mmearrccii Posted July 29, 2011 Author Share Posted July 29, 2011 3rd tut…This is pretty basic stuff...Client side:In **modConstants** below the:```Public Const ITEM_TYPE_SPELL As Byte = 8```Add:```Public Const ITEM_TYPE_STAT_RESET As Byte = 9```In **frmEditor_Item** add cmbType's list: Stat reset potionServer Side:In **modConstants** below the:```Public Const ITEM_TYPE_SPELL As Byte = 8```Add:```Public Const ITEM_TYPE_STAT_RESET As Byte = 9```In **modPlayer**, in the sub UseItem add below:``` Case ITEM_TYPE_SPELL ' stat requirements For i = 1 To Stats.Stat_Count - 1 If GetPlayerRawStat(index, i) < Item(itemnum).Stat_Req(i) Then PlayerMsg index, "You do not meet the stat requirements to use this item.", BrightRed Exit Sub End If Next ' level requirement If GetPlayerLevel(index) < Item(itemnum).LevelReq Then PlayerMsg index, "You do not meet the level requirement to use this item.", BrightRed Exit Sub End If ' class requirement If Item(itemnum).ClassReq > 0 Then If Not GetPlayerClass(index) = Item(itemnum).ClassReq Then PlayerMsg index, "You do not meet the class requirement to use this item.", BrightRed Exit Sub End If End If ' access requirement If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then PlayerMsg index, "You do not meet the access requirement to use this item.", BrightRed Exit Sub End If ' Get the spell num n = Item(itemnum).Data1 If n > 0 Then ' Make sure they are the right class If Spell(n).ClassReq = GetPlayerClass(index) Or Spell(n).ClassReq = 0 Then ' Make sure they are the right level i = Spell(n).LevelReq If i <= GetPlayerLevel(index) Then i = FindOpenSpellSlot(index) ' Make sure they have an open spell slot If i > 0 Then ' Make sure they dont already have the spell If Not HasSpell(index, n) Then Call SetPlayerSpell(index, i, n) Call SendAnimation(GetPlayerMap(index), Item(itemnum).Animation, 0, 0, TARGET_TYPE_PLAYER, index) Call TakeInvItem(index, itemnum, 0) Call PlayerMsg(index, "You feel the rush of knowledge fill your mind. You can now use " & Trim$(Spell(n).Name) & ".", BrightGreen) Else Call PlayerMsg(index, "You already have knowledge of this skill.", BrightRed) End If Else Call PlayerMsg(index, "You cannot learn any more skills.", BrightRed) End If Else Call PlayerMsg(index, "You must be level " & i & " to learn this skill.", BrightRed) End If Else Call PlayerMsg(index, "This spell can only be learned by " & CheckGrammar(GetClassName(Spell(n).ClassReq)) & ".", BrightRed) End If End If ' send the sound SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum```This:``` Case ITEM_TYPE_STAT_RESET filename = App.Path & "\data\classes.ini" Call SetPlayerStat(index, Agility, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Agility"))) Call SetPlayerStat(index, Strength, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Strength"))) Call SetPlayerStat(index, Intelligence, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Intelligence"))) Call SetPlayerStat(index, Endurance, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Endurance"))) Call SetPlayerStat(index, Willpower, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Willpower"))) If Not GetPlayerPOINTS(index) > 0 Then Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + ((GetPlayerLevel(index) - 1) * 3)) Else Call SetPlayerPOINTS(index, 0) Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + ((GetPlayerLevel(index) - 1) * 3)) End If Call TakeInvItem(index, Player(index).Inv(invNum).Num, 0) ' send the sound SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum Call PlayerMsg(index, "Your Stats had been reset!", BrightRed)```Also, don't forget to change this in the sub!```Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long```To:```Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long, filename As String```I think thats it… Hope i helped. Link to comment Share on other sites More sharing options...
Sauros Posted July 30, 2011 Share Posted July 30, 2011 Not bad, this could be used for idiot players who mess up their stats, or just want to start fresh. Link to comment Share on other sites More sharing options...
RyokuHasu Posted July 30, 2011 Share Posted July 30, 2011 Just a word of advice to anyone who will use this, make the item hard to get or expensive. Link to comment Share on other sites More sharing options...
Savents Posted July 30, 2011 Share Posted July 30, 2011 Is its affected by base stats? for example, I am a warrior with 5STR 5END 5AGI at level 1, just starting the game, I play up to level 30, and messed something up along the way in my stat build, I use a stat reset potion, do you go back to your base stats? or does everything get reset back to 0. Link to comment Share on other sites More sharing options...
juvanio Posted July 30, 2011 Share Posted July 30, 2011 @Sauros:> Not bad, this could be used for idiot players who mess up their stats, or just want to start fresh.I do agree! Many people in other games always mess up their stats. Link to comment Share on other sites More sharing options...
mmearrccii Posted July 30, 2011 Author Share Posted July 30, 2011 @Savints:> Is its affected by base stats? for example, I am a warrior with 5STR 5END 5AGI at level 1, just starting the game, I play up to level 30, and messed something up along the way in my stat build, I use a stat reset potion, do you go back to your base stats? or does everything get reset back to 0.It uses the base stats of your character's class from your classes.ini in your server's data files. Well.. It resets your points then it gives them back so you can use them again. Also it doesn't reset anything else, so you will keep your lvl. Link to comment Share on other sites More sharing options...
erkro1 Posted September 28, 2011 Share Posted September 28, 2011 **Fixed** Link to comment Share on other sites More sharing options...
harvest24 Posted November 5, 2011 Share Posted November 5, 2011 thank Link to comment Share on other sites More sharing options...
Wyvren Posted November 8, 2011 Share Posted November 8, 2011 Awesome, thanks! :) Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 17, 2012 Share Posted March 17, 2012 Works Fine :DThanks very much Link to comment Share on other sites More sharing options...
Tic Tac 2 Posted April 28, 2012 Share Posted April 28, 2012 ![](http://img1.uploadscreenshot.com/images/main/4/11807022880.jpg)Runtime error 9: Subscript out of rangeHappens when i do /edititem(opening the item editor)HALP I FOLLOWED EVERYTHING CORRECTLY(I think) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now