View Single Post
  #1  
Old 02-18-2015, 05:45 PM
Greyhelm's Avatar
Greyhelm
Sarnak
 
Join Date: Jul 2009
Location: East Coast
Posts: 35
Default Making an NPC and Client stop attacking

I have a problem in a script,

Code:
sub EVENT_SPAWN{
  quest::emote("text");
  quest::setnexthpevent(45);
  }
sub EVENT_SAY{
  if($text=~/text/i){
    quest::say("respone");
    }
}
sub EVENT_HP{
  if($hpevent <=45){
    $npc->SetBodyType(11); #make untargettable to stop client attack
    $npc->WipeHateList(); #remove hatelist 
    $npc->DisableMelee(1); #ensure npc cannot attack further
    quest::emote("mob gives up");
    quest::say("this line links to EVENT_SAY text");
    $npc->SetBodyType (3); #To be able to target again for quest say
    $npc->WipeHateList(); #ensure hatelist wiped to enable dialogue
    }
}
The npc stops attacking and client stops attacking, but if I do #hatelist on npc it shows client is still on hatelist though damage is low and hate is low. Example -name: Greyhelm, damage:301, hate:16
When I had to do 20,120 damage just to get the npc to 45% to trigger HP_Event. Any thoughts or did I miss something in my script?

If event is triggered and client is say triple attacking would that cause this?
Reply With Quote