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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2009, 07:56 PM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default NPC's finding other NPC's $x,$y,$z

i'd like to request somethin to the effect of $npc->$GetNpcX(NPCID); i'm wantin to use it to update npc positions based on the discussion here. think it would be a viable addition, and could be used for other purposes as well.
__________________
Server Op of Bonds of Strength(custom-Legit)
Reply With Quote
  #2  
Old 10-23-2009, 08:28 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

There are already a couple ways to accomplish this, we don't need another.
Reply With Quote
  #3  
Old 10-23-2009, 08:37 PM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

could you please explain how? i've been trying everything, and apparently noone else knows of a way to do so, based on the answers provided on the forums, and IRC.
__________________
Server Op of Bonds of Strength(custom-Legit)
Reply With Quote
  #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
  #5  
Old 10-23-2009, 09:43 PM
nightsta69
Hill Giant
 
Join Date: May 2005
Posts: 134
Default

thank you KLS, i've been at this all day, and noone knew this lol. another learning experience.
__________________
Server Op of Bonds of Strength(custom-Legit)
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 03:34 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