Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EOv2.0] How To Add New Equipment Slots


Justn
 Share

Recommended Posts

This is for anyone having trouble with adding new equipment slots on this tutorial: [http://www.touchofde…ic,64777.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,64777.0.html) Note: In this tutorial we will be adding 5 new equipment slots feel free to add, remove or change as many as you need making the necessary changes for your game. The new slots are gloves(bottom left in picture), boots(bottom right), legwear(bottom center), necklace(top right, the necklace is refered in the tutorial as 'ring' just because thats what i also use it for), and an enchant slot(top left). In the end you should have something that looks like this: This is my char with all the new items equipped:
>! [http://www.freemmorp…51ed71ff0d3.bmp](http://www.freemmorpgmaker.com/files/imagehost/pics/756d1ba11157545523f8551ed71ff0d3.bmp)Server Side Go to **modConstants** and make your item constants look like this taking note that the new equipment slots are under the helmet slot and above the shield slot. you need to do this client side also.```
Item constantsPublic Const ITEM_TYPE_NONE As Byte = 0Public Const ITEM_TYPE_WEAPON As Byte = 1Public Const ITEM_TYPE_ARMOR As Byte = 2Public Const ITEM_TYPE_HELMET As Byte = 3Public Const ITEM_TYPE_LEGS As Byte = 4 ' NewPublic Const ITEM_TYPE_BOOTS As Byte = 5 ' NewPublic Const ITEM_TYPE_GLOVE As Byte = 6 ' NewPublic Const ITEM_TYPE_RING As Byte = 7 ' NewPublic Const ITEM_TYPE_ENCHANT As Byte = 8 ' NewPublic Const ITEM_TYPE_SHIELD As Byte = 9 Public Const ITEM_TYPE_CONSUME As Byte = 10Public Const ITEM_TYPE_KEY As Byte = 11Public Const ITEM_TYPE_CURRENCY As Byte = 12Public Const ITEM_TYPE_SPELL As Byte = 13
```Next go to **modEnumerations****Find** :```
' Equipment used by PlayersPublic Enum Equipment
```This will be the order in which your eq is displayed in the char window to do it as the picture above **make it look like this**:```
' Equipment used by PlayersPublic Enum Equipment Enchant = 1 Helmet Ring Weapon Armor Shield Glove Legs Boots ' Make sure Equipment_Count is below everything else Equipment_CountEnd Enum
```After that Go to **modPlayer** First: **Find**:```
Function GetPlayerProtection(ByVal Index As Long) As Long
```Make it look something like this anything new added will be labeled as 'New:```
Function GetPlayerProtection(ByVal Index As Long) As Long Dim Armor As Long Dim Helm As Long Dim Legs As Long ' New Dim Boots As Long ' New Dim Glove As Long ' New Dim Ring As Long ' New Dim Enchant As Long ' New GetPlayerProtection = 0 ' Check for subscript out of range If IsPlaying(Index) = False Or Index <= 0 Or Index > Player_HighIndex Then Exit Function End If Armor = GetPlayerEquipment(Index, Armor) Helm = GetPlayerEquipment(Index, Helmet) Legs = GetPlayerEquipment(Index, Legs) ' New Boots = GetPlayerEquipment(Index, Boots) ' New Glove = GetPlayerEquipment(Index, Glove) ' New Ring = GetPlayerEquipment(Index, Ring) ' New Enchant = GetPlayerEquipment(Index, Enchant) ' New GetPlayerProtection = (GetPlayerStat(Index, Stats.Endurance) \ 5) If Armor > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Armor).Data2 End If If Helm > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Helm).Data2 End If ' New If Legs > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Legs).Data2 End If If Boots > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Boots).Data2 End If If Glove > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Glove).Data2 End If If Ring > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Ring).Data2 End If If Enchant > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Enchant).Data2 End If ' /NewEnd Function
```Second(modPlayer):**Find**:```
Sub CheckEquippedItems(ByVal Index As Long)
```Where it has the 'Select Case i' make yours to look like this noting that the **new items are under helmet and above shield**```
Select Case i Case Equipment.Weapon If Item(ItemNum).Type <> ITEM_TYPE_WEAPON Then SetPlayerEquipment Index, 0, i Case Equipment.Armor If Item(ItemNum).Type <> ITEM_TYPE_ARMOR Then SetPlayerEquipment Index, 0, i 'NEW Case Equipment.Helmet If Item(ItemNum).Type <> ITEM_TYPE_HELMET Then SetPlayerEquipment Index, 0, i Case Equipment.Legs If Item(ItemNum).Type <> ITEM_TYPE_LEGS Then SetPlayerEquipment Index, 0, i Case Equipment.Boots If Item(ItemNum).Type <> ITEM_TYPE_BOOTS Then SetPlayerEquipment Index, 0, i Case Equipment.Glove If Item(ItemNum).Type <> ITEM_TYPE_GLOVE Then SetPlayerEquipment Index, 0, i Case Equipment.Ring If Item(ItemNum).Type <> ITEM_TYPE_RING Then SetPlayerEquipment Index, 0, i Case Equipment.Enchant If Item(ItemNum).Type <> ITEM_TYPE_ENCHANT Then SetPlayerEquipment Index, 0, i ' /New Case Equipment.Shield If Item(ItemNum).Type <> ITEM_TYPE_SHIELD Then SetPlayerEquipment Index, 0, i End Select
```Third(modPlayer):**Find** in **Public Sub UseItem** : **Under this**:```
Case ITEM_TYPE_HELMET ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, Helmet) > 0 Then tempItem = GetPlayerEquipment(Index, Helmet) End If SetPlayerEquipment Index, ItemNum, Helmet PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum
```**Add**This:```
Case ITEM_TYPE_LEGS ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, Legs) > 0 Then tempItem = GetPlayerEquipment(Index, Legs) End If SetPlayerEquipment Index, ItemNum, Legs PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum Case ITEM_TYPE_BOOTS ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, Boots) > 0 Then tempItem = GetPlayerEquipment(Index, Boots) End If SetPlayerEquipment Index, ItemNum, Boots PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum Case ITEM_TYPE_GLOVE ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, Glove) > 0 Then tempItem = GetPlayerEquipment(Index, Glove) End If SetPlayerEquipment Index, ItemNum, Glove PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum Case ITEM_TYPE_RING ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, Ring) > 0 Then tempItem = GetPlayerEquipment(Index, Ring) End If SetPlayerEquipment Index, ItemNum, Ring PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum Case ITEM_TYPE_ENCHANT ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, Enchant) > 0 Then tempItem = GetPlayerEquipment(Index, Enchant) End If SetPlayerEquipment Index, ItemNum, Enchant PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum
```**Or** you can just add this piece of code for every new item you are adding making sure you place it below Helmet and ABOVE Shield Case and changing '####' to the name of the item:
>! ```
Case ITEM_TYPE_#### ' 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 equip 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 equip 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 equip 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 equip this item.", BrightRed Exit Sub End If If GetPlayerEquipment(Index, #####) > 0 Then tempItem = GetPlayerEquipment(Index, ####) End If SetPlayerEquipment Index, ItemNum, #### PlayerMsg Index, "You equip " & CheckGrammar(Item(ItemNum).Name), BrightGreen TakeInvItem Index, ItemNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index) ' send vitals Call SendVital(Index, Vitals.HP) Call SendVital(Index, Vitals.MP) ' send vitals to party if in one If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index ' send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum
```Then move over to **modServerTCP**First Find : **Sub SendWornEquipment(ByVal Index As Long)** And Make it look like this taking note the **new items are below Helmet and above shield**:```
Sub SendWornEquipment(ByVal Index As Long) Dim packet As String Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SPlayerWornEq Buffer.WriteLong GetPlayerEquipment(Index, Armor) Buffer.WriteLong GetPlayerEquipment(Index, Weapon) Buffer.WriteLong GetPlayerEquipment(Index, Helmet) Buffer.WriteLong GetPlayerEquipment(Index, Legs) ' New Buffer.WriteLong GetPlayerEquipment(Index, Boots) ' New Buffer.WriteLong GetPlayerEquipment(Index, Glove) ' New Buffer.WriteLong GetPlayerEquipment(Index, Ring) ' New Buffer.WriteLong GetPlayerEquipment(Index, Enchant) ' New Buffer.WriteLong GetPlayerEquipment(Index, Shield) SendDataTo Index, Buffer.ToArray() Set Buffer = NothingEnd Sub
```Second(modServerTCP):Right under that sub you will see : **Sub SendMapEquipment** Make it look like this :```
Sub SendMapEquipment(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SMapWornEq Buffer.WriteLong Index Buffer.WriteLong GetPlayerEquipment(Index, Armor) Buffer.WriteLong GetPlayerEquipment(Index, Weapon) Buffer.WriteLong GetPlayerEquipment(Index, Helmet) Buffer.WriteLong GetPlayerEquipment(Index, Legs) Buffer.WriteLong GetPlayerEquipment(Index, Boots) Buffer.WriteLong GetPlayerEquipment(Index, Glove) Buffer.WriteLong GetPlayerEquipment(Index, Ring) Buffer.WriteLong GetPlayerEquipment(Index, Enchant) Buffer.WriteLong GetPlayerEquipment(Index, Shield) SendDataToMap GetPlayerMap(Index), Buffer.ToArray() Set Buffer = NothingEnd Sub
```Third(modServerTCP): Find right under that sub: **Sub SendMapEquipmentTo** and **just like before** make it look like this making sure the **new equipment is below helmet and above shield**:```
Sub SendMapEquipmentTo(ByVal PlayerNum As Long, ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SMapWornEq Buffer.WriteLong PlayerNum Buffer.WriteLong GetPlayerEquipment(PlayerNum, Armor) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Weapon) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Helmet) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Legs) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Boots) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Glove) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Ring) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Enchant) Buffer.WriteLong GetPlayerEquipment(PlayerNum, Shield) SendDataTo Index, Buffer.ToArray() Set Buffer = NothingEnd Sub
```That should be all for the Server Side.Client SideFirst go to **modConstants** and make your 'item constants look the same as your server```
' Item constantsPublic Const ITEM_TYPE_NONE As Byte = 0Public Const ITEM_TYPE_WEAPON As Byte = 1Public Const ITEM_TYPE_ARMOR As Byte = 2Public Const ITEM_TYPE_HELMET As Byte = 3Public Const ITEM_TYPE_LEGS As Byte = 4Public Const ITEM_TYPE_BOOTS As Byte = 5Public Const ITEM_TYPE_GLOVE As Byte = 6Public Const ITEM_TYPE_RING As Byte = 7Public Const ITEM_TYPE_ENCHANT As Byte = 8Public Const ITEM_TYPE_SHIELD As Byte = 9Public Const ITEM_TYPE_CONSUME As Byte = 10Public Const ITEM_TYPE_KEY As Byte = 11Public Const ITEM_TYPE_CURRENCY As Byte = 12Public Const ITEM_TYPE_SPELL As Byte = 13
```Second(modConstants): Find **' Character consts** Now this is where your equipment will be drawn on the character window change it to fit your char window and your eq for the picture above i used these settings```
' Character constsPublic Const EqTop As Long = 164Public Const EqLeft As Long = 43Public Const EqOffsetX As Long = 3Public Const EqOffsetY As Long = 4Public Const EqColumns As Long = 3
```Next go to **modGeneral****Find** in **Public Sub Main()**:```
' set the paperdoll order
```And make it look something like this keeping **shield on the bottom**:```
' set the paperdoll order ReDim PaperdollOrder(1 To Equipment.Equipment_Count - 1) As Long PaperdollOrder(1) = Equipment.Armor PaperdollOrder(2) = Equipment.Helmet PaperdollOrder(3) = Equipment.Legs PaperdollOrder(4) = Equipment.Boots PaperdollOrder(5) = Equipment.Glove PaperdollOrder(6) = Equipment.Ring PaperdollOrder(7) = Equipment.Enchant PaperdollOrder(8) = Equipment.Shield PaperdollOrder(9) = Equipment.Weapon
```After that go to **modEnumerations** and do the same thing you did for the server:**Find:**```
' Equipment used by Players
```and make it look like this and the same as you did for the server```
' Equipment used by PlayersPublic Enum Equipment Enchant = 1 Helmet Ring Weapon Armor Shield Glove Legs Boots ' Make sure Equipment_Count is below everything else Equipment_CountEnd Enum
```Now go to **modHandleData**First:**Find: **Sub HandlePlayerWornEq(ByVal Index As Long, ByRef Data()** and **make the sub look like this** keeping the **new items above the shield**:```
Sub HandlePlayerWornEq(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteBytes Data() Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Armor) Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Weapon) Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Helmet) Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Legs) ' New Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Boots) ' NEw Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Glove) ' New Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Ring) ' New Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Enchant) ' New Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Shield) ' changes to inventory, need to clear any drop menu frmMain.picCurrency.Visible = False frmMain.txtCurrency.text = vbNullString tmpCurrencyItem = 0 CurrencyMenu = 0 ' clear BltInventory BltEquipment Set Buffer = Nothing ' Error handler Exit Suberrorhandler: HandleError "HandlePlayerWornEq", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub
```Second(modHandleData):**right under that sub find**:```
Sub HandleMapWornEq(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
```and **change** it to look like this making sure **shield is on bottom**:```
Sub HandleMapWornEq(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBufferDim playerNum As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteBytes Data() playerNum = Buffer.ReadLong Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Armor) Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Weapon) Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Helmet) Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Legs) ' New Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Boots) ' New Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Glove) ' New Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Ring) ' New Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Enchant) ' New Call SetPlayerEquipment(playerNum, Buffer.ReadLong, Shield) Set Buffer = Nothing ' Error handler Exit Suberrorhandler: HandleError "HandleMapWornEq", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub
```Next go to **modDirectDraw7****Find** in **Sub BltEquipment()**:```
With rec_pos .top = EqTop .Bottom = .top + PIC_Y .Left = EqLeft + ((EqOffsetX + 32) * (((i - 1) Mod EqColumns))) .Right = .Left + PIC_X End With
```and **change** to```
With rec_pos .top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns)) .Bottom = .top + PIC_Y .Left = EqLeft + ((EqOffsetX + 32) * (((i - 1) Mod EqColumns))) .Right = .Left + PIC_X End With
```Now open up **frmEditor_Item**Right-click 'cmbType' and click properties: ![]([url]http://www.freemmorp...94534b22f0e.bmp[/url]) [http://www.freemmorp…a705ea8fb13.bmp](http://www.freemmorpgmaker.com/files/imagehost/pics/dcf756c612d15388204bda705ea8fb13.bmp) Then find the 'List' and add the new items ![]([url]http://www.freemmorp...6345c64ae27.bmp[/url])EDIT: Make sure in **frmMain** Find in **Private Function IsEqItem**:```
.Top = EqTop
```And Change to:```
.Top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns))
```and that should be it to add new equipment slots.. All credits to Murdock for showing us how to do this.. **Note your character window will not look like mine just move the picCharacter stuff around alittle to make it fit your needs and edit your character.jpg to fit your equipment slots if neededHere are a couple of character windows if you want them:**
Link to comment
Share on other sites

  • Replies 128
  • Created
  • Last Reply

Top Posters In This Topic

@Justn:

> For anyone having trouble with adding new equipment slots on this tutorial: http://www.touchofdeathforums.com/smf/index.php/topic,64777.0.html
> I have seen alot of people keep asking about this tutorial and how it doesnt work. I am here to tell you that it works fine and I feel it is an insult to Murdock for re-writing the same tutorial, but here it goes and it works. :cheesy:

I'm not insulted at all… perplexed maybe lol.. All you did was organize it a little better, but kudos for that anyway .. Im not a coder and I wrote that tutorial in less than an hour of skimming through code for the hell of it, which shows just how easy it really is to do... now maybe there will be less people complaining that they cant figure out a basic tutorial that is easy enough for a vb beginner, like myself, to figure out (with a little focus and determination that is)
Link to comment
Share on other sites

@SeeingBlue:

> I believe most of the complaints were that they couldn't find a certain line. Not a lot of people here are programmers & are lost by this.
>
> Btw here is a modified char window I made.

12 eq slots wow.. thats a lot of gear for a 2d game lol
Link to comment
Share on other sites

oops i didnt understand what you were saying thanks alot
in modDirectDraw7
find:```
With rec_pos
                .top = EqTop
                .Bottom = .top + PIC_Y
                .Left = EqLeft + ((EqOffsetX + 32) * (((i - 1) Mod EqColumns)))
                .Right = .Left + PIC_X
            End With
