|
del-Cormic Newbie
Joined: 08 Jul 2002 Posts: 4
|
Posted: Tue Jul 09, 2002 5:12 am
Need help with Script |
Typical piece of equipemt
Object 'lavender-cape-ugly', Item type: Armor
Item is: Hum Anti-Cleric Anti-Mage
Weight: 18, Volume: 300, Value: 20000 [Rare]
AC-apply is 10
Can affect you as:
Affects Damroll by 2
Affects Berserk by 7
Affects Armor by -15
Affects Hide by -100
Affects Sneak by -100
I've managed to get a script to gather all the info thats important and pass it off to the built in zmudd database. The only thing I'm having trouble with is getting the Affects x by y parts to get passed to the db and stored. The item can have up to five items like that and theres a list of like 90 effects and I was wondering if there was an easier way of setting it up besides defining all of them as a huge Option List? |
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Tue Jul 09, 2002 8:02 am |
If you look in the Finished Scripts forum and a general search in this forum, you'll see that there are a couple of identify scripts. If you look at Troubadour's script in the Finished Scripts forum, you should be able to tweak it to fit your output.
Iljhar |
|
|
|
del-Cormic Newbie
Joined: 08 Jul 2002 Posts: 4
|
Posted: Tue Jul 09, 2002 8:32 am |
Actually I did tweak his script to make mine.. problem is that his list of things that equipment can affect is 14 items and he stores each one as a seperate field. The mud I play on has a lot more then that and if I tried to make a field for each one it would get huge.
How would I do this.. I make 5 columns for Affects and each one is an Option List. How would I go about sending the first Affect line to the first column, the second Affect to the second column etc etc. I'm assuming that with the Allow Other option checked on Option List that if a new option shows up that hasn't been defined it will make it? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jul 09, 2002 5:14 pm |
You would need to use a counting variable, which will need to be reset for every identify. You can then change it every time you trigger on Affects.
#VAR affectcount 1 1
#TR {^Affects (*) by (%n)} {#ADDKEY db affect@affectcount {%1};#ADDKEY db amount@affectcount {%2};#ADD affectcount 1}
LightBulb
Senior Member |
|
|
|
del-Cormic Newbie
Joined: 08 Jul 2002 Posts: 4
|
Posted: Tue Jul 09, 2002 9:34 pm |
HA!
It works.. many thanks for the both of you for your help. |
|
|
|
del-Cormic Newbie
Joined: 08 Jul 2002 Posts: 4
|
Posted: Tue Jul 09, 2002 10:49 pm |
Ok.. something is wrong with this one..
allRestrictions is defined as
Anti-Warrior|Anti-Cleric|Anti-Mage|Anti-Thief|Anti-Good|Anti-Neutral|Anti-Evil
allProperties is defined as
Hum|Magic|None|Invisible|Organic|Glow
I left out two of the properties, namily Metal and Bless so I add it to the variable.
when I run
#LOOP %numwords( %1) {
#IF %ismember( %word( {%1}, %i), @allRestrictions) {#ADDKEY stuff Restrictions %word( {%1}, %i)} {#ADDKEY stuff Properties %word( {%1}, %i)}
}
I removes the last two properties I added, Metal and Bless and I'm not sure where to add the ismember check for @allProperties after it gets done checking for hits in @allRestrictions. |
|
|
|
|
|