GettingPassives(var/Passivetree/P)
var/Passivetree
paspoints
Unlocked_Passives
if( (P.name in src.PassiveTreeList) )
if(P.JutsuMaxLevel==P.JutsuLevel)
src << "You have already mastered this!"
if(P.JutsuMaxLevel > P.JutsuLevel)
if(src.Skill_Point < paspoints)
src << "You don't have the required skill points for this!"
else if( alert("Would you like to level up [P.name] for [paspoints] skill points?","Current Level: [P.JutsuLevel]/[P.JutsuMaxLevel]", "Yes","No") == "Yes")
P.JutsuLevel+=1
src <<"You have leveled up [P.name]!"
src.Skill_Point = max(0, src.Skill_Point - paspoints)
SavePassives(P)
else if( !(P.name in src.Activated_Passives) )
src <<"This Passive is not available to you at this time."
else if(src.Skill_Point < paspoints)
src << "You don't have the required skill points for this!"
else if( alert("Obtain [P.name] for [paspoints] skill points?","Skill Obtain","Yes","No") == "Yes")
src << "You have obtained [P.name]!"
src.PassiveTreeList += P.name
for(var/A in Unlocked_Passives)
if( !(A in src.Activated_Passives) )
src.Activated_Passives += A
src.Skill_Point = max(0, src.Skill_Point - paspoints)
src.contents += new P.pass_obtained
src.SkillBoosts()
src.Refresh_Skilltree()
Problem description: Well what I got here is basically a skill tree system that when someone clicks an item it allows the user to gain a passive. That all works but the problem starts at the beginning when I tell the proc to level up the passive, which it does successfully. My only problem is that the variable that shows the level of the Passive is under the Passive itself, and I don't know a way to save it to the mob. Whenever the mob logs out it forgets that the passive had ever leveled.
So my question is how would I save a variable that is located in a passive to a mob's save system?
This is how items in a player's contents are saved and loaded automatically.