```and change to```
With rec_pos
                .top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns))
                .Bottom = .top + PIC_Y
                .Left = EqLeft + ((EqOffsetX + 32) * (((i - 1) Mod EqColumns)))
                .Right = .Left + PIC_X
            End With
```updated tutorial
Link to comment
Share on other sites

I did the tutorial but, at test I get this error at login (from server):

Runtime error '9' subscript out of range

Debug:

    ' Send Resource cache
**For i = 0 To ResourceCache(GetPlayerMap(index)).Resource_Count**
        SendResourceCacheTo index, i
    Next

Please Help!
Link to comment
Share on other sites

why do you need to put the legging before the shield? i dont see any point of doing that. A guy told me that because it help paperdoll order, but you can edit the paperdoll order using a trick. So… what is the point of placing the legging before the shield anyway? I think they would end up giving you the same result.
Link to comment
Share on other sites

there are some parts that use a wep through shield then blah.  so if you placed it on the other side of shield you would have to change that part as well to after your new slot.  this way, you can leave that part alone.
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
@GoldSide:

> Why if I start Game
> Error SubScript Out of Range
>
> If PetMapCache(Player(Index).Map).UpperBound > 0 Then

umm that really has nothing to do with this tutorial but did you delete your accounts and make a new one? Also post the whole sub where the error is and maybe I can try to help you.. :)
Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...