View Single Post
  #2  
Old 07-11-2007, 05:32 PM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

You would need to write it:

Code:
sub EVENT_SAY {
if ($text=~/hail/i)  {
quest::say("Welcome warrior,youve bested the guards now i suppose you have [come for me]?");
}

if($text=~/come For me/i) {
quest::say("Prepare for death foolish mortal!!!");
quest::attack($name);
quest::setnexthpevent(90);
}
}


sub EVENT_HP  { 
if($hpevent <= 90)  {
quest::shout("Keldovan!!");
quest::spawn2(317005,0,0,$x+20,$y+20,$z,$h);
quest::setnexthpevent(85);}
} 

if($hpevent <= 85)  {
quest::shout("Hanvar!!!");
quest::spawn2(317004,0,0,$x+20,$y+20,$z,$h);
quest::setnexthpevent(50);
} 
}
For this, you'll want to be sure to do add an action in this same format for hp events at 50 since you call for it in the script.

However, I would recommend this way to ensure the npcs attack correctly:

Code:
sub EVENT_SAY {
if ($text=~/hail/i)  {
quest::say("Welcome warrior,youve bested the guards now i suppose you have [come for me]?");
}

if($text=~/come For me/i) {
quest::say("Prepare for death foolish mortal!!!");
quest::attack($name);
quest::setnexthpevent(90);
}
}


sub EVENT_HP  { 
if($hpevent <= 90)  {
quest::shout("Keldovan!!");
$entid1 = quest::spawn2(317005,0,0,$x+20,$y+20,$z,$h);
$mob1 = $entity_list->GetMobID($entid1);
$mobnpc1 = $mob1->CastToNPC();
$mobnpc1->AddToHateList($npc->GetHateTop(),1);
quest::setnexthpevent(85);}
} 

if($hpevent <= 85)  {
quest::shout("Hanvar!!!");
$entid2 = quest::spawn2(317004,0,0,$x+20,$y+20,$z,$h);
$mob2 = $entity_list->GetMobID($entid2);
$mobnpc2 = $mob2->CastToNPC();
$mobnpc2->AddToHateList($npc->GetHateTop(),1);
quest::setnexthpevent(50);
} 
}
This would ensure thep erson with the most hate gets the adds when they spawn. Nothing worse than the add picking off the group's cleric.
Reply With Quote