or3o Posted August 27, 2012 Author Share Posted August 27, 2012 Ok so i had someone ask about adding a new stat in EO, this is pretty easy but you will need to erase items npcs and accounts to do it. I added it as a critical strike skill.I made it so you cant level it up with stat points ( i did it the lazy way of just hiding the train stat label, and if you have a better suggestion please feel free to tell me.)anyway this stat affects your critical strike chance although you could easily use it for other things.first we are gonna start **Server Side****Moddatabase** Sub load classes find```Class(i).stat(Stats.Willpower) = Val(GetVar(filename, "CLASS" & i, "Willpower"))```beneath that paste```Class(i).stat(Stats.crit) = Val(GetVar(filename, "CLASS" & i, "Crit"))```now in sub SaveClasses under```Call PutVar(filename, "CLASS" & i, "Willpower", STR(Class(i).stat(Stats.Willpower)))```Paste```Call PutVar(filename, "CLASS" & i, "Crit", STR(Class(i).stat(Stats.crit)))```**ModHandleData** Sub handleUseStatpointfind``` Case Stats.WillpowerCall SetPlayerStat(Index, Stats.Willpower, GetPlayerRawStat(Index, Stats.Willpower) + 1)sMes = "Willpower"```Underneath that paste``` Case Stats.critCall SetPlayerStat(Index, Stats.crit, GetPlayerRawStat(Index, Stats.crit) + 1)sMes = "Crit"```**In mine i replaced the +1 with a +0 to ensure no one could use stat points to train Crit chance but im leaving this as is in case you wanna have it be trainable or whatever.**Moving on to **ModEnumerations**in Public enum stats under``` Willpower```paste```crit```just above stat_count**This is where i calculate if you can critical hit. if you are using this tutorial to make a different kind of skill such as defence you can ignore this part and start checking out the CanplayerBlock function.**Ok in ModCombat sub CanplayerCrit replace the entire sub with this```Public Function CanPlayerCrit(ByVal Index As Long) As BooleanDim rate As LongDim rndNum As LongCanPlayerCrit = Falserate = GetPlayerStat(Index, crit)rndNum = rand(1, 100)If rndNum <= rate ThenCanPlayerCrit = TrueEnd IfEnd Function```In sub CanNpcCrit i edited it to look like this so i could give the npcs the ability to have a crit chance also its not required for the tutorial it was just preference```Dim rate As LongDim rndNum As LongCanNpcCrit = Falserate = NPC(npcNum).stat(Stats.Crit)rndNum = rand(1, 100)If rndNum <= rate ThenCanNpcCrit = TrueEnd If```In sub TryPlayerAttackNpc under```' * 1.5 if it's a crit!```you can change the value of the crit if you would like to.That Should be it for Server Side! now we move on to the**Client Side**Ok so **ModEnumerations**find```Willpower```in Public Enum Statsunder that before Stat_count paste```CRIT```**Form Work**now in Frmeditor_npc in ScrlStat_Change under``` Case 5prefix = "Will: "```paste``` Case 6prefix = "Crit: "```now in Frmeditor_itemin ScrlStatBonus under``` Case 5text = "+ Will: "```paste``` Case 6text = "+ CRIT: "```now in ScrlStatReq under``` Case 5text = "Will: "```paste``` Case 6text = "+ CRIT: "```Ok now we start adding the scrl bars and labels. this parts really easy.in FrmEditor_item in the requirements box right click on one of the scroll bars and copy it. now paste it in the same box paste it agian (**these boxes are in an array so when you copy them they automatically name themselves, the only problem is the first one you paste will have a (0) at the end, you need it to be a (6) so you copy it and then paste it twice. The second one you paste will have the (6) at the end just delete the first one you copied and your good to go.** **You need to do this will all the labels and scroll bars in this edit!!**ok so copy scrlstatreq and paste it do the same with lbl statreq now do the same with scrlStatbonus and lblstatbonus (its also a good idea to change the caption on the labels to Crit:0)Ok now your done with the item editor. now you move on to Frmeditor_NpcCopy ScrlStat and LblStat doing the same thing you did with the item editor(copy twice and delete the first copy!) and now your done with the npc editor. time to finish this up.Ok so open up Frmmain open PicCharacter (if you cant find it click on the dropdown button in the properties menu and find picCharacter and select it. a square should show up on your frm main, right click it and select move to front.)ok now its time to copy lblCharStat (be sure to copy it twice and delete the first copy.)now do the same with lblTrainStat. **If you plan on making this non trainable i would suggest moving the trainstat label offscreen so it isnt visible ingame.** anyway thats all for this tutorial i hope this helps at least someone out. No credit needed. Link to comment Share on other sites More sharing options...
willunited Posted August 27, 2012 Share Posted August 27, 2012 Nice tutorial,thx Link to comment Share on other sites More sharing options...
MCADAMS Posted August 27, 2012 Share Posted August 27, 2012 Thank you for posting this upon my request. I actually did most of this when I tried to do it myself, so having this will be a nice reference. I'll tell you if it works for me! Thanks a lot ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png) Link to comment Share on other sites More sharing options...
or3o Posted August 27, 2012 Author Share Posted August 27, 2012 Alright man no problem, its will be pretty easy to use it as a block chance or something like that if thats what your plan is. if ya have any issued feel free to ask. 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