aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Wintergrasp.cpp45
-rw-r--r--src/game/Wintergrasp.h12
-rw-r--r--src/game/World.cpp8
-rw-r--r--src/game/World.h7
-rw-r--r--src/trinitycore/Main.cpp2
-rw-r--r--src/trinitycore/trinitycore.conf.dist33
6 files changed, 98 insertions, 9 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 8f23f799faa..d762b5bfed2 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -292,6 +292,10 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
m_wartime = false;
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME) * MINUTE * IN_MILISECONDS;
+ if(sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
+ for(int i = 0; i < WG_REWARD_EVENT_MAX; ++i)
+ m_customHonorReward[i] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0 + i);
+
RegisterZone(ZONE_WINTERGRASP);
return true;
}
@@ -317,7 +321,16 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
state->damageState = DAMAGE_DAMAGED;
if(state->type == BUILDING_TOWER)
- LieutenantCastSpell(m_defender, SPELL_DAMAGED_TOWER);
+ {
+ if(sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
+ {
+ for(PlayerSet::const_iterator itr = m_players[m_defender].begin(); itr != m_players[m_defender].end(); ++itr)
+ if((*itr)->HasAura(SPELL_LIEUTENANT) && ((*itr)->getLevel() > 69))
+ (*itr)->ModifyHonorPoints(m_customHonorReward[DAMAGED_TOWER]);
+ }
+ else
+ LieutenantCastSpell(m_defender, SPELL_DAMAGED_TOWER);
+ }
}
else if(eventId == obj->GetGOInfo()->building.destroyedEvent)
{
@@ -336,7 +349,14 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
else
{
--m_towerCount;
- LieutenantCastSpell(m_defender, SPELL_DESTROYED_TOWER);
+ if(sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
+ {
+ for(PlayerSet::const_iterator itr = m_players[m_defender].begin(); itr != m_players[m_defender].end(); ++itr)
+ if((*itr)->HasAura(SPELL_LIEUTENANT) && ((*itr)->getLevel() > 69))
+ (*itr)->ModifyHonorPoints(m_customHonorReward[DESTROYED_TOWER]);
+ }
+ else
+ LieutenantCastSpell(m_defender, SPELL_DESTROYED_TOWER);
}
}
}
@@ -901,11 +921,22 @@ void OPvPWintergrasp::EndBattle()
{
if((*itr)->HasAura(SPELL_LIEUTENANT))
{
- (*itr)->CastSpell(*itr, team == m_defender ? SPELL_VICTORY_REWARD : SPELL_DEFEAT_REWARD, true);
- for(uint32 i = 0; i < intactNum; ++i)
- (*itr)->CastSpell(*itr, SPELL_INTACT_BUILDING, true);
- for(uint32 i = 0; i < damagedNum; ++i)
- (*itr)->CastSpell(*itr, SPELL_DAMAGED_BUILDING, true);
+ if(!sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
+ {
+ (*itr)->CastSpell(*itr, team == m_defender ? SPELL_VICTORY_REWARD : SPELL_DEFEAT_REWARD, true);
+ for(uint32 i = 0; i < intactNum; ++i)
+ (*itr)->CastSpell(*itr, SPELL_INTACT_BUILDING, true);
+ for(uint32 i = 0; i < damagedNum; ++i)
+ (*itr)->CastSpell(*itr, SPELL_DAMAGED_BUILDING, true);
+ }
+ else if(sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
+ {
+ (*itr)->ModifyHonorPoints( team == m_defender ? m_customHonorReward[WIN_BATTLE] : m_customHonorReward[LOSE_BATTLE] );
+ for(uint32 i = 0; i < intactNum; ++i)
+ (*itr)->ModifyHonorPoints(m_customHonorReward[INTACT_BUILDING]);
+ for(uint32 i = 0; i < damagedNum; ++i)
+ (*itr)->ModifyHonorPoints(m_customHonorReward[DAMAGED_BUILDING]);
+ }
}
REMOVE_RANK_AURAS(*itr);
}
diff --git a/src/game/Wintergrasp.h b/src/game/Wintergrasp.h
index 93b68cbbd23..7f3be18da3e 100644
--- a/src/game/Wintergrasp.h
+++ b/src/game/Wintergrasp.h
@@ -50,6 +50,17 @@ enum WintergraspSpell
SPELL_SHUTDOWN_VEHICLE = 21247,
};
+enum WintergraspRewardEvent
+{
+ WIN_BATTLE,
+ LOSE_BATTLE,
+ DAMAGED_TOWER,
+ DESTROYED_TOWER,
+ DAMAGED_BUILDING,
+ INTACT_BUILDING,
+ WG_REWARD_EVENT_MAX
+};
+
#define MAX_VEHICLE_PER_WORKSHOP 4
const uint32 WG_KEEP_CM = 0; //Need data
@@ -202,6 +213,7 @@ class OPvPWintergrasp : public OutdoorPvP
uint32 m_clock[5];
uint32 m_workshopCount[2];
uint32 m_towerCount;
+ uint32 m_customHonorReward[WG_REWARD_EVENT_MAX];
SiegeWorkshop *GetWorkshop(uint32 lowguid) const;
SiegeWorkshop *GetWorkshopByEngGuid(uint32 lowguid) const;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index a270680ae84..9ae75029637 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1161,6 +1161,14 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.StartTime", 30);
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.BattleTime", 30);
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.Interval", 150);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR] = sConfig.GetBoolDefault("OutdoorPvP.Wintergrasp.CustomHonorRewards", false);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleWin", 0);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_1] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleLose", 0);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_2] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDamageTower", 0);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_3] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower", 0);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_4] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding", 0);
+ m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_5] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding", 0);
+
m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
m_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false);
m_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfig.GetIntDefault("RecordUpdateTimeDiffInterval", 60000);
diff --git a/src/game/World.h b/src/game/World.h
index 34de2ef0f2e..9d5085c3b7f 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -240,6 +240,13 @@ enum WorldConfigs
CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME,
CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME,
CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_1,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_2,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_3,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_4,
+ CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_5,
CONFIG_NO_RESET_TALENT_COST,
CONFIG_SHOW_KICK_IN_WORLD,
CONFIG_INTERVAL_LOG_UPDATE,
diff --git a/src/trinitycore/Main.cpp b/src/trinitycore/Main.cpp
index 5bc8bbaa76f..9d1a9f3321c 100644
--- a/src/trinitycore/Main.cpp
+++ b/src/trinitycore/Main.cpp
@@ -40,7 +40,7 @@
// Format is YYYYMMDDRR where RR is the change in the conf file
// for that day.
#ifndef _TRINITY_CORE_CONFVER
-# define _TRINITY_CORE_CONFVER 2009091001
+# define _TRINITY_CORE_CONFVER 2009091101
#endif //_TRINITY_CORE_CONFVER
#ifdef WIN32
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index 3afd0e37eed..fa21ced5e08 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -1,7 +1,7 @@
##########################################
# Trinity Core worldd configuration file #
##########################################
-ConfVersion=2009091001
+ConfVersion=2009091101
###################################################################################################################
# CONNECTIONS AND DIRECTORIES
@@ -1894,11 +1894,35 @@ Ra.Secure = 1
#
# OutdoorPvP.Wintergrasp.StartTime = 30
# The start time of the first battle after server starts (default: 30 minutes)
+#
# OutdoorPvP.Wintergrasp.BattleTime = 30
# Time limit of a battle
+#
# OutdoorPvP.Wintergrasp.Interval
# Interval between battles (default: 150 minutes)
#
+# OutdoorPvP.Wintergrasp.CustomHonorRewards
+# Defines whether custom honor rewards should be given to player for partaking in the Wintergrasp Battle (1) or not (0).
+# Default: 0
+#
+# OutdoorPvP.Wintergrasp.CustomHonorBattleWin
+# Defines the amount of honor points that should be given to the team winning the Wintergrasp Battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
+#
+# OutdoorPvP.Wintergrasp.CustomHonorBattleLose
+# Defines the amount of honor points that should be given to the team losing the Wintergrasp Battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
+#
+# OutdoorPvP.Wintergrasp.CustomHonorDamageTower
+# Defines the amount of honor points that should be given for damaging a tower. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
+#
+# OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower
+# Defines the amount of honor points that should be given for destroying a tower. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
+#
+# OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding
+# Defines the amount of honor points that should be given for damaged buildings after the battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
+#
+# OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding
+# Defines the amount of honor points that should be given for intact buildings after the battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
+#
# ForbiddenMaps
# map ids that users below SEC_GAMEMASTER cannot enter, with delimiter ','
# Default: ""
@@ -1948,6 +1972,13 @@ PvPToken.ItemCount = 1
OutdoorPvP.Wintergrasp.StartTime = 30
OutdoorPvP.Wintergrasp.BattleTime = 30
OutdoorPvP.Wintergrasp.Interval = 150
+OutdoorPvP.Wintergrasp.CustomHonorRewards = 0
+OutdoorPvP.Wintergrasp.CustomHonorBattleWin = 0
+OutdoorPvP.Wintergrasp.CustomHonorBattleLose = 0
+OutdoorPvP.Wintergrasp.CustomHonorDamageTower = 0
+OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower = 0
+OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding = 0
+OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding = 0
NoResetTalentsCost = 0
ShowKickInWorld = 0
RecordUpdateTimeDiffInterval = 60000