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
Exodus
Newbie


Joined: 30 Oct 2001
Posts: 1
Location: USA

PostPosted: Tue Oct 30, 2001 7:30 pm   

Auto DB entries.
 
I am trying to get my triggers to automatically enter information into the DB. The help files have shown me the basics but I am having trouble with the fact that there can be different numbers of restrictions. Let me show an example...

You recite a scroll of identify which dissolves.
You feel informed:
Object 'the Death plate', Object type: Armor
Object is: !Donate Magic !Drop
Object is made of: Bone
Object is restricted: !Warrior !Thief Level_30
Weight: 20, Value: 175000, Size: medium
Max AC-apply is 15, Current AC-apply 15
There is something special about this item.
Object Affects :
Affects : Mana By 20

So here the restricted items are 2 and then the level. While...

You recite a scroll of identify which dissolves.
You feel informed:
Object 'the holy book', Object type: Treasure
Object is: Glow Bless
Object is made of: Paper Leather
Object is restricted: !Evil !Warrior !Mage !Thief !Druid !Monk Level_30
Weight: 1, Value: 6000, Size: any
Object Affects :
Affects : Mana By 50
Affects : Hit_N_Dam By -2

Here there are 6 restrictions then the level. There is also a matter of multiple affects lines with no distinguishing remarks. Just for reference I will also show an example of a weapon...

You feel informed:
Object 'an ice staff', Object type: Weapon
Object is: Magic
Object is made of: Leather
Object is restricted: !Warrior !Thief Level_30
Weight: 13, Value: 85000, Size: big
Minimum Strength to Wield: 10, Hold: 99, DualWield: 28, RangerDual: 25
Damage Dice: 7d3, Attack Type: Pounding
There is something special about this weapon.
Object Affects :
Affects : Hit_N_Dam By 2
Affects : Mana By 20

Any help is greatly appreciated. :D


____----===+++Exodus+++===----____
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Nov 06, 2001 4:00 am   
 
Check out great examples in the finished script forum for things you can hack to fit your particular example:

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=4104&FORUM_ID=29&CAT_ID=5&Topic_Title=Medievia+Database+EQ+Script&Forum_Title=Finished+MUD+Scripts

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=2368&FORUM_ID=29&CAT_ID=5&Topic_Title=Eq+ID+for+Avatar+MUD+part1&Forum_Title=Finished+MUD+Scripts
http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=2370&FORUM_ID=29&CAT_ID=5&Topic_Title=Eq+ID+for+Avatar+MUD+part2&Forum_Title=Finished+MUD+Scripts

TonDiening
Uses 6.16
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Nov 08, 2001 3:03 am   
 
As TonDiening suggested, take a look at the completed scripts to see the general method of processing this information. As to your specific problem of extracting the level information from the restrictions list, try the following. This assumes that the level restriction is always last in the list.



#TR {Object is restricted: (*) Level_(%d)} {
#ADDKEY newRecord Restrictions %replace("%1", " ", "|")
#ADDKEY newRecord Level %2
}


This will add the restrictions as a string list to your database. This works best if you make the Restrictions field "Option List" type. The level datum is added as a numeric value.

As far as the Affects are concerned, this is an opportunity. I prefer to make each Affect be an independent field in the database. This trigger would look like:



#TR {Affects: (%w) by (%n)} {#ADDKEY newRecord %1 %2}


The rest is up to you, but similar to what's been done in the past.

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