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
Ralph1971
Wanderer


Joined: 01 Mar 2008
Posts: 64

PostPosted: Wed Sep 17, 2008 11:56 pm   

eq damage script
 
I'm trying to get an equip damage script running, playing on Realms of Despair..
what I'm wanting is to load my eq into a series of variables or list and when it gets damaged, it increments a counter by 1. At the end of the fight, I can either use a 'report' alias or some such to list the items and how many hits they took. Having a spot of difficulty getting the items to read in when they get damaged.. basic format of the damage message is:
(a swirled collar gets damaged)
I want it to capture 'a swirled collar' and increment it by one. all I'm getting is #var neckitem (a
any thoughts?
Also, it'd be rawkin if it could output to a child window.. but that's for a later stage..
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Sep 18, 2008 12:45 pm   
 
#trigger {~((%*) gets damaged~)} {put in the var counter in here}
_________________
http://www.Aardwolf.com
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Sep 19, 2008 1:50 am   
 
A very basic form of this would be:

Code:
#CLASS {Damaged Equipment}
#TRIGGER {~((%*) gets damaged~)} {
#CLASS {Damaged Equipment}
#VAR eqname %subchar(%1, " ", "_")
#VAR %concat("Damaged.", @eqname) %eval(@%concat("Damaged.", @eqname) + 1)
#CLASS 0
}
#ALIAS ShowDamEq {
#ECHO {%format(add in whatever kind of header you want here)}
#ECHO {put a number of hyphens here equal to the total number of characters in the above line}
#LOOP %numitems(@Damaged) {#ECHO {%format(and here we use a format matching the above on but using the values we've stashed into the vars)}}
#ECHO {put a number of hyphens here equal to the total number of characters in the above line}
}


NOTE: I had to pseudo the last part because I'm not having the help for %format right in front of me and don't feel like looking it up.

Your output could look something like this:
Code:
Equipment Name                    Amount of Damage
--------------------------------------------------
a swirled collar                  11
a jeweled girdle                  7
a barbed long sword               53
--------------------------------------------------
Reply with quote
Ralph1971
Wanderer


Joined: 01 Mar 2008
Posts: 64

PostPosted: Sat Sep 20, 2008 2:44 am   
 
Ralgith-
that output looks great.. this is what I have for the showdameq alias, and the output.
#ECHO {%format( Equipment Name Amount of damage)}
#ECHO {---------------------------------}
#LOOP %numitems( @Damaged) {#ECHO %concat( @eqname) %eval( @%concat( "Damaged.", @eqname))}
#ECHO {---------------------------------}

gives me the output
Equipment Name Amount of damage
---------------------------------
a_swirled_collar 3
---------------------------------

but the damaged variable is this: Variable: Damaged a_swirled_collar3a_lifebane1
suggestions?
_________________
Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Sep 20, 2008 8:52 pm   
 
Well, since I was being daft about it... I'll have to say I messed up lol!!!

Code:
#CLASS {Damaged Equipment}
#TRIGGER {~((%*) gets damaged~)} {
#CLASS {Damaged Equipment}
#ADDITEM DamNames %subchar(%1, " ", "_")
#VAR %concat("DamAmnt.", %subchar(%1, " ", "_")) %eval(%concat("DamAmnt.", %subchar(%1, " ", "_")) + 1)
#CLASS 0
}
#ALIAS ShowDamEq {
#ECHO {%format(add in whatever kind of header you want here)}
#ECHO {put a number of hyphens here equal to the total number of characters in the above line}
#LOOP %numitems(@Damaged) {#ECHO {%format(and here we use a format matching the above on but using the values we've stashed into the vars)}}
#ECHO {put a number of hyphens here equal to the total number of characters in the above line}
}


Then your display would be
#LOOP %numitems( @DamNames) {#ECHO {%item(@DamNames, %i) %concat(
"@DamAmnt.", %item(@DamNames, %i))}}

I think anyways, I don't normally mess with stuff like this.
You'd probably be better off using a database, but you seem to be pretty new to this so I didn't want to throw everything at you at once :)
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Ralph1971
Wanderer


Joined: 01 Mar 2008
Posts: 64

PostPosted: Sat Sep 20, 2008 9:53 pm   
 
basic scripting, I'm ok at.. more advanced stuff, shaky on *gr*
I'm not above trying the database. If I did that, I'd like to try to input the max ac of an item, and then at some point, have it compare current vs max and if it's at a certain point (say 2), remove it.
As for databases, I have one now set up for my mage for a midas-bot. it just holds the "proper" item name.. i.e. 'a swirled collar', and an item name ..i.e. collar.. that can be used to midas the item. Not sure how pretty it would compared to someoen elses.. but it works :)
_________________
Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21
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