EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Last touch on this wont work (https://www.eqemulator.org/forums/showthread.php?t=38860)

scrubtasticx 10-03-2014 08:24 PM

Last touch on this wont work
 
So i made a quest EVERYTHING works on it BUT the quest::summonitem part i have even added a check to make sure that section is working and it is.. the npc just wont summon the item any ideas where i went wrong?

Code:

sub EVENT_SAY
{
my $weapon = quest::saylink ("weapon");

        if ($text =~/Hail/i && !defined $qglobals{"Epic"})
        {
        quest::say("Hello $name, Along my journies i have aquired knowledge on how to create a [$weapon] with power like none seen before.");
        }
       
        if ($text =~/weapon/i)
        {
        quest::say("In order for me to make you this special weapon i need a few items. The first item I need is a greatsword from Acryila Caverns.");
        }
       
        elsif ($qglobals{"Epic"} == 1)
                {
                quest::say("The next item you need is an eye from a evil unicorn in Lesser Faydark.");
            }
               
        elsif ($qglobals{"Epic"} == 2)
                {
                quest::say("The next item i need is a Polished Shard from Droga.");
            }
               
                elsif ($qglobals{"Epic"} == 3)
                {
                quest::say("The next item i need is a Sphere of Sandstorm from Bastion of Thunder.");
            }
               
                elsif ($qglobals{"Epic"} == 4)
                {
                quest::say("The next item I need is dryad parts from Jagged Pine Forest.");
            }
               
                elsif ($qglobals{"Epic"} == 5)
                {
                quest::say("The next item i need is werewolf talon from Castle Mistmoore.");
            }
               
                elsif ($qglobals{"Epic"} == 6)
                {
                quest::say("The next item i need is a snowball from permafrost.");
            }
               
                elsif ($qglobals{"Epic"} == 7)
                {
                quest::say("This last part will not be so easy. I need Kallis' Head.");
            }
               
                elsif (($class eq "Wizard") && ($qglobals{"Epic"} == 8))
                {
                $client->Message(315, "$NPCNAME whispers to you, 'Congrats on your Epic!'");
                quest::summonitem(32374);
                }
               
        else
        {
        quest::say("you are not a wizard somthing is wrong");
        }
}

sub EVENT_ITEM

{
        if ($item1== 51261 && !defined $qglobals{"Epic"})
        {
    quest::say("This is just what i was looking for! The next item you need is an eye from a evil unicorn in Lesser Faydark.");
        quest::setglobal("Epic", 1, 1, "F");
        }
 
        elsif ($item1== 1815 && ($qglobals {"Epic"} == 1))
        {
        quest::say("Wow you are making incredible time getting me these items. The next item i need is a Polished Shard from Droga.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 81116 && ($qglobals {"Epic"} == 2))
        {
        quest::say("You are getting closer to greatness. The next item i need is a Sphere of Sandstorm from Bastion of Thunder.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 9429 && ($qglobals {"Epic"} == 3))
        {
        quest::say("Incdredible! The weapon is almost complete. The next item I need is dryad parts from Jagged Pine Forest.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 8107 && ($qglobals {"Epic"} == 4))
        {
        quest::say("You are half way there. The next item i need is werewolf talon from Castle Mistmoore.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 13746 && ($qglobals {"Epic"} == 5))
        {
        quest::say("The weapon is starting to glow. The next item i need is a snowball from permafrost.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 19034 && ($qglobals {"Epic"} == 6))
        {
        quest::say("Just one more peice to go. This last part will not be so easy. I need Kallis' Head.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 31420 && ($qglobals {"Epic"} == 7))
        {
        quest::say("That is everything. Give me a few seconds to get your weapon made.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
        }
       
else
        {
        quest::say("I cannot use that at this time. Please give me the items in the correct order as I have instructed.");
        }
sub EVENT_SAY
{
my $weapon = quest::saylink ("weapon");

        if ($text =~/Hail/i && !defined $qglobals{"Epic"})
        {
        quest::say("Hello $name, Along my journies i have aquired knowledge on how to create a [$weapon] with power like none seen before.");
        }
       
        if ($text =~/weapon/i)
        {
        quest::say("In order for me to make you this special weapon i need a few items. The first item I need is a greatsword from Acryila Caverns.");
        }
       
        elsif ($qglobals{"Epic"} == 1)
                {
                quest::say("The next item you need is an eye from a evil unicorn in Lesser Faydark.");
            }
               
        elsif ($qglobals{"Epic"} == 2)
                {
                quest::say("The next item i need is a Polished Shard from Droga.");
            }
               
                elsif ($qglobals{"Epic"} == 3)
                {
                quest::say("The next item i need is a Sphere of Sandstorm from Bastion of Thunder.");
            }
               
                elsif ($qglobals{"Epic"} == 4)
                {
                quest::say("The next item I need is dryad parts from Jagged Pine Forest.");
            }
               
                elsif ($qglobals{"Epic"} == 5)
                {
                quest::say("The next item i need is werewolf talon from Castle Mistmoore.");
            }
               
                elsif ($qglobals{"Epic"} == 6)
                {
                quest::say("The next item i need is a snowball from permafrost.");
            }
               
                elsif ($qglobals{"Epic"} == 7)
                {
                quest::say("This last part will not be so easy. I need Kallis' Head.");
            }
               
                elsif (($class eq "Ranger") && ($qglobals{"Epic"} == 8))
                {
                $client->Message(315, "$NPCNAME whispers to you, 'Congrats on your Epic!'");
                quest::summonitem(1119);
                }
               
        else
        {
        quest::say("you are not a wizard somthing is wrong");
        }
}

sub EVENT_ITEM

{
        if ($item1== 51261 && !defined $qglobals{"Epic"})
        {
    quest::say("This is just what i was looking for! The next item you need is an eye from a evil unicorn in Lesser Faydark.");
        quest::setglobal("Epic", 1, 1, "F");
        }
 
        elsif ($item1== 1815 && ($qglobals {"Epic"} == 1))
        {
        quest::say("Wow you are making incredible time getting me these items. The next item i need is a Polished Shard from Droga.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 81116 && ($qglobals {"Epic"} == 2))
        {
        quest::say("You are getting closer to greatness. The next item i need is a Sphere of Sandstorm from Bastion of Thunder.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 9429 && ($qglobals {"Epic"} == 3))
        {
        quest::say("Incdredible! The weapon is almost complete. The next item I need is dryad parts from Jagged Pine Forest.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 8107 && ($qglobals {"Epic"} == 4))
        {
        quest::say("You are half way there. The next item i need is werewolf talon from Castle Mistmoore.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 13746 && ($qglobals {"Epic"} == 5))
        {
        quest::say("The weapon is starting to glow. The next item i need is a snowball from permafrost.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 19034 && ($qglobals {"Epic"} == 6))
        {
        quest::say("Just one more peice to go. This last part will not be so easy. I need Kallis' Head.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 31420 && ($qglobals {"Epic"} == 7))
        {
        quest::say("That is everything. Give me a few seconds to get your weapon made.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
        }
       
else
        {
        quest::say("I cannot use that at this time. Please give me the items in the correct order as I have instructed.");
        }
plugin::return_items(\%itemcount);
}
}


jdoran 10-03-2014 08:50 PM

There is no EVENT_ITEM. Try EVENT_TRADE

Uleat 10-03-2014 08:53 PM

I'm not a quest person...

but, have you tried this:
Code:

$client->summonitem(32374);
It would seem that you're trying to have the NPC summon the item with the way that it's written.

scrubtasticx 10-03-2014 08:56 PM

Uleat that worked thankyou :P any certain reason quest::summonitem wasnt working though?

scrubtasticx 10-03-2014 09:21 PM

well either way it works and now ive finished it so here is a customizable epic quest for anyone who wants it finished code:

Code:

sub EVENT_SAY
{
my $weapon = quest::saylink ("weapon");

        if ($text =~/Hail/i && !defined $qglobals{"Epic"})
        {
        quest::say("Hello $name, Along my journies i have aquired knowledge on how to create a [$weapon] with power like none seen before.");
        }
       
        if ($text =~/weapon/i)
        {
        quest::say("In order for me to make you this special weapon i need a few items. The first item I need is a greatsword from Acryila Caverns.");
        }
       
        elsif ($qglobals{"Epic"} == 1)
                {
                quest::say("The next item you need is an eye from a evil unicorn in Lesser Faydark.");
            }
               
        elsif ($qglobals{"Epic"} == 2)
                {
                quest::say("The next item i need is a Polished Shard from Droga.");
            }
               
                elsif ($qglobals{"Epic"} == 3)
                {
                quest::say("The next item i need is a Sphere of Sandstorm from Bastion of Thunder.");
            }
               
                elsif ($qglobals{"Epic"} == 4)
                {
                quest::say("The next item I need is dryad parts from Jagged Pine Forest.");
            }
               
                elsif ($qglobals{"Epic"} == 5)
                {
                quest::say("The next item i need is werewolf talon from Castle Mistmoore.");
            }
               
                elsif ($qglobals{"Epic"} == 6)
                {
                quest::say("The next item i need is a snowball from permafrost.");
            }
               
                elsif ($qglobals{"Epic"} == 7)
                {
                quest::say("This last part will not be so easy. I need Kallis' Head.");
            }
               
                elsif (($class eq "Wizard") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(16576);
                }
               
                elsif (($class eq "Ranger") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(62649);
                }
               
                elsif (($class eq "Bard") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(77640);
                }
               
                elsif (($class eq "Beastlord") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(57054);
                }
               
                elsif (($class eq "Berserker") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(18609);
                }
               
                elsif (($class eq "Cleric") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(20076);
                }
               
                elsif (($class eq "Druid") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(62880);
                }
               
                elsif (($class eq "Enchanter") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(52962);
                }
               
                elsif (($class eq "Magician") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(19839);
                }
               
                elsif (($class eq "Monk") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(67742);
                }
               
                elsif (($class eq "Necromancer") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(64067);
                }
               
                elsif (($class eq "Paladin") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(48147);
                }
               
                elsif (($class eq "Rogue") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(39941);
                }
               
                elsif (($class eq "Shadowknight") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(48136);
                }
               
                elsif (($class eq "Shaman") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(57405);
                }
               
                elsif (($class eq "Warrior") && ($qglobals{"Epic"} == 8))
                {
                quest::say("Congrats on your Epic! Use it well.");
                quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
                $client->summonitem(60332);
                }
               
        else
        {
        quest::say("You have already completed this quest.");
        }
}

sub EVENT_ITEM

{
        if ($item1== 51261 && !defined $qglobals{"Epic"})
        {
    quest::say("This is just what i was looking for! The next item you need is an eye from a evil unicorn in Lesser Faydark.");
        quest::setglobal("Epic", 1, 1, "F");
        }
 
        elsif ($item1== 1815 && ($qglobals {"Epic"} == 1))
        {
        quest::say("Wow you are making incredible time getting me these items. The next item i need is a Polished Shard from Droga.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 81116 && ($qglobals {"Epic"} == 2))
        {
        quest::say("You are getting closer to greatness. The next item i need is a Sphere of Sandstorm from Bastion of Thunder.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 9429 && ($qglobals {"Epic"} == 3))
        {
        quest::say("Incdredible! The weapon is almost complete. The next item I need is dryad parts from Jagged Pine Forest.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 8107 && ($qglobals {"Epic"} == 4))
        {
        quest::say("You are half way there. The next item i need is werewolf talon from Castle Mistmoore.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 13746 && ($qglobals {"Epic"} == 5))
        {
        quest::say("The weapon is starting to glow. The next item i need is a snowball from permafrost.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 19034 && ($qglobals {"Epic"} == 6))
        {
        quest::say("Just one more peice to go. This last part will not be so easy. I need Kallis' Head.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
    }
       
        elsif ($item1== 31420 && ($qglobals {"Epic"} == 7))
        {
        quest::say("That is everything. Give me a few seconds to get your weapon made.");
        quest::setglobal("Epic", ($qglobals{"Epic"} +1), 1, "F");
        }
       
else
        {
        quest::say("I cannot use that at this time. Please give me the items in the correct order as I have instructed.");
        }
}


Uleat 10-03-2014 09:34 PM

Gotta remember that quest::say() makes the NPC speak..so, quest::summonitem() at best would make the NPC summon an item to its cursor...

But, NPC (nor Mob) does not have a cursor nor a SummonItem() method.

Asylum 10-03-2014 09:39 PM

quest::summonitem(1001);

works just fine. It summons the given item number and places it on the cursor of the client who initiated the EVENT_... that the command is listed under. If the NPC no longer has a $client as a target (i.e. engaged in conversation or focused on) it will fail because there is no client to summon the item for.

According to your script, you would not receive the item upon the final turnin, that only sets the qglobal to 8. Now the client would need to say "weapon" one more time to activate the summonitem command.

Uleat 10-03-2014 11:26 PM

And that's why I don't do quests :P

But, at least you're on the right track :)


All times are GMT -4. The time now is 10:46 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.