Comenzamos na mejor no tengo sueñito no duermo hace 2 dias
ta bien comenzamos
- 3 , 2 ,1 YAAAAAAAAAAAAAAAA
Bueno en el cliente buscamos
- Private Sub HandleChangeInventorySlot()
y Remplazamos hasta el end sub
Por esto
- ''
- ' Handles the ChangeInventorySlot message.
- Private Sub HandleChangeInventorySlot()
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modification: 05/17/06
- '
- '***************************************************
- If incomingData.length < 22 Then
- Err.Raise incomingData.NotEnoughDataErrCode
- Exit Sub
- End If
- On Error GoTo ErrHandler
- 'This packet contains strings, make a copy of the data to prevent losses if it's not complete yet...
- Dim Buffer As New clsByteQueue
- Call Buffer.CopyBuffer(incomingData)
- 'Remove packet ID
- Call Buffer.ReadByte
- Dim slot As Byte
- Dim OBJIndex As Integer
- Dim Name As String
- Dim Amount As Integer
- Dim Equipped As Boolean
- Dim grhindex As Integer
- Dim OBJType As Byte
- Dim MaxHit As Integer
- Dim MinHit As Integer
- Dim defense As Integer
- Dim MaxDef As Integer
- Dim MinDef As Integer
- Dim value As Single
- slot = Buffer.ReadByte()
- OBJIndex = Buffer.ReadInteger()
- Name = Buffer.ReadASCIIString()
- Amount = Buffer.ReadInteger()
- Equipped = Buffer.ReadBoolean()
- grhindex = Buffer.ReadInteger()
- OBJType = Buffer.ReadByte()
- MaxHit = Buffer.ReadInteger()
- MinHit = Buffer.ReadInteger()
- defense = Buffer.ReadInteger()
- MaxDef = Buffer.ReadInteger()
- MinDef = Buffer.ReadInteger
- value = Buffer.ReadSingle()
- If Equipped Then
- Select Case OBJType
- Case eObjType.otWeapon
- frmMain.lblWeapon = MinHit & "/" & MaxHit
- UserWeaponEqpSlot = slot
- Case eObjType.otArmadura
- frmMain.lblArmor = MinDef & "/" & MaxDef
- UserArmourEqpSlot = slot
- Case eObjType.otescudo
- frmMain.lblShielder = MinDef & "/" & MaxDef
- UserHelmEqpSlot = slot
- Case eObjType.otcasco
- frmMain.lblHelm = MinDef & "/" & MaxDef
- UserShieldEqpSlot = slot
- End Select
- Else
- Select Case slot
- Case UserWeaponEqpSlot
- frmMain.lblWeapon = "0/0"
- UserWeaponEqpSlot = 0
- Case UserArmourEqpSlot
- frmMain.lblArmor = "0/0"
- UserArmourEqpSlot = 0
- Case UserHelmEqpSlot
- frmMain.lblShielder = "0/0"
- UserHelmEqpSlot = 0
- Case UserShieldEqpSlot
- frmMain.lblHelm = "0/0"
- UserShieldEqpSlot = 0
- End Select
- End If
- Call Inventario.SetItem(slot, OBJIndex, Amount, Equipped, grhindex, OBJType, MaxHit, MinHit, defense, MaxDef, MinDef, value, Name)
- 'If we got here then packet is complete, copy data back to original queue
- Call incomingData.CopyBuffer(Buffer)
- ErrHandler:
- Dim error As Long
- error = Err.number
- On Error GoTo 0
- 'Destroy auxiliar buffer
- Set Buffer = Nothing
- If error <> 0 Then Err.Raise error
- End Sub
Declaramos
- Public UserWeaponEqpSlot As Byte
- Public UserArmourEqpSlot As Byte
- Public UserHelmEqpSlot As Byte
- Public UserShieldEqpSlot As Byte
Buscamos
- Type Inventory
y remplazamos todo el type por
- 'Inventario
- Type Inventory
- OBJIndex As Integer
- Name As String
- grhindex As Integer
- '[Alejo]: tipo de datos ahora es Long
- Amount As Long
- '[/Alejo]
- Equipped As Byte
- Valor As Single
- OBJType As Integer
- Def As Integer
- MaxHit As Integer
- MinHit As Integer
- MaxDef As Integer
- MinDef As Integer 'Budi
- End Type
Buscamos
- Public Property Get OBJIndex(ByVal slot As Byte) As Integer
y arriba agregamos
- Public Property Get MaxDef(ByVal slot As Byte) As Integer
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modify Date: 27/07/04
- 'Retrieves the defense of the selected item
- '***************************************************
- MaxDef = UserInventory(slot).MaxDef
- End Property
- Public Property Get MinDef(ByVal slot As Byte) As Integer
- '***************************************************
- 'Author: Budi
- 'Last Modify Date: 02/1209
- 'Retrieves the defense of the selected item
- '***************************************************
- MinDef = UserInventory(slot).MinDef
- End Property
Ahora buscamos y remplazamos hasta el end sub
- Public Sub SetItem
por
- Public Sub SetItem(ByVal slot As Byte, ByVal eOBJIndex As Integer, ByVal _
- eAmount As Integer, ByVal eEquipped As Byte, ByVal eGrhIndex As Integer, ByVal _
- eObjType As Integer, ByVal eMaxHit As Integer, ByVal eMinHit As Integer, ByVal _
- eDef As Integer, ByVal MaxDef As Integer, ByVal MinDef As Integer, ByVal eValor As Single, ByVal eName As String)
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modify Date: 12/04/06
- 'Sets all data for a given inventory slot
- '***************************************************
- If slot < 1 Or slot > MAX_INVENTORY_SLOTS Then Exit Sub
- With UserInventory(slot)
- .Amount = eAmount
- .Def = eDef
- .MaxDef = MaxDef
- .MinDef = MinDef
- .Equipped = eEquipped
- .grhindex = eGrhIndex
- .MaxHit = eMaxHit
- .MinHit = eMinHit
- .Name = eName
- .OBJIndex = eOBJIndex
- .OBJType = eObjType
- .Valor = eValor
- End With
- End Sub
Ahora vamos al frmmain
y creamos
4 labels
con los nombres de
- lblWeapon
- lblShielder
- lblHelm
- lblArmor
Y lesto el cliente
Ahora vamos al servidor
Buscamos y remplazamos el
- Public Sub WriteChangeInventorySlot(ByVal UserIndex As Integer, ByVal Slot As Byte)
por
- ''
- ' Writes the "ChangeInventorySlot" message to the given user's outgoing data buffer.
- '
- ' @param UserIndex User to which the message is intended.
- ' @param slot Inventory slot which needs to be updated.
- ' @remarks The data is not actually sent until the buffer is properly flushed.
- Public Sub WriteChangeInventorySlot(ByVal UserIndex As Integer, ByVal Slot As Byte)
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modification: 3/12/09
- 'Writes the "ChangeInventorySlot" message to the given user's outgoing data buffer
- '3/12/09: Budi - Ahora se envia MaxDef y MinDef en lugar de Def
- '***************************************************
- On Error GoTo Errhandler
- With UserList(UserIndex).outgoingData
- Call .WriteByte(ServerPacketID.ChangeInventorySlot)
- Call .WriteByte(Slot)
- Dim ObjIndex As Integer
- Dim obData As ObjData
- ObjIndex = UserList(UserIndex).Invent.Object(Slot).ObjIndex
- If ObjIndex > 0 Then
- obData = ObjData(ObjIndex)
- End If
- Call .WriteInteger(ObjIndex)
- Call .WriteASCIIString(obData.name)
- Call .WriteInteger(UserList(UserIndex).Invent.Object(Slot).amount)
- Call .WriteBoolean(UserList(UserIndex).Invent.Object(Slot).Equipped)
- Call .WriteInteger(obData.GrhIndex)
- Call .WriteByte(obData.OBJType)
- Call .WriteInteger(obData.MaxHIT)
- Call .WriteInteger(obData.MinHIT)
- Call .WriteInteger(obData.def)
- Call .WriteInteger(obData.MaxDef)
- Call .WriteInteger(obData.MinDef)
- Call .WriteSingle(SalePrice(ObjIndex))
- End With
- Exit Sub
- Errhandler:
- If Err.Number = UserList(UserIndex).outgoingData.NotEnoughSpaceErrCode Then
- Call FlushBuffer(UserIndex)
- Resume
- End If
- End Sub
Buenos eso es todo suerte y feliz año 2009 (?





924![Dragon Ancestral [5] Dragon Ancestral [5]](./images/ranks/Rango34.gif)

![Newbie [4] Newbie [4]](./images/ranks/Rango3.gif)

![Dragon Ancestral [4] Dragon Ancestral [4]](./images/ranks/Rango33.gif)



![Dragon Ancestral [3] Dragon Ancestral [3]](./images/ranks/Rango32.gif)

![Aprendiz [1] Aprendiz [1]](./images/ranks/Rango6.gif)
