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
  #1  
Old 06-27-2017, 09:00 PM
Eealer
Fire Beetle
 
Join Date: Jul 2016
Location: Alberta, Canada
Posts: 29
Default NPC Script - only casting 1 spell of many

Hello again,

Is there some way that I can make my NPC cast a series of spells without using selfcast? I finally got "CastSpell" to work but in the section of the code I am testing, the NPC will only cast the first spell and then stop. Does anyone have any suggestions for how I can make it continue casting all of the spells in its cast list?

Code:
sub EVENT_SAY
{
	my $Buff = quest::saylink("Buffs", 1);
	my $heal = quest::saylink("Healing", 1);


		if($text=~/Hail/i)
		{
			$client->Message(315, "Hello, $name. Do you need some $Buff? Or maybe you're in need of some $heal?'");
		}
		
		if($text=~/Healing/i)
		{
			$npc->CastSpell(13);
			$client->Message(315, "You have been healed, $name");
		}

		if($text=~/Buffs/i) 
		{			

				
				if ($ulevel >= "61") 
				{
					$npc->CastSpell(5257, $userid);
					$npc->CastSpell(5258, $userid);
					$npc->CastSpell(5261, $userid);
					$npc->CastSpell(60, $userid);
					$npc->CastSpell(61, $userid);
					$npc->CastSpell(62, $userid);
					$npc->CastSpell(63, $userid);
					$npc->CastSpell(64, $userid);
					$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
				}
				if (($ulevel >= "47") && ($ulevel < "61")) 
				{
					$npc->CastSpell(3467, $userid);
					$npc->CastSpell(3472, $userid);
					$npc->CastSpell(4091, $userid);
					$npc->CastSpell(3469, $userid);
					$npc->CastSpell(60, $userid);
					$npc->CastSpell(61, $userid);
					$npc->CastSpell(62, $userid);
					$npc->CastSpell(63, $userid);
					$npc->CastSpell(64, $userid);
					$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
				}
				if ($ulevel == "46") 
				{
					$npc->CastSpell(3467, $userid);
					$npc->CastSpell(3472, $userid);
					$npc->CastSpell(4091, $userid);
					$npc->CastSpell(1548, $userid);
					$npc->CastSpell(60, $userid);
					$npc->CastSpell(61, $userid);
					$npc->CastSpell(62, $userid);
					$npc->CastSpell(63, $userid);
					$npc->CastSpell(64, $userid);
					$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
				}
				if ($ulevel == "45") 
				{
					$npc->CastSpell(1447, $userid);
					$npc->CastSpell(3576, $userid);
					$npc->CastSpell(4090, $userid);
					$npc->CastSpell(1548, $userid);
					$npc->CastSpell(60, $userid);
					$npc->CastSpell(61, $userid);
					$npc->CastSpell(62, $userid);
					$npc->CastSpell(63, $userid);
					$npc->CastSpell(64, $userid);
					$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
				}
				if ($ulevel >= "43") 
				{
					$npc->CastSpell(3692, $userid);
					$npc->CastSpell(3576, $userid);
					$npc->CastSpell(4090, $userid);
					$npc->CastSpell(1548, $userid);
					$npc->CastSpell(60, $userid);
					$npc->CastSpell(61, $userid);
					$npc->CastSpell(62, $userid);
					$npc->CastSpell(63, $userid);
					$npc->CastSpell(64, $userid);
					$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
				}
				if ($ulevel <= "42") 
				{
					$npc->CastSpell(3692, $userid);
					$npc->CastSpell(3576, $userid);
					$npc->CastSpell(4089, $userid);
					$npc->CastSpell(63, $userid);
					$npc->CastSpell(64, $userid);
					$npc->CastSpell(61, $userid);
					$npc->CastSpell(60, $userid);
					$npc->CastSpell(62, $userid);
					$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
				}
			}
		}
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 12:01 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