GS-Zone

Meditar Con Particulas (Dx8) Ir al Indice

Moderadores: Moderadores de Argentum, Especialistas de Argentum, Especialistas de Programación

13

Nota » 02 Ago 2011 16:03

Bueno, gente como decidi retirarme del Argentum Online, libero mi ultimo sistema echo para la 12.x sabiendo poco y nada del protocolo. Espero que les guste, mi ultimo aporte en Argentum Online.

Aclaracion:
Para poder implementar el codigo, debemos tener algun sistema de particulas ore en el Argentum Online, ya implementado.


En el cliente:

Buscamos:
  1. CreateFX                ' CFX


Abajo ponemos:


Buscamos:
  1. Case ServerPacketID.CreateFX                ' CFX
  2.             Call HandleCreateFX


Abajo ponemos:
  1. Case ServerPacketID.CreateParticle          ' CFF
  2.             Call HandleCreateParticle


Buscamos:
  1. ''
  2. ' Handles the CreateFX message.
  3.  
  4. Private Sub HandleCreateFX()
  5. '***************************************************
  6. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  7. 'Last Modification: 05/17/06
  8. '
  9. '***************************************************
  10.     If incomingData.length < 7 Then
  11.         Err.Raise incomingData.NotEnoughDataErrCode
  12.         Exit Sub
  13.     End If
  14.    
  15.     'Remove packet ID
  16.     Call incomingData.ReadByte
  17.    
  18.     Dim CharIndex As Integer
  19.     Dim fX As Integer
  20.     Dim Loops As Integer
  21.    
  22.     CharIndex = incomingData.ReadInteger()
  23.     fX = incomingData.ReadInteger()
  24.     Loops = incomingData.ReadInteger()
  25.    
  26.     Call SetCharacterFx(CharIndex, fX, Loops)
  27. End Sub


Abajo ponemos:
  1. ''
  2. ' Handles the CreateParticle message.
  3.  
  4. Private Sub HandleCreateParticle()
  5. '***************************************************
  6. 'Author: Martín Gomez (Samke)
  7. 'Last Modification: 01/08/11
  8. '
  9. '***************************************************
  10.     If incomingData.length < 7 Then
  11.         Err.Raise incomingData.NotEnoughDataErrCode
  12.         Exit Sub
  13.     End If
  14.    
  15.     'Remove packet ID
  16.     Call incomingData.ReadByte
  17.    
  18.     Dim CharIndex As Integer
  19.    
  20.     CharIndex = incomingData.ReadInteger()
  21.     charlist(CharIndex).particle_count = incomingData.ReadInteger()
  22.    
  23.     Call General_Char_Particle_Create(charlist(CharIndex).particle_count, CharIndex)
  24.     Call RefreshAllChars
  25. End Sub


En el servidor:

Buscamos:
  1. CreateFX                ' CFX


Abajo ponemos:


