[SERVIDOR] UserCrea Teleport con Hechizo Iao Style
HECHIZO DE TELEPORT by 'Pocho'
EDIT: ESTE ES EL UNICO QUE ANDA, si tienen otro, reemplazen por este ! porq habia una cosa que decia If portal > 0 y no, era If Portal = 0
EDIT2: Ya anda
13/12/06
En ModHechizo.bas HandleHechizoTerreno Buscamos
Código de Visual Basic:
--------------------------------------------------------------------------------
Else ' /GS
Select Case Hechizos(uh).Tipo
Case uInvocacion '
Call HechizoInvocacion(UserIndex, b)
Case uEstado
Call HechizoTerrenoEstado(UserIndex, b)
End Select
End If
--------------------------------------------------------------------------------
y abajo agregamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
If Hechizos(uh).TeleportX = 1 Then
Dim Mapaf, Xf, Yf As Integer
If UserList(UserIndex).flags.Portal = 0 Then
Dim TiemPoP As Integer
Dim ET As Obj
ET.Amount = 1
ET.ObjIndex = 378
Mapaf = Hechizos(uh).TeleportXMap
Xf = Hechizos(uh).TeleportXX
Yf = Hechizos(uh).TeleportXY
TiemPoP = 10 ' segundos
UserList(UserIndex).flags.Portal = TiemPoP
Call MakeObj(ToMap, 0, UserList(UserIndex).Pos.Map, ET, UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY)
MapData(UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY).TileExit.Map = Mapaf
MapData(UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY).TileExit.x = Xf
MapData(UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY).TileExit.y = Yf
Call senddata(ToIndex, Userindex,0,"||Has creado un teleport!!" & fonttype_info)
Call SendData(ToPCArea, UserIndex, UserList, UserIndex).Pos.Map, "TW" & SND_WARP)
UserList(UserIndex).flags.Portal = TiemPoP
UserList(UserIndex).flags.PortalM = UserList(UserIndex).Pos.Map
UserList(UserIndex).flags.PortalX = UserList(UserIndex).flags.TargetX
UserList(UserIndex).flags.PortalY = UserList(UserIndex).flags.TargetY
Else
Call SendData(ToIndex, UserIndex, 0, "||No puedes lanzar mas de un portal a la vez" & fonttype_info)
End If
End if
--------------------------------------------------------------------------------
Si no tienen eso de 'GS
ponganlo arriba de if b
Luego vamos a FileIO.bas y en el Sub CargarHechizos buscamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
'Llena la lista
For Hechizo = 1 To NumeroHechizos
--------------------------------------------------------------------------------
y abajo ponemos:
Código de Visual Basic:
--------------------------------------------------------------------------------
Hechizos(Hechizo).TeleportX = val(Leer.DarValor("Hechizo" & Hechizo, "Teleport"))
Hechizos(Hechizo).TeleportXMap = val(Leer.DarValor("Hechizo" & Hechizo, "TeleportMap"))
Hechizos(Hechizo).TeleportXX = val(Leer.DarValor("Hechizo" & Hechizo, "TeleportX"))
Hechizos(Hechizo).TeleportXY = val(Leer.DarValor("Hechizo" & Hechizo, "TeleportY"))
--------------------------------------------------------------------------------
abajo tendremos que tener:
Código de Visual Basic:
--------------------------------------------------------------------------------
Hechizos(Hechizo).Nombre = Leer.DarValor("Hechizo" & Hechizo, "Nombre")
--------------------------------------------------------------------------------
Segimos
En Declares.bas buscamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
'**************************************************************
'**************************************************************
'************************ TIPOS *******************************
'**************************************************************
'**************************************************************
Type tHechizo
--------------------------------------------------------------------------------
y abajo agregamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
TeleportX As Integer
TeleportXMap As Integer
TeleportXX As Integer
TeleportXY As Integer
--------------------------------------------------------------------------------
Luego vamos a General.bas y en Sub PasarSegundo() debajo de:
Código de Visual Basic:
--------------------------------------------------------------------------------
ElseIf UserList(i).flags.EstaEmpo = 1 Then
UserList(i).EmpoCont = UserList(i).EmpoCont + 1
If UserList(i).EmpoCont = 30 Then
'If FileExist(CharPath & UserList(Z).Name & ".chr", vbNormal) Then
'esto siempre existe! sino no estaria logueado ;p
'TmpP = val(GetVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant"))
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant", TmpP + 1)
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "P" & TmpP + 1, LCase$(UserList(Z).Name) & ": CARCEL " & 30 & "m, MOTIVO: Empollando" & " " & Date & " " & Time)
'Call Encarcelar(Z, 30, "El sistema anti empollo")
Call SendData(ToIndex, i, 0, "!! Fuiste expulsado por permanecer muerto sobre un item")
'Call SendData(ToAdmins, Z, 0, "|| " & UserList(Z).Name & " Fue encarcelado por empollar" & FONTTYPE_INFO)
UserList(i).EmpoCont = 0
Call CloseSocket(i)
Exit Sub
ElseIf UserList(i).EmpoCont = 15 Then
Call SendData(ToIndex, i, 0, "|| LLevas 15 segundos bloqueando el item, muévete o serás desconectado." & FONTTYPE_WARNING)
End If
End If
--------------------------------------------------------------------------------
y agregamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
If UserList(i).flags.Portal = 1 Then
Dim mapa, x, y As Integer
mapa = UserList(i).flags.PortalM
x = UserList(i).flags.PortalX
y = UserList(i).flags.PortalY
If MapData(mapa, x, y).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, mapa, MapData(mapa, x, y).OBJInfo.Amount, mapa, x, y)
Call EraseObj(ToMap, 0, MapData(mapa, x, y).TileExit.Map, 1, MapData(mapa, x, y).TileExit.Map, MapData(mapa, x, y).TileExit.x, MapData(mapa, x, y).TileExit.y)
MapData(mapa, x, y).TileExit.Map = 0
MapData(mapa, x, y).TileExit.x = 0
MapData(mapa, x, y).TileExit.y = 0
End If
UserList(i).flags.Portal = 0
UserList(i).flags.PortalM = 0
UserList(i).flags.PortalY = 0
UserList(i).flags.PortalX = 0
End If
If UserList(i).flags.Portal > 1 Then UserList(i).flags.Portal = UserList(i).flags.Portal - 1
--------------------------------------------------------------------------------
nos quedaria ASÍ:
Código de Visual Basic:
--------------------------------------------------------------------------------
ElseIf UserList(i).flags.EstaEmpo = 1 Then
UserList(i).EmpoCont = UserList(i).EmpoCont + 1
If UserList(i).EmpoCont = 30 Then
'If FileExist(CharPath & UserList(Z).Name & ".chr", vbNormal) Then
'esto siempre existe! sino no estaria logueado ;p
'TmpP = val(GetVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant"))
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant", TmpP + 1)
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "P" & TmpP + 1, LCase$(UserList(Z).Name) & ": CARCEL " & 30 & "m, MOTIVO: Empollando" & " " & Date & " " & Time)
'Call Encarcelar(Z, 30, "El sistema anti empollo")
Call SendData(ToIndex, i, 0, "!! Fuiste expulsado por permanecer muerto sobre un item")
'Call SendData(ToAdmins, Z, 0, "|| " & UserList(Z).Name & " Fue encarcelado por empollar" & FONTTYPE_INFO)
UserList(i).EmpoCont = 0
Call CloseSocket(i)
Exit Sub
ElseIf UserList(i).EmpoCont = 15 Then
Call SendData(ToIndex, i, 0, "|| LLevas 15 segundos bloqueando el item, muévete o serás desconectado." & FONTTYPE_WARNING)
End If
End If
If UserList(i).flags.Portal = 1 Then
Dim mapa, x, y As Integer
mapa = UserList(i).flags.PortalM
x = UserList(i).flags.PortalX
y = UserList(i).flags.PortalY
If MapData(mapa, x, y).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, mapa, MapData(mapa, x, y).OBJInfo.Amount, mapa, x, y)
Call EraseObj(ToMap, 0, MapData(mapa, x, y).TileExit.Map, 1, MapData(mapa, x, y).TileExit.Map, MapData(mapa, x, y).TileExit.x, MapData(mapa, x, y).TileExit.y)
MapData(mapa, x, y).TileExit.Map = 0
MapData(mapa, x, y).TileExit.x = 0
MapData(mapa, x, y).TileExit.y = 0
End If
UserList(i).flags.Portal = 0
UserList(i).flags.PortalM = 0
UserList(i).flags.PortalY = 0
UserList(i).flags.PortalX = 0
End If
If UserList(i).flags.Portal > 1 Then UserList(i).flags.Portal = UserList(i).flags.Portal - 1
Next i
--------------------------------------------------------------------------------
Volvemos a Declares.bas y buscamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
'Flags
Type UserFlags
--------------------------------------------------------------------------------
debajo agregamos y terminamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
Portal As Integer
PortalM As Integer
PortalX As Integer
PortalY As Integer
--------------------------------------------------------------------------------
buscamos
Código de Visual Basic:
--------------------------------------------------------------------------------
#If UsarQueSocket = 1 Or UsarQueSocket = 2 Then
Sub CloseSocket(ByVal UserIndex As Integer, Optional ByVal cerrarlo As Boolean = True)
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
--------------------------------------------------------------------------------
abajo ponemoos
Código de Visual Basic:
--------------------------------------------------------------------------------
If UserList(UserIndex).flags.Portal > 0 Then
UserList(UserIndex).flags.PortalX = UserList(UserIndex).flags.PortalX
UserList(UserIndex).flags.PortalY = UserList(UserIndex).flags.PortalY
If MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, UserList(UserIndex).flags.PortalM, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).OBJInfo.Amount, UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY)
Call EraseObj(ToMap, 0, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, 1, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y)
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y = 0
End If
End If
--------------------------------------------------------------------------------
dsp buscamos unas lineas mas abaqjo
Código de Visual Basic:
--------------------------------------------------------------------------------
#ElseIf UsarQueSocket = 0 Then
Sub CloseSocket(ByVal UserIndex As Integer)
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
'Call LogTarea("Close Socket")
On Error GoTo errhandler
--------------------------------------------------------------------------------
y abajo ponemos
Código de Visual Basic:
--------------------------------------------------------------------------------
If UserList(UserIndex).flags.Portal > 0 Then
UserList(UserIndex).flags.PortalX = UserList(UserIndex).flags.PortalX
UserList(UserIndex).flags.PortalY = UserList(UserIndex).flags.PortalY
If MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, UserList(UserIndex).flags.PortalM, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).OBJInfo.Amount, UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY)
Call EraseObj(ToMap, 0, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, 1, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y)
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y = 0
End If
End IF
Luego, en hechizos.dat agregamos HECHIZOxx y ponemos asi:
[HECHIZO44]
Nombre=Portal Ulla
Desc= teleport a ulla
PalabrasMagicas=A' ullA pL`z
HechizeroMsg=Has lanzado portal
TargetMsg= laslas.
PropioMsg=lalals
Tipo=5
WAV=27
FXgrh=0
Teleport=1
TeleportMap=1
TeleportX=50
TeleportY=50
Target=4
MinSkill=1
ManaRequerido=1
StaRequerido= 1
HECHIZO DE TELEPORT by 'Pocho'
EDIT: ESTE ES EL UNICO QUE ANDA, si tienen otro, reemplazen por este ! porq habia una cosa que decia If portal > 0 y no, era If Portal = 0
EDIT2: Ya anda

