PDA

View Full Version : quest::collectitems(item_id, remove)


The Crucial One
07-26-2015, 04:10 PM
I am working on removing the need for turnin's so that I wont have people running around handing in hard to obtain items to pets and what not, atm i use


sub EVENT_SAY {
$Turnin = quest::saylink("Turnin",1);
if ($text=~/hail/i && !plugin::check_hasitem($client, 132709)) {
plugin::Whisper("I need 2 wolf pelts to craft you what your after.");
}
if ($text=~/hail/i && plugin::check_hasitem($client, 132709)) {
plugin::Whisper("I need 2 wolf pelts to craft you what your after.");
$client->Message(15, "Would you like to $Turnin?");
}
if ($text=~/Turnin/i && plugin::check_hasitem($client, 132709)) {
$tokens = quest::collectitems(132709, 1);
$tokens = $tokens - 2;
quest::summonitem(132709, $tokens);
}
}

i mean it works but i would like to get the summoned items to be placed back in inventory slots otherwise from time to time i get client inventory issues and people loose their items...

Any help or Advice would be much appreciated,

Thanks
Crucial

NatedogEZ
07-26-2015, 07:26 PM
I was bored.. so I wrote a thing.. maybe this will help you?

https://perl.pastebin.mozilla.org/8840687


place that into a .pl file in your plugins folder...


Here is an example quest on how to use it..



sub EVENT_SAY {
if($text=~/hail/i) {
plugin::Whisper("This handin requires two " . quest::varlink(21779)
. ", three " . quest::varlink(9990)
. ", one " . quest::varlink(1001)
. ", and 1 platinum, 5 gold, 5 silver, 5 copper.");
$client->Message(315, "::" . quest::saylink("handin",1));
} elsif($text=~/handin/i) {
if (plugin::collect_quest($client, 21779 => 2, 9990 => 3, 1001 => 1, "platinum" => 1, "gold" => 5, "silver" => 5, "copper" => 5)) {
plugin::Whisper("GRATS YOU DID A TURN IN..");
}
}
}

Shendare
07-26-2015, 07:43 PM
This sounds similar to the way KinglyKrab was changing handins to pull from inventory instead of awaiting a trade window.

I can definitely see it being useful for a builder who wants to avoid the trade window method.

Kingly_Krab
07-26-2015, 07:58 PM
Yeah, I had written plugins to do something similar to what Natedog is doing, but he added money functionality and made it a hash. It's a much nicer way to do it than the trade window, that's for sure, as you can require as many items as you want.

The Crucial One
07-26-2015, 09:39 PM
Thanks for your Reply's all this is much helpful! With all the random players that are always handing shit into pets this makes my life that much easier!