Print Page | Close Window

Talking NPCs

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=128
Printed Date: 20 December 2006 at 5:52pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Talking NPCs
Posted By: Sync
Subject: Talking NPCs
Date Posted: 11 February 2006 at 2:39pm
Difficulty: Easy 1/5

Originaly Posted By: Izzy545

Talking NPCs
 
I couldn't see this tutorial on here, so forgive me if it's already up...

It's all server side code.

Find the sub called CanAttackNpc under modGameLogic

Under the comment: ' Make sure they are on the same map

is a Select Case and Cases.

For all directions replace:

If Npc(NpcNum).Behavior <> NPC_BEHAVIOR_FRIENDLY And Npc(NpcNum).Behavior <> NPC_BEHAVIOR_SHOPKEEPER Then
      CanAttackNpc = True
Else
      Call PlayerMsg(Attacker, "You cannot attack a " & Trim(Npc(NpcNum).Name) & "!", BrightBlue)
End If

with

If Npc(NpcNum).Behavior <> NPC_BEHAVIOR_FRIENDLY And Npc(NpcNum).Behavior <> NPC_BEHAVIOR_SHOPKEEPER Then
      CanAttackNpc = True
Else
      Call PlayerMsg(Attacker, Trim(Npc(NpcNum).Name) & " says: '" & Trim(Npc(NpcNum).AttackSay) & "'", BrightBlue)
End If

That's all you have to do!

Remember to replace the code for all directions, i.e: Case DIR_UP, Case DIR_DOWN, etc.



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info