Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 28th, 2012  |  syntax: None  |  size: 2.47 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. Sub JoinGame(ByVal Index As Long)
  3.     Dim i As Long
  4.    
  5.    
  6.     ' Set the flag so we know the person is in the game
  7.     TempPlayer(Index).InGame = True
  8.     'Update the log
  9.     frmServer.lvwInfo.ListItems(Index).SubItems(1) = GetPlayerIP(Index)
  10.     frmServer.lvwInfo.ListItems(Index).SubItems(2) = GetPlayerLogin(Index)
  11.     frmServer.lvwInfo.ListItems(Index).SubItems(3) = GetPlayerName(Index)
  12.    
  13.     ' send the login ok
  14.     SendLoginOk Index
  15.    
  16.     TotalPlayersOnline = TotalPlayersOnline + 1
  17.    
  18.     ' Send some more little goodies, no need to explain these
  19.     Call CheckEquippedItems(Index)
  20.     Call SendClasses(Index)
  21.     Call SendItems(Index)
  22.     Call SendAnimations(Index)
  23.     Call SendNpcs(Index)
  24.     Call SendShops(Index)
  25.     Call SendSpells(Index)
  26.     Call SendConvs(Index)
  27.     Call SendResources(Index)
  28.     Call SendInventory(Index)
  29.     Call SendWornEquipment(Index)
  30.     Call SendMapEquipment(Index)
  31.     Call SendPlayerSpells(Index)
  32.     Call SendHotbar(Index)
  33.     ' send vitals, exp + stats
  34.     For i = 1 To Vitals.Vital_Count - 1
  35.         Call SendVital(Index, i)
  36.     Next
  37.     SendEXP Index
  38.     Call SendStats(Index)
  39.    
  40.     ' Warp the player to his saved location
  41.     Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
  42.    
  43.     ' Send a global message that he/she joined
  44.     If GetPlayerAccess(Index) <= ADMIN_MONITOR Then
  45.         'Call GlobalMsg(GetPlayerName(index) & " has joined " & Options.Game_Name & "!", JoinLeftColor)
  46.     Else
  47.         Call GlobalMsg(GetPlayerName(Index) & " has joined " & Options.Game_Name & "!", White)
  48.     End If
  49.    
  50.     ' Send welcome messages
  51.     Call SendWelcome(Index)
  52.    
  53.     'Do all the guild start up checks
  54.     Call GuildLoginCheck(Index)
  55.  
  56.     ' Send Resource cache
  57.     For i = 0 To ResourceCache(GetPlayerMap(Index)).Resource_Count
  58.         SendResourceCacheTo Index, i
  59.     Next
  60.    
  61.     ' Send the flag so they know they can start doing stuff
  62.     SendInGame Index
  63.    
  64.     ' Send any unread messages
  65.     Call Unread(i, Player(Index).Login)
  66.    
  67.    
  68.     If Player(Index).PrevMap > 0 Then
  69.     Call PlayerWarp(Index, Player(Index).PrevMap, Player(Index).PrevX, Player(Index).PrevY)
  70.     Player(Index).PrevMap = 0
  71.     Player(Index).PrevX = 0
  72.     Player(Index).PrevY = 0
  73.     Call PlayerMsg(Index, "You Have Left The Instance!", Red)
  74.     End If
  75.    
  76.     ' tell them to do the damn tutorial
  77.     If Player(Index).TutorialState = 0 Then SendStartTutorial Index
  78. End Sub