[EO 3.0 - Event System]How to add new Equipment Slots

Thanks to Justn i just changed the things to work in D3D8 (DirectX 😎

http://www.touchofde…ic,75028.0.html

Have Fun 😉

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

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 constants

Public Const ITEM_TYPE_NONE As Byte = 0

Public Const ITEM_TYPE_WEAPON As Byte = 1

Public Const ITEM_TYPE_ARMOR As Byte = 2

Public Const ITEM_TYPE_HELMET As Byte = 3

Public Const ITEM_TYPE_LEGS As Byte = 4 ' New

Public Const ITEM_TYPE_BOOTS As Byte = 5 ' New

Public Const ITEM_TYPE_GLOVE As Byte = 6 ' New

Public Const ITEM_TYPE_RING As Byte = 7 ' New

Public Const ITEM_TYPE_ENCHANT As Byte = 8 ' New

Public Const ITEM_TYPE_SHIELD As Byte = 9

Public Const ITEM_TYPE_CONSUME As Byte = 10

Public Const ITEM_TYPE_KEY As Byte = 11

Public Const ITEM_TYPE_CURRENCY As Byte = 12

Public Const ITEM_TYPE_SPELL As Byte = 13

Next go to modEnumerations

Find :```
’ Equipment used by Players

Public 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 Players

Public Enum Equipment

Enchant = 1

Helmet

Ring

Weapon

Armor

Shield

Glove

Legs

Boots

' Make sure Equipment_Count is below everything else

Equipment_Count

End 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

’ /New

End 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 = Nothing

End 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 = Nothing

End 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 = Nothing

End Sub

That should be all for the Server Side.

Client Side

First go to modConstants and make your 'item constants look the same as your server

' Item constants

Public Const ITEM_TYPE_NONE As Byte = 0

Public Const ITEM_TYPE_WEAPON As Byte = 1

Public Const ITEM_TYPE_ARMOR As Byte = 2

Public Const ITEM_TYPE_HELMET As Byte = 3

Public Const ITEM_TYPE_LEGS As Byte = 4

Public Const ITEM_TYPE_BOOTS As Byte = 5

Public Const ITEM_TYPE_GLOVE As Byte = 6

Public Const ITEM_TYPE_RING As Byte = 7

Public Const ITEM_TYPE_ENCHANT As Byte = 8

Public Const ITEM_TYPE_SHIELD As Byte = 9

Public Const ITEM_TYPE_CONSUME As Byte = 10

Public Const ITEM_TYPE_KEY As Byte = 11

Public Const ITEM_TYPE_CURRENCY As Byte = 12

Public 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 consts

Public Const EqTop As Long = 164

Public Const EqLeft As Long = 43

Public Const EqOffsetX As Long = 3

Public Const EqOffsetY As Long = 4

Public 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 Players

Public Enum Equipment

    Enchant = 1

    Helmet

    Ring

    Weapon

    Armor

    Shield

    Glove

    Legs

    Boots

    ' Make sure Equipment_Count is below everything else

    Equipment_Count

End 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

    frmMain.picInventory.Refresh

    frmMain.picCharacter.Refresh

    Set Buffer = Nothing

    ' Error handler

    Exit Sub

errorhandler:

    HandleError "HandlePlayerWornEq", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext

    Err.Clear

    Exit Sub

End 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 clsBuffer

Dim 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 Sub

errorhandler:

    HandleError "HandleMapWornEq", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext

    Err.Clear

    Exit Sub

End Sub

Next go to modGraphics

Find in Sub DrawEquipment():

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…

Here is the NEW character.jpg

![](http://www7.pic-upload.de/07.10.12/4yijas97bw51.jpg)

put it in /data files/graphics/gui/main/

and make the picCharacter look like the one in the attachments or just copy it ;-)

MortalAngel**

Works fine, only error I could see is that when double click an item to unequip it the image is still visible until you click a different button and go back to the character window.

hmm…
This does not happen to me… only onetime its was showed and is then gone slow
from top to bottom like an HP bar xD but now it happend not to me

“Next go to modDirectDraw7
Find in Sub DrawEquipment()”

Um… Where can I find that in EO 3.0? It is now modGraphics, isnt it?

Oops yes its modgraphics sorry change it

@Mortal:

hmm…
This does not happen to me… only onetime its was showed and is then gone slow
from top to bottom like an HP bar xD but now it happend not to me

Using DX8

Yes my version of eclipse = Eclipse Ultimate (Only german or pay to translate)

@Whack:

Works fine, only error I could see is that when double click an item to unequip it the image is still visible until you click a different button and go back to the character window.

That happens to me as well

Also, this:

I have somehow managed to fix that on my old version, but I dont remember how, I figured out that I was missing one of the “.Top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns))” lines somewhere I think… 😄

Hm i changed nothing what have to do with the pictures hmm… if anyone want send me the source and ill take a look or try it to unequip with right click

@Whack:

Works fine, only error I could see is that when double click an item to unequip it the image is still visible until you click a different button and go back to the character window.

My Solution   (worked for me)  NOTE the red code.

Replace:
DrawInventory
DrawEquipment

with the code in RED

in modHandleData

! 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, Shield)

’ changes to inventory, need to clear any drop menu
    frmMain.picCurrency.Visible = False
    frmMain.txtCurrency.text = vbNullString
    tmpCurrencyItem = 0
    CurrencyMenu = 0 ’ clear

frmMain.picInventory.Refresh  'KEEP
    frmMain.picCharacter.Refresh    'KEEP

Set buffer = Nothing

’ Error handler
    Exit Sub
errorhandler:
    HandleError “HandlePlayerWornEq”, “modHandleData”, Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

Thanks for the Fix
Added to OP

@Mortal:

Hm i changed nothing what have to do with the pictures hmm… if anyone want send me the source and ill take a look or try it to unequip with right click

No, the thing is, I see item equipped on the upper left, but it is when the red cross is. It is also where I have the cursor.

You use the false image… use the one which i use here
If i use this picCharacter and this image for the tutorial so its logically that u need to use these 2 or ? 😉

@Mortal:

You use the false image… use the one which i use here
If i use this picCharacter and this image for the tutorial so its logically that u need to use these 2 or ? 😉

Its image from old version of my game and it has nothing to do with issue I have. I just used it so you could see what my issue is. Image of item is drawn one 32x32 frame up instead of where the item is. If I use my image as example, I have to click red cross to unequip, but as you can see, axe appears to be more up.

hmm then add it again from start to end i think there is an problem with the x / y properties

@Vus:

That happens to me as well

Also, this:

I have somehow managed to fix that on my old version, but I dont remember how, I figured out that I was missing one of the “.Top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns))” lines somewhere I think… 😄

How did you fix this?

Added this ?

EDIT: Make sure in frmMain
Find in Private Function IsEqItem:

.Top = EqTop

```And Change to:

.Top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns))

Yup.

Yea me too. It was something with similiar line when I fixed it last time. I just dont remember what line it was 😄

EDIT: I have tried creating other items, and Everything displays in same line like weapons etc. Text and such are in right place,but icon is in same line.

Everything compiled nicely, but getting error 9, subscript out of range, you able to post up a full version of the Eclipse 3.0 with this feature added in?

Log in to reply