Full Version : Random List for gumps
xmlspawner >>XMLSpawner Feature Request's >>Random List for gumps
<< Prev | Next >>
Lord Hog Fred- 06-18-2006
Would it be possible to add a RNDLIST type command to use with gumps?
I ask this because if this was implemented it would be possible for a quest giving NPC to give any one of a random amount of quests to a player. Just a suggestion.
Also is it possible to make it so that when a player talks to a quest NPC and they have a certain attachment on them (for example they have already completed a previous quest for the NPC) then the quest NPC would bypass the original quest and give different ones using the suggested method above?
Cheers ,
ArteGordon- 06-18-2006

QUOTE (Lord Hog Fred @ June 18, 2006 09:33 am)
Would it be possible to add a RNDLIST type command to use with gumps? I ask this because if this was implemented it would be possible for a quest giving NPC to give any one of a random amount of quests to a player. Just a suggestion. Also is it possible to make it so that when a player talks to a quest NPC and they have a certain attachment on them (for example they have already completed a previous quest for the NPC) then the quest NPC would bypass the original quest and give different ones using the suggested method above?
Cheers ,

yes, you can do those things now.
You can use keywords like RNDSTRLIST to substitute strings anywhere you like by using the {} substitution brackets.
So, for example if you wanted to set up a gump that offered a random quest you could use a Gump string like
GUMP,Choose a quest,4/Are you up for today's challenge? ; Take the challenge ; {RNDSTRLIST,quest1,quest2,quest3} ; Run away ; flee
where you would use the RNDSTRLIST substitution to assign a random response string given the following syntax of the type 4 GUMP
GUMP,gumpname,4/maintext ; selection; response ; selection ; response etc.
this would do exactly the same thing
GUMP,Choose a quest,4/Are you up for today's challenge? ; Take the challenge ; quest{RNDLIST,1,2,3} ; Run away ; flee
because the {} string substitution occurs before any parsing, so you can build the string any way you like.
Once you have set up the GUMP string, then you could have dialog entries that depended on that entry and each of the random 'quest1', 'quest2', etc. responses.
Every time that GUMP entry is opened, the RNDSTRLIST will substitute a different random response string.
For the second thing, just have dialog entries that have a Condition field that checks for certain attachments (like xmlquestattachments for specific quests).
You could also combine the two methods to have entries that depend on the Condition and the random response string.