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 |
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?
|
then this shold work right?
Code:
my $npc_target = $client->GetTarget(); $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 |
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 |
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:
|
yeah that worked GetID()
thanks dude! you are teh m45t3r of p3r1 |
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!
|
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.
|
All times are GMT -4. The time now is 10:18 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.