* Wintergrasp: Elementals/Revenants only visible outside Wartime. By Spp
*Wintergrasp: Fixed Towers, weren't giving rewards. By Spp *Wintergrasp: Cosmetic changes to make code easier to follow. By Spp (idea by Biglad) *Wintergrasp: Building are immune to damage outside Wartime. By Spp (Original code by Biglad) *Wintergrasp: Modified Custom Honor (Honor and marks) to fit with rank level. By Spp (Thanks to Gyullo and Magnarion) *Some cleanup. --HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -328,13 +328,13 @@ struct TRINITY_DLL_DECL npc_anub_ar_warriorAI : public ScriptedAI
|
|||||||
|
|
||||||
if(StrikeTimer < diff)
|
if(StrikeTimer < diff)
|
||||||
{
|
{
|
||||||
m_creature->CastSpell(m_creature->getVictim(),SPELL_STRIKE,true);
|
m_creature->CastSpell(m_creature->getVictim(), SPELL_STRIKE, true);
|
||||||
StrikeTimer = 15000;
|
StrikeTimer = 15000;
|
||||||
} else StrikeTimer -= diff;
|
} else StrikeTimer -= diff;
|
||||||
|
|
||||||
if(CleaveTimer < diff)
|
if(CleaveTimer < diff)
|
||||||
{
|
{
|
||||||
m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE ,true);
|
m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE, true);
|
||||||
CleaveTimer = 17000;
|
CleaveTimer = 17000;
|
||||||
} else CleaveTimer -= diff;
|
} else CleaveTimer -= diff;
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CheckIntenseColdTimer = 2000;
|
CheckIntenseColdTimer = 2000;
|
||||||
}else CheckIntenseColdTimer -= diff;
|
} else CheckIntenseColdTimer -= diff;
|
||||||
|
|
||||||
if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
|
if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
|
||||||
{
|
{
|
||||||
@@ -201,22 +201,22 @@ struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
DoCast(m_creature->getVictim(), HEROIC(SPELL_CRYSTALFIRE_BREATH_N, SPELL_CRYSTALFIRE_BREATH_H));
|
DoCast(m_creature->getVictim(), HEROIC(SPELL_CRYSTALFIRE_BREATH_N, SPELL_CRYSTALFIRE_BREATH_H));
|
||||||
CRYSTALFIRE_BREATH_Timer = 14000;
|
CRYSTALFIRE_BREATH_Timer = 14000;
|
||||||
}else CRYSTALFIRE_BREATH_Timer -=diff;
|
} else CRYSTALFIRE_BREATH_Timer -=diff;
|
||||||
|
|
||||||
if (TAIL_SWEEP_Timer < diff)
|
if (TAIL_SWEEP_Timer < diff)
|
||||||
{
|
{
|
||||||
DoCast(m_creature, SPELL_TAIL_SWEEP);
|
DoCast(m_creature, SPELL_TAIL_SWEEP);
|
||||||
TAIL_SWEEP_Timer = 5000;
|
TAIL_SWEEP_Timer = 5000;
|
||||||
}else TAIL_SWEEP_Timer -=diff;
|
} else TAIL_SWEEP_Timer -=diff;
|
||||||
|
|
||||||
if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff)
|
if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_CRYSTAL_NOVA , m_creature);
|
DoScriptText(SAY_CRYSTAL_NOVA, m_creature);
|
||||||
if (HeroicMode)
|
if (HeroicMode)
|
||||||
DoCast(m_creature, SPELL_CRYSTALIZE);
|
DoCast(m_creature, SPELL_CRYSTALIZE);
|
||||||
else if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||||
DoCast(target, SPELL_CRYSTAL_CHAINS);
|
DoCast(target, SPELL_CRYSTAL_CHAINS);
|
||||||
CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000;
|
CRYSTAL_CHAINS_CRYSTALIZE_Timer = HEROIC(11000,30000); // is this supposed to cast less often in normal ?
|
||||||
} else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff;
|
} else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff;
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
|
|||||||
+194
-113
@@ -19,7 +19,6 @@
|
|||||||
#include "Wintergrasp.h"
|
#include "Wintergrasp.h"
|
||||||
#include "SpellAuras.h"
|
#include "SpellAuras.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
//#include "GameEventMgr.h"
|
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
|
||||||
@@ -45,8 +44,6 @@ const TeamPair CreatureEntryPair[] =
|
|||||||
{
|
{
|
||||||
{32307, 32308}, // Guards
|
{32307, 32308}, // Guards
|
||||||
{30739, 30740}, // Champions
|
{30739, 30740}, // Champions
|
||||||
//{30400, 30499}, // Engineers
|
|
||||||
//{30870, 30869}, // Flight Masters
|
|
||||||
{31101, 31051}, // Hoodoo Master & Sorceress
|
{31101, 31051}, // Hoodoo Master & Sorceress
|
||||||
{31102, 31052}, // Vieron Blazefeather & Bowyer
|
{31102, 31052}, // Vieron Blazefeather & Bowyer
|
||||||
{32296, 32294}, // Quartermaster
|
{32296, 32294}, // Quartermaster
|
||||||
@@ -56,7 +53,6 @@ const TeamPair CreatureEntryPair[] =
|
|||||||
{31053, 31054}, // Primalist & Anchorite
|
{31053, 31054}, // Primalist & Anchorite
|
||||||
{31091, 31036}, // Commander
|
{31091, 31036}, // Commander
|
||||||
{32615, 32626}, // Warbringer & Brigadier General
|
{32615, 32626}, // Warbringer & Brigadier General
|
||||||
//{31841, 31842), // Spirit Guide
|
|
||||||
{0,0}
|
{0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -81,6 +77,10 @@ void LoadTeamPair(TeamPairMap &pairMap, const TeamPair *pair)
|
|||||||
(p)->RemoveAura(SPELL_CORPORAL);(p)->RemoveAura(SPELL_LIEUTENANT)
|
(p)->RemoveAura(SPELL_CORPORAL);(p)->RemoveAura(SPELL_LIEUTENANT)
|
||||||
#define REMOVE_TENACITY_AURA(p) CastTenacity(p, 0)
|
#define REMOVE_TENACITY_AURA(p) CastTenacity(p, 0)
|
||||||
|
|
||||||
|
// Visual defines, easier to understand code
|
||||||
|
#define getDefenderTeam() m_defender
|
||||||
|
#define getAttackerTeam() OTHER_TEAM(m_defender)
|
||||||
|
|
||||||
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
||||||
|
|
||||||
bool OPvPWintergrasp::SetupOutdoorPvP()
|
bool OPvPWintergrasp::SetupOutdoorPvP()
|
||||||
@@ -90,11 +90,8 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
|
|
||||||
m_defender = TeamId(rand()%2);
|
m_defender = TeamId(rand()%2);
|
||||||
m_changeDefender = false;
|
m_changeDefender = false;
|
||||||
|
|
||||||
m_workshopCount[TEAM_ALLIANCE] = 0;
|
m_workshopCount[TEAM_ALLIANCE] = 0;
|
||||||
m_workshopCount[TEAM_HORDE] = 0;
|
m_workshopCount[TEAM_HORDE] = 0;
|
||||||
m_towerCount = 3;
|
|
||||||
m_towerDamagedCount = 0;
|
|
||||||
|
|
||||||
// Select POI
|
// Select POI
|
||||||
AreaPOIList areaPOIs;
|
AreaPOIList areaPOIs;
|
||||||
@@ -153,8 +150,8 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// add building to the list
|
// add building to the list
|
||||||
TeamId teamId = x > POS_X_CENTER ? m_defender : OTHER_TEAM(m_defender);
|
TeamId teamId = x > POS_X_CENTER ? getDefenderTeam() : getAttackerTeam();
|
||||||
m_buildingStates[guid] = new BuildingState((*poi)->worldState, teamId, m_defender != TEAM_ALLIANCE);
|
m_buildingStates[guid] = new BuildingState((*poi)->worldState, teamId, getDefenderTeam() != TEAM_ALLIANCE);
|
||||||
if ((*poi)->id == 2246)
|
if ((*poi)->id == 2246)
|
||||||
m_gate = m_buildingStates[guid];
|
m_gate = m_buildingStates[guid];
|
||||||
areaPOIs.erase(poi);
|
areaPOIs.erase(poi);
|
||||||
@@ -289,7 +286,7 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
//for (AreaPOIList::iterator itr = areaPOIs.begin(); itr != areaPOIs.end(); ++itr)
|
//for (AreaPOIList::iterator itr = areaPOIs.begin(); itr != areaPOIs.end(); ++itr)
|
||||||
// sLog.outError("not assigned %u %f %f", (*itr)->id, (*itr)->x, (*itr)->y);
|
// sLog.outError("not assigned %u %f %f", (*itr)->id, (*itr)->x, (*itr)->y);
|
||||||
|
|
||||||
//gameeventmgr.StartInternalEvent(GameEventWintergraspDefender[m_defender]);
|
//gameeventmgr.StartInternalEvent(GameEventWintergraspDefender[getDefenderTeam()]);
|
||||||
|
|
||||||
//Titan Relic eventid = 19982
|
//Titan Relic eventid = 19982
|
||||||
objmgr.AddGOData(192829, 571, 5440, 2840.8, 420.43 + 10, 0);
|
objmgr.AddGOData(192829, 571, 5440, 2840.8, 420.43 + 10, 0);
|
||||||
@@ -300,10 +297,23 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
m_wartime = false;
|
m_wartime = false;
|
||||||
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME) * MINUTE * IN_MILISECONDS;
|
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME) * MINUTE * IN_MILISECONDS;
|
||||||
|
|
||||||
|
m_towerCount[getDefenderTeam()][DAMAGE_INTACT] = 4;
|
||||||
|
m_towerCount[getAttackerTeam()][DAMAGE_INTACT] = 3;
|
||||||
|
m_towerCount[TEAM_ALLIANCE][DAMAGE_DAMAGED] = 0;
|
||||||
|
m_towerCount[TEAM_HORDE][DAMAGE_DAMAGED] = 0;
|
||||||
|
m_towerCount[TEAM_ALLIANCE][DAMAGE_DESTROYED] = 0;
|
||||||
|
m_towerCount[TEAM_HORDE][DAMAGE_DESTROYED] = 0;
|
||||||
|
|
||||||
// Load custom rewards
|
// Load custom rewards
|
||||||
if (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
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);
|
m_customHonorReward[WIN_BATTLE] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_WIN_BATTLE);
|
||||||
|
m_customHonorReward[LOSE_BATTLE] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_LOSE_BATTLE);
|
||||||
|
m_customHonorReward[DAMAGED_TOWER] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_TOWER);
|
||||||
|
m_customHonorReward[DESTROYED_TOWER] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_DESTROYED_TOWER);
|
||||||
|
m_customHonorReward[DAMAGED_BUILDING] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_BUILDING);
|
||||||
|
m_customHonorReward[INTACT_BUILDING] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_INTACT_BUILDING);
|
||||||
|
}
|
||||||
|
|
||||||
RemoveOfflinePlayerWGAuras();
|
RemoveOfflinePlayerWGAuras();
|
||||||
|
|
||||||
@@ -315,7 +325,7 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
|
|||||||
{
|
{
|
||||||
if (eventId == 19982)
|
if (eventId == 19982)
|
||||||
{
|
{
|
||||||
if (m_wartime && m_gate && m_gate->damageState == DAMAGE_DESTROYED)
|
if (isWarTime() && m_gate && m_gate->damageState == DAMAGE_DESTROYED)
|
||||||
{
|
{
|
||||||
m_changeDefender = true;
|
m_changeDefender = true;
|
||||||
m_timer = 0;
|
m_timer = 0;
|
||||||
@@ -332,7 +342,7 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
|
|||||||
state->damageState = DAMAGE_DAMAGED;
|
state->damageState = DAMAGE_DAMAGED;
|
||||||
|
|
||||||
if (state->type == BUILDING_TOWER)
|
if (state->type == BUILDING_TOWER)
|
||||||
++m_towerDamagedCount;
|
++m_towerCount[state->GetTeam()][DAMAGE_DAMAGED];
|
||||||
}
|
}
|
||||||
else if (eventId == obj->GetGOInfo()->building.destroyedEvent)
|
else if (eventId == obj->GetGOInfo()->building.destroyedEvent)
|
||||||
{
|
{
|
||||||
@@ -341,12 +351,9 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
|
|||||||
if (state->type == BUILDING_WORKSHOP)
|
if (state->type == BUILDING_WORKSHOP)
|
||||||
ModifyWorkshopCount(state->GetTeam(), false);
|
ModifyWorkshopCount(state->GetTeam(), false);
|
||||||
else if (state->type == BUILDING_TOWER)
|
else if (state->type == BUILDING_TOWER)
|
||||||
if (!m_towerCount)
|
|
||||||
sLog.outError("OPvPWintergrasp::ProcessEvent: negative tower count!");
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
--m_towerCount;
|
--m_towerCount[state->GetTeam()][DAMAGE_DAMAGED];
|
||||||
--m_towerDamagedCount;
|
++m_towerCount[state->GetTeam()][DAMAGE_DESTROYED];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BroadcastStateChange(state);
|
BroadcastStateChange(state);
|
||||||
@@ -378,7 +385,7 @@ void OPvPWintergrasp::ModifyWorkshopCount(TeamId team, bool add)
|
|||||||
|
|
||||||
uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, const CreatureData *data)
|
uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, const CreatureData *data)
|
||||||
{
|
{
|
||||||
if (m_defender == TEAM_ALLIANCE)
|
if (getDefenderTeam() == TEAM_ALLIANCE)
|
||||||
{
|
{
|
||||||
TeamPairMap::const_iterator itr = m_creEntryPair.find(data->id);
|
TeamPairMap::const_iterator itr = m_creEntryPair.find(data->id);
|
||||||
if (itr != m_creEntryPair.end())
|
if (itr != m_creEntryPair.end())
|
||||||
@@ -392,25 +399,40 @@ uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, const CreatureData *dat
|
|||||||
|
|
||||||
WintergraspCreType OPvPWintergrasp::GetCreatureType(uint32 entry) const
|
WintergraspCreType OPvPWintergrasp::GetCreatureType(uint32 entry) const
|
||||||
{
|
{
|
||||||
|
// VEHICLES, GUARDS and TURRETS gives kill credit
|
||||||
|
// OTHER Not in wartime
|
||||||
|
// TURRET Only during wartime
|
||||||
|
// SPECIAL like "OTHER" but no despawn conditions
|
||||||
|
// Entries like Case A: Case: B have their own despawn function
|
||||||
switch(entry)
|
switch(entry)
|
||||||
{
|
{
|
||||||
case 27881:
|
case 27881: // Catapult
|
||||||
case 28094:
|
case 28094: // Demolisher
|
||||||
case 28312:
|
case 28312: // Alliance Siege Engine
|
||||||
case 32627:
|
case 32627: // Horde Siege Engine
|
||||||
return CREATURE_SIEGE_VEHICLE;
|
return CREATURE_SIEGE_VEHICLE;
|
||||||
case 28366:
|
case 28366: // Wintergrasp Tower cannon
|
||||||
return CREATURE_TURRET;
|
return CREATURE_TURRET;
|
||||||
case CRE_ENG_A:
|
case CRE_ENG_A: // Alliance Engineer
|
||||||
case CRE_ENG_H:
|
case CRE_ENG_H: // Horde Engineer
|
||||||
return CREATURE_ENGINEER;
|
return CREATURE_ENGINEER;
|
||||||
case 30739:
|
case 30739:case 30740: // Champions
|
||||||
case 30740:
|
case 32307:case 32308: // Guards
|
||||||
case 32307:
|
|
||||||
case 32308:
|
|
||||||
return CREATURE_GUARD;
|
return CREATURE_GUARD;
|
||||||
|
case 31101:case 31051: // Hoodoo Master & Sorceress
|
||||||
|
case 31102:case 31052: // Vieron Blazefeather & Bowyer
|
||||||
|
case 31107:case 31109: // Lieutenant & Senior Demolitionist
|
||||||
|
case 31151:case 31153: // Tactical Officer
|
||||||
|
case 31106:case 31108: // Siegesmith & Siege Master
|
||||||
|
case 31053:case 31054: // Primalist & Anchorite
|
||||||
|
case 31091:case 31036: // Commander
|
||||||
|
case 32615:case 32626: // Warbringer && Brigadier General
|
||||||
|
case 32296:case 32294: // Quartermaster
|
||||||
|
case 30870:case 30869: // Flight Masters
|
||||||
|
case 31841:case 31842: // Spirit Guides
|
||||||
|
return CREATURE_SPECIAL;
|
||||||
default:
|
default:
|
||||||
return CREATURE_OTHER;
|
return CREATURE_OTHER; // Revenants, Elementals, etc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,17 +509,10 @@ void OPvPWintergrasp::OnCreatureCreate(Creature *creature, bool add)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CREATURE_TURRET:
|
|
||||||
if (add) m_turrets.insert(creature);
|
|
||||||
else m_turrets.erase(creature);
|
|
||||||
UpdateCreatureInfo(creature);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if (m_creEntryPair.find(entry) != m_creEntryPair.end()) // guards and npc
|
|
||||||
{
|
|
||||||
if (add) m_creatures.insert(creature);
|
if (add) m_creatures.insert(creature);
|
||||||
else m_creatures.erase(creature);
|
else m_creatures.erase(creature);
|
||||||
}
|
UpdateCreatureInfo(creature);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -518,6 +533,8 @@ void OPvPWintergrasp::OnGameObjectCreate(GameObject *go, bool add)
|
|||||||
if (itr != m_buildingStates.end())
|
if (itr != m_buildingStates.end())
|
||||||
{
|
{
|
||||||
itr->second->building = add ? go : NULL;
|
itr->second->building = add ? go : NULL;
|
||||||
|
if (go->GetGOInfo()->displayId == 7878 || go->GetGOInfo()->displayId == 7900)
|
||||||
|
itr->second->type = BUILDING_TOWER;
|
||||||
if (!add || itr->second->damageState == DAMAGE_INTACT && !itr->second->health)
|
if (!add || itr->second->damageState == DAMAGE_INTACT && !itr->second->health)
|
||||||
itr->second->health = go->GetGOValue()->building.health;
|
itr->second->health = go->GetGOValue()->building.health;
|
||||||
else
|
else
|
||||||
@@ -539,8 +556,6 @@ void OPvPWintergrasp::UpdateAllWorldObject()
|
|||||||
UpdateGameObjectInfo(*itr);
|
UpdateGameObjectInfo(*itr);
|
||||||
for (CreatureSet::iterator itr = m_creatures.begin(); itr != m_creatures.end(); ++itr)
|
for (CreatureSet::iterator itr = m_creatures.begin(); itr != m_creatures.end(); ++itr)
|
||||||
UpdateCreatureInfo(*itr);
|
UpdateCreatureInfo(*itr);
|
||||||
for (CreatureSet::iterator itr = m_turrets.begin(); itr != m_turrets.end(); ++itr)
|
|
||||||
UpdateCreatureInfo(*itr);
|
|
||||||
|
|
||||||
// rebuild and update building states
|
// rebuild and update building states
|
||||||
RebuildAllBuildings();
|
RebuildAllBuildings();
|
||||||
@@ -557,6 +572,7 @@ void OPvPWintergrasp::RebuildAllBuildings()
|
|||||||
{
|
{
|
||||||
if (itr->second->building)
|
if (itr->second->building)
|
||||||
{
|
{
|
||||||
|
UpdateGameObjectInfo(itr->second->building);
|
||||||
itr->second->building->Rebuild();
|
itr->second->building->Rebuild();
|
||||||
itr->second->health = itr->second->building->GetGOValue()->building.health;
|
itr->second->health = itr->second->building->GetGOValue()->building.health;
|
||||||
}
|
}
|
||||||
@@ -570,10 +586,15 @@ void OPvPWintergrasp::RebuildAllBuildings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
itr->second->damageState = DAMAGE_INTACT;
|
itr->second->damageState = DAMAGE_INTACT;
|
||||||
itr->second->SetTeam(m_defender == TEAM_ALLIANCE ? OTHER_TEAM(itr->second->defaultTeam) : itr->second->defaultTeam);
|
itr->second->SetTeam(getDefenderTeam() == TEAM_ALLIANCE ? OTHER_TEAM(itr->second->defaultTeam) : itr->second->defaultTeam);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_towerCount = 3;
|
m_towerCount[getDefenderTeam()][DAMAGE_INTACT] = 4;
|
||||||
|
m_towerCount[getAttackerTeam()][DAMAGE_INTACT] = 3;
|
||||||
|
m_towerCount[TEAM_ALLIANCE][DAMAGE_DAMAGED] = 0;
|
||||||
|
m_towerCount[TEAM_HORDE][DAMAGE_DAMAGED] = 0;
|
||||||
|
m_towerCount[TEAM_ALLIANCE][DAMAGE_DESTROYED] = 0;
|
||||||
|
m_towerCount[TEAM_HORDE][DAMAGE_DESTROYED] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPvPWintergrasp::SendInitWorldStatesTo(Player *player) const
|
void OPvPWintergrasp::SendInitWorldStatesTo(Player *player) const
|
||||||
@@ -584,10 +605,10 @@ void OPvPWintergrasp::SendInitWorldStatesTo(Player *player) const
|
|||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
data << uint16(4+5+4+m_buildingStates.size());
|
data << uint16(4+5+4+m_buildingStates.size());
|
||||||
|
|
||||||
data << uint32(3803) << uint32(m_defender == TEAM_ALLIANCE ? 1 : 0);
|
data << uint32(3803) << uint32(getDefenderTeam() == TEAM_ALLIANCE ? 1 : 0);
|
||||||
data << uint32(3802) << uint32(m_defender != TEAM_ALLIANCE ? 1 : 0);
|
data << uint32(3802) << uint32(getDefenderTeam() != TEAM_ALLIANCE ? 1 : 0);
|
||||||
data << uint32(3801) << uint32(m_wartime ? 0 : 1);
|
data << uint32(3801) << uint32(isWarTime() ? 0 : 1);
|
||||||
data << uint32(3710) << uint32(m_wartime ? 1 : 0);
|
data << uint32(3710) << uint32(isWarTime() ? 1 : 0);
|
||||||
|
|
||||||
for (uint32 i = 0; i < 5; ++i)
|
for (uint32 i = 0; i < 5; ++i)
|
||||||
data << ClockWorldState[i] << m_clock[i];
|
data << ClockWorldState[i] << m_clock[i];
|
||||||
@@ -617,56 +638,86 @@ void OPvPWintergrasp::BroadcastStateChange(BuildingState *state) const
|
|||||||
// Called at Start and Battle End
|
// Called at Start and Battle End
|
||||||
bool OPvPWintergrasp::UpdateCreatureInfo(Creature *creature) const
|
bool OPvPWintergrasp::UpdateCreatureInfo(Creature *creature) const
|
||||||
{
|
{
|
||||||
if (GetCreatureType(creature->GetEntry()) == CREATURE_TURRET)
|
uint32 entry = creature->GetEntry();
|
||||||
|
switch(GetCreatureType(entry))
|
||||||
|
{
|
||||||
|
case CREATURE_TURRET:
|
||||||
|
if (isWarTime())
|
||||||
{
|
{
|
||||||
if (!creature->isAlive())
|
if (!creature->isAlive())
|
||||||
creature->Respawn(true);
|
creature->Respawn(true);
|
||||||
if (m_wartime)
|
creature->setFaction(WintergraspFaction[getDefenderTeam()]);
|
||||||
{
|
|
||||||
creature->SetVisibility(VISIBILITY_ON);
|
creature->SetVisibility(VISIBILITY_ON);
|
||||||
creature->setFaction(WintergraspFaction[m_defender]);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (creature->IsVehicle())
|
||||||
|
creature->GetVehicleKit()->RemoveAllPassengers();
|
||||||
|
creature->SetVisibility(VISIBILITY_OFF);
|
||||||
|
creature->setFaction(35);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case CREATURE_OTHER:
|
||||||
|
if (isWarTime())
|
||||||
{
|
{
|
||||||
creature->SetVisibility(VISIBILITY_OFF);
|
creature->SetVisibility(VISIBILITY_OFF);
|
||||||
creature->setFaction(35);
|
creature->setFaction(35);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
creature->RestoreFaction();
|
||||||
|
creature->SetVisibility(VISIBILITY_ON);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case CREATURE_ENGINEER:
|
||||||
|
return false;
|
||||||
|
case CREATURE_SIEGE_VEHICLE:
|
||||||
|
creature->DisappearAndDie();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TeamPairMap::const_iterator itr = m_creEntryPair.find(creature->GetCreatureData()->id);
|
TeamPairMap::const_iterator itr = m_creEntryPair.find(creature->GetCreatureData()->id);
|
||||||
if (itr != m_creEntryPair.end())
|
if (itr != m_creEntryPair.end())
|
||||||
{
|
{
|
||||||
uint32 entry = m_defender == TEAM_ALLIANCE ? itr->second : itr->first;
|
entry = getDefenderTeam() == TEAM_ALLIANCE ? itr->second : itr->first;
|
||||||
creature->SetOriginalEntry(entry);
|
creature->SetOriginalEntry(entry);
|
||||||
if (entry != creature->GetEntry() || !creature->isAlive())
|
if (entry != creature->GetEntry() || !creature->isAlive())
|
||||||
creature->Respawn(true);
|
creature->Respawn(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return false = Need to rebuild at battle End/Start
|
||||||
|
// true = no need to rebuild (ie: Banners or teleporters)
|
||||||
bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
|
bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
|
||||||
{
|
{
|
||||||
|
uint32 attFaction = 35;
|
||||||
|
uint32 defFaction = 35;
|
||||||
|
|
||||||
|
if (isWarTime())
|
||||||
|
{
|
||||||
|
attFaction = WintergraspFaction[getAttackerTeam()];
|
||||||
|
defFaction = WintergraspFaction[getDefenderTeam()];
|
||||||
|
}
|
||||||
|
|
||||||
switch(go->GetGOInfo()->displayId)
|
switch(go->GetGOInfo()->displayId)
|
||||||
{
|
{
|
||||||
case 8244: // Defender's Portal - Vehicle Teleporter
|
case 8244: // Defender's Portal - Vehicle Teleporter
|
||||||
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_defender]);
|
go->SetUInt32Value(GAMEOBJECT_FACTION, defFaction);
|
||||||
return true;
|
return true;
|
||||||
case 7967: // Titan relic
|
case 7967: // Titan relic
|
||||||
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[OTHER_TEAM(m_defender)]);
|
go->SetUInt32Value(GAMEOBJECT_FACTION, attFaction);
|
||||||
return true;
|
return true;
|
||||||
// Return False = we need to rebuild at battle End
|
|
||||||
|
|
||||||
case 8165: // Wintergrasp Keep Door
|
case 8165: // Wintergrasp Keep Door
|
||||||
case 7877: // Wintergrasp Fortress Wall
|
case 7877: // Wintergrasp Fortress Wall
|
||||||
case 7878: // Wintergrasp Keep Tower
|
case 7878: // Wintergrasp Keep Tower
|
||||||
case 7906: // Wintergrasp Fortress Gate
|
case 7906: // Wintergrasp Fortress Gate
|
||||||
case 7909: // Wintergrasp Wall
|
case 7909: // Wintergrasp Wall
|
||||||
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_defender]);
|
go->SetUInt32Value(GAMEOBJECT_FACTION, defFaction);
|
||||||
return false;
|
return false;
|
||||||
case 7900: // Flamewatch Tower - Shadowsight Tower - Winter's Edge Tower
|
case 7900: // Flamewatch Tower - Shadowsight Tower - Winter's Edge Tower
|
||||||
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[OTHER_TEAM(m_defender)]);
|
go->SetUInt32Value(GAMEOBJECT_FACTION, attFaction);
|
||||||
return false;
|
return false;
|
||||||
case 8208: // Goblin Workshop
|
case 8208: // Goblin Workshop
|
||||||
SiegeWorkshop *workshop = GetWorkshopByGOGuid(go->GetGUID());
|
SiegeWorkshop *workshop = GetWorkshopByGOGuid(go->GetGUID());
|
||||||
@@ -679,7 +730,7 @@ bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
|
|||||||
TeamPairMap::const_iterator itr = m_goDisplayPair.find(go->GetGOInfo()->displayId);
|
TeamPairMap::const_iterator itr = m_goDisplayPair.find(go->GetGOInfo()->displayId);
|
||||||
if (itr != m_goDisplayPair.end())
|
if (itr != m_goDisplayPair.end())
|
||||||
{
|
{
|
||||||
go->SetUInt32Value(GAMEOBJECT_DISPLAYID, m_defender == TEAM_ALLIANCE ?
|
go->SetUInt32Value(GAMEOBJECT_DISPLAYID, getDefenderTeam() == TEAM_ALLIANCE ?
|
||||||
itr->second : itr->first);
|
itr->second : itr->first);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -688,7 +739,7 @@ bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
|
|||||||
|
|
||||||
void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
||||||
{
|
{
|
||||||
if (m_wartime && !plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
if (isWarTime() && !plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
||||||
&& !plr->HasAura(SPELL_LIEUTENANT))
|
&& !plr->HasAura(SPELL_LIEUTENANT))
|
||||||
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
||||||
|
|
||||||
@@ -792,12 +843,12 @@ void OPvPWintergrasp::CastTenacity(Unit *unit, int32 newStack)
|
|||||||
// Recalculates Tenacity and applies it to Players / Vehicles
|
// Recalculates Tenacity and applies it to Players / Vehicles
|
||||||
void OPvPWintergrasp::UpdateTenacityStack()
|
void OPvPWintergrasp::UpdateTenacityStack()
|
||||||
{
|
{
|
||||||
if (!m_wartime)
|
if (!isWarTime())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TeamId team = TEAM_NEUTRAL;
|
TeamId team = TEAM_NEUTRAL;
|
||||||
uint32 allianceNum = m_players[TEAM_ALLIANCE].size();
|
uint32 allianceNum = m_players[TEAM_ALLIANCE].size();;
|
||||||
uint32 hordeNum = m_players[TEAM_HORDE].size();
|
uint32 hordeNum = m_players[TEAM_HORDE].size();;
|
||||||
int32 newStack = 0;
|
int32 newStack = 0;
|
||||||
|
|
||||||
if (allianceNum && hordeNum)
|
if (allianceNum && hordeNum)
|
||||||
@@ -880,7 +931,7 @@ void OPvPWintergrasp::UpdateClock()
|
|||||||
UpdateClockDigit(timer, 1, 6);
|
UpdateClockDigit(timer, 1, 6);
|
||||||
UpdateClockDigit(timer, 2, 10);
|
UpdateClockDigit(timer, 2, 10);
|
||||||
UpdateClockDigit(timer, 3, 6);
|
UpdateClockDigit(timer, 3, 6);
|
||||||
if (!m_wartime)
|
if (!isWarTime())
|
||||||
UpdateClockDigit(timer, 4, 10);
|
UpdateClockDigit(timer, 4, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -893,7 +944,7 @@ bool OPvPWintergrasp::Update(uint32 diff)
|
|||||||
{
|
{
|
||||||
m_timer -= diff;
|
m_timer -= diff;
|
||||||
|
|
||||||
if (m_wartime)
|
if (isWarTime())
|
||||||
OutdoorPvP::Update(diff); // update capture points
|
OutdoorPvP::Update(diff); // update capture points
|
||||||
|
|
||||||
UpdateClock();
|
UpdateClock();
|
||||||
@@ -902,20 +953,20 @@ bool OPvPWintergrasp::Update(uint32 diff)
|
|||||||
{
|
{
|
||||||
m_sendUpdate = false;
|
m_sendUpdate = false;
|
||||||
|
|
||||||
if (m_wartime)
|
if (isWarTime())
|
||||||
{
|
{
|
||||||
if (m_changeDefender)
|
if (m_changeDefender)
|
||||||
{
|
{
|
||||||
m_changeDefender = false;
|
m_changeDefender = false;
|
||||||
m_defender = OTHER_TEAM(m_defender);
|
m_defender = getAttackerTeam();
|
||||||
if (m_defender == TEAM_ALLIANCE)
|
if (getDefenderTeam() == TEAM_ALLIANCE)
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has taken over the fortress!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has taken over the fortress!");
|
||||||
else
|
else
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has taken over the fortress!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has taken over the fortress!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_defender == TEAM_ALLIANCE)
|
if (getDefenderTeam() == TEAM_ALLIANCE)
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has successfully defended the fortress!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has successfully defended the fortress!");
|
||||||
else
|
else
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has successfully defended the fortress!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has successfully defended the fortress!");
|
||||||
@@ -944,14 +995,9 @@ void OPvPWintergrasp::StartBattle()
|
|||||||
m_wartime = true;
|
m_wartime = true;
|
||||||
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILISECONDS;
|
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILISECONDS;
|
||||||
|
|
||||||
// make sure all building are rebuild as battle starts
|
|
||||||
RebuildAllBuildings();
|
|
||||||
// update all GOs make sure they have correct faction for wartime
|
|
||||||
UpdateAllWorldObject();
|
|
||||||
|
|
||||||
// Add recruit Aura, Add Tenacity
|
// Add recruit Aura, Add Tenacity
|
||||||
TeamCastSpell(m_defender, SPELL_RECRUIT);
|
TeamCastSpell(getDefenderTeam(), SPELL_RECRUIT);
|
||||||
TeamCastSpell(OTHER_TEAM(m_defender), SPELL_RECRUIT);
|
TeamCastSpell(getAttackerTeam(), SPELL_RECRUIT);
|
||||||
UpdateTenacityStack();
|
UpdateTenacityStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -984,33 +1030,29 @@ void OPvPWintergrasp::EndBattle()
|
|||||||
else if (workshop->m_buildingState->damageState == DAMAGE_INTACT)
|
else if (workshop->m_buildingState->damageState == DAMAGE_INTACT)
|
||||||
++intactNum;
|
++intactNum;
|
||||||
|
|
||||||
uint32 spellRewardId = (team == m_defender) ? SPELL_VICTORY_REWARD : SPELL_DEFEAT_REWARD;
|
uint32 spellRewardId = team == getDefenderTeam() ? SPELL_VICTORY_REWARD : SPELL_DEFEAT_REWARD;
|
||||||
int32 honor;
|
uint32 baseHonor = 0;
|
||||||
uint32 marks;
|
uint32 marks = 0;
|
||||||
m_towerDamagedCount = 0; //until a function calculate it
|
uint32 playersWithRankNum = 0;
|
||||||
m_towerCount = 3;
|
|
||||||
|
|
||||||
if (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
if (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
||||||
{
|
{
|
||||||
if (team == m_defender)
|
// Calculate Level 70+ with Corporal or Lieutenant rank
|
||||||
{
|
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
honor = m_customHonorReward[WIN_BATTLE];
|
if ((*itr)->getLevel() > 69 && ((*itr)->HasAura(SPELL_LIEUTENANT) || (*itr)->HasAura(SPELL_CORPORAL)))
|
||||||
marks = m_customHonorReward[WIN_BATTLE_MARKS];
|
++playersWithRankNum;
|
||||||
honor += (m_customHonorReward[DAMAGED_TOWER] * m_towerDamagedCount);
|
|
||||||
honor += (m_customHonorReward[DESTROYED_TOWER] * (3 - m_towerCount));
|
baseHonor = m_customHonorReward[(team == getDefenderTeam()) ? WIN_BATTLE : LOSE_BATTLE];
|
||||||
}
|
baseHonor += (m_customHonorReward[DAMAGED_TOWER] * m_towerCount[OTHER_TEAM(team)][DAMAGED_TOWER]);
|
||||||
else
|
baseHonor += (m_customHonorReward[DESTROYED_TOWER] * m_towerCount[OTHER_TEAM(team)][DAMAGED_TOWER]);
|
||||||
{
|
baseHonor += (m_customHonorReward[INTACT_BUILDING] * intactNum);
|
||||||
honor = m_customHonorReward[LOSE_BATTLE];
|
baseHonor += (m_customHonorReward[DAMAGED_BUILDING] * damagedNum);
|
||||||
marks = m_customHonorReward[LOSE_BATTLE_MARKS];;
|
|
||||||
}
|
|
||||||
honor += (m_customHonorReward[INTACT_BUILDING] * intactNum);
|
|
||||||
honor += (m_customHonorReward[DAMAGED_BUILDING] * damagedNum);
|
|
||||||
honor = int32(honor / m_players[team].size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Revive players, remove auras and give rewards
|
||||||
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
{
|
{
|
||||||
|
uint32 honor;
|
||||||
// When WG ends the zone is cleaned including corpses, revive all players if dead
|
// When WG ends the zone is cleaned including corpses, revive all players if dead
|
||||||
if ((*itr)->isDead())
|
if ((*itr)->isDead())
|
||||||
{
|
{
|
||||||
@@ -1018,38 +1060,75 @@ void OPvPWintergrasp::EndBattle()
|
|||||||
ObjectAccessor::Instance().ConvertCorpseForPlayer((*itr)->GetGUID());
|
ObjectAccessor::Instance().ConvertCorpseForPlayer((*itr)->GetGUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((*itr)->getLevel() < 70)
|
||||||
|
continue; // No rewards for level <70
|
||||||
|
|
||||||
// give rewards
|
// give rewards
|
||||||
if ((*itr)->HasAura(SPELL_LIEUTENANT) && (*itr)->getLevel() > 69)
|
if (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
||||||
{
|
{
|
||||||
if (!sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR))
|
if (team == getDefenderTeam())
|
||||||
{
|
{
|
||||||
|
if ((*itr)->HasAura(SPELL_LIEUTENANT))
|
||||||
|
{
|
||||||
|
marks = 3;
|
||||||
|
honor = baseHonor;
|
||||||
|
}
|
||||||
|
else if ((*itr)->HasAura(SPELL_CORPORAL))
|
||||||
|
{
|
||||||
|
marks = 2;
|
||||||
|
honor = baseHonor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
marks = 1;
|
||||||
|
honor = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((*itr)->HasAura(SPELL_LIEUTENANT))
|
||||||
|
{
|
||||||
|
marks = 1;
|
||||||
|
honor = baseHonor;
|
||||||
|
}
|
||||||
|
else if ((*itr)->HasAura(SPELL_CORPORAL))
|
||||||
|
{
|
||||||
|
marks = 1;
|
||||||
|
honor = baseHonor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
marks = 0;
|
||||||
|
honor = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(*itr)->RewardHonor(NULL, playersWithRankNum, honor);
|
||||||
|
RewardMarkOfHonor(*itr, marks);
|
||||||
|
(*itr)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, spellRewardId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if ((*itr)->HasAura(SPELL_LIEUTENANT) || (*itr)->HasAura(SPELL_CORPORAL))
|
||||||
|
{
|
||||||
|
// TODO - Honor from SpellReward should be shared by team players
|
||||||
|
// TODO - Marks should be given depending on Rank but 3 are given
|
||||||
|
// each time so Won't give any to recruits
|
||||||
(*itr)->CastSpell(*itr, spellRewardId, true);
|
(*itr)->CastSpell(*itr, spellRewardId, true);
|
||||||
for (uint32 i = 0; i < intactNum; ++i)
|
for (uint32 i = 0; i < intactNum; ++i)
|
||||||
(*itr)->CastSpell(*itr, SPELL_INTACT_BUILDING, true);
|
(*itr)->CastSpell(*itr, SPELL_INTACT_BUILDING, true);
|
||||||
for (uint32 i = 0; i < damagedNum; ++i)
|
for (uint32 i = 0; i < damagedNum; ++i)
|
||||||
(*itr)->CastSpell(*itr, SPELL_DAMAGED_BUILDING, true);
|
(*itr)->CastSpell(*itr, SPELL_DAMAGED_BUILDING, true);
|
||||||
if (team == m_defender)
|
for (uint32 i = 0; i < m_towerCount[OTHER_TEAM(team)][DAMAGE_DAMAGED]; ++i)
|
||||||
{
|
|
||||||
for (uint32 i = 0; i < m_towerDamagedCount; ++i)
|
|
||||||
(*itr)->CastSpell(*itr, SPELL_DAMAGED_TOWER, true);
|
(*itr)->CastSpell(*itr, SPELL_DAMAGED_TOWER, true);
|
||||||
for (uint32 i = 3; i > m_towerCount; --i)
|
for (uint32 i = 0; i < m_towerCount[OTHER_TEAM(team)][DAMAGE_DESTROYED]; ++i)
|
||||||
(*itr)->CastSpell(*itr, SPELL_DESTROYED_TOWER, true);
|
(*itr)->CastSpell(*itr, SPELL_DESTROYED_TOWER, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
(*itr)->ModifyHonorPoints(honor);
|
|
||||||
(*itr)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, spellRewardId);
|
|
||||||
RewardMarkOfHonor(*itr, marks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
REMOVE_WARTIME_AURAS(*itr);
|
REMOVE_WARTIME_AURAS(*itr);
|
||||||
REMOVE_TENACITY_AURA(*itr);
|
REMOVE_TENACITY_AURA(*itr);
|
||||||
(*itr)->CombatStop(true);
|
(*itr)->CombatStop(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//3.2.0: TeamCastSpell(OTHER_TEAM(m_defender), SPELL_TELEPORT_DALARAN);
|
//3.2.0: TeamCastSpell(getAttackerTeam(), SPELL_TELEPORT_DALARAN);
|
||||||
RemoveOfflinePlayerWGAuras();
|
RemoveOfflinePlayerWGAuras();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1066,7 +1145,7 @@ bool OPvPWintergrasp::CanBuildVehicle(SiegeWorkshop *workshop) const
|
|||||||
if (team == TEAM_NEUTRAL)
|
if (team == TEAM_NEUTRAL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return m_wartime
|
return isWarTime()
|
||||||
&& workshop->m_buildingState->damageState != DAMAGE_DESTROYED
|
&& workshop->m_buildingState->damageState != DAMAGE_DESTROYED
|
||||||
&& m_vehicles[team].size() < m_workshopCount[team] * MAX_VEHICLE_PER_WORKSHOP;
|
&& m_vehicles[team].size() < m_workshopCount[team] * MAX_VEHICLE_PER_WORKSHOP;
|
||||||
}
|
}
|
||||||
@@ -1085,6 +1164,8 @@ void OPvPWintergrasp::RewardMarkOfHonor(Player *plr, uint32 count)
|
|||||||
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
|
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
|
||||||
if (plr->HasAura(SPELL_AURA_PLAYER_INACTIVE))
|
if (plr->HasAura(SPELL_AURA_PLAYER_INACTIVE))
|
||||||
return;
|
return;
|
||||||
|
if (count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
ItemPosCountVec dest;
|
ItemPosCountVec dest;
|
||||||
uint32 no_space_count = 0;
|
uint32 no_space_count = 0;
|
||||||
|
|||||||
@@ -63,11 +63,10 @@ enum WintergraspRewardEvent
|
|||||||
DESTROYED_TOWER,
|
DESTROYED_TOWER,
|
||||||
DAMAGED_BUILDING,
|
DAMAGED_BUILDING,
|
||||||
INTACT_BUILDING,
|
INTACT_BUILDING,
|
||||||
WIN_BATTLE_MARKS,
|
WG_REWARD_EVENT_MAX,
|
||||||
LOSE_BATTLE_MARKS,
|
|
||||||
WG_REWARD_EVENT_MAX
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Not used / Not implemented
|
/* Not used / Not implemented
|
||||||
|
|
||||||
const uint16 GameEventWintergraspDefender[2] = {50, 51};
|
const uint16 GameEventWintergraspDefender[2] = {50, 51};
|
||||||
@@ -106,6 +105,7 @@ enum WintergraspCreType
|
|||||||
CREATURE_TURRET,
|
CREATURE_TURRET,
|
||||||
CREATURE_ENGINEER,
|
CREATURE_ENGINEER,
|
||||||
CREATURE_GUARD,
|
CREATURE_GUARD,
|
||||||
|
CREATURE_SPECIAL,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum BuildingType
|
enum BuildingType
|
||||||
@@ -195,9 +195,9 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
void SetData(uint32 id, uint32 value);
|
void SetData(uint32 id, uint32 value);
|
||||||
|
|
||||||
void ModifyWorkshopCount(TeamId team, bool add);
|
void ModifyWorkshopCount(TeamId team, bool add);
|
||||||
uint32 GetTimer() { return m_timer / 1000; };
|
uint32 GetTimer() const { return m_timer / 1000; };
|
||||||
TeamId GetTeam() { return m_defender; };
|
TeamId GetTeam() const { return m_defender; };
|
||||||
bool isWarTime() { return m_wartime; };
|
bool isWarTime() const { return m_wartime; };
|
||||||
protected:
|
protected:
|
||||||
TeamId m_defender;
|
TeamId m_defender;
|
||||||
int32 m_tenacityStack;
|
int32 m_tenacityStack;
|
||||||
@@ -206,7 +206,6 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
BuildingState *m_gate;
|
BuildingState *m_gate;
|
||||||
|
|
||||||
CreatureSet m_creatures;
|
CreatureSet m_creatures;
|
||||||
CreatureSet m_turrets;
|
|
||||||
CreatureSet m_vehicles[2];
|
CreatureSet m_vehicles[2];
|
||||||
GameObjectSet m_gobjects;
|
GameObjectSet m_gobjects;
|
||||||
|
|
||||||
@@ -217,8 +216,8 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
uint32 m_timer;
|
uint32 m_timer;
|
||||||
uint32 m_clock[5];
|
uint32 m_clock[5];
|
||||||
uint32 m_workshopCount[2];
|
uint32 m_workshopCount[2];
|
||||||
uint32 m_towerCount;
|
uint32 m_towerCount[2][2];
|
||||||
uint32 m_towerDamagedCount;
|
|
||||||
uint32 m_customHonorReward[WG_REWARD_EVENT_MAX];
|
uint32 m_customHonorReward[WG_REWARD_EVENT_MAX];
|
||||||
|
|
||||||
SiegeWorkshop *GetWorkshop(uint32 lowguid) const;
|
SiegeWorkshop *GetWorkshop(uint32 lowguid) const;
|
||||||
|
|||||||
+6
-8
@@ -1174,14 +1174,12 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.BattleTime", 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_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] = sConfig.GetBoolDefault("OutdoorPvP.Wintergrasp.CustomHonorRewards", false);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleWin", 3000);
|
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_WIN_BATTLE] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleWin", 3000);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_1] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleLose", 1250);
|
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_LOSE_BATTLE] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleLose", 1250);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_2] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDamageTower", 750);
|
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_TOWER] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDamageTower", 750);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_3] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower", 750);
|
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_DESTROYED_TOWER] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower", 750);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_4] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding", 750);
|
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_BUILDING] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding", 750);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_5] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding", 1500);
|
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_INTACT_BUILDING] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding", 1500);
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_6] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleWinMarks", 3);
|
|
||||||
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_7] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.CustomHonorBattleLoseMarks", 1);
|
|
||||||
|
|
||||||
m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
|
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_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false);
|
||||||
|
|||||||
+6
-8
@@ -242,14 +242,12 @@ enum WorldConfigs
|
|||||||
CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME,
|
CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL,
|
CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR,
|
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0,
|
CONFIG_OUTDOORPVP_WINTERGRASP_WIN_BATTLE,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_1,
|
CONFIG_OUTDOORPVP_WINTERGRASP_LOSE_BATTLE,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_2,
|
CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_TOWER,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_3,
|
CONFIG_OUTDOORPVP_WINTERGRASP_DESTROYED_TOWER,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_4,
|
CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_BUILDING,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_5,
|
CONFIG_OUTDOORPVP_WINTERGRASP_INTACT_BUILDING,
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_6,
|
|
||||||
CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_7,
|
|
||||||
CONFIG_NO_RESET_TALENT_COST,
|
CONFIG_NO_RESET_TALENT_COST,
|
||||||
CONFIG_SHOW_KICK_IN_WORLD,
|
CONFIG_SHOW_KICK_IN_WORLD,
|
||||||
CONFIG_INTERVAL_LOG_UPDATE,
|
CONFIG_INTERVAL_LOG_UPDATE,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
// Format is YYYYMMDDRR where RR is the change in the conf file
|
// Format is YYYYMMDDRR where RR is the change in the conf file
|
||||||
// for that day.
|
// for that day.
|
||||||
#ifndef _TRINITY_CORE_CONFVER
|
#ifndef _TRINITY_CORE_CONFVER
|
||||||
# define _TRINITY_CORE_CONFVER 2009101501
|
# define _TRINITY_CORE_CONFVER 2009101701
|
||||||
#endif //_TRINITY_CORE_CONFVER
|
#endif //_TRINITY_CORE_CONFVER
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
##########################################
|
##########################################
|
||||||
# Trinity Core worldd configuration file #
|
# Trinity Core worldd configuration file #
|
||||||
##########################################
|
##########################################
|
||||||
ConfVersion=2009101501
|
ConfVersion=2009101701
|
||||||
|
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
# CONNECTIONS AND DIRECTORIES
|
# CONNECTIONS AND DIRECTORIES
|
||||||
@@ -1917,27 +1917,27 @@ Ra.Secure = 1
|
|||||||
#
|
#
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorBattleWin
|
# 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.
|
# Defines the amount of honor points that should be given to the team winning the Wintergrasp Battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
||||||
|
# Default: 3000
|
||||||
#
|
#
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorBattleLose
|
# 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.
|
# Defines the amount of honor points that should be given to the team losing the Wintergrasp Battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
||||||
|
# Default: 1250
|
||||||
#
|
#
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorDamageTower
|
# OutdoorPvP.Wintergrasp.CustomHonorDamageTower
|
||||||
# Defines the amount of honor points that should be given to the team for damaging a tower. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
# Defines the amount of honor points that should be given to the team for damaging a tower. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
||||||
|
# Default: 750
|
||||||
#
|
#
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower
|
# OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower
|
||||||
# Defines the amount of honor points that should be given to the team for destroying a tower. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
# Defines the amount of honor points that should be given to the team for destroying a tower. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
||||||
|
# Default: 750
|
||||||
#
|
#
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding
|
# OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding
|
||||||
# Defines the amount of honor points that should be given to the team for damaged buildings after the battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
# Defines the amount of honor points that should be given to the team for damaged buildings after the battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
||||||
|
# Default: 750
|
||||||
#
|
#
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding
|
# OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding
|
||||||
# Defines the amount of honor points that should be given to the team for intact buildings after the battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
# Defines the amount of honor points that should be given to the team for intact buildings after the battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
||||||
#
|
# Default: 1500
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorBattleWinMarks
|
|
||||||
# Defines the amount of wintergrasp reward marks that should be given to the team winning the Wintergrasp Battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
|
||||||
#
|
|
||||||
# OutdoorPvP.Wintergrasp.CustomHonorBattleLoseMarks
|
|
||||||
# Defines the amount of wintergrasp reward marks that should be given to the team losing the Wintergrasp Battle. Requires OutdoorPvP.Wintergrasp.CustomHonorRewards = 1.
|
|
||||||
#
|
#
|
||||||
# ForbiddenMaps
|
# ForbiddenMaps
|
||||||
# map ids that users below SEC_GAMEMASTER cannot enter, with delimiter ','
|
# map ids that users below SEC_GAMEMASTER cannot enter, with delimiter ','
|
||||||
@@ -1997,8 +1997,6 @@ OutdoorPvP.Wintergrasp.CustomHonorDamageTower = 750
|
|||||||
OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower = 750
|
OutdoorPvP.Wintergrasp.CustomHonorDestroyedTower = 750
|
||||||
OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding = 750
|
OutdoorPvP.Wintergrasp.CustomHonorDamagedBuilding = 750
|
||||||
OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding = 1500
|
OutdoorPvP.Wintergrasp.CustomHonorIntactBuilding = 1500
|
||||||
OutdoorPvP.Wintergrasp.CustomHonorBattleWinMarks = 3
|
|
||||||
OutdoorPvP.Wintergrasp.CustomHonorBattleLoseMarks = 1
|
|
||||||
NoResetTalentsCost = 0
|
NoResetTalentsCost = 0
|
||||||
ShowKickInWorld = 0
|
ShowKickInWorld = 0
|
||||||
RecordUpdateTimeDiffInterval = 60000
|
RecordUpdateTimeDiffInterval = 60000
|
||||||
|
|||||||
Reference in New Issue
Block a user