PDA

View Full Version : question about $itemcount


x-scythe
06-14-2004, 04:36 AM
if i wanted to have it so like 2 of one item and 1 of another were turned in would it be like this?

example quest:


sub EVENT_SAY
{
if($text=~/Hail, $mname/i)
{
quest::say("Ello there $name! If you bring me two firebeetle eyes and one bone chip, I will craft you an item.");
}
}

#the xx is the firebeetle eyes and the yy is the bone chip
sub EVENT_ITEM
{
if(($itemcount{xx} == 2)($itemcount{yy} == 1))
{
quest::say("Well done. Here is your crafted item!");
quest::summonitem(blah);
}
}


this is what i need to know is correct

if(($itemcount{xx} == 2)($itemcount{yy} == 1))


thanks in advance

m0oni9
06-14-2004, 04:56 AM
if(($itemcount{xx} == 2) && ($itemcount{yy} == 1))

x-scythe
06-14-2004, 05:04 AM
doh...now that i see it its so obvious now lol..thanks

Minuss
06-19-2004, 01:30 AM
no need for so many "("
if($itemcount{xxxx} && $itemcount{xxxx} == 1) is also correct

if you have to put 2 items for a turn in for example, it is :
if($itemcount{xxxx} && $itemcount{xxxx} ==1 && $itemcount{yyyy} && $itemcount{yyyy} ==1)