Abajo de todo el mod Protocol ponemos:
  1. ''
  2. ' Prepares the "CreateParticle" message and returns it.
  3. '
  4. ' @param    UserIndex User to which the message is intended.
  5. ' @param    CharIndex Character upon which the Particle will be created.
  6. ' @param    Particle Particle index to be displayed over the new character.
  7. ' @param    ParticleLoops Number of times the Particle should be rendered.
  8. ' @return   The formated message ready to be writen as is on outgoing buffers.
  9. ' @remarks  The data is not actually sent until the buffer is properly flushed.
  10.  
  11. Public Function PrepareMessageCreateParticle(ByVal CharIndex As Integer, ByVal Particle As Integer, ByVal ParticleLoops As Integer) As String
  12. '***************************************************
  13. 'Author: Martín Gomez (Samke)
  14. 'Last Modification: 01/08/11
  15. 'Prepares the "CreateParticle" message and returns it
  16. '***************************************************
  17.     With auxiliarBuffer
  18.         Call .WriteByte(ServerPacketID.CreateParticle)
  19.         Call .WriteInteger(CharIndex)
  20.         Call .WriteInteger(Particle)
  21.         Call .WriteInteger(ParticleLoops)
  22.        
  23.         PrepareMessageCreateParticle = .ReadASCIIStringFixed(.length)
  24.     End With
  25. End Function
  26.  
  27. ''
  28. ' Writes the "CreateParticle" message to the given user's outgoing data buffer.
  29. '
  30. ' @param    UserIndex User to which the message is intended.
  31. ' @param    CharIndex Character upon which the Particle will be created.
  32. ' @param    Particle Particle index to be displayed over the new character.
  33. ' @param    ParticleLoops Number of times the Particle should be rendered.
  34. ' @remarks  The data is not actually sent until the buffer is properly flushed.
  35.  
  36. Public Sub WriteCreateParticle(ByVal UserIndex As Integer, ByVal CharIndex As Integer, ByVal Particle As Integer, ByVal ParticleLoops As Integer)
  37. '***************************************************
  38. 'Author: Martín Gomez (Samke)
  39. 'Last Modification: 01/08/11
  40. 'Writes the "CreateParticle" message to the given user's outgoing data buffer
  41. '***************************************************
  42. On Error GoTo Errhandler
  43.     Call UserList(UserIndex).outgoingData.WriteASCIIStringFixed(PrepareMessageCreateParticle(CharIndex, Particle, ParticleLoops))
  44. Exit Sub
  45.  
  46. Errhandler:
  47.     If Err.Number = UserList(UserIndex).outgoingData.NotEnoughSpaceErrCode Then
  48.         Call FlushBuffer(UserIndex)
  49.         Resume
  50.     End If
  51. End Sub


Buscamos el sub:
  1. Private Sub HandleMeditate(ByVal UserIndex As Integer)


Remplazamos por:
  1. ''
  2. ' Handles the "Meditate" message.
  3. '
  4. ' @param    userIndex The index of the user sending the message.
  5.  
  6. Private Sub HandleMeditate(ByVal UserIndex As Integer)
  7. '***************************************************
  8. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  9. 'Last Modification: 01/08/11 (Samke)
  10. 'Implemente el Sistema de Particulas al Meditar
  11. '***************************************************
  12.     With UserList(UserIndex)
  13.         'Remove packet ID
  14.         Call .incomingData.ReadByte
  15.        
  16.         'Dead users can't use pets
  17.         If .flags.Muerto = 1 Then
  18.             Call WriteConsoleMsg(UserIndex, "¡¡Estás muerto!! Solo podés usar meditar cuando estás vivo.", FontTypeNames.FONTTYPE_INFO)
  19.             Exit Sub
  20.         End If
  21.        
  22.         'Can he meditate?
  23.         If .Stats.MaxMAN = 0 Then
  24.              Call WriteConsoleMsg(UserIndex, "Sólo las clases mágicas conocen el arte de la meditación", FontTypeNames.FONTTYPE_INFO)
  25.              Exit Sub
  26.         End If
  27.        
  28.         'Admins don't have to wait :D
  29.         If Not .flags.Privilegios And PlayerType.User Then
  30.             .Stats.MinMAN = .Stats.MaxMAN
  31.             Call WriteConsoleMsg(UserIndex, "Mana restaurado", FontTypeNames.FONTTYPE_VENENO)
  32.             Call WriteUpdateMana(UserIndex)
  33.             Exit Sub
  34.         End If
  35.        
  36.         Call WriteMeditateToggle(UserIndex)
  37.        
  38.         If .flags.Meditando Then _
  39.            Call WriteConsoleMsg(UserIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  40.        
  41.         .flags.Meditando = Not .flags.Meditando
  42.        
  43.         'Barrin 3/10/03 Tiempo de inicio al meditar
  44.         If .flags.Meditando Then
  45.             .Counters.tInicioMeditar = GetTickCount() And &H7FFFFFFF
  46.            
  47.             Call WriteConsoleMsg(UserIndex, "Te estás concentrando. En " & Fix(TIEMPO_INICIOMEDITAR / 1000) & " segundos comenzarás a meditar.", FontTypeNames.FONTTYPE_INFO)
  48.            
  49.             .Char.loops = INFINITE_LOOPS
  50.            
  51.             'Show proper Particle according to level
  52.             If .Stats.ELV < 13 Then
  53.                 .Char.Particle = FXIDs.FXMEDITARCHICO
  54.            
  55.             ElseIf .Stats.ELV < 25 Then
  56.                 .Char.Particle = FXIDs.FXMEDITARMEDIANO
  57.            
  58.             ElseIf .Stats.ELV < 35 Then
  59.                 .Char.Particle = FXIDs.FXMEDITARGRANDE
  60.            
  61.             ElseIf .Stats.ELV < 42 Then
  62.                 .Char.Particle = FXIDs.FXMEDITARXGRANDE
  63.            
  64.             Else
  65.                 .Char.Particle = FXIDs.FXMEDITARXXGRANDE
  66.             End If
  67.            
  68.             Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateParticle(.Char.CharIndex, .Char.Particle, INFINITE_LOOPS))
  69.         Else
  70.             .Counters.bPuedeMeditar = False
  71.            
  72.             .Char.Particle = 0
  73.             .Char.loops = 0
  74.             Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateParticle(.Char.CharIndex, 0, 0))
  75.         End If
  76.     End With
  77. End Sub


