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 09-14-2011, 01:42 AM
Expletus
Hill Giant
 
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
Default Spawn2 // Itemturn in

Was trying to get an npc to assign the task (which it did) and upon turn in of 4 of the same item it would depop and spawn another mob in its place. Tried several variations and just couldn't figure this out. Where did I go wrong? The elseif part?

Code:
sub EVENT_SAY {
 
	my $help = quest::saylink("help");
	my $assist = quest::saylink("assist");

	$client->Message(7, "-");
	my $NPCName = $npc->GetCleanName();

	if (quest::istaskactive(226) || quest::istaskcompleted(226))
	{
		$client->Message(315, "$NPCName whispers to you, 'What are you waiting for? Don't make me skunk you up.");
	}
	else
	{
		if ($text =~/Hail/i)
		{
			$client->Message(315, "$NPCName whispers to you, 'Please wait, $name! I need your [$help].");
		}

		if ($text =~/help/i)
		{
			$client->Message(315, "$NPCName whispers to you, 'I was turned into a skunk by Xalgoz when they invaded. Since I dabbled in some magic, I know essence of shadow can reverse this particular spell. If you can [$assist] me and bring me 4 essences, I will give this shiney thing I found.");
		}

		if ($text =~/assist/i)
		{
			$client->Message(315, "$NPCName whispers to you, 'Bring me 4 of those essences and please do hurry.");
			quest::assigntask(226);
		}
	}

}

sub EVENT_ITEM 
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	$z = $npc->GetZ();
	$h = $npc->GetHeading();
	$entid1 = quest::spawn2(58083,0,0,$x,$y,$z,$h);
  
  if (plugin::check_handin(\%itemcount, 119782=> 4))
    {
      quest::spawn2(58083,0,0,$x,$y,$z$h);
      quest::shout2("Fool you have unleashed me!");
      quest::ding ();
      quest::depop(58082);
    }
  elsif(plugin::check_handin(\%itemcount, $_=> 1)) 
    {
	$client->Message(315, "$NPCName whispers to you, 'Not quite there yet, ace.");
	quest::summonitem($turnins[$i]);
   		}
   plugin::return_items(\%itemcount);

}
__________________
Expletus / Volgar
Reply With Quote
  #2  
Old 09-14-2011, 02:13 AM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 656
Default

You are missing a comma in
Code:
      quest::spawn2(58083,0,0,$x,$y,$z$h);
Reply With Quote
  #3  
Old 09-14-2011, 09:03 AM
Expletus
Hill Giant
 
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
Default

my God... 2 hours of fiddling and it's a comma... lol thank you !
__________________
Expletus / Volgar
Reply With Quote
  #4  
Old 09-14-2011, 09:53 AM
Expletus
Hill Giant
 
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
Default

Alright, so it was working somewhat and I am running into the following issues:

1. Spawns 2 of the mobs on turn in
2. Spawns the mob when given less than 4 items but stays up
3. Gives double message when less than 4 items turned in
4. Upon completion, it's crashing the zone - log back in and task rewards is on cursor

Am I missing some particular rule code ? (I only changed the bottom code and the top remains the same).

Code:
sub EVENT_ITEM 
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	$z = $npc->GetZ();
	$h = $npc->GetHeading();
	$entid1 = quest::spawn2(58083,0,0,$x,$y,$z,$h);
  
  if (plugin::check_handin(\%itemcount, 119782=> 4))
    {
      quest::spawn2(58083,0,0,$x,$y,$z,$h);
      quest::shout2("Fool you have unleashed me!");
      quest::depop(58082);
    }
  else
    {
	$client->Message(315, "$NPCName whispers to you, 'Not quite there yet, ace.");
        plugin::return_items(\%itemcount);
    }

}
__________________
Expletus / Volgar
Reply With Quote
  #5  
Old 09-14-2011, 10:22 AM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

Your spawn command is outside of the if statements so any turn in is going to trigger it.
Reply With Quote
  #6  
Old 09-14-2011, 01:32 PM
Expletus
Hill Giant
 
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
Default

I'm confused what you mean. The spawn2 comes after

Code:
if (plugin::check_handin(\%itemcount, 119782=> 4))
    {
      quest::spawn2(58083,0,0,$x,$y,$z,$h);
So shouldn't it only trigger if the requirement is met, else it won't fire off?
__________________
Expletus / Volgar
Reply With Quote
  #7  
Old 09-14-2011, 01:49 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

Code:
sub EVENT_ITEM 
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	$z = $npc->GetZ();
	$h = $npc->GetHeading();
	$entid1 = quest::spawn2(58083,0,0,$x,$y,$z,$h);
  
	if (plugin::check_handin(\%itemcount, 119782=> 4)) {...}
	else {...}

}
Reply With Quote
  #8  
Old 09-15-2011, 09:42 AM
Expletus
Hill Giant
 
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
Default

Def. thought that was part of the top code needed. Didn't realize it was an actual code line.. thank you !
__________________
Expletus / Volgar
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 09:33 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