Transportación vía objetos
A. Pases: se compran a un NPC ubicado en determinada posición/es y
sólo pueden ser usados allí (Transportes)
B. Invitaciones: válidas sólo para determinada hora/día, llevan al
char al lugar del evento
Public Const OBJTYPE_PASES = 36
Public Const OBJTYPE_INVITACION = 37
Declares
Map As Integer
X As Integer
Y As Integer
Funciones:
Sub UsarPase(ByVal UserIndex As Integer, ByVal Slot As Integer)
Dim Map As Integer
Dim X As Integer
Dim Y As Integer
Map = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Map
X = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).X
Y = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Y
If UserList(UserIndex).Pos.Map = Map And UserList(UserIndex).Pos.X =
X And UserList(UserIndex).Pos.Y = Y Then
Call SendData(ToIndex, UserIndex, 0, "||El enano recibe tu pase,
al verlo te mira como si le estuvieses jugando una broma." &
FONTTYPE_INFO)
Exit Sub
ElseIf UserList(UserIndex).Pos.Map = 61 And UserList
(UserIndex).Pos.X = 67 And UserList(UserIndex).Pos.Y = 66 Or _
UserList(UserIndex).Pos.Map = 34 And UserList(UserIndex).Pos.X = 27
And UserList(UserIndex).Pos.Y = 77 Or _
UserList(UserIndex).Pos.Map = 139 And UserList(UserIndex).Pos.X = 60
And UserList(UserIndex).Pos.Y = 50 Or _
UserList(UserIndex).Pos.Map = 24 And UserList(UserIndex).Pos.X = 91
And UserList(UserIndex).Pos.Y = 34 Or _
UserList(UserIndex).Pos.Map = 20 And UserList(UserIndex).Pos.X = 29
And UserList(UserIndex).Pos.Y = 91 Or _
UserList(UserIndex).Pos.Map = 111 And UserList(UserIndex).Pos.X = 79
And UserList(UserIndex).Pos.Y = 65 Then
Call WarpUserChar(UserIndex, Map, X, Y, True)
Call QuitarUserInvItem(UserIndex, CByte(Slot), 1)
UserList(UserIndex).Stats.MinHam = 0
UserList(UserIndex).Stats.MinAGU = 0
Call SendData(ToIndex, UserIndex, 0, "||Has viajado por varios
días, te sientes hambriento y sediento." & FONTTYPE_INFO)
Exit Sub
Else
Call SendData(ToIndex, UserIndex, 0, "||Los pases son sólo
válidos mientras estés frente a un pirata, mostrándole así el
mismo." & FONTTYPE_WARNING)
Exit Sub
End If
End Sub
Sub UsarInvitacion(ByVal UserIndex As Integer, ByVal Slot As Integer)
Dim Map As Integer
Dim X As Integer
Dim Y As Integer
Map = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Map
X = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).X
Y = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Y
If ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Hora =
Hour And _
ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Dia = Date
Then
Call WarpUserChar(UserIndex, Map, X, Y, True)
Call QuitarUserInvItem(UserIndex, CByte(Slot), 1)
Else
Call SendData(ToIndex, UserIndex, 0, "||Parece ser que esta
invistación es de otro día o bien aún no es la hora del evento." &
FONTTYPE_WARNING)
Exit Sub
End Sub
En InvUsuario agregamos estos dos tipos de objetos:
Case OBJTYPE_PASES '¿Es un pase?
If UserList(UserIndex).Flags.Muerto = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||¡¡Estas
muerto!! Sólo podés usar items cuando estas vivo. " & FONTTYPE_INFO)
Exit Sub
ElseIf UserList(UserIndex).Flags.Transformado = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||No podés
usar items estando transformado. " & FONTTYPE_INFO)
Exit Sub
Else
Call UsarPase(UserIndex, Slot)
End If
Case OBJTYPE_INVITACION '¿Es una invitacion?
If UserList(UserIndex).Flags.Muerto = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||¡¡Estas
muerto!! Sólo podés usar items cuando estas vivo. " & FONTTYPE_INFO)
Exit Sub
ElseIf UserList(UserIndex).Flags.Transformado = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||No podés
usar items estando transformado. " & FONTTYPE_INFO)
Exit Sub
Else
Call UsarInvitacion(UserIndex, Slot)
End If
Codigo extraido de <a href="http://www.codigosao.tk" class="postlink" rel="nofollow" onClick="window.open(this.href);return false;">http://www.codigosao.tk</a>" onclick="window.open(this.href);return false;
A. Pases: se compran a un NPC ubicado en determinada posición/es y
sólo pueden ser usados allí (Transportes)
B. Invitaciones: válidas sólo para determinada hora/día, llevan al
char al lugar del evento
Public Const OBJTYPE_PASES = 36
Public Const OBJTYPE_INVITACION = 37
Declares
Map As Integer
X As Integer
Y As Integer
Funciones:
Sub UsarPase(ByVal UserIndex As Integer, ByVal Slot As Integer)
Dim Map As Integer
Dim X As Integer
Dim Y As Integer
Map = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Map
X = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).X
Y = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Y
If UserList(UserIndex).Pos.Map = Map And UserList(UserIndex).Pos.X =
X And UserList(UserIndex).Pos.Y = Y Then
Call SendData(ToIndex, UserIndex, 0, "||El enano recibe tu pase,
al verlo te mira como si le estuvieses jugando una broma." &
FONTTYPE_INFO)
Exit Sub
ElseIf UserList(UserIndex).Pos.Map = 61 And UserList
(UserIndex).Pos.X = 67 And UserList(UserIndex).Pos.Y = 66 Or _
UserList(UserIndex).Pos.Map = 34 And UserList(UserIndex).Pos.X = 27
And UserList(UserIndex).Pos.Y = 77 Or _
UserList(UserIndex).Pos.Map = 139 And UserList(UserIndex).Pos.X = 60
And UserList(UserIndex).Pos.Y = 50 Or _
UserList(UserIndex).Pos.Map = 24 And UserList(UserIndex).Pos.X = 91
And UserList(UserIndex).Pos.Y = 34 Or _
UserList(UserIndex).Pos.Map = 20 And UserList(UserIndex).Pos.X = 29
And UserList(UserIndex).Pos.Y = 91 Or _
UserList(UserIndex).Pos.Map = 111 And UserList(UserIndex).Pos.X = 79
And UserList(UserIndex).Pos.Y = 65 Then
Call WarpUserChar(UserIndex, Map, X, Y, True)
Call QuitarUserInvItem(UserIndex, CByte(Slot), 1)
UserList(UserIndex).Stats.MinHam = 0
UserList(UserIndex).Stats.MinAGU = 0
Call SendData(ToIndex, UserIndex, 0, "||Has viajado por varios
días, te sientes hambriento y sediento." & FONTTYPE_INFO)
Exit Sub
Else
Call SendData(ToIndex, UserIndex, 0, "||Los pases son sólo
válidos mientras estés frente a un pirata, mostrándole así el
mismo." & FONTTYPE_WARNING)
Exit Sub
End If
End Sub
Sub UsarInvitacion(ByVal UserIndex As Integer, ByVal Slot As Integer)
Dim Map As Integer
Dim X As Integer
Dim Y As Integer
Map = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Map
X = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).X
Y = ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Y
If ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Hora =
Hour And _
ObjData(UserList(UserIndex).Invent.Object(Slot).Ob jIndex).Dia = Date
Then
Call WarpUserChar(UserIndex, Map, X, Y, True)
Call QuitarUserInvItem(UserIndex, CByte(Slot), 1)
Else
Call SendData(ToIndex, UserIndex, 0, "||Parece ser que esta
invistación es de otro día o bien aún no es la hora del evento." &
FONTTYPE_WARNING)
Exit Sub
End Sub
En InvUsuario agregamos estos dos tipos de objetos:
Case OBJTYPE_PASES '¿Es un pase?
If UserList(UserIndex).Flags.Muerto = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||¡¡Estas
muerto!! Sólo podés usar items cuando estas vivo. " & FONTTYPE_INFO)
Exit Sub
ElseIf UserList(UserIndex).Flags.Transformado = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||No podés
usar items estando transformado. " & FONTTYPE_INFO)
Exit Sub
Else
Call UsarPase(UserIndex, Slot)
End If
Case OBJTYPE_INVITACION '¿Es una invitacion?
If UserList(UserIndex).Flags.Muerto = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||¡¡Estas
muerto!! Sólo podés usar items cuando estas vivo. " & FONTTYPE_INFO)
Exit Sub
ElseIf UserList(UserIndex).Flags.Transformado = 1 Then
Call SendData(ToIndex, UserIndex, 0, "||No podés
usar items estando transformado. " & FONTTYPE_INFO)
Exit Sub
Else
Call UsarInvitacion(UserIndex, Slot)
End If
Codigo extraido de <a href="http://www.codigosao.tk" class="postlink" rel="nofollow" onClick="window.open(this.href);return false;">http://www.codigosao.tk</a>" onclick="window.open(this.href);return false;