Justin Knight Posted April 17, 2016 Author Share Posted April 17, 2016 In EO3 if you login while holding a direction towards an event that you can't normally pass through, you will clip through it while it's loading.on the server side replace PlayerMove with this```Sub PlayerMove(ByVal index As Long, ByVal Dir As Long, ByVal movement As Long, Optional ByVal sendToSelf As Boolean = False) Dim Buffer As clsBuffer, mapnum As Long, i As Long Dim x As Long, y As Long Dim Moved As Byte, MovedSoFar As Boolean Dim NewMapX As Byte, NewMapY As Byte Dim TileType As Long, VitalType As Long, Colour As Long, amount As Long, begineventprocessing As Boolean Dim eventblock As Boolean ' Check for subscript out of range If IsPlaying(index) = False Or Dir < DIR_UP Or Dir > DIR_RIGHT Or movement < 1 Or movement > 2 Then Exit Sub End If Call SetPlayerDir(index, Dir) Moved = NO mapnum = GetPlayerMap(index) 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 Not isDirBlocked(Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).DirBlock, DIR_UP + 1) Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index) - 1).Type <> TILE_TYPE_BLOCKED Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index) - 1).Type <> TILE_TYPE_RESOURCE 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 eventblock = False 'check to see if there is a solid event error fix 1005 If TempPlayer(index).EventMap.CurrentEvents > 0 Then For i = 1 To TempPlayer(index).EventMap.CurrentEvents If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Global = 1 Then If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).x = GetPlayerX(index) And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).y = GetPlayerY(index) - 1 And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If Else If TempPlayer(index).EventMap.EventPages(i).x = GetPlayerX(index) And TempPlayer(index).EventMap.EventPages(i).y = GetPlayerY(index) - 1 And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If End If Next End If If eventblock = False Then Call SetPlayerY(index, GetPlayerY(index) - 1) SendPlayerMove index, movement, sendToSelf Moved = YES End If End If End If End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(index)).Up > 0 Then NewMapY = Map(Map(GetPlayerMap(index)).Up).MaxY Call PlayerWarp(index, Map(GetPlayerMap(index)).Up, GetPlayerX(index), NewMapY) Moved = YES ' clear their target TempPlayer(index).target = 0 TempPlayer(index).targetType = TARGET_TYPE_NONE SendTarget index End If End If Case DIR_DOWN ' Check to make sure not outside of boundries If GetPlayerY(index) < Map(mapnum).MaxY Then ' Check to make sure that the tile is walkable If Not isDirBlocked(Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).DirBlock, DIR_DOWN + 1) Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index) + 1).Type <> TILE_TYPE_BLOCKED Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index) + 1).Type <> TILE_TYPE_RESOURCE 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 eventblock = False 'check to see if there is a solid event error fix 1005 If TempPlayer(index).EventMap.CurrentEvents > 0 Then For i = 1 To TempPlayer(index).EventMap.CurrentEvents If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Global = 1 Then If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).x = GetPlayerX(index) And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).y = GetPlayerY(index) + 1 And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If Else If TempPlayer(index).EventMap.EventPages(i).x = GetPlayerX(index) And TempPlayer(index).EventMap.EventPages(i).y = GetPlayerY(index) + 1 And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If End If Next End If If eventblock = False Then 'move player Call SetPlayerY(index, GetPlayerY(index) + 1) SendPlayerMove index, movement, sendToSelf Moved = YES End If End If End If 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 ' clear their target TempPlayer(index).target = 0 TempPlayer(index).targetType = TARGET_TYPE_NONE SendTarget index 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 Not isDirBlocked(Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).DirBlock, DIR_LEFT + 1) Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index) - 1, GetPlayerY(index)).Type <> TILE_TYPE_BLOCKED Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index) - 1, GetPlayerY(index)).Type <> TILE_TYPE_RESOURCE 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 eventblock = False 'check to see if there is a solid event error fix 1005 If TempPlayer(index).EventMap.CurrentEvents > 0 Then For i = 1 To TempPlayer(index).EventMap.CurrentEvents If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Global = 1 Then If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).x = GetPlayerX(index) - 1 And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).y = GetPlayerY(index) And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If Else If TempPlayer(index).EventMap.EventPages(i).x = GetPlayerX(index) - 1 And TempPlayer(index).EventMap.EventPages(i).y = GetPlayerY(index) And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If End If Next End If If eventblock = False Then 'move player Call SetPlayerX(index, GetPlayerX(index) - 1) SendPlayerMove index, movement, sendToSelf Moved = YES End If End If End If End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(index)).Left > 0 Then NewMapX = Map(Map(GetPlayerMap(index)).Left).MaxX Call PlayerWarp(index, Map(GetPlayerMap(index)).Left, NewMapX, GetPlayerY(index)) Moved = YES ' clear their target TempPlayer(index).target = 0 TempPlayer(index).targetType = TARGET_TYPE_NONE SendTarget index End If End If Case DIR_RIGHT ' Check to make sure not outside of boundries If GetPlayerX(index) < Map(mapnum).MaxX Then ' Check to make sure that the tile is walkable If Not isDirBlocked(Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).DirBlock, DIR_RIGHT + 1) Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index) + 1, GetPlayerY(index)).Type <> TILE_TYPE_BLOCKED Then If Map(GetPlayerMap(index)).Tile(GetPlayerX(index) + 1, GetPlayerY(index)).Type <> TILE_TYPE_RESOURCE 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 eventblock = False 'check to see if there is a solid event error fix 1005 If TempPlayer(index).EventMap.CurrentEvents > 0 Then For i = 1 To TempPlayer(index).EventMap.CurrentEvents If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Global = 1 Then If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).x = GetPlayerX(index) + 1 And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).y = GetPlayerY(index) And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If Else If TempPlayer(index).EventMap.EventPages(i).x = GetPlayerX(index) + 1 And TempPlayer(index).EventMap.EventPages(i).y = GetPlayerY(index) And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).WalkThrough = 0 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then 'stuff here cant walk here eventblock = True Else 'can walk here End If End If Next End If If eventblock = False Then 'move player Call SetPlayerX(index, GetPlayerX(index) + 1) SendPlayerMove index, movement, sendToSelf Moved = YES End If 'Call SetPlayerX(index, GetPlayerX(index) + 1) 'SendPlayerMove index, movement, sendToSelf 'Moved = YES End If End If 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 ' clear their target TempPlayer(index).target = 0 TempPlayer(index).targetType = TARGET_TYPE_NONE SendTarget index End If End If End Select With Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)) ' Check to see if the tile is a warp tile, and if so warp them If .Type = TILE_TYPE_WARP Then mapnum = .Data1 x = .Data2 y = .Data3 Call PlayerWarp(index, mapnum, x, y) Moved = YES End If ' Check to see if the tile is a door tile, and if so warp them If .Type = TILE_TYPE_DOOR Then mapnum = .Data1 x = .Data2 y = .Data3 ' send the animation to the map SendDoorAnimation GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index) Call PlayerWarp(index, mapnum, x, y) Moved = YES End If ' Check for key trigger open If .Type = TILE_TYPE_KEYOPEN Then x = .Data1 y = .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 = GetTick SendMapKey index, x, y, 1 Call MapMsg(GetPlayerMap(index), "A door has been unlocked.", White) End If End If ' Check for a shop, and if so open it If .Type = TILE_TYPE_SHOP Then x = .Data1 If x > 0 Then ' shop exists? If Len(Trim$(Shop(x).Name)) > 0 Then ' name exists? SendOpenShop index, x TempPlayer(index).InShop = x ' stops movement and the like End If End If End If ' Check to see if the tile is a bank, and if so send bank If .Type = TILE_TYPE_BANK Then SendBank index TempPlayer(index).InBank = True Moved = YES End If ' Check if it's a heal tile If .Type = TILE_TYPE_HEAL Then VitalType = .Data1 amount = .Data2 If Not GetPlayerVital(index, VitalType) = GetPlayerMaxVital(index, VitalType) Then If VitalType = Vitals.HP Then Colour = BrightGreen Else Colour = BrightBlue End If SendActionMsg GetPlayerMap(index), "+" & amount, Colour, ACTIONMSG_SCROLL, GetPlayerX(index) * 32, GetPlayerY(index) * 32, 1 SetPlayerVital index, VitalType, GetPlayerVital(index, VitalType) + amount PlayerMsg index, "You feel rejuvinating forces flowing through your boy.", BrightGreen Call SendVital(index, VitalType) ' send vitals to party if in one If TempPlayer(index).inParty > 0 Then SendPartyVitals TempPlayer(index).inParty, index End If Moved = YES End If ' Check if it's a trap tile If .Type = TILE_TYPE_TRAP Then amount = .Data1 SendActionMsg GetPlayerMap(index), "-" & amount, BrightRed, ACTIONMSG_SCROLL, GetPlayerX(index) * 32, GetPlayerY(index) * 32, 1 If GetPlayerVital(index, HP) - amount <= 0 Then KillPlayer index PlayerMsg index, "You're killed by a trap.", BrightRed Else SetPlayerVital index, HP, GetPlayerVital(index, HP) - amount PlayerMsg index, "You're injured by a trap.", BrightRed Call SendVital(index, HP) ' send vitals to party if in one If TempPlayer(index).inParty > 0 Then SendPartyVitals TempPlayer(index).inParty, index End If Moved = YES End If ' Slide If .Type = TILE_TYPE_SLIDE Then ForcePlayerMove index, MOVING_WALKING, .Data1 Moved = YES End If 'checkpoint If .Type = TILE_TYPE_CHECKPOINT Then SetCheckpoint index, .Data1, .Data2, .Data3 End If End With ' They tried to hack If Moved = NO Then PlayerWarp index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index) End If x = GetPlayerX(index) y = GetPlayerY(index) If Moved = YES Then If TempPlayer(index).EventMap.CurrentEvents > 0 Then For i = 1 To TempPlayer(index).EventMap.CurrentEvents If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Global = 1 Then If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).x = x And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).y = y And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).Trigger = 1 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then begineventprocessing = True Else If TempPlayer(index).EventMap.EventPages(i).x = x And TempPlayer(index).EventMap.EventPages(i).y = y And Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).Trigger = 1 And TempPlayer(index).EventMap.EventPages(i).Visible = 1 Then begineventprocessing = True End If If begineventprocessing = True Then 'Process this event, it is on-touch and everything checks out. If Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).CommandListCount > 0 Then TempPlayer(index).EventProcessingCount = TempPlayer(index).EventProcessingCount + 1 ReDim Preserve TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount) TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).ActionTimer = GetTick TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).CurList = 1 TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).CurSlot = 1 TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).eventID = TempPlayer(index).EventMap.EventPages(i).eventID TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).pageID = TempPlayer(index).EventMap.EventPages(i).pageID TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).WaitingForResponse = 0 ReDim TempPlayer(index).EventProcessing(TempPlayer(index).EventProcessingCount).ListLeftOff(0 To Map(GetPlayerMap(index)).Events(TempPlayer(index).EventMap.EventPages(i).eventID).Pages(TempPlayer(index).EventMap.EventPages(i).pageID).CommandListCount) End If begineventprocessing = False End If Next End If End IfEnd Sub``` Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now