Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Gandorf
Novice


Joined: 28 Oct 2000
Posts: 38
Location: Sweden

PostPosted: Mon Dec 17, 2001 6:34 pm   

Database help
 
I have been trying for hours to get my eq database work but without success.
This is how the identify looks on my mud
Weapon:

Object 'circular saw' is type weapon
Extra flags: hum.
Weight is 7, value is 460, level is 46.
Worn take wield.
Weapon type is axe.
Damage is 11d7 (average 44).
Affects skill disarm by 9.
Lore shows this item is from Descent to Hell.

Armor:
Object 'captive audience float' is type armor
Extra flags: hum magic burn-proof auctioned held.
Weight is 8, value is 6500, level is 50.
Worn take float.
Armor class is 17 pierce, 20 bash, 19 slash, and 15 vs. magic.
Affects damage roll by 5.
Affects hit roll by 2.
Affects save vs spell by 5.
Lore shows this item is from The Bard Clan.

What I need help with is to setup the triggers properly. I think I have managed to configure the database so it should work.


Gandorf
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Mon Dec 17, 2001 8:55 pm   
 
Your output provides some unique data, but capturing is just a matter of turning each line into a trigger:


#TRIGGER {Object '(*)' is type (%w)} {
#VAR newRec %null
#ADDKEY newRec Name "%1"
#ADDKEY newRec Type %2
#TEMP {$} {
#DBLOAD Eq
#PROMPT newRec.Mob "Source Mob or Shop"
#QUERY ((&Name = @newRec.Name) & (&Source = @newRec.Source) & (&Mob = @newRec.Mob)) All 1
#IF %null(%rec) {NEW All @newRec} {#NOOP}
#DBRESET
}
}
#TRIGGER {Extra flags: (*).} {#ADDKEY newRec Flags %replace("%1", " ", "|")}
#TRIGGER {Weight is (%d), value is (%d), level is (%d).} {
#ADDKEY newRec Weight %1
#ADDKEY newRec Value %2
#ADDKEY newRec Level %3
}
#TRIGGER {Worn take (%w).} {#ADDKEY newRec Worn %1}
#TRIGGER {Weapon type is (%w).} {#ADDKEY newRec Kind %1}
#TRIGGER {Damage is (%x) ~(average (%d)~).} {
#ADDKEY newRec Damage %1
#ADDKEY newRec AvgDam %2
}
#TRIGGER {Affects skill disarm by (%d).} {#ADDKEY newRec Disarm %1}
#TRIGGER {Lore shows this item is from (*).} {#ADDKEY newRec Source "%1"}
#TRIGGER {Armor class is (%d) pierce, (%d) bash, (%d) slash, and (%d) vs. magic.} {
#ADDKEY newRec AC_Pierce %1
#ADDKEY newRec AC_Bash %2
#ADDKEY newRec AC_Slash %3
#ADDKEY newRec AC_Magic %4
}
#TRIGGER {Affects damage roll by (%d).} {#ADDKEY newRec Damroll %1}
#TRIGGER {Affects hit roll by (%d).} {#ADDKEY newRec Hitroll %1}
#TRIGGER {Affects save vs spell by (%d).} {#ADDKEY newRec SaveVSpell %1}

If you use this script you must make certain that your database has the following fields: Name, Type, Mob, Flags, Weight, Value, Level, Worn, Kind, Damage, AvgDam, Disarm, Source, AC_Pierce, AC_Bash, AC_Slash, AC_Magic, Damroll, Hitroll, and SaveVSpell. The Flags field should be the Option List type. Check the "allow others" box.

Now, my philosophy is "The more Fields, the more flexible." Your philosophy may differ and if so you should sit down and decide what you're going to do with all this data once you collect it and how you're going to access it to make decisions. Remember you can always make Views to hide fields you don't need to use at the moment.

I'm guessing there's quite a bit of information not listed here. Pills, potions, scrolls, and wands will have spell information; and there's no indication that your equipment affects stats. You can add this later yourself. Just make sure that for every new key you place in @newRec that there is a corresponding field in the database that is spelled exactly the same.


Troubadour
Reply with quote
Gandorf
Novice


Joined: 28 Oct 2000
Posts: 38
Location: Sweden

PostPosted: Mon Dec 17, 2001 11:30 pm   
 
Thanks it is working.
Yeah I know I have to add more things. There is just one thing I wonder about. After I have entered the triggers I get this syntax error from the #QUARY line
#QUERY ((&Name = @newRec.Name) & (&Source = @newRec.Source) & (&Mob = @newRec.Mob)) All 1 ^ expression not allowed here
Pointing to the first "(". It still works but I wonder hwo this can be fixed. Didn't found anything helpful in the helpfile

Gandorf
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Tue Dec 18, 2001 4:09 am   
 
This is a bug in the Settings Editor parser. Just ignore it; it will still work, as you said.

Troubadour
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net