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

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

09-14-2011, 02:13 AM
|
Dragon
|
|
Join Date: Dec 2008
Location: Tennessee
Posts: 656
|
|
You are missing a comma in
Code:
quest::spawn2(58083,0,0,$x,$y,$z$h);
|

09-14-2011, 09:03 AM
|
Hill Giant
|
|
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
|
|
my God... 2 hours of fiddling and it's a comma... lol thank you !
__________________
Expletus / Volgar
|

09-14-2011, 09:53 AM
|
Hill Giant
|
|
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
|
|
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
|

09-14-2011, 10:22 AM
|
Dragon
|
|
Join Date: May 2009
Location: Milky Way
Posts: 539
|
|
Your spawn command is outside of the if statements so any turn in is going to trigger it.
|

09-14-2011, 01:32 PM
|
Hill Giant
|
|
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
|
|
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
|

09-14-2011, 01:49 PM
|
Dragon
|
|
Join Date: May 2009
Location: Milky Way
Posts: 539
|
|
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 {...}
}
|

09-15-2011, 09:42 AM
|
Hill Giant
|
|
Join Date: Jan 2010
Location: Baltimore Maryland
Posts: 152
|
|
Def. thought that was part of the top code needed. Didn't realize it was an actual code line..  thank you !
__________________
Expletus / Volgar
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 09:33 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |