Mirage Engine
NPCs Talk When Attacked - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: NPCs Talk When Attacked (/showthread.php?tid=486)



NPCs Talk When Attacked - Tutorial Bot - 17-12-2006

Author: Izzy545
Difficulty: 1/5

:: SERVER SIDE ::

In sub CanAttackNpc, under "' Make sure they are on the same map", in the select case statement, for all directions replace:
Code:
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:
Code:
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
Remember to replace the code for all directions, i.e: Case DIR_UP, Case DIR_DOWN, etc.


Re: NPCs Talk When Attacked - ShadowMaster - 05-11-2007

Should it also be in CanAttackNPcWithArrows sub?


Re: NPCs Talk When Attacked - William - 05-11-2007

ShadowMaster Wrote:Should it also be in CanAttackNPcWithArrows sub?
Yeah it should, although I don't see how anybody would want to talk if they get a arrow in them Tongue