diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index 71be01b8e..c09e5494d 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -1319,7 +1319,7 @@ namespace Framework.Constants Model = 32, // Source = Creature, Datalong = Model Id CloseGossip = 33, // Source = Player Playmovie = 34, // Source = Player, Datalong = Movie Id - Movement = 35, // Source = Creature, datalong = MovementType, datalong2 = MovementDistance (spawndist f.ex.), dataint = pathid + Movement = 35, // Source = Creature, datalong = MovementType, datalong2 = MovementDistance (wander_distance f.ex.), dataint = pathid PlayAnimkit = 36 // Source = Creature, datalong = AnimKit id } @@ -1455,6 +1455,11 @@ namespace Framework.Constants CleanCharacterDb, CleanOldMailTime, ClientCacheVersion, + CommunityAllowBnetClubTypeEnabled, + CommunityAllowCharacterClubTypeEnabled, + CommunityChatKeepDays, + CommunityClubFinderEnabled, + CommunityClubsEnabled, Compression, CorpseDecayElite, CorpseDecayNormal, diff --git a/Source/Game/Entities/StatSystem.cs b/Source/Game/Entities/StatSystem.cs index 6d87369da..6708e602e 100644 --- a/Source/Game/Entities/StatSystem.cs +++ b/Source/Game/Entities/StatSystem.cs @@ -477,8 +477,11 @@ namespace Game.Entities val = maxHealth; } + ulong oldVal = GetHealth(); SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Health), val); + TriggerOnHealthChangeAuras(oldVal, val); + // group update Player player = ToPlayer(); if (player) diff --git a/Source/Game/Entities/Transport.cs b/Source/Game/Entities/Transport.cs index 0421d0ba3..46e2af782 100644 --- a/Source/Game/Entities/Transport.cs +++ b/Source/Game/Entities/Transport.cs @@ -547,7 +547,7 @@ namespace Game.Entities void LoadStaticPassengers() { uint mapId = (uint)GetGoInfo().MoTransport.SpawnMap; - var cells = Global.ObjectMgr.GetMapObjectGuids(mapId, (byte)GetMap().GetDifficultyID()); + var cells = Global.ObjectMgr.GetMapObjectGuids(mapId, GetMap().GetDifficultyID()); if (cells == null) return; foreach (var cell in cells) diff --git a/Source/Game/Garrisons/Garrisons.cs b/Source/Game/Garrisons/Garrisons.cs index b69f5eb85..758a18cfd 100644 --- a/Source/Game/Garrisons/Garrisons.cs +++ b/Source/Game/Garrisons/Garrisons.cs @@ -753,7 +753,7 @@ namespace Game.Garrisons if (go.GetGoType() == GameObjectTypes.GarrisonBuilding && go.GetGoInfo().garrisonBuilding.SpawnMap != 0) { - foreach (var cellGuids in Global.ObjectMgr.GetMapObjectGuids((uint)go.GetGoInfo().garrisonBuilding.SpawnMap, (byte)map.GetDifficultyID())) + foreach (var cellGuids in Global.ObjectMgr.GetMapObjectGuids((uint)go.GetGoInfo().garrisonBuilding.SpawnMap, map.GetDifficultyID())) { foreach (var spawnId in cellGuids.Value.creatures) { diff --git a/Source/Game/Handlers/ChannelHandler.cs b/Source/Game/Handlers/ChannelHandler.cs index 292cb1026..a6aede56f 100644 --- a/Source/Game/Handlers/ChannelHandler.cs +++ b/Source/Game/Handlers/ChannelHandler.cs @@ -50,19 +50,9 @@ namespace Game return; } - if (packet.ChannelName.Length > 31) - { - ChannelNotify channelNotify = new(); - channelNotify.Type = ChatNotify.InvalidNameNotice; - channelNotify.Channel = packet.ChannelName; - SendPacket(channelNotify); - Log.outError(LogFilter.Network, $"Player {GetPlayer().GetGUID()} tried to create a channel with a name more than 31 characters long - blocked"); - return; - } - if (packet.Password.Length > 127) { - Log.outError(LogFilter.Network, $"Player {GetPlayer().GetGUID()} tried to create a channel with a password more that 127 characters long - blocked"); + Log.outError(LogFilter.Network, $"Player {GetPlayer().GetGUID()} tried to create a channel with a password more than 127 characters long - blocked"); return; } @@ -79,6 +69,12 @@ namespace Game else { // custom channel + if (packet.ChannelName.Length > 31) + { + Log.outError(LogFilter.Network, $"Player {GetPlayer().GetGUID()} tried to create a channel with a name more than 31 characters long - blocked"); + return; + } + Channel channel = cMgr.GetCustomChannel(packet.ChannelName); if (channel != null) channel.JoinChannel(GetPlayer(), packet.Password); diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index 606c64e2e..20e379119 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -3121,13 +3121,12 @@ namespace Game.Maps public void SaveRespawnInfoDB(RespawnInfo info, SQLTransaction dbTrans = null) { - // Just here for support of compatibility mode PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_RESPAWN); stmt.AddValue(0, (ushort)info.type); - stmt.AddValue(0, info.spawnId); - stmt.AddValue(1, info.respawnTime); - stmt.AddValue(2, GetId()); - stmt.AddValue(3, GetInstanceId()); + stmt.AddValue(1, info.spawnId); + stmt.AddValue(2, info.respawnTime); + stmt.AddValue(3, GetId()); + stmt.AddValue(4, GetInstanceId()); DB.Characters.ExecuteOrAppend(dbTrans, stmt); } diff --git a/Source/Game/Pools/QuestPools.cs b/Source/Game/Pools/QuestPools.cs index e2d50590d..e9763d3cc 100644 --- a/Source/Game/Pools/QuestPools.cs +++ b/Source/Game/Pools/QuestPools.cs @@ -228,7 +228,7 @@ namespace Game if (activeCount != pool.numActive) { doRegenerate = true; - Log.outError(LogFilter.Sql, "Table `pool_quest_save` has %u active members saved for pool %u, which requests %u active members. Pool spawns re-generated.", activeCount, pool.poolId, pool.numActive); + Log.outError(LogFilter.Sql, $"Table `pool_quest_save` has {activeCount} active members saved for pool {pool.poolId}, which requests {pool.numActive} active members. Pool spawns re-generated."); } } @@ -242,13 +242,12 @@ namespace Game { foreach (uint quest in pool.members[memberKey]) { - QuestPool refe = _poolLookup[quest]; - if (refe != null) + if (_poolLookup.ContainsKey(quest)) { - Log.outError(LogFilter.Sql, "Table `quest_pool_members` lists quest %u as member of pool %u, but it is already a member of pool %u. Skipped.", quest, pool.poolId, refe.poolId); + Log.outError(LogFilter.Sql, $"Table `quest_pool_members` lists quest {quest} as member of pool {pool.poolId}, but it is already a member of pool {_poolLookup[quest].poolId}. Skipped."); continue; } - refe = pool; + _poolLookup[quest] = pool; } } } diff --git a/Source/Game/Server/WorldConfig.cs b/Source/Game/Server/WorldConfig.cs index 335a1743a..8d1069fde 100644 --- a/Source/Game/Server/WorldConfig.cs +++ b/Source/Game/Server/WorldConfig.cs @@ -991,6 +991,12 @@ namespace Game // Whether to use LoS from game objects Values[WorldCfg.CheckGobjectLos] = GetDefaultValue("CheckGameObjectLoS", true); + // FactionBalance + Values[WorldCfg.FactionBalanceLevelCheckDiff] = GetDefaultValue("Pvp.FactionBalance.LevelCheckDiff", 0); + Values[WorldCfg.CallToArms5Pct] = GetDefaultValue("Pvp.FactionBalance.Pct5", 0.6f); + Values[WorldCfg.CallToArms10Pct] = GetDefaultValue("Pvp.FactionBalance.Pct10", 0.7f); + Values[WorldCfg.CallToArms20Pct] = GetDefaultValue("Pvp.FactionBalance.Pct20", 0.8f); + // call ScriptMgr if we're reloading the configuration if (reload) Global.ScriptMgr.OnConfigLoad(reload); diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 47294cd79..034a5764a 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -3309,6 +3309,7 @@ namespace Game.Spells case 61716: // Rabbit Costume case 61734: // Noblegarden Bunny case 62344: // Fists of Stone + case 50344: // Dream Funnel case 61819: // Manabonked! (item) case 61834: // Manabonked! (minigob) case 73523: // Rigor Mortis diff --git a/Source/Scripts/World/GameObject.cs b/Source/Scripts/World/GameObject.cs index 6aba651be..0ff5c7344 100644 --- a/Source/Scripts/World/GameObject.cs +++ b/Source/Scripts/World/GameObject.cs @@ -309,7 +309,7 @@ namespace Scripts.World.GameObjects public const uint Darnassus = 1657; public const uint Ashenvale = 331; public const uint HillsbradFoothills = 267; - public const uint Duskwood = 42; + public const uint Duskwood = 10; } struct Misc @@ -328,32 +328,6 @@ namespace Scripts.World.GameObjects public const uint EventRingBell = 1; } - [Script] - class go_cat_figurine : GameObjectAI - { - public go_cat_figurine(GameObject go) : base(go) { } - - public override bool GossipHello(Player player) - { - player.CastSpell(player, SpellIds.SummonGhostSaber, true); - return false; - } - } - - [Script] - class go_barov_journal : GameObjectAI - { - public go_barov_journal(GameObject go) : base(go) { } - - public override bool GossipHello(Player player) - { - if (player.HasSkill(SkillType.Tailoring) && player.GetBaseSkillValue(SkillType.Tailoring) >= 280 && !player.HasSpell(26086)) - player.CastSpell(player, 26095, false); - - return true; - } - } - [Script] class go_gilded_brazier : GameObjectAI { @@ -374,20 +348,6 @@ namespace Scripts.World.GameObjects } } - [Script] - class go_orb_of_command : GameObjectAI - { - public go_orb_of_command(GameObject go) : base(go) { } - - public override bool GossipHello(Player player) - { - if (player.GetQuestRewardStatus(7761)) - player.CastSpell(player, 23460, true); - - return true; - } - } - [Script] class go_tablet_of_madness : GameObjectAI { @@ -1320,7 +1280,9 @@ namespace Scripts.World.GameObjects if (eventId == Misc.GameEventHourlyBells && start) { var localTm = Time.UnixTimeToDateTime(GameTime.GetGameTime()).ToLocalTime(); - int _rings = (localTm.Hour - 1) % 12 + 1; + int _rings = localTm.Hour % 12; + if (_rings == 0) // 00:00 and 12:00 + _rings = 12; for (var i = 0; i < _rings; ++i) _scheduler.Schedule(TimeSpan.FromSeconds(i * 4 + 1), task => me.PlayDirectSound(_soundId)); diff --git a/Source/Scripts/World/ItemScripts.cs b/Source/Scripts/World/ItemScripts.cs index 9cd5ffe40..f004a5db5 100644 --- a/Source/Scripts/World/ItemScripts.cs +++ b/Source/Scripts/World/ItemScripts.cs @@ -165,23 +165,6 @@ namespace Scripts.World.ItemScripts } } - [Script] - class item_incendiary_explosives : ItemScript - { - public item_incendiary_explosives() : base("item_incendiary_explosives") { } - - public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId) - { - if (player.FindNearestCreature(26248, 15) || player.FindNearestCreature(26249, 15)) - return false; - else - { - player.SendEquipError(InventoryResult.OutOfRange, item, null); - return true; - } - } - } - [Script] class item_mysterious_egg : ItemScript {