Expletus
09-14-2011, 01:42 AM
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?
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);
}
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);
}