Give out random items?

Join Discord

2dope

Golden Oldie
Golden Oldie
Mar 15, 2005
514
13
125
I want to have a quest npc that gives out a random item. Say there is 4 items in a set
WarHelm
WarBrace
WarNeck
WarRing

Can I have it so that it only gives out 1 item but randomly ?
Thanks
 

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
255
♫♪♫ ♦♥♠♣ ♀♂♀
i'd say.. use the idea of the gift box but call it some way different.. so that u click on it twice and u get a random item between the ones u said..

do u have the gift box code written in the qfunction and in your stditems table?
 
Upvote 0

2dope

Golden Oldie
Golden Oldie
Mar 15, 2005
514
13
125
i'd say.. use the idea of the gift box but call it some way different.. so that u click on it twice and u get a random item between the ones u said..

do u have the gift box code written in the qfunction and in your stditems table?

No mate I do not, I understand what you mean, ragnarok online had something like that. Could you help me with code please at all as I would not have a clue where to start and I think this is a brilliant idea.
 
Upvote 0

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
Code:
[@main]
#IF
CHECKNAMELIST WarHelm.txt
CHECKNAMELIST WarBrace.txt
CHECKNAMELIST WarNeck.txt
CHECKNAMELIST WarRing.txt
#SAY
You have recived all the War items. \ \
<Exit/@exit>
#ELSEACT
GOTO @giveitem

[@giveitem]
#IF
RANDOM 4
#ACT
GOTO @WarHelm
#IF
RANDOM 3
#ACT
GOTO @WarBrace
#IF
RANDOM 2
#ACT
GOTO @WarNeck
#IF
RANDOM 1
#ACT
GOT @WarRing
#ELSESAY
Contact a GM. \ \
<Exit/@exit>

[@WarHelm]
#IF
CHECKNAMELIST WarHelm.txt
#ACT
GOTO @giveitem
#ELSEACT
ADDNAMELIST WarHelm.txt
GIVE WarHelm 1
BREAK
#ELSESAY
Here is your WarHelm. \ \
<Exit/@exit>

[@WarBrace]
#IF
CHECKNAMELIST WarBrace.txt
#ACT
GOTO @giveitem
#ELSEACT
ADDNAMELIST WarBrace.txt
GIVE WarBrace
BREAK
#ELSESAY
Here is your WarBrace. \ \
<Exit/@exit>

[@warNeck]
#IF
CHECKNAMELIST WarNeck.txt
#ACT
GOTO @giveitem
#ELSEACT
ADDNAMELIST WarNeck.txt
GIVE WarNeck
BREAK
#ELSESAY
Here is your WarNeck. \ \
<Exit/@exit>

[@WarRing]
#IF
CHECKNAMELIST WarRing.txt
#ACT
GOTO @giveitem
#ELSEACT
ADDNAMELIST WarRing.txt
GIVE WarRing
BREAK
#ELSESAY
Here is your WarRing. \ \
<Exit/@exit>

That script should give the player a random item everytime it's clicked. When the player recives a certain item their name is added to a namelist so they cannot recive the same one again. Not sure if thats what you wanted, but i asumed it was.

If you just add the rest of your quest (again assuming there is one) on top of that it should work.

p
 
Upvote 0

Bon

Legend
Legendary
Jul 29, 2004
6,726
330
300
Kent, UK
id use more than just random 1 2 3 4 tho... personally id put em all at random 50's or something, then at end put elseact and go bk to start of the randoms bit.. it'll eventually pick 1 and give u it
 
Upvote 0

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
id use more than just random 1 2 3 4 tho... personally id put em all at random 50's or something, then at end put elseact and go bk to start of the randoms bit.. it'll eventually pick 1 and give u it

Could do it that way. Still the same priciple.

p
 
Upvote 0