Removing unneeded scripts from zone_zuldrak.cpp (Core scripts for Amphitheatre of anguish chain

removing cpp scripts scripts, please check this as dont know much about c but have just removed everything relating to amphitheatre npcs, or lines 168 - 1143 and 1869,1870,1871,1872,1873,1876 or the complete scripts for all involved npcs and the individual lines from void AddSC_zuldrak
This commit is contained in:
Dr-J
2013-11-24 20:25:49 +00:00
parent 2c307aa67c
commit 96daa553b4
@@ -165,982 +165,6 @@ public:
}
};
/*####
## npc_gurgthock
####*/
enum Gurgthock
{
QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON = 12935,
QUEST_AMPHITHEATER_ANGUISH_KORRAK_BLOODRAGER = 12936,
QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_2 = 12954,
QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1 = 12932,
QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR = 12933,
QUEST_AMPHITHEATER_ANGUISH_FROM_BEYOND = 12934,
NPC_ORINOKO_TUSKBREAKER = 30020,
NPC_KORRAK_BLOODRAGER = 30023,
NPC_YGGDRAS = 30014,
NPC_STINKBEARD = 30017,
NPC_AZ_BARIN = 30026, // air
NPC_DUKE_SINGEN = 30019, // fire
NPC_ERATHIUS = 30025, // earth
NPC_GARGORAL = 30024, // water
NPC_FIEND_WATER = 30044,
NPC_FIEND_AIR = 30045,
NPC_FIEND_FIRE = 30042,
NPC_FIEND_EARTH = 30043,
SAY_QUEST_ACCEPT_TUSKARRMAGEDON = 0,
SAY_QUEST_ACCEPT_KORRAK_1 = 1,
SAY_QUEST_ACCEPT_KORRAK_2 = 2,
SAY_QUEST_ACCEPT_MAGNATAUR = 3,
EMOTE_YGGDRAS_SPAWN = 4,
SAY_STINKBEARD_SPAWN = 5,
SAY_GURGTHOCK_ELEMENTAL_SPAWN = 6,
SAY_GURGTHOCK_7 = 7,
SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS = 8,
SAY_GURGTHOCK_9 = 9,
SAY_CALL_FOR_HELP = 0,
SAY_RECRUIT = 0,
SPELL_CRASHING_WAVE = 55909, // water
SPELL_SHOCKWAVE = 55918, // earth
SPELL_BLAST_OF_AIR = 55912, // air
SPELL_MAGMA_WAVE = 55916, // fire
SPELL_ORB_OF_WATER = 55888, // fiend of water spell
SPELL_ORB_OF_STORMS = 55882, // fiend of air spell
SPELL_BOULDER = 55886, // fiend of earth spell
SPELL_ORB_OF_FLAME = 55872, // fiend of fire spell
};
struct BossAndAdd
{
uint32 uiBoss;
uint32 uiAdd;
uint32 uiSpell;
uint32 uiAddSpell;
};
static BossAndAdd Boss[]=
{
{NPC_GARGORAL, NPC_FIEND_WATER, SPELL_CRASHING_WAVE, SPELL_ORB_OF_WATER},
{NPC_AZ_BARIN, NPC_FIEND_AIR, SPELL_BLAST_OF_AIR, SPELL_ORB_OF_STORMS},
{NPC_DUKE_SINGEN, NPC_FIEND_FIRE, SPELL_MAGMA_WAVE, SPELL_ORB_OF_FLAME},
{NPC_ERATHIUS, NPC_FIEND_EARTH, SPELL_SHOCKWAVE, SPELL_BOULDER},
};
const Position SpawnPosition[] =
{
{5754.692f, -2939.46f, 286.276123f, 5.156380f}, // stinkbeard || orinoko || korrak
{5762.054199f, -2954.385010f, 273.826955f, 5.108289f}, //yggdras
{5776.855f, -2989.77979f, 272.96814f, 5.194f} // elementals
};
const Position AddSpawnPosition[] =
{
{5722.487f, -3010.75f, 312.751648f, 0.478f}, // caster location
{5724.983f, -2969.89551f, 286.359619f, 0.478f},
{5733.76025f, -3000.34644f, 286.359619f, 0.478f},
{5739.8125f, -2981.524f, 290.7671f, 0.478f}, // caster location
{5742.101f, -2950.75586f, 286.2643f, 5.21f},
{5743.305f, -3011.29736f, 290.7671f, 0.478f}, // caster location
{5744.417f, -3025.528f, 286.35965f, 0.478f},
{5763.189f, -3029.67529f, 290.7671f, 0.478f},
{5769.401f, -2935.121f, 286.335754f, 5.21f},
{5793.061f, -2934.593f, 286.359619f, 3.53f},
{5797.32129f, -2955.26855f, 290.7671f, 3.53f}, // caster location
{5813.94531f, -2956.74683f, 286.359619f, 3.53f},
{5816.85547f, -2974.476f, 290.7671f, 3.53f}, // caster location
{5820.30859f, -3002.83716f, 290.7671f, 3.53f}, // caster location
{5828.50244f, -2981.737f, 286.359619f, 3.53f},
{5828.899f, -2960.15479f, 312.751648f, 3.53f}, // caster location
};
class npc_gurgthock : public CreatureScript
{
public:
npc_gurgthock() : CreatureScript("npc_gurgthock") { }
struct npc_gurgthockAI : public ScriptedAI
{
npc_gurgthockAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() OVERRIDE
{
_summonGUID = 0;
_playerGUID = 0;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
uiTimer = 0;
uiPhase = 0;
uiQuest = 0;
uiRemoveFlagTimer = 5000;
_bossRandom = 0;
_removeFlag = false;
}
void SetGUID(uint64 guid, int32 /*id*/) OVERRIDE
{
_playerGUID = guid;
}
void SetData(uint32 type, uint32 data) OVERRIDE
{
_removeFlag = true;
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
switch (type)
{
case 1:
switch (data)
{
case QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON:
Talk(SAY_QUEST_ACCEPT_TUSKARRMAGEDON);
uiPhase = 1;
uiTimer = 4000;
break;
case QUEST_AMPHITHEATER_ANGUISH_KORRAK_BLOODRAGER:
Talk(SAY_QUEST_ACCEPT_KORRAK_1);
uiPhase = 3;
uiTimer = 3000;
break;
case QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_2:
case QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1:
uiPhase = 6;
uiTimer = 3000;
break;
case QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR:
uiTimer = 5000;
uiPhase = 7;
break;
case QUEST_AMPHITHEATER_ANGUISH_FROM_BEYOND:
uiTimer = 2000;
uiPhase = 12;
break;
}
break;
}
}
void UpdateAI(uint32 diff) OVERRIDE
{
ScriptedAI::UpdateAI(diff);
if (_removeFlag)
{
if (uiRemoveFlagTimer <= diff)
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
_removeFlag = false;
uiRemoveFlagTimer = 10000;
} else uiRemoveFlagTimer -= diff;
}
if (uiPhase)
{
if (uiTimer <= diff)
{
switch (uiPhase)
{
case 1:
if (Creature* summon = me->SummonCreature(NPC_ORINOKO_TUSKBREAKER, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
_summonGUID = summon->GetGUID();
uiPhase = 2;
uiTimer = 4000;
break;
case 2:
if (Creature* summon = Unit::GetCreature(*me, _summonGUID))
summon->GetMotionMaster()->MoveJump(5776.319824f, -2981.005371f, 273.100037f, 10.0f, 20.0f);
uiPhase = 0;
_summonGUID = 0;
break;
case 3:
Talk(SAY_QUEST_ACCEPT_KORRAK_2);
uiTimer = 3000;
uiPhase = 4;
break;
case 4:
if (Creature* summon = me->SummonCreature(NPC_KORRAK_BLOODRAGER, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
_summonGUID = summon->GetGUID();
uiTimer = 3000;
uiPhase = 0;
break;
case 6:
Talk(SAY_GURGTHOCK_7, _playerGUID);
uiTimer = 5000;
uiPhase = 9;
break;
case 7:
Talk(SAY_GURGTHOCK_9, _playerGUID);
uiTimer = 3000;
uiPhase = 8;
break;
case 8:
Talk(SAY_QUEST_ACCEPT_MAGNATAUR);
uiTimer = 5000;
uiPhase = 11;
break;
case 9:
Talk(SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS, _playerGUID);
uiTimer = 10000;
uiPhase = 10;
break;
case 10:
me->SummonCreature(NPC_YGGDRAS, SpawnPosition[1], TEMPSUMMON_CORPSE_DESPAWN, 1000);
Talk(EMOTE_YGGDRAS_SPAWN);
uiPhase = 0;
break;
case 11:
if (Creature* creature = me->SummonCreature(NPC_STINKBEARD, SpawnPosition[0], TEMPSUMMON_CORPSE_DESPAWN, 1000))
creature->AI()->Talk(SAY_STINKBEARD_SPAWN);
uiPhase = 0;
break;
case 12:
Talk(SAY_GURGTHOCK_9, _playerGUID);
uiTimer = 5000;
uiPhase = 13;
break;
case 13:
Talk(SAY_GURGTHOCK_ELEMENTAL_SPAWN);
uiTimer = 3000;
uiPhase = 14;
break;
case 14:
_bossRandom = urand(0, 3);
if (Creature* creature = me->SummonCreature(Boss[_bossRandom].uiBoss, SpawnPosition[2], TEMPSUMMON_CORPSE_DESPAWN, 1000))
creature->AI()->SetData(1, _bossRandom);
uiPhase = 0;
break;
}
}
else
uiTimer -= diff;
}
}
private:
bool _removeFlag;
uint8 _bossRandom;
uint64 _summonGUID;
uint64 _playerGUID;
uint32 uiTimer;
uint32 uiPhase;
uint32 uiRemoveFlagTimer;
uint32 uiQuest;
};
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
{
switch (quest->GetQuestId())
{
case QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON:
creature->AI()->SetData(1, quest->GetQuestId());
break;
case QUEST_AMPHITHEATER_ANGUISH_KORRAK_BLOODRAGER:
creature->AI()->SetData(1, quest->GetQuestId());
break;
case QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_2:
case QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1:
creature->AI()->SetData(1, quest->GetQuestId());
break;
case QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR:
creature->AI()->SetData(1, quest->GetQuestId());
break;
case QUEST_AMPHITHEATER_ANGUISH_FROM_BEYOND:
creature->AI()->SetData(1, quest->GetQuestId());
break;
}
creature->AI()->SetGUID(player->GetGUID());
return false;
}
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_gurgthockAI(creature);
}
};
/*####
## npc_orinoko_tuskbreaker
####*/
enum OrinokoTuskbreaker
{
NPC_WHISKER = 30113,
NPC_HUNGRY_PENGUIN = 30110,
SPELL_BATTLE_SHOUT = 32064,
SPELL_FISHY_SCENT = 55937,
SPELL_IMPALE = 55929,
SPELL_SUMMON_WHISKER = 55946
};
class npc_orinoko_tuskbreaker : public CreatureScript
{
public:
npc_orinoko_tuskbreaker() : CreatureScript("npc_orinoko_tuskbreaker") { }
struct npc_orinoko_tuskbreakerAI : public ScriptedAI
{
npc_orinoko_tuskbreakerAI(Creature* creature) : ScriptedAI(creature)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
}
void Reset() OVERRIDE
{
_summoned = false;
_battleShout = false;
_fishyScent = false;
uiBattleShoutTimer = 0;
uiFishyScentTimer = 20000;
_whiskerGUID = 0;
_affectedGUID = 0;
}
void EnterEvadeMode() OVERRIDE
{
if (Creature* whisker = me->GetCreature(*me, _whiskerGUID))
whisker->RemoveFromWorld();
}
void MovementInform(uint32 type, uint32 /*pointId*/) OVERRIDE
{
if (type != EFFECT_MOTION_TYPE)
return;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
uiBattleShoutTimer = 7000;
}
void EnterCombat(Unit* who) OVERRIDE
{
DoCast(who, SPELL_IMPALE);
}
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
if (!_battleShout && uiBattleShoutTimer <= diff)
{
DoCast(me, SPELL_BATTLE_SHOUT);
_battleShout = true;
} else uiBattleShoutTimer -= diff;
if (uiFishyScentTimer <= diff)
{
if (Unit* affected = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(affected, SPELL_FISHY_SCENT);
_affectedGUID = affected->GetGUID();
}
uiFishyScentTimer = 20000;
} else uiFishyScentTimer -= diff;
if (!_summoned && !HealthAbovePct(50))
{
Talk(SAY_CALL_FOR_HELP);
//DoCastVictim(SPELL_SUMMON_WHISKER); petai is not working correctly???
if (Creature* whisker = me->SummonCreature(NPC_WHISKER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
_whiskerGUID = whisker->GetGUID();
_summoned = true;
}
DoMeleeAttackIfReady();
}
void JustSummoned(Creature* summon) OVERRIDE
{
switch (summon->GetEntry())
{
case NPC_WHISKER:
summon->AI()->AttackStart(me->GetVictim());
break;
case NPC_HUNGRY_PENGUIN:
if (Unit* affected = Unit::GetUnit(*me, _affectedGUID))
{
if (affected->IsAlive())
summon->AI()->AttackStart(affected);
}
break;
}
}
void JustDied(Unit* killer) OVERRIDE
{
if (_whiskerGUID)
if (Creature* whisker = me->GetCreature(*me, _whiskerGUID))
whisker->RemoveFromWorld();
if (killer->GetTypeId() == TYPEID_PLAYER)
killer->GetCharmerOrOwnerPlayerOrPlayerItself()->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON, killer);
}
private:
bool _summoned;
bool _battleShout;
bool _fishyScent;
uint32 uiBattleShoutTimer;
uint32 uiFishyScentTimer;
uint64 _affectedGUID;
uint64 _whiskerGUID;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_orinoko_tuskbreakerAI(creature);
}
};
/*####
## npc_korrak_bloodrager
####*/
enum KorrakBloodrager
{
SPELL_GROW = 55948,
SPELL_CHARGE = 24193,
SPELL_UPPERCUT = 30471,
SPELL_ENRAGE = 42745
};
class npc_korrak_bloodrager : public CreatureScript
{
public:
npc_korrak_bloodrager() : CreatureScript("npc_korrak_bloodrager") { }
struct npc_korrak_bloodragerAI : public npc_escortAI
{
npc_korrak_bloodragerAI(Creature* creature) : npc_escortAI(creature)
{
Start(true, true, 0, NULL);
SetDespawnAtEnd(false);
}
void Reset() OVERRIDE
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
_enrage = false;
_chargeTimer = 15000;
_uppercutTimer = 12000;
}
void WaypointReached(uint32 waypointId) OVERRIDE
{
switch (waypointId)
{
case 6:
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
break;
}
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
DoCast(me, SPELL_GROW);
}
void UpdateAI(uint32 diff) OVERRIDE
{
npc_escortAI::UpdateAI(diff);
if (!UpdateVictim())
return;
if (_uppercutTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0))
DoCast(target, SPELL_UPPERCUT);
_uppercutTimer = 12000;
} else _uppercutTimer -= diff;
if (_chargeTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0))
DoCast(target, SPELL_CHARGE);
_chargeTimer = 15000;
} else _chargeTimer -= diff;
if (!_enrage && !HealthAbovePct(20))
{
DoCast(me, SPELL_ENRAGE);
_enrage = true;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer) OVERRIDE
{
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
player->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_KORRAK_BLOODRAGER, killer);
}
private:
bool _enrage;
uint32 _chargeTimer;
uint32 _uppercutTimer;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_korrak_bloodragerAI(creature);
}
};
/*####
## npc_yggdras
####*/
enum Yggdras
{
SPELL_CLEAVE = 40504,
SPELL_CORRODE_FLESH = 57076,
SPELL_JORMUNGAR_SPAWN = 55859
};
class npc_yggdras : public CreatureScript
{
public:
npc_yggdras() : CreatureScript("npc_yggdras") { }
struct npc_yggdrasAI : public ScriptedAI
{
npc_yggdrasAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() OVERRIDE
{
_cleaveTimer = 9000;
_corrodeFleshTimer = 6000;
}
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
if (me->GetVictim()->GetPositionZ() >= 286.276f)
{
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
if (unit->GetPositionZ() <= 286.276f)
{
me->getThreatManager().resetAllAggro();
me->AddThreat(unit, 5.0f);
break;
}
EnterEvadeMode();
}
}
}
if (_cleaveTimer <= diff)
{
DoCastVictim(SPELL_CLEAVE);
_cleaveTimer = 9000;
} else _cleaveTimer -= diff;
if (_corrodeFleshTimer <= diff)
{
DoCastVictim(SPELL_CORRODE_FLESH);
_corrodeFleshTimer = 6000;
} else _corrodeFleshTimer -= diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer) OVERRIDE
{
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
{
std::string sText = (std::string(killer->GetName()) + " has defeated Yg.. Yggg-really big worm!");
summoner->MonsterYell(sText.c_str(), LANG_UNIVERSAL, 0);
}
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
{
player->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1, killer);
player->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_2, killer);
}
for (uint8 i = 0; i < 3; ++i)
DoCast(killer, SPELL_JORMUNGAR_SPAWN, true);
}
private:
uint32 _cleaveTimer;
uint32 _corrodeFleshTimer;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_yggdrasAI(creature);
}
};
/*####
## npc_stinkbeard
####*/
enum Stinkbeard
{
SPELL_ENRAGE_STINKBEARD = 50420,
SPELL_KNOCK_AWAY = 31389,
SPELL_STINKY_BEARD = 55867,
SPELL_THUNDERBLADE = 55866,
SPELL_THUNDERCLAP = 15588
};
class npc_stinkbeard : public CreatureScript
{
public:
npc_stinkbeard() : CreatureScript("npc_stinkbeard") { }
struct npc_stinkbeardAI : public npc_escortAI
{
npc_stinkbeardAI(Creature* creature) : npc_escortAI(creature)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
Start(true, true, 0, NULL);
SetDespawnAtEnd(false);
}
void Reset() OVERRIDE
{
me->AddAura(SPELL_THUNDERBLADE, me);
uiKnockAwayTimer = 10000;
uiStinkyBeardTimer = 15000;
_enrage = false;
_thunderClap = false;
}
void WaypointReached(uint32 waypointId) OVERRIDE
{
switch (waypointId)
{
case 7:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
break;
}
}
void UpdateAI(uint32 uiDiff) OVERRIDE
{
npc_escortAI::UpdateAI(uiDiff);
if (!UpdateVictim())
return;
if (Unit* victim = me->GetVictim())
{
if (victim->GetPositionZ() >= 286.276f)
{
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
if (unit->GetPositionZ() <= 286.276f)
{
me->getThreatManager().resetAllAggro();
me->AddThreat(unit, 5.0f);
break;
}
EnterEvadeMode();
}
}
}
}
if (_thunderClap && !HealthAbovePct(10))
{
DoCastAOE(SPELL_THUNDERCLAP);
_thunderClap = true;
}
if (uiKnockAwayTimer <= uiDiff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (target && target->IsAlive())
DoCast(target, SPELL_KNOCK_AWAY);
}
uiKnockAwayTimer = 10000;
} else uiKnockAwayTimer -= uiDiff;
if (uiStinkyBeardTimer <= uiDiff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (target && target->IsAlive())
DoCast(target, SPELL_STINKY_BEARD);
}
uiStinkyBeardTimer = 15000;
} else uiStinkyBeardTimer -= uiDiff;
if (!_enrage && !HealthAbovePct(20))
{
DoCast(me, SPELL_ENRAGE_STINKBEARD);
_enrage = true;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer) OVERRIDE
{
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
player->GetCharmerOrOwnerPlayerOrPlayerItself()->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR, killer);
std::string sText = ("And with AUTHORITY, " + std::string(killer->GetName()) + " dominates the magnataur lord! Stinkbeard's clan is gonna miss him back home in the Dragonblight!");
me->MonsterYell(sText.c_str(), LANG_UNIVERSAL, 0);
}
private:
bool _enrage;
bool _thunderClap;
uint32 uiKnockAwayTimer;
uint32 uiStinkyBeardTimer;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_stinkbeardAI(creature);
}
};
/*####
## npc_elemental_lord
####*/
class npc_elemental_lord : public CreatureScript
{
public:
npc_elemental_lord() : CreatureScript("npc_elemental_lord") { }
struct npc_elemental_lordAI : public ScriptedAI
{
npc_elemental_lordAI(Creature* creature) : ScriptedAI(creature) { }
std::list<uint64> SummonList;
uint32 uiElementalSpellTimer;
uint8 uiBossRandom;
uint32 uiSpellInfo;
bool bAddAttack;
void Reset() OVERRIDE
{
uiBossRandom = 0;
uiSpellInfo = 0;
uiElementalSpellTimer = urand(5000, 8000);
bAddAttack = false;
}
void SetData(uint32 uiData, uint32 uiValue) OVERRIDE
{
if (uiData == 1)
{
uiBossRandom = uiValue;
SummonAdds();
}
}
void SummonAdds()
{
if (!Boss[uiBossRandom].uiAdd)
return;
SummonList.clear();
for (uint8 uiI = 0; uiI < 16; uiI++)
{
if (Creature* summon = me->SummonCreature(Boss[uiBossRandom].uiAdd, AddSpawnPosition[uiI]))
{
summon->AI()->SetData(1, uiBossRandom);
SummonList.push_back(summon->GetGUID());
}
}
}
void EnterCombat(Unit* unit) OVERRIDE
{
if (!SummonList.empty())
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
if (Creature* temp = Unit::GetCreature(*me, *itr))
{
temp->m_CombatDistance = 100.0f; // ugly hack? we are not in a instance sorry. :(
temp->AI()->AttackStart(unit);
}
}
}
void UpdateAI(uint32 uiDiff) OVERRIDE
{
if (!UpdateVictim())
return;
if (me->GetVictim()->GetPositionZ() >= 286.276f)
{
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
if (unit->GetPositionZ() <= 286.276f)
{
me->getThreatManager().resetAllAggro();
me->AddThreat(unit, 5.0f);
break;
}
EnterEvadeMode();
}
}
}
if (uiElementalSpellTimer <= uiDiff)
{
DoCastVictim(Boss[uiBossRandom].uiSpell);
uiElementalSpellTimer = urand(5000, 8000);
} else uiElementalSpellTimer -= uiDiff;
if (!bAddAttack && !HealthAbovePct(20))
{
if (!SummonList.empty())
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
if (Creature* temp = Unit::GetCreature(*me, *itr))
{
if (temp->GetPositionZ() >= 287.00f)
continue;
if (temp->GetVictim())
temp->GetMotionMaster()->MoveChase(temp->GetVictim());
}
}
bAddAttack = true;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer) OVERRIDE
{
if (!SummonList.empty())
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
if (Creature* temp = Unit::GetCreature(*me, *itr))
temp->DespawnOrUnsummon();
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
player->GetCharmerOrOwnerPlayerOrPlayerItself()->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_FROM_BEYOND, killer);
std::string sText = (std::string(killer->GetName()) + " is victorious once more!");
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
summoner->MonsterYell(sText.c_str(), LANG_UNIVERSAL, 0);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_elemental_lordAI(creature);
}
};
/*####
## npc_fiend_elemental
####*/
class npc_fiend_elemental : public CreatureScript
{
public:
npc_fiend_elemental() : CreatureScript("npc_fiend_elemental") { }
struct npc_fiend_elementalAI : public ScriptedAI
{
npc_fiend_elementalAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() OVERRIDE
{
if (me->GetPositionZ() >= 287.0f)
me->GetMotionMaster()->MoveIdle();
_spell = 0;
_missleTimer = urand(2000, 7000);
}
void AttackStart(Unit* who) OVERRIDE
{
if (!who)
return;
AttackStartNoMove(who);
}
void SetData(uint32 Data, uint32 Value) OVERRIDE
{
if (Data == 1)
_spell = Boss[Value].uiAddSpell;
}
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
if (me->GetPositionZ() >= 287.0f)
{
if (_missleTimer <= diff)
{
if (_spell) // Sometimes it is 0, why?
DoCast(me, _spell); // this spell (what spell) is not supported ... YET!
_missleTimer = urand(2000, 7000);
} else _missleTimer -= diff;
}
DoMeleeAttackIfReady();
}
private:
uint32 _missleTimer;
uint32 _spell;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_fiend_elementalAI(creature);
}
};
/*####
## npc_released_offspring_harkoa
@@ -1866,15 +890,8 @@ void AddSC_zuldrak()
{
new npc_drakuru_shackles();
new npc_captured_rageclaw();
new npc_gurgthock();
new npc_orinoko_tuskbreaker();
new npc_korrak_bloodrager();
new npc_yggdras();
new npc_stinkbeard();
new npc_released_offspring_harkoa();
new npc_crusade_recruit();
new npc_elemental_lord();
new npc_fiend_elemental();
new go_scourge_enclosure();
new npc_alchemist_finklestein();
new go_finklesteins_cauldron();