Buscamos:


Remplazamos hasta end enum por:
  1. Public Enum FXIDs  ' Numero de Particulas, puse las de 11.5
  2.     FXWARP = 1
  3.     FXMEDITARCHICO = 34
  4.     FXMEDITARMEDIANO = 2
  5.     FXMEDITARGRANDE = 35
  6.     FXMEDITARXGRANDE = 36
  7.     FXMEDITARXXGRANDE = 36
  8. End Enum


Buscamos:
  1. UserList(UserIndex).Char.FX = 0
  2. UserList(UserIndex).Char.loops = 0
  3. Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateFX(UserList(UserIndex).Char.CharIndex, 0, 0))


Abajo ponemos:
  1. UserList(UserIndex).Char.Particle = 0
  2. UserList(UserIndex).Char.loops = 0
  3. Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateParticle(UserList(UserIndex).Char.CharIndex, 0, 0))


Buscamos:
  1. If UserList(UserIndex).Stats.MinMAN >= UserList(UserIndex).Stats.MaxMAN Then
  2.     Call WriteConsoleMsg(UserIndex, "Has terminado de meditar.", FontTypeNames.FONTTYPE_INFO)
  3.     Call WriteMeditateToggle(UserIndex)
  4.     UserList(UserIndex).flags.Meditando = False
  5.     UserList(UserIndex).Char.FX = 0
  6.     UserList(UserIndex).Char.loops = 0
  7.     Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateFX(UserList(UserIndex).Char.CharIndex, 0, 0))
  8.     Exit Sub
  9. End If


Remplazamos por:
  1. If UserList(UserIndex).Stats.MinMAN >= UserList(UserIndex).Stats.MaxMAN Then
  2.     Call WriteConsoleMsg(UserIndex, "Has terminado de meditar.", FontTypeNames.FONTTYPE_INFO)
  3.     Call WriteMeditateToggle(UserIndex)
  4.     UserList(UserIndex).flags.Meditando = False
  5.     UserList(UserIndex).Char.Particle = 0
  6.     UserList(UserIndex).Char.loops = 0
  7.     Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateParticle(UserList(UserIndex).Char.CharIndex, 0, 0))
  8.     Exit Sub
  9. End If


