- Sub JoinGame(ByVal Index As Long)
- Dim i As Long
- ' Set the flag so we know the person is in the game
- TempPlayer(Index).InGame = True
- 'Update the log
- frmServer.lvwInfo.ListItems(Index).SubItems(1) = GetPlayerIP(Index)
- frmServer.lvwInfo.ListItems(Index).SubItems(2) = GetPlayerLogin(Index)
- frmServer.lvwInfo.ListItems(Index).SubItems(3) = GetPlayerName(Index)
- ' send the login ok
- SendLoginOk Index
- TotalPlayersOnline = TotalPlayersOnline + 1
- ' Send some more little goodies, no need to explain these
- Call CheckEquippedItems(Index)
- Call SendClasses(Index)
- Call SendItems(Index)
- Call SendAnimations(Index)
- Call SendNpcs(Index)
- Call SendShops(Index)
- Call SendSpells(Index)
- Call SendConvs(Index)
- Call SendResources(Index)
- Call SendInventory(Index)
- Call SendWornEquipment(Index)
- Call SendMapEquipment(Index)
- Call SendPlayerSpells(Index)
- Call SendHotbar(Index)
- ' send vitals, exp + stats
- For i = 1 To Vitals.Vital_Count - 1
- Call SendVital(Index, i)
- Next
- SendEXP Index
- Call SendStats(Index)
- ' Warp the player to his saved location
- Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
- ' Send a global message that he/she joined
- If GetPlayerAccess(Index) <= ADMIN_MONITOR Then
- 'Call GlobalMsg(GetPlayerName(index) & " has joined " & Options.Game_Name & "!", JoinLeftColor)
- Else
- Call GlobalMsg(GetPlayerName(Index) & " has joined " & Options.Game_Name & "!", White)
- End If
- ' Send welcome messages
- Call SendWelcome(Index)
- 'Do all the guild start up checks
- Call GuildLoginCheck(Index)
- ' Send Resource cache
- For i = 0 To ResourceCache(GetPlayerMap(Index)).Resource_Count
- SendResourceCacheTo Index, i
- Next
- ' Send the flag so they know they can start doing stuff
- SendInGame Index
- ' Send any unread messages
- Call Unread(i, Player(Index).Login)
- If Player(Index).PrevMap > 0 Then
- Call PlayerWarp(Index, Player(Index).PrevMap, Player(Index).PrevX, Player(Index).PrevY)
- Player(Index).PrevMap = 0
- Player(Index).PrevX = 0
- Player(Index).PrevY = 0
- Call PlayerMsg(Index, "You Have Left The Instance!", Red)
- End If
- ' tell them to do the damn tutorial
- If Player(Index).TutorialState = 0 Then SendStartTutorial Index
- End Sub