Scripts/Achievements: add multiple achievement scripts for Strand Of The Ancients.

add kill counter reset related to Battleground achievements.
This commit is contained in:
Supabad
2011-04-17 11:11:40 +02:00
parent e023a32cf3
commit 35c238050a
6 changed files with 122 additions and 41 deletions
@@ -490,6 +490,15 @@ void BattlegroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
}
uint32 BattlegroundSA::GetPlayerDemolisherScore(Player* source)
{
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(source->GetGUID());
if (itr == m_PlayerScores.end()) // player not found...
return 0;
else
return ((BattlegroundSAScore*)itr->second)->demolishers_destroyed;
}
void BattlegroundSA::TeleportPlayers()
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
@@ -554,8 +563,8 @@ void BattlegroundSA::HandleKillUnit(Creature* unit, Player* killer)
{
if (!unit)
return;
if (unit->GetEntry() == 28781) //Demolisher
if (unit->GetEntry() == NPC_DEMOLISHER_SA)
UpdatePlayerScore(killer, SCORE_DESTROYED_DEMOLISHER, 1);
}
@@ -34,64 +34,65 @@ class BattlegroundSAScore : public BattlegroundScore
#define BG_SA_DEMOLISHER_AMOUNT 4
enum BG_SA_Status
{
{
BG_SA_NOTSTARTED = 0,
BG_SA_WARMUP,
BG_SA_ROUND_ONE,
BG_SA_SECOND_WARMUP,
BG_SA_ROUND_TWO,
BG_SA_BONUS_ROUND
};
};
enum BG_SA_GateState
{
{
BG_SA_GATE_OK = 1,
BG_SA_GATE_DAMAGED = 2,
BG_SA_GATE_DESTROYED = 3
};
};
enum BG_SA_Timers
{
BG_SA_BOAT_START = 60000,
BG_SA_WARMUPLENGTH = 120000,
BG_SA_ROUNDLENGTH = 600000
};
{
BG_SA_BOAT_START = 60*IN_MILLISECONDS,
BG_SA_WARMUPLENGTH = 120*IN_MILLISECONDS,
BG_SA_ROUNDLENGTH = 600*IN_MILLISECONDS
};
enum BG_SA_WorldStates
{
{
BG_SA_TIMER_MINS = 3559,
BG_SA_TIMER_SEC_TENS = 3560,
BG_SA_TIMER_SEC_DECS = 3561,
BG_SA_ALLY_ATTACKS = 4352,
BG_SA_HORDE_ATTACKS = 4353,
BG_SA_PURPLE_GATEWS = 3614,
BG_SA_RED_GATEWS = 3617,
BG_SA_BLUE_GATEWS = 3620,
BG_SA_GREEN_GATEWS = 3623,
BG_SA_YELLOW_GATEWS = 3638,
BG_SA_ANCIENT_GATEWS = 3849,
BG_SA_LEFT_GY_ALLIANCE = 3635,
BG_SA_RIGHT_GY_ALLIANCE = 3636,
BG_SA_CENTER_GY_ALLIANCE = 3637,
BG_SA_RIGHT_ATT_TOKEN_ALL = 3627,
BG_SA_LEFT_ATT_TOKEN_ALL = 3626,
BG_SA_LEFT_ATT_TOKEN_HRD = 3629,
BG_SA_RIGHT_ATT_TOKEN_HRD = 3628,
BG_SA_HORDE_DEFENCE_TOKEN = 3631,
BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630,
BG_SA_RIGHT_GY_HORDE = 3632,
BG_SA_LEFT_GY_HORDE = 3633,
BG_SA_CENTER_GY_HORDE = 3634,
BG_SA_BONUS_TIMER = 0xdf3,
BG_SA_ENABLE_TIMER = 3564,
};
};
enum npc
{
NPC_ANTI_PERSONNAL_CANNON = 27894,
NPC_DEMOLISHER_SA = 28781,
NPC_RIGGER_SPARKLIGHT = 29260,
NPC_GORGRIL_RIGSPARK = 29262,
};
enum BG_SA_NPCs
{
@@ -129,30 +130,30 @@ enum BG_SA_Boat
const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] =
{
27894,
27894,
27894,
27894,
27894,
27894,
27894,
27894,
27894,
27894,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
//4 beach demolishers
28781,
28781,
28781,
28781,
NPC_DEMOLISHER_SA,
NPC_DEMOLISHER_SA,
NPC_DEMOLISHER_SA,
NPC_DEMOLISHER_SA,
//Triggers
23472,
23472,
23472,
23472,
23472,
//Fizzle Sparklight, or whatever his name was
29260,
29262
//Used Demolisher Salesman
NPC_RIGGER_SPARKLIGHT,
NPC_GORGRIL_RIGSPARK
};
const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
@@ -430,7 +431,6 @@ class BattlegroundSA : public Battleground
/// Called when battle start
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
/// Called for ini battleground, after that the first player be entered
virtual bool SetupBattleground();
virtual void Reset();
@@ -486,6 +486,8 @@ class BattlegroundSA : public Battleground
/* Scorekeeping */
/// Update score board
uint32 GetPlayerDemolisherScore(Player* /*source*/);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
private: