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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
Troubadour Posted: Wed Mar 14, 2001 1:29 am
Realms of Despair -- Equipment Database Script
double0fro
Beginner


Joined: 19 May 2002
Posts: 15

PostPosted: Mon Sep 02, 2002 12:26 am   
 
So I brought this script in and I love it. Just one problem though. Some items on the mud I play have a bunch of special
properties, and the script only seems to be grabbing two. Any ideas?
Also, is there ANY way to add items to the DB with out the DB window being open?
Reply with quote
brecconary
Newbie


Joined: 26 Sep 2002
Posts: 1
Location: USA

PostPosted: Thu Sep 26, 2002 11:57 pm   
 
Troubador,

I am writing my own set of db-building trigs, and i must say yours have been very helpful. I've made a few departures from the way yours are built, but I've taken some ideas of yours as well. I like your idea of prompting on weapon type. I've added capability to get current room name from the mapper, and i'm also working on a maxlevel/minlevel function to record the highest and lowest encountered levels of a particular item.


if someone can clarify a few points for me about getting data into the db...

1) one issue with RoD is that enchants/glory get added on a second line:

Affects hit roll by 7.
Affects damage roll by 6.
Affects hit roll by 3.
Affects damage roll by 5.

(thats a neph enchanted sai, btw.)

if #addkey calls the same db field twice, does the value reset? or is there a way to make it add?

2) similarly, with "option list" do the entries append or replace?

3) is there a way to trigger on up to two or more words?

eg: triggertext: these words work.
or triggertext: also this
or treggertext: sample

i.e. can you write one trigger that triggers off the beginning of that text, then manipulates the rest of the text as separate variables or %w words?

given that there would be either 3 or 2 or 1 word, I can write three different triggers and it'll work, but it looks sloppy.

thanks in advance!
Brecco
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Thu Dec 26, 2002 2:46 pm   
 
How is this script affected by the db format in 6.40? Any different?

Why oh WHY did I have pass door on...
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jan 24, 2003 1:37 am   
 
I'm trying to transfer this script to Materiamagica (which should be fairly straightforward). However, I have one question:

1. Materiamagica uses a fancy thousand decimal seperator. My question is how do I write a code that ignores the comma? (see below example).

---->

Item 'a seashell belt' is type clothing, alignment 500, made of leather,
has keywords 'seashell belt leather', and can be equipped around the waist.
This item weighs 0 stones and 85 pebbles, and is valued at 50,300 gp.
This level 241 item has the attributes: identified insulated wont-fuse unbreakable
A seashell belt is in excellent condition.
This item has a special enchantment.
*Your personality must be greater than or equal to 16 to use this item.
*This item may be repaired 3 more times.
This belt is crafted of fine leather, woven together around several
colorful seashells. It is quite sturdy and strong, and fastens with a brass
clasp.
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Fri Jan 24, 2003 5:29 am   
 
Use %n rather than %d to capture decimal numbers. They will then store to the variable without the commas.
Reply with quote
mrmook
Beginner


Joined: 14 Jun 2003
Posts: 16
Location: USA

PostPosted: Tue Sep 09, 2003 8:10 pm   
 
Im new at databases.. and zmud..
i really just want this script so i can figure out whats going on a lil easier..
i tried and tried to get this workin for my mud.. but heres the output for a few of the items...

Weapon
Object 'Sword Quest Ancient' is type weapon made of unknown material.
Wear flags take wield nosac, extra flags glow hum burnproof quest.
Weight is 3, value is 1000qp, level is 202.
Weapon type is sword.
Damage is 202d5 (average 606).
Damage type is slice.
Weapons flags: flaming nodisarm
Affects damroll by 20.
Affects hitroll by 20.

Item
an Amulet of the Ancients costs 2500 questpoints.
Object 'amulet quest ancient' is type portal made of unknown material.
Wear flags take hold nosac, extra flags glow magic burnproof quest.
Weight is 0, value is 833qp, level is 202.
Affects wisdom by 1.
Affects hitroll by 10.
Affects damroll by 10.
Affects ac by -50.
Adds achilles_heel affect.
Affects skill enhanced damage by 2.

