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 04-13-2011, 05:05 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Well, right off the bat, I see quite a few issues with your script snippets. Part of the problem is that you broke the script up and didn't show the entire script, so it is really hard to tell you for sure where all of your issues are.

For one thing, if you want an NPC to be able to cast more than 1 spell at a time, you should use the following command:

Code:
SpellFinished(spell_id, spell_target = this, mana_cost = 0)
Only 1 spell can be cast at a time, so if you use something like CastSpell(), it will only be able to cast the first cast and then fail any following casts until the first one is completely done casting.

Another issue is you seem to be confused on the idea of entity IDs vs getting the actual mob itself. When using CastSpell(), it requires the entity ID, not the actual mob or NPC Type ID, which Caryatis already mentioned a bit.

Code:
CastSpell(spell_id, target_id, slot= 10, casttime= -1, mana_cost= -1)
The target_id field there is for entity ID only and it will fail if you don't set that to a valid ID. To get the Entity ID is easy though, as you just need to do something like this:

Code:
my $NPC_ID = $npc->GetID();
That will get a number between 1 and about 1600, but more likely less than 300 depending on how many NPCs/Clients you have in the zone. Each mob gets it's own unique ID, and that is what the number is.

You could then do this:

Code:
$npc->CastSpell(11, $NPC_ID);
And that should work.

Also, before you try to do something like this:

Code:
$selfEntity->GetID()
Always make sure the $selfEntity variable was set to a valid mob before using it as a pointer or you will likely run into zone crashes. If you are saving variables like that in timers and using them again later, you run into even more potential crash issues. If you must do that, you should save the entity ID and then get the mob by entity ID again later when you need it again to verify the mob still exists in the zone.

There are a few other issues I can guess you have in that script, but I can't say for sure without seeing the whole script.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:15 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