Case 3Call Inimaker(index)Call Giveskillstuff(index)Case 4skilltype = Getvar("skills.ini", "BASE", Int(Getvar("skills.ini", GetPlayerMap(index), "skilltype")))Call PutVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stammax", 5 + Int(getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "lvl")))Call PutVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam", 0)Call Playermsg(index, "You feel refreshed and ready to " & skilltype & " again.", 5)
Sub Inimaker(index)On Error Resume nextDim mapnumIf GetPlayerAccess(index) > 0 ThenIf Getvar("skills.ini", GetPlayerMap(index), "hasdata") <> 1 Then Call Putvar("skills.ini", GetPlayerMap(index), "hasdata", 1) Call Putvar("skills.ini", GetPlayerMap(index), "skilltype", 0) Call Putvar("skills.ini", GetPlayerMap(index), "checkitemnum", 0) Call Putvar("skills.ini", GetPlayerMap(index), "drop1", 0) Call Putvar("skills.ini", GetPlayerMap(index), "drop2", 0) Call Putvar("skills.ini", GetPlayerMap(index), "chance1", 0) Call Putvar("skills.ini", GetPlayerMap(index), "chance2", 0) Call Putvar("skills.ini", GetPlayerMap(index), "givexp", 0) Call Putvar("skills.ini", GetPlayerMap(index), "reqlvl", 0) Call Putvar("skills.ini", GetPlayerMap(index), "successmsg1", 0) Call Putvar("skills.ini", GetPlayerMap(index), "successmsg2", 0) Call Putvar("skills.ini", GetPlayerMap(index), "failuremsg", 0)End If End If End Sub
Sub giveskillstuff(index)On Error Resume nextDim equippedDim lvlskillDim skilltypeDim randomiserDim chance1Dim chance2Dim itemcheckDim succeed1Dim succeed2Dim failDim skillnumberDim skillxpDim finalxpDim currentxpDim needxpDim testlvlDim drop1Dim drop2Dim totalDim SLOTDim tempDim stammaxDim stamDim equipchecknum equipped = GetPlayerWeaponSlot(index)equipchecknum = Int(GetPlayerInvItemNum(index,equipped))itemcheck = 0 + Getvar("skills.ini", GetPlayerMap(index), "checkitemnum")skilltype = Getvar("skills.ini", "BASE", Getvar("skills.ini", GetPlayerMap(index), "skilltype"))If equipchecknum > 0 Then If 0 + GetPlayerInvItemNum(index, equipped) = itemcheck Then If 0 + GetVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "lvl") < 0 Then Call PutVar ("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "lvl", 1) Call PutVar ("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "xp", 0) Call PutVar ("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam", 0) Call PutVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stammax", 5) End If lvlskill = Getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "lvl") If Getvar("skills.ini", GetPlayerMap(index), "reqlvl") <= lvlskill Then stammax = Int(GetVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stammax")) stam = Int(GetVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam")) If stam < stammax Then randomiser = Int((1000 - 0 + 1) * Rnd) + 0 chance1 = 0 + Getvar("skills.ini", GetPlayerMap(index), "chance1") chance2 = 0 + Getvar("skills.ini", GetPlayerMap(index), "chance2") fail = Getvar("skills.ini", GetPlayerMap(index), "failuremsg") drop1 = 0 + Getvar("skills.ini", GetPlayerMap(index), "drop1") drop2 = 0 + Getvar("skills.ini", GetPlayerMap(index), "drop2") succeed1 = Getvar("skills.ini", GetPlayerMap(index), "successmsg1") succeed2 = Getvar("skills.ini", GetPlayerMap(index), "successmsg2") total = randomiser - lvlskill If total <= chance1 Then If total <= chance2 Then Call wtftest(index,drop2) Call Playermsg(index, succeed2 ,10) Call PutVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam", 1 + Int(getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam"))) Else Call wtftest(index,drop1) Call Playermsg(index, succeed1,10) Call PutVar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam", 1 + Int(getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "stam"))) End If Else Call Playermsg(index, fail, 12) End If Else Call playermsg( index, "You need to take a break before continuing", 12) End If Else Call Playermsg(index, "You need to be more skilled to " & skilltype & " here.", 12) End If Else Call Playermsg(index, "You need the correct tool to " & skilltype & " here", 12) End IfElseCall Playermsg(index, "You need the correct tool to " & skilltype & " here", 12)End IfEnd Sub
Sub wtftest(index, drop)Dim tempDim slotDim givengiven = 0slot = 1 Do While SLOT < 25 If GetPlayerInvItemNum(index, SLOT) = ( 0 + drop) Then temp = 1 + Getplayerinvitemvalue(index, SLOT) Call SetPlayerInvItemValue(index, SLOT, temp) Call SendInventoryUpdate(index, SLOT) Call Giveskillxp(index) Given = 1 SLOT = 24 End If SLOT = SLOT + 1 Loop Slot = 1If Given <> 1 Then Do While SLOT < 25 If GetPlayerInvItemNum(index, SLOT) = 0 Then Call SetPlayerInvItemNum(index, SLOT, drop) Call SetPlayerInvItemValue(index, SLOT, 1) Call SendInventoryUpdate(index, SLOT) Call GiveSkillxp(index) SLOT = 24 Given = 1 End If SLOT = SLOT + 1 LoopEnd IfIf Given = 0 ThenCall PlayerMsg(index, "You do not have sufficient inventory space to recieve this item.", 12)End IfEnd Sub
Sub Giveskillxp(index)Dim finalxpDim lvlskillDim needxpDim skilltypeDim currentxpDim addxpDim maxDim titlemax = 100skilltype = Getvar("skills.ini", "BASE", Getvar("skills.ini", GetPlayerMap(index), "skilltype"))lvlskill = 1 + Getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "lvl")addxp = Int(Getvar("skills.ini", GetPlayerMap(index), "givexp"))currentxp = Int(Getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "xp"))finalxp = 0 + addxp + currentxpneedxp = Int(Getvar("experience.ini", "EXPERIENCE", "Exp" & lvlskill))title = skilltype & "xp" If lvlskill <= max ThenCall Putvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index),skilltype & "xp", Int(Getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "xp"))+ Int(Getvar("skills.ini", GetPlayerMap(index), "givexp")))Call Playermsg(index, finalxp & "/" & needxp , 6) If needxp <= finalxp Then Call Putvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index),skilltype&"lvl", 1 + Getvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), skilltype & "lvl")) Call Putvar("skills\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index),skilltype&"xp", 0) Call Playermsg(index, "You advanced to level " & lvlskill & ", congratulations!", 10) If lvlskill = max Then Call Playermsg(index, "You have mastered this skill! Congratulations!", 14) End If End IfEnd If End Sub
[2]hasdata=1skilltype=0checkitemnum=0drop1=0drop2=0chance1=0chance2=0givexp=0reqlvl=0successmsg1=0successmsg2=0failuremsg=0
[BASE]1=Mine2=Fish3=Whatevayougetheideabynowihope
[6]hasdata=1skilltype=1checkitemnum=6drop1=2drop2=3chance1=200chance2=20givexp=50reqlvl=0successmsg1=You remove a large chunk of copper ore.successmsg2=You break open a rock revealing a shiny crystal.failuremsg=You remove some rubble.
finalxp = 0 + addxp + currentxp needxp = Int(Getvar("experience.ini", "EXPERIENCE", "Exp" & lvlskill)) title = skilltype & "xp"
does ur game has this system? I want to check it before trying to put it in my game
yup, just make a new skillxp.ini, and change the fields, redo that statement you just pasted to draw from it and it should work fine.