Find
Code:
Public Const DIR_RIGHT As Byte = 3
Below that add
Code:
Public Const DIR_UP_LEFT As Byte = 4
Public Const DIR_UP_RIGHT As Byte = 5
Public Const DIR_DOWN_LEFT As Byte = 6
Public Const DIR_DOWN_RIGHT As Byte = 7
Next find
Code:
Function CanAttackPlayer(ByVal Attacker As Long, ByVal Victim As Long) As Boolean
Replace the sub with
Code:
Function CanAttackPlayer(ByVal Attacker As Long, ByVal Victim As Long) As Boolean
' Check for subscript out of range
If Not IsPlaying(Victim) Then
Exit Function
End If
' Check attack timer
If GetTickCount > TempPlayer(Attacker).AttackTimer + 1000 Then
Exit Function
End If
' Check if at same coordinates
Select Case GetPlayerDir(Attacker)
Case DIR_UP
If (GetPlayerY(Victim) + 1 = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_DOWN
If (GetPlayerY(Victim) - 1 = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_LEFT
If (GetPlayerY(Victim) = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) + 1 = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_RIGHT
If (GetPlayerY(Victim) = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) - 1 = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_UP_LEFT
If (GetPlayerY(Victim) + 1 = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) + 1 = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_UP_RIGHT
If (GetPlayerY(Victim) + 1 = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) - 1 = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_DOWN_LEFT
If (GetPlayerY(Victim) - 1 = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) + 1 = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
Case DIR_DOWN_RIGHT
If (GetPlayerY(Victim) - 1 = GetPlayerY(Attacker)) Then
If (GetPlayerX(Victim) - 1 = GetPlayerX(Attacker)) Then
CanAttackPlayer = True
End If
End If
End Select
If Not CanAttackPlayer Then
Exit Function
End If
' Make sure they have more then 0 hp
If GetPlayerVital(Victim, Vitals.HP) <= 0 Then
Exit Function
End If
' Check to make sure that they dont have access
If GetPlayerAccess(Attacker) > ADMIN_MONITOR Then
Call PlayerMsg(Attacker, "You cannot attack any player for thou art an admin!", BrightBlue)
Exit Function
End If
' Check to make sure the victim isn't an admin
If GetPlayerAccess(Victim) > ADMIN_MONITOR Then
Call PlayerMsg(Attacker, "You cannot attack " & GetPlayerName(Victim) & "!", BrightRed)
Exit Function
End If
' Make sure attacker is high enough level
If GetPlayerLevel(Attacker) < 10 Then
Call PlayerMsg(Attacker, "You are below level 10, you cannot attack another player yet!", BrightRed)
Exit Function
End If
' Make sure victim is high enough level
If GetPlayerLevel(Victim) < 10 Then
Call PlayerMsg(Attacker, GetPlayerName(Victim) & " is below level 10, you cannot attack this player yet!", BrightRed)
Exit Function
End If
' Make sure they are on the same map
If Not GetPlayerMap(Attacker) = GetPlayerMap(Victim) Then
Exit Function
End If
' Make sure we dont attack the player if they are switching maps
If TempPlayer(Victim).GettingMap = YES Then
Exit Function
End If
' Check if map is attackable
If Not Map(GetPlayerMap(Attacker)).Moral = MAP_MORAL_NONE Or GetPlayerPK(Victim) = NO Then
Call PlayerMsg(Attacker, "This is a safe zone!", BrightRed)
Exit Function
End If
CanAttackPlayer = True
End Function
Next find
Code:
Function CanAttackNpc(ByVal Attacker As Long, ByVal MapNpcNum As Long) As Boolean
Replace the sub with
Code:
Function CanAttackNpc(ByVal Attacker As Long, ByVal MapNpcNum As Long) As Boolean
Dim MapNum As Long, NpcNum As Long
Dim NpcX As Long, NpcY As Long
CanAttackNpc = False
' Check for subscript out of range
If IsPlaying(Attacker) = False Or MapNpcNum <= 0 Or MapNpcNum > MAX_MAP_NPCS Then
Exit Function
End If
' Check for subscript out of range
If MapNpc(GetPlayerMap(Attacker), MapNpcNum).Num <= 0 Then
Exit Function
End If
MapNum = GetPlayerMap(Attacker)
NpcNum = MapNpc(MapNum, MapNpcNum).Num
' Make sure the npc isn't already dead
If MapNpc(MapNum, MapNpcNum).Vital(Vitals.HP) <= 0 Then
Exit Function
End If
' Make sure they are on the same map
If IsPlaying(Attacker) Then
If NpcNum > 0 And GetTickCount > TempPlayer(Attacker).AttackTimer + 1000 Then
' Check if at same coordinates
Select Case GetPlayerDir(Attacker)
Case DIR_UP
NpcX = MapNpc(MapNum, MapNpcNum).x
NpcY = MapNpc(MapNum, MapNpcNum).y + 1
Case DIR_DOWN
NpcX = MapNpc(MapNum, MapNpcNum).x
NpcY = MapNpc(MapNum, MapNpcNum).y - 1
Case DIR_LEFT
NpcX = MapNpc(MapNum, MapNpcNum).x + 1
NpcY = MapNpc(MapNum, MapNpcNum).y
Case DIR_RIGHT
NpcX = MapNpc(MapNum, MapNpcNum).x - 1
NpcY = MapNpc(MapNum, MapNpcNum).y
Case DIR_UP_LEFT
NpcX = MapNpc(MapNum, MapNpcNum).x + 1
NpcY = MapNpc(MapNum, MapNpcNum).y + 1
Case DIR_UP_RIGHT
NpcX = MapNpc(MapNum, MapNpcNum).x - 1
NpcY = MapNpc(MapNum, MapNpcNum).y + 1
Case DIR_DOWN_LEFT
NpcX = MapNpc(MapNum, MapNpcNum).x + 1
NpcY = MapNpc(MapNum, MapNpcNum).y - 1
Case DIR_DOWN_RIGHT
NpcX = MapNpc(MapNum, MapNpcNum).x - 1
NpcY = MapNpc(MapNum, MapNpcNum).y - 1
End Select
If NpcX = GetPlayerX(Attacker) Then
If NpcY = GetPlayerY(Attacker) Then
If Npc(NpcNum).Behavior <> NPC_BEHAVIOR_FRIENDLY And Npc(NpcNum).Behavior <> NPC_BEHAVIOR_SHOPKEEPER Then
CanAttackNpc = True
Else
Call PlayerMsg(Attacker, "You cannot attack a " & Trim$(Npc(NpcNum).Name) & "!", BrightBlue)
End If
End If
End If
End If
End If
End Function
Next find
Code:
Function CanNpcAttackPlayer(ByVal MapNpcNum As Long, ByVal Index As Long) As Boolean
Replace the sub with
Code:
Function CanNpcAttackPlayer(ByVal MapNpcNum As Long, ByVal Index As Long) As Boolean
Dim MapNum As Long, NpcNum As Long
CanNpcAttackPlayer = False
' Check for subscript out of range
If MapNpcNum <= 0 Or MapNpcNum > MAX_MAP_NPCS Or IsPlaying(Index) = False Then
Exit Function
End If
' Check for subscript out of range
If MapNpc(GetPlayerMap(Index), MapNpcNum).Num <= 0 Then
Exit Function
End If
MapNum = GetPlayerMap(Index)
NpcNum = MapNpc(MapNum, MapNpcNum).Num
' Make sure the npc isn't already dead
If MapNpc(MapNum, MapNpcNum).Vital(Vitals.HP) <= 0 Then
Exit Function
End If
' Make sure npcs dont attack more then once a second
If GetTickCount < MapNpc(MapNum, MapNpcNum).AttackTimer + 1000 Then
Exit Function
End If
' Make sure we dont attack the player if they are switching maps
If TempPlayer(Index).GettingMap = YES Then
Exit Function
End If
MapNpc(MapNum, MapNpcNum).AttackTimer = GetTickCount
' Make sure they are on the same map
If IsPlaying(Index) Then
If NpcNum > 0 Then
' Check if at same coordinates
If (GetPlayerY(Index) + 1 = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) - 1 = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) + 1 = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) - 1 = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) + 1 = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) + 1 = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) + 1 = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) - 1 = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) = MapNpc(MapNum, MapNpcNum).y) - 1 And (GetPlayerX(Index) + 1 = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
Else
If (GetPlayerY(Index) = MapNpc(MapNum, MapNpcNum).y) - 1 And (GetPlayerX(Index) - 1 = MapNpc(MapNum, MapNpcNum).x) Then
CanNpcAttackPlayer = True
End If
End If
End If
End If
End If
End If
End If
End If
' Select Case MapNpc(MapNum, MapNpcNum).Dir
' Case DIR_UP
' If (GetPlayerY(Index) + 1 = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) = MapNpc(MapNum, MapNpcNum).x) Then
' CanNpcAttackPlayer = True
' End If
'
' Case DIR_DOWN
' If (GetPlayerY(Index) - 1 = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) = MapNpc(MapNum, MapNpcNum).x) Then
' CanNpcAttackPlayer = True
' End If
'
' Case DIR_LEFT
' If (GetPlayerY(Index) = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) + 1 = MapNpc(MapNum, MapNpcNum).x) Then
' CanNpcAttackPlayer = True
' End If
'
' Case DIR_RIGHT
' If (GetPlayerY(Index) = MapNpc(MapNum, MapNpcNum).y) And (GetPlayerX(Index) - 1 = MapNpc(MapNum, MapNpcNum).x) Then
' CanNpcAttackPlayer = True
' End If
' End Select
End If
End If
End Function
Next Find this sub
Code:
Sub SetPlayerY(ByVal Index As Long, ByVal y As Long)
Player(Index).Char(TempPlayer(Index).CharNum).y = y
End Sub
Below it Add this sub
Code:
Sub SetPlayerXY(ByVal Index As Long, ByVal x As Long, ByVal y As Long)
Player(Index).Char(TempPlayer(Index).CharNum).x = x
Player(Index).Char(TempPlayer(Index).CharNum).y = y
End Sub
Next find
Code:
Sub PlayerMove(ByVal Index As Long, ByVal Dir As Long, ByVal Movement As Long)
Replace the sub with
Code:
Sub PlayerMove(ByVal Index As Long, ByVal Dir As Long, ByVal Movement As Long)
Dim Packet As String
Dim MapNum As Long
Dim x As Long
Dim y As Long
Dim Moved As Byte
' Check for subscript out of range
If IsPlaying(Index) = False Or Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Or Movement < 1 Or Movement > 2 Then
Exit Sub
End If
Call SetPlayerDir(Index, Dir)
Moved = NO
Select Case Dir
Case DIR_UP
' Check to make sure not outside of boundries
If GetPlayerY(Index) > 0 Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index), GetPlayerY(Index) - 1) = YES) Then
Call SetPlayerY(Index, GetPlayerY(Index) - 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Up > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY)
Moved = YES
End If
End If
Case DIR_DOWN
' Check to make sure not outside of boundries
If GetPlayerY(Index) < MAX_MAPY Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index), GetPlayerY(Index) + 1) = YES) Then
Call SetPlayerY(Index, GetPlayerY(Index) + 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Down > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Down, GetPlayerX(Index), 0)
Moved = YES
End If
End If
Case DIR_LEFT
' Check to make sure not outside of boundries
If GetPlayerX(Index) > 0 Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index)) = YES) Then
Call SetPlayerX(Index, GetPlayerX(Index) - 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Left > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Left, MAX_MAPX, GetPlayerY(Index))
Moved = YES
End If
End If
Case DIR_RIGHT
' Check to make sure not outside of boundries
If GetPlayerX(Index) < MAX_MAPX Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) + 1, GetPlayerY(Index)) = YES) Then
Call SetPlayerX(Index, GetPlayerX(Index) + 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Right > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Right, 0, GetPlayerY(Index))
Moved = YES
End If
End If
Case DIR_UP_LEFT
' Check to make sure not outside of boundries
If GetPlayerY(Index) > 0 And GetPlayerX(Index) > 0 Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index) - 1).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index) - 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index) - 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index) - 1) = YES) Then
Call SetPlayerXY(Index, GetPlayerX(Index) - 1, GetPlayerY(Index) - 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Up > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY)
Moved = YES
End If
End If
Case DIR_UP_RIGHT
' Check to make sure not outside of boundries
If GetPlayerY(Index) > 0 And GetPlayerX(Index) < MAX_MAPX Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index) - 1).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index) - 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index) - 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) + 1, GetPlayerY(Index) - 1) = YES) Then
Call SetPlayerXY(Index, GetPlayerX(Index) + 1, GetPlayerY(Index) - 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Up > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY)
Moved = YES
End If
End If
Case DIR_DOWN_LEFT
' Check to make sure not outside of boundries
If GetPlayerY(Index) < MAX_MAPY And GetPlayerX(Index) > 0 Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index) + 1).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index) + 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index) + 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index) + 1) = YES) Then
Call SetPlayerXY(Index, GetPlayerX(Index) - 1, GetPlayerY(Index) + 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Down > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Down, GetPlayerX(Index), 0)
Moved = YES
End If
End If
Case DIR_DOWN_RIGHT
' Check to make sure not outside of boundries
If GetPlayerY(Index) < MAX_MAPY And GetPlayerX(Index) < MAX_MAPX Then
' Check to make sure that the tile is walkable
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index) + 1).Type <> TILE_TYPE_BLOCKED Then
' Check to see if the tile is a key and if it is check if its opened
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index) + 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index) + 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) + 1, GetPlayerY(Index) + 1) = YES) Then
Call SetPlayerXY(Index, GetPlayerX(Index) + 1, GetPlayerY(Index) + 1)
Packet = SPlayerMove & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & END_CHAR
Call SendDataToMapBut(Index, GetPlayerMap(Index), Packet)
Moved = YES
End If
End If
Else
' Check to see if we can move them to the another map
If Map(GetPlayerMap(Index)).Down > 0 Then
Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Down, GetPlayerX(Index), 0)
Moved = YES
End If
End If
End Select
' Check to see if the tile is a warp tile, and if so warp them
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_WARP Then
MapNum = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data1
x = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2
y = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data3
Call PlayerWarp(Index, MapNum, x, y)
Moved = YES
End If
' Check for key trigger open
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_KEYOPEN Then
x = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data1
y = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2
If Map(GetPlayerMap(Index)).Tile(x, y).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(x, y) = NO Then
TempTile(GetPlayerMap(Index)).DoorOpen(x, y) = YES
TempTile(GetPlayerMap(Index)).DoorTimer = GetTickCount
Call SendDataToMap(GetPlayerMap(Index), "mapkey" & SEP_CHAR & x & SEP_CHAR & y & SEP_CHAR & 1 & END_CHAR)
Call MapMsg(GetPlayerMap(Index), "A door has been unlocked.", White)
End If
End If
' They tried to hack
If Moved = NO Then
Call HackingAttempt(Index, "Position Modification")
End If
End Sub
Next Find
Code:
Function CanNpcMove(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Dir As Byte) As Boolean
Replace the sub with
Code:
Function CanNpcMove(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Dir As Byte) As Boolean
Dim i As Long, n As Long
Dim x As Long, y As Long
CanNpcMove = False
' Check for subscript out of range
If MapNum <= 0 Or MapNum > MAX_MAPS Or MapNpcNum <= 0 Or MapNpcNum > MAX_MAP_NPCS Or Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Then
Exit Function
End If
x = MapNpc(MapNum, MapNpcNum).x
y = MapNpc(MapNum, MapNpcNum).y
CanNpcMove = True
Select Case Dir
Case DIR_UP
' Check to make sure not outside of boundries
If y > 0 Then
n = Map(MapNum).Tile(x, y - 1).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y - 1) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y - 1) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_DOWN
' Check to make sure not outside of boundries
If y < MAX_MAPY Then
n = Map(MapNum).Tile(x, y + 1).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y + 1) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y + 1) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_LEFT
' Check to make sure not outside of boundries
If x > 0 Then
n = Map(MapNum).Tile(x - 1, y).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x - 1) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x - 1) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_RIGHT
' Check to make sure not outside of boundries
If x < MAX_MAPX Then
n = Map(MapNum).Tile(x + 1, y).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x + 1) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x + 1) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_UP_LEFT
' Check to make sure not outside of boundries
If y > 0 And x > 0 Then
n = Map(MapNum).Tile(x - 1, y - 1).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x - 1) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y - 1) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x - 1) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y - 1) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_UP_RIGHT
' Check to make sure not outside of boundries
If y > 0 And x < MAX_MAPX Then
n = Map(MapNum).Tile(x + 1, y - 1).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x + 1) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y - 1) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x + 1) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y - 1) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_DOWN_LEFT
' Check to make sure not outside of boundries
If y < MAX_MAPY And x > 0 Then
n = Map(MapNum).Tile(x - 1, y + 1).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x - 1) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y + 1) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x - 1) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y + 1) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
Case DIR_DOWN_RIGHT
' Check to make sure not outside of boundries
If y < MAX_MAPY And x < MAX_MAPX Then
n = Map(MapNum).Tile(x + 1, y + 1).Type
' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM Then
CanNpcMove = False
Exit Function
End If
' Check to make sure that there is not a player in the way
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If (GetPlayerMap(i) = MapNum) And (GetPlayerX(i) = MapNpc(MapNum, MapNpcNum).x + 1) And (GetPlayerY(i) = MapNpc(MapNum, MapNpcNum).y + 1) Then
CanNpcMove = False
Exit Function
End If
End If
Next i
' Check to make sure that there is not another npc in the way
For i = 1 To MAX_MAP_NPCS
If (i <> MapNpcNum) And (MapNpc(MapNum, i).Num > 0) And (MapNpc(MapNum, i).x = MapNpc(MapNum, MapNpcNum).x + 1) And (MapNpc(MapNum, i).y = MapNpc(MapNum, MapNpcNum).y + 1) Then
CanNpcMove = False
Exit Function
End If
Next i
Else
CanNpcMove = False
End If
End Select
End Function
Next Find
Code:
Sub NpcMove(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Dir As Long, ByVal Movement As Long)
Replace sub with
Code:
Sub NpcMove(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Dir As Long, ByVal Movement As Long)
Dim Packet As String
' Check for subscript out of range
If MapNum <= 0 Or MapNum > MAX_MAPS Or MapNpcNum <= 0 Or MapNpcNum > MAX_MAP_NPCS Or Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Or Movement < 1 Or Movement > 2 Then
Exit Sub
End If
MapNpc(MapNum, MapNpcNum).Dir = Dir
Select Case Dir
Case DIR_UP
MapNpc(MapNum, MapNpcNum).y = MapNpc(MapNum, MapNpcNum).y - 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_DOWN
MapNpc(MapNum, MapNpcNum).y = MapNpc(MapNum, MapNpcNum).y + 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_LEFT
MapNpc(MapNum, MapNpcNum).x = MapNpc(MapNum, MapNpcNum).x - 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_RIGHT
MapNpc(MapNum, MapNpcNum).x = MapNpc(MapNum, MapNpcNum).x + 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_UP_LEFT
MapNpc(MapNum, MapNpcNum).x = MapNpc(MapNum, MapNpcNum).x - 1
MapNpc(MapNum, MapNpcNum).y = MapNpc(MapNum, MapNpcNum).y - 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_UP_RIGHT
MapNpc(MapNum, MapNpcNum).x = MapNpc(MapNum, MapNpcNum).x + 1
MapNpc(MapNum, MapNpcNum).y = MapNpc(MapNum, MapNpcNum).y - 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_DOWN_LEFT
MapNpc(MapNum, MapNpcNum).x = MapNpc(MapNum, MapNpcNum).x - 1
MapNpc(MapNum, MapNpcNum).y = MapNpc(MapNum, MapNpcNum).y + 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
Case DIR_DOWN_RIGHT
MapNpc(MapNum, MapNpcNum).x = MapNpc(MapNum, MapNpcNum).x + 1
MapNpc(MapNum, MapNpcNum).y = MapNpc(MapNum, MapNpcNum).y + 1
Packet = SNpcMove & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(MapNum, MapNpcNum).x & SEP_CHAR & MapNpc(MapNum, MapNpcNum).y & SEP_CHAR & MapNpc(MapNum, MapNpcNum).Dir & SEP_CHAR & Movement & END_CHAR
Call SendDataToMap(MapNum, Packet)
End Select
End Sub
Next Find
Code:
Sub NpcDir(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Dir As Long)
Replace sub with
Code:
Sub NpcDir(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Dir As Long)
Dim Packet As String
' Check for subscript out of range
If MapNum <= 0 Or MapNum > MAX_MAPS Or MapNpcNum <= 0 Or MapNpcNum > MAX_MAP_NPCS Or Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Then
Exit Sub
End If
MapNpc(MapNum, MapNpcNum).Dir = Dir
Packet = SNpcDir & SEP_CHAR & MapNpcNum & SEP_CHAR & Dir & END_CHAR
Call SendDataToMap(MapNum, Packet)
End Sub
Next Find
Code:
Sub HandlePlayerMove(ByVal Index As Long, ByRef Parse() As String)
Replace sub with
Code:
Sub HandlePlayerMove(ByVal Index As Long, ByRef Parse() As String)
Dim Dir As Long, Movement As Long
If TempPlayer(Index).GettingMap = YES Then
Exit Sub
End If
Dir = Val(Parse(1))
Movement = Val(Parse(2))
' Prevent hacking
If Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Then
Call HackingAttempt(Index, "Invalid Direction")
Exit Sub
End If
' Prevent hacking
If Movement < 1 Or Movement > 2 Then
Call HackingAttempt(Index, "Invalid Movement")
Exit Sub
End If
' Prevent player from moving if they have casted a spell
If TempPlayer(Index).CastedSpell = YES Then
' Check if they have already casted a spell, and if so we can't let them move
If GetTickCount > TempPlayer(Index).AttackTimer + 1000 Then
TempPlayer(Index).CastedSpell = NO
Else
Call SendPlayerXY(Index)
Exit Sub
End If
End If
Call PlayerMove(Index, Dir, Movement)
End Sub
Next Find
Code:
Sub HandlePlayerDir(ByVal Index As Long, ByRef Parse() As String)
Replace sub with
Code:
Sub HandlePlayerDir(ByVal Index As Long, ByRef Parse() As String)
Dim Dir As Long
If TempPlayer(Index).GettingMap = YES Then
Exit Sub
End If
Dir = Val(Parse(1))
' Prevent hacking
If Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Then
Call HackingAttempt(Index, "Invalid Direction")
Exit Sub
End If
Call SetPlayerDir(Index, Dir)
Call SendDataToMapBut(Index, GetPlayerMap(Index), "playerdir" & SEP_CHAR & Index & SEP_CHAR & GetPlayerDir(Index) & END_CHAR)
End Sub
In
Code:
Sub HandleUseItem(ByVal Index As Long, ByRef Parse() As String)
Find
Code:
Case ITEM_TYPE_KEY
Select Case GetPlayerDir(Index)
Case DIR_UP
If GetPlayerY(Index) > 0 Then
x = GetPlayerX(Index)
y = GetPlayerY(Index) - 1
Else
Exit Sub
End If
Case DIR_DOWN
If GetPlayerY(Index) < MAX_MAPY Then
x = GetPlayerX(Index)
y = GetPlayerY(Index) + 1
Else
Exit Sub
End If
Case DIR_LEFT
If GetPlayerX(Index) > 0 Then
x = GetPlayerX(Index) - 1
y = GetPlayerY(Index)
Else
Exit Sub
End If
Case DIR_RIGHT
If GetPlayerX(Index) < MAX_MAPX Then
x = GetPlayerX(Index) + 1
y = GetPlayerY(Index)
Else
Exit Sub
End If
Replace this bit of code with
Code:
Case ITEM_TYPE_KEY
Select Case GetPlayerDir(Index)
Case DIR_UP
If GetPlayerY(Index) > 0 Then
x = GetPlayerX(Index)
y = GetPlayerY(Index) - 1
Else
Exit Sub
End If
Case DIR_DOWN
If GetPlayerY(Index) < MAX_MAPY Then
x = GetPlayerX(Index)
y = GetPlayerY(Index) + 1
Else
Exit Sub
End If
Case DIR_LEFT
If GetPlayerX(Index) > 0 Then
x = GetPlayerX(Index) - 1
y = GetPlayerY(Index)
Else
Exit Sub
End If
Case DIR_RIGHT
If GetPlayerX(Index) < MAX_MAPX Then
x = GetPlayerX(Index) + 1
y = GetPlayerY(Index)
Else
Exit Sub
End If
Case DIR_UP_LEFT
If GetPlayerY(Index) > 0 And GetPlayerX(Index) > 0 Then
x = GetPlayerX(Index) - 1
y = GetPlayerY(Index) - 1
Else
Exit Sub
End If
Case DIR_UP_RIGHT
If GetPlayerY(Index) > 0 And GetPlayerX(Index) < MAX_MAPX Then
x = GetPlayerX(Index) + 1
y = GetPlayerY(Index) - 1
Else
Exit Sub
End If
Case DIR_DOWN_LEFT
If GetPlayerY(Index) < MAX_MAPY And GetPlayerX(Index) > 0 Then
x = GetPlayerX(Index) - 1
y = GetPlayerY(Index) + 1
Else
Exit Sub
End If
Case DIR_DOWN_RIGHT
If GetPlayerY(Index) < MAX_MAPY And GetPlayerX(Index) < MAX_MAPX Then
x = GetPlayerX(Index) + 1
y = GetPlayerY(Index) + 1
Else
Exit Sub
End If
Next find
Code:
Sub HandleRequestNewMap
Replace this sub with
Code:
Sub HandleRequestNewMap(ByVal Index As Long, ByRef Parse() As String)
Dim Dir As Long
Dir = Val(Parse(1))
' Prevent hacking
If Dir < DIR_UP Or Dir > DIR_DOWN_RIGHT Then
Call HackingAttempt(Index, "Invalid Direction")
Exit Sub
End If
Call PlayerMove(Index, Dir, 1)
End Sub
UpdateNPCAi still needs to be done.