View Single Post
  #12  
Old 05-16-2011, 11:27 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Try something like this, where 999424 is the NPCID of your main boss, which I assume is named Laibach. This script would be placed on each of your add NPCs. This assumes that they are attacked as well, to trigger this event, otherwise you can just signal them from your main boss to trigger this same bit of code instead.

Code:
sub EVENT_ATTACK {

	# Get Laibach if he is up
	my $laibach = $entity_list->GetMobByNpcTypeID(999424);
	# Make sure you got him before using $laibach as a pointer
	if($laibach)
	{
		# Get a random entry on Laibach's hate list
		my $HateTarget = $laibach->GetHateRandom();
		# Get the ID of that hate entry for use with CastSpell
		my $HateTargetID = $HateTarget->GetID();
		# Cast a spell on the random hate target (Courage in this example)
		$npc->CastSpell(11, $HateTargetID);
	}
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote