PDA

View Full Version : Item turn in gives task


mastajon
12-20-2009, 11:24 PM
I am working on a task that requires players to turn in an item to even start it, then later on they turn in another item to get the next part. here is what i have. Is this the correct way to do it, because i do not want players being able to start the task without turning in the needed items.

sub EVENT_ITEM{

if (plugin::check_handin(\%itemcount, 13008 => 1)){ #checks for mead turnin
quest::say("Ah a nice brew, I've been waiting for this for awhile, I would've got one myself but I am not about to do anything that requires work. Since you were so kind to get me this brew I shall reward you with this [$saylink5].");
}

if ($text =~ /platinum coin of metzger/i) {
quest::say("HAHAHAHAHAHAHAHAHA!!! Did you really think I would just give you that? Oh you should have seen the look on your face, it was priceless. But seriously I want you to go out and create my seal to prove to me that you are worthy of such reward.");
quest::taskselector(35);
}

Randymarsh9
12-21-2009, 12:05 AM
That wouldn't work because then somebody would just have to say 'platinum coin of metzger' and it would bypass the first part. You could either put the taskselector option under the sub EVENT_ITEM as well, or you could do something with qglobals.

sub EVENT_ITEM{

if (plugin::check_handin(\%itemcount, 13008 => 1)){ #checks for mead turnin
quest::say("Ah a nice brew, I've been waiting for this for awhile, I would've got one myself but I am not about to do anything that requires work. Since you were so kind to get me this brew I shall reward you with this [$saylink5].");
quest::setglobal("metzger", 1, 5, "F");
}
}

sub EVENT_SAY{
if ($text =~ /platinum coin of metzger/i) {
if (defined($qlobals{metzger})){
quest::say("HAHAHAHAHAHAHAHAHA!!! Did you really think I would just give you that? Oh you should have seen the look on your face, it was priceless. But seriously I want you to go out and create my seal to prove to me that you are worthy of such reward.");
quest::taskselector(35);
}
else{
quest::say("You haven't turned in the mead yet");
}
}
}

The NPC would have to have qglobals set to 1 in the database if you use that option

trevius
12-21-2009, 02:11 AM
Try using:

quest::assigntask(35);

Instead of:

quest::taskselector(35);

mastajon
12-21-2009, 03:30 PM
okay thanks for the responses. im still new to the whole coding thing so i dont really know how to use qglobals yet but i will mess around with it. so your saying i should try to use only 1 response with the task. or put the platinum response down under with the sub event item also?

sorry for all the questions.