GS-Zone

No pega a los usuarios Ir al Indice

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

3

Nota » 20 Mar 2011 15:33

No me pega a los usuarios a los bichos si a los user no por favor diganme que parte deberia revisar DIOS no pega y ya tengo tood el server listo para lanzar.
Usuario Registrado
Newbie [2]
Registrado: Años de membresía
Mensajes: 49

Nota » 20 Mar 2011 19:34

Reemplaza este sub por el tuyo:

  1.  
  2. Public Sub UsuarioAtaca(ByVal UserIndex As Integer)
  3.     Dim index As Integer
  4.     Dim AttackPos As WorldPos
  5.    
  6.     'Check bow's interval
  7.     If Not IntervaloPermiteUsarArcos(UserIndex, False) Then Exit Sub
  8.    
  9.     'Check Spell-Magic interval
  10.     If Not IntervaloPermiteMagiaGolpe(UserIndex) Then
  11.         'Check Attack interval
  12.         If Not IntervaloPermiteAtacar(UserIndex) Then
  13.             Exit Sub
  14.         End If
  15.     End If
  16.    
  17.     With UserList(UserIndex)
  18.         'Quitamos stamina
  19.         If .Stats.MinSta >= 10 Then
  20.             Call QuitarSta(UserIndex, RandomNumber(1, 10))
  21.         Else
  22.             If .genero = eGenero.Hombre Then
  23.                 Call WriteConsoleMsg(UserIndex, "Estas muy cansado para luchar.", FontTypeNames.FONTTYPE_INFO)
  24.             Else
  25.                 Call WriteConsoleMsg(UserIndex, "Estas muy cansada para luchar.", FontTypeNames.FONTTYPE_INFO)
  26.             End If
  27.             Exit Sub
  28.         End If
  29.        
  30.         AttackPos = .Pos
  31.         Call HeadtoPos(.Char.heading, AttackPos)
  32.        
  33.         'Exit if not legal
  34.         If AttackPos.X < XMinMapSize Or AttackPos.X > XMaxMapSize Or AttackPos.Y <= YMinMapSize Or AttackPos.Y > YMaxMapSize Then
  35.             Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessagePlayWave(SND_SWING, .Pos.X, .Pos.Y))
  36.             Exit Sub
  37.         End If
  38.        
  39.         index = MapData(AttackPos.map, AttackPos.X, AttackPos.Y).UserIndex
  40.        
  41.         'Look for user
  42.         If index > 0 Then
  43.             Call UsuarioAtacaUsuario(UserIndex, index)
  44.             Call WriteUpdateUserStats(UserIndex)
  45.             Call WriteUpdateUserStats(index)
  46.             Exit Sub
  47.         End If
  48.        
  49.         index = MapData(AttackPos.map, AttackPos.X, AttackPos.Y).NpcIndex
  50.        
  51.         'Look for NPC
  52.         If index > 0 Then
  53.             If Npclist(index).Attackable Then
  54.                 If Npclist(index).MaestroUser > 0 And MapInfo(Npclist(index).Pos.map).Pk = False Then
  55.                     Call WriteConsoleMsg(UserIndex, "No podés atacar mascotas en zonas seguras", FontTypeNames.FONTTYPE_FIGHT)
  56.                     Exit Sub
  57.                 End If
  58.                
  59.                 Call UsuarioAtacaNpc(UserIndex, index)
  60.             Else
  61.                 Call WriteConsoleMsg(UserIndex, "No podés atacar a este NPC", FontTypeNames.FONTTYPE_FIGHT)
  62.             End If
  63.            
  64.             Call WriteUpdateUserStats(UserIndex)
  65.            
  66.             Exit Sub
  67.         End If
  68.        
  69.         Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessagePlayWave(SND_SWING, .Pos.X, .Pos.Y))
  70.         Call WriteUpdateUserStats(UserIndex)
  71.        
  72.         If .Counters.Trabajando Then .Counters.Trabajando = .Counters.Trabajando - 1
  73.            
  74.         If .Counters.Ocultando Then .Counters.Ocultando = .Counters.Ocultando - 1
  75.     End With
  76. End Sub
  77.  


