View Single Post
  #1  
Old 05-22-2013, 12:48 AM
thepoetwarrior
Discordant
 
Join Date: Aug 2007
Posts: 307
Question Level of $npc->GetTarget() ?

I know $ulevel gets the level of the player when doing something to the npc like EVENT_SAY but what about when the player isn't doing anything?

More specifically, get the level of a player from the target of the boss?

For example, I have code to get the npc target id for casting a spell on it (nuke main tank in boss event script). How would I get the level of the bosses target?

Code:
my $SPELL_ID 	= quest::ChooseRandom(12505, 12506, 12507);
my $NPC_TARGET 	= $npc->GetTarget();
my $TARGET_ID	= $NPC_TARGET->GetID();
$npc->CastSpell($SPELL_ID,$TARGET_ID);
Reply With Quote