private static void LoadGameData() { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Loading Classes..."); modDatabase.LoadClasses(); Console.WriteLine("Loading Maps..."); modDatabase.LoadMaps(); Console.WriteLine("Creating Map Matrices..."); for (int i = 1; i < Constants.MAX_MAPS; i++) { modPathfinding.CreatePathMatrix(i); } Console.WriteLine("Loading Items..."); S_Items.LoadItems(); Console.WriteLine("Loading Npc's..."); modDatabase.LoadNpcs(); Console.WriteLine("Loading Resources..."); S_Resources.LoadResources(); Console.WriteLine("Loading Shops..."); modDatabase.LoadShops(); Console.WriteLine("Loading Skills..."); modDatabase.LoadSkills(); Console.WriteLine("Loading Animations..."); S_Animations.LoadAnimations(); Console.WriteLine("Loading Quests..."); S_Quest.LoadQuests(); Console.WriteLine("Loading House Configurations..."); S_Housing.LoadHouses(); Console.WriteLine("Loading Switches..."); S_Events.LoadSwitches(); Console.WriteLine("Loading Variables..."); S_Events.LoadVariables(); Console.WriteLine("Spawning global events..."); S_EventLogic.SpawnAllMapGlobalEvents(); Console.WriteLine("Loading projectiles..."); S_Projectiles.LoadProjectiles(); Console.WriteLine("Loading Recipes..."); modCrafting.LoadRecipes(); Console.WriteLine("Loading Pets..."); S_Pets.LoadPets(); Console.ResetColor(); }
private static void LoadGameData() { Console.WriteLine("Loading Classes..."); modDatabase.LoadClasses(); Console.WriteLine("Loading Maps..."); modDatabase.LoadMaps(); Console.WriteLine("Loading Items..."); S_Items.LoadItems(); Console.WriteLine("Loading Npc's..."); modDatabase.LoadNpcs(); Console.WriteLine("Loading Resources..."); S_Resources.LoadResources(); Console.WriteLine("Loading Shops..."); modDatabase.LoadShops(); Console.WriteLine("Loading Skills..."); modDatabase.LoadSkills(); Console.WriteLine("Loading Animations..."); S_Animations.LoadAnimations(); Console.WriteLine("Loading Quests..."); S_Quest.LoadQuests(); Console.WriteLine("Loading House Configurations..."); S_Housing.LoadHouses(); Console.WriteLine("Loading Switches..."); S_Events.LoadSwitches(); Console.WriteLine("Loading Variables..."); S_Events.LoadVariables(); Console.WriteLine("Spawning global events..."); S_EventLogic.SpawnAllMapGlobalEvents(); Console.WriteLine("Loading projectiles..."); S_Projectiles.LoadProjectiles(); Console.WriteLine("Loading Recipes..."); modCrafting.LoadRecipes(); Console.WriteLine("Loading Pets..."); S_Pets.LoadPets(); }
internal static void Party_ShareExp(int partyNum, int exp, int index, int mapNum) { int expShare = 0; int leftOver = 0; int i = 0; int tmpindex = 0; byte loseMemberCount = 0; // check if it's worth sharing if (!(exp >= Party[partyNum].MemberCount)) { // no party - keep exp for self S_Events.GivePlayerExp(index, exp); return; } // check members in others maps for (i = 1; i <= Constants.MAX_PARTY_MEMBERS; i++) { tmpindex = Party[partyNum].Member[i]; if (tmpindex > 0) { if (S_NetworkConfig.Socket.IsConnected(tmpindex) && S_NetworkConfig.IsPlaying(tmpindex)) { if (S_Players.GetPlayerMap(tmpindex) != mapNum) { loseMemberCount = (byte)(loseMemberCount + 1); } } } } // find out the equal share expShare = exp / (Party[partyNum].MemberCount - loseMemberCount); leftOver = exp % (Party[partyNum].MemberCount - loseMemberCount); // loop through and give everyone exp for (i = 1; i <= Constants.MAX_PARTY_MEMBERS; i++) { tmpindex = Party[partyNum].Member[i]; // existing member? if (tmpindex > 0) { // playing? if (S_NetworkConfig.Socket.IsConnected(tmpindex) && S_NetworkConfig.IsPlaying(tmpindex)) { if (S_Players.GetPlayerMap(tmpindex) == mapNum) { // give them their share S_Events.GivePlayerExp(tmpindex, expShare); } } } } // give the remainder to a random member if (!(leftOver == 0)) { tmpindex = Party[partyNum].Member[S_GameLogic.Random(1, Party[partyNum].MemberCount)]; // give the exp S_Events.GivePlayerExp(tmpindex, leftOver); } }