RPG Starter

by Falacy
An Open Source Demo/Game with everything you'll need to get started on your very own BYOND Game!
ID:292238
 
i am trying to add level caps but i want to have it so when you reach your cap you get a new verb that resets your stats and increases your cap.

so say cap was 100 and i reach that cap i get a new verb to reset my stats so im level one again but it then increase my cap to 110 and if i reach 110 i get the verb again and can get a cap of level 120.

can someone help me? many thanks if you can.
Sharkchris wrote:
i am trying to add level caps but i want to have it so when you reach your cap you get a new verb that resets your stats and increases your cap.

so say cap was 100 and i reach that cap i get a new verb to reset my stats so im level one again but it then increase my cap to 110 and if i reach 110 i get the verb again and can get a cap of level 120.

can someone help me? many thanks if you can.

mob/var/level = 1
mob/var/levelcap = 110

mob/proc/LevelCheck()
if(src.Level>=src.LevelCap)
src<<"<I><B><small>Your Level Has Been Reset!"
src<<"<b><big>Level Cap Raised!"
src.Level = 1
src.LevelCap += 10
if(src.Exp>=src.Nexp)
src<<"<I><B><small>You gained a level!"
src.Level+=1


Remember to save the mobs "LevelCap" Alwell, seeing as this proc will increase their level cap by 10 everytime they reach their current level cap, aswell as resetting their level alone back to 1.
In response to Bladewolfx
That's only half functional, and not really what he asked for to begin with
In response to Falacy
Falacy wrote:
That's only half functional, and not really what he asked for to begin with

well i want him to do some work on his own, not to mention it is generally what he asked for, in terms of getting the point of what to do acrossed.
In response to Bladewolfx
Except you left off the parts that he might not actually know how to do; like adding a verb and correctly resetting stats. Plus, with the way you have those if()s setup, you would have to become a level higher than the limit before it would reset.
In response to Falacy
Falacy wrote:
Except you left off the parts that he might not actually know how to do; like adding a verb and correctly resetting stats. Plus, with the way you have those if()s setup, you would have to become a level higher than the limit before it would reset.

Well, now that i realize he asked for a verb to reset them not an auto reset, i realize i made a mistake. As for the if()s setup i want them to actually have to complete the 110th level before having the ability to level to 120. well, atleast that makes more sense to me. As for reseting stats, he never stated he wanted that, only the level reset. this enables not losing all your time o nthe game, but still giving it a fun "Level Grinding" experience.
In response to XxLucifersJesterxX
"... i reach that cap i get a new verb to reset my stats so im level one again but it then increase my cap ..."
In response to Falacy
Falacy wrote:
"... i reach that cap i get a new verb to reset my stats -so im level one again- but it then increase my cap ..."
In response to Bladewolfx
the code doesnt seem to work i reach the levelcap and nothing happens. also it doesnt stop when it reachs the level it passes the level cap as well.
In response to Sharkchris
This is, more or less, what you want. It may be crappy code, I don't know. I'm not an expert in DM, but it works :).

mob
var
lvl = 1
lvlcap = 10
exp = 0
nexp = 20

proc
LevelCheck()
if(src.exp >= src.nexp)
if(src.lvl >= src.lvlcap)
src << "You have reached your level cap, please use the 'Upgrade Level Cap' verb to increase it by 10!"
src.verbs+=typesof(/mob/LvlCap/verb)
else
src.lvl += 1
src.nexp = src.exp + 20
src.exp -= 15
RemoveULC()
src.verbs-=typesof(/mob/LvlCap/verb)


LvlCap/verb
Upgrade_Level_Cap()
src.lvlcap += 10
src.RemoveULC()

verb
Level_Up()
src.exp = src.nexp
src.LevelCheck()

Stat()
statpanel("Stats")
stat("Level:","[src.lvl]/[src.lvlcap]")
stat("Exp:","[src.exp]/[src.nexp]")
In response to Sharkchris
Sharkchris wrote:
the code doesnt seem to work i reach the levelcap and nothing happens. also it doesnt stop when it reachs the level it passes the level cap as well.

As i stated before, this is only partially the code, you need to do some stuff yourself.
In response to Exonit
Exonit wrote:
This is, more or less, what you want. It may be crappy code, I don't know. I'm not an expert in DM, but it works :).

mob
> var
> lvl = 1
> lvlcap = 10
> exp = 0
> nexp = 20
>
> proc
> LevelCheck()
> if(src.exp >= src.nexp)
> if(src.lvl >= src.lvlcap)
> src << "You have reached your level cap, please use the 'Upgrade Level Cap' verb to increase it by 10!"
> src.verbs+=typesof(/mob/LvlCap/verb)
> else
> src.lvl += 1
> src.nexp = src.exp + 20
> src.exp -= 15
> RemoveULC()
> src.verbs-=typesof(/mob/LvlCap/verb)
>
>
> LvlCap/verb
> Upgrade_Level_Cap()
> src.lvlcap += 10
> src.RemoveULC()
>
> verb
> Level_Up()
> src.exp = src.nexp
> src.LevelCheck()
>
> Stat()
> statpanel("Stats")
> stat("Level:","[src.lvl]/[src.lvlcap]")
> stat("Exp:","[src.exp]/[src.nexp]")


He wants their level reset to 1 while boostign their cap.
In response to XxLucifersJesterxX
XxLucifersJesterxX wrote:
He wants their level reset to 1 while boostign their cap.

If he cannot do that, then.. wow.

All it would take is in the Upgrade_Level_Cap verb do

src.exp = 0
src.nexp = x (whatever you want, it could be like src.lvl * 2 or something)
src.lvl = 1
In response to Exonit
Thank you. this is alot more helpfull.