$npc->castSpell(ID,Spell); not working
I don't know why, but I can't seem to get this command working. I have also tried quest::castspell(ID,Spell); but that doesn't seem to work in this quest either. I'm not quite sure what is wrong. This is an NPC that is supposed to be spawned during an event and then switch textures a few times and then depop and cause a really nasty AE if it isn't killed before the last timer finishes. It goes through all of the timers, but stops working on the last one. Though, if I remove "$npc->castSpell($client,6536);" the script completes as it should.
I have it set the variable $client to equal userid so that I am sure it is passing that info into the command. I am testing this with my GM char, but I have tried with invuln on or invuln off and with or without attacking the NPC. I can't get it to work no matter what I have tried. Code:
#Explosive Storm |
i think you have the args swapped.
$npc->CastSpell(1948, $charid, 10, -1, -1); args are spellid, targetid is working in one of my scripts... maybe $charid instead of $userid? not sure if case sensitive castSpell vs CastSpell |
Ya, I am just going off of the wiki here:
http://www.eqemulator.net/wiki/wikka...=QuestTutorial Which says to do it this way: Code:
quest::castspell(id,spellid) - Casts "spell" on entity with "id". This is buggy, if it does not work try $npc->CastSpell(id,spellid); The Quest Object Wiki says to do it the way you mentioned: http://www.eqemulator.net/wiki/wikka...a=QuestObjects Code:
$npc->CastSpell(spellid,userid); (I found some strange bugs with quest::castspell() and all of these where resolved by using the object...) |
Oh, it is the case sensitive issue lol. I am using GoergeS' Quest Editor Tool and it is changing this:
Code:
$npc->CastSpell(6536, $userid); Code:
$npc->castSpell(6536, $userid); |
This works on TGC:
Code:
$npc->CastSpell(17,$userid); #Light Healing |
It could have been related to that space in between '(6536,' and '$userid)' ; (6536, $userid).
or any other invisible character that got caught up in the script ( if you copy-pasted it). I've wasted days on scripts only to find out they were always good, just had unknown, invisible characters (usually when I copy-paste stuff). This program; Perl Editor by EngInSite is for windows (although i can run it with Wine too), is free and has an option to show all hidden characters in the script. |
No, it was the case sensitive issue that I already posted about 2 posts up :P It has been resolved and GeorgeS already fixed it in his quest editor. His tool was changing the case of the letter C to lowercase, which is why it wasn't working. Resolved now, thanks!
|
All times are GMT -4. The time now is 06:36 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.