EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Making an NPC and Client stop attacking (https://www.eqemulator.org/forums/showthread.php?t=39387)

Greyhelm 02-18-2015 05:45 PM

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?

Maceblade 02-19-2015 09:02 AM

Quote:

if ($hpevent <= 45) {
quest::emote("shakes with laughter and says, 'You are much stronger than I thought. I give up.");
quest::modifynpcstat("special_attacks",ABfHG);
quest::settimer(1,60);
$npc->WipeHateList();
}
This will keep it targetable just sets it immune. This is what I used for one of my bosses but I removed a bunch of stuff.

Greyhelm 02-19-2015 12:44 PM

That worked like a charm.. I tried that before but now I see I was trying $npc->modifynpcstats not quest::modifynpcstats... Thanks!


All times are GMT -4. The time now is 04:55 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.