diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/GlobalEvents.cpp | 2 | ||||
-rw-r--r-- | src/game/ObjectAccessor.cpp | 8 | ||||
-rw-r--r-- | src/game/ObjectAccessor.h | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/World.cpp | 2 | ||||
-rw-r--r-- | src/game/World.h | 2 | ||||
-rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 8 |
7 files changed, 21 insertions, 5 deletions
diff --git a/src/game/GlobalEvents.cpp b/src/game/GlobalEvents.cpp index a2dd89d34c0..957462b9e22 100644 --- a/src/game/GlobalEvents.cpp +++ b/src/game/GlobalEvents.cpp @@ -55,7 +55,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones) { if(!ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid)) { - sLog.outDebug("Corpse %u not found in world. Delete from DB.",guidlow); + sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow); CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); } } diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 0608408cf5e..2182af0b751 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -38,6 +38,7 @@ #include "Opcodes.h" #include "ObjectDefines.h" #include "MapInstanced.h" +#include "World.h" #include <cmath> @@ -423,7 +424,7 @@ ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair,GridType& grid,Map* ma } Corpse* -ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid) +ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia) { Corpse *corpse = GetCorpseForPlayerGUID(player_guid); if(!corpse) @@ -449,7 +450,10 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid) Corpse *bones = NULL; // create the bones only if the map and the grid is loaded at the corpse's location - if(map && !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY())) + // ignore bones creating option in case insignia + if (map && (insignia || + (map->IsBattleGroundOrArena() ? sWorld.getConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getConfig(CONFIG_DEATH_BONES_WORLD))) && + !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY())) { // Create bones, don't change Corpse bones = new Corpse; diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index bbfc06b78b6..9399035afd8 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -192,7 +192,7 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor void RemoveCorpse(Corpse *corpse); void AddCorpse(Corpse* corpse); void AddCorpsesToGrid(GridPair const& gridpair,GridType& grid,Map* map); - Corpse* ConvertCorpseForPlayer(uint64 player_guid); + Corpse* ConvertCorpseForPlayer(uint64 player_guid, bool insignia = false); static void UpdateObject(Object* obj, Player* exceptPlayer); static void _buildUpdateObject(Object* obj, UpdateDataMapType &); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 743d457d689..341742dd3b1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7247,7 +7247,7 @@ void Player::RemovedInsignia(Player* looterPlr) // We have to convert player corpse to bones, not to be able to resurrect there // SpawnCorpseBones isn't handy, 'cos it saves player while he in BG - Corpse *bones = ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID()); + Corpse *bones = ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID(),true); if (!bones) return; diff --git a/src/game/World.cpp b/src/game/World.cpp index b50e8476283..5edd15fa472 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -893,6 +893,8 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfig.GetIntDefault("Death.SicknessLevel", 11); m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvP", true); m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvE", true); + m_configs[CONFIG_DEATH_BONES_WORLD] = sConfig.GetBoolDefault("Death.Bones.World", true); + m_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfig.GetBoolDefault("Death.Bones.BattlegroundOrArena", true); m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 60); diff --git a/src/game/World.h b/src/game/World.h index ff03f4124b0..27052cf7966 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -171,6 +171,8 @@ enum WorldConfigs CONFIG_DEATH_SICKNESS_LEVEL, CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP, CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE, + CONFIG_DEATH_BONES_WORLD, + CONFIG_DEATH_BONES_BG_OR_ARENA, CONFIG_THREAT_RADIUS, CONFIG_INSTANT_LOGOUT, CONFIG_DISABLE_BREATHING, diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index fcc093e811a..86f2d994f25 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1058,6 +1058,12 @@ Visibility.Distance.Grey.Object = 10 # Default: 1 (enabled) # 0 (disabled) # +# Death.Bones.World +# Death.Bones.BattlegroundOrArena +# Enabled/disabled creating bones instead corpse at resurrection (in normal zones/instacnes, or battleground/arenas) +# Default: 1 (enabled) +# 0 (disabled) +# ################################################################################################################### Rate.Health = 1 @@ -1110,6 +1116,8 @@ DurabilityLossChance.Block = 0.05 Death.SicknessLevel = 11 Death.CorpseReclaimDelay.PvP = 1 Death.CorpseReclaimDelay.PvE = 0 +Death.Bones.World = 1 +Death.Bones.BattlegroundOrArena = 1 ################################################################################################################### # |