Servidor:
Abajo de :
- Ping '/PING
Agregar:
- Nobleza 'Nobleza
Abajo de:
- Case ClientPacketID.Ping '/PING
- Call HandlePing(UserIndex)
Agregar:
- Case ClientPacketID.Nobleza
- Call HandleNobleza(UserIndex)
Abajo de:
- ''
- ' Handle the "Ping" message
- '
- ' @param userIndex The index of the user sending the message
- Public Sub HandlePing(ByVal UserIndex As Integer)
- '***************************************************
- 'Author: Lucas Tavolaro Ortiz (Tavo)
- 'Last Modification: 12/24/06
- 'Show guilds messages
- '***************************************************
- With UserList(UserIndex)
- 'Remove Packet ID
- Call .incomingData.ReadByte
- Call WritePong(UserIndex)
- End With
- End Sub
Agregar:
- Public Sub HandleNobleza(ByVal UserIndex As Integer)
- 'Código creado para ZAO
- With UserList(UserIndex)
- 'Remove Packet ID
- Call .incomingData.ReadByte
- Dim NumItemNoble As Byte
- NumItemNoble = .incomingData.ReadByte()
- Call ItemsNoble(UserIndex, NumItemNoble)
- 'llamamos al sub itemsnoble
- End With
- End Sub
Creamos un nuevo módulo llamado "Mod_Shak"
Nota muy importante: Si no se llama mod_shak no les va a funcionar!
Contenido del nuevo módulo:
- Option Explicit
- Private PremioItem As Obj
- Public Sub ItemsNoble(ByVal UserIndex As Integer, ByVal Shakfeo As Integer)
- Select Case Shakfeo
- Case 0 'Espada
- PremioItem.Amount = 1 'CAnt de obj
- PremioItem.ObjIndex = 1 'Numero en obj.dat de la espada que te da
- If TieneObjetos(715, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If TieneObjetos(716, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If TieneObjetos(717, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If TieneObjetos(718, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- Call MeterItemEnInventario(UserIndex, USErIndex) 'Metemos el objeto canjeable
- Call QuitarObjetos(ITEM, cantidad, USErIndex) ' Sacamos los objetos que pide si pide 4 objetos ponemos 4 quitarobjetos
- Call QuitarObjetos(ITEM, cantidad, USErIndex) ' Cambiar item y antidad por el numero en obj.dat y la cantidad deseada a sacar.
- Call QuitarObjetos(ITEM, cantidad, USErIndex) 'Hacer lo mismo con el otro case " Casco"
- Call QuitarObjetos(ITEM, cantidad, USErIndex)
- End If
- Case 1 'Casco
- PremioItem.Amount = 1 'CAnt de obj
- PremioItem.ObjIndex = 1 'Numero en obj.dat de la espada que te da
- If TieneObjetos(718, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If TieneObjetos(719, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If TieneObjetos(720, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If TieneObjetos(721, 1, UserIndex) = False Then
- Call WriteConsoleMsg(UserIndex, "No tienes los objetos necesarios", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- Call MeterItemEnInventario(UserIndex, PremioItem)
- End If
- End Select
- End Sub
CLIENTE:
abajo de:
- Ping '/PING
Agregas:
Abajo de:
- Case "/PING"
- Call WritePing
Agregar:
- Case "/ITEMS"
- Call fRMITEMS.Show(vbModeless, frmMain)
ABAJO DE:
- Public Sub WritePing()
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modification: 26/01/2007
- 'Writes the "Ping" message to the outgoing data buffer
- '***************************************************
- 'Prevent the timer from being cut
- If pingTime <> 0 Then Exit Sub
- Call outgoingData.WriteByte(ClientPacketID.Ping)
- ' Avoid computing errors due to frame rate
- Call FlushBuffer
- DoEvents
- pingTime = GetTickCount
- End Sub
Agregar:
- Public Sub writeNobleza(ByVal shakfeo As Byte)
- With outgoingData
- Call .WriteByte(ClientPacketID.Nobleza)
- Call .WriteByte(shakfeo)
- End With
- End Sub
Ahora llega la parte del diseño.
creamos un nuevo formulario llamado "Frmitems"
Creamos 4 Commands y de caption le ponemos la del item que pida.
En el interior de cada commands agregamos
- call writenobleza(0)
Commands dos=
- call writenobleza(1)
Y así con los otros items.
EJ: En el servidor en el mod_shak dice case 0 case 1
estos van a coincidir con el cliente writenobleza(0) writenobleza(1)
así con los otros!
Si no se dan cuenta de algo lo explico






531![Oraculo [5] Oraculo [5]](./images/ranks/Rango29.gif)
![Dragon Ancestral [3] Dragon Ancestral [3]](./images/ranks/Rango32.gif)


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



![Dragon Ancestral [2] Dragon Ancestral [2]](./images/ranks/Rango31.gif)

![Aprendiz [2] Aprendiz [2]](./images/ranks/Rango7.gif)






![Oraculo [2] Oraculo [2]](./images/ranks/Rango26.gif)
