Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2021, 10:59 PM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default 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 + " .");

}
Reply With Quote
  #2  
Old 03-15-2021, 01:30 AM
Splose's Avatar
Splose
Discordant
 
Join Date: Apr 2014
Posts: 279
Default

Quote:
Originally Posted by Bytebait View Post
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.
Reply With Quote
  #3  
Old 03-15-2021, 01:28 PM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default

Quote:
Originally Posted by Splose View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:19 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3