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


Joined: 19 Nov 2011
Posts: 1

PostPosted: Sat Nov 19, 2011 8:56 pm   

Need help with a trigger please.
 
This draws from a database I have for building and sets everything correctly except the level of the mob. Regardless of what numeric value I give (1-100), if always sets the mob's level as one, and the subsequent fields appropriate for it being level one. Does anyone know why it constantly sets as level 1? Thanks for the help. :)

Code:
#CLASS {setmob}
#ALIAS setmob {
  #var level %1
  #IF (@level > 120 | @level < 1) {#say That is not a valid level!} {
    #dbget [@level-1]
    level %rec.level
    hitdice %rec.hitdice
    damdice %rec.damdice
    armor %rec.acslash %rec.acbash %rec.acpierce %rec.acexotic
    #say Level set to %rec.level!
    }
  }
#CLASS 0
Reply with quote
hogarius
Adept


Joined: 29 Jan 2003
Posts: 221
Location: islands.genesismuds.org

PostPosted: Sun Nov 20, 2011 5:03 am   
 
I'm not sure why you are using square brackets in the #dbget command.

#dbget uses a numerical expression, which should be in parentheses.

#dbget (@level - 1)
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