View Single Post
  #13  
Old 05-16-2011, 11:32 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by trevius View Post
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);
	}
}
oh, so i can put that on my other mobs not liabach and it will work the same?

the other mobs are immune to melee, only damaged by spells
Reply With Quote