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 12-30-2012, 06:04 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default I'm stumped - can't seem to get $target or $npc with player event say

Hello everyone,

The new feature where the server parses # text freely spoken by players... doesn't seem to work properly.

namely....
$target and or $npc are not being passed;

I want to use the # to cast spells on an npc or player I have targeted. But I cannot. (I can do self cast or cast ae stuff, but that is not what i want)

If anyone has any quick tips here i'd appreciate it.. Ive been at it for hours trying to sort it out (facepalm?)

I know when i'm beat. I will post more details later if that isnt enough information to go on.

Thanks,

Davood
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator

Last edited by Davood; 12-30-2012 at 06:06 AM.. Reason: bad thread title
Reply With Quote
  #2  
Old 12-30-2012, 01:10 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i don't think $npc will be passed because it's an event that exists in a player quest and i believe that object only exists on npc quests. as far as $target is concerned, does $client->GetTarget() not work?
Reply With Quote
  #3  
Old 12-30-2012, 02:27 PM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

then this shold work right?

Code:
my $npc_target = $client->GetTarget();
my $mon_target = $npc_target->GetMobID();
$client->CastSpell($a_cast_buff,$mon_target,10,0,0);
it doesn't i'm not sure why

$a_cast_buff is some spell id value (i outputted it to make sure it was valid)

casting on $clientid works with the same $client->Cast. etc code
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #4  
Old 12-30-2012, 02:39 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i'd start by testing the return value of GetTarget(). this should evaluate to true if you've got anything targeted:

Code:
ref($client->GetTarget()) =~ /Mob/i
if it's false, then GetTarget() isn't returning a Mob object
Reply With Quote
  #5  
Old 12-30-2012, 02:52 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i think i know what the problem is. GetMobID() isn't what you want. you should be using GetID(). GetMobID() returns a Mob object (don't ask me why, because it doesn't make any sense to me either) and is an $entity_list method, not a $mob method.

EDIT: i updated the QuestObject method list on the wiki at revision 2264, so some things have been moved/removed/added fairly recently. i used python scripts to parse the information so i didn't have to do it all by hand. i'll likely be updating it this way every few weeks and adding additional information to each entry when i have time (and motivation).

Quote:
Originally Posted by Davood View Post
then this shold work right?

Code:
my $npc_target = $client->GetTarget();
my $mon_target = $npc_target->GetMobID();
$client->CastSpell($a_cast_buff,$mon_target,10,0,0);
it doesn't i'm not sure why

$a_cast_buff is some spell id value (i outputted it to make sure it was valid)

casting on $clientid works with the same $client->Cast. etc code
Reply With Quote
  #6  
Old 12-30-2012, 03:12 PM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

yeah that worked GetID()

thanks dude! you are teh m45t3r of p3r1
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #7  
Old 12-30-2012, 03:13 PM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

and upon directory searching with notepad++ i did find evidence of GetMobID() only being used with list entities and it made me a little apprehensive!
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #8  
Old 12-30-2012, 03:18 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i think $entity_list->GetMobID() and $entity_list->GetMobByID() do the same thing, but i haven't looked into it enough to find out for sure yet.
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 01:02 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