|
Dizelesicap Newbie
Joined: 27 Oct 2001 Posts: 9 Location: USA
|
Posted: Sun Nov 17, 2002 1:07 pm
Abandoned Realms EQ Database Help |
I have been trying for almost 12 hours straight to make an alias that would allow me to automatically add things to database but the best I could get was making a variable with the items properties. I also could not figure out how to make the AC field for armor. Here are samples of all the different identify outputs I could think of. I would appreciate any help in creating a way for me to use an alias to add items I identify with it.
Object 'mace unholy spirits' is type weapon, material adamantite.
Extra flags: hum evil magic nodrop anti_good noremove enchanted.
Weight is 20, value is 5, level is 42.
Weapon type is mace/club.
Damage is 11d4 (average 27).
Affects damroll by 2.
Affects hitroll by 4.
Rare item.
Object 'ring seashell' is type boat, material seashell.
Extra flags: magic.
Weight is 2, value is 100, level is 0.h
Casts create spring.
Object 'barrel' is type drink, material leather.
Extra flags: none.
Weight is 1, value is 30, level is 1.
It holds clear-colored water.
Object 'sack' is type container, material leather.
Extra flags: none.
Weight is 2, value is 500, level is 1.
Capacity: 350# Maximum weight: 200# flags: closeable closed
Object 'shield darkness crested eternal' is type armor, material adamantium.
Extra flags: magic anti_good anti_neutral noremove.
Weight is 8, value is 5, level is 58.
Armor class is 4 pierce, 4 bash, 4 slash, and 0 vs. magic.
Affects hitroll by 1.
Affects strength by 1.
Affects damroll by 3.
Rare item. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Nov 17, 2002 7:40 pm |
The general method is to make a set of triggers that capture the information you want and store it to a record-variable using #ADDKEY. The data from the variable is then added to the database using the #NEW command, this can be done with a trigger which fires when you receive the next prompt, blank line, or some other indication that the identification information is complete.
How (or even if) you store the AC info is up to you. Some possibilities are:
Use four numeric fields
Add it all up and store the total to a numeric field
Take the mean average and store that to a numeric field
Use a string field
Example of a script for the weapon. Many of these triggers will apply to any object. Note that the Key Names must match the Field Names of the database, and the values must be compatible with the matching Field type:
#AL id {#T+ Ident;#VAR ident %null;#ADDKEY ident Rare No;cast identify}
#CLASS Ident disable
#TR {Object '(*)' is type (%w), material (%w).} {#ADDKEY ident Name {%1};#ADDKEY ident Type {%2};#ADDKEY ident Material {%3}}
#TR {Extra flags: (*).} {#ADDKEY ident Flags {%1}}
#TR {Weapon type is (%x)} {#ADDKEY ident Wtype {%1}}
#TR {Weight is (%d), value is (%d), level is (%d)} {#ADDKEY ident Weight {%1};#ADDKEY ident Value {%2};#ADDKEY ident Level {%3}}
#TR {Damage is (%a) ~(average (%d)~).} {#ADDKEY ident Dmgdice {%1};#ADDKEY ident Avedmg {%2}}
#TR {Affects damroll by (%n)} {#ADDKEY ident damroll {%1}}
#TR {Affects hitroll by (%n).} {#ADDKEY ident Hitroll {%1}}
#TR {Rare item} {#ADDKEY ident Rare Yes}
#TR {%d/(%d)hp %d/(%d)mn %d/(%d)mv} {#T- Ident;#NEW All @ident} {} {nocr|prompt}
#CLASS 0
#T- Ident
The last trigger is intended to match the prompt.
You can add additional triggers for the other object types, they don't have to be in any particular order. If you need help with other triggers search this forum and the finished scripts forum.
The database and database window have to be open. You'll probably have to enter the first piece of equipment by hand.
LightBulb
Senior Member |
|
|
|
Dizelesicap Newbie
Joined: 27 Oct 2001 Posts: 9 Location: USA
|
Posted: Wed Nov 20, 2002 1:38 am |
Hmm I'll try that method. So far I had gotten the following method but it would not send it to Database for some reason. :
#TRIGGER {Object '&Item.Object' is type &Item.Type, material &Item.Material(.)} {}
#TRIGGER {Extra flags: &Item.Flags(.)} {}
#TRIGGER {Weight is &Item.Weight, value is &Item.Value, level is &Item.Level(.)} {}
#TRIGGER {Weapon type is &Item.WeaponType(.)} {}
#TRIGGER {Damage is &Item.Damage (average *)(.)} {}
#TRIGGER {Affects damroll by &Item.Damroll(.)} {}
#TRIGGER {Affects hitroll by &Item.Hitroll(.)} {}
#TRIGGER {&Item.Presence item(.)} {}
#TRIGGER {Affects save_mental by &Item.Save_mental(.)} {}
#TRIGGER {Affects save_maledictive by &Item.Save_maledictive(.)} {}
#TRIGGER {Affects save_afflictive by &Item.Save_afflictive(.)} {}
#TRIGGER {$} {#T- identify;#IF (!%null(@NewItem)) {#NEW @ItemType @Item}}
I used the parenthasis around the periods to remove them from the variable it created called "Item" . |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Nov 20, 2002 4:34 am |
quote: #TRIGGER {$} {#T- identify;#IF (!%null(@NewItem)) {#NEW @ItemType @Item}}
Nothing in the script you posted puts anything in @NewItem or @ItemType. If there's nothing in @NewItem it's not supposed to do anything. If there's nothing in @ItemType your #NEW command won't be formatted correctly.
LightBulb
Senior Member |
|
|
|
|
|
|
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
|
|