Y este otro por este:

  1.  
  2. Public Sub UsuarioAtacaUsuario(ByVal AtacanteIndex As Integer, ByVal VictimaIndex As Integer)
  3.  
  4. On Error GoTo Errhandler
  5.  
  6.     If Not PuedeAtacar(AtacanteIndex, VictimaIndex) Then Exit Sub
  7.    
  8.     With UserList(AtacanteIndex)
  9.         If Distancia(.Pos, UserList(VictimaIndex).Pos) > MAXDISTANCIAARCO Then
  10.            Call WriteConsoleMsg(AtacanteIndex, "Estás muy lejos para disparar.", FontTypeNames.FONTTYPE_FIGHT)
  11.            Exit Sub
  12.         End If
  13.        
  14.         Call UsuarioAtacadoPorUsuario(AtacanteIndex, VictimaIndex)
  15.        
  16.         If UsuarioImpacto(AtacanteIndex, VictimaIndex) Then
  17.             Call SendData(SendTarget.ToPCArea, AtacanteIndex, PrepareMessagePlayWave(SND_IMPACTO, .Pos.X, .Pos.Y))
  18.            
  19.             If UserList(VictimaIndex).flags.Navegando = 0 Then
  20.                 Call SendData(SendTarget.ToPCArea, VictimaIndex, PrepareMessageCreateFX(UserList(VictimaIndex).Char.CharIndex, FXSANGRE, 0))
  21.             End If
  22.            
  23.             'Pablo (ToxicWaste): Guantes de Hurto del Bandido en acción
  24.             If .clase = eClass.Bandit Then
  25.                 Call DoHurtar(AtacanteIndex, VictimaIndex)
  26.             'y ahora, el ladrón puede llegar a paralizar con el golpe.
  27.             ElseIf .clase = eClass.Thief Then
  28.                 Call DoHandInmo(AtacanteIndex, VictimaIndex)
  29.             End If
  30.            
  31.             Call UserDañoUser(AtacanteIndex, VictimaIndex)
  32.         Else
  33.             ' Invisible admins doesn't make sound to other clients except itself
  34.             If .flags.AdminInvisible = 1 Then
  35.                 Call EnviarDatosASlot(AtacanteIndex, PrepareMessagePlayWave(SND_SWING, .Pos.X, .Pos.Y))
  36.             Else
  37.                 Call SendData(SendTarget.ToPCArea, AtacanteIndex, PrepareMessagePlayWave(SND_SWING, .Pos.X, .Pos.Y))
  38.             End If
  39.            
  40.             Call WriteUserSwing(AtacanteIndex)
  41.             Call WriteUserAttackedSwing(VictimaIndex, AtacanteIndex)
  42.         End If
  43.        
  44.         If .clase = eClass.Thief Then Call Desarmar(AtacanteIndex, VictimaIndex)
  45.     End With
  46. Exit Sub
  47.    
  48. Errhandler:
  49.     Call LogError("Error en UsuarioAtacaUsuario. Error " & Err.Number & " : " & Err.description)
  50. End Sub
  51.  
Aguante River Plate ! ! !
909
Moderador
Registrado: Años de membresíaAños de membresíaAños de membresía
Ubicación: Villa adelina, Vicente Lopez.
Mensajes: 14428
Aportes: 305
Premios: 10
Señor Moderador (3) Señor Reglamento (1) Aportes (2) Embajador (3) Detector de Bugs (1)

Nota » 20 Mar 2011 19:46

Bien ahora pega pero de abajo y del costado derecho de nosotros pero del izquierdo y de arriba no pega :S
Usuario Registrado
Newbie [2]
Registrado: Años de membresía
Mensajes: 49


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