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 01-12-2011, 06:49 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Quote:
Originally Posted by Caryatis View Post
Also if you dont want them to actually cast the spell, use CastSpell(xxx, blah, 10, 0, 0); the 10 is slot(not really important except its not a spell gem), then its cast time and mana usage or vice versa.
Not quite following you here. Are you saying

$ent->CastSpell(2570, $ent, 10, -1, -1)

or

$npc->CastSpell(2570, $ent, 10, -1, -1)

or

CastSpell(2570, $ent, 10, -1, -1)

Because the last does nothing for me.
Reply With Quote
  #2  
Old 01-13-2011, 03:30 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

My post on the second page of this thread might have some useful script bits for what you are wanting to do:

http://www.eqemulator.org/forums/sho...t=32605&page=2

An MPG would basically be the same code as in my CastOnGroup() plugin code in that thread, accept you should just have to remove all of the group check stuff.


One thing is that I believe CastSpell() can only do 1 target at a time. If the NPC is casting the spell on all of the AE targets, it is probably only going to land on 1 of them. In cases where you want multiple spells cast from the same mob at once, you should use SpellFinished():

Code:
SpellFinished(spell_id, spell_target = this, mana_cost = 0)

An example for your loop would be:

Code:
$npc->SpellFinished(1111, $ent);
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 01-13-2011, 11:46 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

I somehow missed this answer to my post. Dude that works awesome, now it shows the NPC casting the spell. I went ahead and changed my other scripts to this ! You are awesome !

Update:

I notice that this works with something like Skin like Nature, but with an NPC casting KEI will not work and I have to do a $ent->CastSpell(2570, $ent, 10, -1, -1)

I am guessing this is because of what you said here.

Quote:
One thing is that I believe CastSpell() can only do 1 target at a time. If the NPC is casting the spell on all of the AE targets, it is probably only going to land on 1 of them. In cases where you want multiple spells cast from the same mob at once, you should use SpellFinished():
Reply With Quote
  #4  
Old 01-14-2011, 03:50 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I don't know why that wouldn't work for KEI offhand. Should work fine.

Also, if you want the NPC to cast the spell, you want to use this instead:

Code:
$npc->CastSpell(2570, $ent, 10, -1, -1);
Though, doing that will limit the NPC to only being able to cast on 1 target at a time. That is why I recommended SpellFinished().
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 01-14-2011, 09:20 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Not sure but with KEI she cast it on herself, but not me.
Reply With Quote
  #6  
Old 01-14-2011, 03:14 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

This is the block of code I am working with.

Code:
		my @moblist = $entity_list->GetMobList();
		foreach $ent (@moblist)
		{
			my $dist = $ent->CalculateDistance($npc->GetSpawnPointX(),$npc->GetSpawnPointY(),$npc->GetSpawnPointZ());
			my $level = $ent->GetLevel();
			if(int($dist)<100 && $level>=45 && $ent->IsClient())
			{
				#$npc->SpellFinished(2570, $ent);
				$npc->CastSpell(2570, $ent, 10, -1, -1)
			}
			elsif(int($dist)<100 && $level<45 && $ent->IsClient())
			{	
				quest::say("Sorry " . $ent->GetCleanName() . " you are too low to recieve this spell");
			}
		}
With either what you see, or un-remarking the other line of code, both she will cast on herself. If I change the $npc to $ent I will cast the spell on myself. If I change the spell to Skin like Nature it works fine, but KEI she will always cast on herself. My memory may be off but you had to be grouped to get KEI in Live, so I think this would make sense correct ? So essentially no matter who you have targetted it would only effect you and your group.
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 08:44 PM.


 

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