PDA

View Full Version : Item hand in question


ChaosSlayer
05-30-2007, 02:50 PM
some sort of forum bug my post refuses to show up in here

ChaosSlayer
05-30-2007, 02:54 PM
Ok here is a bit fo a problem.
i have looked all over the forum but i stil can't get this complitly.

as far as i understand it:

$item1, $item2, $item3, $item4 - these respocible for each of the 4 slots, and very strict. As far as i understand this can be used to track items put in specific slots only.


$itemcount - this one supose to count all items.
taken from Quest guide:

if($itemcount{1001} == 2)

this will respond if i given NPC excatly TWO items.

if($itemcount{1001} == 1) -this one works for 1 item only.

But my quetsion is, how do i make NPC to respond individualy to each item given, where quest requres only 1 item?

in otherwords, if $itemcount set to be equal to 1, NPC will only respond if only 1 item is given and if you give him more he will "eat" all the items.

If you set it to 4 - you MUSt give him 4 items at a time.

So, how do i make it so I can give more than 1 item at a time but NPC gives quest reward for each???
Is there is a way I can mayby set up counting loop inside $intemcount?

So far NPC eaither accepts the excat number of items or just eats all of them when itemcount does not match.

thanks!

Kayot
05-30-2007, 03:38 PM
I'll try to answer this, since I'm working on a script generator for my program. MWMDragon's guide will help.

I think this will check the number of items handed in from highest to lowest. If theres an item that doesn't belong, it should kick it back to the user. I haven't tested this yet, so tell me how it goes.

sub EVENT_ITEM
{
if($itemcount{1001} == 4)
{
quest::exp(400);
}
if($itemcount{1001} == 3)
{
quest::exp(300);
}
if($itemcount{1001} == 2)
{
quest::exp(200);
}
if($itemcount{1001} == 1)
{
quest::exp(100);
}
else
{
quest::say("Sorry, I can't use this stuff... Here you can have it back.");
quest::summonitem($item1) if($item1);
quest::summonitem($item2) if($item2);
quest::summonitem($item3) if($item3);
quest::summonitem($item4) if($item4);
}
}

I hope this works ^-^

P.S. You can make this more advanced with checkers so that handing in one wrong item and one right item will return the wrong item and still give the rewards for the right item.

ChaosSlayer
05-30-2007, 04:09 PM
thanks, this is what i was thinkign too, doign it the manual way so to speak.

I am prety sure this will work, thought this requres you to make an If case for each instance..in otherwords if there are 26 instances, you would have make 26 IFs =)

thinking in terms of VB it would be nice if i could writen something like this:

For x=1 to $itemcount{1001}
{
quest::exp(100);
}


in theory this should be able to handle unlimited number of items. But of course if perl quest system can handle such coding, which i guess it is not =)

Kayot
05-31-2007, 02:47 AM
I'm not sure about loop commands in Perl, but usually when I only have four possible conditions I set them all up as it is probably easer for me to trouble shoot the full layout than a loop. ^-^ I'll probably be more help as I build my script engine. Though its a bit hard right now.

P.S. Though it's much easer than the item editor as I can flush the perl scipts without restarting the server.

ChaosSlayer
05-31-2007, 04:53 AM
i guess i keep experimenting..

another question however, it seem i have a weird faction issue:

In Gfay there is lots of diffirents orcs who have different faction IDs for some reason (same primary faction, but faction of specific mob seem to duplicate over and over)

However orc_pawns seem to have weird faction - unlike all other orcs they agro on you even if you are 100 levels above them. I compared their faction values with all other orcs and I can't seem to find what makes them behave this way - all values seem to be identical.

jimbabwe
05-31-2007, 06:39 AM
That's because orc pawns are hard. They don't care how tough you are.

ChaosSlayer
06-01-2007, 03:12 AM
yeha but they breaking the law =P


anyway - anyone could someone tell me where is that flag that makes mob to attack you regadless of your level, please? Like undead do?
I just can't seem to find it =(
I compared number of undead vs number of regular mobs and I can't find what makes them aggro beyond green con level