Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-23-2009, 09:10 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

The first step is to get the npc, the second step is to get the locations.

I can think of two ways to do this, the first with $entity_list and the second with $entity_list and list iteration:
Code:
    my $x_loc = 0;
    my $y_loc = 0;
    my $z_loc = 0;
    my $target_to_follow = $entity_list->GetMobByNpcTypeID(12345);
    if($target_to_follow)
    {
        $x_loc = $target_to_follow->GetX();
        $y_loc = $target_to_follow->GetY();
        $z_loc = $target_to_follow->GetZ();
    }
Code:
    my $x_loc = 0;
    my $y_loc = 0;
    my $z_loc = 0;
    my @npclist = $entity_list->GetNPCList();
    foreach $ent (@npclist)
    {
        if($ent->GetNPCTypeID() == 12345)
        {
            $x_loc = $ent->GetX();
            $y_loc = $ent->GetY();
            $z_loc = $ent->GetZ();
            last;
        }
    }
I suggest the first one in this case because it's less complicated and a little faster code wise, the second is more for if there's more than one target you want to track easily.
Reply With Quote
 


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 11:35 AM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3