Armor
a BreastPlate of the Ancients costs 2500 questpoints.
Object 'breastplate quest ancient' is type armor made of unknown material.
Wear flags take body nosac, extra flags glow hum burnproof quest.
Weight is 2, value is 833qp, level is 202.
Armor class is 202 pierce, 202 bash, 202 slash, and 202 vs. magic.
Affects strength by 1.
Affects dexterity by 1.
Affects wisdom by 1.
Affects intelligence by 1.
Adds absorb affect.
Affects move by 125.
Affects mana by 125.
Affects hp by 125.
Affects damroll by 40.
Affects hitroll by 40.

as far as i can see all i really need is triggers..
Reply with quote
WDog
Newbie


Joined: 01 Sep 2003
Posts: 5
Location: Australia

PostPosted: Mon Sep 15, 2003 10:41 am   
 
In reply to Brecconary

quote:
1) one issue with RoD is that enchants/glory get added on a second line:

Affects hit roll by 7.
Affects damage roll by 6.
Affects hit roll by 3.
Affects damage roll by 5.


I use this trigger
Code:
#TRIGGER {Affects damage roll by (%n)~.$} {#ADDKEY NewRecord DR %eval( @NewRecord.DR + %1)}

This setup requires that the variable NewRecord be set to %null befor capaturing data. eg
Code:
#var test %null
#T+ capIDinfo

Note that the order of the arguments for %eval is important if @Record.Key is empty.
Code:
#VAR Test %Null
#VAR Num 4
#SAY %eval( @Test.Num + @Num)
Outputs 4
Code:
#VAR Test %Null
#VAR Num 4
#SAY %eval( @Num + @Test.Num)
Outputs Nothing
Code:
#ADDKEY Test Num 10
#VAR Num 4
#SAY %eval( @Test.Num + @Num)
Outputs 14
Code:
#ADDKEY Test Num 10
#VAR Num 4
#SAY %eval( @Num + @Test.Num)
Outputs 14

Hope this helps

Dave
Reply with quote
palio
Novice


Joined: 30 Jul 2003
Posts: 36

PostPosted: Wed Oct 15, 2003 8:34 am   
 
I converted the above script to my mud and I now have it doing everything but I am having a problem

the name goes into the @var newRecord just fine but for some reason it does not put the name over to the database. It seems to work sometimes but darned if I can figure out why it starts and stops almost seemingly on its own whim. It actually seems as if maybe its the zmud database thats deleting the names but i could be off there


