Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #16  
Old 09-18-2012, 11:15 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i just realized that it's likely because the npc's target is at the top of the hate list (the first entity in the array), and the loop you have is trying to get the npc to cast the spell on a new target while he's still casting on the first one.

you could attempt to address this by putting a delay (sleep($seconds)) equal to the cast time of the spell in the loop (you'd want to place it after the casting has begun). you could also check $npc->IsCasting() periodically to see if you needed to continue on to the next target. that way you wouldn't have a lengthy delay between casts if the cast was ever interrupted by the players. i'm not sure what sort of load that would cause on the server, however.

DUH.

or you could set the cast time to 0 in CastSpell()... i forgot that one.

CastSpell(spell_id, target_id, slot= 10, casttime= -1, mana_cost= -1)
Reply With Quote
  #17  
Old 09-19-2012, 01:52 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

The spell didn't have a cast time in the first place. I couldn't get it to work with npc->CastSpell, but for some reason, quest::castspell works perfectly.
Reply With Quote
  #18  
Old 09-19-2012, 10:45 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

in the source code, quest::castspell() calls Mob::SpellFinished() while $npc->CastSpell() calls Mob::CastSpell(). i haven't looked over the source to be able to tell you exactly what the difference is, nor do i know the benefits of using one instead of the other (except for the fact that only one is working for you).
Reply With Quote
  #19  
Old 09-19-2012, 11:53 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

looks like quest::castspell() skips a lot of the validation checks (movement, stun, combat, etc) and timers involved with spell casting. i'm going to have to guess that the problem with using $npc->CastSpell() is still timer related, since it hits one target when you use it. otherwise, clients would probably see interruption messages while in combat with the npc in question.
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 06:03 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3