Buscamos:
  1. If UserList(UserIndex).flags.Meditando Then
  2.     If daño > Fix(UserList(UserIndex).Stats.MinHP / 100 * UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) * UserList(UserIndex).Stats.UserSkills(eSkill.Meditar) / 100 * 12 / (RandomNumber(0, 5) + 7)) Then
  3.         UserList(UserIndex).flags.Meditando = False
  4.         Call WriteMeditateToggle(UserIndex)
  5.         Call WriteConsoleMsg(UserIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  6.         UserList(UserIndex).Char.FX = 0
  7.         UserList(UserIndex).Char.loops = 0
  8.         Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateFX(UserList(UserIndex).Char.CharIndex, 0, 0))
  9.     End If
  10. End If


Remplazamos por:
  1. If UserList(UserIndex).flags.Meditando Then
  2.     If daño > Fix(UserList(UserIndex).Stats.MinHP / 100 * UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) * UserList(UserIndex).Stats.UserSkills(eSkill.Meditar) / 100 * 12 / (RandomNumber(0, 5) + 7)) Then
  3.         UserList(UserIndex).flags.Meditando = False
  4.         Call WriteMeditateToggle(UserIndex)
  5.         Call WriteConsoleMsg(UserIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  6.         UserList(UserIndex).Char.Particle = 0
  7.         UserList(UserIndex).Char.loops = 0
  8.         Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateParticle(UserList(UserIndex).Char.CharIndex, 0, 0))
  9.     End If
  10. End If


Buscamos:
  1. If UserList(VictimIndex).flags.Meditando Then
  2.         UserList(VictimIndex).flags.Meditando = False
  3.         Call WriteMeditateToggle(VictimIndex)
  4.         Call WriteConsoleMsg(VictimIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  5.         UserList(VictimIndex).Char.FX = 0
  6.         UserList(VictimIndex).Char.loops = 0
  7.         Call SendData(SendTarget.ToPCArea, VictimIndex, PrepareMessageCreateFX(UserList(VictimIndex).Char.CharIndex, 0, 0))
  8.     End If


Remplazamos por:
  1. If UserList(VictimIndex).flags.Meditando Then
  2.         UserList(VictimIndex).flags.Meditando = False
  3.         Call WriteMeditateToggle(VictimIndex)
  4.         Call WriteConsoleMsg(VictimIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  5.         UserList(VictimIndex).Char.Particle = 0
  6.         UserList(VictimIndex).Char.loops = 0
  7.         Call SendData(SendTarget.ToPCArea, VictimIndex, PrepareMessageCreateParticle(UserList(VictimIndex).Char.CharIndex, 0, 0))
  8.     End If


Buscamos:
  1. If .flags.Paralizado = 0 Then
  2.             If .flags.Meditando Then
  3.                 'Stop meditating, next action will start movement.
  4.                 .flags.Meditando = False
  5.                 .Char.FX = 0
  6.                 .Char.loops = 0
  7.                
  8.                 Call WriteMeditateToggle(UserIndex)
  9.                 Call WriteConsoleMsg(UserIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  10.                
  11.                 Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateFX(.Char.CharIndex, 0, 0))
  12.             Else


Remplazamos por:
  1. If .flags.Paralizado = 0 Then
  2.             If .flags.Meditando Then
  3.                 'Stop meditating, next action will start movement.
  4.                 .flags.Meditando = False
  5.                 .Char.Particle = 0
  6.                 .Char.loops = 0
  7.                
  8.                 Call WriteMeditateToggle(UserIndex)
  9.                 Call WriteConsoleMsg(UserIndex, "Dejas de meditar.", FontTypeNames.FONTTYPE_INFO)
  10.                
  11.                 Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateParticle(.Char.CharIndex, 0, 0))
  12.             Else


En el Public Type Char ponemos:


Muestra:
Imagen

Saludos ^^
Última edición por Samke el 02 Ago 2011 16:36, editado 2 veces en total

Imagen
Imagen
Staff Zeiked-Games
641
Dragon Ancestral [3]
Registrado: Años de membresíaAños de membresía
Ubicación: Castelar
Mensajes: 3416
Aportes: 66
Premios: 3
Usuario omnipresente (1) Embajador (2)

Nota » 02 Ago 2011 16:04

Sos un genio Samke! (:
Me encataaa! ;)

.

SE REALISTA, SOÑA LO IMPOSIBLE.


Imagen

Gracias Zaphiro...
«mens et manus»
72
Oraculo [1]
Registrado: Años de membresíaAños de membresíaAños de membresía
Ubicación: Pedro Luro
Mensajes: 1207
Aportes: 21
Premios: 2
Embajador (2)

Nota » 02 Ago 2011 16:06

Excelente bldo! buen aporte!

Imagen
- IDE -
730
Moderador Global
Registrado: Años de membresíaAños de membresía
Ubicación: Sídney
Mensajes: 5335
Aportes: 47
Premios: 6
Especial de Navidad (1) Señor Organizador (1) Señor Reglamento (2) Reportes resueltos (1) Embajador (1)

Nota » 02 Ago 2011 16:08

No me pidas más ayuda, te pedí porfavor que no aportes esto... Ahora la gente llena de Mods de 12.1 con DX8.

Adiós.

Director del Proyecto IndeX - AO
Mannakia escribió:Closed moderhipocradores , tema ya solucionado, jesus me ilumino en un sueño, y programamos junto, la verdad un genio, sabe lenguaje V** (V Multiply Multiply) que es sobre como programaron las primeras microcelulas.

Dunkan escribió:Chiters?, Pero esto no tenía la "Samke Security" ?

Imagen
Imagen
Programador
356
Dragon Ancestral [6]
Registrado: Años de membresíaAños de membresíaAños de membresíaAños de membresía
Mensajes: 4550
Aportes: 46
Premios: 2
Usuario superado (2)

Nota » 02 Ago 2011 16:10

Buen aporte.

Hola Lord.

Holis
ADM 2013
561
Dragon Ancestral [3]
Registrado: Años de membresíaAños de membresía
Ubicación: Argentina
Mensajes: 3112
Aportes: 9

Nota » 02 Ago 2011 16:18

Vale aclarar que tienen que Implementar Ore, y no cualquier sistema de particulas ;)...

