EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   GetLevel() of target in perl? (https://www.eqemulator.org/forums/showthread.php?t=43236)

Bytebait 03-14-2021 10:59 PM

GetLevel() of target in perl?
 
How can I get the target of a NPC/MOB that isn't in combat, only targeted by the client? I see how to grab the entity on a hate list but not while out of combat.

I would like to make an item that 'warns' the player how deep into red an encounter is.

something like so. But I don't know what $targeted is.
Code:

sub EVENT_ITEM_CLICK{

$mob_level = $targeted->GetLevel();
$client->Message(15, "The mob is level " + $mob_level + " .");

}


Splose 03-15-2021 01:30 AM

Quote:

Originally Posted by Bytebait (Post 266385)
How can I get the target of a NPC/MOB that isn't in combat, only targeted by the client? I see how to grab the entity on a hate list but not while out of combat.

I would like to make an item that 'warns' the player how deep into red an encounter is.

something like so. But I don't know what $targeted is.
Code:

sub EVENT_ITEM_CLICK{

$mob_level = $targeted->GetLevel();
$client->Message(15, "The mob is level " + $mob_level + " .");

}


Code:

my $target = $client->GetTarget();
my $target_level = $target->GetLevel();

You also need to make sure that you have the item connected to a script.

Bytebait 03-15-2021 01:28 PM

Quote:

Originally Posted by Splose (Post 266386)
Code:

my $target = $client->GetTarget();
my $target_level = $target->GetLevel();

You also need to make sure that you have the item connected to a script.

Right on! That worked. Thank you.


All times are GMT -4. The time now is 07:48 AM.

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