*Add a config option for .die command behavior

--HG--
branch : trunk
This commit is contained in:
maximius
2009-08-20 13:22:07 -07:00
parent a63b457b3c
commit eb81138e6d
4 changed files with 17 additions and 3 deletions

View File

@@ -4223,8 +4223,11 @@ bool ChatHandler::HandleDieCommand(const char* /*args*/)
if( target->isAlive() )
{
m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
if(sWorld.getConfig(CONFIG_DIE_COMMAND_MODE))
m_session->GetPlayer()->Kill(target);
else
m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
return true;
}

View File

@@ -990,6 +990,8 @@ void World::LoadConfigSettings(bool reload)
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_DIE_COMMAND_MODE] = sConfig.GetBoolDefault("Die.Command.Mode", true);
m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 60);
// always use declined names in the russian client

View File

@@ -199,6 +199,7 @@ enum WorldConfigs
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
CONFIG_DEATH_BONES_WORLD,
CONFIG_DEATH_BONES_BG_OR_ARENA,
CONFIG_DIE_COMMAND_MODE,
CONFIG_THREAT_RADIUS,
CONFIG_INSTANT_LOGOUT,
CONFIG_DISABLE_BREATHING,

View File

@@ -1,7 +1,7 @@
##########################################
# Trinity Core worldd configuration file #
##########################################
ConfVersion=2009081702
ConfVersion=2009082013
###################################################################################################################
# CONNECTIONS AND DIRECTORIES
@@ -1295,6 +1295,13 @@ Visibility.Distance.Grey.Object = 10
# Default: 1 (enabled)
# 0 (disabled)
#
# Die.Command.Mode
# Switch between two possible .die modes, where mode 1 kills
# and does not trigger anything such as loot, and mode 0 does
# damage and does trigger things such as loot
# Default: 1
# 0
#
###################################################################################################################
Rate.Health = 1
@@ -1356,6 +1363,7 @@ Death.CorpseReclaimDelay.PvP = 1
Death.CorpseReclaimDelay.PvE = 0
Death.Bones.World = 1
Death.Bones.BattlegroundOrArena = 1
Die.Command.Mode = 1
###################################################################################################################
# AUTO BROADCAST