Además, tienen que tener el sub General_Char_Particle_Create, que crea en el Char las partículas...

Adiós.

Hola Faqe.

Director del Proyecto IndeX - AO
Mannakia escribió:Closed moderhipocradores , tema ya solucionado, jesus me ilumino en un sueño, y programamos junto, la verdad un genio, sabe lenguaje V** (V Multiply Multiply) que es sobre como programaron las primeras microcelulas.

Dunkan escribió:Chiters?, Pero esto no tenía la "Samke Security" ?

Imagen
Imagen
Programador
356
Dragon Ancestral [6]
Registrado: Años de membresíaAños de membresíaAños de membresíaAños de membresía
Mensajes: 4550
Aportes: 46
Premios: 2
Usuario superado (2)

Nota » 02 Ago 2011 16:37

Lord Fers escribió:Vale aclarar que tienen que Implementar Ore, y no cualquier sistema de particulas ;)...

Además, tienen que tener el sub General_Char_Particle_Create, que crea en el Char las partículas...

Adiós.

Hola Faqe.


Los sistemas de Particulas Ore, lo traen, gracias me falto poner ore.

Saludos ^^

Imagen
Imagen
Staff Zeiked-Games
641
Dragon Ancestral [3]
Registrado: Años de membresíaAños de membresía
Ubicación: Castelar
Mensajes: 3416
Aportes: 66
Premios: 3
Usuario omnipresente (1) Embajador (2)

Nota » 02 Ago 2011 16:50

Samke escribió:
Lord Fers escribió:Vale aclarar que tienen que Implementar Ore, y no cualquier sistema de particulas ;)...

