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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 12-16-2010, 08:58 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Here is one way to do it:

Code:
sub EVENT_SPAWN {
	quest::setnexthpevent(98);
}

sub EVENT_HP {
	if($hpevent <= 98)
	{
		quest::shout("Roar Mother *******!!");
		my $NPCTarget = $npc->GetTarget(); # Get the NPC's Target
		# Make sure they have a target before getting the ID, or the zone could crash
		if ($NPCTarget)
		{
			my $TargetID = $NPCTarget->GetID();
			$npc->CastSpell(21439, $TargetID);
		}
	}

}
I always just use this simple plugin I made a while back for casting on the NPC's target:

Code:
#Usage: plugin::CastOnTarget(spellid);
# This can be used anywhere, but is best used from events
# that don't export a $client value such as EVENT_TIMER.
# This simply tries to get the NPCs target and then casts
# the spell on them if it has a target

sub CastOnTarget {

	my $npc = plugin::val('$npc');
	my $CastSpellID = $_[0];	#Use the Spell ID Supplied to the Function - "$_[0]" means to use the first argument given
	my $Cur_Target = $npc->GetTarget();	#Get the current Target for this NPC
	if ($Cur_Target && ($Cur_Target->IsNPC() || $Cur_Target->IsClient())) {	#Only cast if the NPC actually has a Target
		my $My_Target = $Cur_Target->GetID();	#Get the Entity ID of the Target
		$npc->CastSpell($CastSpellID, $My_Target, 11);	#Cast the requested Spell ID on the NPC's Target
		# Note: Uses slot 11 argument to prevent fizzling from ever happening
	}
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 12-17-2010 at 10:52 PM..
Reply With Quote
 


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 05:19 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