En ModHechizo.bas HandleHechizoTerreno Buscamos
Código de Visual Basic:
--------------------------------------------------------------------------------
Else ' /GS
Select Case Hechizos(uh).Tipo
Case uInvocacion '
Call HechizoInvocacion(UserIndex, b)
Case uEstado
Call HechizoTerrenoEstado(UserIndex, b)
End Select
End If
--------------------------------------------------------------------------------
y abajo agregamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
If Hechizos(uh).TeleportX = 1 Then
Dim Mapaf, Xf, Yf As Integer
If UserList(UserIndex).flags.Portal = 0 Then
Dim TiemPoP As Integer
Dim ET As Obj
ET.Amount = 1
ET.ObjIndex = 378
Mapaf = Hechizos(uh).TeleportXMap
Xf = Hechizos(uh).TeleportXX
Yf = Hechizos(uh).TeleportXY
TiemPoP = 10 ' segundos
UserList(UserIndex).flags.Portal = TiemPoP
Call MakeObj(ToMap, 0, UserList(UserIndex).Pos.Map, ET, UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY)
MapData(UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY).TileExit.Map = Mapaf
MapData(UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY).TileExit.x = Xf
MapData(UserList(UserIndex).Pos.Map, UserList(UserIndex).flags.TargetX, UserList(UserIndex).flags.TargetY).TileExit.y = Yf
Call senddata(ToIndex, Userindex,0,"||Has creado un teleport!!" & fonttype_info)
Call SendData(ToPCArea, UserIndex, UserList, UserIndex).Pos.Map, "TW" & SND_WARP)
UserList(UserIndex).flags.Portal = TiemPoP
UserList(UserIndex).flags.PortalM = UserList(UserIndex).Pos.Map
UserList(UserIndex).flags.PortalX = UserList(UserIndex).flags.TargetX
UserList(UserIndex).flags.PortalY = UserList(UserIndex).flags.TargetY
Else
Call SendData(ToIndex, UserIndex, 0, "||No puedes lanzar mas de un portal a la vez" & fonttype_info)
End If
End if
--------------------------------------------------------------------------------
Si no tienen eso de 'GS
ponganlo arriba de if b
Luego vamos a FileIO.bas y en el Sub CargarHechizos buscamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
'Llena la lista
For Hechizo = 1 To NumeroHechizos
--------------------------------------------------------------------------------
y abajo ponemos:
Código de Visual Basic:
--------------------------------------------------------------------------------
Hechizos(Hechizo).TeleportX = val(Leer.DarValor("Hechizo" & Hechizo, "Teleport"))
Hechizos(Hechizo).TeleportXMap = val(Leer.DarValor("Hechizo" & Hechizo, "TeleportMap"))
Hechizos(Hechizo).TeleportXX = val(Leer.DarValor("Hechizo" & Hechizo, "TeleportX"))
Hechizos(Hechizo).TeleportXY = val(Leer.DarValor("Hechizo" & Hechizo, "TeleportY"))
--------------------------------------------------------------------------------
abajo tendremos que tener:
Código de Visual Basic:
--------------------------------------------------------------------------------
Hechizos(Hechizo).Nombre = Leer.DarValor("Hechizo" & Hechizo, "Nombre")
--------------------------------------------------------------------------------
Segimos
En Declares.bas buscamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
'**************************************************************
'**************************************************************
'************************ TIPOS *******************************
'**************************************************************
'**************************************************************
Type tHechizo
--------------------------------------------------------------------------------
y abajo agregamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
TeleportX As Integer
TeleportXMap As Integer
TeleportXX As Integer
TeleportXY As Integer
--------------------------------------------------------------------------------
Luego vamos a General.bas y en Sub PasarSegundo() debajo de:
Código de Visual Basic:
--------------------------------------------------------------------------------
ElseIf UserList(i).flags.EstaEmpo = 1 Then
UserList(i).EmpoCont = UserList(i).EmpoCont + 1
If UserList(i).EmpoCont = 30 Then
'If FileExist(CharPath & UserList(Z).Name & ".chr", vbNormal) Then
'esto siempre existe! sino no estaria logueado ;p
'TmpP = val(GetVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant"))
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant", TmpP + 1)
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "P" & TmpP + 1, LCase$(UserList(Z).Name) & ": CARCEL " & 30 & "m, MOTIVO: Empollando" & " " & Date & " " & Time)
'Call Encarcelar(Z, 30, "El sistema anti empollo")
Call SendData(ToIndex, i, 0, "!! Fuiste expulsado por permanecer muerto sobre un item")
'Call SendData(ToAdmins, Z, 0, "|| " & UserList(Z).Name & " Fue encarcelado por empollar" & FONTTYPE_INFO)
UserList(i).EmpoCont = 0
Call CloseSocket(i)
Exit Sub
ElseIf UserList(i).EmpoCont = 15 Then
Call SendData(ToIndex, i, 0, "|| LLevas 15 segundos bloqueando el item, muévete o serás desconectado." & FONTTYPE_WARNING)
End If
End If
--------------------------------------------------------------------------------
y agregamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
If UserList(i).flags.Portal = 1 Then
Dim mapa, x, y As Integer
mapa = UserList(i).flags.PortalM
x = UserList(i).flags.PortalX
y = UserList(i).flags.PortalY
If MapData(mapa, x, y).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, mapa, MapData(mapa, x, y).OBJInfo.Amount, mapa, x, y)
Call EraseObj(ToMap, 0, MapData(mapa, x, y).TileExit.Map, 1, MapData(mapa, x, y).TileExit.Map, MapData(mapa, x, y).TileExit.x, MapData(mapa, x, y).TileExit.y)
MapData(mapa, x, y).TileExit.Map = 0
MapData(mapa, x, y).TileExit.x = 0
MapData(mapa, x, y).TileExit.y = 0
End If
UserList(i).flags.Portal = 0
UserList(i).flags.PortalM = 0
UserList(i).flags.PortalY = 0
UserList(i).flags.PortalX = 0
End If
If UserList(i).flags.Portal > 1 Then UserList(i).flags.Portal = UserList(i).flags.Portal - 1
--------------------------------------------------------------------------------
nos quedaria ASÍ:
Código de Visual Basic:
--------------------------------------------------------------------------------
ElseIf UserList(i).flags.EstaEmpo = 1 Then
UserList(i).EmpoCont = UserList(i).EmpoCont + 1
If UserList(i).EmpoCont = 30 Then
'If FileExist(CharPath & UserList(Z).Name & ".chr", vbNormal) Then
'esto siempre existe! sino no estaria logueado ;p
'TmpP = val(GetVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant"))
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "Cant", TmpP + 1)
'Call WriteVar(CharPath & UserList(Z).Name & ".chr", "PENAS", "P" & TmpP + 1, LCase$(UserList(Z).Name) & ": CARCEL " & 30 & "m, MOTIVO: Empollando" & " " & Date & " " & Time)
'Call Encarcelar(Z, 30, "El sistema anti empollo")
Call SendData(ToIndex, i, 0, "!! Fuiste expulsado por permanecer muerto sobre un item")
'Call SendData(ToAdmins, Z, 0, "|| " & UserList(Z).Name & " Fue encarcelado por empollar" & FONTTYPE_INFO)
UserList(i).EmpoCont = 0
Call CloseSocket(i)
Exit Sub
ElseIf UserList(i).EmpoCont = 15 Then
Call SendData(ToIndex, i, 0, "|| LLevas 15 segundos bloqueando el item, muévete o serás desconectado." & FONTTYPE_WARNING)
End If
End If
If UserList(i).flags.Portal = 1 Then
Dim mapa, x, y As Integer
mapa = UserList(i).flags.PortalM
x = UserList(i).flags.PortalX
y = UserList(i).flags.PortalY
If MapData(mapa, x, y).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, mapa, MapData(mapa, x, y).OBJInfo.Amount, mapa, x, y)
Call EraseObj(ToMap, 0, MapData(mapa, x, y).TileExit.Map, 1, MapData(mapa, x, y).TileExit.Map, MapData(mapa, x, y).TileExit.x, MapData(mapa, x, y).TileExit.y)
MapData(mapa, x, y).TileExit.Map = 0
MapData(mapa, x, y).TileExit.x = 0
MapData(mapa, x, y).TileExit.y = 0
End If
UserList(i).flags.Portal = 0
UserList(i).flags.PortalM = 0
UserList(i).flags.PortalY = 0
UserList(i).flags.PortalX = 0
End If
If UserList(i).flags.Portal > 1 Then UserList(i).flags.Portal = UserList(i).flags.Portal - 1
Next i
--------------------------------------------------------------------------------
Volvemos a Declares.bas y buscamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
'Flags
Type UserFlags
--------------------------------------------------------------------------------
debajo agregamos y terminamos:
Código de Visual Basic:
--------------------------------------------------------------------------------
Portal As Integer
PortalM As Integer
PortalX As Integer
PortalY As Integer
--------------------------------------------------------------------------------
buscamos
Código de Visual Basic:
--------------------------------------------------------------------------------
#If UsarQueSocket = 1 Or UsarQueSocket = 2 Then
Sub CloseSocket(ByVal UserIndex As Integer, Optional ByVal cerrarlo As Boolean = True)
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
--------------------------------------------------------------------------------
abajo ponemoos
Código de Visual Basic:
--------------------------------------------------------------------------------
If UserList(UserIndex).flags.Portal > 0 Then
UserList(UserIndex).flags.PortalX = UserList(UserIndex).flags.PortalX
UserList(UserIndex).flags.PortalY = UserList(UserIndex).flags.PortalY
If MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, UserList(UserIndex).flags.PortalM, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).OBJInfo.Amount, UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY)
Call EraseObj(ToMap, 0, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, 1, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y)
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y = 0
End If
End If
--------------------------------------------------------------------------------
dsp buscamos unas lineas mas abaqjo
Código de Visual Basic:
--------------------------------------------------------------------------------
#ElseIf UsarQueSocket = 0 Then
Sub CloseSocket(ByVal UserIndex As Integer)
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>
'Call LogTarea("Close Socket")
On Error GoTo errhandler
--------------------------------------------------------------------------------
y abajo ponemos
Código de Visual Basic:
--------------------------------------------------------------------------------
If UserList(UserIndex).flags.Portal > 0 Then
UserList(UserIndex).flags.PortalX = UserList(UserIndex).flags.PortalX
UserList(UserIndex).flags.PortalY = UserList(UserIndex).flags.PortalY
If MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map > 0 Then
Call EraseObj(ToMap, 0, UserList(UserIndex).flags.PortalM, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).OBJInfo.Amount, UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY)
Call EraseObj(ToMap, 0, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, 1, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X, MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y)
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Map = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.X = 0
MapData(UserList(UserIndex).flags.PortalM, UserList(UserIndex).flags.PortalX, UserList(UserIndex).flags.PortalY).TileExit.Y = 0
End If
End IF
Luego, en hechizos.dat agregamos HECHIZOxx y ponemos asi:
[HECHIZO44]
Nombre=Portal Ulla
Desc= teleport a ulla
PalabrasMagicas=A' ullA pL`z
HechizeroMsg=Has lanzado portal
TargetMsg= laslas.
PropioMsg=lalals
Tipo=5
WAV=27
FXgrh=0
Teleport=1
TeleportMap=1
TeleportX=50
TeleportY=50
Target=4
MinSkill=1
ManaRequerido=1
StaRequerido= 1