Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPCs Talk When Attacked
#1
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.
Reply
#2
Should it also be in CanAttackNPcWithArrows sub?
Reply
#3
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)