#CLASS {equip_id}
#ALIAS store_data {#IF !%null( %find( @newRecord.Name, All, Name)) {#YESNO "A duplicate item already exists, add anyway?" {#NOOP} {#ABORT 1}};#PROMPT newRecord.Source "Where Item Located?";#DBLOAD eq;#NEW All @newRecord;#DBRESET}
#VAR newRecord {Nameleggings quest ancientTypearmorMaterialunknown materialWeartake legs nosacExtramagic|burnproof|questWeight0Value833qpLevel202acpierce202acbash202acslash202acmagic202dam5affectaccelerationmana242mv242Hit20Source} {}
#TRIGGER {^Object '(*)' is type (%w).$} {#VAR newRecord %null %null equip_id;#ADDKEY newRecord Name {%1};#ADDKEY newRecord Type %2;#TEMP eqidtemptrig {^$} {#T- eqidtemptrig;store_data}}
#TRIGGER {^Wear flags (*), extra flags (*).$} {#ADDKEY newRecord Wear {%1};#ADDKEY newRecord Extra %replace( "%2", " ", "|")}
#TRIGGER {^Weight is (%d), value is (*), condition is (%d), level is (%d).$} {#ADDKEY newRecord Weight %1;#ADDKEY newRecord Value {%2};#ADDKEY newRecord Condition %3;#ADDKEY newRecord Level %4}
#TRIGGER {^Damage is (*) ~(average (%d)~).$} {#ADDKEY newRecord Damage %1;#ADDKEY newRecord avgdam %2}
#TRIGGER {^Has (%d)~(%d~) charges of level (%d) '(*)'.$} {#ADDKEY newRecord charges %1;#ADDKEY newRecord castlevel %2;#ADDKEY newRecord Spells {%3}}
#TRIGGER {^Level (%d) spells of: ~'(*)~'.$} {#ADDKEY newRecord castlevel %1;#ADDKEY newRecord Spells %replace( {%2}, "' '", "|")}
#TRIGGER {^Armor class is (%d) pierce, (%d) bash, (%d) slash, and (%d) vs. magic.$} {#ADDKEY newRecord acpierce %1;#ADDKEY newRecord acbash %2;#ADDKEY newRecord acslash %3;#ADDKEY newRecord acmagic %4}
#TRIGGER {^Affects hp by (%n).$} {#ADDKEY newRecord hp %1}
#TRIGGER {^Affects dexterity by (%n).$} {#ADDKEY newRecord dex %1}
#TRIGGER {^Affects strength by (%n).$} {#ADDKEY newRecord str %1}
#TRIGGER {^Affects constitution by (%n).$} {#ADDKEY newRecord con %1}
#TRIGGER {^Affects luck by (%n).$} {#ADDKEY newRecord luck %1}
#TRIGGER {^Affects intelligence by (%n).$} {#ADDKEY newRecord int %1}
#TRIGGER {^Affects wisdom by (%n).$} {#ADDKEY newRecord wis %1}
#TRIGGER {^Affects charisma by (%n).$} {#ADDKEY newRecord char %1}
#TRIGGER {^Affects save vs (%w) by (%n).$} {#ADDITEM newRecord.Saves %concat( %1, " ", %2)}
#TRIGGER {^Affects ac by (%n).$} {#ADDKEY newRecord ac %1}
#TRIGGER {^Affects affected_by by (*).$} {#ADDITEM newRecord.Affects {%1}}
#TRIGGER {^Affects mana by (%n).$} {#ADDKEY newRecord mana %1}
#TRIGGER {^Affects move by (%n).$} {#ADDKEY newRecord mv %1}
#TRIGGER {^Affects damroll by (%n).$} {#ADDKEY newRecord dam %1}
#TRIGGER {^Affects hitroll by (%n).$} {#ADDKEY newRecord Hit %1}
#TRIGGER {^{@newRecord.Name} appears to be of a ({@allCapacities}) capacity.$} {#ADDKEY newRecord capacity %ismember( {%1}, @allCapacities)}
#TRIGGER {^Adds resistance to (*)$} {#ADDITEM newRecord.Resists {%1}}
#TRIGGER {^Affects susceptible by (*).$} {#ADDITEM newRecord.Suscepts {%1}}
#TRIGGER {^Adds immunity to (*)$} {#ADDITEM newRecord.Immunes {%1}}
#TRIGGER {^Item's wear location: (%w)$} {#ADDKEY newRecord Wear %replace( "%1", " ", " , ")}
#TRIGGER {Adds (%w) affect.} {#ADDKEY newRecord affect %replace( "%1", " ", "|")}
#TRIGGER {^Has (%d) charges of level (%d) '(*)'.$} {#ADDKEY newRecord charges %1;#ADDKEY newRecord castlevel %2;#ADDKEY newRecord Spells {%3}}
#TRIGGER {^Affects alignment by (%n).$} {#ADDKEY newRecord align %1}
#TRIGGER {^Object '(*)' is type (%x) made of (*).$} {#VAR newRecord %null %null equip_id;#ADDKEY newRecord Name {%1};#ADDKEY newRecord Type %2;#ADDKEY newRecord Material {%3};#TEMP eqidtemptrig {^$} {#T- eqidtemptrig;store_data}}
#TRIGGER {^Weapon type is (*).$} {#ADDKEY newRecord weaponType {%1}}
#TRIGGER {^Weapons flags: (*)$} {#ADDKEY newRecord WepFlag %replace( "%1", " ", "|")}
#TRIGGER {^Weight is (%d), value is (*), level is (%d).$} {#ADDKEY newRecord Weight %1;#ADDKEY newRecord Value {%2};#ADDKEY newRecord Level %3}
#CLASS 0
Reply with quote
Anyday
Newbie


Joined: 18 Nov 2003
Posts: 1

PostPosted: Tue Nov 18, 2003 7:06 pm   
 
Yes i loaded your script and it works fine, except for when im looking in the database. If i scroll all the way to the left in db view and scroll back the name of item changes from its name to a 0 for every item. Any idea what is going on.
Thanks Alot
Reply with quote
Skilganon
Newbie


Joined: 07 Sep 2004
Posts: 1

PostPosted: Tue Sep 07, 2004 8:04 pm   
 
Pardon my obvious shortcomings when it comes to triggers. I thought I followed all of your instructions
but it doesn't seem to be working for me. I set a new database called eq. Set up the fields per your
instructions. I went through settings and imported the script. I have the database open when I cast
ID and it doesn't seem to be capturing any information?

Any help would be greatly appreciated.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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