Scripts/Achievements:
- Move achievement Shocking! to appropriate boss script instead of instance script. - Split the polarity spellscript into two and move to proper boss file - Fixed a typo in Loatheb's spore achievement.
This commit is contained in:
@@ -570,6 +570,7 @@ void AddSC_the_eye();
|
||||
void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
|
||||
void AddSC_boss_nethermancer_sepethrea();
|
||||
void AddSC_boss_pathaleon_the_calculator();
|
||||
void AddSC_boss_mechano_lord_capacitus();
|
||||
void AddSC_instance_mechanar();
|
||||
|
||||
void AddSC_blades_edge_mountains();
|
||||
@@ -1030,6 +1031,7 @@ void AddOutlandScripts()
|
||||
AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
|
||||
AddSC_boss_nethermancer_sepethrea();
|
||||
AddSC_boss_pathaleon_the_calculator();
|
||||
AddSC_boss_mechano_lord_capacitus();
|
||||
AddSC_instance_mechanar();
|
||||
|
||||
AddSC_blades_edge_mountains();
|
||||
|
||||
@@ -82,7 +82,7 @@ class boss_loatheb : public CreatureScript
|
||||
_sporeLoserData = false;
|
||||
}
|
||||
|
||||
uint32 GetData(int32 id)
|
||||
uint32 GetData(uint32 id)
|
||||
{
|
||||
if (id != DATA_ACHIEVEMENT_SPORE_LOSER)
|
||||
return 0;
|
||||
|
||||
@@ -83,7 +83,11 @@ enum ThaddiusSpells
|
||||
SPELL_BALL_LIGHTNING = 28299,
|
||||
SPELL_CHAIN_LIGHTNING = 28167,
|
||||
H_SPELL_CHAIN_LIGHTNING = 54531,
|
||||
SPELL_BERSERK = 27680
|
||||
SPELL_BERSERK = 27680,
|
||||
SPELL_POSITIVE_CHARGE = 28062,
|
||||
SPELL_POSITIVE_CHARGE_STACK = 29659,
|
||||
SPELL_NEGATIVE_CHARGE = 28085,
|
||||
SPELL_NEGATIVE_CHARGE_STACK = 29660
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -94,6 +98,11 @@ enum Events
|
||||
EVENT_BERSERK,
|
||||
};
|
||||
|
||||
enum Achievement
|
||||
{
|
||||
DATA_POLARITY_SWITCH = 76047605,
|
||||
};
|
||||
|
||||
class boss_thaddius : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -135,6 +144,7 @@ public:
|
||||
|
||||
bool checkStalaggAlive;
|
||||
bool checkFeugenAlive;
|
||||
bool polaritySwitch;
|
||||
uint32 uiAddsTimer;
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -194,6 +204,20 @@ public:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void SetData(uint32 id, uint32 data)
|
||||
{
|
||||
if (id == DATA_POLARITY_SWITCH)
|
||||
polaritySwitch = data ? true : false;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 id)
|
||||
{
|
||||
if (id != DATA_POLARITY_SWITCH)
|
||||
return 0;
|
||||
|
||||
return uint32(polaritySwitch);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (checkFeugenAlive && checkStalaggAlive)
|
||||
@@ -409,6 +433,24 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_thaddius_pos_neg_charge_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE_STACK))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE_STACK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleTargets(std::list<Unit*>& targetList)
|
||||
{
|
||||
uint8 count = 0;
|
||||
@@ -417,16 +459,16 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
|
||||
if (Player* target = (*ihit)->ToPlayer())
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
++count;
|
||||
|
||||
if (count)
|
||||
{
|
||||
uint32 spellId = 0;
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case 28062: spellId = 29659; break;
|
||||
case 28085: spellId = 29660; break;
|
||||
case 39090: spellId = 39089; break;
|
||||
case 39093: spellId = 39092; break;
|
||||
}
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
|
||||
spellId = SPELL_POSITIVE_CHARGE_STACK;
|
||||
else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
|
||||
spellId = SPELL_NEGATIVE_CHARGE_STACK;
|
||||
|
||||
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
|
||||
}
|
||||
}
|
||||
@@ -435,14 +477,17 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
|
||||
{
|
||||
if (!GetTriggeringSpell())
|
||||
return;
|
||||
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
SetHitDamage(0);
|
||||
else
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
instance->SetData(DATA_POLARITY_SWITCHED, 1);
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && caster->IsAIEnabled)
|
||||
caster->ToCreature()->AI()->SetData(DATA_POLARITY_SWITCH, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -458,10 +503,22 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_polarity_switch : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_polarity_switch() : AchievementCriteriaScript("achievement_polarity_switch") { }
|
||||
|
||||
bool OnCheck(Player* /*source*/, Unit* target)
|
||||
{
|
||||
return target && target->GetAI()->GetData(DATA_POLARITY_SWITCH);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_thaddius()
|
||||
{
|
||||
new boss_thaddius();
|
||||
new mob_stalagg();
|
||||
new mob_feugen();
|
||||
new spell_thaddius_pos_neg_charge();
|
||||
new achievement_polarity_switch();
|
||||
}
|
||||
|
||||
@@ -148,8 +148,6 @@ public:
|
||||
time_t maxHorsemenDiedTime;
|
||||
|
||||
uint32 playerDied;
|
||||
|
||||
uint32 PolaritySwitch;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
@@ -170,8 +168,6 @@ public:
|
||||
|
||||
playerDied = 0;
|
||||
gothikDoorState = GO_STATE_ACTIVE;
|
||||
|
||||
PolaritySwitch = 0;
|
||||
|
||||
memset(portalsGUID, 0, sizeof(portalsGUID));
|
||||
}
|
||||
@@ -315,9 +311,6 @@ public:
|
||||
case DATA_ABOMINATION_KILLED:
|
||||
AbominationCount = value;
|
||||
break;
|
||||
case DATA_POLARITY_SWITCHED:
|
||||
PolaritySwitch = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,13 +440,6 @@ public:
|
||||
if (AreAllEncoutersDone() && !playerDied)
|
||||
return true;
|
||||
return false;
|
||||
// Criteria for achievement 2178: Shocking! (10-man)
|
||||
case 7604:
|
||||
// Criteria for achievement 2179: Shocking! (25-man)
|
||||
case 7605:
|
||||
if (!PolaritySwitch)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -461,14 +447,14 @@ public:
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << GetBossSaveData() << gothikDoorState << ' ' << playerDied << ' ' << PolaritySwitch;
|
||||
saveStream << GetBossSaveData() << gothikDoorState << ' ' << playerDied;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char * data)
|
||||
{
|
||||
std::istringstream loadStream(LoadBossState(data));
|
||||
uint32 temp, buff, buff2, buff3;
|
||||
uint32 temp, buff, buff2;
|
||||
|
||||
for (uint32 i = 0; i < MAX_BOSS_NUMBER; ++i)
|
||||
loadStream >> temp;
|
||||
@@ -477,8 +463,6 @@ public:
|
||||
gothikDoorState = GOState(buff);
|
||||
loadStream >> buff2;
|
||||
playerDied = buff2;
|
||||
loadStream >> buff3;
|
||||
PolaritySwitch = buff3;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -49,8 +49,6 @@ enum Data
|
||||
DATA_HORSEMEN2,
|
||||
DATA_HORSEMEN3,
|
||||
DATA_ABOMINATION_KILLED,
|
||||
|
||||
DATA_POLARITY_SWITCHED,
|
||||
};
|
||||
|
||||
enum Data64
|
||||
|
||||
@@ -45,6 +45,7 @@ set(scripts_STAT_SRCS
|
||||
Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
|
||||
Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
|
||||
Outland/shattrath_city.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
|
||||
Outland/TempestKeep/Mechanar/mechanar.h
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//! TODO - Boss not scripted, just ported required spellscript from core
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_POSITIVE_CHARGE = 39090,
|
||||
SPELL_POSITIVE_CHARGE_STACK = 39089,
|
||||
SPELL_NEGATIVE_CHARGE = 39093,
|
||||
SPELL_NEGATIVE_CHARGE_STACK = 39092
|
||||
};
|
||||
|
||||
class spell_capacitus_polarity_shift : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
|
||||
|
||||
class spell_capacitus_polarity_shift_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE_STACK))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE_STACK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleTargets(std::list<Unit*>& targetList)
|
||||
{
|
||||
uint8 count = 0;
|
||||
for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
|
||||
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
|
||||
if (Player* target = (*ihit)->ToPlayer())
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
++count;
|
||||
|
||||
if (count)
|
||||
{
|
||||
uint32 spellId = 0;
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
|
||||
spellId = SPELL_POSITIVE_CHARGE_STACK;
|
||||
else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
|
||||
spellId = SPELL_NEGATIVE_CHARGE_STACK;
|
||||
|
||||
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetTriggeringSpell())
|
||||
return;
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
SetHitDamage(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_shift_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_capacitus_polarity_shift_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mechano_lord_capacitus()
|
||||
{
|
||||
new spell_capacitus_polarity_shift();
|
||||
}
|
||||
Reference in New Issue
Block a user