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
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Mon Feb 16, 2004 12:49 am   

Next level.
 
Hi. I have a question that I am trying to make.

Now there is 19 levels in this game that I play. and for each level it cost a certain amount of gold to train.

Here follows an example:
when i type 'score' i get the following:

Strength: 25 Agility: 25 Charisma: 25
Constitution: 25 Coordination: 25 Intelligence: 25

with those stats, I am lvl 10.

now I want it to be that when I type 'score'
it will count how much more gold thast is needed to level up.
To be able to level up to the next level requires 30 in all the stats.
(levels are 25/30/35/40/45/50 and so on up to 100. So its 5 stats each level)

Each stat cost 24gp. (The first level, and for each level I gain it will cost more, lets pretend it will double all the time)

I want it to count and tell me something like this:

Strength: 25 (120) Agility: 25 (120) Charisma: 25 (120)
Constitution: 25 (120) Coordination: 25 (120) Intelligence: 25 (120)

the numbers within the () is the gold amount that it would cost me to level up... BUT. when I reach 30 in something, I want it to count to the next level.... and so and on and so on.. do anyone understand what I mean, and by any chance know how I should do it?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Feb 16, 2004 1:11 pm   
 
Create triggers that will match those two lines and store the current values of the stats in %1, %1, etc. Now, in the triggers, use modulus to find out how much is left for the next level for each stat. Example:
%eval(5 - %15)

This expression will return how much is left for a particular stat to reach the next level. Now, all that is left to do is find out how much it currently costs for each stat increase. For this, you can divide the current value of the stat by 5 using integer division (which drops the fractional part) and use that result as an index for a stringlist that contains the cost for each set of 5 stat values. Example:
#VAR trainCost {0|24|48|72|96|...}

The first value is for stats 0 - 4, then for 5 - 9, and so on. After that, just multiply the amoun of stat values needed for next level by the amount of gold for each stat value, anduse #SUB if you want to replace the MUD displayed line with a new one.
Reply with quote
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Mon Feb 16, 2004 7:46 pm   
 
Hmm.. OK.. I am not that experienced with making triggers ets.. Can you show me an example that I could continue upon? Thank you though for your information and I will try my best in making it.

Btw. if possible show me an example upon this:
Strength: 95
Coordination: 86


Now it cost 778 gold pieces to train from 95-100 in strength.

and it cost 479 to train from 80-90 (that's 10 stats)

Now from the info you get here, how can I do it?

I really don't understand anything. I am new with making triggers etc and my english aint that good either... so sorry..
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