Además, tienen que tener el sub General_Char_Particle_Create, que crea en el Char las partículas...

Adiós.

Hola Faqe.


Los sistemas de Particulas Ore, lo traen, gracias me falto poner ore.

Saludos ^^

Ese sub no lo trae ore, cuando aportaron muchos códigos de Ore en 2009 en 11.5, como todos copy pasteaban el Ore del IAO, dejaron General_Char_Particle_Create, que es el mismo de IAO...

Adiós.

Director del Proyecto IndeX - AO
Mannakia escribió:Closed moderhipocradores , tema ya solucionado, jesus me ilumino en un sueño, y programamos junto, la verdad un genio, sabe lenguaje V** (V Multiply Multiply) que es sobre como programaron las primeras microcelulas.

Dunkan escribió:Chiters?, Pero esto no tenía la "Samke Security" ?

Imagen
Imagen
Programador
356
Dragon Ancestral [6]
Registrado: Años de membresíaAños de membresíaAños de membresíaAños de membresía
Mensajes: 4550
Aportes: 46
Premios: 2
Usuario superado (2)

Nota » 02 Ago 2011 18:25

Hacelo con el sistema de partículas que viene aportado en el cliente 12.x DX8..

Imagen
201.212.4.161:27030


''Tagiamos G5, jugamos por GS-Zone''
<Acá hay mafia y me los cargo a todos en la espalda>
No acepto críticas ni comentario de ignorantes.
549
G5 TeamDragon Ancestral [1]
Registrado: Años de membresíaAños de membresíaAños de membresía
Ubicación: Villa Regina - Rio Negro
Mensajes: 2682
Aportes: 16

Nota » 03 Ago 2011 12:33

Está liberado en fenix xD !

Muy lindo samke :)
Última edición por Dunkan el 03 Ago 2011 12:33, editado 1 vez en total
All we need is love
475
Oraculo [5]
Registrado: Años de membresíaAños de membresía
Ubicación: Mar del Plata
Mensajes: 2002
Aportes: 30
Premios: 1
Mister Programador AO (1)

Nota » 03 Ago 2011 15:19

Lanzers escribió:Hacelo con el sistema de partículas que viene aportado en el cliente 12.x DX8..

Es exactamente lo que hago yo. (Va hacía, porque lo tuve que adaptar al de Ore, porque quité las de Menduz y fue algo MUY al pedo, ORE = Optimización en el ANO)...


Dunkan escribió:Está liberado en fenix xD !

Muy lindo samke :)

¿Que es lo que liberaron en fenix? =$

Director del Proyecto IndeX - AO
Mannakia escribió:Closed moderhipocradores , tema ya solucionado, jesus me ilumino en un sueño, y programamos junto, la verdad un genio, sabe lenguaje V** (V Multiply Multiply) que es sobre como programaron las primeras microcelulas.

Dunkan escribió:Chiters?, Pero esto no tenía la "Samke Security" ?

Imagen
Imagen
Programador
356
Dragon Ancestral [6]
Registrado: Años de membresíaAños de membresíaAños de membresíaAños de membresía
Mensajes: 4550
Aportes: 46
Premios: 2
Usuario superado (2)

Nota » 03 Ago 2011 18:03

All we need is love
475
Oraculo [5]
Registrado: Años de membresíaAños de membresía
Ubicación: Mar del Plata
Mensajes: 2002
Aportes: 30
Premios: 1
Mister Programador AO (1)

Nota » 03 Ago 2011 20:01

Lord Fers escribió:No me pidas más ayuda, te pedí porfavor que no aportes esto... Ahora la gente llena de Mods de 12.1 con DX8.

Adiós.


Pero si es facil... :P

Saludos y buen aporte.

Imagen
169
Oraculo [5]
Registrado: Años de membresíaAños de membresía
Mensajes: 2021
Aportes: 13
Premios: 1
Embajador (1)


Volver a AO 0.12.x

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados