diff --git a/README.md b/README.md index 9aabaab..2ac480f 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,16 @@ dotnet publish ./src/DiIiS-NA/Blizzless.csproj --configuration Release --output - `!account add username@ YourPassword YourBattleTag owner` - Creates an account with Login `username@`, password `YourPassword` and BattleTag `YourBattleTag` with rank `owner` +### Example: + +> !account add username@ YourPassword YourBattleTag + +Creates an account with Login `username@`, password `YourPassword` and BattleTag `YourBattleTag` + +> !account add username@ YourPassword YourBattleTag owner + +Creates an account with Login `username@`, password `YourPassword` and BattleTag `YourBattleTag` with rank `owner` + ## Prepare Client Do this for each client connecting to the server. diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestEvents/Implementations/Act I/SpawnSkeletons.cs b/Src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestEvents/Implementations/Act I/SpawnSkeletons.cs similarity index 96% rename from src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestEvents/Implementations/Act I/SpawnSkeletons.cs rename to Src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestEvents/Implementations/Act I/SpawnSkeletons.cs index 2a33eae..ff7fe82 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestEvents/Implementations/Act I/SpawnSkeletons.cs +++ b/Src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestEvents/Implementations/Act I/SpawnSkeletons.cs @@ -72,7 +72,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem.QuestEvents.Implementations var spawner = world.GetActorBySNO(ActorSno._trdun_rescuecainskelspawner); while (spawner != null) { - var monster = FastRandom.Instance.Next(10) % 2 == 0 ? ActorSno._skeletonking_shield_skeleton : ActorSno._skeletonking_skeleton; + var monster = ActorSno._skeletonking_shield_skeleton; world.SpawnMonster(monster, spawner.Position); spawner.Destroy(); spawner = world.GetActorBySNO(ActorSno._trdun_rescuecainskelspawner); diff --git a/src/DiIiS-NA/BGS-Server/ServicesSystem/Services/GameUtilitiesService.cs b/src/DiIiS-NA/BGS-Server/ServicesSystem/Services/GameUtilitiesService.cs index 3eeb0de..57356b9 100644 --- a/src/DiIiS-NA/BGS-Server/ServicesSystem/Services/GameUtilitiesService.cs +++ b/src/DiIiS-NA/BGS-Server/ServicesSystem/Services/GameUtilitiesService.cs @@ -77,7 +77,7 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services const int anniversaryEventStatus = 1; const int challengeRiftNumber = 1; const bool freeToPlay = true; - const bool storeStatus = false; // false + const bool storeStatus = true; // false (true - disabled, false - enabled) const string catalogDigest = "C42DC6117A7008EDA2006542D6C07EAD096DAD90"; const string catalogVersion = "633565800390338000"; const int regionId = 1; @@ -92,8 +92,8 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services $" OnlineService.Store.Status={(storeStatus ? "1" : "0")}" + //Store Status, 0 - Enabled, 1 - Disabled $" OnlineService.Store.ProductCatalogDigest={catalogDigest}" + //China $" OnlineService.Store.ProductCatalogVersion={catalogVersion}" + //Chinese Catalog - //" OnlineService.Store.ProductCatalogDigest=79162283AFACCBA5DA989BD341F7B782860AC1F4" + //Euro - //" OnlineService.Store.ProductCatalogVersion=635984100169931000" + //Euro + //" OnlineService.Store.ProductCatalogDigest=79162283AFACCBA5DA989BD341F7B782860AC1F4" + //Euro + //" OnlineService.Store.ProductCatalogVersion=635984100169931000" + //Euro $" OnlineService.Region.Id={regionId}"); //Region Init.SetSeenTutorials(ByteString.CopyFrom(Client.Account.GameAccount.DBGameAccount.SeenTutorials)); diff --git a/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/ActorSno.cs b/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/ActorSno.cs index d1b4091..be363b1 100644 --- a/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/ActorSno.cs +++ b/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/ActorSno.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using DiIiS_NA.Core.MPQ; @@ -19043,8 +19042,39 @@ namespace DiIiS_NA.D3_GameServer.Core.Types.SNO _p74_dh_multishotrune_discipline_cast_proj_actor = 487919, _p74_dh_multishotrune_width_cast_proj_actor = 487920, _p74_cosmetic_pet_zombiewolfpup = 487966, - #endregion - } + _holidaygift = 488101, + _p75_cos_pet_murlocinarius = 488105, + _p75_displayicon = 488117, + _p75_cos_pet_inariusmurloc_wings = 488119, + _p75_displayicon_024 = 488129, + _p75_displayicon_002 = 488130, + _p75_displayicon_004 = 488131, + _p75_displayicon_023 = 488132, + _p75_cosmetic_pet_inariusmurloc = 488138, + _p75_cos_wings_inarius = 488139, + _p75_cos_wings_inarius_barbf = 488186, + _p75_cos_wings_inarius_barbm = 488189, + _p75_cos_wings_inarius_cdrf = 488191, + _p75_cos_wings_inarius_cdrm = 488193, + _p75_cos_wings_inarius_dhf = 488195, + _p75_cos_wings_inarius_dhm = 488197, + _p75_cos_wings_inarius_monkf = 488199, + _p75_cos_wings_inarius_monkm = 488201, + _p75_cos_wings_inarius_nmf = 488203, + _p75_cos_wings_inarius_nmm = 488205, + _p75_cos_wings_inarius_wdf = 488207, + _p75_cos_wings_inarius_wdm = 488209, + _p75_cos_wings_inarius_wizf = 488211, + _p75_cos_wings_inarius_wizm = 488213, + _p75_darkalchemy_gizmo_altar = 488275, + _p75_cos_pet_angelicdragon = 488485, + _p75_cosmetic_pet_angelicdragon = 488498, + _p75_displayicon_018 = 488500, + _p75_displayicon_020 = 488501, + _p75_crafting_primal = 488515, + _p75_itempassive_unique_ring_017_dome_purple_red = 488528, + #endregion + } static class ActorSnoExtensions { diff --git a/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/AnimationSno.cs b/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/AnimationSno.cs index fd80a13..a1643ea 100644 --- a/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/AnimationSno.cs +++ b/src/DiIiS-NA/D3-GameServer/Core/Types/SNO/AnimationSno.cs @@ -15253,6 +15253,9 @@ p75_cos_wings_inarius_anim_wizf_idle_2_intimidate = 488182, p75_cos_wings_inarius_anim_wizm_idle_0_neutral = 488183, p75_cos_wings_inarius_anim_wizm_idle_2_intimidate = 488185, + p75_cos_pet_angelicdragon_creation = 488486, + p75_cos_pet_angelicdragon_fidget_grp = 488487, + p75_cos_pet_angelicdragon_run = 488488, #endregion } } diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/Kadala.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/Kadala.cs index 35699aa..7274781 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/Kadala.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/Kadala.cs @@ -61,7 +61,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations return; } - int cost = item.ItemDefinition.Cost; + int cost = item.ItemDefinition.CostAlt; //Check shards here if (currentShards < cost) return; diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GameUpdateManager.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GameUpdateManager.cs index 3a00f41..6854f0b 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GameUpdateManager.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/GameUpdateManager.cs @@ -25,7 +25,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem var thread = new GameUpdateThread(); //thread.CPUAffinity = (1UL << coreId); _updateWorkers.Add(thread); - var loopThread = new Thread(thread.Run) { Name = "UpdateWorkerThread", IsBackground = true }; ; // create the game update thread. + var loopThread = new Thread(thread.Run) { Name = "UpdateWorkerThread", IsBackground = true }; loopThread.Start(); } Logger.Info("Started {0} threads", CPUCount); diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/ItemsSystem/Item.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/ItemsSystem/Item.cs index 9d32bc2..f0ee67d 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/ItemsSystem/Item.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/ItemsSystem/Item.cs @@ -31,7 +31,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem get; private set; //needed in Future, set this to true if Item affixes or item attributes have changed. } - + public override ActorType ActorType => ActorType.Item; public Actor Owner { get; set; } // Only set when the _actor_ has the item in its inventory. /fasbat @@ -43,10 +43,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem public bool Unidentified { get => Attributes[GameAttributes.Unidentified]; - set - { + set + { Attributes[GameAttributes.Unidentified] = value; - if (DBInventory is {} dbInventory) dbInventory.Unidentified = value; + if (DBInventory is { } dbInventory) dbInventory.Unidentified = value; } } @@ -832,14 +832,88 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem public override void OnTargeted(Player player, TargetMessage message) { + player.Inventory.RefreshInventoryToClient(); var playerAcc = player.InGameClient.BnetClient.Account.GameAccount; switch (SNO) { - case ActorSno._tieredlootrunkey_0: + case ActorSno._tieredlootrunkey_0: //Greater Rift Key playerAcc.BigPortalKey++; Destroy(); break; + case ActorSno._crafting_assortedparts_05: //Reusable Parts + playerAcc.CraftItem1++; + Destroy(); + break; + + case ActorSno._crafting_magic_05: //Arcanes Dust + playerAcc.CraftItem2++; + Destroy(); + break; + + case ActorSno._crafting_rare_05: //Veiled Crystal + playerAcc.CraftItem3++; + Destroy(); + break; + + case ActorSno._crafting_looted_reagent_05: //Death's Breath + playerAcc.CraftItem4++; + Destroy(); + break; + + case ActorSno._crafting_legendary_05: //Forgotten Soul + playerAcc.CraftItem5++; + Destroy(); + break; + + case ActorSno._craftingreagent_legendary_set_borns_x1: //Khanduran Rune Bounty itens Act I. + playerAcc.HoradricA1Res++; + Destroy(); + break; + + case ActorSno._craftingreagent_legendary_set_cains_x1: //Caldeum Nightshade Bounty itens Act II. + playerAcc.HoradricA2Res++; + Destroy(); + break; + + case ActorSno._craftingreagent_legendary_set_demon_x1: //Arreat War Tapestry Bounty itens Act III. + playerAcc.HoradricA3Res++; + Destroy(); + break; + + case ActorSno._craftingreagent_legendary_set_hallowed_x1: //Corrupted Angel Flesh Bounty itens Act IV. + playerAcc.HoradricA4Res++; + Destroy(); + break; + + case ActorSno._craftingreagent_legendary_set_captaincrimsons_x1: //Westmarch Holy Water Bounty itens Act V. + playerAcc.HoradricA5Res++; + Destroy(); + break; + + case ActorSno._demonorgan_skeletonking_x1: //Leorik Regret. + playerAcc.LeorikKey++; + Destroy(); + break; + + case ActorSno._demonorgan_ghom_x1: //Vial of Putridness. + playerAcc.VialofPutridness++; + Destroy(); + break; + + case ActorSno._demonorgan_siegebreaker_x1: //Idol of Terror. + playerAcc.IdolofTerror++; + Destroy(); + break; + + case ActorSno._demonorgan_diablo_x1: //Heart of Fright. + playerAcc.HeartofFright++; + Destroy(); + break; + //case ActorSno._currency_platinum_flippy: //Platinum coin + // playerAcc.Platinum++; + // Destroy(); + // break; default: player.Inventory.PickUp(this); break; @@ -902,7 +976,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem player.InGameClient.SendMessage( new MessageSystem.Message.Definitions.Base.GenericBlobMessage(Opcodes.CurrencyDataFull) - { Data = Moneys.Build().ToByteArray() }); + { Data = Moneys.Build().ToByteArray() }); } public virtual void OnRequestUse(Player player, Item target, int actionId, WorldPlace worldPlace) @@ -1195,7 +1269,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem player.InGameClient.SendMessage( new MessageSystem.Message.Definitions.Base.GenericBlobMessage(Opcodes.CurrencyDataFull) - { Data = moneys.Build().ToByteArray() }); + { Data = moneys.Build().ToByteArray() }); player.Inventory.DestroyInventoryItem(this); return; diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Inventory.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Inventory.cs index b28a4ef..13a742a 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Inventory.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Inventory.cs @@ -582,7 +582,8 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem ChangeItemLocationDB(old_x, old_y + 1, addedItem); destGrid.PlaceItem(addedItem, old_y + 1, old_x); } - }; + } + ; } else { @@ -1198,12 +1199,12 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem (a.OverrideLevelReq <= Item.ItemDefinition.RequiredLevel) ); - if (!ReloadAffix.Definition.Name.Contains("Secondary")) filteredList = filteredList.Where( a => !a.Name.Contains("Secondary") ); + if (!ReloadAffix.Definition.Name.Contains("Secondary")) filteredList = filteredList.Where(a => !a.Name.Contains("Secondary")); if (!ReloadAffix.Definition.Name.Contains("Experience")) filteredList = filteredList.Where(a => !a.Name.Contains("Experience")); if (!ReloadAffix.Definition.Name.Contains("Archon")) filteredList = filteredList.Where(a => !a.Name.Contains("Archon")); // FIXME: always true? if (ReloadAffix.Definition.Hash == ReloadAffix.Definition.Hash) filteredList = filteredList.Where(a => a.Hash != ReloadAffix.Definition.Hash); - if (Item.GBHandle.GBID == -4139386) filteredList = filteredList.Where( a => !a.Name.Contains("Str") && !a.Name.Contains("Dex") && !a.Name.Contains("Int") && !a.Name.Contains("Vit" )); + if (Item.GBHandle.GBID == -4139386) filteredList = filteredList.Where(a => !a.Name.Contains("Str") && !a.Name.Contains("Dex") && !a.Name.Contains("Int") && !a.Name.Contains("Vit")); Dictionary bestDefinitions = new Dictionary(); @@ -1260,7 +1261,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem if (ReloadAffix.Definition.Name.Contains("Bracer")) result = (float)FastRandom.Instance.Next(1, 3); } - + if (GameAttributes.Attributes[effect.AttributeId] is GameAttributeF) { var attr = GameAttributes.Attributes[effect.AttributeId] as GameAttributeF; @@ -1286,7 +1287,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem foreach (var def in selectedGroups) { - if (def != null) + if (def != null) { List Scores = new List(); foreach (var effect in def.AttributeSpecifier) @@ -1300,7 +1301,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem if (Item.RandomGenerator == null) Item.RandomGenerator = new ItemRandomHelper(Item.Attributes[GameAttributes.Seed]); - + if (FormulaScript.Evaluate(effect.Formula.ToArray(), Item.RandomGenerator, out result, out minValue, out maxValue)) { if (effect.AttributeId == 369) continue; //Durability_Max @@ -1364,13 +1365,13 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem Field1 = (Item.Unidentified ? 0x00000002 : 0x00000001), aAffixGBIDs = affixGbis, }); - + //*/ } } #endregion _owner.GrantCriteria(74987255495718); - + } private void OnTrySalvageAllMessage(TrySalvageAllMessage msg) { @@ -1379,7 +1380,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem int count_reward = 0; switch (msg.SalvageType) { - + // Simple items case 0: foreach (var item in GetBackPackItems()) @@ -1549,7 +1550,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem return; Logger.Warn("Identifying items not implemented yet"); } - + private void OnInventoryUseIdentifyItemMessage(InventoryUseIdentifyItemMessage msg) { var item = GetItemByDynId(_owner, msg.ItemID); @@ -1557,14 +1558,15 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem return; int idDuration = 60; - _owner.StartCasting(idDuration, new Action(() => { + _owner.StartCasting(idDuration, new Action(() => + { item.Identify(); })); } //* private void OnTrySalvageMessage(TrySalvageMessage msg) { - + var item = GetItemByDynId(_owner, msg.ActorID); if (item == null) return; @@ -1633,8 +1635,8 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem _inventoryGrid.RemoveItem(item); item.Unreveal(_owner); - - + + bool haveBrimstone = false; Item brimstone = null; if (item.Attributes[GameAttributes.Item_Quality_Level] > 8 || FastRandom.Instance.Next(1, 1000) == 1) @@ -1656,9 +1658,9 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem gbidOriginalItem = item.GBHandle.GBID, IQLOriginalItem = Math.Min(item.Attributes[GameAttributes.Item_Quality_Level], 9), MaterialsResults = haveBrimstone ? 2 : 1, - gbidNewItems = new int[] { reward.GBHandle.GBID, haveBrimstone ? brimstone.GBHandle.GBID : -1, -1, -1 }, + gbidNewItems = new int[] { reward.GBHandle.GBID, haveBrimstone ? brimstone.GBHandle.GBID : -1, -1, -1 }, MaterialsCounts = new int[] { count_reward, haveBrimstone ? 1 : 0, 0, 0 } - + }); UpdateCurrencies(); @@ -1707,13 +1709,13 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem if (GetGoldAmount() < recipeDefinition.Gold) return; bool haveEnoughIngredients = true; - foreach (var ingr in recipeDefinition.Ingredients) + foreach (var ingr in recipeDefinition.Ingredients) { if (ingr.ItemsGBID == -1 || ingr.ItemsGBID == 0) continue; switch (ingr.ItemsGBID) { case -363607620: // Common parts. - if(_owner.Toon.GameAccount.CraftItem1 < ingr.Count) + if (_owner.Toon.GameAccount.CraftItem1 < ingr.Count) haveEnoughIngredients = false; break; case -1585802162: // Wizard Dust. @@ -1754,7 +1756,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem _stashGrid.RemoveItem(item); item.Unreveal(item.Owner as Player); } - else if(item.Attributes[GameAttributes.ItemStackQuantityLo] > ingr.Count) + else if (item.Attributes[GameAttributes.ItemStackQuantityLo] > ingr.Count) { item.Attributes[GameAttributes.ItemStackQuantityLo] -= ingr.Count; item.Attributes.BroadcastChangedIfRevealed(); @@ -1773,13 +1775,13 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem switch (ingr.ItemsGBID) { case -363607620: // Common parts. - _owner.Toon.GameAccount.CraftItem1 -= ingr.Count; + _owner.Toon.GameAccount.CraftItem1 -= ingr.Count; break; case -1585802162: // Wizard Dust. - _owner.Toon.GameAccount.CraftItem2 -= ingr.Count; + _owner.Toon.GameAccount.CraftItem2 -= ingr.Count; break; case -605947593: // Blurred Crystal. - _owner.Toon.GameAccount.CraftItem3 -= ingr.Count; + _owner.Toon.GameAccount.CraftItem3 -= ingr.Count; break; } } @@ -1800,7 +1802,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem } //else if (!(recipeDefinition.Name.StartsWith("T12_") || recipeDefinition.Name.StartsWith("T11_"))) - reward.Attributes[GameAttributes.Item_Quality_Level] = Math.Min(recipe.ItemSpecifierData.AdditionalRandomAffixes + 2 , 9); + reward.Attributes[GameAttributes.Item_Quality_Level] = Math.Min(recipe.ItemSpecifierData.AdditionalRandomAffixes + 2, 9); if (reward.Attributes[GameAttributes.Item_Quality_Level] < 9) { AffixGenerator.Generate(reward, recipe.ItemSpecifierData.AdditionalRandomAffixes, true); @@ -1925,7 +1927,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem if (reward.Attributes[GameAttributes.ItemStackQuantityLo] > 0) _inventoryGrid.AddItem(reward); client.SendMessage(new CraftingResultsMessage { annItem = reward.GlobalID, GBIDItem = recipe.ItemSpecifierData.ItemGBId, IQL = reward.Attributes[GameAttributes.Item_Quality_Level] }); - + UpdateCurrencies(); } @@ -2228,7 +2230,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem return _equipment.GetOffHand(); } - + public void AddGoldAmount(int amount, bool immediately = true) { @@ -2318,7 +2320,12 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem D3.Items.CurrencyData craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(playerAcc.BigPortalKey).Build(); // KeyStone Greater Rift. - D3.Items.CurrencyData[] consumables = {goldData, bloodShardData, platinumData, craft1Data, craft2Data, craft3Data, craft4Data, craft5Data, craft7Data, horadric1Data, horadric2Data, horadric3Data, horadric4Data, horadric5Data, craft8Data, craft9Data, craft10Data, craft11Data}; + D3.Items.CurrencyData[] consumables = { + goldData, bloodShardData, platinumData, craft1Data, + craft2Data, craft3Data, craft4Data, craft5Data, craft7Data, + horadric1Data, horadric2Data, horadric3Data, horadric4Data, + horadric5Data, craft8Data, craft9Data, craft10Data, craft11Data + }; foreach (var consumable in consumables) { @@ -2404,7 +2411,8 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem _owner.SetAttributesByParagon(); CheckWeapons(); _owner.Attributes.BroadcastChangedIfRevealed(); - Task.Delay(3000).ContinueWith((t) => { + Task.Delay(3000).ContinueWith((t) => + { try { _owner.CheckBonusSets(); @@ -2421,7 +2429,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem _inventoryGold.Owner = _owner; _inventoryGold.SetInventoryLocation((int)EquipmentSlotId.Gold, 0, 0); _inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient); - + //this.inventoryPotion = ItemGenerator.CreateItem(this._owner, ItemGenerator.GetItemDefinition(DiIiS_NA.Core.Helpers.Hash.StringHashHelper.HashItemName("HealthPotionBottomless"))); //this.inventoryPotion.Owner = _owner; //this.inventoryPotion.SetInventoryLocation((int)EquipmentSlotId.Inventory, 0, 0); diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs index 57ec161..66190d0 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs @@ -108,7 +108,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable public List NecromancerSkeletons = new() { }; public bool ActiveSkeletons = false; - + public Actor ActiveGolem = null; public bool EnableGolem = false; @@ -2148,7 +2148,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable break; - #endregion + #endregion } } @@ -2492,7 +2492,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable public float IntelligenceMultiplier => ParagonLevel > 0 ? GameModsConfig.Instance.Player.Multipliers.Intelligence.Paragon : GameModsConfig.Instance.Player.Multipliers.Intelligence.Normal; - + public float VitalityMultiplier => ParagonLevel > 0 ? GameModsConfig.Instance.Player.Multipliers.Vitality.Paragon : GameModsConfig.Instance.Player.Multipliers.Intelligence.Normal; @@ -2645,7 +2645,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable Logger.WarnException(ex, "OnLoadWorldActions"); } } - + World.Game.OnLoadWorldActions[World.SNO].Clear(); } } @@ -2653,7 +2653,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable if (World.Game.OnLoadSceneActions.ContainsKey(CurrentScene.SceneSNO.Id)) { Logger.MethodTrace($"OnLoadSceneActions: {CurrentScene.SceneSNO.Id}"); - + Logger.MethodTrace(World.SNO.ToString()); lock (World.Game.OnLoadSceneActions[CurrentScene.SceneSNO.Id]) { @@ -2693,7 +2693,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable } // Reset resurrection charges on zone change // TODO: do not reset charges on reentering the same zone - Attributes[GameAttributes.Corpse_Resurrection_Charges] = GameModsConfig.Instance.Health.ResurrectionCharges; + Attributes[GameAttributes.Corpse_Resurrection_Charges] = GameModsConfig.Instance.Health.ResurrectionCharges; #if DEBUG Logger.Warn($"Player Location {Toon.Name}, Scene: {CurrentScene.SceneSNO.Name} SNO: {CurrentScene.SceneSNO.Id} LevelArea: {CurrentScene.Specification.SNOLevelAreas[0]}"); @@ -3008,9 +3008,9 @@ public class Player : Actor, IMessageConsumer, IUpdateable private bool DisconnectIdle() { - if (!GameServerConfig.Instance.AfkDisconnect || InGameClient.Game.TickCounter - LastMovementTick <= 54000) + if (!GameServerConfig.Instance.AfkDisconnect || InGameClient.Game.TickCounter - LastMovementTick <= 54000) return false; - + Logger.Warn($"Player $[underline white]${Name}$[/]$ disconnected for being AFK."); Opcodes.CloseGameMessage.SendTo(InGameClient); return true; @@ -3020,7 +3020,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable { if (BetweenWorlds) return; if (DisconnectIdle()) return; - + // Check the gold if (InGameClient.Game.TickCounter % 120 == 0 && World != null && GoldCollectedTempCount > 0) { @@ -3215,7 +3215,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable }); World.Leave(skeleton); } - catch{} + catch { } } NecromancerSkeletons.Clear(); @@ -3622,7 +3622,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable System.Threading.Tasks.Task.Delay(3).Wait(); RevealActorsToPlayer(); - + if (!_motdSent && LoginServer.LoginServerConfig.Instance.MotdEnabled) { if (!LoginServerConfig.Instance.MotdEnabledWhenWorldLoads) @@ -4013,9 +4013,9 @@ public class Player : Actor, IMessageConsumer, IUpdateable { var baseStrength = 0.0f; var multiplier = StrengthMultiplier; - baseStrength = Toon.HeroTable.CoreAttribute == GameBalance.PrimaryAttribute.Strength - ? Toon.HeroTable.Strength + (Level - 1) * 3 - : Toon.HeroTable.Strength + (Level - 1); + baseStrength = Toon.HeroTable.CoreAttribute == GameBalance.PrimaryAttribute.Strength + ? Toon.HeroTable.Strength + (Level - 1) * 3 + : Toon.HeroTable.Strength + (Level - 1); return baseStrength * multiplier; } @@ -4098,7 +4098,9 @@ public class Player : Actor, IMessageConsumer, IUpdateable HotBarButtons = SkillSet.HotBarSkills, HotBarButton = new HotbarButtonData { - SNOSkill = -1, RuneType = -1, ItemGBId = + SNOSkill = -1, + RuneType = -1, + ItemGBId = StringHashHelper.HashItemName( "HealthPotionBottomless") //2142362846//this.Toon.DBActiveSkills.PotionGBID , @@ -4340,8 +4342,14 @@ public class Player : Actor, IMessageConsumer, IUpdateable //returns empty data var emptyHireling = new HirelingInfo { - HirelingIndex = type, GbidName = 0x0000, Dead = false, Skill1SNOId = -1, Skill2SNOId = -1, - Skill3SNOId = -1, Skill4SNOId = -1, annItems = -1 + HirelingIndex = type, + GbidName = 0x0000, + Dead = false, + Skill1SNOId = -1, + Skill2SNOId = -1, + Skill3SNOId = -1, + Skill4SNOId = -1, + annItems = -1 }; return emptyHireling; } @@ -4392,7 +4400,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable public void LearnRecipe(ArtisanType? artisan, int recipe) { Logger.Trace("Learning recipe #{0}, Artisan type: {1}", recipe, artisan); - + /*var query = this.World.Game.GameDBSession.SessionQuerySingle( dbi => dbi.DBGameAccount.Id == this.Toon.GameAccount.PersistentID && @@ -4499,18 +4507,18 @@ public class Player : Actor, IMessageConsumer, IUpdateable if (BlacksmithUnlocked || InGameClient.Game.CurrentAct == 3000) InGameClient.SendMessage(new GenericBlobMessage(Opcodes.CraftingDataBlacksmithInitialMessage) - { Data = blacksmith.ToByteArray() }); + { Data = blacksmith.ToByteArray() }); if (JewelerUnlocked || InGameClient.Game.CurrentAct == 3000) InGameClient.SendMessage(new GenericBlobMessage(Opcodes.CraftingDataJewelerInitialMessage) - { Data = jeweler.ToByteArray() }); + { Data = jeweler.ToByteArray() }); if (MysticUnlocked || InGameClient.Game.CurrentAct == 3000) { InGameClient.SendMessage(new GenericBlobMessage(Opcodes.CraftingDataMysticInitialMessage) - { Data = mystic.ToByteArray() }); + { Data = mystic.ToByteArray() }); InGameClient.SendMessage(new GenericBlobMessage(Opcodes.CraftingDataTransmogInitialMessage) - { Data = transmog.ToByteArray() }); + { Data = transmog.ToByteArray() }); } } @@ -4609,7 +4617,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable private readonly Dictionary _achievementCounters = new(); public int DodgesInARow { get; set; } = 0; - public int BlocksInARow { get; set; }= 0; + public int BlocksInARow { get; set; } = 0; public void GrantAchievement(ulong id) { @@ -5114,13 +5122,15 @@ public class Player : Actor, IMessageConsumer, IUpdateable if (World.Game.IsHardcore && Attributes[GameAttributes.Level] >= 70) addedExp *= 5; - if (Attributes[GameAttributes.Alt_Level] >= 515) - { - var XPcap = 91.262575239831f * Math.Pow(Attributes[GameAttributes.Alt_Level], 3) - - 44301.083380565047f * Math.Pow(Attributes[GameAttributes.Alt_Level], 2) + - 3829010.395566940308f * Attributes[GameAttributes.Alt_Level] + 322795582.543823242188f; - addedExp = (int)((float)(ParagonLevelBorders[Attributes[GameAttributes.Alt_Level]] / XPcap) * addedExp); - } + // To'do verify this formula. + // Remove this if to remove paragon level cap. + //if (Attributes[GameAttributes.Alt_Level] >= 515) + //{ + // var XPcap = 91.262575239831f * Math.Pow(Attributes[GameAttributes.Alt_Level], 3) - + // 44301.083380565047f * Math.Pow(Attributes[GameAttributes.Alt_Level], 2) + + // 3829010.395566940308f * Attributes[GameAttributes.Alt_Level] + 322795582.543823242188f; + // addedExp = (int)((float)(ParagonLevelBorders[Attributes[GameAttributes.Alt_Level]] / XPcap) * addedExp); + //} if (Attributes[GameAttributes.Rest_Experience_Lo] > 0) { @@ -5585,9 +5595,9 @@ public class Player : Actor, IMessageConsumer, IUpdateable }); plr.InGameClient.SendMessage(new DisplayGameTextMessage(Opcodes.DisplayGameChatTextMessage) - { Message = "Messages:LR_BossSpawned" }); + { Message = "Messages:LR_BossSpawned" }); plr.InGameClient.SendMessage(new DisplayGameTextMessage(Opcodes.DisplayGameTextMessage) - { Message = "Messages:LR_BossSpawned" }); + { Message = "Messages:LR_BossSpawned" }); } StartConversation(World, 366542); @@ -5687,40 +5697,40 @@ public class Player : Actor, IMessageConsumer, IUpdateable case 0: return; case > 0: - { - if (Attributes[GameAttributes.Hitpoints_Cur] < Attributes[GameAttributes.Hitpoints_Max_Total]) { - if (Toon.Class == ToonClass.Barbarian) - if (SkillSet.HasPassive(205217)) - quantity += 0.01f * Attributes[GameAttributes.Health_Globe_Bonus_Health]; - - if (guidingLight) //Monk -> Guiding Light + if (Attributes[GameAttributes.Hitpoints_Cur] < Attributes[GameAttributes.Hitpoints_Max_Total]) { - var missingHP = - (Attributes[GameAttributes.Hitpoints_Max_Total] - Attributes[GameAttributes.Hitpoints_Cur]) / - Attributes[GameAttributes.Hitpoints_Max_Total]; - if (missingHP > 0.05f) - if (!World.BuffManager.HasBuff(this)) - World.BuffManager.AddBuff(this, this, - new GuidingLightBuff(Math.Min(missingHP, 0.3f), - TickTimer.WaitSeconds(World.Game, 10.0f))); + if (Toon.Class == ToonClass.Barbarian) + if (SkillSet.HasPassive(205217)) + quantity += 0.01f * Attributes[GameAttributes.Health_Globe_Bonus_Health]; + + if (guidingLight) //Monk -> Guiding Light + { + var missingHP = + (Attributes[GameAttributes.Hitpoints_Max_Total] - Attributes[GameAttributes.Hitpoints_Cur]) / + Attributes[GameAttributes.Hitpoints_Max_Total]; + if (missingHP > 0.05f) + if (!World.BuffManager.HasBuff(this)) + World.BuffManager.AddBuff(this, this, + new GuidingLightBuff(Math.Min(missingHP, 0.3f), + TickTimer.WaitSeconds(World.Game, 10.0f))); + } + + Attributes[GameAttributes.Hitpoints_Cur] = Math.Min( + Attributes[GameAttributes.Hitpoints_Cur] + quantity, + Attributes[GameAttributes.Hitpoints_Max_Total]); + + Attributes.BroadcastChangedIfRevealed(); + InGameClient.SendMessage(new FloatingNumberMessage + { + ActorID = DynamicID(this), + Number = quantity, + Type = FloatingNumberMessage.FloatType.Green + }); } - Attributes[GameAttributes.Hitpoints_Cur] = Math.Min( - Attributes[GameAttributes.Hitpoints_Cur] + quantity, - Attributes[GameAttributes.Hitpoints_Max_Total]); - - Attributes.BroadcastChangedIfRevealed(); - InGameClient.SendMessage(new FloatingNumberMessage - { - ActorID = DynamicID(this), - Number = quantity, - Type = FloatingNumberMessage.FloatType.Green - }); + break; } - - break; - } default: Attributes[GameAttributes.Hitpoints_Cur] = Math.Max( Attributes[GameAttributes.Hitpoints_Cur] + quantity, diff --git a/src/DiIiS-NA/D3-GameServer/MessageSystem/GameAttribute.List.cs b/src/DiIiS-NA/D3-GameServer/MessageSystem/GameAttribute.List.cs index cee327c..47826bc 100644 --- a/src/DiIiS-NA/D3-GameServer/MessageSystem/GameAttribute.List.cs +++ b/src/DiIiS-NA/D3-GameServer/MessageSystem/GameAttribute.List.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace DiIiS_NA.GameServer.MessageSystem @@ -1497,6 +1497,9 @@ namespace DiIiS_NA.GameServer.MessageSystem public static readonly GameAttributeB Soul_shards_unlocked = new(1478, "Soulshardsunlocked"); public static readonly GameAttributeB Item_was_sanctified = new(1479, "Itemwassanctified"); public static readonly GameAttributeB Sanctified_items_unlocked = new(1480, "Sanctifieditemsunlocked"); + public static readonly GameAttributeI Heros_Unlocked_Dark_Alchemy_Nodes = new(1481, "HerosunlockedDarkAlchemynodes"); + public static readonly GameAttributeI Dark_Alchemy_Powers_Unlocked = new(1482, "DarkAlchemypowersunlocked"); + public static readonly GameAttributeB Item_Was_Primalized = new(1483, "Itemwasprimalized"); #endregion } } diff --git a/src/DiIiS-NA/config.ini b/src/DiIiS-NA/config.ini index 6580716..51e7d7b 100644 --- a/src/DiIiS-NA/config.ini +++ b/src/DiIiS-NA/config.ini @@ -13,7 +13,7 @@ Enabled = true ; IP address on which the server will be bound BindIP = 127.0.0.1 ; Port for web interactions -WebPort = 83 +WebPort = 9800 ; Port for the server Port = 1119 @@ -49,7 +49,7 @@ CoreActive = true ; IP address on which the game server will be bound BindIP = 127.0.0.1 ; Port for web interactions -WebPort = 83 +WebPort = 9001 ; Port for game server connections Port = 1345 ; IP address for IPv6 bindings diff --git a/src/DiIiS-NA/database.Account.config b/src/DiIiS-NA/database.Account.config index 5e9a698..ae5d775 100644 --- a/src/DiIiS-NA/database.Account.config +++ b/src/DiIiS-NA/database.Account.config @@ -8,7 +8,7 @@ true 0 - Server=diiis-na-db;Database=diiis;User ID=postgres;Password=postgres + Server=localhost;Database=diiis;User ID=postgres;Password=postgres on_close 0 diff --git a/src/DiIiS-NA/database.Worlds.config b/src/DiIiS-NA/database.Worlds.config index 484bfa0..ddec9eb 100644 --- a/src/DiIiS-NA/database.Worlds.config +++ b/src/DiIiS-NA/database.Worlds.config @@ -7,7 +7,7 @@ true 0 - Server=diiis-na-db;Database=worlds;User ID=postgres;Password=postgres + Server=localhost;Database=worlds;User ID=postgres;Password=postgres on_close 0