Richy420Rich Posted February 7, 2014 Author Share Posted February 7, 2014 I'm going to finally release my epic resource mod for EO 2.0 - 2.3.What do it do?1. It adds dynamic recs for resource level, experience, and the likes.2. It allows multiple resource materials to be gathered from one resource at a selected resource level.3. It allows linking resources, EG: You can't cook without fish, you can't smith without ores!4. It allows taking stacked and non-stacked items for the linking resource.5. It allows the giving of rare items.6. It allows a resource description for resource info-help logs, (Logs not included).7. It tells a player what is needed for a resource if they attack it with a wrong tool.8. It utilizes a graphical interface which when a tool is equipped, it brings up a window for a player to choose their material.9. It utilizes a HotKey which can be pressed while tool is equipped to open the window and choose again.10. Blah blah blah, let's get started.Difficulty? 10-10! You should be alright if you follow this step by step correctly, and if I make sure everything is added here lol.**Step 1**Back up your client and server files before attempting.**Step 2**Download the attachment I placed here, extract it and place it inside your clients **src** folder.[attachment=1112:ResourceSrc.zip]**Step 3**Open VB6 and make sure your frmEditor_Resource looks like this:![](http://i.imgur.com/64FdJd3.png)**Step 4**Inside frmMain, you're going to want to create a Picture Box. Name it: PicResourceAfter that, you're going to want to create another Picture Box inside, height/width = 32/32Name this second Picture Box: PicResourceItem**Step 5**After making PicResourceItem, you're going to want to copy and paste this control. Right clickon the Picture Box and click 'copy'. Then inside PicResource, right click and click 'paste'.Doing this will tell you that you already have a PicResouceItem, would you like to create an array? Click YES.Paste this control 14 more times. The end result should look something like this:![](http://i.imgur.com/muVFaJL.png)After you create 16 PicResourceItems, go back to your first one, inside your Property Window, find INDEXset this INDEX to 16\. Also, set PicResource.visible to false in its property window.![](http://i.imgur.com/winKFwc.png)**Step 6**Double click on PicResourceItem, you're going to want to paste this code inside the Sub:```Call SendMaterialRequest(Index, HoldResourceNum)```After the End Sub, make a new line and make sure it's clear, then paste this code in:```Private Sub PicResourceItem_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)If Index > 0 Thenx = PicResource.Left + picItemDesc.width - 80y = PicResource.top - picItemDesc.height - 40UpdateDescWindow Resource(HoldResourceNum).ItemReward(Index), x, yLastItemDesc = Resource(HoldResourceNum).ItemReward(Index)Exit SubEnd If picItemDesc.Visible = False LastItemDesc = 0 ' no item was last loadedEnd Sub```**Step 7**Go inside modGameEditors, look for ResourceEditorInit. Remove that entire sub and paste this in:```' ////////////////' // Resource Editor //' ////////////////Public Sub ResourceEditorInit()Dim i As LongDim SoundSet As Boolean ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If frmEditor_Resource.Visible = False Then Exit Sub EditorIndex = frmEditor_Resource.lstIndex.ListIndex + 1 ' populate the cache if we need to If Not hasPopulated Then PopulateLists End If ' add the array to the combo frmEditor_Resource.cmbSound.Clear frmEditor_Resource.cmbSound.AddItem "None." For i = 1 To UBound(soundCache) frmEditor_Resource.cmbSound.AddItem soundCache(i) Next ' finished populating With frmEditor_Resource .scrlExhaustedPic.Max = NumResources .scrlNormalPic.Max = NumResources .scrlAnimation.Max = MAX_ANIMATIONS .scrlItemLevel.Max = MAX_LEVELS .txtName.text = Trim$(Resource(EditorIndex).Name) .txtMessage.text = Trim$(Resource(EditorIndex).SuccessMessage) .txtMessage2.text = Trim$(Resource(EditorIndex).EmptyMessage) .txtlogit.text = Trim$(Resource(EditorIndex).TalkAboutIt) .cmbType.ListIndex = Resource(EditorIndex).ResourceType .scrlNormalPic.Value = Resource(EditorIndex).ResourceImage .scrlExhaustedPic.Value = Resource(EditorIndex).ExhaustedImage .scrlTool.Value = Resource(EditorIndex).ToolRequired .scrlHealth.Value = Resource(EditorIndex).health .scrlRespawn.Value = Resource(EditorIndex).RespawnTime .scrlAnimation.Value = Resource(EditorIndex).Animation .HScroll1.Value = Resource(EditorIndex).ResourceGiveExp .scrlMultiItem.Value = 1 .scrlItemLevel.Value = 1 .scrlReward.Value = Resource(EditorIndex).ItemReward(1) .scrlrewardvalue.Value = 1 .scrlItemneeded.Value = Resource(EditorIndex).ItemNeeded(1) .scrlItemvalue.Value = Resource(EditorIndex).ItemValueNeeded(1) .scrlrareitem.Value = Resource(EditorIndex).RareItem(1) .Check1.Value = Resource(EditorIndex).IsLinked ' find the sound we have set If .cmbSound.ListCount >= 0 Then For i = 0 To .cmbSound.ListCount If .cmbSound.List(i) = Trim$(Resource(EditorIndex).Sound) Then .cmbSound.ListIndex = i SoundSet = True End If Next If Not SoundSet Or .cmbSound.ListIndex = -1 Then .cmbSound.ListIndex = 0 End If End With Call EditorResource_BltSprite Resource_Changed(EditorIndex) = True ' Error handler Exit Suberrorhandler: HandleError "ResourceEditorInit", "modGameEditors", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```**Step 8**Go to modGlobals and place this at the bottom, this keeps track of the resource number during Material selecting.```Public HoldResourceNum As Byte```**Step 9**Go to modHandleData and place this code at the bottom:```Private Sub HandleResourceMaterial(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)'Modification(S)Dim buffer As clsBufferDim i As LongDim resourcenum As LongDim ItemNumber As LongDim Picture As LongDim Level As LongDim n As Long Set buffer = New clsBuffer buffer.WriteBytes Data() resourcenum = buffer.ReadLong HoldResourceNum = resourcenum For n = 1 To 16 frmMain.PicResourceItem(n).Visible = False Next For i = 1 To 16 ItemNumber = buffer.ReadLong If ItemNumber > 0 Then Picture = buffer.ReadLong Level = buffer.ReadLong frmMain.PicResourceItem(i) = LoadPicture(App.Path & "\data files\graphics\items\" & Picture & ".bmp") frmMain.PicResourceItem(i).Visible = True Resource(resourcenum).ItemReward(i) = ItemNumber If Level = 99 Then Exit For End If End If Next i frmMain.PicResource.Visible = True Set buffer = NothingEnd Sub```**Step 10**While inside modHandleData, go to InitMessages and add this at the bottom.```HandleDataSub(SResourceMaterial) = GetAddress(AddressOf HandleResourceMaterial)```**Step 11**Go to modEnumerations and add these to the S/C packet lists, make sure they are last, but before CMSG_COUNT and SMSG_COUNT. SResourceMaterial goes with the Server packet list while CResourceMaterial goes with the Client packet list.```SResourceMaterialCResourceMaterial```**Step 12**Go to modClientTCP, paste this in a blank line.```Sub SendMaterialRequest(ByVal ItemValue As Integer, ByVal resourcenum As Long)'Modification(S)Dim buffer As clsBufferDim ItemReward As LongDim ResNum As LongItemReward = ItemValueResNum = resourcenumSet buffer = New clsBufferbuffer.WriteLong CResourceMaterialbuffer.WriteLong ItemRewardbuffer.WriteLong ResNumSendData buffer.ToArray()frmMain.PicResource.Visible = FalseSet buffer = NothingEnd Sub```**Step 13**Go to modTypes, look for Public Type ResourceRec, replace the whole type with this:(Note that this will most likely force you to delete all resources.)```Private Type ResourceRec Name As String * NAME_LENGTH SuccessMessage As String * NAME_LENGTH EmptyMessage As String * NAME_LENGTH Sound As String * NAME_LENGTH ResourceType As Byte ResourceImage As Long ExhaustedImage As Long ItemReward(1 To 16) As Long ToolRequired As Long health As Long RespawnTime As Long Walkthrough As Boolean Animation As Long ResourceGiveExp As Long ItemLevel(1 To 16) As Long IsLinked As Byte ItemNeeded(1 To 16) As Long ItemValueNeeded(1 To 16) As Long RareItem(1 To 16) As Long DescTool As String * NAME_LENGTH TalkAboutIt As String * 500 RewardValue(1 To 16) As LongEnd Type```Still inside modTypes, go inside PlayerRec and add these to the bottom, above End Type:``` ' Resource stuffs ResourceLv(1 To MAX_RESOURCES) As Byte ResourceExp(1 To MAX_RESOURCES) As Long ResourceNextLv(1 To MAX_RESOURCES) As Long ResourceBonusExp(1 To MAX_RESOURCES) As Long MaterialRequested As Long```**Step 14**Go to modInput, CheckInputKeys, and place this after the End If of GetKeyState(vbkeyControl):This uses ESCAPE to bring the material window back up, which can be changed simply by checking another key's state.``` If GetKeyState(vbKeyEscape) < 0 Then If GetPlayerEquipment(MyIndex, Weapon) > 0 Then If Item(GetPlayerEquipment(MyIndex, Weapon)).Data3 > 0 Then frmMain.PicResource.Visible = True End If End If End If```**Step 15**(SAVING POST AS DRAFT)Congratulations if you've made it this far! I believe we're done with all of the client side work, (save your client and compile it).. If all works well, lets move on to the server:**Step 16**Okay, on the server, let's go to modTypes: Replace the ResourceRec with this:```Private Type ResourceRec Name As String * NAME_LENGTH SuccessMessage As String * NAME_LENGTH EmptyMessage As String * NAME_LENGTH Sound As String * NAME_LENGTH ResourceType As Byte ResourceImage As Long ExhaustedImage As Long ItemReward(1 To 16) As Long ToolRequired As Long health As Long RespawnTime As Long Walkthrough As Boolean Animation As Long ResourceGiveExp As Long ItemLevel(1 To 16) As Long IsLinked As Byte ItemNeeded(1 To 16) As Long ItemValueNeeded(1 To 16) As Long RareItem(1 To 16) As Long DescTool As String * NAME_LENGTH TalkAboutIt As String * 500 RewardValue(1 To 16) As LongEnd Type```And the PlayerRec on the bottom, above End Type: Place this.``` ' Resource stuffs ResourceLv(1 To MAX_RESOURCES) As Byte ResourceExp(1 To MAX_RESOURCES) As Long ResourceNextLv(1 To MAX_RESOURCES) As Long ResourceBonusExp(1 To MAX_RESOURCES) As Long MaterialRequested As Long```**Step 17**Now we'll go to modServerTCP and place this in:```Sub SendResourceMaterial(ByVal index As Long, ByVal itemnum As Long)'Modification(S)Dim Buffer As clsBufferDim i As LongDim ResourceNum As LongDim ItemNumber As LongDim Picture As LongDim level As LongResourceNum = Item(itemnum).Data3If Len(Trim(Resource(ResourceNum).Name)) <= 0 Then Exit SubSet Buffer = New clsBufferBuffer.WriteLong SResourceMaterialBuffer.WriteLong ResourceNumFor i = 1 To 16ItemNumber = Resource(ResourceNum).ItemReward(i)Buffer.WriteLong ItemNumberIf ItemNumber > 0 ThenPicture = Item(Resource(ResourceNum).ItemReward(i)).PicBuffer.WriteLong Picturelevel = Resource(ResourceNum).ItemLevel(i)Buffer.WriteLong levelEnd IfNextSendDataTo index, Buffer.ToArray()Set Buffer = NothingEnd Sub```**Step 18**Now we'll go over to modHandleData, first let's go to the bottom and place this in:```Public Sub HandleResourceMaterial(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)'Modification(S)Dim Buffer As clsBufferDim ItemReward As LongDim ResNum As Long Set Buffer = New clsBuffer Buffer.WriteBytes Data() ItemReward = Buffer.ReadLong ResNum = Buffer.ReadLong If ItemReward < 0 Or ItemReward > 16 Then Exit Sub If ResNum <= 0 Or ResNum > MAX_RESOURCES Then Exit Sub If IsPlaying(index) Then If Player(index).ResourceLv(ResNum) >= Resource(ResNum).ItemLevel(ItemReward) Then Player(index).MaterialRequested = ItemReward PlayerMsg index, "You have chosen to obtain the " & Trim(Item(Resource(ResNum).ItemReward(ItemReward)).Name) & " with this skill tool.", brightgreen Else PlayerMsg index, "You're not the required level to obtain this material, please re-equip the skill tool to choose another!", brightred Player(index).MaterialRequested = 1 End If End IfEnd Sub```**Step 19**Stay inside modHandleData, look for InitMessages, place this on the bottom.```HandleDataSub(CResourceMaterial) = GetAddress(AddressOf HandleResourceMaterial)```**Step 20**Go to modEnumerations and add these to the S/C packet lists, make sure they are last, but before CMSG_COUNT and SMSG_COUNT. SResourceMaterial goes with the Server packet list while CResourceMaterial goes with the Client packet list.```SResourceMaterialCResourceMaterial```**Step 21**Let's go to modPlayer, find CheckResource, replace that whole sub with this:```Sub CheckResource(ByVal index As Long, ByVal X As Long, ByVal Y As Long)Dim Resource_num As LongDim Resource_index As LongDim rX As Long, rY As LongDim i As LongDim Damage As LongDim Exp As LongDim FinalReward As LongDim attackspeed As LongDim PercentageComplete As LongDim SpawnARare As LongDim checkme As BooleanDim extrarate As LongDim scanvalue As LongDim countvalue As LongDim percentageexp As LongDim Buffer As clsBuffer'Gather the attack speed from tool.If GetPlayerEquipment(index, Weapon) > 0 Thenattackspeed = Item(GetPlayerEquipment(index, Weapon)).SpeedElseattackspeed = 1000End If'If a players attack speed is irregular, exit out.If TempPlayer(index).AttackTimer + attackspeed > GetTickCount Then Exit Subcheckme = True'Make sure the player is actually next to the job source.If Map(GetPlayerMap(index)).Tile(X, Y).Type = TILE_TYPE_RESOURCE ThenResource_num = 0Resource_index = Map(GetPlayerMap(index)).Tile(X, Y).Data1' Get the cache number of the job.For i = 0 To ResourceCache(GetPlayerMap(index)).Resource_CountIf ResourceCache(GetPlayerMap(index)).ResourceData(i).X = X ThenIf ResourceCache(GetPlayerMap(index)).ResourceData(i).Y = Y ThenResource_num = iEnd IfEnd IfNext'Checks for resource index, and the job tool.If Resource_num > 0 Then If GetPlayerEquipment(index, Weapon) > 0 Then If Item(GetPlayerEquipment(index, Weapon)).Data3 = Resource(Resource_index).ToolRequired Then 'Grabbing the item which the player chose to gather. FinalReward = Player(index).MaterialRequested 'Check to see if the item and level are correct. If Resource(Resource_index).ItemReward(FinalReward) <= 0 And Resource(Resource_index).ItemReward(FinalReward) > MAX_ITEMS Then Exit Sub If Player(index).ResourceLv(Resource_index) < Resource(Resource_index).ItemLevel(FinalReward) Then Exit Sub 'Enough inventory? If FindOpenInvSlot(index, Resource(Resource_index).ItemReward(FinalReward)) = 0 Then PlayerMsg index, "You have no inventory space.", brightred Exit Sub End If 'Check to see if resource is linked. If Resource(Resource_index).IsLinked > 0 Then 'Is there an item even offered? If Resource(Resource_index).ItemNeeded(FinalReward) <= 0 And Resource(Resource_index).ItemNeeded(FinalReward) > MAX_ITEMS Or Resource(Resource_index).ItemValueNeeded(FinalReward) <= 0 Then PlayerMsg index, "This skill has no item requirements set, please contact an admin with this problem.", brightred Exit Sub End If If Item(Resource(Resource_index).ItemNeeded(FinalReward)).Type = ITEM_TYPE_CURRENCY Then If Not HasItem(index, Resource(Resource_index).ItemNeeded(FinalReward)) = Resource(Resource_index).ItemValueNeeded(FinalReward) Then PlayerMsg index, "You need " & Resource(Resource_index).ItemValueNeeded(FinalReward) & " " & Trim$(Item(Resource(Resource_index).ItemNeeded(FinalReward)).Name) & " to interact with this skill!", brightred Exit Sub End If Else 'If so. Check if player has item required before allowing them to do skill. scanvalue = Resource(Resource_index).ItemValueNeeded(FinalReward) countvalue = 0 For i = 1 To MAX_INV If GetPlayerInvItemNum(index, i) = Resource(Resource_index).ItemNeeded(FinalReward) Then countvalue = countvalue + 1 End If Next If countvalue < scanvalue Then PlayerMsg index, "You need " & Resource(Resource_index).ItemValueNeeded(FinalReward) & " " & Trim$(Item(Resource(Resource_index).ItemNeeded(FinalReward)).Name) & " to interact with this skill!", brightred Exit Sub End If End If End If 'Check if job was already completed or not. If ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).ResourceState = 0 Then rX = ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).X rY = ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).Y Damage = Item(GetPlayerEquipment(index, Weapon)).Data2 'Check if completion is greater than job health. If Damage > 0 Then ' Finalize the job. If ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).cur_health - Damage <= 0 Then 'Base experience given. Exp = Resource(Resource_index).ResourceGiveExp ' Base Exp multiply by multi-item exp progression.. Exp = Exp * FinalReward ' Then add the players level up exp bonus. Exp = (Exp + Player(index).ResourceBonusExp(Resource_index)) SetPlayerSkillExp index, Resource_index, (GetPlayerSkillExp(index, Resource_index) + Exp) Call CheckPlayerSkillLevelUp(index, Resource_index) 'Remove the tile from the map, player accomplished it. ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).ResourceState = 1 ' Cut ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).ResourceTimer = GetTickCount SendResourceCacheToMap GetPlayerMap(index), Resource_num 'Tell a player they done the job. If Len(Trim$(Resource(Resource_index).SuccessMessage)) > 0 Then percentageexp = (GetPlayerSkillExp(index, Resource_index) * 100) \ GetPlayerNextSkillLevel(index, Resource_index) SendActionMsg GetPlayerMap(index), Trim$(Resource(Resource_index).SuccessMessage) & " + " & Exp & " , " & percentageexp & "% TNL!", Yellow, 0, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32), index End If If Resource(Resource_index).IsLinked > 0 Then If Item(Resource(Resource_index).ItemNeeded(FinalReward)).Type = ITEM_TYPE_CURRENCY Then TakeInvItem index, Resource(Resource_index).ItemNeeded(FinalReward), Resource(Resource_index).ItemValueNeeded(FinalReward) Else ' Take the required item, give the job item finalized. For i = 1 To MAX_INV If scanvalue > 0 Then TakeInvItem index, Resource(Resource_index).ItemNeeded(FinalReward), 1 scanvalue = scanvalue - 1 End If Next End If End If If Resource(Resource_index).RewardValue(FinalReward) < 1 Then GiveInvItem index, Resource(Resource_index).ItemReward(FinalReward), 1 End If If Resource(Resource_index).RewardValue(FinalReward) >= 1 Then If Item(Resource(Resource_index).ItemReward(FinalReward)).Type = ITEM_TYPE_CURRENCY Then GiveInvItem index, Resource(Resource_index).ItemReward(FinalReward), Resource(Resource_index).RewardValue(FinalReward) Else GiveInvItem index, Resource(Resource_index).ItemReward(FinalReward), 1 End If End If 'Check to see if rare item is even available for this current job and/or job level, skip this process if not. If Resource(Resource_index).RareItem(FinalReward) <= 0 And Resource(Resource_index).RareItem(FinalReward) > MAX_ITEMS Then checkme = False If checkme = True Then SpawnARare = RAND(1, 100) '5 value random chance of getting a rare item if inventory allows it! If SpawnARare > 95 Then If FindOpenInvSlot(index, Resource(Resource_index).RareItem(FinalReward)) > 0 Then GiveInvItem index, Resource(Resource_index).RareItem(FinalReward), 1 SendActionMsg GetPlayerMap(index), "You received a rare item!", Yellow, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32), index End If End If End If SendAnimation GetPlayerMap(index), Resource(Resource_index).Animation, rX, rY Else If Resource(Resource_index).IsLinked > 0 Then If countvalue < scanvalue Then PlayerMsg index, "You need " & Resource(Resource_index).ItemValueNeeded(FinalReward) & " " & Trim$(Item(Resource(Resource_index).ItemNeeded(FinalReward)).Name) & " to interact with this skill!", brightred Exit Sub End If End If ' Just record the hit. ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).cur_health = ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).cur_health - Damage 'Find the percentage left PercentageComplete = (ResourceCache(GetPlayerMap(index)).ResourceData(Resource_num).cur_health * 100) \ Resource(Resource_index).health SendActionMsg GetPlayerMap(index), PercentageComplete & "%", brightred, 1, (rX * 32), (rY * 32) SendAnimation GetPlayerMap(index), Resource(Resource_index).Animation, rX, rY TempPlayer(index).AttackTimer = GetTickCount 'Send the sound effect. SendMapSound index, rX, rY, SoundEntity.seResource, Resource_index End If Else ' Ability failed. SendActionMsg GetPlayerMap(index), "Miss!", brightred, 1, (rX * 32), (rY * 32), index End If Else ' Job already done? Tell a player to wait. If Len(Trim$(Resource(Resource_index).EmptyMessage)) > 0 Then SendActionMsg GetPlayerMap(index), Trim$(Resource(Resource_index).EmptyMessage), brightred, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32), index End If End If Else 'Player needs the required tool so let them know. PlayerMsg index, "You need " & Trim$(Resource(Resource_index).DescTool) & " equipped to interact with this skill.", brightred End If Else 'Player needs the required tool so let them know. PlayerMsg index, "You need " & Trim$(Resource(Resource_index).DescTool) & " equipped to interact with this skill.", brightred End IfEnd IfEnd IfEnd Sub```**Step 22**On the bottom of modPlayer, paste all this in:```Sub CheckPlayerSkillLevelUp(ByVal index As Long, ByVal ResourceNum As Long)' Modification(S)   Dim i As Long   Dim expRollover As Long   Dim level_count As Long   level_count = 0   Do While GetPlayerSkillExp(index, ResourceNum) >= GetPlayerNextSkillLevel(index, ResourceNum)       expRollover = GetPlayerSkillExp(index, ResourceNum) - GetPlayerNextSkillLevel(index, ResourceNum)       ' can level up?       If Not SetPlayerSkillLevel(index, ResourceNum, Int(GetPlayerSkillLevel(index, ResourceNum)) + 1) Then           Exit Sub       End If       Call SetPlayerSkillExp(index, ResourceNum, expRollover)       level_count = level_count + 1       Player(index).ResourceBonusExp(ResourceNum) = (Resource(ResourceNum).ResourceGiveExp \ 5) * GetPlayerSkillLevel(index, ResourceNum)   Loop   If level_count > 0 Then       If level_count = 1 Then           'singular           PlayerMsg index, "You have gained " & level_count & " " & Trim(Resource(ResourceNum).Name) & " level! You're now level " & Player(index).ResourceLv(ResourceNum) & "!", BrightGreen       Else           'plural           PlayerMsg index, "You have gained " & level_count & " " & Trim(Resource(ResourceNum).Name) & " levels! You're now level " & Player(index).ResourceLv(ResourceNum) & "!", BrightGreen       End If   End IfEnd SubFunction GetPlayerNextSkillLevel(ByVal index As Long, ByVal ResourceNum As Long) As Long GetPlayerNextSkillLevel = (50 / 3) * ((GetPlayerSkillLevel(index, ResourceNum) + 1) ^ 3 - (6 * (GetPlayerSkillLevel(index, ResourceNum) + 1) ^ 2) + 17 * (GetPlayerSkillLevel(index, ResourceNum) + 1) - 12) / 4End FunctionFunction GetPlayerSkillExp(ByVal index As Long, ByVal ResourceNum As Long) As Long ' Modification(S) GetPlayerSkillExp = Player(index).ResourceExp(ResourceNum)End FunctionFunction GetPlayerSkillLevel(ByVal index As Long, ByVal ResourceNum As Long) As Long' Modification(S) If index <= 0 Or index > MAX_PLAYERS Then Exit Function GetPlayerSkillLevel = Player(index).ResourceLv(ResourceNum)End FunctionSub SetPlayerSkillExp(ByVal index As Long, ByVal ResourceNum As Long, ByVal Exp As Long) If GetPlayerSkillLevel(index, ResourceNum) = MAX_LEVELS And Player(index).ResourceExp(ResourceNum) > GetPlayerNextSkillLevel(index, ResourceNum) Then Player(index).ResourceExp(ResourceNum) = GetPlayerNextSkillLevel(index, ResourceNum) Exit Sub End If Player(index).ResourceExp(ResourceNum) = ExpEnd SubFunction SetPlayerSkillLevel(ByVal index As Long, ByVal ResourceNum As Long, ByVal level As Long) As Boolean' Modification(S) SetPlayerSkillLevel = False If Player(index).ResourceLv(ResourceNum) = MAX_LEVELS Then Exit Function Player(index).ResourceLv(ResourceNum) = level SetPlayerSkillLevel = TrueEnd Function```**Step 23**In modPlayer, UseItem, place this inside Case ITEM_TYPE_WEAPON on the bottom``` If Item(itemnum).Data3 > 0 Then Call SendResourceMaterial(index, itemnum) Player(index).MaterialRequested = 1 End If```**Step 24**Go to modDatabase, AddChar: Add this below the Player(n).Stat loop;``` For n = 1 To MAX_RESOURCES Player(index).ResourceExp(n) = 0 Player(index).ResourceLv(n) = 1 Next n```This should finalize the tutorial, credit isn't needed but appreciated, thanks. :) Link to comment Share on other sites More sharing options...
SkywardRiver Posted February 7, 2014 Share Posted February 7, 2014 Looks pretty freaking awesome there mate. If I were using 2.0, this would be a definite must! Link to comment Share on other sites More sharing options...
Richy420Rich Posted February 7, 2014 Author Share Posted February 7, 2014 It doesn't mess with rendering so it might work for 3.0's (The only reason why I said EO 2 is because it uses PictureBox control, and the resource editor has DX7 rendering going on.As for my pictureboxes. There's no DX7 rendering going on as I'm using the basic LoadPicture function for them. Lame… I know lol. I never bothered to render. Link to comment Share on other sites More sharing options...
SkywardRiver Posted February 7, 2014 Share Posted February 7, 2014 Well, the engine I use mainly has rendered everything through Dx8, but this still looks awesome. Might start a new side-project just to use this. Link to comment Share on other sites More sharing options...
Matt Posted February 7, 2014 Share Posted February 7, 2014 Difficulty 10/10 on a copy and paste tutorial? Whaaat Link to comment Share on other sites More sharing options...
Richy420Rich Posted February 7, 2014 Author Share Posted February 7, 2014 Yeah, inb4 I get PM's about it.I tested it here, fixed all the loose crap I forgot, it works perfectly now. Link to comment Share on other sites More sharing options...
Matt Posted February 7, 2014 Share Posted February 7, 2014 Ignorance doesn't mean it's hard ;D> As for my pictureboxes. There's no DX7 rendering going on as I'm using the basic LoadPicture function for them. Lame… I know lol. I never bothered to render.Don't think there's anything wrong with using LoadPicture. The hardest thing with DX7 is initializing it. Understanding what you need to do to render an image isn't too difficult, but in this situation using it to render images to a picturebox will barely make a difference. Link to comment Share on other sites More sharing options...
Richy420Rich Posted February 7, 2014 Author Share Posted February 7, 2014 Well, the LoadPicture function doesn't trans the background of the item pictures when loaded, and the way it's coded, only looks for .bmp files.I suppose it would be simple to get it working on DX8 with a couple of changes. Link to comment Share on other sites More sharing options...
Matt Posted February 7, 2014 Share Posted February 7, 2014 *shrug* You can always make a GUI for it. If you wanted transparency instead of the background color, you'd need to get rid of the pictureboxes altogether and then put in some checks with an algorithm to see if you're click on one of the locations of the image (and so on and so forth). So long long story short, unless you need the transparency, go with the GUI ;D Link to comment Share on other sites More sharing options...
hisherwin Posted February 7, 2014 Share Posted February 7, 2014 Eclipse Origins 2? what?Anyway.. it's nice to see an advance Resource System on a game.. Link to comment Share on other sites More sharing options...
Richy420Rich Posted February 7, 2014 Author Share Posted February 7, 2014 As it says, EO 2\. Because all of my systems were on the EO 2 base. Link to comment Share on other sites More sharing options...
vakarieser Posted February 9, 2014 Share Posted February 9, 2014 How to use ? How to work ? pls tell me.. :( :( Link to comment Share on other sites More sharing options...
Richy420Rich Posted February 9, 2014 Author Share Posted February 9, 2014 Well, first you need Visual Basic 6, then download Eclipse Origins 2.0 and then you come back and follow the tutorial which is step by step and mostly done by copying the code in the code blocks and pasting them in the places that I tell in this tutorial to place them. Link to comment Share on other sites More sharing options...
JohnPony Posted February 9, 2014 Share Posted February 9, 2014 Would someone just put me in their signature already? Link to comment Share on other sites More sharing options...
Richy420Rich Posted February 10, 2014 Author Share Posted February 10, 2014 Wtf, how'd you get so many likes?And why we off-topic? :P Link to comment Share on other sites More sharing options...
or3o Posted August 21, 2014 Share Posted August 21, 2014 Good to see your still around Richy! Link to comment Share on other sites More sharing options...
Richy420Rich Posted August 22, 2014 Author Share Posted August 22, 2014 Been awhile, good to see you too oreos! :) 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