mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 02:53:48 +00:00
refactor(Core/Scripts): restyle scripts lib with astyle (#3467)
This commit is contained in:
@@ -8,122 +8,122 @@
|
||||
|
||||
class instance_blackfathom_deeps : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_blackfathom_deeps() : InstanceMapScript("instance_blackfathom_deeps", 48) { }
|
||||
public:
|
||||
instance_blackfathom_deeps() : InstanceMapScript("instance_blackfathom_deeps", 48) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_blackfathom_deeps_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_blackfathom_deeps_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_blackfathom_deeps_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
return new instance_blackfathom_deeps_InstanceMapScript(map);
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
_akumaiPortalGUID = 0;
|
||||
_requiredDeaths = 0;
|
||||
}
|
||||
|
||||
struct instance_blackfathom_deeps_InstanceMapScript : public InstanceScript
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
instance_blackfathom_deeps_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
if (creature->IsSummon() && (creature->GetEntry() == NPC_BARBED_CRUSTACEAN || creature->GetEntry() == NPC_AKU_MAI_SERVANT ||
|
||||
creature->GetEntry() == NPC_MURKSHALLOW_SOFTSHELL || creature->GetEntry() == NPC_AKU_MAI_SNAPJAW))
|
||||
++_requiredDeaths;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
void OnUnitDeath(Unit* unit)
|
||||
{
|
||||
if (unit->IsSummon() && (unit->GetEntry() == NPC_BARBED_CRUSTACEAN || unit->GetEntry() == NPC_AKU_MAI_SERVANT ||
|
||||
unit->GetEntry() == NPC_MURKSHALLOW_SOFTSHELL || unit->GetEntry() == NPC_AKU_MAI_SNAPJAW))
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
_akumaiPortalGUID = 0;
|
||||
_requiredDeaths = 0;
|
||||
if (--_requiredDeaths == 0)
|
||||
if (_encounters[TYPE_FIRE1] == DONE && _encounters[TYPE_FIRE2] == DONE && _encounters[TYPE_FIRE3] == DONE && _encounters[TYPE_FIRE4] == DONE)
|
||||
HandleGameObject(_akumaiPortalGUID, true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
if (creature->IsSummon() && (creature->GetEntry() == NPC_BARBED_CRUSTACEAN || creature->GetEntry() == NPC_AKU_MAI_SERVANT ||
|
||||
creature->GetEntry() == NPC_MURKSHALLOW_SOFTSHELL || creature->GetEntry() == NPC_AKU_MAI_SNAPJAW))
|
||||
++_requiredDeaths;
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit)
|
||||
{
|
||||
if (unit->IsSummon() && (unit->GetEntry() == NPC_BARBED_CRUSTACEAN || unit->GetEntry() == NPC_AKU_MAI_SERVANT ||
|
||||
unit->GetEntry() == NPC_MURKSHALLOW_SOFTSHELL || unit->GetEntry() == NPC_AKU_MAI_SNAPJAW))
|
||||
{
|
||||
if (--_requiredDeaths == 0)
|
||||
if (_encounters[TYPE_FIRE1] == DONE && _encounters[TYPE_FIRE2] == DONE && _encounters[TYPE_FIRE3] == DONE && _encounters[TYPE_FIRE4] == DONE)
|
||||
HandleGameObject(_akumaiPortalGUID, true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_FIRE_OF_AKU_MAI_1:
|
||||
case GO_FIRE_OF_AKU_MAI_2:
|
||||
case GO_FIRE_OF_AKU_MAI_3:
|
||||
case GO_FIRE_OF_AKU_MAI_4:
|
||||
if (_encounters[gameobject->GetEntry() - GO_FIRE_OF_AKU_MAI_1 + 1] == DONE)
|
||||
{
|
||||
gameobject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
break;
|
||||
case GO_SHRINE_OF_GELIHAST:
|
||||
if (_encounters[TYPE_GELIHAST] == DONE)
|
||||
gameobject->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
case GO_ALTAR_OF_THE_DEEPS:
|
||||
if (_encounters[TYPE_AKU_MAI] == DONE)
|
||||
gameobject->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
case GO_AKU_MAI_DOOR:
|
||||
if (_encounters[TYPE_FIRE1] == DONE && _encounters[TYPE_FIRE2] == DONE && _encounters[TYPE_FIRE3] == DONE && _encounters[TYPE_FIRE4] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
_akumaiPortalGUID = gameobject->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_GELIHAST:
|
||||
case TYPE_FIRE1:
|
||||
case TYPE_FIRE2:
|
||||
case TYPE_FIRE3:
|
||||
case TYPE_FIRE4:
|
||||
case TYPE_AKU_MAI:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "B L " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2] << ' ' << _encounters[3] << ' ' << _encounters[4] << ' ' << _encounters[5];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'B' && dataHead2 == 'L')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
case GO_FIRE_OF_AKU_MAI_1:
|
||||
case GO_FIRE_OF_AKU_MAI_2:
|
||||
case GO_FIRE_OF_AKU_MAI_3:
|
||||
case GO_FIRE_OF_AKU_MAI_4:
|
||||
if (_encounters[gameobject->GetEntry() - GO_FIRE_OF_AKU_MAI_1 + 1] == DONE)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
gameobject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GO_SHRINE_OF_GELIHAST:
|
||||
if (_encounters[TYPE_GELIHAST] == DONE)
|
||||
gameobject->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
case GO_ALTAR_OF_THE_DEEPS:
|
||||
if (_encounters[TYPE_AKU_MAI] == DONE)
|
||||
gameobject->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
case GO_AKU_MAI_DOOR:
|
||||
if (_encounters[TYPE_FIRE1] == DONE && _encounters[TYPE_FIRE2] == DONE && _encounters[TYPE_FIRE3] == DONE && _encounters[TYPE_FIRE4] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
_akumaiPortalGUID = gameobject->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_GELIHAST:
|
||||
case TYPE_FIRE1:
|
||||
case TYPE_FIRE2:
|
||||
case TYPE_FIRE3:
|
||||
case TYPE_FIRE4:
|
||||
case TYPE_AKU_MAI:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
uint64 _akumaiPortalGUID;
|
||||
uint8 _requiredDeaths;
|
||||
};
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "B L " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2] << ' ' << _encounters[3] << ' ' << _encounters[4] << ' ' << _encounters[5];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'B' && dataHead2 == 'L')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
uint64 _akumaiPortalGUID;
|
||||
uint8 _requiredDeaths;
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_blackfathom_deeps()
|
||||
|
||||
@@ -130,7 +130,8 @@ public:
|
||||
|
||||
SwarmTimer = urand(45000, 60000);
|
||||
Talk(SAY_SWARM);
|
||||
} else SwarmTimer -= diff;
|
||||
}
|
||||
else SwarmTimer -= diff;
|
||||
|
||||
if (SleepTimer <= diff)
|
||||
{
|
||||
@@ -141,18 +142,21 @@ public:
|
||||
}
|
||||
SleepTimer = 60000;
|
||||
Talk(SAY_SLEEP);
|
||||
} else SleepTimer -= diff;
|
||||
}
|
||||
else SleepTimer -= diff;
|
||||
if (AuraTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_VAMPIRIC_AURA, true);
|
||||
AuraTimer = urand(10000, 20000);
|
||||
} else AuraTimer -= diff;
|
||||
}
|
||||
else AuraTimer -= diff;
|
||||
if (InfernoTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
|
||||
InfernoTimer = 45000;
|
||||
Talk(SAY_INFERNO);
|
||||
} else InfernoTimer -= diff;
|
||||
}
|
||||
else InfernoTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -224,7 +228,8 @@ public:
|
||||
}
|
||||
}
|
||||
CheckTimer = 5000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
@@ -234,7 +239,8 @@ public:
|
||||
{
|
||||
DoCast(me, SPELL_IMMOLATION);
|
||||
ImmolationTimer = 5000;
|
||||
} else ImmolationTimer -= diff;
|
||||
}
|
||||
else ImmolationTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Archimonde
|
||||
SD%Complete: 85
|
||||
SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented.
|
||||
SDCategory: Caverns of Time, Mount Hyjal
|
||||
EndScriptData */
|
||||
/* ScriptData
|
||||
SDName: Boss_Archimonde
|
||||
SD%Complete: 85
|
||||
SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented.
|
||||
SDCategory: Caverns of Time, Mount Hyjal
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
struct boss_archimondeAI : public BossAI
|
||||
{
|
||||
boss_archimondeAI(Creature* creature) : BossAI(creature, BOSS_ARCHIMONDE), summons(me),
|
||||
Enraged(false), BelowTenPercent(false), HasProtected(false), IsChanneling(false)
|
||||
Enraged(false), BelowTenPercent(false), HasProtected(false), IsChanneling(false)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
return;
|
||||
|
||||
// Now lets get archimode threat list
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
|
||||
if (t_list.empty())
|
||||
return;
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
if (victim && me->IsWithinMeleeRange(victim))
|
||||
return false;
|
||||
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
if (threatlist.empty())
|
||||
return false;
|
||||
|
||||
@@ -493,12 +493,12 @@ public:
|
||||
void SummonDoomfire(Unit* target)
|
||||
{
|
||||
Unit* doomfire1 = me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
|
||||
target->GetPositionX() + 15.0f, target->GetPositionY() + 15.0f, target->GetPositionZ(), 0,
|
||||
TEMPSUMMON_TIMED_DESPAWN, 27000);
|
||||
target->GetPositionX() + 15.0f, target->GetPositionY() + 15.0f, target->GetPositionZ(), 0,
|
||||
TEMPSUMMON_TIMED_DESPAWN, 27000);
|
||||
|
||||
Unit* doomfire2 = me->SummonCreature(CREATURE_DOOMFIRE,
|
||||
target->GetPositionX() - 15.0f, target->GetPositionY() - 15.0f, target->GetPositionZ(), 0,
|
||||
TEMPSUMMON_TIMED_DESPAWN, 27000);
|
||||
target->GetPositionX() - 15.0f, target->GetPositionY() - 15.0f, target->GetPositionZ(), 0,
|
||||
TEMPSUMMON_TIMED_DESPAWN, 27000);
|
||||
|
||||
doomfire1->SetVisible(false);
|
||||
doomfire2->SetVisible(false);
|
||||
@@ -548,7 +548,7 @@ public:
|
||||
me->SetVisible(false);
|
||||
me->setFaction(35);
|
||||
}
|
||||
|
||||
|
||||
if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35)))
|
||||
{
|
||||
me->setFaction(1720);
|
||||
@@ -592,22 +592,22 @@ public:
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_WORLD_TREE_DISTANCE:
|
||||
{
|
||||
// If Archimonde is too close to the world tree this will ENRAGE him
|
||||
Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 2000);
|
||||
if (Check)
|
||||
{
|
||||
Check->SetVisible(false);
|
||||
|
||||
if (me->IsWithinDistInMap(Check, 75))
|
||||
// If Archimonde is too close to the world tree this will ENRAGE him
|
||||
Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 2000);
|
||||
if (Check)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_TOO_CLOSE_TO_WORLD_TREE, 0);
|
||||
break;
|
||||
Check->SetVisible(false);
|
||||
|
||||
if (me->IsWithinDistInMap(Check, 75))
|
||||
{
|
||||
events.ScheduleEvent(EVENT_TOO_CLOSE_TO_WORLD_TREE, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_BELOW_10_PERCENT_HP:
|
||||
DoCastProtection(); // Protection of Elune against Finger and Hand of Death
|
||||
BelowTenPercent = true;
|
||||
@@ -685,29 +685,29 @@ public:
|
||||
|
||||
class spell_red_sky_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_red_sky_effect() : SpellScriptLoader("spell_red_sky_effect") { }
|
||||
public:
|
||||
spell_red_sky_effect() : SpellScriptLoader("spell_red_sky_effect") { }
|
||||
|
||||
class spell_red_sky_effect_SpellScript : public SpellScript
|
||||
class spell_red_sky_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_red_sky_effect_SpellScript);
|
||||
|
||||
void HandleHit(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_red_sky_effect_SpellScript);
|
||||
|
||||
void HandleHit(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetHitUnit())
|
||||
PreventHitDamage();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_red_sky_effect_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_red_sky_effect_SpellScript();
|
||||
if (GetHitUnit())
|
||||
PreventHitDamage();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_red_sky_effect_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_red_sky_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_finger_of_death : public SpellScriptLoader
|
||||
|
||||
@@ -131,26 +131,30 @@ public:
|
||||
if (RainTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true), SPELL_RAIN_OF_FIRE);
|
||||
RainTimer = 20000+rand()%15000;
|
||||
} else RainTimer -= diff;
|
||||
RainTimer = 20000 + rand() % 15000;
|
||||
}
|
||||
else RainTimer -= diff;
|
||||
|
||||
if (DoomTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_DOOM);//never on tank
|
||||
DoomTimer = 45000+rand()%5000;
|
||||
} else DoomTimer -= diff;
|
||||
DoomTimer = 45000 + rand() % 5000;
|
||||
}
|
||||
else DoomTimer -= diff;
|
||||
|
||||
if (HowlTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HOWL_OF_AZGALOR);
|
||||
HowlTimer = 30000;
|
||||
} else HowlTimer -= diff;
|
||||
}
|
||||
else HowlTimer -= diff;
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
CleaveTimer = 10000+rand()%5000;
|
||||
} else CleaveTimer -= diff;
|
||||
CleaveTimer = 10000 + rand() % 5000;
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
|
||||
if (EnrageTimer < diff && !enraged)
|
||||
{
|
||||
@@ -158,7 +162,8 @@ public:
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
enraged = true;
|
||||
EnrageTimer = 600000;
|
||||
} else EnrageTimer -= diff;
|
||||
}
|
||||
else EnrageTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -236,7 +241,8 @@ public:
|
||||
}
|
||||
}
|
||||
CheckTimer = 5000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
@@ -245,14 +251,16 @@ public:
|
||||
if (WarstompTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WARSTOMP);
|
||||
WarstompTimer = 10000+rand()%5000;
|
||||
} else WarstompTimer -= diff;
|
||||
WarstompTimer = 10000 + rand() % 5000;
|
||||
}
|
||||
else WarstompTimer -= diff;
|
||||
|
||||
if (CrippleTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
|
||||
CrippleTimer = 25000+rand()%5000;
|
||||
} else CrippleTimer -= diff;
|
||||
CrippleTimer = 25000 + rand() % 5000;
|
||||
}
|
||||
else CrippleTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -126,14 +126,16 @@ public:
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CLEAVE);
|
||||
CleaveTimer = 6000+rand()%15000;
|
||||
} else CleaveTimer -= diff;
|
||||
CleaveTimer = 6000 + rand() % 15000;
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
|
||||
if (WarStompTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WARSTOMP);
|
||||
WarStompTimer = 60000;
|
||||
} else WarStompTimer -= diff;
|
||||
}
|
||||
else WarStompTimer -= diff;
|
||||
|
||||
if (MarkTimer <= diff)
|
||||
{
|
||||
@@ -144,7 +146,8 @@ public:
|
||||
MarkTimerBase = 5500;
|
||||
MarkTimer = MarkTimerBase;
|
||||
Talk(SAY_MARK);
|
||||
} else MarkTimer -= diff;
|
||||
}
|
||||
else MarkTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -154,62 +157,62 @@ public:
|
||||
|
||||
class spell_mark_of_kazrogal : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { }
|
||||
public:
|
||||
spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { }
|
||||
|
||||
class spell_mark_of_kazrogal_SpellScript : public SpellScript
|
||||
class spell_mark_of_kazrogal_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mark_of_kazrogal_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_mark_of_kazrogal_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(acore::PowerCheck(POWER_MANA, false));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_kazrogal_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_kazrogal_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (target->GetPower(POWER_MANA) == 0)
|
||||
{
|
||||
target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff);
|
||||
// Remove aura
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mark_of_kazrogal_SpellScript();
|
||||
targets.remove_if(acore::PowerCheck(POWER_MANA, false));
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
void Register()
|
||||
{
|
||||
return new spell_mark_of_kazrogal_AuraScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_kazrogal_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_kazrogal_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (target->GetPower(POWER_MANA) == 0)
|
||||
{
|
||||
target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff);
|
||||
// Remove aura
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mark_of_kazrogal_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mark_of_kazrogal_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kazrogal()
|
||||
|
||||
@@ -121,25 +121,29 @@ public:
|
||||
if (FrostArmorTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FROST_ARMOR);
|
||||
FrostArmorTimer = 40000+rand()%20000;
|
||||
} else FrostArmorTimer -= diff;
|
||||
FrostArmorTimer = 40000 + rand() % 20000;
|
||||
}
|
||||
else FrostArmorTimer -= diff;
|
||||
if (DecayTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_DEATH_AND_DECAY);
|
||||
DecayTimer = 60000+rand()%20000;
|
||||
DecayTimer = 60000 + rand() % 20000;
|
||||
Talk(SAY_DECAY);
|
||||
} else DecayTimer -= diff;
|
||||
}
|
||||
else DecayTimer -= diff;
|
||||
if (NovaTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROST_NOVA);
|
||||
NovaTimer = 30000+rand()%15000;
|
||||
NovaTimer = 30000 + rand() % 15000;
|
||||
Talk(SAY_NOVA);
|
||||
} else NovaTimer -= diff;
|
||||
}
|
||||
else NovaTimer -= diff;
|
||||
if (IceboltTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true), SPELL_ICEBOLT);
|
||||
IceboltTimer = 11000+rand()%20000;
|
||||
} else IceboltTimer -= diff;
|
||||
IceboltTimer = 11000 + rand() % 20000;
|
||||
}
|
||||
else IceboltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Hyjal
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
ai->Retreat();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
ai->Debug = !ai->Debug;
|
||||
//TC_LOG_DEBUG("scripts", "HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
@@ -217,13 +217,13 @@ public:
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
|
||||
player->SendNewItem(item, 1, true, false, true);
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
|
||||
player->SendNewItem(item, 1, true, false, true);
|
||||
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ enum Spawns
|
||||
#define YELL_HURRY "Hurry, we don't have much time"
|
||||
|
||||
// Locations for summoning gargoyls and frost wyrms in special cases
|
||||
float SpawnPointSpecial[3][3]=
|
||||
float SpawnPointSpecial[3][3] =
|
||||
{
|
||||
{5497.08f, -2493.23f, 1535.72f}, //spawn point for the gargoyles near the horde gate
|
||||
{5624.53f, -2548.12f, 1551.54f}, //spawn point for the frost wyrm near the horde gate
|
||||
@@ -39,7 +39,7 @@ float SpawnPointSpecial[3][3]=
|
||||
};
|
||||
|
||||
// Locations for summoning waves in Alliance base
|
||||
float AllianceBase[4][3]=
|
||||
float AllianceBase[4][3] =
|
||||
{
|
||||
{4928.48f, -1526.38f, 1326.83f},
|
||||
{4923.54f, -1514.29f, 1327.98f},
|
||||
@@ -47,14 +47,14 @@ float AllianceBase[4][3]=
|
||||
{4938.35f, -1521.00f, 1326.69f}
|
||||
};
|
||||
|
||||
float JainaDummySpawn[2][4]=
|
||||
float JainaDummySpawn[2][4] =
|
||||
{
|
||||
{5497.01f, -2719.03f, 1483.08f, 2.90426f},
|
||||
{5484.98f, -2721.69f, 1483.39f, 6.00656f}
|
||||
};
|
||||
|
||||
// Locations for summoning waves in Horde base
|
||||
float HordeBase[4][3]=
|
||||
float HordeBase[4][3] =
|
||||
{
|
||||
{5458.01f, -2340.27f, 1459.60f},
|
||||
{5466.01f, -2334.69f, 1460.06f},
|
||||
@@ -63,13 +63,13 @@ float HordeBase[4][3]=
|
||||
};
|
||||
|
||||
// Lady Jaina's waypoints when retreathing
|
||||
float JainaWPs[2][3]=
|
||||
float JainaWPs[2][3] =
|
||||
{
|
||||
{5078.56f, -1789.79f, 1320.73f}, //next to the small stairs
|
||||
{5037.38f, -1778.39f, 1322.61f}, //center of alliance base
|
||||
};
|
||||
|
||||
float InfernalPos[8][3]=//spawn points for the infernals in the horde base
|
||||
float InfernalPos[8][3] = //spawn points for the infernals in the horde base
|
||||
{
|
||||
{5453.59f, -2764.52f, 1493.50f},
|
||||
{5478.4f, -2781.77f, 1497.52f},
|
||||
@@ -81,7 +81,7 @@ float InfernalPos[8][3]=//spawn points for the infernals in the horde base
|
||||
{5482.39f, -2689.19f, 1481.09f}
|
||||
};
|
||||
|
||||
float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base used in the cleaning wave
|
||||
float InfernalSPWP[26][4] = //spawn points for the infernals in the horde base used in the cleaning wave
|
||||
{
|
||||
{5490.96f, -2718.72f, 1482.96f, 0.49773f},
|
||||
{5449.51f, -2723.32f, 1485.69f, 2.69685f},
|
||||
@@ -111,7 +111,7 @@ float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base use
|
||||
{5459.78f, -2755.71f, 1490.68f, 1.05139f}
|
||||
};
|
||||
|
||||
float VeinPos[14][8]=//spawn points of the ancient gem veins
|
||||
float VeinPos[14][8] = //spawn points of the ancient gem veins
|
||||
{
|
||||
{5184.84f, -1982.59f, 1382.66f, 2.58079f, 0, 0, 0.960944f, 0.276742f}, //alliance
|
||||
{5107.66f, -2071.16f, 1368.37f, 2.65148f, 0, 0, 0.970124f, 0.242611f}, //alliance
|
||||
@@ -129,7 +129,7 @@ float VeinPos[14][8]=//spawn points of the ancient gem veins
|
||||
{5441.54f, -3321.59f, 1651.55f, 0.258306f, 0, 0, 0.128794f, 0.991671f} //horde
|
||||
};
|
||||
|
||||
float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overrun
|
||||
float AllianceOverrunGargPos[5][4] = //gargoyle spawn points in the alliance overrun
|
||||
{
|
||||
{5279.94f, -2049.68f, 1311.38f, 0}, //garg1
|
||||
{5289.15f, -2219.06f, 1291.12f, 0}, //garg2
|
||||
@@ -138,7 +138,7 @@ float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overr
|
||||
{5120.65f, -2467.92f, 1463.93f, 2.54f}//garg5
|
||||
};
|
||||
|
||||
float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the alliance base
|
||||
float AllianceFirePos[92][8] = //spawn points for the fire visuals (GO) in the alliance base
|
||||
{
|
||||
{5039.9f, -1796.84f, 1323.88f, 2.59222f, 0, 0, 0.962511f, 0.271243f},
|
||||
{5087.2f, -1795.2f, 1320.68f, 1.03946f, 0, 0, 0.496644f, 0.867954f},
|
||||
@@ -230,11 +230,11 @@ float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the all
|
||||
{5195.08f, -2129.01f, 1285.36f, 3.55727f, 0, 0, 0.978480f, -0.206344f},
|
||||
{5353.76f, -2116.28f, 1299.27f, 6.17894f, 0, 0, 0.0521006f, -0.998642f},
|
||||
{5271.14f, -2037.38f, 1299.24f, 4.07879f, 0, 0, 0.892201f, -0.451638f},
|
||||
{5332.5f , -2181.28f, 1279.95f, 4.6906f, 0, 0, 0.714768f, -0.699362f},
|
||||
{5108.2f , -2429.84f, 1427.73f, 4.5194f, 0, 0, 0.771943f, -0.635691f}
|
||||
{5332.5f, -2181.28f, 1279.95f, 4.6906f, 0, 0, 0.714768f, -0.699362f},
|
||||
{5108.2f, -2429.84f, 1427.73f, 4.5194f, 0, 0, 0.771943f, -0.635691f}
|
||||
};
|
||||
|
||||
float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base
|
||||
float HordeFirePos[65][8] = //spawn points for the fire visuals (GO) in the horde base
|
||||
{
|
||||
{5524.11f, -2612.73f, 1483.38f, 1.96198f, 0, 0, 0.831047f, 0.556202f},
|
||||
{5514.42f, -2617.19f, 1505.77f, 1.82453f, 0, 0, 0.790892f, 0.611956f},
|
||||
@@ -308,7 +308,7 @@ hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me)
|
||||
instance = creature->GetInstanceScript();
|
||||
VeinsSpawned[0] = false;
|
||||
VeinsSpawned[1] = false;
|
||||
for (uint8 i=0; i<14; ++i)
|
||||
for (uint8 i = 0; i < 14; ++i)
|
||||
VeinGUID[i] = 0;
|
||||
InfernalCount = 0;
|
||||
TeleportTimer = 1000;
|
||||
@@ -432,7 +432,7 @@ void hyjalAI::MoveInLineOfSight(Unit* who)
|
||||
|
||||
void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||
{
|
||||
uint32 random = rand()%4;
|
||||
uint32 random = rand() % 4;
|
||||
float SpawnLoc[3];
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
@@ -442,38 +442,40 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||
Creature* creature = nullptr;
|
||||
switch (entry)
|
||||
{
|
||||
case 17906: //GARGOYLE
|
||||
case 17906: //GARGOYLE
|
||||
|
||||
if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3))
|
||||
{//summon at tower
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20, 20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20, 20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10, 10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
if (creature)
|
||||
CAST_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
|
||||
}
|
||||
else
|
||||
{//summon at gate
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10, 10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10, 10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10, 10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
}
|
||||
break;
|
||||
case 17907: //FROST_WYRM,
|
||||
if (FirstBossDead && WaveCount == 1) //summon at gate
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0], SpawnPointSpecial[SPAWN_WYRM_GATE][1], SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
else
|
||||
{
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1], SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
if (creature)
|
||||
CAST_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
|
||||
}
|
||||
break;
|
||||
case 17908: //GIANT_INFERNAL
|
||||
++InfernalCount;
|
||||
if (InfernalCount > 7)
|
||||
InfernalCount = 0;
|
||||
creature = me->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
break;
|
||||
default:
|
||||
creature = me->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
break;
|
||||
if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3))
|
||||
{
|
||||
//summon at tower
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0] + irand(-20, 20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1] + irand(-20, 20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2] + irand(-10, 10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
if (creature)
|
||||
CAST_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//summon at gate
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0] + irand(-10, 10), SpawnPointSpecial[SPAWN_GARG_GATE][1] + irand(-10, 10), SpawnPointSpecial[SPAWN_GARG_GATE][2] + irand(-10, 10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
}
|
||||
break;
|
||||
case 17907: //FROST_WYRM,
|
||||
if (FirstBossDead && WaveCount == 1) //summon at gate
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0], SpawnPointSpecial[SPAWN_WYRM_GATE][1], SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
else
|
||||
{
|
||||
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1], SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
if (creature)
|
||||
CAST_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
|
||||
}
|
||||
break;
|
||||
case 17908: //GIANT_INFERNAL
|
||||
++InfernalCount;
|
||||
if (InfernalCount > 7)
|
||||
InfernalCount = 0;
|
||||
creature = me->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
break;
|
||||
default:
|
||||
creature = me->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -517,7 +519,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||
void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
|
||||
{
|
||||
// 1 in 4 chance we give a rally yell. Not sure if the chance is offilike.
|
||||
if (rand()%4 == 0)
|
||||
if (rand() % 4 == 0)
|
||||
Talk(RALLY);
|
||||
|
||||
InfernalCount = 0;//reset infernal count every new wave
|
||||
@@ -531,7 +533,7 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]
|
||||
|
||||
if (!wave[Count].IsBoss)
|
||||
{
|
||||
uint32 stateValue = Count+1;
|
||||
uint32 stateValue = Count + 1;
|
||||
if (FirstBossDead)
|
||||
stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
|
||||
|
||||
@@ -629,21 +631,23 @@ void hyjalAI::SpawnVeins()
|
||||
{
|
||||
if (VeinsSpawned[0])//prevent any buggers
|
||||
return;
|
||||
for (uint8 i = 0; i<7; ++i)
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
{
|
||||
GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
|
||||
if (gem)
|
||||
VeinGUID[i]=gem->GetGUID();
|
||||
VeinGUID[i] = gem->GetGUID();
|
||||
}
|
||||
VeinsSpawned[0] = true;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VeinsSpawned[1])
|
||||
return;
|
||||
for (uint8 i = 7; i<14; ++i)
|
||||
for (uint8 i = 7; i < 14; ++i)
|
||||
{
|
||||
GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
|
||||
if (gem)
|
||||
VeinGUID[i]=gem->GetGUID();
|
||||
VeinGUID[i] = gem->GetGUID();
|
||||
}
|
||||
VeinsSpawned[1] = true;
|
||||
}
|
||||
@@ -653,22 +657,23 @@ void hyjalAI::DeSpawnVeins()
|
||||
{
|
||||
if (Faction == 1)
|
||||
{
|
||||
Creature* unit=ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
|
||||
Creature* unit = ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
|
||||
if (!unit)return;
|
||||
hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
|
||||
if (!ai)return;
|
||||
for (uint8 i = 0; i<7; ++i)
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
{
|
||||
if (GameObject* gem = instance->instance->GetGameObject(ai->VeinGUID[i]))
|
||||
gem->Delete();
|
||||
}
|
||||
} else if (Faction)
|
||||
}
|
||||
else if (Faction)
|
||||
{
|
||||
Creature* unit=ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_THRALL));
|
||||
Creature* unit = ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_THRALL));
|
||||
if (!unit)return;
|
||||
hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
|
||||
if (!ai)return;
|
||||
for (uint8 i = 7; i<14; ++i)
|
||||
for (uint8 i = 7; i < 14; ++i)
|
||||
{
|
||||
if (GameObject* gem = instance->instance->GetGameObject(ai->VeinGUID[i]))
|
||||
gem->Delete();
|
||||
@@ -684,7 +689,8 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
DoCast(me, SPELL_MASS_TELEPORT, false);
|
||||
DoMassTeleport = false;
|
||||
} else MassTeleportTimer -= diff;
|
||||
}
|
||||
else MassTeleportTimer -= diff;
|
||||
return;
|
||||
}
|
||||
if (DoHide)
|
||||
@@ -728,13 +734,16 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
if (Faction == 0)
|
||||
{
|
||||
RespawnNearPos(5037.76f, -1889.71f);
|
||||
} else if (Faction == 1)
|
||||
}
|
||||
else if (Faction == 1)
|
||||
{
|
||||
RespawnNearPos(5563, -2763.19f);
|
||||
RespawnNearPos(5542.2f, -2629.36f);
|
||||
}
|
||||
me->SetVisible(true);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
RespawnTimer -= diff;
|
||||
me->SetVisible(false);
|
||||
}
|
||||
@@ -761,7 +770,8 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
break;
|
||||
}
|
||||
me->SetVisible(false);
|
||||
} else RetreatTimer -= diff;
|
||||
}
|
||||
else RetreatTimer -= diff;
|
||||
}
|
||||
|
||||
if (!EventBegun)
|
||||
@@ -783,7 +793,8 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
else if (Faction == 1)
|
||||
SummonNextWave(HordeWaves, WaveCount, HordeBase);
|
||||
++WaveCount;
|
||||
} else NextWaveTimer -= diff;
|
||||
}
|
||||
else NextWaveTimer -= diff;
|
||||
}
|
||||
|
||||
if (CheckTimer <= diff)
|
||||
@@ -814,7 +825,8 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
}
|
||||
}
|
||||
CheckTimer = 5000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -850,7 +862,8 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
DoCast(target, Spells[i].SpellId);
|
||||
SpellTimer[i] = Spells[i].Cooldown;
|
||||
}
|
||||
} else SpellTimer[i] -= diff;
|
||||
}
|
||||
else SpellTimer[i] -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -944,8 +957,8 @@ void hyjalAI::WaypointReached(uint32 waypointId)
|
||||
acore::AllFriendlyCreaturesInGrid creature_check(me);
|
||||
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
|
||||
TypeContainerVisitor
|
||||
<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>,
|
||||
GridTypeMapContainer> creature_visitor(creature_searcher);
|
||||
<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>,
|
||||
GridTypeMapContainer> creature_visitor(creature_searcher);
|
||||
|
||||
cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
|
||||
|
||||
@@ -963,7 +976,7 @@ void hyjalAI::WaypointReached(uint32 waypointId)
|
||||
float range = 10;
|
||||
if (me->GetEntry() == THRALL)range = 20;
|
||||
me->GetNearPoint(me, x, y, z, range, 0, me->GetAngle((*itr)));
|
||||
(*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5, 5), y+irand(-5, 5), me->GetPositionZ());
|
||||
(*itr)->GetMotionMaster()->MovePoint(0, x + irand(-5, 5), y + irand(-5, 5), me->GetPositionZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -984,8 +997,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
acore::AllFriendlyCreaturesInGrid creature_check(me);
|
||||
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
|
||||
TypeContainerVisitor
|
||||
<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>,
|
||||
GridTypeMapContainer> creature_visitor(creature_searcher);
|
||||
<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>,
|
||||
GridTypeMapContainer> creature_visitor(creature_searcher);
|
||||
|
||||
cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
|
||||
|
||||
@@ -1007,7 +1020,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
|
||||
WaitForTeleport = false;
|
||||
Teleported = true;
|
||||
}TeleportTimer -= diff;
|
||||
}
|
||||
TeleportTimer -= diff;
|
||||
}
|
||||
if (!Teleported)
|
||||
return;
|
||||
@@ -1020,8 +1034,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
|
||||
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
Creature* unit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
|
||||
uint8 r = rand() % 4;
|
||||
Creature* unit = me->SummonCreature(GHOUL, AllianceBase[r][0] + irand(-15, 15), AllianceBase[r][1] + irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2 * 60 * 1000);
|
||||
if (unit)
|
||||
{
|
||||
CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction;
|
||||
@@ -1032,8 +1046,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
}
|
||||
for (uint8 i = 0; i < 3; ++i)//summon 3 abominations
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
Creature* unit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
|
||||
uint8 r = rand() % 4;
|
||||
Creature* unit = me->SummonCreature(ABOMINATION, AllianceBase[r][0] + irand(-15, 15), AllianceBase[r][1] + irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2 * 60 * 1000);
|
||||
if (unit)
|
||||
{
|
||||
CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction;
|
||||
@@ -1044,7 +1058,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
}
|
||||
for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles
|
||||
{
|
||||
Creature* unit = me->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
|
||||
Creature* unit = me->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2 * 60 * 1000);
|
||||
if (unit)
|
||||
{
|
||||
unit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]);
|
||||
@@ -1061,7 +1075,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
|
||||
for (uint8 i = 0; i < 26; ++i)//summon infernals
|
||||
{
|
||||
Creature* unit = me->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
|
||||
Creature* unit = me->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2 * 60 * 1000);
|
||||
if (unit)
|
||||
{
|
||||
unit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]);
|
||||
@@ -1073,8 +1087,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
}
|
||||
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
Creature* unit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
|
||||
uint8 r = rand() % 4;
|
||||
Creature* unit = me->SummonCreature(GHOUL, HordeBase[r][0] + irand(-15, 15), HordeBase[r][1] + irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2 * 60 * 1000);
|
||||
if (unit)
|
||||
{
|
||||
CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction;
|
||||
@@ -1085,8 +1099,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
}
|
||||
for (uint8 i = 0; i < 5; ++i)//summon 5 abominations
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
Creature* unit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
|
||||
uint8 r = rand() % 4;
|
||||
Creature* unit = me->SummonCreature(ABOMINATION, HordeBase[r][0] + irand(-15, 15), HordeBase[r][1] + irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2 * 60 * 1000);
|
||||
if (unit)
|
||||
{
|
||||
CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction;
|
||||
|
||||
@@ -35,8 +35,9 @@ struct Wave
|
||||
bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that
|
||||
};
|
||||
|
||||
const Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
|
||||
{ // Rage Winterchill Wave 1-8
|
||||
const Wave AllianceWaves[] = // Waves that will be summoned in the Alliance Base
|
||||
{
|
||||
// Rage Winterchill Wave 1-8
|
||||
{{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
|
||||
{{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0}, 120000, false},
|
||||
{{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0}, 120000, false},
|
||||
@@ -60,8 +61,9 @@ const Wave AllianceWaves[]= // Waves that will be
|
||||
{{ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
|
||||
};
|
||||
|
||||
const Wave HordeWaves[]= // Waves that are summoned in the Horde base
|
||||
{ // Kaz'Rogal Wave 1-8
|
||||
const Wave HordeWaves[] = // Waves that are summoned in the Horde base
|
||||
{
|
||||
// Kaz'Rogal Wave 1-8
|
||||
{{GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 180000, false},
|
||||
{{GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0}, 180000, false},
|
||||
{{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0}, 180000, false},
|
||||
@@ -136,61 +138,61 @@ struct hyjalAI : public npc_escortAI
|
||||
|
||||
void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
|
||||
|
||||
// Summons the next wave, calls SummonCreature
|
||||
// Summons the next wave, calls SummonCreature
|
||||
void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]);
|
||||
|
||||
void StartEvent(Player* player); // Begins the event by gossip click
|
||||
|
||||
uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase
|
||||
|
||||
public:
|
||||
InstanceScript* instance;
|
||||
public:
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 PlayerGUID;
|
||||
uint64 BossGUID[2];
|
||||
uint64 VeinGUID[14];
|
||||
uint64 PlayerGUID;
|
||||
uint64 BossGUID[2];
|
||||
uint64 VeinGUID[14];
|
||||
|
||||
uint32 NextWaveTimer;
|
||||
uint32 WaveCount;
|
||||
uint32 CheckTimer;
|
||||
uint32 Faction;
|
||||
uint32 EnemyCount;
|
||||
uint32 RetreatTimer;
|
||||
uint32 NextWaveTimer;
|
||||
uint32 WaveCount;
|
||||
uint32 CheckTimer;
|
||||
uint32 Faction;
|
||||
uint32 EnemyCount;
|
||||
uint32 RetreatTimer;
|
||||
|
||||
bool EventBegun;
|
||||
bool FirstBossDead;
|
||||
bool SecondBossDead;
|
||||
bool Summon;
|
||||
bool bRetreat;
|
||||
bool Debug;
|
||||
bool VeinsSpawned[2];
|
||||
uint8 InfernalCount;
|
||||
SummonList Summons;
|
||||
bool Overrun;
|
||||
bool Teleported;
|
||||
bool WaitForTeleport;
|
||||
uint32 TeleportTimer;
|
||||
uint32 OverrunCounter;
|
||||
uint32 OverrunCounter2;
|
||||
uint32 InfernalPoint;
|
||||
uint32 RespawnTimer;
|
||||
bool DoRespawn;
|
||||
bool DoHide;
|
||||
bool IsDummy;
|
||||
uint32 MassTeleportTimer;
|
||||
bool DoMassTeleport;
|
||||
uint64 DummyGuid;
|
||||
bool EventBegun;
|
||||
bool FirstBossDead;
|
||||
bool SecondBossDead;
|
||||
bool Summon;
|
||||
bool bRetreat;
|
||||
bool Debug;
|
||||
bool VeinsSpawned[2];
|
||||
uint8 InfernalCount;
|
||||
SummonList Summons;
|
||||
bool Overrun;
|
||||
bool Teleported;
|
||||
bool WaitForTeleport;
|
||||
uint32 TeleportTimer;
|
||||
uint32 OverrunCounter;
|
||||
uint32 OverrunCounter2;
|
||||
uint32 InfernalPoint;
|
||||
uint32 RespawnTimer;
|
||||
bool DoRespawn;
|
||||
bool DoHide;
|
||||
bool IsDummy;
|
||||
uint32 MassTeleportTimer;
|
||||
bool DoMassTeleport;
|
||||
uint64 DummyGuid;
|
||||
|
||||
struct Spell
|
||||
{
|
||||
uint32 SpellId;
|
||||
uint32 Cooldown;
|
||||
uint32 TargetType;
|
||||
} Spells[HYJAL_AI_MAX_SPELLS];
|
||||
struct Spell
|
||||
{
|
||||
uint32 SpellId;
|
||||
uint32 Cooldown;
|
||||
uint32 TargetType;
|
||||
} Spells[HYJAL_AI_MAX_SPELLS];
|
||||
|
||||
private:
|
||||
uint32 SpellTimer[3];
|
||||
//std::list<uint64> CreatureList;
|
||||
private:
|
||||
uint32 SpellTimer[3];
|
||||
//std::list<uint64> CreatureList;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ enum Spells
|
||||
SPELL_EXPLODING_SHOT = 7896,
|
||||
};
|
||||
|
||||
float HordeWPs[8][3]=//basic waypoints from spawn to leader
|
||||
float HordeWPs[8][3] = //basic waypoints from spawn to leader
|
||||
{
|
||||
{5492.91f, -2404.61f, 1462.63f},
|
||||
{5531.76f, -2460.87f, 1469.55f},
|
||||
@@ -45,7 +45,7 @@ float HordeWPs[8][3]=//basic waypoints from spawn to leader
|
||||
{5489.62f, -2704.05f, 1482.18f},
|
||||
{5457.04f, -2726.26f, 1485.10f}
|
||||
};
|
||||
float AllianceWPs[8][3]=//basic waypoints from spawn to leader
|
||||
float AllianceWPs[8][3] = //basic waypoints from spawn to leader
|
||||
{
|
||||
{4896.08f, -1576.35f, 1333.65f},
|
||||
{4898.68f, -1615.02f, 1329.48f},
|
||||
@@ -57,28 +57,28 @@ float AllianceWPs[8][3]=//basic waypoints from spawn to leader
|
||||
{5067.23f, -1789.95f, 1321.17f}
|
||||
};
|
||||
|
||||
float FrostWyrmWPs[3][3]=//waypoints for the frost wyrms in horde base
|
||||
float FrostWyrmWPs[3][3] = //waypoints for the frost wyrms in horde base
|
||||
{
|
||||
{5580.82f, -2628.83f, 1528.28f},
|
||||
{5550.90f, -2667.16f, 1505.45f},
|
||||
{5459.64f, -2725.91f, 1484.83f}
|
||||
};
|
||||
|
||||
float GargoyleWPs[3][3]=//waypoints for the gargoyles in horde base
|
||||
float GargoyleWPs[3][3] = //waypoints for the gargoyles in horde base
|
||||
{
|
||||
{5533.66f, -2634.32f, 1495.33f},
|
||||
{5517.88f, -2712.05f, 1490.54f},
|
||||
{5459.64f, -2725.91f, 1484.83f}
|
||||
};
|
||||
|
||||
float FlyPathWPs[3][3]=//waypoints for the gargoyls and frost wyrms in horde base in wave 1/3
|
||||
float FlyPathWPs[3][3] = //waypoints for the gargoyls and frost wyrms in horde base in wave 1/3
|
||||
{
|
||||
{5531.96f, -2772.83f, 1516.68f},
|
||||
{5498.32f, -2734.84f, 1497.01f},
|
||||
{5456.67f, -2725.48f, 1493.08f}
|
||||
};
|
||||
|
||||
float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end in the cleaning wave
|
||||
float AllianceOverrunWP[55][3] = //waypoints in the alliance base used in the end in the cleaning wave
|
||||
{
|
||||
{4976.37f, -1708.02f, 1339.43f}, //0spawn
|
||||
{4994.83f, -1725.52f, 1333.25f}, //1 start
|
||||
@@ -138,7 +138,7 @@ float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end
|
||||
|
||||
};
|
||||
|
||||
float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the cleaning wave
|
||||
float HordeOverrunWP[21][3] = //waypoints in the horde base used in the end in the cleaning wave
|
||||
{
|
||||
{5490.72f, -2702.94f, 1482.14f}, //0 start
|
||||
{5469.77f, -2741.34f, 1486.95f},
|
||||
@@ -179,7 +179,7 @@ hyjal_trashAI::hyjal_trashAI(Creature* creature) : npc_escortAI(creature)
|
||||
Reset();
|
||||
}
|
||||
|
||||
void hyjal_trashAI::DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void hyjal_trashAI::DamageTaken(Unit* done_by, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (done_by && (done_by->GetTypeId() == TYPEID_PLAYER || done_by->IsPet()))
|
||||
{
|
||||
@@ -197,63 +197,63 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
{
|
||||
if (me->GetEntry() == GARGOYLE)
|
||||
{
|
||||
DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4
|
||||
DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1];
|
||||
DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2];
|
||||
DummyTarget[0] = AllianceOverrunWP[50 + OverrunType][0]; //+OverrunType 0 - 4
|
||||
DummyTarget[1] = AllianceOverrunWP[50 + OverrunType][1];
|
||||
DummyTarget[2] = AllianceOverrunWP[50 + OverrunType][2];
|
||||
}
|
||||
if (me->GetEntry() == ABOMINATION)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
switch (OverrunType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3, 3), AllianceOverrunWP[22][1]+irand(-3, 3), AllianceOverrunWP[22][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3, 3), AllianceOverrunWP[23][1]+irand(-3, 3), AllianceOverrunWP[23][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3, 3), AllianceOverrunWP[24][1]+irand(-3, 3), AllianceOverrunWP[24][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3, 3), AllianceOverrunWP[25][1]+irand(-3, 3), AllianceOverrunWP[25][2]);
|
||||
AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3, 3), AllianceOverrunWP[26][1]+irand(-3, 3), AllianceOverrunWP[26][2]);
|
||||
AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3, 3), AllianceOverrunWP[27][1]+irand(-3, 3), AllianceOverrunWP[27][2]);
|
||||
AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3, 3), AllianceOverrunWP[28][1]+irand(-3, 3), AllianceOverrunWP[28][2]);
|
||||
AddWaypoint(4, AllianceOverrunWP[22][0] + irand(-3, 3), AllianceOverrunWP[22][1] + irand(-3, 3), AllianceOverrunWP[22][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[23][0] + irand(-3, 3), AllianceOverrunWP[23][1] + irand(-3, 3), AllianceOverrunWP[23][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[24][0] + irand(-3, 3), AllianceOverrunWP[24][1] + irand(-3, 3), AllianceOverrunWP[24][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[25][0] + irand(-3, 3), AllianceOverrunWP[25][1] + irand(-3, 3), AllianceOverrunWP[25][2]);
|
||||
AddWaypoint(8, AllianceOverrunWP[26][0] + irand(-3, 3), AllianceOverrunWP[26][1] + irand(-3, 3), AllianceOverrunWP[26][2]);
|
||||
AddWaypoint(9, AllianceOverrunWP[27][0] + irand(-3, 3), AllianceOverrunWP[27][1] + irand(-3, 3), AllianceOverrunWP[27][2]);
|
||||
AddWaypoint(10, AllianceOverrunWP[28][0] + irand(-3, 3), AllianceOverrunWP[28][1] + irand(-3, 3), AllianceOverrunWP[28][2]);
|
||||
|
||||
AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3, 3), AllianceOverrunWP[36][1]+irand(-3, 3), AllianceOverrunWP[36][2]);
|
||||
AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3, 3), AllianceOverrunWP[37][1]+irand(-3, 3), AllianceOverrunWP[37][2]);
|
||||
AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3, 3), AllianceOverrunWP[38][1]+irand(-3, 3), AllianceOverrunWP[38][2]);
|
||||
AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3, 3), AllianceOverrunWP[39][1]+irand(-3, 3), AllianceOverrunWP[39][2]);
|
||||
AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3, 3), AllianceOverrunWP[40][1]+irand(-3, 3), AllianceOverrunWP[40][2]);
|
||||
AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3, 3), AllianceOverrunWP[41][1]+irand(-3, 3), AllianceOverrunWP[41][2]);
|
||||
AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3, 3), AllianceOverrunWP[42][1]+irand(-3, 3), AllianceOverrunWP[42][2]);
|
||||
AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3, 3), AllianceOverrunWP[43][1]+irand(-3, 3), AllianceOverrunWP[43][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3, 3), AllianceOverrunWP[43][1]+irand(-3, 3), AllianceOverrunWP[43][2], 0);
|
||||
AddWaypoint(11, AllianceOverrunWP[36][0] + irand(-3, 3), AllianceOverrunWP[36][1] + irand(-3, 3), AllianceOverrunWP[36][2]);
|
||||
AddWaypoint(12, AllianceOverrunWP[37][0] + irand(-3, 3), AllianceOverrunWP[37][1] + irand(-3, 3), AllianceOverrunWP[37][2]);
|
||||
AddWaypoint(13, AllianceOverrunWP[38][0] + irand(-3, 3), AllianceOverrunWP[38][1] + irand(-3, 3), AllianceOverrunWP[38][2]);
|
||||
AddWaypoint(14, AllianceOverrunWP[39][0] + irand(-3, 3), AllianceOverrunWP[39][1] + irand(-3, 3), AllianceOverrunWP[39][2]);
|
||||
AddWaypoint(15, AllianceOverrunWP[40][0] + irand(-3, 3), AllianceOverrunWP[40][1] + irand(-3, 3), AllianceOverrunWP[40][2]);
|
||||
AddWaypoint(16, AllianceOverrunWP[41][0] + irand(-3, 3), AllianceOverrunWP[41][1] + irand(-3, 3), AllianceOverrunWP[41][2]);
|
||||
AddWaypoint(17, AllianceOverrunWP[42][0] + irand(-3, 3), AllianceOverrunWP[42][1] + irand(-3, 3), AllianceOverrunWP[42][2]);
|
||||
AddWaypoint(18, AllianceOverrunWP[43][0] + irand(-3, 3), AllianceOverrunWP[43][1] + irand(-3, 3), AllianceOverrunWP[43][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[43][0] + irand(-3, 3), AllianceOverrunWP[43][1] + irand(-3, 3), AllianceOverrunWP[43][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 18;
|
||||
Start(true, true);
|
||||
break;
|
||||
case 1:
|
||||
AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3, 3), AllianceOverrunWP[22][1]+irand(-3, 3), AllianceOverrunWP[22][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3, 3), AllianceOverrunWP[23][1]+irand(-3, 3), AllianceOverrunWP[23][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3, 3), AllianceOverrunWP[24][1]+irand(-3, 3), AllianceOverrunWP[24][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3, 3), AllianceOverrunWP[25][1]+irand(-3, 3), AllianceOverrunWP[25][2]);
|
||||
AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3, 3), AllianceOverrunWP[26][1]+irand(-3, 3), AllianceOverrunWP[26][2]);
|
||||
AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3, 3), AllianceOverrunWP[27][1]+irand(-3, 3), AllianceOverrunWP[27][2]);
|
||||
AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3, 3), AllianceOverrunWP[28][1]+irand(-3, 3), AllianceOverrunWP[28][2]);
|
||||
case 1:
|
||||
AddWaypoint(4, AllianceOverrunWP[22][0] + irand(-3, 3), AllianceOverrunWP[22][1] + irand(-3, 3), AllianceOverrunWP[22][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[23][0] + irand(-3, 3), AllianceOverrunWP[23][1] + irand(-3, 3), AllianceOverrunWP[23][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[24][0] + irand(-3, 3), AllianceOverrunWP[24][1] + irand(-3, 3), AllianceOverrunWP[24][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[25][0] + irand(-3, 3), AllianceOverrunWP[25][1] + irand(-3, 3), AllianceOverrunWP[25][2]);
|
||||
AddWaypoint(8, AllianceOverrunWP[26][0] + irand(-3, 3), AllianceOverrunWP[26][1] + irand(-3, 3), AllianceOverrunWP[26][2]);
|
||||
AddWaypoint(9, AllianceOverrunWP[27][0] + irand(-3, 3), AllianceOverrunWP[27][1] + irand(-3, 3), AllianceOverrunWP[27][2]);
|
||||
AddWaypoint(10, AllianceOverrunWP[28][0] + irand(-3, 3), AllianceOverrunWP[28][1] + irand(-3, 3), AllianceOverrunWP[28][2]);
|
||||
|
||||
AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3, 3), AllianceOverrunWP[36][1]+irand(-3, 3), AllianceOverrunWP[36][2]);
|
||||
AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3, 3), AllianceOverrunWP[37][1]+irand(-3, 3), AllianceOverrunWP[37][2]);
|
||||
AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3, 3), AllianceOverrunWP[38][1]+irand(-3, 3), AllianceOverrunWP[38][2]);
|
||||
AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3, 3), AllianceOverrunWP[39][1]+irand(-3, 3), AllianceOverrunWP[39][2]);
|
||||
AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3, 3), AllianceOverrunWP[40][1]+irand(-3, 3), AllianceOverrunWP[40][2]);
|
||||
AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3, 3), AllianceOverrunWP[41][1]+irand(-3, 3), AllianceOverrunWP[41][2]);
|
||||
AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3, 3), AllianceOverrunWP[42][1]+irand(-3, 3), AllianceOverrunWP[42][2]);
|
||||
AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3, 3), AllianceOverrunWP[44][1]+irand(-3, 3), AllianceOverrunWP[44][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3, 3), AllianceOverrunWP[44][1]+irand(-3, 3), AllianceOverrunWP[44][2], 0);
|
||||
AddWaypoint(11, AllianceOverrunWP[36][0] + irand(-3, 3), AllianceOverrunWP[36][1] + irand(-3, 3), AllianceOverrunWP[36][2]);
|
||||
AddWaypoint(12, AllianceOverrunWP[37][0] + irand(-3, 3), AllianceOverrunWP[37][1] + irand(-3, 3), AllianceOverrunWP[37][2]);
|
||||
AddWaypoint(13, AllianceOverrunWP[38][0] + irand(-3, 3), AllianceOverrunWP[38][1] + irand(-3, 3), AllianceOverrunWP[38][2]);
|
||||
AddWaypoint(14, AllianceOverrunWP[39][0] + irand(-3, 3), AllianceOverrunWP[39][1] + irand(-3, 3), AllianceOverrunWP[39][2]);
|
||||
AddWaypoint(15, AllianceOverrunWP[40][0] + irand(-3, 3), AllianceOverrunWP[40][1] + irand(-3, 3), AllianceOverrunWP[40][2]);
|
||||
AddWaypoint(16, AllianceOverrunWP[41][0] + irand(-3, 3), AllianceOverrunWP[41][1] + irand(-3, 3), AllianceOverrunWP[41][2]);
|
||||
AddWaypoint(17, AllianceOverrunWP[42][0] + irand(-3, 3), AllianceOverrunWP[42][1] + irand(-3, 3), AllianceOverrunWP[42][2]);
|
||||
AddWaypoint(18, AllianceOverrunWP[44][0] + irand(-3, 3), AllianceOverrunWP[44][1] + irand(-3, 3), AllianceOverrunWP[44][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[44][0] + irand(-3, 3), AllianceOverrunWP[44][1] + irand(-3, 3), AllianceOverrunWP[44][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 18;
|
||||
Start(true, true);
|
||||
break;
|
||||
default:
|
||||
for (uint8 i = 22; i < 36; ++i)
|
||||
AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3, 3), AllianceOverrunWP[i][1]+irand(-3, 3), AllianceOverrunWP[i][2]);
|
||||
AddWaypoint(i - 18, AllianceOverrunWP[i][0] + irand(-3, 3), AllianceOverrunWP[i][1] + irand(-3, 3), AllianceOverrunWP[i][2]);
|
||||
|
||||
SetDespawnAtEnd(true);
|
||||
LastOverronPos = 17;
|
||||
@@ -264,69 +264,69 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
if (me->GetEntry() == GHOUL)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
switch (OverrunType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3, 3), AllianceOverrunWP[1][1]+irand(-3, 3), AllianceOverrunWP[1][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3, 3), AllianceOverrunWP[2][1]+irand(-3, 3), AllianceOverrunWP[2][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3, 3), AllianceOverrunWP[2][1]+irand(-3, 3), AllianceOverrunWP[2][2], 0);
|
||||
AddWaypoint(4, AllianceOverrunWP[1][0] + irand(-3, 3), AllianceOverrunWP[1][1] + irand(-3, 3), AllianceOverrunWP[1][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[2][0] + irand(-3, 3), AllianceOverrunWP[2][1] + irand(-3, 3), AllianceOverrunWP[2][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[2][0] + irand(-3, 3), AllianceOverrunWP[2][1] + irand(-3, 3), AllianceOverrunWP[2][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 5;
|
||||
Start(true, true);
|
||||
break;
|
||||
case 1:
|
||||
AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3, 3), AllianceOverrunWP[3][1]+irand(-3, 3), AllianceOverrunWP[3][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3, 3), AllianceOverrunWP[4][1]+irand(-3, 3), AllianceOverrunWP[4][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3, 3), AllianceOverrunWP[5][1]+irand(-3, 3), AllianceOverrunWP[5][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3, 3), AllianceOverrunWP[5][1]+irand(-3, 3), AllianceOverrunWP[5][2], 0);
|
||||
AddWaypoint(4, AllianceOverrunWP[3][0] + irand(-3, 3), AllianceOverrunWP[3][1] + irand(-3, 3), AllianceOverrunWP[3][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[4][0] + irand(-3, 3), AllianceOverrunWP[4][1] + irand(-3, 3), AllianceOverrunWP[4][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[5][0] + irand(-3, 3), AllianceOverrunWP[5][1] + irand(-3, 3), AllianceOverrunWP[5][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[5][0] + irand(-3, 3), AllianceOverrunWP[5][1] + irand(-3, 3), AllianceOverrunWP[5][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 6;
|
||||
Start(true, true);
|
||||
break;
|
||||
case 2:
|
||||
AddWaypoint(4, AllianceOverrunWP[6][0]+irand(-3, 3), AllianceOverrunWP[6][1]+irand(-3, 3), AllianceOverrunWP[6][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3, 3), AllianceOverrunWP[7][1]+irand(-3, 3), AllianceOverrunWP[7][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3, 3), AllianceOverrunWP[8][1]+irand(-3, 3), AllianceOverrunWP[8][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3, 3), AllianceOverrunWP[9][1]+irand(-3, 3), AllianceOverrunWP[9][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3, 3), AllianceOverrunWP[9][1]+irand(-3, 3), AllianceOverrunWP[9][2], 0);
|
||||
AddWaypoint(4, AllianceOverrunWP[6][0] + irand(-3, 3), AllianceOverrunWP[6][1] + irand(-3, 3), AllianceOverrunWP[6][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[7][0] + irand(-3, 3), AllianceOverrunWP[7][1] + irand(-3, 3), AllianceOverrunWP[7][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[8][0] + irand(-3, 3), AllianceOverrunWP[8][1] + irand(-3, 3), AllianceOverrunWP[8][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[9][0] + irand(-3, 3), AllianceOverrunWP[9][1] + irand(-3, 3), AllianceOverrunWP[9][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[9][0] + irand(-3, 3), AllianceOverrunWP[9][1] + irand(-3, 3), AllianceOverrunWP[9][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 7;
|
||||
Start(true, true);
|
||||
break;
|
||||
case 3:
|
||||
AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3, 3), AllianceOverrunWP[10][1]+irand(-3, 3), AllianceOverrunWP[10][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3, 3), AllianceOverrunWP[11][1]+irand(-3, 3), AllianceOverrunWP[11][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3, 3), AllianceOverrunWP[12][1]+irand(-3, 3), AllianceOverrunWP[12][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3, 3), AllianceOverrunWP[12][1]+irand(-3, 3), AllianceOverrunWP[12][2], 0);
|
||||
AddWaypoint(4, AllianceOverrunWP[10][0] + irand(-3, 3), AllianceOverrunWP[10][1] + irand(-3, 3), AllianceOverrunWP[10][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[11][0] + irand(-3, 3), AllianceOverrunWP[11][1] + irand(-3, 3), AllianceOverrunWP[11][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[12][0] + irand(-3, 3), AllianceOverrunWP[12][1] + irand(-3, 3), AllianceOverrunWP[12][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[12][0] + irand(-3, 3), AllianceOverrunWP[12][1] + irand(-3, 3), AllianceOverrunWP[12][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 6;
|
||||
Start(true, true);
|
||||
break;
|
||||
case 4:
|
||||
AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3, 3), AllianceOverrunWP[13][1]+irand(-3, 3), AllianceOverrunWP[13][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3, 3), AllianceOverrunWP[14][1]+irand(-3, 3), AllianceOverrunWP[14][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3, 3), AllianceOverrunWP[15][1]+irand(-3, 3), AllianceOverrunWP[15][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3, 3), AllianceOverrunWP[15][1]+irand(-3, 3), AllianceOverrunWP[15][2], 0);
|
||||
AddWaypoint(4, AllianceOverrunWP[13][0] + irand(-3, 3), AllianceOverrunWP[13][1] + irand(-3, 3), AllianceOverrunWP[13][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[14][0] + irand(-3, 3), AllianceOverrunWP[14][1] + irand(-3, 3), AllianceOverrunWP[14][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[15][0] + irand(-3, 3), AllianceOverrunWP[15][1] + irand(-3, 3), AllianceOverrunWP[15][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[15][0] + irand(-3, 3), AllianceOverrunWP[15][1] + irand(-3, 3), AllianceOverrunWP[15][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 6;
|
||||
Start(true, true);
|
||||
break;
|
||||
case 5:
|
||||
AddWaypoint(4, AllianceOverrunWP[16][0]+irand(-3, 3), AllianceOverrunWP[16][1]+irand(-3, 3), AllianceOverrunWP[16][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[17][0]+irand(-3, 3), AllianceOverrunWP[17][1]+irand(-3, 3), AllianceOverrunWP[17][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[18][0]+irand(-3, 3), AllianceOverrunWP[18][1]+irand(-3, 3), AllianceOverrunWP[18][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3, 3), AllianceOverrunWP[19][1]+irand(-3, 3), AllianceOverrunWP[19][2]);
|
||||
AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3, 3), AllianceOverrunWP[20][1]+irand(-3, 3), AllianceOverrunWP[20][2]);
|
||||
AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3, 3), AllianceOverrunWP[21][1]+irand(-3, 3), AllianceOverrunWP[21][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3, 3), AllianceOverrunWP[21][1]+irand(-3, 3), AllianceOverrunWP[21][2], 0);
|
||||
AddWaypoint(4, AllianceOverrunWP[16][0] + irand(-3, 3), AllianceOverrunWP[16][1] + irand(-3, 3), AllianceOverrunWP[16][2]);
|
||||
AddWaypoint(5, AllianceOverrunWP[17][0] + irand(-3, 3), AllianceOverrunWP[17][1] + irand(-3, 3), AllianceOverrunWP[17][2]);
|
||||
AddWaypoint(6, AllianceOverrunWP[18][0] + irand(-3, 3), AllianceOverrunWP[18][1] + irand(-3, 3), AllianceOverrunWP[18][2]);
|
||||
AddWaypoint(7, AllianceOverrunWP[19][0] + irand(-3, 3), AllianceOverrunWP[19][1] + irand(-3, 3), AllianceOverrunWP[19][2]);
|
||||
AddWaypoint(8, AllianceOverrunWP[20][0] + irand(-3, 3), AllianceOverrunWP[20][1] + irand(-3, 3), AllianceOverrunWP[20][2]);
|
||||
AddWaypoint(9, AllianceOverrunWP[21][0] + irand(-3, 3), AllianceOverrunWP[21][1] + irand(-3, 3), AllianceOverrunWP[21][2]);
|
||||
me->SetHomePosition(AllianceOverrunWP[21][0] + irand(-3, 3), AllianceOverrunWP[21][1] + irand(-3, 3), AllianceOverrunWP[21][2], 0);
|
||||
SetDespawnAtEnd(false);
|
||||
LastOverronPos = 9;
|
||||
Start(true, true);
|
||||
break;
|
||||
default:
|
||||
for (uint8 i = 22; i < 36; ++i)
|
||||
AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3, 3), AllianceOverrunWP[i][1]+irand(-3, 3), AllianceOverrunWP[i][2]);
|
||||
AddWaypoint(i - 18, AllianceOverrunWP[i][0] + irand(-3, 3), AllianceOverrunWP[i][1] + irand(-3, 3), AllianceOverrunWP[i][2]);
|
||||
SetDespawnAtEnd(true);
|
||||
LastOverronPos = 17;
|
||||
Start(true, true);
|
||||
@@ -339,12 +339,12 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
if (me->GetEntry() == GHOUL)
|
||||
{
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
switch (OverrunType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10, 10), HordeOverrunWP[16][1]+irand(-10, 10), HordeOverrunWP[16][2]);
|
||||
AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10, 10), HordeOverrunWP[17][1]+irand(-10, 10), HordeOverrunWP[17][2]);
|
||||
AddWaypoint(5, HordeOverrunWP[16][0] + irand(-10, 10), HordeOverrunWP[16][1] + irand(-10, 10), HordeOverrunWP[16][2]);
|
||||
AddWaypoint(6, HordeOverrunWP[17][0] + irand(-10, 10), HordeOverrunWP[17][1] + irand(-10, 10), HordeOverrunWP[17][2]);
|
||||
AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]);
|
||||
AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]);
|
||||
me->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2], 0);
|
||||
@@ -353,8 +353,8 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
Start(true, true);
|
||||
break;
|
||||
case 1:
|
||||
AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10, 10), HordeOverrunWP[16][1]+irand(-10, 10), HordeOverrunWP[16][2]);
|
||||
AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10, 10), HordeOverrunWP[17][1]+irand(-10, 10), HordeOverrunWP[17][2]);
|
||||
AddWaypoint(5, HordeOverrunWP[16][0] + irand(-10, 10), HordeOverrunWP[16][1] + irand(-10, 10), HordeOverrunWP[16][2]);
|
||||
AddWaypoint(6, HordeOverrunWP[17][0] + irand(-10, 10), HordeOverrunWP[17][1] + irand(-10, 10), HordeOverrunWP[17][2]);
|
||||
AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]);
|
||||
AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]);
|
||||
me->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2], 0);
|
||||
@@ -364,7 +364,7 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
break;
|
||||
default:
|
||||
for (uint8 i = 0; i < 16; ++i)
|
||||
AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10, 10), HordeOverrunWP[i][1]+irand(-10, 10), HordeOverrunWP[i][2]);
|
||||
AddWaypoint(i + 6, HordeOverrunWP[i][0] + irand(-10, 10), HordeOverrunWP[i][1] + irand(-10, 10), HordeOverrunWP[i][2]);
|
||||
SetDespawnAtEnd(true);
|
||||
LastOverronPos = 21;
|
||||
Start(true, true);
|
||||
@@ -374,9 +374,9 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
if (me->GetEntry() == ABOMINATION)
|
||||
{
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-10, 10), HordeWPs[i][1]+irand(-10, 10), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-10, 10), HordeWPs[i][1] + irand(-10, 10), HordeWPs[i][2]);
|
||||
for (uint8 i = 0; i < 16; ++i)
|
||||
AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10, 10), HordeOverrunWP[i][1]+irand(-10, 10), HordeOverrunWP[i][2]);
|
||||
AddWaypoint(i + 6, HordeOverrunWP[i][0] + irand(-10, 10), HordeOverrunWP[i][1] + irand(-10, 10), HordeOverrunWP[i][2]);
|
||||
SetDespawnAtEnd(true);
|
||||
LastOverronPos = 21;
|
||||
Start(true, true);
|
||||
@@ -390,7 +390,7 @@ void hyjal_trashAI::JustDied(Unit* /*killer*/)
|
||||
if (IsEvent && !me->isWorldBoss())
|
||||
instance->SetData(DATA_TRASH, 0);//signal trash is dead
|
||||
|
||||
if ((instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !me->isWorldBoss()) || (damageTaken < me->GetMaxHealth()/4 && me->isWorldBoss()))
|
||||
if ((instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !me->isWorldBoss()) || (damageTaken < me->GetMaxHealth() / 4 && me->isWorldBoss()))
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ public:
|
||||
instance = creature->GetInstanceScript();
|
||||
meteor = false;//call once!
|
||||
CanMove = false;
|
||||
Delay = rand()%30000;
|
||||
Delay = rand() % 30000;
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetDisplayId(MODEL_INVIS);
|
||||
@@ -424,7 +424,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
spawnTimer = 2000;
|
||||
FlameBuffetTimer= 2000;
|
||||
FlameBuffetTimer = 2000;
|
||||
imol = false;
|
||||
}
|
||||
|
||||
@@ -447,16 +447,18 @@ public:
|
||||
{
|
||||
if (Delay <= diff)
|
||||
{
|
||||
Delay=0;
|
||||
}else{
|
||||
Delay-=diff;
|
||||
Delay = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Delay -= diff;
|
||||
return;
|
||||
}
|
||||
if (!meteor)
|
||||
{
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
Creature* trigger = me->SummonCreature(NPC_TRIGGER, x+8, y+8, z+25+rand()%10, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1000);
|
||||
Creature* trigger = me->SummonCreature(NPC_TRIGGER, x + 8, y + 8, z + 25 + rand() % 10, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1000);
|
||||
if (trigger)
|
||||
{
|
||||
trigger->SetVisible(false);
|
||||
@@ -466,7 +468,9 @@ public:
|
||||
}
|
||||
me->GetMotionMaster()->Clear();
|
||||
meteor = true;
|
||||
} else if (!CanMove){
|
||||
}
|
||||
else if (!CanMove)
|
||||
{
|
||||
if (spawnTimer <= diff)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -478,10 +482,13 @@ public:
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
} else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
|
||||
}
|
||||
else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT))
|
||||
{
|
||||
//do overrun
|
||||
}
|
||||
} else spawnTimer -= diff;
|
||||
}
|
||||
else spawnTimer -= diff;
|
||||
}
|
||||
if (!CanMove)return;
|
||||
hyjal_trashAI::UpdateAI(diff);
|
||||
@@ -492,7 +499,7 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
AddWaypoint(0, HordeWPs[7][0]+irand(-3, 3), HordeWPs[7][1]+irand(-3, 3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall
|
||||
AddWaypoint(0, HordeWPs[7][0] + irand(-3, 3), HordeWPs[7][1] + irand(-3, 3), HordeWPs[7][2]); //HordeWPs[7] infront of thrall
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -503,13 +510,14 @@ public:
|
||||
if (!imol)
|
||||
{
|
||||
DoCast(me, SPELL_IMMOLATION);
|
||||
imol=true;
|
||||
imol = true;
|
||||
}
|
||||
if (FlameBuffetTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FLAME_BUFFET, true);
|
||||
FlameBuffetTimer = 7000;
|
||||
} else FlameBuffetTimer -= diff;
|
||||
}
|
||||
else FlameBuffetTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -588,13 +596,14 @@ public:
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
}
|
||||
else //use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -607,8 +616,9 @@ public:
|
||||
if (KnockDownTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKDOWN);
|
||||
KnockDownTimer = 15000+rand()%10000;
|
||||
} else KnockDownTimer -= diff;
|
||||
KnockDownTimer = 15000 + rand() % 10000;
|
||||
}
|
||||
else KnockDownTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -640,7 +650,7 @@ public:
|
||||
bool RandomMove;
|
||||
void Reset()
|
||||
{
|
||||
FrenzyTimer = 5000+rand()%5000;
|
||||
FrenzyTimer = 5000 + rand() % 5000;
|
||||
MoveTimer = 2000;
|
||||
RandomMove = false;
|
||||
}
|
||||
@@ -688,13 +698,14 @@ public:
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
}
|
||||
else //use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -703,8 +714,9 @@ public:
|
||||
if (FrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
FrenzyTimer = 15000+rand()%15000;
|
||||
} else FrenzyTimer -= diff;
|
||||
FrenzyTimer = 15000 + rand() % 15000;
|
||||
}
|
||||
else FrenzyTimer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -739,7 +751,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowBoltTimer = 1000+rand()%5000;
|
||||
ShadowBoltTimer = 1000 + rand() % 5000;
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
@@ -810,13 +822,14 @@ public:
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
}
|
||||
else //use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -829,8 +842,9 @@ public:
|
||||
if (ShadowBoltTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOW_BOLT);
|
||||
ShadowBoltTimer = 20000+rand()%10000;
|
||||
} else ShadowBoltTimer -= diff;
|
||||
ShadowBoltTimer = 20000 + rand() % 10000;
|
||||
}
|
||||
else ShadowBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -864,9 +878,9 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
CourseTimer = 20000+rand()%5000;
|
||||
WailTimer = 15000+rand()%5000;
|
||||
ShellTimer = 50000+rand()%10000;
|
||||
CourseTimer = 20000 + rand() % 5000;
|
||||
WailTimer = 15000 + rand() % 5000;
|
||||
ShellTimer = 50000 + rand() % 10000;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
@@ -903,13 +917,14 @@ public:
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
}
|
||||
else //use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -920,18 +935,21 @@ public:
|
||||
if (CourseTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_BANSHEE_CURSE);
|
||||
CourseTimer = 20000+rand()%5000;
|
||||
} else CourseTimer -= diff;
|
||||
CourseTimer = 20000 + rand() % 5000;
|
||||
}
|
||||
else CourseTimer -= diff;
|
||||
if (WailTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_BANSHEE_WAIL);
|
||||
WailTimer = 15000+rand()%5000;
|
||||
} else WailTimer -= diff;
|
||||
WailTimer = 15000 + rand() % 5000;
|
||||
}
|
||||
else WailTimer -= diff;
|
||||
if (ShellTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ANTI_MAGIC_SHELL);
|
||||
ShellTimer = 50000+rand()%10000;
|
||||
} else ShellTimer -= diff;
|
||||
ShellTimer = 50000 + rand() % 10000;
|
||||
}
|
||||
else ShellTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -962,7 +980,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
WebTimer = 20000+rand()%5000;
|
||||
WebTimer = 20000 + rand() % 5000;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
@@ -999,13 +1017,14 @@ public:
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
}
|
||||
else //use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -1016,8 +1035,9 @@ public:
|
||||
if (WebTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_WEB);
|
||||
WebTimer = 20000+rand()%5000;
|
||||
} else WebTimer -= diff;
|
||||
WebTimer = 20000 + rand() % 5000;
|
||||
}
|
||||
else WebTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -1048,7 +1068,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ManaBurnTimer = 9000+rand()%5000;
|
||||
ManaBurnTimer = 9000 + rand() % 5000;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
@@ -1085,13 +1105,14 @@ public:
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
AddWaypoint(i, HordeWPs[i][0] + irand(-3, 3), HordeWPs[i][1] + irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
}
|
||||
else //use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
AddWaypoint(i, AllianceWPs[i][0] + irand(-3, 3), AllianceWPs[i][1] + irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -1102,8 +1123,9 @@ public:
|
||||
if (ManaBurnTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MANA_BURN);
|
||||
ManaBurnTimer = 9000+rand()%5000;
|
||||
} else ManaBurnTimer -= diff;
|
||||
ManaBurnTimer = 9000 + rand() % 5000;
|
||||
}
|
||||
else ManaBurnTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -1190,9 +1212,10 @@ public:
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
else
|
||||
{//fly path FlyPathWPs
|
||||
{
|
||||
//fly path FlyPathWPs
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
AddWaypoint(i, FlyPathWPs[i][0] + irand(-10, 10), FlyPathWPs[i][1] + irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -1208,7 +1231,8 @@ public:
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
MoveTimer = 2000;
|
||||
} else MoveTimer-=diff;
|
||||
}
|
||||
else MoveTimer -= diff;
|
||||
}
|
||||
|
||||
if (FrostBreathTimer <= diff)
|
||||
@@ -1220,7 +1244,8 @@ public:
|
||||
me->GetMotionMaster()->Clear();
|
||||
FrostBreathTimer = 4000;
|
||||
}
|
||||
} else FrostBreathTimer -= diff;
|
||||
}
|
||||
else FrostBreathTimer -= diff;
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -1256,7 +1281,7 @@ public:
|
||||
{
|
||||
forcemove = true;
|
||||
Zpos = 10.0f;
|
||||
StrikeTimer = 2000+rand()%5000;
|
||||
StrikeTimer = 2000 + rand() % 5000;
|
||||
MoveTimer = 0;
|
||||
me->SetDisableGravity(true);
|
||||
}
|
||||
@@ -1302,12 +1327,14 @@ public:
|
||||
if (!useFlyPath)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, GargoyleWPs[i][0]+irand(-10, 10), GargoyleWPs[i][1]+irand(-10, 10), GargoyleWPs[i][2]);
|
||||
AddWaypoint(i, GargoyleWPs[i][0] + irand(-10, 10), GargoyleWPs[i][1] + irand(-10, 10), GargoyleWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else{//fly path FlyPathWPs
|
||||
}
|
||||
else //fly path FlyPathWPs
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
AddWaypoint(i, FlyPathWPs[i][0] + irand(-10, 10), FlyPathWPs[i][1] + irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
@@ -1321,9 +1348,10 @@ public:
|
||||
if (StrikeTimer <= diff)
|
||||
{
|
||||
me->CastSpell(DummyTarget[0], DummyTarget[1], DummyTarget[2], SPELL_GARGOYLE_STRIKE, false);
|
||||
StrikeTimer = 2000+rand()%1000;
|
||||
} else StrikeTimer -= diff;
|
||||
StrikeTimer = 2000 + rand() % 1000;
|
||||
}
|
||||
else StrikeTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -1341,12 +1369,13 @@ public:
|
||||
{
|
||||
float x, y, z;
|
||||
me->GetVictim()->GetPosition(x, y, z);
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z+Zpos);
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z + Zpos);
|
||||
Zpos -= 1.0f;
|
||||
if (Zpos <= 0)
|
||||
Zpos = 0;
|
||||
MoveTimer = 2000;
|
||||
} else MoveTimer-=diff;
|
||||
}
|
||||
else MoveTimer -= diff;
|
||||
}
|
||||
|
||||
if (StrikeTimer <= diff)
|
||||
@@ -1356,9 +1385,11 @@ public:
|
||||
DoCastVictim(SPELL_GARGOYLE_STRIKE);
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->Clear();
|
||||
StrikeTimer = 2000+rand()%1000;
|
||||
} else StrikeTimer=0;
|
||||
} else StrikeTimer -= diff;
|
||||
StrikeTimer = 2000 + rand() % 1000;
|
||||
}
|
||||
else StrikeTimer = 0;
|
||||
}
|
||||
else StrikeTimer -= diff;
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -1388,7 +1419,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ExplodeTimer = 5000+rand()%5000;
|
||||
ExplodeTimer = 5000 + rand() % 5000;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
@@ -1420,10 +1451,11 @@ public:
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
int dmg = 500+rand()%700;
|
||||
int dmg = 500 + rand() % 700;
|
||||
me->CastCustomSpell(me->GetVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false);
|
||||
ExplodeTimer = 5000+rand()%5000;
|
||||
} else ExplodeTimer -= diff;
|
||||
ExplodeTimer = 5000 + rand() % 5000;
|
||||
}
|
||||
else ExplodeTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,20 +20,20 @@ struct hyjal_trashAI : public npc_escortAI
|
||||
|
||||
void JustDied(Unit* /*killer*/);
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask);
|
||||
void DamageTaken(Unit* done_by, uint32& damage, DamageEffectType, SpellSchoolMask);
|
||||
|
||||
public:
|
||||
InstanceScript* instance;
|
||||
bool IsEvent;
|
||||
uint32 Delay;
|
||||
uint32 LastOverronPos;
|
||||
bool IsOverrun;
|
||||
bool SetupOverrun;
|
||||
uint32 OverrunType;
|
||||
uint8 faction;
|
||||
bool useFlyPath;
|
||||
uint32 damageTaken;
|
||||
float DummyTarget[3];
|
||||
public:
|
||||
InstanceScript* instance;
|
||||
bool IsEvent;
|
||||
uint32 Delay;
|
||||
uint32 LastOverronPos;
|
||||
bool IsOverrun;
|
||||
bool SetupOverrun;
|
||||
uint32 OverrunType;
|
||||
uint8 faction;
|
||||
bool useFlyPath;
|
||||
uint32 damageTaken;
|
||||
float DummyTarget[3];
|
||||
|
||||
//private:
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Mount_Hyjal
|
||||
@@ -106,14 +106,30 @@ public:
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case RAGE_WINTERCHILL: RageWinterchill = creature->GetGUID(); break;
|
||||
case ANETHERON: Anetheron = creature->GetGUID(); break;
|
||||
case KAZROGAL: Kazrogal = creature->GetGUID(); break;
|
||||
case AZGALOR: Azgalor = creature->GetGUID(); break;
|
||||
case ARCHIMONDE: Archimonde = creature->GetGUID(); break;
|
||||
case JAINA: JainaProudmoore = creature->GetGUID(); break;
|
||||
case THRALL: Thrall = creature->GetGUID(); break;
|
||||
case TYRANDE: TyrandeWhisperwind = creature->GetGUID(); break;
|
||||
case RAGE_WINTERCHILL:
|
||||
RageWinterchill = creature->GetGUID();
|
||||
break;
|
||||
case ANETHERON:
|
||||
Anetheron = creature->GetGUID();
|
||||
break;
|
||||
case KAZROGAL:
|
||||
Kazrogal = creature->GetGUID();
|
||||
break;
|
||||
case AZGALOR:
|
||||
Azgalor = creature->GetGUID();
|
||||
break;
|
||||
case ARCHIMONDE:
|
||||
Archimonde = creature->GetGUID();
|
||||
break;
|
||||
case JAINA:
|
||||
JainaProudmoore = creature->GetGUID();
|
||||
break;
|
||||
case THRALL:
|
||||
Thrall = creature->GetGUID();
|
||||
break;
|
||||
case TYRANDE:
|
||||
TyrandeWhisperwind = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,14 +137,22 @@ public:
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case DATA_RAGEWINTERCHILL: return RageWinterchill;
|
||||
case DATA_ANETHERON: return Anetheron;
|
||||
case DATA_KAZROGAL: return Kazrogal;
|
||||
case DATA_AZGALOR: return Azgalor;
|
||||
case DATA_ARCHIMONDE: return Archimonde;
|
||||
case DATA_JAINAPROUDMOORE: return JainaProudmoore;
|
||||
case DATA_THRALL: return Thrall;
|
||||
case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind;
|
||||
case DATA_RAGEWINTERCHILL:
|
||||
return RageWinterchill;
|
||||
case DATA_ANETHERON:
|
||||
return Anetheron;
|
||||
case DATA_KAZROGAL:
|
||||
return Kazrogal;
|
||||
case DATA_AZGALOR:
|
||||
return Azgalor;
|
||||
case DATA_ARCHIMONDE:
|
||||
return Archimonde;
|
||||
case DATA_JAINAPROUDMOORE:
|
||||
return JainaProudmoore;
|
||||
case DATA_THRALL:
|
||||
return Thrall;
|
||||
case DATA_TYRANDEWHISPERWIND:
|
||||
return TyrandeWhisperwind;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -166,14 +190,14 @@ public:
|
||||
if (map->IsDungeon() && unit)
|
||||
{
|
||||
unit->SetVisible(false);
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
Map::PlayerList const& PlayerList = map->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->GetSource())
|
||||
{
|
||||
if (i->GetSource())
|
||||
{
|
||||
WorldPacket packet;
|
||||
ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, i->GetSource(), YELL_EFFORTS);
|
||||
i->GetSource()->GetSession()->SendPacket(&packet);
|
||||
@@ -181,7 +205,7 @@ public:
|
||||
WorldPacket data2(SMSG_PLAY_SOUND, 4);
|
||||
data2 << 10986;
|
||||
i->GetSource()->GetSession()->SendPacket(&data2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,9 +266,9 @@ public:
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' '
|
||||
<< m_auiEncounter[3] << ' ' << m_auiEncounter[4]
|
||||
<< ' ' << allianceRetreat << ' ' << hordeRetreat
|
||||
<< ' ' << RaidDamage;
|
||||
<< m_auiEncounter[3] << ' ' << m_auiEncounter[4]
|
||||
<< ' ' << allianceRetreat << ' ' << hordeRetreat
|
||||
<< ' ' << RaidDamage;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
@@ -258,15 +282,24 @@ public:
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0];
|
||||
case DATA_ANETHERONEVENT: return m_auiEncounter[1];
|
||||
case DATA_KAZROGALEVENT: return m_auiEncounter[2];
|
||||
case DATA_AZGALOREVENT: return m_auiEncounter[3];
|
||||
case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4];
|
||||
case DATA_TRASH: return Trash;
|
||||
case DATA_ALLIANCE_RETREAT: return allianceRetreat;
|
||||
case DATA_HORDE_RETREAT: return hordeRetreat;
|
||||
case DATA_RAIDDAMAGE: return RaidDamage;
|
||||
case DATA_RAGEWINTERCHILLEVENT:
|
||||
return m_auiEncounter[0];
|
||||
case DATA_ANETHERONEVENT:
|
||||
return m_auiEncounter[1];
|
||||
case DATA_KAZROGALEVENT:
|
||||
return m_auiEncounter[2];
|
||||
case DATA_AZGALOREVENT:
|
||||
return m_auiEncounter[3];
|
||||
case DATA_ARCHIMONDEEVENT:
|
||||
return m_auiEncounter[4];
|
||||
case DATA_TRASH:
|
||||
return Trash;
|
||||
case DATA_ALLIANCE_RETREAT:
|
||||
return allianceRetreat;
|
||||
case DATA_HORDE_RETREAT:
|
||||
return hordeRetreat;
|
||||
case DATA_RAIDDAMAGE:
|
||||
return RaidDamage;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -293,25 +326,25 @@ public:
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint32 m_auiEncounter[EncounterCount];
|
||||
std::string str_data;
|
||||
std::list<uint64> m_uiAncientGemGUID;
|
||||
uint64 RageWinterchill;
|
||||
uint64 Anetheron;
|
||||
uint64 Kazrogal;
|
||||
uint64 Azgalor;
|
||||
uint64 Archimonde;
|
||||
uint64 JainaProudmoore;
|
||||
uint64 Thrall;
|
||||
uint64 TyrandeWhisperwind;
|
||||
uint64 HordeGate;
|
||||
uint64 ElfGate;
|
||||
uint32 Trash;
|
||||
uint32 hordeRetreat;
|
||||
uint32 allianceRetreat;
|
||||
uint32 RaidDamage;
|
||||
bool ArchiYell;
|
||||
protected:
|
||||
uint32 m_auiEncounter[EncounterCount];
|
||||
std::string str_data;
|
||||
std::list<uint64> m_uiAncientGemGUID;
|
||||
uint64 RageWinterchill;
|
||||
uint64 Anetheron;
|
||||
uint64 Kazrogal;
|
||||
uint64 Azgalor;
|
||||
uint64 Archimonde;
|
||||
uint64 JainaProudmoore;
|
||||
uint64 Thrall;
|
||||
uint64 TyrandeWhisperwind;
|
||||
uint64 HordeGate;
|
||||
uint64 ElfGate;
|
||||
uint32 Trash;
|
||||
uint32 hordeRetreat;
|
||||
uint32 allianceRetreat;
|
||||
uint32 RaidDamage;
|
||||
bool ArchiYell;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (!urand(0,1))
|
||||
if (!urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
|
||||
@@ -47,8 +47,8 @@ public:
|
||||
SummonList summons;
|
||||
uint32 beamTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
EventMap events;
|
||||
bool finished;
|
||||
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
|
||||
@@ -86,13 +86,13 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (!urand(0,1))
|
||||
if (!urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* who, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!finished && damage >= me->GetHealth())
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (!urand(0,1))
|
||||
if (!urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case EVENT_SPELL_CONSTRICTING_CHAINS:
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, 50.0f, true))
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, 50.0f, true))
|
||||
me->CastSpell(pTarget, DUNGEON_MODE(SPELL_CONSTRICTING_CHAINS_N, SPELL_CONSTRICTING_CHAINS_H), false);
|
||||
events.RepeatEvent(14000);
|
||||
break;
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
void Reset()
|
||||
{
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (!urand(0,1))
|
||||
if (!urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
@@ -119,19 +119,19 @@ public:
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_SPELL_STEAL_FLESH:
|
||||
if (!urand(0,2))
|
||||
if (!urand(0, 2))
|
||||
Talk(SAY_STEAL_FLESH);
|
||||
me->CastSpell(me->GetVictim(), SPELL_STEAL_FLESH_CHANNEL, false);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
case EVENT_SPELL_SUMMON_GHOULS:
|
||||
if (!urand(0,2))
|
||||
if (!urand(0, 2))
|
||||
Talk(SAY_SUMMON_GHOULS);
|
||||
me->CastSpell(me, SPELL_SUMMON_GHOULS, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_EXPLODE_GHOUL:
|
||||
if (!urand(0,2))
|
||||
if (!urand(0, 2))
|
||||
Talk(SAY_EXPLODE_GHOUL);
|
||||
ExplodeGhoul();
|
||||
events.RepeatEvent(15000);
|
||||
@@ -150,34 +150,34 @@ public:
|
||||
|
||||
class spell_boss_salramm_steal_flesh : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_boss_salramm_steal_flesh() : SpellScriptLoader("spell_boss_salramm_steal_flesh") { }
|
||||
public:
|
||||
spell_boss_salramm_steal_flesh() : SpellScriptLoader("spell_boss_salramm_steal_flesh") { }
|
||||
|
||||
class spell_boss_salramm_steal_flesh_AuraScript : public AuraScript
|
||||
class spell_boss_salramm_steal_flesh_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_boss_salramm_steal_flesh_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_boss_salramm_steal_flesh_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetUnitOwner();
|
||||
if (caster)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetUnitOwner();
|
||||
if (caster)
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_STEAL_FLESH_CASTER, true);
|
||||
caster->CastSpell(target, SPELL_STEAL_FLESH_TARGET, true);
|
||||
}
|
||||
caster->CastSpell(caster, SPELL_STEAL_FLESH_CASTER, true);
|
||||
caster->CastSpell(target, SPELL_STEAL_FLESH_TARGET, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_boss_salramm_steal_flesh_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_boss_salramm_steal_flesh_AuraScript();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_boss_salramm_steal_flesh_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_boss_salramm_steal_flesh_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_salramm()
|
||||
|
||||
@@ -145,12 +145,12 @@ enum Spells
|
||||
|
||||
enum GossipMenuArthas
|
||||
{
|
||||
GOSSIP_MENU_ARTHAS_1 = 13076,
|
||||
GOSSIP_MENU_ARTHAS_2 = 13125,
|
||||
GOSSIP_MENU_ARTHAS_3 = 13126,
|
||||
GOSSIP_MENU_ARTHAS_4 = 13177,
|
||||
GOSSIP_MENU_ARTHAS_5 = 13179,
|
||||
GOSSIP_MENU_ARTHAS_6 = 13287,
|
||||
GOSSIP_MENU_ARTHAS_1 = 13076,
|
||||
GOSSIP_MENU_ARTHAS_2 = 13125,
|
||||
GOSSIP_MENU_ARTHAS_3 = 13126,
|
||||
GOSSIP_MENU_ARTHAS_4 = 13177,
|
||||
GOSSIP_MENU_ARTHAS_5 = 13179,
|
||||
GOSSIP_MENU_ARTHAS_6 = 13287,
|
||||
};
|
||||
|
||||
enum Misc
|
||||
@@ -181,7 +181,7 @@ enum Events
|
||||
};
|
||||
|
||||
// Locations for necromancers and add to spawn
|
||||
float WavesLocations[ENCOUNTER_WAVES_NUMBER][ENCOUNTER_WAVES_MAX_SPAWNS][5]=
|
||||
float WavesLocations[ENCOUNTER_WAVES_NUMBER][ENCOUNTER_WAVES_MAX_SPAWNS][5] =
|
||||
{
|
||||
{
|
||||
{NPC_RISEN_ZOMBIE, 2164.698975f, 1255.392944f, 135.040878f, 0.490202f},
|
||||
@@ -234,7 +234,7 @@ float WavesLocations[ENCOUNTER_WAVES_NUMBER][ENCOUNTER_WAVES_MAX_SPAWNS][5]=
|
||||
};
|
||||
|
||||
// Locations for rifts to spawn and draconians to go
|
||||
float RiftAndSpawnsLocations[ENCOUNTER_CHRONO_NUMBER][ENCOUNTER_CHRONO_MAX_SPAWNS_FIRST][5]=
|
||||
float RiftAndSpawnsLocations[ENCOUNTER_CHRONO_NUMBER][ENCOUNTER_CHRONO_MAX_SPAWNS_FIRST][5] =
|
||||
{
|
||||
{
|
||||
{NPC_TIME_RIFT, 2431.790039f, 1190.670044f, 148.076004f, 0.187923f},
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
ClearGossipMenuFor(player);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_3, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
@@ -332,23 +332,23 @@ public:
|
||||
switch (pInstance->GetData(DATA_ARTHAS_EVENT))
|
||||
{
|
||||
case COS_PROGRESS_FINISHED_INTRO:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_1, creature->GetGUID());
|
||||
break;
|
||||
case COS_PROGRESS_REACHED_TOWN_HALL:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_2, creature->GetGUID());
|
||||
break;
|
||||
case COS_PROGRESS_KILLED_EPOCH:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_4, creature->GetGUID());
|
||||
break;
|
||||
case COS_PROGRESS_LAST_CITY:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_5, creature->GetGUID());
|
||||
break;
|
||||
case COS_PROGRESS_BEFORE_MALGANIS:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_6, creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
waveGroupId = 10;
|
||||
eventInRun = true;
|
||||
SetRun(true);
|
||||
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2+9, 10000);
|
||||
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2 + 9, 10000);
|
||||
}
|
||||
else if (param == ACTION_START_TOWN_HALL)
|
||||
{
|
||||
@@ -473,7 +473,7 @@ public:
|
||||
{
|
||||
EnterEvadeMode();
|
||||
eventInRun = true;
|
||||
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE5+1, 22000);
|
||||
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE5 + 1, 22000);
|
||||
me->SetFacingTo(1.84f);
|
||||
|
||||
if (!me->GetMap()->GetPlayers().isEmpty())
|
||||
@@ -649,7 +649,7 @@ public:
|
||||
eventInRun = true;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -671,8 +671,8 @@ public:
|
||||
me->SetTarget(uther->GetGUID());
|
||||
}
|
||||
for (int i = 0; i < 3; ++i)
|
||||
if (Creature *horse = me->SummonCreature(NPC_HORSE_ESCORT, EventPos[EVENT_SRC_HORSE1+i], TEMPSUMMON_DEAD_DESPAWN, 180000))
|
||||
horse->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_HORSE1+i], false);
|
||||
if (Creature* horse = me->SummonCreature(NPC_HORSE_ESCORT, EventPos[EVENT_SRC_HORSE1 + i], TEMPSUMMON_DEAD_DESPAWN, 180000))
|
||||
horse->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_HORSE1 + i], false);
|
||||
|
||||
ScheduleNextEvent(currentEvent, 4000);
|
||||
break;
|
||||
@@ -1050,7 +1050,7 @@ public:
|
||||
eventInRun = false;
|
||||
SetEscortPaused(false);
|
||||
Talk(SAY_PHASE311);
|
||||
me->SetFacingTo(M_PI*3/2);
|
||||
me->SetFacingTo(M_PI * 3 / 2);
|
||||
ScheduleNextEvent(currentEvent, 0);
|
||||
break;
|
||||
case EVENT_ACTION_PHASE3+14:
|
||||
@@ -1061,7 +1061,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
me->SetFacingTo(M_PI/2);
|
||||
me->SetFacingTo(M_PI / 2);
|
||||
ScheduleNextEvent(currentEvent, 8000);
|
||||
break;
|
||||
case EVENT_ACTION_PHASE3+15:
|
||||
@@ -1152,7 +1152,7 @@ public:
|
||||
me->SetVisible(false);
|
||||
actionEvents.PopEvent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Battling skills
|
||||
@@ -1203,15 +1203,15 @@ Creature* npc_arthas::npc_arthasAI::GetEventNpc(uint32 entry)
|
||||
void npc_arthas::npc_arthasAI::ScheduleNextEvent(uint32 currentEvent, uint32 time)
|
||||
{
|
||||
actionEvents.PopEvent();
|
||||
actionEvents.ScheduleEvent(currentEvent+1, time);
|
||||
actionEvents.ScheduleEvent(currentEvent + 1, time);
|
||||
}
|
||||
|
||||
void npc_arthas::npc_arthasAI::SummonNextWave()
|
||||
{
|
||||
Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
i->GetSource()->PlayerTalkClass->SendPointOfInterest(1000+waveGroupId);
|
||||
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
i->GetSource()->PlayerTalkClass->SendPointOfInterest(1000 + waveGroupId);
|
||||
|
||||
waveKillCount = 0; // this is forced condition!
|
||||
uint32 tableId = waveGroupId;
|
||||
@@ -1252,7 +1252,7 @@ void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data)
|
||||
if (data == COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
{
|
||||
eventInRun = true;
|
||||
actionEvents.RescheduleEvent(EVENT_ACTION_PHASE2+8, 10000);
|
||||
actionEvents.RescheduleEvent(EVENT_ACTION_PHASE2 + 8, 10000);
|
||||
}
|
||||
else if (data == COS_PROGRESS_KILLED_MEATHOOK)
|
||||
{
|
||||
@@ -1319,7 +1319,7 @@ void npc_arthas::npc_arthasAI::SendNextWave(uint32 entry)
|
||||
else
|
||||
SummonNextWave();
|
||||
|
||||
pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, waveGroupId+1);
|
||||
pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, waveGroupId + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1354,39 +1354,39 @@ void npc_arthas::npc_arthasAI::SpawnTimeRift()
|
||||
|
||||
class npc_crate_helper : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_crate_helper() : CreatureScript("npc_create_helper_cot") { }
|
||||
public:
|
||||
npc_crate_helper() : CreatureScript("npc_create_helper_cot") { }
|
||||
|
||||
struct npc_crate_helperAI : public NullCreatureAI
|
||||
struct npc_crate_helperAI : public NullCreatureAI
|
||||
{
|
||||
npc_crate_helperAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
npc_crate_helperAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
_marked = false;
|
||||
}
|
||||
_marked = false;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ARCANE_DISRUPTION && !_marked)
|
||||
{
|
||||
if (spell->Id == SPELL_ARCANE_DISRUPTION && !_marked)
|
||||
_marked = true;
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(DATA_CRATE_COUNT, 0);
|
||||
if (GameObject* crate = me->FindNearestGameObject(GO_SUSPICIOUS_CRATE, 5.0f))
|
||||
{
|
||||
_marked = true;
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(DATA_CRATE_COUNT, 0);
|
||||
if (GameObject* crate = me->FindNearestGameObject(GO_SUSPICIOUS_CRATE, 5.0f))
|
||||
{
|
||||
crate->SummonGameObject(GO_PLAGUED_CRATE, crate->GetPositionX(), crate->GetPositionY(), crate->GetPositionZ(), crate->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, DAY);
|
||||
crate->Delete();
|
||||
}
|
||||
crate->SummonGameObject(GO_PLAGUED_CRATE, crate->GetPositionX(), crate->GetPositionY(), crate->GetPositionZ(), crate->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, DAY);
|
||||
crate->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool _marked;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_crate_helperAI(creature);
|
||||
}
|
||||
|
||||
private:
|
||||
bool _marked;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_crate_helperAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum chromie
|
||||
@@ -1398,207 +1398,207 @@ enum chromie
|
||||
|
||||
class npc_cos_chromie_start : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_cos_chromie_start() : CreatureScript("npc_cos_chromie_start") { }
|
||||
public:
|
||||
npc_cos_chromie_start() : CreatureScript("npc_cos_chromie_start") { }
|
||||
|
||||
bool OnQuestAccept(Player* , Creature* creature, const Quest* pQuest) override
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest) override
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
|
||||
return true;
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
player->AddItem(ITEM_ARCANE_DISRUPTOR, 1);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
player->AddItem(ITEM_ARCANE_DISRUPTOR, 1);
|
||||
}
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetData64(DATA_ARTHAS)))
|
||||
arthas->AI()->Reset();
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetData64(DATA_ARTHAS)))
|
||||
arthas->AI()->Reset();
|
||||
}
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
|
||||
// return false to display last windows
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// return false to display last windows
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_cos_chromie_middle : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_cos_chromie_middle() : CreatureScript("npc_cos_chromie_middle") { }
|
||||
public:
|
||||
npc_cos_chromie_middle() : CreatureScript("npc_cos_chromie_middle") { }
|
||||
|
||||
bool OnQuestAccept(Player* , Creature* creature, const Quest* pQuest) override
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_A_ROYAL_ESCORT)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_CRATES_FOUND)
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_START_INTRO);
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest) override
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_A_ROYAL_ESCORT)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_CRATES_FOUND)
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_START_INTRO);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
if (!creature->GetInstanceScript() || creature->GetInstanceScript()->GetData(DATA_ARTHAS_EVENT) != COS_PROGRESS_CRATES_FOUND)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
// We can start event:)
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9612)
|
||||
creature->GetInstanceScript()->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_START_INTRO);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
{
|
||||
if (!creature->GetInstanceScript() || creature->GetInstanceScript()->GetData(DATA_ARTHAS_EVENT) != COS_PROGRESS_CRATES_FOUND)
|
||||
return true;
|
||||
|
||||
// We can start event:)
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9612)
|
||||
creature->GetInstanceScript()->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_START_INTRO);
|
||||
|
||||
return false;
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
player->SendPreparedQuest(creature->GetGUID());
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
{
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
player->SendPreparedQuest(creature->GetGUID());
|
||||
}
|
||||
if (!creature->GetInstanceScript() || creature->GetInstanceScript()->GetData(DATA_ARTHAS_EVENT) != COS_PROGRESS_CRATES_FOUND)
|
||||
return true;
|
||||
|
||||
if (!creature->GetInstanceScript() || creature->GetInstanceScript()->GetData(DATA_ARTHAS_EVENT) != COS_PROGRESS_CRATES_FOUND)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_cos_stratholme_citizien : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_cos_stratholme_citizien() : CreatureScript("npc_cos_stratholme_citizien") { }
|
||||
public:
|
||||
npc_cos_stratholme_citizien() : CreatureScript("npc_cos_stratholme_citizien") { }
|
||||
|
||||
struct npc_cos_stratholme_citizienAI : public ScriptedAI
|
||||
struct npc_cos_stratholme_citizienAI : public ScriptedAI
|
||||
{
|
||||
npc_cos_stratholme_citizienAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_cos_stratholme_citizienAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
allowTimer = 0;
|
||||
pInstance = me->GetInstanceScript();
|
||||
if (!pInstance || pInstance->GetData(DATA_ARTHAS_EVENT) < COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
allowTimer++;
|
||||
}
|
||||
|
||||
bool locked;
|
||||
uint32 changeTimer;
|
||||
InstanceScript* pInstance;
|
||||
uint32 allowTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
locked = false;
|
||||
changeTimer = 0;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
uint32 data = pInstance->GetData(DATA_ARTHAS_EVENT);
|
||||
if (me->GetDistance(2400, 1200, 135) > 20.0f && data >= COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
{
|
||||
if (data >= COS_PROGRESS_KILLED_SALRAMM)
|
||||
me->DespawnOrUnsummon(500);
|
||||
else
|
||||
InfectMe(3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!allowTimer && !locked && (who->GetTypeId() == TYPEID_PLAYER || who->IsPet()) && me->GetDistance(who) < 15.0f)
|
||||
InfectMe(2000);
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_INFECT_CITIZIEN)
|
||||
InfectMe(1);
|
||||
else if (param == ACTION_FORCE_CHANGE_LOCK)
|
||||
locked = true;
|
||||
}
|
||||
|
||||
void InfectMe(uint32 time)
|
||||
{
|
||||
locked = true;
|
||||
changeTimer = time;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_ARTHAS_CRUSADER_STRIKE)
|
||||
{
|
||||
if (me->GetEntry() == NPC_CITY_MAN3)
|
||||
{
|
||||
me->StopMoving();
|
||||
me->HandleEmoteCommand(54); // laugh
|
||||
}
|
||||
else
|
||||
Unit::Kill(caster, me);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
ScriptedAI::UpdateAI(diff);
|
||||
|
||||
if (allowTimer)
|
||||
{
|
||||
allowTimer += diff;
|
||||
if (allowTimer >= 8000 && pInstance && pInstance->GetData(DATA_ARTHAS_EVENT) >= COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
allowTimer = 0;
|
||||
}
|
||||
|
||||
if (changeTimer)
|
||||
{
|
||||
changeTimer += diff;
|
||||
if (changeTimer >= 2500 && changeTimer < 10000)
|
||||
{
|
||||
me->CastSpell(me, SPELL_GREEN_VISUAL_AURA, true);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_COWER);
|
||||
changeTimer = 10000;
|
||||
}
|
||||
else if (changeTimer >= 14500 && changeTimer < 20000)
|
||||
{
|
||||
me->UpdateEntry(NPC_RISEN_ZOMBIE, NULL, false);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
changeTimer = 20000;
|
||||
}
|
||||
else if (changeTimer >= 23000)
|
||||
{
|
||||
me->RemoveAura(SPELL_GREEN_VISUAL_AURA);
|
||||
changeTimer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_cos_stratholme_citizienAI(creature);
|
||||
allowTimer = 0;
|
||||
pInstance = me->GetInstanceScript();
|
||||
if (!pInstance || pInstance->GetData(DATA_ARTHAS_EVENT) < COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
allowTimer++;
|
||||
}
|
||||
|
||||
bool locked;
|
||||
uint32 changeTimer;
|
||||
InstanceScript* pInstance;
|
||||
uint32 allowTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
locked = false;
|
||||
changeTimer = 0;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
uint32 data = pInstance->GetData(DATA_ARTHAS_EVENT);
|
||||
if (me->GetDistance(2400, 1200, 135) > 20.0f && data >= COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
{
|
||||
if (data >= COS_PROGRESS_KILLED_SALRAMM)
|
||||
me->DespawnOrUnsummon(500);
|
||||
else
|
||||
InfectMe(3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!allowTimer && !locked && (who->GetTypeId() == TYPEID_PLAYER || who->IsPet()) && me->GetDistance(who) < 15.0f)
|
||||
InfectMe(2000);
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_INFECT_CITIZIEN)
|
||||
InfectMe(1);
|
||||
else if (param == ACTION_FORCE_CHANGE_LOCK)
|
||||
locked = true;
|
||||
}
|
||||
|
||||
void InfectMe(uint32 time)
|
||||
{
|
||||
locked = true;
|
||||
changeTimer = time;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_ARTHAS_CRUSADER_STRIKE)
|
||||
{
|
||||
if (me->GetEntry() == NPC_CITY_MAN3)
|
||||
{
|
||||
me->StopMoving();
|
||||
me->HandleEmoteCommand(54); // laugh
|
||||
}
|
||||
else
|
||||
Unit::Kill(caster, me);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
ScriptedAI::UpdateAI(diff);
|
||||
|
||||
if (allowTimer)
|
||||
{
|
||||
allowTimer += diff;
|
||||
if (allowTimer >= 8000 && pInstance && pInstance->GetData(DATA_ARTHAS_EVENT) >= COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
allowTimer = 0;
|
||||
}
|
||||
|
||||
if (changeTimer)
|
||||
{
|
||||
changeTimer += diff;
|
||||
if (changeTimer >= 2500 && changeTimer < 10000)
|
||||
{
|
||||
me->CastSpell(me, SPELL_GREEN_VISUAL_AURA, true);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_COWER);
|
||||
changeTimer = 10000;
|
||||
}
|
||||
else if (changeTimer >= 14500 && changeTimer < 20000)
|
||||
{
|
||||
me->UpdateEntry(NPC_RISEN_ZOMBIE, NULL, false);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
changeTimer = 20000;
|
||||
}
|
||||
else if (changeTimer >= 23000)
|
||||
{
|
||||
me->RemoveAura(SPELL_GREEN_VISUAL_AURA);
|
||||
changeTimer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_cos_stratholme_citizienAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_culling_of_stratholme()
|
||||
|
||||
@@ -139,7 +139,7 @@ const Position LeaderIntroPos4 = {2423.12f, 1119.43f, 148.07f, 0.0f};
|
||||
const Position LeaderIntroPos5 = {2540.48f, 1129.06f, 130.86f, 0.0f};
|
||||
const Position LeaderIntroPos6 = {2327.39f, 1412.47f, 127.69f, 0.0f};
|
||||
|
||||
const Position EventPos[] =
|
||||
const Position EventPos[] =
|
||||
{
|
||||
{1813.298f, 1283.578f, 142.326f, 3.878161f}, // chromie
|
||||
{1809.46f, 1286.05f, 142.62f, 4.8f}, // hourglass
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
class instance_culling_of_stratholme : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
instance_culling_of_stratholme() : InstanceMapScript("instance_culling_of_stratholme", 595) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
@@ -31,7 +31,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
// GOs
|
||||
_shkafGateGUID = 0;
|
||||
_exitGateGUID = 0;
|
||||
|
||||
|
||||
// Instance
|
||||
_crateCount = 0;
|
||||
_showCrateTimer = 0;
|
||||
@@ -111,7 +111,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
if (!instance->IsHeroic() || !_guardianTimer)
|
||||
return;
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, data);
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, uint32(_guardianTimer / (MINUTE*IN_MILLISECONDS)));
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS)));
|
||||
if (data == 0)
|
||||
{
|
||||
_guardianTimer = 0;
|
||||
@@ -125,7 +125,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
if (instance->IsHeroic())
|
||||
{
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, true);
|
||||
_guardianTimer = 26*MINUTE*IN_MILLISECONDS;
|
||||
_guardianTimer = 26 * MINUTE * IN_MILLISECONDS;
|
||||
if (!_infiniteGUID)
|
||||
instance->SummonCreature(NPC_INFINITE, EventPos[EVENT_SRC_CORRUPTOR]);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
_crateCount++;
|
||||
if (_crateCount == 5)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
i->GetSource()->KilledMonsterCredit(NPC_GRAIN_CREATE_TRIGGER, 0);
|
||||
@@ -151,19 +151,19 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
_encounterState = data;
|
||||
if (data == COS_PROGRESS_START_INTRO)
|
||||
{
|
||||
if (Creature *arthas = instance->GetCreature(_arthasGUID))
|
||||
if (Creature* arthas = instance->GetCreature(_arthasGUID))
|
||||
arthas->AI()->DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
else if (data == COS_PROGRESS_KILLED_SALRAMM)
|
||||
{
|
||||
if (Creature *arthas = instance->GetCreature(_arthasGUID))
|
||||
if (Creature* arthas = instance->GetCreature(_arthasGUID))
|
||||
arthas->AI()->DoAction(ACTION_KILLED_SALRAMM);
|
||||
}
|
||||
break;
|
||||
case DATA_ARTHAS_REPOSITION:
|
||||
if (data == 2)
|
||||
_respawnAndReposition = true;
|
||||
else if (Creature *arthas = instance->GetCreature(_arthasGUID))
|
||||
else if (Creature* arthas = instance->GetCreature(_arthasGUID))
|
||||
Reposition(arthas);
|
||||
return;
|
||||
|
||||
@@ -213,7 +213,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
// Used when arthas dies
|
||||
if (_respawnAndReposition)
|
||||
{
|
||||
if (Creature *arthas = instance->GetCreature(_arthasGUID))
|
||||
if (Creature* arthas = instance->GetCreature(_arthasGUID))
|
||||
{
|
||||
if (!arthas->IsAlive())
|
||||
{
|
||||
@@ -243,10 +243,10 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
// Used to display how much time players have
|
||||
if (_guardianTimer)
|
||||
{
|
||||
uint32 div = uint32(_guardianTimer / (MINUTE*IN_MILLISECONDS));
|
||||
uint32 div = uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS));
|
||||
_guardianTimer -= diff;
|
||||
uint32 divAfter = uint32(_guardianTimer / (MINUTE*IN_MILLISECONDS));
|
||||
|
||||
uint32 divAfter = uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS));
|
||||
|
||||
if (divAfter == 0)
|
||||
{
|
||||
_guardianTimer = 0;
|
||||
@@ -280,7 +280,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
instance->SummonCreature(NPC_HOURGLASS, EventPos[EVENT_POS_HOURGLASS]);
|
||||
|
||||
if (_encounterState == COS_PROGRESS_CRATES_FOUND ||
|
||||
_encounterState == COS_PROGRESS_START_INTRO)
|
||||
_encounterState == COS_PROGRESS_START_INTRO)
|
||||
{
|
||||
ChromieWhisper(0);
|
||||
|
||||
@@ -362,7 +362,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "C S " << _encounterState << ' ' << _guardianTimer;
|
||||
saveStream << "C S " << _encounterState << ' ' << _guardianTimer;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
@@ -398,21 +398,21 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
// NPCs
|
||||
uint64 _arthasGUID;
|
||||
uint64 _infiniteGUID;
|
||||
private:
|
||||
// NPCs
|
||||
uint64 _arthasGUID;
|
||||
uint64 _infiniteGUID;
|
||||
|
||||
// GOs
|
||||
uint64 _shkafGateGUID;
|
||||
uint64 _exitGateGUID;
|
||||
uint32 _encounterState;
|
||||
uint32 _crateCount;
|
||||
uint32 _showCrateTimer;
|
||||
uint32 _guardianTimer;
|
||||
// GOs
|
||||
uint64 _shkafGateGUID;
|
||||
uint64 _exitGateGUID;
|
||||
uint32 _encounterState;
|
||||
uint32 _crateCount;
|
||||
uint32 _showCrateTimer;
|
||||
uint32 _guardianTimer;
|
||||
|
||||
bool _respawnAndReposition;
|
||||
uint32 _loadTimer;
|
||||
bool _respawnAndReposition;
|
||||
uint32 _loadTimer;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
summons.Summon(summon);
|
||||
if (Creature* thrall = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(DATA_THRALL_GUID)))
|
||||
thrall->AI()->JustSummoned(summon);
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
|
||||
if (summon->GetEntry() == NPC_SKARLOC_MOUNT)
|
||||
return;
|
||||
@@ -82,15 +82,15 @@ public:
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
ScriptedAI::InitializeAI();
|
||||
ScriptedAI::InitializeAI();
|
||||
|
||||
Movement::PointsArray path;
|
||||
path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
|
||||
for (uint8 i = 0; i < WAYPOINTS_COUNT; ++i)
|
||||
for (uint8 i = 0; i < WAYPOINTS_COUNT; ++i)
|
||||
path.push_back(G3D::Vector3(startPath[i].GetPositionX(), startPath[i].GetPositionY(), startPath[i].GetPositionZ()));
|
||||
|
||||
me->GetMotionMaster()->MoveSplinePath(&path);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->Mount(SKARLOC_MOUNT_MODEL);
|
||||
}
|
||||
|
||||
@@ -155,13 +155,13 @@ public:
|
||||
Talk(SAY_ENTER);
|
||||
break;
|
||||
case EVENT_START_FIGHT:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetInCombatWithZone();
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (summon->GetEntry() != NPC_SKARLOC_MOUNT)
|
||||
{
|
||||
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -146,9 +146,9 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
Movement::PointsArray pathPoints;
|
||||
private:
|
||||
EventMap events;
|
||||
Movement::PointsArray pathPoints;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "old_hillsbrad.h"
|
||||
#include "Player.h"
|
||||
|
||||
const Position instancePositions[INSTANCE_POSITIONS_COUNT] =
|
||||
const Position instancePositions[INSTANCE_POSITIONS_COUNT] =
|
||||
{
|
||||
{2188.18f, 228.90f, 53.025f, 1.77f}, // Orcs Gather Point 1
|
||||
{2103.23f, 93.55f, 53.096f, 3.78f}, // Orcs Gather Point 2
|
||||
@@ -138,19 +138,19 @@ public:
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_BOMBS_PLACED:
|
||||
{
|
||||
if (_barrelCount >= 5 || _encounterProgress > ENCOUNTER_PROGRESS_NONE)
|
||||
return;
|
||||
|
||||
DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, ++_barrelCount);
|
||||
if (_barrelCount == 5)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_INITIAL_BARRELS_FLAME, 4000);
|
||||
_events.ScheduleEvent(EVENT_FINAL_BARRELS_FLAME, 12000);
|
||||
_events.ScheduleEvent(EVENT_SUMMON_LIEUTENANT, 18000);
|
||||
if (_barrelCount >= 5 || _encounterProgress > ENCOUNTER_PROGRESS_NONE)
|
||||
return;
|
||||
|
||||
DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, ++_barrelCount);
|
||||
if (_barrelCount == 5)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_INITIAL_BARRELS_FLAME, 4000);
|
||||
_events.ScheduleEvent(EVENT_FINAL_BARRELS_FLAME, 12000);
|
||||
_events.ScheduleEvent(EVENT_SUMMON_LIEUTENANT, 18000);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DATA_THRALL_ADD_FLAG:
|
||||
if (Creature* thrall = instance->GetCreature(_thrallGUID))
|
||||
thrall->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -182,87 +182,87 @@ public:
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_INITIAL_BARRELS_FLAME:
|
||||
{
|
||||
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
|
||||
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
|
||||
{
|
||||
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
|
||||
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
|
||||
|
||||
for (std::set<uint64>::const_iterator itr = _prisonersSet.begin(); itr != _prisonersSet.end(); ++itr)
|
||||
if (Creature* orc = instance->GetCreature(*itr))
|
||||
{
|
||||
uint8 index = orc->GetDistance(instancePositions[0]) < 80.0f ? 0 : 1;
|
||||
Position pos(instancePositions[index]);
|
||||
orc->MovePosition(pos, frand(1.0f, 3.0f) + 15.0f * (float)rand_norm(), (float)rand_norm() * static_cast<float>(2 * M_PI));
|
||||
orc->GetMotionMaster()->MovePoint(1, pos);
|
||||
orc->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
for (std::set<uint64>::const_iterator itr = _prisonersSet.begin(); itr != _prisonersSet.end(); ++itr)
|
||||
if (Creature* orc = instance->GetCreature(*itr))
|
||||
{
|
||||
uint8 index = orc->GetDistance(instancePositions[0]) < 80.0f ? 0 : 1;
|
||||
Position pos(instancePositions[index]);
|
||||
orc->MovePosition(pos, frand(1.0f, 3.0f) + 15.0f * (float)rand_norm(), (float)rand_norm() * static_cast<float>(2 * M_PI));
|
||||
orc->GetMotionMaster()->MovePoint(1, pos);
|
||||
orc->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
|
||||
for (std::set<uint64>::const_iterator itr = _initalFlamesSet.begin(); itr != _initalFlamesSet.end(); ++itr)
|
||||
if (GameObject* gobject = instance->GetGameObject(*itr))
|
||||
{
|
||||
gobject->SetRespawnTime(0);
|
||||
gobject->UpdateObjectVisibility(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
for (std::set<uint64>::const_iterator itr = _initalFlamesSet.begin(); itr != _initalFlamesSet.end(); ++itr)
|
||||
if (GameObject* gobject = instance->GetGameObject(*itr))
|
||||
{
|
||||
gobject->SetRespawnTime(0);
|
||||
gobject->UpdateObjectVisibility(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_FINAL_BARRELS_FLAME:
|
||||
{
|
||||
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
|
||||
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
|
||||
|
||||
if (_encounterProgress == ENCOUNTER_PROGRESS_NONE)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
player->KilledMonsterCredit(NPC_LODGE_QUEST_TRIGGER, 0);
|
||||
}
|
||||
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
|
||||
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
|
||||
|
||||
for (std::set<uint64>::const_iterator itr = _finalFlamesSet.begin(); itr != _finalFlamesSet.end(); ++itr)
|
||||
if (GameObject* gobject = instance->GetGameObject(*itr))
|
||||
if (_encounterProgress == ENCOUNTER_PROGRESS_NONE)
|
||||
{
|
||||
gobject->SetRespawnTime(0);
|
||||
gobject->UpdateObjectVisibility(true);
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
player->KilledMonsterCredit(NPC_LODGE_QUEST_TRIGGER, 0);
|
||||
}
|
||||
|
||||
for (std::set<uint64>::const_iterator itr = _prisonersSet.begin(); itr != _prisonersSet.end(); ++itr)
|
||||
if (Creature* orc = instance->GetCreature(*itr))
|
||||
if (roll_chance_i(25))
|
||||
orc->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
|
||||
|
||||
SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_BARRELS);
|
||||
DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, 0);
|
||||
break;
|
||||
}
|
||||
for (std::set<uint64>::const_iterator itr = _finalFlamesSet.begin(); itr != _finalFlamesSet.end(); ++itr)
|
||||
if (GameObject* gobject = instance->GetGameObject(*itr))
|
||||
{
|
||||
gobject->SetRespawnTime(0);
|
||||
gobject->UpdateObjectVisibility(true);
|
||||
}
|
||||
|
||||
for (std::set<uint64>::const_iterator itr = _prisonersSet.begin(); itr != _prisonersSet.end(); ++itr)
|
||||
if (Creature* orc = instance->GetCreature(*itr))
|
||||
if (roll_chance_i(25))
|
||||
orc->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
|
||||
|
||||
SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_BARRELS);
|
||||
DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, 0);
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON_LIEUTENANT:
|
||||
{
|
||||
instance->LoadGrid(instancePositions[2].GetPositionX(), instancePositions[2].GetPositionY());
|
||||
if (Creature* drake = instance->SummonCreature(NPC_LIEUTENANT_DRAKE, instancePositions[2]))
|
||||
{
|
||||
drake->AI()->Talk(0);
|
||||
}
|
||||
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
|
||||
}
|
||||
case EVENT_THRALL_REPOSITION:
|
||||
{
|
||||
if (Creature* thrall = instance->GetCreature(_thrallGUID))
|
||||
{
|
||||
if (!thrall->IsAlive())
|
||||
instance->LoadGrid(instancePositions[2].GetPositionX(), instancePositions[2].GetPositionY());
|
||||
if (Creature* drake = instance->SummonCreature(NPC_LIEUTENANT_DRAKE, instancePositions[2]))
|
||||
{
|
||||
++_attemptsCount;
|
||||
EnsureGridLoaded();
|
||||
thrall->SetVisible(false);
|
||||
Reposition(thrall);
|
||||
thrall->setDeathState(DEAD);
|
||||
thrall->Respawn();
|
||||
thrall->SetVisible(true);
|
||||
SaveToDB();
|
||||
drake->AI()->Talk(0);
|
||||
}
|
||||
else
|
||||
thrall->AI()->Reset();
|
||||
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
|
||||
}
|
||||
case EVENT_THRALL_REPOSITION:
|
||||
{
|
||||
if (Creature* thrall = instance->GetCreature(_thrallGUID))
|
||||
{
|
||||
if (!thrall->IsAlive())
|
||||
{
|
||||
++_attemptsCount;
|
||||
EnsureGridLoaded();
|
||||
thrall->SetVisible(false);
|
||||
Reposition(thrall);
|
||||
thrall->setDeathState(DEAD);
|
||||
thrall->Respawn();
|
||||
thrall->SetVisible(true);
|
||||
SaveToDB();
|
||||
}
|
||||
else
|
||||
thrall->AI()->Reset();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "O H " << _encounterProgress << ' ' << _attemptsCount;
|
||||
saveStream << "O H " << _encounterProgress << ' ' << _attemptsCount;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
@@ -326,18 +326,18 @@ public:
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounterProgress;
|
||||
uint32 _barrelCount;
|
||||
uint32 _attemptsCount;
|
||||
private:
|
||||
uint32 _encounterProgress;
|
||||
uint32 _barrelCount;
|
||||
uint32 _attemptsCount;
|
||||
|
||||
uint64 _thrallGUID;
|
||||
uint64 _tarethaGUID;
|
||||
std::set<uint64> _initalFlamesSet;
|
||||
std::set<uint64> _finalFlamesSet;
|
||||
std::set<uint64> _prisonersSet;
|
||||
uint64 _thrallGUID;
|
||||
uint64 _tarethaGUID;
|
||||
std::set<uint64> _initalFlamesSet;
|
||||
std::set<uint64> _finalFlamesSet;
|
||||
std::set<uint64> _prisonersSet;
|
||||
|
||||
EventMap _events;
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Originally written by Xinef - Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
/*
|
||||
* Originally written by Xinef - Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
creature->AI()->DoAction(instance->GetData(DATA_ESCORT_PROGRESS));
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_QUESTGIVER);
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
combatEvents.Reset();
|
||||
summons.DespawnAll();
|
||||
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
instance->SetData(DATA_THRALL_REPOSITION, 1);
|
||||
|
||||
uint32 data = instance->GetData(DATA_ESCORT_PROGRESS);
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_ITEM);
|
||||
break;
|
||||
case EVENT_DRESSING_SHIELD:
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_ITEM);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, THRALL_SHIELD_ITEM);
|
||||
break;
|
||||
case EVENT_DRESSING_TALK:
|
||||
instance->SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_THRALL_ARMORED);
|
||||
@@ -608,7 +608,7 @@ public:
|
||||
case EVENT_SUMMON_CHRONO:
|
||||
if (Creature* epoch = me->SummonCreature(NPC_EPOCH_HUNTER, 2640.49f, 696.15f, 64.31f, 4.51f, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
epoch->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
epoch->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
epoch->AI()->Talk(SAY_EPOCH_ENTER1);
|
||||
}
|
||||
break;
|
||||
@@ -691,21 +691,21 @@ public:
|
||||
case EVENT_CALL_EPOCH:
|
||||
if (Creature* epoch = summons.GetCreatureWithEntry(NPC_EPOCH_HUNTER))
|
||||
{
|
||||
epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
epoch->GetMotionMaster()->MovePoint(0, *me, false, true);
|
||||
}
|
||||
break;
|
||||
case EVENT_THRALL_FACE_TARETHA:
|
||||
{
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
player->KilledMonsterCredit(20156, 0);
|
||||
{
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
player->KilledMonsterCredit(20156, 0);
|
||||
|
||||
me->SetFacingTo(5.76f);
|
||||
break;
|
||||
}
|
||||
me->SetFacingTo(5.76f);
|
||||
break;
|
||||
}
|
||||
case EVENT_THRALL_TALK_4:
|
||||
Talk(SAY_GREET_TARETHA);
|
||||
break;
|
||||
@@ -747,7 +747,7 @@ public:
|
||||
Talk(SAY_EVENT_COMPLETE);
|
||||
break;
|
||||
case EVENT_THRALL_RUN_AWAY:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
SetEscortPaused(false);
|
||||
break;
|
||||
@@ -796,19 +796,19 @@ public:
|
||||
SetEscortPaused(true);
|
||||
SetDespawnAtEnd(false);
|
||||
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
if (data < ENCOUNTER_PROGRESS_THRALL_ARMORED)
|
||||
{
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
|
||||
me->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->SetDisplayId(THRALL_MODEL_EQUIPPED);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_ITEM);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_ITEM);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, THRALL_SHIELD_ITEM);
|
||||
}
|
||||
|
||||
switch (data)
|
||||
@@ -834,13 +834,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
EventMap combatEvents;
|
||||
SummonList summons;
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
EventMap combatEvents;
|
||||
SummonList summons;
|
||||
|
||||
bool _mounted;
|
||||
bool _mounted;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -895,7 +895,7 @@ public:
|
||||
me->CastSpell(me, SPELL_SHADOW_PRISON, true);
|
||||
}
|
||||
|
||||
void AttackStart(Unit*) override { }
|
||||
void AttackStart(Unit*) override { }
|
||||
void MoveInLineOfSight(Unit*) override { }
|
||||
};
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_MEDIVH)))
|
||||
{
|
||||
me->SetHomePosition(medivh->GetPositionX() + 14.0f*cos(medivh->GetAngle(me)), medivh->GetPositionY() + 14.0f*sin(medivh->GetAngle(me)), medivh->GetPositionZ(), me->GetAngle(medivh));
|
||||
me->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(medivh->GetAngle(me)), medivh->GetPositionY() + 14.0f * sin(medivh->GetAngle(me)), medivh->GetPositionZ(), me->GetAngle(medivh));
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
|
||||
const Position PortalLocation[4]=
|
||||
const Position PortalLocation[4] =
|
||||
{
|
||||
{-2041.06f, 7042.08f, 29.99f, 1.30f},
|
||||
{-1968.18f, 7042.11f, 21.93f, 2.12f},
|
||||
@@ -138,26 +138,26 @@ public:
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_AEONUS:
|
||||
{
|
||||
encounters[type] = DONE;
|
||||
SaveToDB();
|
||||
{
|
||||
encounters[type] = DONE;
|
||||
SaveToDB();
|
||||
|
||||
if (Creature* medivh = instance->GetCreature(_medivhGUID))
|
||||
medivh->AI()->DoAction(ACTION_OUTRO);
|
||||
if (Creature* medivh = instance->GetCreature(_medivhGUID))
|
||||
medivh->AI()->DoAction(ACTION_OUTRO);
|
||||
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL);
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL);
|
||||
|
||||
if (player->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (player->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TYPE_CHRONO_LORD_DEJA:
|
||||
case TYPE_TEMPORUS:
|
||||
encounters[type] = DONE;
|
||||
@@ -243,19 +243,27 @@ public:
|
||||
int32 entry = 0;
|
||||
switch (_currentRift)
|
||||
{
|
||||
case 6: entry = GetData(TYPE_CHRONO_LORD_DEJA) == DONE ? (instance->IsHeroic() ? NPC_INFINITE_CHRONO_LORD : -NPC_CHRONO_LORD_DEJA) : NPC_CHRONO_LORD_DEJA; break;
|
||||
case 12: entry = GetData(TYPE_TEMPORUS) == DONE ? (instance->IsHeroic() ? NPC_INFINITE_TIMEREAVER : -NPC_TEMPORUS) : NPC_TEMPORUS; break;
|
||||
case 18: entry = NPC_AEONUS; break;
|
||||
default: entry = RAND(NPC_RIFT_KEEPER_WARLOCK, NPC_RIFT_KEEPER_MAGE, NPC_RIFT_LORD, NPC_RIFT_LORD_2); break;
|
||||
case 6:
|
||||
entry = GetData(TYPE_CHRONO_LORD_DEJA) == DONE ? (instance->IsHeroic() ? NPC_INFINITE_CHRONO_LORD : -NPC_CHRONO_LORD_DEJA) : NPC_CHRONO_LORD_DEJA;
|
||||
break;
|
||||
case 12:
|
||||
entry = GetData(TYPE_TEMPORUS) == DONE ? (instance->IsHeroic() ? NPC_INFINITE_TIMEREAVER : -NPC_TEMPORUS) : NPC_TEMPORUS;
|
||||
break;
|
||||
case 18:
|
||||
entry = NPC_AEONUS;
|
||||
break;
|
||||
default:
|
||||
entry = RAND(NPC_RIFT_KEEPER_WARLOCK, NPC_RIFT_KEEPER_MAGE, NPC_RIFT_LORD, NPC_RIFT_LORD_2);
|
||||
break;
|
||||
}
|
||||
|
||||
Position pos;
|
||||
rift->GetNearPosition(pos, 10.0f, 2*M_PI*rand_norm());
|
||||
rift->GetNearPosition(pos, 10.0f, 2 * M_PI * rand_norm());
|
||||
|
||||
if (TempSummon* summon = instance->SummonCreature(abs(entry), pos))
|
||||
{
|
||||
summon->SetTempSummonType(TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
summon->SetTimer(3*MINUTE*IN_MILLISECONDS);
|
||||
summon->SetTimer(3 * MINUTE * IN_MILLISECONDS);
|
||||
|
||||
if (entry < 0)
|
||||
summon->SetLootMode(0);
|
||||
@@ -283,7 +291,7 @@ public:
|
||||
|
||||
if (instance->GetCreature(_medivhGUID))
|
||||
{
|
||||
uint8 position = (_currentRift-1)%4;
|
||||
uint8 position = (_currentRift - 1) % 4;
|
||||
instance->SummonCreature(NPC_TIME_RIFT, PortalLocation[position]);
|
||||
}
|
||||
break;
|
||||
@@ -329,8 +337,8 @@ public:
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
EventMap Events;
|
||||
protected:
|
||||
EventMap Events;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -95,12 +95,12 @@ public:
|
||||
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f, creature->GetPositionY(), creature->GetPositionZ()));
|
||||
airArray.push_back(G3D::Vector3(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ()));
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f*cos(2.0f*M_PI*i/10.0f), creature->GetPositionY() + 8.0f*sin(2.0f*M_PI*i/10.0f), creature->GetPositionZ()));
|
||||
groundArray.push_back(G3D::Vector3(creature->GetPositionX() + 8.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 8.0f * sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ()));
|
||||
|
||||
for (uint8 i = 0; i < 40; ++i)
|
||||
airArray.push_back(G3D::Vector3(creature->GetPositionX() + i*0.25f*cos(2.0f*M_PI*i/10.0f), creature->GetPositionY() + i*0.25f*sin(2.0f*M_PI*i/10.0f), creature->GetPositionZ() + i/4.0f));
|
||||
airArray.push_back(G3D::Vector3(creature->GetPositionX() + i * 0.25f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + i * 0.25f * sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
|
||||
for (uint8 i = 40; i < 80; ++i)
|
||||
airArray.push_back(G3D::Vector3(creature->GetPositionX() + 10.0f*cos(2.0f*M_PI*i/10.0f), creature->GetPositionY() + 10.0f*sin(2.0f*M_PI*i/10.0f), creature->GetPositionZ() + i/4.0f));
|
||||
airArray.push_back(G3D::Vector3(creature->GetPositionX() + 10.0f * cos(2.0f * M_PI * i / 10.0f), creature->GetPositionY() + 10.0f * sin(2.0f * M_PI * i / 10.0f), creature->GetPositionZ() + i / 4.0f));
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
@@ -196,9 +196,9 @@ public:
|
||||
case EVENT_CHECK_HEALTH_25:
|
||||
case EVENT_CHECK_HEALTH_50:
|
||||
case EVENT_CHECK_HEALTH_75:
|
||||
if (instance && instance->GetData(DATA_SHIELD_PERCENT) <= eventId*25)
|
||||
if (instance && instance->GetData(DATA_SHIELD_PERCENT) <= eventId * 25)
|
||||
{
|
||||
Talk(eventId-1);
|
||||
Talk(eventId - 1);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(eventId, 500);
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -256,11 +256,11 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
if (Creature* cr = me->SummonCreature(NPC_SHADOW_COUNCIL_ENFORCER, -2091.731f, 7133.083f - 3.0f*i, 34.589f, 0.0f))
|
||||
if (Creature* cr = me->SummonCreature(NPC_SHADOW_COUNCIL_ENFORCER, -2091.731f, 7133.083f - 3.0f * i, 34.589f, 0.0f))
|
||||
{
|
||||
cr->GetMotionMaster()->MovePoint(0, (first && i == 3) ? x+2.0f : x, cr->GetPositionY()+y, cr->GetMap()->GetHeight(x, cr->GetPositionY()+y, MAX_HEIGHT, true));
|
||||
cr->m_Events.AddEvent(new NpcRunToHome(*cr), cr->m_Events.CalculateTime(homeTime+urand(0, 2000)));
|
||||
cr->DespawnOrUnsummon(duration+urand(0, 2000));
|
||||
cr->GetMotionMaster()->MovePoint(0, (first && i == 3) ? x + 2.0f : x, cr->GetPositionY() + y, cr->GetMap()->GetHeight(x, cr->GetPositionY() + y, MAX_HEIGHT, true));
|
||||
cr->m_Events.AddEvent(new NpcRunToHome(*cr), cr->m_Events.CalculateTime(homeTime + urand(0, 2000)));
|
||||
cr->DespawnOrUnsummon(duration + urand(0, 2000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,14 +316,15 @@ public:
|
||||
void DoSummonAtRift(uint32 entry)
|
||||
{
|
||||
Position pos;
|
||||
me->GetNearPosition(pos, 10.0f, 2*M_PI*rand_norm());
|
||||
me->GetNearPosition(pos, 10.0f, 2 * M_PI * rand_norm());
|
||||
|
||||
if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 150000))
|
||||
if (instance) {
|
||||
if (instance)
|
||||
{
|
||||
if (Unit* medivh = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_MEDIVH)))
|
||||
{
|
||||
float o = medivh->GetAngle(summon) + frand(-1.0f, 1.0f);
|
||||
summon->SetHomePosition(medivh->GetPositionX() + 14.0f*cos(o), medivh->GetPositionY() + 14.0f*sin(o), medivh->GetPositionZ(), summon->GetAngle(medivh));
|
||||
summon->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(o), medivh->GetPositionY() + 14.0f * sin(o), medivh->GetPositionZ(), summon->GetAngle(medivh));
|
||||
summon->GetMotionMaster()->MoveTargetedHome();
|
||||
summon->SetReactState(REACT_DEFENSIVE);
|
||||
}
|
||||
@@ -376,29 +377,29 @@ public:
|
||||
|
||||
class spell_black_morass_corrupt_medivh : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_morass_corrupt_medivh() : SpellScriptLoader("spell_black_morass_corrupt_medivh") { }
|
||||
public:
|
||||
spell_black_morass_corrupt_medivh() : SpellScriptLoader("spell_black_morass_corrupt_medivh") { }
|
||||
|
||||
class spell_black_morass_corrupt_medivh_AuraScript : public AuraScript
|
||||
class spell_black_morass_corrupt_medivh_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_morass_corrupt_medivh_AuraScript);
|
||||
|
||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_black_morass_corrupt_medivh_AuraScript);
|
||||
|
||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
|
||||
instance->SetData(DATA_DAMAGE_SHIELD, 1);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_corrupt_medivh_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_morass_corrupt_medivh_AuraScript();
|
||||
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
|
||||
instance->SetData(DATA_DAMAGE_SHIELD, 1);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_corrupt_medivh_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_morass_corrupt_medivh_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_the_black_morass()
|
||||
|
||||
@@ -63,7 +63,7 @@ enum CreatureIds
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
{
|
||||
SPELL_RIFT_CHANNEL = 31387,
|
||||
|
||||
EVENT_NEXT_PORTAL = 1,
|
||||
|
||||
@@ -8,46 +8,46 @@
|
||||
|
||||
class instance_dire_maul : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_dire_maul() : InstanceMapScript("instance_dire_maul", 429) { }
|
||||
public:
|
||||
instance_dire_maul() : InstanceMapScript("instance_dire_maul", 429) { }
|
||||
|
||||
struct instance_dire_maul_InstanceMapScript : public InstanceScript
|
||||
struct instance_dire_maul_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_dire_maul_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
instance_dire_maul_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
_eastWingProgress = 0;
|
||||
_westWingProgress = 0;
|
||||
_pylonsState = 0;
|
||||
_northWingProgress = 0;
|
||||
_northWingBosses = 0;
|
||||
_immoltharGUID = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
_eastWingProgress = 0;
|
||||
_westWingProgress = 0;
|
||||
_pylonsState = 0;
|
||||
_northWingProgress = 0;
|
||||
_northWingBosses = 0;
|
||||
_immoltharGUID = 0;
|
||||
case NPC_IMMOL_THAR:
|
||||
_immoltharGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HIGHBORNE_SUMMONER:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
creature->DespawnOrUnsummon(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_IMMOL_THAR:
|
||||
_immoltharGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HIGHBORNE_SUMMONER:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
creature->DespawnOrUnsummon(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_DIRE_MAUL_FORCE_FIELD:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_GORDOK_TRIBUTE:
|
||||
case GO_DIRE_MAUL_FORCE_FIELD:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_GORDOK_TRIBUTE:
|
||||
{
|
||||
uint32 fullLootMode = 0x3F;
|
||||
for (uint32 i = 0; i < _northWingBosses; ++i)
|
||||
@@ -56,98 +56,98 @@ class instance_dire_maul : public InstanceMapScript
|
||||
gameobject->SetLootMode(fullLootMode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_EAST_WING_PROGRESS:
|
||||
_eastWingProgress = data;
|
||||
instance->LoadGrid(-56.59f, -269.12f);
|
||||
break;
|
||||
case TYPE_WEST_WING_PROGRESS:
|
||||
_westWingProgress = data;
|
||||
instance->LoadGrid(132.626f, 625.913f);
|
||||
break;
|
||||
case TYPE_NORTH_WING_PROGRESS:
|
||||
_northWingProgress = data;
|
||||
break;
|
||||
case TYPE_NORTH_WING_BOSSES:
|
||||
_northWingBosses |= (1 << _northWingBosses);
|
||||
break;
|
||||
case TYPE_PYLONS_STATE:
|
||||
if (_pylonsState & data)
|
||||
return;
|
||||
_pylonsState |= data;
|
||||
if (_pylonsState == ALL_PYLONS_OFF) // all five active, 31
|
||||
{
|
||||
instance->LoadGrid(-38.08f, 812.44f);
|
||||
if (Creature* immol = instance->GetCreature(_immoltharGUID))
|
||||
{
|
||||
immol->setActive(true);
|
||||
immol->GetAI()->SetData(1, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_EAST_WING_PROGRESS)
|
||||
return _eastWingProgress;
|
||||
else if (type == TYPE_WEST_WING_PROGRESS)
|
||||
return _westWingProgress;
|
||||
else if (type == TYPE_NORTH_WING_PROGRESS)
|
||||
return _northWingProgress;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D M " << _eastWingProgress << ' ' << _westWingProgress << ' ' << _pylonsState << ' ' << _northWingProgress << ' ' << _northWingBosses;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'D' && dataHead2 == 'M')
|
||||
{
|
||||
loadStream >> _eastWingProgress;
|
||||
loadStream >> _westWingProgress;
|
||||
loadStream >> _pylonsState;
|
||||
loadStream >> _northWingProgress;
|
||||
loadStream >> _northWingBosses;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _eastWingProgress;
|
||||
uint32 _westWingProgress;
|
||||
uint32 _pylonsState;
|
||||
uint32 _northWingProgress;
|
||||
uint32 _northWingBosses;
|
||||
|
||||
uint64 _immoltharGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_dire_maul_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_EAST_WING_PROGRESS:
|
||||
_eastWingProgress = data;
|
||||
instance->LoadGrid(-56.59f, -269.12f);
|
||||
break;
|
||||
case TYPE_WEST_WING_PROGRESS:
|
||||
_westWingProgress = data;
|
||||
instance->LoadGrid(132.626f, 625.913f);
|
||||
break;
|
||||
case TYPE_NORTH_WING_PROGRESS:
|
||||
_northWingProgress = data;
|
||||
break;
|
||||
case TYPE_NORTH_WING_BOSSES:
|
||||
_northWingBosses |= (1 << _northWingBosses);
|
||||
break;
|
||||
case TYPE_PYLONS_STATE:
|
||||
if (_pylonsState & data)
|
||||
return;
|
||||
_pylonsState |= data;
|
||||
if (_pylonsState == ALL_PYLONS_OFF) // all five active, 31
|
||||
{
|
||||
instance->LoadGrid(-38.08f, 812.44f);
|
||||
if (Creature* immol = instance->GetCreature(_immoltharGUID))
|
||||
{
|
||||
immol->setActive(true);
|
||||
immol->GetAI()->SetData(1, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_EAST_WING_PROGRESS)
|
||||
return _eastWingProgress;
|
||||
else if (type == TYPE_WEST_WING_PROGRESS)
|
||||
return _westWingProgress;
|
||||
else if (type == TYPE_NORTH_WING_PROGRESS)
|
||||
return _northWingProgress;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D M " << _eastWingProgress << ' ' << _westWingProgress << ' ' << _pylonsState << ' ' << _northWingProgress << ' ' << _northWingBosses;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'D' && dataHead2 == 'M')
|
||||
{
|
||||
loadStream >> _eastWingProgress;
|
||||
loadStream >> _westWingProgress;
|
||||
loadStream >> _pylonsState;
|
||||
loadStream >> _northWingProgress;
|
||||
loadStream >> _northWingBosses;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _eastWingProgress;
|
||||
uint32 _westWingProgress;
|
||||
uint32 _pylonsState;
|
||||
uint32 _northWingProgress;
|
||||
uint32 _northWingBosses;
|
||||
|
||||
uint64 _immoltharGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_dire_maul_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_dire_maul()
|
||||
|
||||
@@ -8,78 +8,78 @@
|
||||
|
||||
class instance_maraudon : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_maraudon() : InstanceMapScript("instance_maraudon", 349) { }
|
||||
public:
|
||||
instance_maraudon() : InstanceMapScript("instance_maraudon", 349) { }
|
||||
|
||||
struct instance_maraudon_InstanceMapScript : public InstanceScript
|
||||
struct instance_maraudon_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_maraudon_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
instance_maraudon_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_CORRUPTION_SPEWER:
|
||||
if (_encounters[TYPE_NOXXION] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_NOXXION:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "M A " << _encounters[0];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'M' && dataHead2 == 'A')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_maraudon_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_CORRUPTION_SPEWER:
|
||||
if (_encounters[TYPE_NOXXION] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_NOXXION:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "M A " << _encounters[0];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'M' && dataHead2 == 'A')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_maraudon_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_maraudon()
|
||||
|
||||
@@ -74,13 +74,13 @@ static sOnyxMove OnyxiaMoveData[] =
|
||||
{
|
||||
{0, 0, 0, -64.496f, -214.906f, -84.4f, 0.0f}, // south ground
|
||||
{1, 5, SPELL_BREATH_S_TO_N, -64.496f, -214.906f, -60.0f, 0.0f}, // south
|
||||
{2, 6, SPELL_BREATH_SW_TO_NE, -59.809f, -190.758f, -60.0f, 7*M_PI/4}, // south-west
|
||||
{3, 7, SPELL_BREATH_W_TO_E, -29.450f, -180.600f, -60.0f, M_PI+M_PI/2}, // west
|
||||
{4, 8, SPELL_BREATH_NW_TO_SE, 6.895f, -180.246f, -60.0f, M_PI+M_PI/4}, // north-west
|
||||
{2, 6, SPELL_BREATH_SW_TO_NE, -59.809f, -190.758f, -60.0f, 7 * M_PI / 4}, // south-west
|
||||
{3, 7, SPELL_BREATH_W_TO_E, -29.450f, -180.600f, -60.0f, M_PI + M_PI / 2}, // west
|
||||
{4, 8, SPELL_BREATH_NW_TO_SE, 6.895f, -180.246f, -60.0f, M_PI + M_PI / 4}, // north-west
|
||||
{5, 1, SPELL_BREATH_N_TO_S, 22.876f, -217.152f, -60.0f, M_PI}, // north
|
||||
{6, 2, SPELL_BREATH_NE_TO_SW, 10.2191f, -247.912f, -60.0f, 3*M_PI/4}, // north-east
|
||||
{7, 3, SPELL_BREATH_E_TO_W, -31.496f, -250.123f, -60.0f, M_PI/2}, // east
|
||||
{8, 4, SPELL_BREATH_SE_TO_NW, -63.5156f, -240.096f, -60.0f, M_PI/4}, // south-east
|
||||
{6, 2, SPELL_BREATH_NE_TO_SW, 10.2191f, -247.912f, -60.0f, 3 * M_PI / 4}, // north-east
|
||||
{7, 3, SPELL_BREATH_E_TO_W, -31.496f, -250.123f, -60.0f, M_PI / 2}, // east
|
||||
{8, 4, SPELL_BREATH_SE_TO_NW, -63.5156f, -240.096f, -60.0f, M_PI / 4}, // south-east
|
||||
};
|
||||
|
||||
enum Yells
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if( me->GetVictim() || me->GetDistance(who) > 30.0f )
|
||||
return;
|
||||
@@ -214,16 +214,16 @@ public:
|
||||
m_pInstance->SetData(DATA_ONYXIA, DONE);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 & /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
switch( Phase )
|
||||
{
|
||||
case 1:
|
||||
if( me->GetHealth()*100 / me->GetMaxHealth() <= 65 )
|
||||
if( me->GetHealth() * 100 / me->GetMaxHealth() <= 65 )
|
||||
SetPhase(2);
|
||||
break;
|
||||
case 2:
|
||||
if( me->GetHealth()*100 / me->GetMaxHealth() <= 40 )
|
||||
if( me->GetHealth() * 100 / me->GetMaxHealth() <= 40 )
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
SetPhase(3);
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *pSummoned)
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
if( !pSummoned )
|
||||
return;
|
||||
@@ -261,27 +261,27 @@ public:
|
||||
}
|
||||
}
|
||||
else switch( id )
|
||||
{
|
||||
case 10:
|
||||
me->SetFacingTo(OnyxiaMoveData[0].o);
|
||||
events.ScheduleEvent(EVENT_LIFTOFF, 0);
|
||||
break;
|
||||
case 11:
|
||||
me->SetFacingTo(OnyxiaMoveData[1].o);
|
||||
events.ScheduleEvent(EVENT_FLY_S_TO_N, 0);
|
||||
break;
|
||||
case 12:
|
||||
me->SetFacingTo(OnyxiaMoveData[1].o);
|
||||
events.ScheduleEvent(EVENT_LAND, 0);
|
||||
break;
|
||||
case 13:
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
me->SetSpeed(MOVE_RUN, me->GetCreatureTemplate()->speed_run, false);
|
||||
events.ScheduleEvent(EVENT_PHASE_3_ATTACK, 0);
|
||||
break;
|
||||
}
|
||||
{
|
||||
case 10:
|
||||
me->SetFacingTo(OnyxiaMoveData[0].o);
|
||||
events.ScheduleEvent(EVENT_LIFTOFF, 0);
|
||||
break;
|
||||
case 11:
|
||||
me->SetFacingTo(OnyxiaMoveData[1].o);
|
||||
events.ScheduleEvent(EVENT_FLY_S_TO_N, 0);
|
||||
break;
|
||||
case 12:
|
||||
me->SetFacingTo(OnyxiaMoveData[1].o);
|
||||
events.ScheduleEvent(EVENT_LAND, 0);
|
||||
break;
|
||||
case 13:
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
me->SetSpeed(MOVE_RUN, me->GetCreatureTemplate()->speed_run, false);
|
||||
events.ScheduleEvent(EVENT_PHASE_3_ATTACK, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleWhelpSpam(const uint32 diff)
|
||||
@@ -293,8 +293,8 @@ public:
|
||||
whelpSpamTimer -= diff;
|
||||
if( whelpSpamTimer <= 0 )
|
||||
{
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
float dist = rand_norm()*4.0f;
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
float dist = rand_norm() * 4.0f;
|
||||
me->CastSpell(-33.18f + cos(angle)*dist, -258.80f + sin(angle)*dist, -89.0f, 17646, true);
|
||||
me->CastSpell(-32.535f + cos(angle)*dist, -170.190f + sin(angle)*dist, -89.0f, 17646, true);
|
||||
whelpCount += 2;
|
||||
@@ -372,7 +372,7 @@ public:
|
||||
me->SetHover(true);
|
||||
me->SetOrientation(OnyxiaMoveData[0].o);
|
||||
me->SendMovementFlagUpdate();
|
||||
me->GetMotionMaster()->MoveTakeoff(11, OnyxiaMoveData[1].x+1.0f, OnyxiaMoveData[1].y, OnyxiaMoveData[1].z, 12.0f);
|
||||
me->GetMotionMaster()->MoveTakeoff(11, OnyxiaMoveData[1].x + 1.0f, OnyxiaMoveData[1].y, OnyxiaMoveData[1].z, 12.0f);
|
||||
bManyWhelpsAvailable = true;
|
||||
events.PopEvent();
|
||||
events.RescheduleEvent(EVENT_END_MANY_WHELPS_TIME, 10000);
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
{
|
||||
Talk(SAY_PHASE_3_TRANS);
|
||||
me->SendMeleeAttackStop(me->GetVictim());
|
||||
me->GetMotionMaster()->MoveLand(13, OnyxiaMoveData[0].x+1.0f, OnyxiaMoveData[0].y, OnyxiaMoveData[0].z, 12.0f);
|
||||
me->GetMotionMaster()->MoveLand(13, OnyxiaMoveData[0].x + 1.0f, OnyxiaMoveData[0].y, OnyxiaMoveData[0].z, 12.0f);
|
||||
events.PopEvent();
|
||||
DoResetThreat();
|
||||
}
|
||||
@@ -518,8 +518,8 @@ public:
|
||||
break;
|
||||
case EVENT_SUMMON_WHELP:
|
||||
{
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
float dist = rand_norm()*4.0f;
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
float dist = rand_norm() * 4.0f;
|
||||
me->CastSpell(-33.18f + cos(angle)*dist, -258.80f + sin(angle)*dist, -89.0f, 17646, true);
|
||||
me->CastSpell(-32.535f + cos(angle)*dist, -170.190f + sin(angle)*dist, -89.0f, 17646, true);
|
||||
events.RepeatEvent(30000);
|
||||
@@ -558,7 +558,7 @@ public:
|
||||
|
||||
EventMap events;
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if( me->GetVictim() || me->GetDistance(who) > 20.0f )
|
||||
return;
|
||||
@@ -620,7 +620,7 @@ public:
|
||||
{
|
||||
npc_onyxia_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) {}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if( me->GetVictim() || me->GetDistance(who) > 20.0f )
|
||||
return;
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for( uint8 i=0; i<MAX_ENCOUNTER; ++i )
|
||||
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
|
||||
if( m_auiEncounter[i] == IN_PROGRESS )
|
||||
return true;
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
{
|
||||
case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER:
|
||||
case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER:
|
||||
return ManyWhelpsCounter>=50;
|
||||
return ManyWhelpsCounter >= 50;
|
||||
case ACHIEV_CRITERIA_DEEP_BREATH_10_PLAYER:
|
||||
case ACHIEV_CRITERIA_DEEP_BREATH_25_PLAYER:
|
||||
return bDeepBreath;
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
|
||||
class instance_ragefire_chasm : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_ragefire_chasm() : InstanceMapScript("instance_ragefire_chasm", 389) { }
|
||||
public:
|
||||
instance_ragefire_chasm() : InstanceMapScript("instance_ragefire_chasm", 389) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_ragefire_chasm_InstanceMapScript(map);
|
||||
}
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_ragefire_chasm_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_ragefire_chasm_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_ragefire_chasm_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
};
|
||||
struct instance_ragefire_chasm_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_ragefire_chasm_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_ragefire_chasm()
|
||||
|
||||
@@ -9,86 +9,86 @@
|
||||
|
||||
class instance_razorfen_downs : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_razorfen_downs() : InstanceMapScript("instance_razorfen_downs", 129) { }
|
||||
public:
|
||||
instance_razorfen_downs() : InstanceMapScript("instance_razorfen_downs", 129) { }
|
||||
|
||||
struct instance_razorfen_downs_InstanceMapScript : public InstanceScript
|
||||
struct instance_razorfen_downs_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_razorfen_downs_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
instance_razorfen_downs_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_gongPhase = 0;
|
||||
_firesState = 0;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_IDOL_OVEN_FIRE:
|
||||
case GO_IDOL_CUP_FIRE:
|
||||
case GO_IDOL_MOUTH_FIRE:
|
||||
if (_firesState == DONE)
|
||||
gameobject->Delete();
|
||||
break;
|
||||
case GO_GONG:
|
||||
if (_gongPhase == DONE)
|
||||
gameobject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == GO_GONG)
|
||||
return _gongPhase;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
if (type == GO_GONG)
|
||||
_gongPhase = data;
|
||||
else if (type == GO_BELNISTRASZS_BRAZIER)
|
||||
_firesState = DONE;
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "R D " << _gongPhase << ' ' << _firesState;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'R' && dataHead2 == 'D')
|
||||
{
|
||||
loadStream >> _gongPhase;
|
||||
loadStream >> _firesState;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _gongPhase;
|
||||
uint32 _firesState;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_razorfen_downs_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_gongPhase = 0;
|
||||
_firesState = 0;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_IDOL_OVEN_FIRE:
|
||||
case GO_IDOL_CUP_FIRE:
|
||||
case GO_IDOL_MOUTH_FIRE:
|
||||
if (_firesState == DONE)
|
||||
gameobject->Delete();
|
||||
break;
|
||||
case GO_GONG:
|
||||
if (_gongPhase == DONE)
|
||||
gameobject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == GO_GONG)
|
||||
return _gongPhase;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
if (type == GO_GONG)
|
||||
_gongPhase = data;
|
||||
else if (type == GO_BELNISTRASZS_BRAZIER)
|
||||
_firesState = DONE;
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "R D " << _gongPhase << ' ' << _firesState;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'R' && dataHead2 == 'D')
|
||||
{
|
||||
loadStream >> _gongPhase;
|
||||
loadStream >> _firesState;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _gongPhase;
|
||||
uint32 _firesState;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_razorfen_downs_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_razorfen_downs()
|
||||
|
||||
@@ -57,105 +57,105 @@ enum Belnistrasz
|
||||
|
||||
class npc_belnistrasz : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_belnistrasz() : CreatureScript("npc_belnistrasz") { }
|
||||
public:
|
||||
npc_belnistrasz() : CreatureScript("npc_belnistrasz") { }
|
||||
|
||||
struct npc_belnistraszAI : public ScriptedAI
|
||||
struct npc_belnistraszAI : public ScriptedAI
|
||||
{
|
||||
npc_belnistraszAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_belnistraszAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
eventInProgress = false;
|
||||
spawnerCount = 0;
|
||||
}
|
||||
instance = creature->GetInstanceScript();
|
||||
eventInProgress = false;
|
||||
spawnerCount = 0;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
if (!eventInProgress)
|
||||
{
|
||||
if (!eventInProgress)
|
||||
if (!me->HasAura(SPELL_ARCANE_INTELLECT))
|
||||
DoCast(me, SPELL_ARCANE_INTELLECT);
|
||||
|
||||
channeling = false;
|
||||
eventProgress = 0;
|
||||
spawnerCount = 0;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (channeling)
|
||||
Talk(SAY_WATCH_OUT, who);
|
||||
else
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FIREBALL, 1000);
|
||||
events.ScheduleEvent(EVENT_FROST_NOVA, urand(8000, 12000));
|
||||
if (urand(0, 100) > 40)
|
||||
Talk(SAY_AGGRO, who);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
me->DespawnOrUnsummon(5000);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* /*player*/, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_EXTINGUISHING_THE_IDOL)
|
||||
{
|
||||
eventInProgress = true;
|
||||
Talk(SAY_QUEST_ACCEPTED);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
|
||||
me->setFaction(FACTION_ESCORT);
|
||||
me->GetMotionMaster()->MovePath(PATH_ESCORT, false);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == WAYPOINT_MOTION_TYPE && id == POINT_REACH_IDOL)
|
||||
{
|
||||
channeling = true;
|
||||
events.ScheduleEvent(EVENT_CHANNEL, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!eventInProgress)
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
if (!me->HasAura(SPELL_ARCANE_INTELLECT))
|
||||
DoCast(me, SPELL_ARCANE_INTELLECT);
|
||||
|
||||
channeling = false;
|
||||
eventProgress = 0;
|
||||
spawnerCount = 0;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (channeling)
|
||||
Talk(SAY_WATCH_OUT, who);
|
||||
else
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FIREBALL, 1000);
|
||||
events.ScheduleEvent(EVENT_FROST_NOVA, urand(8000, 12000));
|
||||
if (urand(0, 100) > 40)
|
||||
Talk(SAY_AGGRO, who);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
me->DespawnOrUnsummon(5000);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* /*player*/, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_EXTINGUISHING_THE_IDOL)
|
||||
{
|
||||
eventInProgress = true;
|
||||
Talk(SAY_QUEST_ACCEPTED);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
|
||||
me->setFaction(FACTION_ESCORT);
|
||||
me->GetMotionMaster()->MovePath(PATH_ESCORT, false);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == WAYPOINT_MOTION_TYPE && id == POINT_REACH_IDOL)
|
||||
{
|
||||
channeling = true;
|
||||
events.ScheduleEvent(EVENT_CHANNEL, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!eventInProgress)
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CHANNEL:
|
||||
Talk(SAY_EVENT_START);
|
||||
DoCast(me, SPELL_IDOL_SHUTDOWN_VISUAL);
|
||||
events.ScheduleEvent(EVENT_IDOL_ROOM_SPAWNER, 100);
|
||||
events.ScheduleEvent(EVENT_PROGRESS, 120000);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
break;
|
||||
case EVENT_IDOL_ROOM_SPAWNER:
|
||||
if (Creature* creature = me->SummonCreature(NPC_IDOL_ROOM_SPAWNER, PosSummonSpawner[urand(0,2)], TEMPSUMMON_TIMED_DESPAWN, 4000))
|
||||
creature->AI()->SetData(0,spawnerCount);
|
||||
if (++spawnerCount < 8)
|
||||
events.ScheduleEvent(EVENT_IDOL_ROOM_SPAWNER, 35000);
|
||||
break;
|
||||
case EVENT_PROGRESS:
|
||||
case EVENT_CHANNEL:
|
||||
Talk(SAY_EVENT_START);
|
||||
DoCast(me, SPELL_IDOL_SHUTDOWN_VISUAL);
|
||||
events.ScheduleEvent(EVENT_IDOL_ROOM_SPAWNER, 100);
|
||||
events.ScheduleEvent(EVENT_PROGRESS, 120000);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
break;
|
||||
case EVENT_IDOL_ROOM_SPAWNER:
|
||||
if (Creature* creature = me->SummonCreature(NPC_IDOL_ROOM_SPAWNER, PosSummonSpawner[urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN, 4000))
|
||||
creature->AI()->SetData(0, spawnerCount);
|
||||
if (++spawnerCount < 8)
|
||||
events.ScheduleEvent(EVENT_IDOL_ROOM_SPAWNER, 35000);
|
||||
break;
|
||||
case EVENT_PROGRESS:
|
||||
{
|
||||
switch (eventProgress)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_EVENT_THREE_MIN_LEFT);
|
||||
++eventProgress;
|
||||
events.ScheduleEvent(EVENT_PROGRESS, 60000);
|
||||
break;
|
||||
events.ScheduleEvent(EVENT_PROGRESS, 60000);
|
||||
break;
|
||||
case 1:
|
||||
Talk(SAY_EVENT_TWO_MIN_LEFT);
|
||||
++eventProgress;
|
||||
@@ -173,9 +173,9 @@ class npc_belnistrasz : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_COMPLETE, 3000);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case EVENT_COMPLETE:
|
||||
case EVENT_COMPLETE:
|
||||
{
|
||||
DoCast(me, SPELL_IDOM_ROOM_CAMERA_SHAKE);
|
||||
me->SummonGameObject(GO_BELNISTRASZS_BRAZIER, 2577.196f, 947.0781f, 53.16757f, 2.356195f, 0, 0, 0.9238796f, 0.3826832f, 3600);
|
||||
@@ -200,69 +200,69 @@ class npc_belnistrasz : public CreatureScript
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
}
|
||||
case EVENT_FIREBALL:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || !UpdateVictim())
|
||||
return;
|
||||
DoCastVictim(SPELL_FIREBALL);
|
||||
events.ScheduleEvent(EVENT_FIREBALL, 8000);
|
||||
break;
|
||||
case EVENT_FROST_NOVA:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || !UpdateVictim())
|
||||
return;
|
||||
DoCast(me, SPELL_FROST_NOVA);
|
||||
events.ScheduleEvent(EVENT_FROST_NOVA, 15000);
|
||||
break;
|
||||
}
|
||||
case EVENT_FIREBALL:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || !UpdateVictim())
|
||||
return;
|
||||
DoCastVictim(SPELL_FIREBALL);
|
||||
events.ScheduleEvent(EVENT_FIREBALL, 8000);
|
||||
break;
|
||||
case EVENT_FROST_NOVA:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || !UpdateVictim())
|
||||
return;
|
||||
DoCast(me, SPELL_FROST_NOVA);
|
||||
events.ScheduleEvent(EVENT_FROST_NOVA, 15000);
|
||||
break;
|
||||
}
|
||||
if (!channeling)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
bool eventInProgress;
|
||||
bool channeling;
|
||||
uint8 eventProgress;
|
||||
uint8 spawnerCount;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_belnistraszAI>(creature);
|
||||
if (!channeling)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
bool eventInProgress;
|
||||
bool channeling;
|
||||
uint8 eventProgress;
|
||||
uint8 spawnerCount;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_belnistraszAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_idol_room_spawner : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_idol_room_spawner() : CreatureScript("npc_idol_room_spawner") { }
|
||||
public:
|
||||
npc_idol_room_spawner() : CreatureScript("npc_idol_room_spawner") { }
|
||||
|
||||
struct npc_idol_room_spawnerAI : public NullCreatureAI
|
||||
struct npc_idol_room_spawnerAI : public NullCreatureAI
|
||||
{
|
||||
npc_idol_room_spawnerAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
npc_idol_room_spawnerAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void SetData(uint32 /*type*/, uint32 data)
|
||||
{
|
||||
if (data < 7)
|
||||
{
|
||||
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
if (data > 0 && me->GetOrientation() < 4.0f)
|
||||
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
me->SummonCreature(NPC_DEATHS_HEAD_GEOMANCER, me->GetPositionX() + (cos(me->GetOrientation() - (M_PI/2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() - (M_PI/2)) * 2), me->GetPositionZ(), me->GetOrientation());
|
||||
me->SummonCreature(NPC_WITHERED_QUILGUARD, me->GetPositionX() + (cos(me->GetOrientation() + (M_PI/2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() + (M_PI/2)) * 2), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
else if (data == 7)
|
||||
me->SummonCreature(NPC_PLAGUEMAW_THE_ROTTING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_idol_room_spawnerAI>(creature);
|
||||
}
|
||||
|
||||
void SetData(uint32 /*type*/, uint32 data)
|
||||
{
|
||||
if (data < 7)
|
||||
{
|
||||
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
if (data > 0 && me->GetOrientation() < 4.0f)
|
||||
me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
me->SummonCreature(NPC_DEATHS_HEAD_GEOMANCER, me->GetPositionX() + (cos(me->GetOrientation() - (M_PI / 2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() - (M_PI / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
|
||||
me->SummonCreature(NPC_WITHERED_QUILGUARD, me->GetPositionX() + (cos(me->GetOrientation() + (M_PI / 2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() + (M_PI / 2)) * 2), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
else if (data == 7)
|
||||
me->SummonCreature(NPC_PLAGUEMAW_THE_ROTTING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_idol_room_spawnerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_razorfen_downs()
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
|
||||
class instance_razorfen_kraul : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_razorfen_kraul() : InstanceMapScript("instance_razorfen_kraul", 47) { }
|
||||
public:
|
||||
instance_razorfen_kraul() : InstanceMapScript("instance_razorfen_kraul", 47) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_razorfen_kraul_InstanceMapScript(map);
|
||||
}
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_razorfen_kraul_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_razorfen_kraul_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_razorfen_kraul_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
};
|
||||
struct instance_razorfen_kraul_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_razorfen_kraul_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_razorfen_kraul()
|
||||
|
||||
@@ -61,141 +61,141 @@ const Position LarvaPos[2] =
|
||||
|
||||
class boss_ayamiss : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_ayamiss() : CreatureScript("boss_ayamiss") { }
|
||||
public:
|
||||
boss_ayamiss() : CreatureScript("boss_ayamiss") { }
|
||||
|
||||
struct boss_ayamissAI : public BossAI
|
||||
struct boss_ayamissAI : public BossAI
|
||||
{
|
||||
boss_ayamissAI(Creature* creature) : BossAI(creature, DATA_AYAMISS)
|
||||
{
|
||||
boss_ayamissAI(Creature* creature) : BossAI(creature, DATA_AYAMISS)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
_phase = PHASE_AIR;
|
||||
_enraged = false;
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
_phase = PHASE_AIR;
|
||||
_enraged = false;
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* who)
|
||||
void JustSummoned(Creature* who)
|
||||
{
|
||||
switch (who->GetEntry())
|
||||
{
|
||||
switch (who->GetEntry())
|
||||
case NPC_SWARMER:
|
||||
_swarmers.push_back(who->GetGUID());
|
||||
break;
|
||||
case NPC_LARVA:
|
||||
who->GetMotionMaster()->MovePoint(POINT_PARALYZE, AltarPos);
|
||||
break;
|
||||
case NPC_HORNET:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
who->AI()->AttackStart(target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case NPC_SWARMER:
|
||||
_swarmers.push_back(who->GetGUID());
|
||||
case POINT_AIR:
|
||||
me->AddUnitState(UNIT_STATE_ROOT);
|
||||
break;
|
||||
case NPC_LARVA:
|
||||
who->GetMotionMaster()->MovePoint(POINT_PARALYZE, AltarPos);
|
||||
break;
|
||||
case NPC_HORNET:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
who->AI()->AttackStart(target);
|
||||
case POINT_GROUND:
|
||||
me->ClearUnitState(UNIT_STATE_ROOT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->ClearUnitState(UNIT_STATE_ROOT);
|
||||
BossAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* attacker)
|
||||
{
|
||||
BossAI::EnterCombat(attacker);
|
||||
|
||||
events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(20000, 30000));
|
||||
events.ScheduleEvent(EVENT_POISON_STINGER, 5000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
|
||||
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000);
|
||||
events.ScheduleEvent(EVENT_PARALYZE, 15000);
|
||||
|
||||
me->SetCanFly(true);
|
||||
me->SetDisableGravity(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (_phase == PHASE_AIR && me->GetHealthPct() < 70.0f)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case POINT_AIR:
|
||||
me->AddUnitState(UNIT_STATE_ROOT);
|
||||
break;
|
||||
case POINT_GROUND:
|
||||
me->ClearUnitState(UNIT_STATE_ROOT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
_phase = PHASE_GROUND;
|
||||
SetCombatMovement(true);
|
||||
me->SetCanFly(false);
|
||||
Position VictimPos;
|
||||
me->GetVictim()->GetPosition(&VictimPos);
|
||||
me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
|
||||
DoResetThreat();
|
||||
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
|
||||
events.ScheduleEvent(EVENT_TRASH, urand(3000, 6000));
|
||||
events.CancelEvent(EVENT_POISON_STINGER);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
if (!_enraged && me->GetHealthPct() < 20.0f)
|
||||
{
|
||||
me->ClearUnitState(UNIT_STATE_ROOT);
|
||||
BossAI::EnterEvadeMode();
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Talk(EMOTE_FRENZY);
|
||||
_enraged = true;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* attacker)
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
BossAI::EnterCombat(attacker);
|
||||
|
||||
events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(20000, 30000));
|
||||
events.ScheduleEvent(EVENT_POISON_STINGER, 5000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
|
||||
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000);
|
||||
events.ScheduleEvent(EVENT_PARALYZE, 15000);
|
||||
|
||||
me->SetCanFly(true);
|
||||
me->SetDisableGravity(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (_phase == PHASE_AIR && me->GetHealthPct() < 70.0f)
|
||||
switch (eventId)
|
||||
{
|
||||
_phase = PHASE_GROUND;
|
||||
SetCombatMovement(true);
|
||||
me->SetCanFly(false);
|
||||
Position VictimPos;
|
||||
me->GetVictim()->GetPosition(&VictimPos);
|
||||
me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
|
||||
DoResetThreat();
|
||||
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
|
||||
events.ScheduleEvent(EVENT_TRASH, urand(3000, 6000));
|
||||
events.CancelEvent(EVENT_POISON_STINGER);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
case EVENT_STINGER_SPRAY:
|
||||
DoCast(me, SPELL_STINGER_SPRAY);
|
||||
events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_POISON_STINGER:
|
||||
DoCastVictim(SPELL_POISON_STINGER);
|
||||
events.ScheduleEvent(EVENT_POISON_STINGER, urand(2000, 3000));
|
||||
break;
|
||||
case EVENT_PARALYZE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
DoCast(target, SPELL_PARALYZE);
|
||||
instance->SetData64(DATA_PARALYZED, target->GetGUID());
|
||||
uint8 Index = urand(0, 1);
|
||||
me->SummonCreature(NPC_LARVA, LarvaPos[Index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_PARALYZE, 15000);
|
||||
break;
|
||||
case EVENT_SWARMER_ATTACK:
|
||||
for (std::list<uint64>::iterator i = _swarmers.begin(); i != _swarmers.end(); ++i)
|
||||
if (Creature* swarmer = me->GetMap()->GetCreature(*i))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
swarmer->AI()->AttackStart(target);
|
||||
|
||||
if (!_enraged && me->GetHealthPct() < 20.0f)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Talk(EMOTE_FRENZY);
|
||||
_enraged = true;
|
||||
}
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_STINGER_SPRAY:
|
||||
DoCast(me, SPELL_STINGER_SPRAY);
|
||||
events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_POISON_STINGER:
|
||||
DoCastVictim(SPELL_POISON_STINGER);
|
||||
events.ScheduleEvent(EVENT_POISON_STINGER, urand(2000, 3000));
|
||||
break;
|
||||
case EVENT_PARALYZE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
DoCast(target, SPELL_PARALYZE);
|
||||
instance->SetData64(DATA_PARALYZED, target->GetGUID());
|
||||
uint8 Index = urand(0, 1);
|
||||
me->SummonCreature(NPC_LARVA, LarvaPos[Index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_PARALYZE, 15000);
|
||||
break;
|
||||
case EVENT_SWARMER_ATTACK:
|
||||
for (std::list<uint64>::iterator i = _swarmers.begin(); i != _swarmers.end(); ++i)
|
||||
if (Creature* swarmer = me->GetMap()->GetCreature(*i))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
swarmer->AI()->AttackStart(target);
|
||||
|
||||
_swarmers.clear();
|
||||
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000);
|
||||
break;
|
||||
case EVENT_SUMMON_SWARMER:
|
||||
_swarmers.clear();
|
||||
events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000);
|
||||
break;
|
||||
case EVENT_SUMMON_SWARMER:
|
||||
{
|
||||
Position Pos;
|
||||
me->GetRandomPoint(SwarmerPos, 80.0f, Pos);
|
||||
@@ -203,81 +203,81 @@ class boss_ayamiss : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_TRASH:
|
||||
DoCastVictim(SPELL_TRASH);
|
||||
events.ScheduleEvent(EVENT_TRASH, urand(5000, 7000));
|
||||
break;
|
||||
case EVENT_LASH:
|
||||
DoCastVictim(SPELL_LASH);
|
||||
events.ScheduleEvent(EVENT_LASH, urand(8000, 15000));
|
||||
break;
|
||||
}
|
||||
case EVENT_TRASH:
|
||||
DoCastVictim(SPELL_TRASH);
|
||||
events.ScheduleEvent(EVENT_TRASH, urand(5000, 7000));
|
||||
break;
|
||||
case EVENT_LASH:
|
||||
DoCastVictim(SPELL_LASH);
|
||||
events.ScheduleEvent(EVENT_LASH, urand(8000, 15000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
private:
|
||||
std::list<uint64> _swarmers;
|
||||
uint8 _phase;
|
||||
bool _enraged;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_ayamissAI>(creature);
|
||||
}
|
||||
private:
|
||||
std::list<uint64> _swarmers;
|
||||
uint8 _phase;
|
||||
bool _enraged;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_ayamissAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_hive_zara_larva : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_hive_zara_larva() : CreatureScript("npc_hive_zara_larva") { }
|
||||
public:
|
||||
npc_hive_zara_larva() : CreatureScript("npc_hive_zara_larva") { }
|
||||
|
||||
struct npc_hive_zara_larvaAI : public ScriptedAI
|
||||
struct npc_hive_zara_larvaAI : public ScriptedAI
|
||||
{
|
||||
npc_hive_zara_larvaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_hive_zara_larvaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
if (id == POINT_PARALYZE)
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*me, _instance->GetData64(DATA_PARALYZED)))
|
||||
DoCast(target, SPELL_FEED); // Omnomnom
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* victim)
|
||||
{
|
||||
if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(victim);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
ScriptedAI::UpdateAI(diff);
|
||||
}
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_hive_zara_larvaAI>(creature);
|
||||
_instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
if (id == POINT_PARALYZE)
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*me, _instance->GetData64(DATA_PARALYZED)))
|
||||
DoCast(target, SPELL_FEED); // Omnomnom
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* victim)
|
||||
{
|
||||
if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(victim);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
ScriptedAI::UpdateAI(diff);
|
||||
}
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_hive_zara_larvaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_ayamiss()
|
||||
|
||||
@@ -50,216 +50,216 @@ enum Actions
|
||||
|
||||
class boss_buru : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_buru() : CreatureScript("boss_buru") { }
|
||||
public:
|
||||
boss_buru() : CreatureScript("boss_buru") { }
|
||||
|
||||
struct boss_buruAI : public BossAI
|
||||
struct boss_buruAI : public BossAI
|
||||
{
|
||||
boss_buruAI(Creature* creature) : BossAI(creature, DATA_BURU)
|
||||
{
|
||||
boss_buruAI(Creature* creature) : BossAI(creature, DATA_BURU)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
|
||||
for (std::list<uint64>::iterator i = Eggs.begin(); i != Eggs.end(); ++i)
|
||||
if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin()))
|
||||
egg->Respawn();
|
||||
|
||||
Eggs.clear();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(EMOTE_TARGET, who);
|
||||
DoCast(me, SPELL_THORNS);
|
||||
|
||||
events.ScheduleEvent(EVENT_DISMEMBER, 5000);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000);
|
||||
events.ScheduleEvent(EVENT_FULL_SPEED, 60000);
|
||||
|
||||
_phase = PHASE_EGG;
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
{
|
||||
if (action == ACTION_EXPLODE)
|
||||
if (_phase == PHASE_EGG)
|
||||
Unit::DealDamage(me, me, 45000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
ChaseNewVictim();
|
||||
}
|
||||
|
||||
void ChaseNewVictim()
|
||||
{
|
||||
if (_phase != PHASE_EGG)
|
||||
return;
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_FULL_SPEED);
|
||||
me->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000);
|
||||
events.ScheduleEvent(EVENT_FULL_SPEED, 60000);
|
||||
|
||||
if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
AttackStart(victim);
|
||||
Talk(EMOTE_TARGET, victim);
|
||||
}
|
||||
}
|
||||
|
||||
void ManageRespawn(uint64 EggGUID)
|
||||
{
|
||||
ChaseNewVictim();
|
||||
Eggs.push_back(EggGUID);
|
||||
events.ScheduleEvent(EVENT_RESPAWN_EGG, 100000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DISMEMBER:
|
||||
DoCastVictim(SPELL_DISMEMBER);
|
||||
events.ScheduleEvent(EVENT_DISMEMBER, 5000);
|
||||
break;
|
||||
case EVENT_GATHERING_SPEED:
|
||||
DoCast(me, SPELL_GATHERING_SPEED);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000);
|
||||
break;
|
||||
case EVENT_FULL_SPEED:
|
||||
DoCast(me, SPELL_FULL_SPEED);
|
||||
break;
|
||||
case EVENT_CREEPING_PLAGUE:
|
||||
DoCast(me, SPELL_CREEPING_PLAGUE);
|
||||
events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 6000);
|
||||
break;
|
||||
case EVENT_RESPAWN_EGG:
|
||||
if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin()))
|
||||
{
|
||||
egg->Respawn();
|
||||
Eggs.pop_front();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (me->GetHealthPct() < 20.0f && _phase == PHASE_EGG)
|
||||
{
|
||||
DoCast(me, SPELL_BURU_TRANSFORM); // Enrage
|
||||
DoCast(me, SPELL_FULL_SPEED, true);
|
||||
me->RemoveAurasDueToSpell(SPELL_THORNS);
|
||||
_phase = PHASE_TRANSFORM;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint8 _phase;
|
||||
std::list<uint64> Eggs;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_buruAI(creature);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
|
||||
for (std::list<uint64>::iterator i = Eggs.begin(); i != Eggs.end(); ++i)
|
||||
if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin()))
|
||||
egg->Respawn();
|
||||
|
||||
Eggs.clear();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(EMOTE_TARGET, who);
|
||||
DoCast(me, SPELL_THORNS);
|
||||
|
||||
events.ScheduleEvent(EVENT_DISMEMBER, 5000);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000);
|
||||
events.ScheduleEvent(EVENT_FULL_SPEED, 60000);
|
||||
|
||||
_phase = PHASE_EGG;
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
{
|
||||
if (action == ACTION_EXPLODE)
|
||||
if (_phase == PHASE_EGG)
|
||||
Unit::DealDamage(me, me, 45000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
ChaseNewVictim();
|
||||
}
|
||||
|
||||
void ChaseNewVictim()
|
||||
{
|
||||
if (_phase != PHASE_EGG)
|
||||
return;
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_FULL_SPEED);
|
||||
me->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000);
|
||||
events.ScheduleEvent(EVENT_FULL_SPEED, 60000);
|
||||
|
||||
if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
AttackStart(victim);
|
||||
Talk(EMOTE_TARGET, victim);
|
||||
}
|
||||
}
|
||||
|
||||
void ManageRespawn(uint64 EggGUID)
|
||||
{
|
||||
ChaseNewVictim();
|
||||
Eggs.push_back(EggGUID);
|
||||
events.ScheduleEvent(EVENT_RESPAWN_EGG, 100000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DISMEMBER:
|
||||
DoCastVictim(SPELL_DISMEMBER);
|
||||
events.ScheduleEvent(EVENT_DISMEMBER, 5000);
|
||||
break;
|
||||
case EVENT_GATHERING_SPEED:
|
||||
DoCast(me, SPELL_GATHERING_SPEED);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000);
|
||||
break;
|
||||
case EVENT_FULL_SPEED:
|
||||
DoCast(me, SPELL_FULL_SPEED);
|
||||
break;
|
||||
case EVENT_CREEPING_PLAGUE:
|
||||
DoCast(me, SPELL_CREEPING_PLAGUE);
|
||||
events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 6000);
|
||||
break;
|
||||
case EVENT_RESPAWN_EGG:
|
||||
if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin()))
|
||||
{
|
||||
egg->Respawn();
|
||||
Eggs.pop_front();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (me->GetHealthPct() < 20.0f && _phase == PHASE_EGG)
|
||||
{
|
||||
DoCast(me, SPELL_BURU_TRANSFORM); // Enrage
|
||||
DoCast(me, SPELL_FULL_SPEED, true);
|
||||
me->RemoveAurasDueToSpell(SPELL_THORNS);
|
||||
_phase = PHASE_TRANSFORM;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint8 _phase;
|
||||
std::list<uint64> Eggs;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_buruAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_buru_egg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_buru_egg() : CreatureScript("npc_buru_egg") { }
|
||||
public:
|
||||
npc_buru_egg() : CreatureScript("npc_buru_egg") { }
|
||||
|
||||
struct npc_buru_eggAI : public ScriptedAI
|
||||
struct npc_buru_eggAI : public ScriptedAI
|
||||
{
|
||||
npc_buru_eggAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_buru_eggAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_instance = me->GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* attacker)
|
||||
{
|
||||
if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU)))
|
||||
if (!buru->IsInCombat())
|
||||
buru->AI()->AttackStart(attacker);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* who)
|
||||
{
|
||||
if (who->GetEntry() == NPC_HATCHLING)
|
||||
if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU)))
|
||||
if (Unit* target = buru->AI()->SelectTarget(SELECT_TARGET_RANDOM))
|
||||
who->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoCastAOE(SPELL_EXPLODE, true);
|
||||
DoCastAOE(SPELL_EXPLODE_2, true); // Unknown purpose
|
||||
DoCast(me, SPELL_SUMMON_HATCHLING, true);
|
||||
|
||||
if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU)))
|
||||
if (boss_buru::boss_buruAI* buruAI = dynamic_cast<boss_buru::boss_buruAI*>(buru->AI()))
|
||||
buruAI->ManageRespawn(me->GetGUID());
|
||||
}
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_buru_eggAI>(creature);
|
||||
_instance = me->GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* attacker)
|
||||
{
|
||||
if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU)))
|
||||
if (!buru->IsInCombat())
|
||||
buru->AI()->AttackStart(attacker);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* who)
|
||||
{
|
||||
if (who->GetEntry() == NPC_HATCHLING)
|
||||
if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU)))
|
||||
if (Unit* target = buru->AI()->SelectTarget(SELECT_TARGET_RANDOM))
|
||||
who->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoCastAOE(SPELL_EXPLODE, true);
|
||||
DoCastAOE(SPELL_EXPLODE_2, true); // Unknown purpose
|
||||
DoCast(me, SPELL_SUMMON_HATCHLING, true);
|
||||
|
||||
if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU)))
|
||||
if (boss_buru::boss_buruAI* buruAI = dynamic_cast<boss_buru::boss_buruAI*>(buru->AI()))
|
||||
buruAI->ManageRespawn(me->GetGUID());
|
||||
}
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_buru_eggAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_egg_explosion : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_egg_explosion() : SpellScriptLoader("spell_egg_explosion") { }
|
||||
public:
|
||||
spell_egg_explosion() : SpellScriptLoader("spell_egg_explosion") { }
|
||||
|
||||
class spell_egg_explosion_SpellScript : public SpellScript
|
||||
class spell_egg_explosion_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_egg_explosion_SpellScript);
|
||||
|
||||
void HandleAfterCast()
|
||||
{
|
||||
PrepareSpellScript(spell_egg_explosion_SpellScript);
|
||||
|
||||
void HandleAfterCast()
|
||||
{
|
||||
if (Creature* buru = GetCaster()->FindNearestCreature(NPC_BURU, 5.f))
|
||||
buru->AI()->DoAction(ACTION_EXPLODE);
|
||||
}
|
||||
|
||||
void HandleDummyHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
Unit::DealDamage(GetCaster(), target, -16 * GetCaster()->GetDistance(target) + 500);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_egg_explosion_SpellScript::HandleAfterCast);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_egg_explosion_SpellScript::HandleDummyHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_egg_explosion_SpellScript();
|
||||
if (Creature* buru = GetCaster()->FindNearestCreature(NPC_BURU, 5.f))
|
||||
buru->AI()->DoAction(ACTION_EXPLODE);
|
||||
}
|
||||
|
||||
void HandleDummyHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
Unit::DealDamage(GetCaster(), target, -16 * GetCaster()->GetDistance(target) + 500);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_egg_explosion_SpellScript::HandleAfterCast);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_egg_explosion_SpellScript::HandleDummyHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_egg_explosion_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_buru()
|
||||
|
||||
@@ -35,89 +35,89 @@ enum Texts
|
||||
|
||||
class boss_kurinnaxx : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_kurinnaxx() : CreatureScript("boss_kurinnaxx") { }
|
||||
public:
|
||||
boss_kurinnaxx() : CreatureScript("boss_kurinnaxx") { }
|
||||
|
||||
struct boss_kurinnaxxAI : public BossAI
|
||||
struct boss_kurinnaxxAI : public BossAI
|
||||
{
|
||||
boss_kurinnaxxAI(Creature* creature) : BossAI(creature, DATA_KURINNAXX)
|
||||
{
|
||||
boss_kurinnaxxAI(Creature* creature) : BossAI(creature, DATA_KURINNAXX)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
_enraged = false;
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
|
||||
events.ScheduleEvent(EVENT_SANDTRAP, urand(5000, 15000));
|
||||
events.ScheduleEvent(EVENT_TRASH, 1000);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!_enraged && HealthBelowPct(30))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
_enraged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
if (Creature* Ossirian = me->GetMap()->GetCreature(instance->GetData64(DATA_OSSIRIAN)))
|
||||
sCreatureTextMgr->SendChat(Ossirian, SAY_KURINAXX_DEATH, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MORTAL_WOUND:
|
||||
DoCastVictim(SPELL_MORTALWOUND);
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
|
||||
break;
|
||||
case EVENT_SANDTRAP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
target->CastSpell(target, SPELL_SANDTRAP, true);
|
||||
else if (Unit* victim = me->GetVictim())
|
||||
victim->CastSpell(victim, SPELL_SANDTRAP, true);
|
||||
events.ScheduleEvent(EVENT_SANDTRAP, urand(5000, 15000));
|
||||
break;
|
||||
case EVENT_WIDE_SLASH:
|
||||
DoCast(me, SPELL_WIDE_SLASH);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
|
||||
break;
|
||||
case EVENT_TRASH:
|
||||
DoCast(me, SPELL_TRASH);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 16000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _enraged;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_kurinnaxxAI>(creature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
_enraged = false;
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
|
||||
events.ScheduleEvent(EVENT_SANDTRAP, urand(5000, 15000));
|
||||
events.ScheduleEvent(EVENT_TRASH, 1000);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!_enraged && HealthBelowPct(30))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
_enraged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
if (Creature* Ossirian = me->GetMap()->GetCreature(instance->GetData64(DATA_OSSIRIAN)))
|
||||
sCreatureTextMgr->SendChat(Ossirian, SAY_KURINAXX_DEATH, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MORTAL_WOUND:
|
||||
DoCastVictim(SPELL_MORTALWOUND);
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
|
||||
break;
|
||||
case EVENT_SANDTRAP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
target->CastSpell(target, SPELL_SANDTRAP, true);
|
||||
else if (Unit* victim = me->GetVictim())
|
||||
victim->CastSpell(victim, SPELL_SANDTRAP, true);
|
||||
events.ScheduleEvent(EVENT_SANDTRAP, urand(5000, 15000));
|
||||
break;
|
||||
case EVENT_WIDE_SLASH:
|
||||
DoCast(me, SPELL_WIDE_SLASH);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
|
||||
break;
|
||||
case EVENT_TRASH:
|
||||
DoCast(me, SPELL_TRASH);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 16000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _enraged;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_kurinnaxxAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kurinnaxx()
|
||||
|
||||
@@ -42,45 +42,45 @@ enum Actions
|
||||
|
||||
class boss_moam : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_moam() : CreatureScript("boss_moam") { }
|
||||
public:
|
||||
boss_moam() : CreatureScript("boss_moam") { }
|
||||
|
||||
struct boss_moamAI : public BossAI
|
||||
struct boss_moamAI : public BossAI
|
||||
{
|
||||
boss_moamAI(Creature* creature) : BossAI(creature, DATA_MOAM)
|
||||
{
|
||||
boss_moamAI(Creature* creature) : BossAI(creature, DATA_MOAM)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
me->SetPower(POWER_MANA, 0);
|
||||
_isStonePhase = false;
|
||||
events.ScheduleEvent(EVENT_STONE_PHASE, 90000);
|
||||
//events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
me->SetPower(POWER_MANA, 0);
|
||||
_isStonePhase = false;
|
||||
events.ScheduleEvent(EVENT_STONE_PHASE, 90000);
|
||||
//events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!_isStonePhase && HealthBelowPct(45))
|
||||
{
|
||||
if (!_isStonePhase && HealthBelowPct(45))
|
||||
{
|
||||
_isStonePhase = true;
|
||||
DoAction(ACTION_STONE_PHASE_START);
|
||||
}
|
||||
_isStonePhase = true;
|
||||
DoAction(ACTION_STONE_PHASE_START);
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
void DoAction(int32 action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_STONE_PHASE_END:
|
||||
case ACTION_STONE_PHASE_END:
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_ENERGIZE);
|
||||
events.ScheduleEvent(EVENT_STONE_PHASE, 90000);
|
||||
_isStonePhase = false;
|
||||
break;
|
||||
}
|
||||
case ACTION_STONE_PHASE_START:
|
||||
case ACTION_STONE_PHASE_START:
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_MANA_FIEND_1);
|
||||
DoCast(me, SPELL_SUMMON_MANA_FIEND_2);
|
||||
@@ -89,45 +89,45 @@ class boss_moam : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_STONE_PHASE_END, 90000);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
|
||||
{
|
||||
if (_isStonePhase)
|
||||
DoAction(ACTION_STONE_PHASE_END);
|
||||
DoCastAOE(SPELL_ARCANE_ERUPTION);
|
||||
me->SetPower(POWER_MANA, 0);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
if (_isStonePhase)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
if (events.ExecuteEvent() == EVENT_STONE_PHASE_END)
|
||||
DoAction(ACTION_STONE_PHASE_END);
|
||||
return;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
// Messing up mana-drain channel
|
||||
//if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
// return;
|
||||
|
||||
if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
if (_isStonePhase)
|
||||
DoAction(ACTION_STONE_PHASE_END);
|
||||
DoCastAOE(SPELL_ARCANE_ERUPTION);
|
||||
me->SetPower(POWER_MANA, 0);
|
||||
}
|
||||
|
||||
if (_isStonePhase)
|
||||
{
|
||||
if (events.ExecuteEvent() == EVENT_STONE_PHASE_END)
|
||||
DoAction(ACTION_STONE_PHASE_END);
|
||||
return;
|
||||
}
|
||||
|
||||
// Messing up mana-drain channel
|
||||
//if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
// return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_STONE_PHASE:
|
||||
DoAction(ACTION_STONE_PHASE_START);
|
||||
break;
|
||||
case EVENT_DRAIN_MANA:
|
||||
case EVENT_STONE_PHASE:
|
||||
DoAction(ACTION_STONE_PHASE_START);
|
||||
break;
|
||||
case EVENT_DRAIN_MANA:
|
||||
{
|
||||
std::list<Unit*> targetList;
|
||||
{
|
||||
@@ -153,21 +153,21 @@ class boss_moam : public CreatureScript
|
||||
DoCast(me, SPELL_TRASH);
|
||||
events.ScheduleEvent(EVENT_WIDE_SLASH, 16000);
|
||||
break;*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _isStonePhase;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_moamAI(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _isStonePhase;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_moamAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_moam()
|
||||
|
||||
@@ -70,198 +70,198 @@ Position const RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 };
|
||||
|
||||
class boss_ossirian : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_ossirian() : CreatureScript("boss_ossirian") { }
|
||||
public:
|
||||
boss_ossirian() : CreatureScript("boss_ossirian") { }
|
||||
|
||||
struct boss_ossirianAI : public BossAI
|
||||
struct boss_ossirianAI : public BossAI
|
||||
{
|
||||
boss_ossirianAI(Creature* creature) : BossAI(creature, DATA_OSSIRIAN)
|
||||
{
|
||||
boss_ossirianAI(Creature* creature) : BossAI(creature, DATA_OSSIRIAN)
|
||||
SaidIntro = false;
|
||||
}
|
||||
|
||||
uint64 TriggerGUID;
|
||||
uint64 CrystalGUID;
|
||||
uint8 CrystalIterator;
|
||||
bool SaidIntro;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
CrystalIterator = 0;
|
||||
TriggerGUID = 0;
|
||||
CrystalGUID = 0;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell)
|
||||
{
|
||||
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
|
||||
{
|
||||
SaidIntro = false;
|
||||
if (spell->Id == SpellWeakness[i])
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SUPREME);
|
||||
((TempSummon*)caster)->UnSummon();
|
||||
SpawnNextCrystal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
{
|
||||
if (action == ACTION_TRIGGER_WEAKNESS)
|
||||
if (Creature* Trigger = me->GetMap()->GetCreature(TriggerGUID))
|
||||
if (!Trigger->HasUnitState(UNIT_STATE_CASTING))
|
||||
Trigger->CastSpell(Trigger, SpellWeakness[urand(0, 4)], false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SILENCE, 30000);
|
||||
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
||||
events.ScheduleEvent(EVENT_STOMP, 30000);
|
||||
|
||||
DoCast(me, SPELL_SUPREME);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_WEATHER, (4 + 4 + 4));
|
||||
data << uint32(WEATHER_STATE_HEAVY_SANDSTORM) << float(1) << uint8(0);
|
||||
map->SendToPlayers(&data);
|
||||
|
||||
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
|
||||
{
|
||||
Position Point;
|
||||
me->GetRandomPoint(RoomCenter, RoomRadius, Point);
|
||||
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
|
||||
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
|
||||
}
|
||||
|
||||
uint64 TriggerGUID;
|
||||
uint64 CrystalGUID;
|
||||
uint8 CrystalIterator;
|
||||
bool SaidIntro;
|
||||
SpawnNextCrystal();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
Cleanup();
|
||||
summons.DespawnAll();
|
||||
BossAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Cleanup();
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void Cleanup()
|
||||
{
|
||||
if (GameObject* Crystal = me->GetMap()->GetGameObject(CrystalGUID))
|
||||
Crystal->Use(me);
|
||||
}
|
||||
|
||||
void SpawnNextCrystal()
|
||||
{
|
||||
if (CrystalIterator == NUM_CRYSTALS)
|
||||
CrystalIterator = 0;
|
||||
TriggerGUID = 0;
|
||||
CrystalGUID = 0;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell)
|
||||
if (Creature* Trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[CrystalIterator]))
|
||||
{
|
||||
TriggerGUID = Trigger->GetGUID();
|
||||
if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
||||
CrystalCoordinates[CrystalIterator].GetPositionX(),
|
||||
CrystalCoordinates[CrystalIterator].GetPositionY(),
|
||||
CrystalCoordinates[CrystalIterator].GetPositionZ(),
|
||||
0, 0, 0, 0, 0, uint32(-1)))
|
||||
{
|
||||
CrystalGUID = Crystal->GetGUID();
|
||||
++CrystalIterator;
|
||||
Crystal->SetOwnerGUID(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
if (!SaidIntro)
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
SaidIntro = true;
|
||||
}
|
||||
BossAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
// No kiting!
|
||||
if (me->GetDistance(me->GetVictim()) > 60.00f && me->GetDistance(me->GetVictim()) < 120.00f)
|
||||
DoCastVictim(SPELL_SUMMON);
|
||||
|
||||
bool ApplySupreme = true;
|
||||
|
||||
if (me->HasAura(SPELL_SUPREME))
|
||||
ApplySupreme = false;
|
||||
else
|
||||
{
|
||||
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
|
||||
{
|
||||
if (spell->Id == SpellWeakness[i])
|
||||
if (me->HasAura(SpellWeakness[i]))
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SUPREME);
|
||||
((TempSummon*)caster)->UnSummon();
|
||||
SpawnNextCrystal();
|
||||
ApplySupreme = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
if (ApplySupreme)
|
||||
{
|
||||
if (action == ACTION_TRIGGER_WEAKNESS)
|
||||
if (Creature* Trigger = me->GetMap()->GetCreature(TriggerGUID))
|
||||
if (!Trigger->HasUnitState(UNIT_STATE_CASTING))
|
||||
Trigger->CastSpell(Trigger, SpellWeakness[urand(0, 4)], false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SILENCE, 30000);
|
||||
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
||||
events.ScheduleEvent(EVENT_STOMP, 30000);
|
||||
|
||||
DoCast(me, SPELL_SUPREME);
|
||||
Talk(SAY_AGGRO);
|
||||
Talk(SAY_SUPREME);
|
||||
}
|
||||
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_WEATHER, (4+4+4));
|
||||
data << uint32(WEATHER_STATE_HEAVY_SANDSTORM) << float(1) << uint8(0);
|
||||
map->SendToPlayers(&data);
|
||||
|
||||
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
Position Point;
|
||||
me->GetRandomPoint(RoomCenter, RoomRadius, Point);
|
||||
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
|
||||
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
|
||||
}
|
||||
|
||||
SpawnNextCrystal();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
Cleanup();
|
||||
summons.DespawnAll();
|
||||
BossAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Cleanup();
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void Cleanup()
|
||||
{
|
||||
if (GameObject* Crystal = me->GetMap()->GetGameObject(CrystalGUID))
|
||||
Crystal->Use(me);
|
||||
}
|
||||
|
||||
void SpawnNextCrystal()
|
||||
{
|
||||
if (CrystalIterator == NUM_CRYSTALS)
|
||||
CrystalIterator = 0;
|
||||
|
||||
if (Creature* Trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[CrystalIterator]))
|
||||
{
|
||||
TriggerGUID = Trigger->GetGUID();
|
||||
if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
|
||||
CrystalCoordinates[CrystalIterator].GetPositionX(),
|
||||
CrystalCoordinates[CrystalIterator].GetPositionY(),
|
||||
CrystalCoordinates[CrystalIterator].GetPositionZ(),
|
||||
0, 0, 0, 0, 0, uint32(-1)))
|
||||
{
|
||||
CrystalGUID = Crystal->GetGUID();
|
||||
++CrystalIterator;
|
||||
Crystal->SetOwnerGUID(0);
|
||||
}
|
||||
case EVENT_SILENCE:
|
||||
DoCast(me, SPELL_SILENCE);
|
||||
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_CYCLONE:
|
||||
DoCastVictim(SPELL_CYCLONE);
|
||||
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
||||
break;
|
||||
case EVENT_STOMP:
|
||||
DoCast(me, SPELL_STOMP);
|
||||
events.ScheduleEvent(EVENT_STOMP, 30000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
if (!SaidIntro)
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
SaidIntro = true;
|
||||
}
|
||||
BossAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
// No kiting!
|
||||
if (me->GetDistance(me->GetVictim()) > 60.00f && me->GetDistance(me->GetVictim()) < 120.00f)
|
||||
DoCastVictim(SPELL_SUMMON);
|
||||
|
||||
bool ApplySupreme = true;
|
||||
|
||||
if (me->HasAura(SPELL_SUPREME))
|
||||
ApplySupreme = false;
|
||||
else
|
||||
{
|
||||
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
|
||||
{
|
||||
if (me->HasAura(SpellWeakness[i]))
|
||||
{
|
||||
ApplySupreme = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ApplySupreme)
|
||||
{
|
||||
DoCast(me, SPELL_SUPREME);
|
||||
Talk(SAY_SUPREME);
|
||||
}
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SILENCE:
|
||||
DoCast(me, SPELL_SILENCE);
|
||||
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_CYCLONE:
|
||||
DoCastVictim(SPELL_CYCLONE);
|
||||
events.ScheduleEvent(EVENT_CYCLONE, 20000);
|
||||
break;
|
||||
case EVENT_STOMP:
|
||||
DoCast(me, SPELL_STOMP);
|
||||
events.ScheduleEvent(EVENT_STOMP, 30000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_ossirianAI>(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_ossirianAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class go_ossirian_crystal : public GameObjectScript
|
||||
|
||||
@@ -28,7 +28,7 @@ enum Yells
|
||||
SAY_CHANGEAGGRO = 10,
|
||||
SAY_KILLS_ANDOROV = 11,
|
||||
SAY_COMPLETE_QUEST = 12 // Yell when realm complete quest 8743 for world event
|
||||
// Warriors, Captains, continue the fight! Sound: 8640
|
||||
// Warriors, Captains, continue the fight! Sound: 8640
|
||||
};
|
||||
|
||||
enum Spells
|
||||
@@ -47,71 +47,71 @@ enum Events
|
||||
|
||||
class boss_rajaxx : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_rajaxx() : CreatureScript("boss_rajaxx") { }
|
||||
public:
|
||||
boss_rajaxx() : CreatureScript("boss_rajaxx") { }
|
||||
|
||||
struct boss_rajaxxAI : public BossAI
|
||||
struct boss_rajaxxAI : public BossAI
|
||||
{
|
||||
boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX)
|
||||
{
|
||||
boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
enraged = false;
|
||||
events.ScheduleEvent(EVENT_DISARM, 10000);
|
||||
events.ScheduleEvent(EVENT_THUNDERCRASH, 12000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
//SAY_DEATH
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*victim*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DISARM:
|
||||
DoCastVictim(SPELL_DISARM);
|
||||
events.ScheduleEvent(EVENT_DISARM, 22000);
|
||||
break;
|
||||
case EVENT_THUNDERCRASH:
|
||||
DoCast(me, SPELL_THUNDERCRASH);
|
||||
events.ScheduleEvent(EVENT_THUNDERCRASH, 21000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool enraged;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_rajaxxAI(creature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
enraged = false;
|
||||
events.ScheduleEvent(EVENT_DISARM, 10000);
|
||||
events.ScheduleEvent(EVENT_THUNDERCRASH, 12000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
//SAY_DEATH
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*victim*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DISARM:
|
||||
DoCastVictim(SPELL_DISARM);
|
||||
events.ScheduleEvent(EVENT_DISARM, 22000);
|
||||
break;
|
||||
case EVENT_THUNDERCRASH:
|
||||
DoCast(me, SPELL_THUNDERCRASH);
|
||||
events.ScheduleEvent(EVENT_THUNDERCRASH, 21000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool enraged;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_rajaxxAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_rajaxx()
|
||||
|
||||
@@ -10,143 +10,143 @@
|
||||
|
||||
class instance_ruins_of_ahnqiraj : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_ruins_of_ahnqiraj() : InstanceMapScript("instance_ruins_of_ahnqiraj", 509) { }
|
||||
public:
|
||||
instance_ruins_of_ahnqiraj() : InstanceMapScript("instance_ruins_of_ahnqiraj", 509) { }
|
||||
|
||||
struct instance_ruins_of_ahnqiraj_InstanceMapScript : public InstanceScript
|
||||
struct instance_ruins_of_ahnqiraj_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_ruins_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
instance_ruins_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(NUM_ENCOUNTER);
|
||||
SetBossNumber(NUM_ENCOUNTER);
|
||||
|
||||
_kurinaxxGUID = 0;
|
||||
_rajaxxGUID = 0;
|
||||
_moamGUID = 0;
|
||||
_buruGUID = 0;
|
||||
_ayamissGUID = 0;
|
||||
_ossirianGUID = 0;
|
||||
_paralyzedGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_KURINAXX:
|
||||
_kurinaxxGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_RAJAXX:
|
||||
_rajaxxGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MOAM:
|
||||
_moamGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_BURU:
|
||||
_buruGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_AYAMISS:
|
||||
_ayamissGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_OSSIRIAN:
|
||||
_ossirianGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 bossId, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(bossId, state))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData64(uint32 type, uint64 data)
|
||||
{
|
||||
if (type == DATA_PARALYZED)
|
||||
_paralyzedGUID = data;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_KURINNAXX:
|
||||
return _kurinaxxGUID;
|
||||
case DATA_RAJAXX:
|
||||
return _rajaxxGUID;
|
||||
case DATA_MOAM:
|
||||
return _moamGUID;
|
||||
case DATA_BURU:
|
||||
return _buruGUID;
|
||||
case DATA_AYAMISS:
|
||||
return _ayamissGUID;
|
||||
case DATA_OSSIRIAN:
|
||||
return _ossirianGUID;
|
||||
case DATA_PARALYZED:
|
||||
return _paralyzedGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "R A" << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* data)
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(data);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(data);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'R' && dataHead2 == 'A')
|
||||
{
|
||||
for (uint8 i = 0; i < NUM_ENCOUNTER; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > TO_BE_DECIDED)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _kurinaxxGUID;
|
||||
uint64 _rajaxxGUID;
|
||||
uint64 _moamGUID;
|
||||
uint64 _buruGUID;
|
||||
uint64 _ayamissGUID;
|
||||
uint64 _ossirianGUID;
|
||||
uint64 _paralyzedGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_ruins_of_ahnqiraj_InstanceMapScript(map);
|
||||
_kurinaxxGUID = 0;
|
||||
_rajaxxGUID = 0;
|
||||
_moamGUID = 0;
|
||||
_buruGUID = 0;
|
||||
_ayamissGUID = 0;
|
||||
_ossirianGUID = 0;
|
||||
_paralyzedGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_KURINAXX:
|
||||
_kurinaxxGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_RAJAXX:
|
||||
_rajaxxGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MOAM:
|
||||
_moamGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_BURU:
|
||||
_buruGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_AYAMISS:
|
||||
_ayamissGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_OSSIRIAN:
|
||||
_ossirianGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 bossId, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(bossId, state))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData64(uint32 type, uint64 data)
|
||||
{
|
||||
if (type == DATA_PARALYZED)
|
||||
_paralyzedGUID = data;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_KURINNAXX:
|
||||
return _kurinaxxGUID;
|
||||
case DATA_RAJAXX:
|
||||
return _rajaxxGUID;
|
||||
case DATA_MOAM:
|
||||
return _moamGUID;
|
||||
case DATA_BURU:
|
||||
return _buruGUID;
|
||||
case DATA_AYAMISS:
|
||||
return _ayamissGUID;
|
||||
case DATA_OSSIRIAN:
|
||||
return _ossirianGUID;
|
||||
case DATA_PARALYZED:
|
||||
return _paralyzedGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "R A" << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* data)
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(data);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(data);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'R' && dataHead2 == 'A')
|
||||
{
|
||||
for (uint8 i = 0; i < NUM_ENCOUNTER; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > TO_BE_DECIDED)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _kurinaxxGUID;
|
||||
uint64 _rajaxxGUID;
|
||||
uint64 _moamGUID;
|
||||
uint64 _buruGUID;
|
||||
uint64 _ayamissGUID;
|
||||
uint64 _ossirianGUID;
|
||||
uint64 _paralyzedGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_ruins_of_ahnqiraj_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_ruins_of_ahnqiraj()
|
||||
|
||||
@@ -87,14 +87,16 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(5000, 12000);
|
||||
} else Cleave_Timer -= diff;
|
||||
}
|
||||
else Cleave_Timer -= diff;
|
||||
|
||||
//ToxicVolley_Timer
|
||||
if (ToxicVolley_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_TOXIC_VOLLEY);
|
||||
ToxicVolley_Timer = urand(10000, 15000);
|
||||
} else ToxicVolley_Timer -= diff;
|
||||
}
|
||||
else ToxicVolley_Timer -= diff;
|
||||
|
||||
if (!HealthAbovePct(5) && !Death)
|
||||
{
|
||||
@@ -113,7 +115,8 @@ public:
|
||||
VemDead = true;
|
||||
}
|
||||
Check_Timer = 2000;
|
||||
} else Check_Timer -=diff;
|
||||
}
|
||||
else Check_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -187,7 +190,8 @@ public:
|
||||
}
|
||||
|
||||
Charge_Timer = urand(8000, 16000);
|
||||
} else Charge_Timer -= diff;
|
||||
}
|
||||
else Charge_Timer -= diff;
|
||||
|
||||
//KnockBack_Timer
|
||||
if (KnockBack_Timer <= diff)
|
||||
@@ -196,14 +200,16 @@ public:
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
DoModifyThreatPercent(me->GetVictim(), -80);
|
||||
KnockBack_Timer = urand(15000, 25000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
}
|
||||
else KnockBack_Timer -= diff;
|
||||
|
||||
//Enrage_Timer
|
||||
if (!Enraged && Enrage_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
Enraged = true;
|
||||
} else Charge_Timer -= diff;
|
||||
}
|
||||
else Charge_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -277,7 +283,8 @@ public:
|
||||
DoCastVictim(SPELL_FEAR);
|
||||
DoResetThreat();
|
||||
Fear_Timer = 20000;
|
||||
} else Fear_Timer -= diff;
|
||||
}
|
||||
else Fear_Timer -= diff;
|
||||
|
||||
//Casting Heal to other twins or herself.
|
||||
if (Heal_Timer <= diff)
|
||||
@@ -297,8 +304,9 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
Heal_Timer = 15000+rand()%15000;
|
||||
} else Heal_Timer -= diff;
|
||||
Heal_Timer = 15000 + rand() % 15000;
|
||||
}
|
||||
else Heal_Timer -= diff;
|
||||
|
||||
//Checking if Vem is dead. If yes we will enrage.
|
||||
if (Check_Timer <= diff)
|
||||
@@ -312,7 +320,8 @@ public:
|
||||
}
|
||||
}
|
||||
Check_Timer = 2000;
|
||||
} else Check_Timer -= diff;
|
||||
}
|
||||
else Check_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
|
||||
//to avoid having a following void zone
|
||||
Creature* pPortal= me->FindNearestCreature(NPC_CTHUN_PORTAL, 10);
|
||||
Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10);
|
||||
if (pPortal)
|
||||
pPortal->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
@@ -238,7 +238,8 @@ public:
|
||||
SpawnEyeTentacle(-10, 10); // south east
|
||||
|
||||
EyeTentacleTimer = 45000;
|
||||
} else EyeTentacleTimer -= diff;
|
||||
}
|
||||
else EyeTentacleTimer -= diff;
|
||||
}
|
||||
|
||||
switch (currentPhase)
|
||||
@@ -259,7 +260,8 @@ public:
|
||||
|
||||
//Beam every 3 seconds
|
||||
BeamTimer = 3000;
|
||||
} else BeamTimer -= diff;
|
||||
}
|
||||
else BeamTimer -= diff;
|
||||
|
||||
//ClawTentacleTimer
|
||||
if (ClawTentacleTimer <= diff)
|
||||
@@ -277,7 +279,8 @@ public:
|
||||
|
||||
//One claw tentacle every 12.5 seconds
|
||||
ClawTentacleTimer = 12500;
|
||||
} else ClawTentacleTimer -= diff;
|
||||
}
|
||||
else ClawTentacleTimer -= diff;
|
||||
|
||||
//PhaseTimer
|
||||
if (PhaseTimer <= diff)
|
||||
@@ -312,7 +315,8 @@ public:
|
||||
|
||||
//Darkbeam for 35 seconds
|
||||
PhaseTimer = 35000;
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
else PhaseTimer -= diff;
|
||||
|
||||
break;
|
||||
|
||||
@@ -343,7 +347,8 @@ public:
|
||||
|
||||
//1 second per tick
|
||||
DarkGlareTickTimer = 1000;
|
||||
} else DarkGlareTickTimer -= diff;
|
||||
}
|
||||
else DarkGlareTickTimer -= diff;
|
||||
}
|
||||
|
||||
//PhaseTimer
|
||||
@@ -366,7 +371,8 @@ public:
|
||||
|
||||
//Eye Beam for 50 seconds
|
||||
PhaseTimer = 50000;
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
else PhaseTimer -= diff;
|
||||
|
||||
break;
|
||||
|
||||
@@ -380,7 +386,7 @@ public:
|
||||
|
||||
//Dead phase
|
||||
case PHASE_CTHUN_DONE:
|
||||
Creature* pPortal= me->FindNearestCreature(NPC_CTHUN_PORTAL, 10);
|
||||
Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10);
|
||||
if (pPortal)
|
||||
pPortal->DespawnOrUnsummon();
|
||||
|
||||
@@ -389,7 +395,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
switch (instance->GetData(DATA_CTHUN_PHASE))
|
||||
{
|
||||
@@ -575,7 +581,7 @@ public:
|
||||
return;
|
||||
|
||||
//Play random sound to the zone
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
Map::PlayerList const& PlayerList = map->GetPlayers();
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
{
|
||||
@@ -588,7 +594,8 @@ public:
|
||||
|
||||
//One random wisper every 90 - 300 seconds
|
||||
WisperTimer = urand(90000, 300000);
|
||||
} else WisperTimer -= diff;
|
||||
}
|
||||
else WisperTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -613,7 +620,8 @@ public:
|
||||
SpawnEyeTentacle(-10, 10); // south east
|
||||
|
||||
EyeTentacleTimer = 30000; // every 30sec in phase 2
|
||||
} else EyeTentacleTimer -= diff;
|
||||
}
|
||||
else EyeTentacleTimer -= diff;
|
||||
}
|
||||
|
||||
switch (currentPhase)
|
||||
@@ -656,7 +664,8 @@ public:
|
||||
}
|
||||
|
||||
PhaseTimer = 0;
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
else PhaseTimer -= diff;
|
||||
|
||||
break;
|
||||
|
||||
@@ -687,7 +696,7 @@ public:
|
||||
if (unit && i->second == true)
|
||||
{
|
||||
//Teleport each player out
|
||||
DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6));
|
||||
DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand() % 6));
|
||||
|
||||
//Cast knockback on them
|
||||
DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
|
||||
@@ -724,7 +733,7 @@ public:
|
||||
if (unit->IsWithinDist3d(&KickPos, 15.0f))
|
||||
{
|
||||
//Teleport each player out
|
||||
DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6));
|
||||
DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand() % 6));
|
||||
|
||||
//Cast knockback on them
|
||||
DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
|
||||
@@ -739,7 +748,8 @@ public:
|
||||
}
|
||||
|
||||
StomachAcidTimer = 4000;
|
||||
} else StomachAcidTimer -= diff;
|
||||
}
|
||||
else StomachAcidTimer -= diff;
|
||||
|
||||
//Stomach Enter Timer
|
||||
if (StomachEnterTimer <= diff)
|
||||
@@ -755,7 +765,8 @@ public:
|
||||
}
|
||||
|
||||
StomachEnterTimer = 13800;
|
||||
} else StomachEnterTimer -= diff;
|
||||
}
|
||||
else StomachEnterTimer -= diff;
|
||||
|
||||
if (StomachEnterVisTimer && StomachEnterTarget)
|
||||
{
|
||||
@@ -771,7 +782,8 @@ public:
|
||||
|
||||
StomachEnterTarget = 0;
|
||||
StomachEnterVisTimer = 0;
|
||||
} else StomachEnterVisTimer -= diff;
|
||||
}
|
||||
else StomachEnterVisTimer -= diff;
|
||||
}
|
||||
|
||||
//GientClawTentacleTimer
|
||||
@@ -787,7 +799,8 @@ public:
|
||||
|
||||
//One giant claw tentacle every minute
|
||||
GiantClawTentacleTimer = 60000;
|
||||
} else GiantClawTentacleTimer -= diff;
|
||||
}
|
||||
else GiantClawTentacleTimer -= diff;
|
||||
|
||||
//GiantEyeTentacleTimer
|
||||
if (GiantEyeTentacleTimer <= diff)
|
||||
@@ -802,7 +815,8 @@ public:
|
||||
|
||||
//One giant eye tentacle every minute
|
||||
GiantEyeTentacleTimer = 60000;
|
||||
} else GiantEyeTentacleTimer -= diff;
|
||||
}
|
||||
else GiantEyeTentacleTimer -= diff;
|
||||
|
||||
break;
|
||||
|
||||
@@ -829,7 +843,8 @@ public:
|
||||
}
|
||||
|
||||
PhaseTimer = 0;
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
else PhaseTimer -= diff;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -840,7 +855,7 @@ public:
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
switch (instance->GetData(DATA_CTHUN_PHASE))
|
||||
{
|
||||
@@ -938,7 +953,8 @@ public:
|
||||
{
|
||||
Unit::Kill(me, me);
|
||||
return;
|
||||
} else KillSelfTimer -= diff;
|
||||
}
|
||||
else KillSelfTimer -= diff;
|
||||
|
||||
//MindflayTimer
|
||||
if (MindflayTimer <= diff)
|
||||
@@ -949,7 +965,8 @@ public:
|
||||
|
||||
//Mindflay every 10 seconds
|
||||
MindflayTimer = 10000;
|
||||
} else MindflayTimer -= diff;
|
||||
}
|
||||
else MindflayTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1043,7 +1060,8 @@ public:
|
||||
}
|
||||
|
||||
me->SetVisible(true);
|
||||
} else EvadeTimer -= diff;
|
||||
}
|
||||
else EvadeTimer -= diff;
|
||||
}
|
||||
|
||||
//GroundRuptureTimer
|
||||
@@ -1051,14 +1069,16 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_GROUND_RUPTURE);
|
||||
GroundRuptureTimer = 30000;
|
||||
} else GroundRuptureTimer -= diff;
|
||||
}
|
||||
else GroundRuptureTimer -= diff;
|
||||
|
||||
//HamstringTimer
|
||||
if (HamstringTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_HAMSTRING);
|
||||
HamstringTimer = 5000;
|
||||
} else HamstringTimer -= diff;
|
||||
}
|
||||
else HamstringTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -1156,7 +1176,8 @@ public:
|
||||
AttackStart(target);
|
||||
}
|
||||
me->SetVisible(true);
|
||||
} else EvadeTimer -= diff;
|
||||
}
|
||||
else EvadeTimer -= diff;
|
||||
}
|
||||
|
||||
//GroundRuptureTimer
|
||||
@@ -1164,21 +1185,24 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_GROUND_RUPTURE);
|
||||
GroundRuptureTimer = 30000;
|
||||
} else GroundRuptureTimer -= diff;
|
||||
}
|
||||
else GroundRuptureTimer -= diff;
|
||||
|
||||
//ThrashTimer
|
||||
if (ThrashTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_THRASH);
|
||||
ThrashTimer = 10000;
|
||||
} else ThrashTimer -= diff;
|
||||
}
|
||||
else ThrashTimer -= diff;
|
||||
|
||||
//HamstringTimer
|
||||
if (HamstringTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_HAMSTRING);
|
||||
HamstringTimer = 10000;
|
||||
} else HamstringTimer -= diff;
|
||||
}
|
||||
else HamstringTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -1245,7 +1269,8 @@ public:
|
||||
|
||||
//Beam every 2 seconds
|
||||
BeamTimer = 2100;
|
||||
} else BeamTimer -= diff;
|
||||
}
|
||||
else BeamTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -65,18 +65,26 @@ public:
|
||||
if (!victim)
|
||||
return;
|
||||
|
||||
Rand = 10 + (rand()%10);
|
||||
switch (rand()%2)
|
||||
Rand = 10 + (rand() % 10);
|
||||
switch (rand() % 2)
|
||||
{
|
||||
case 0: RandX = 0.0f - Rand; break;
|
||||
case 1: RandX = 0.0f + Rand; break;
|
||||
case 0:
|
||||
RandX = 0.0f - Rand;
|
||||
break;
|
||||
case 1:
|
||||
RandX = 0.0f + Rand;
|
||||
break;
|
||||
}
|
||||
|
||||
Rand = 10 + (rand()%10);
|
||||
switch (rand()%2)
|
||||
Rand = 10 + (rand() % 10);
|
||||
switch (rand() % 2)
|
||||
{
|
||||
case 0: RandY = 0.0f - Rand; break;
|
||||
case 1: RandY = 0.0f + Rand; break;
|
||||
case 0:
|
||||
RandY = 0.0f - Rand;
|
||||
break;
|
||||
case 1:
|
||||
RandY = 0.0f + Rand;
|
||||
break;
|
||||
}
|
||||
Rand = 0;
|
||||
Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
@@ -99,7 +107,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_MORTAL_WOUND);
|
||||
MortalWound_Timer = urand(10000, 20000);
|
||||
} else MortalWound_Timer -= diff;
|
||||
}
|
||||
else MortalWound_Timer -= diff;
|
||||
|
||||
//Summon 1-3 Spawns of Fankriss at random time.
|
||||
if (SpawnSpawns_Timer <= diff)
|
||||
@@ -120,7 +129,8 @@ public:
|
||||
break;
|
||||
}
|
||||
SpawnSpawns_Timer = urand(30000, 60000);
|
||||
} else SpawnSpawns_Timer -= diff;
|
||||
}
|
||||
else SpawnSpawns_Timer -= diff;
|
||||
|
||||
// Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer.
|
||||
//We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot.
|
||||
@@ -139,53 +149,54 @@ public:
|
||||
{
|
||||
case 0:
|
||||
DoTeleportPlayer(target, -8106.0142f, 1289.2900f, -74.419533f, 5.112f);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
break;
|
||||
case 1:
|
||||
DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
break;
|
||||
case 2:
|
||||
DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Hatchling = me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Hatchling)
|
||||
Hatchling->AI()->AttackStart(target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
SpawnHatchlings_Timer = urand(45000, 60000);
|
||||
} else SpawnHatchlings_Timer -= diff;
|
||||
}
|
||||
else SpawnHatchlings_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -82,7 +82,8 @@ public:
|
||||
Frenzy = true;
|
||||
PoisonBolt_Timer = 3000;
|
||||
Frenzy_Timer = urand(25000, 35000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
}
|
||||
else Frenzy_Timer -= diff;
|
||||
|
||||
// Wyvern Timer
|
||||
if (Wyvern_Timer <= diff)
|
||||
@@ -90,21 +91,24 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_WYVERNSTING);
|
||||
Wyvern_Timer = urand(15000, 32000);
|
||||
} else Wyvern_Timer -= diff;
|
||||
}
|
||||
else Wyvern_Timer -= diff;
|
||||
|
||||
//Spit Timer
|
||||
if (Spit_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ACIDSPIT);
|
||||
Spit_Timer = urand(5000, 10000);
|
||||
} else Spit_Timer -= diff;
|
||||
}
|
||||
else Spit_Timer -= diff;
|
||||
|
||||
//NoxiousPoison_Timer
|
||||
if (NoxiousPoison_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_NOXIOUSPOISON);
|
||||
NoxiousPoison_Timer = urand(12000, 24000);
|
||||
} else NoxiousPoison_Timer -= diff;
|
||||
}
|
||||
else NoxiousPoison_Timer -= diff;
|
||||
|
||||
//PoisonBolt only if frenzy or berserk
|
||||
if (Frenzy || Berserk)
|
||||
@@ -113,7 +117,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_POISONBOLT);
|
||||
PoisonBolt_Timer = 3000;
|
||||
} else PoisonBolt_Timer -= diff;
|
||||
}
|
||||
else PoisonBolt_Timer -= diff;
|
||||
}
|
||||
|
||||
//FrenzyBack_Timer
|
||||
@@ -122,7 +127,8 @@ public:
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
Frenzy = false;
|
||||
FrenzyBack_Timer = 15000;
|
||||
} else FrenzyBack_Timer -= diff;
|
||||
}
|
||||
else FrenzyBack_Timer -= diff;
|
||||
|
||||
if (!Berserk && HealthBelowPct(31))
|
||||
{
|
||||
|
||||
@@ -77,14 +77,16 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_SWEEP);
|
||||
Sweep_Timer = urand(15000, 30000);
|
||||
} else Sweep_Timer -= diff;
|
||||
}
|
||||
else Sweep_Timer -= diff;
|
||||
|
||||
//SandBlast_Timer
|
||||
if (!Submerged && SandBlast_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SANDBLAST);
|
||||
SandBlast_Timer = urand(20000, 35000);
|
||||
} else SandBlast_Timer -= diff;
|
||||
}
|
||||
else SandBlast_Timer -= diff;
|
||||
|
||||
//Submerge_Timer
|
||||
if (!Submerged && Submerge_Timer <= diff)
|
||||
@@ -97,7 +99,8 @@ public:
|
||||
|
||||
Submerged = true;
|
||||
Back_Timer = urand(30000, 45000);
|
||||
} else Submerge_Timer -= diff;
|
||||
}
|
||||
else Submerge_Timer -= diff;
|
||||
|
||||
//ChangeTarget_Timer
|
||||
if (Submerged && ChangeTarget_Timer <= diff)
|
||||
@@ -109,7 +112,8 @@ public:
|
||||
me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation());
|
||||
|
||||
ChangeTarget_Timer = urand(10000, 20000);
|
||||
} else ChangeTarget_Timer -= diff;
|
||||
}
|
||||
else ChangeTarget_Timer -= diff;
|
||||
|
||||
//Back_Timer
|
||||
if (Submerged && Back_Timer <= diff)
|
||||
@@ -121,7 +125,8 @@ public:
|
||||
|
||||
Submerged = false;
|
||||
Submerge_Timer = urand(60000, 120000);
|
||||
} else Back_Timer -= diff;
|
||||
}
|
||||
else Back_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ enum Sartura
|
||||
SPELL_ENRAGE = 28747, //Not sure if right ID.
|
||||
SPELL_ENRAGEHARD = 28798,
|
||||
|
||||
//Guard Spell
|
||||
//Guard Spell
|
||||
SPELL_WHIRLWINDADD = 26038,
|
||||
SPELL_KNOCKBACK = 26027
|
||||
};
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
WhirlWindEnd_Timer = 15000;
|
||||
AggroReset_Timer = urand(45000, 55000);
|
||||
AggroResetEnd_Timer = 5000;
|
||||
EnrageHard_Timer = 10*60000;
|
||||
EnrageHard_Timer = 10 * 60000;
|
||||
|
||||
WhirlWind = false;
|
||||
AggroReset = false;
|
||||
@@ -76,15 +76,15 @@ public:
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -104,13 +104,15 @@ public:
|
||||
AttackStart(target);
|
||||
}
|
||||
WhirlWindRandom_Timer = urand(3000, 7000);
|
||||
} else WhirlWindRandom_Timer -= diff;
|
||||
}
|
||||
else WhirlWindRandom_Timer -= diff;
|
||||
|
||||
if (WhirlWindEnd_Timer <= diff)
|
||||
{
|
||||
WhirlWind = false;
|
||||
WhirlWind_Timer = urand(25000, 40000);
|
||||
} else WhirlWindEnd_Timer -= diff;
|
||||
}
|
||||
else WhirlWindEnd_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!WhirlWind)
|
||||
@@ -120,7 +122,8 @@ public:
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
WhirlWind = true;
|
||||
WhirlWindEnd_Timer = 15000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
}
|
||||
else WhirlWind_Timer -= diff;
|
||||
|
||||
if (AggroReset_Timer <= diff)
|
||||
{
|
||||
@@ -133,7 +136,8 @@ public:
|
||||
}
|
||||
AggroReset = true;
|
||||
AggroReset_Timer = urand(2000, 5000);
|
||||
} else AggroReset_Timer -= diff;
|
||||
}
|
||||
else AggroReset_Timer -= diff;
|
||||
|
||||
if (AggroReset)
|
||||
{
|
||||
@@ -142,7 +146,8 @@ public:
|
||||
AggroReset = false;
|
||||
AggroResetEnd_Timer = 5000;
|
||||
AggroReset_Timer = urand(35000, 45000);
|
||||
} else AggroResetEnd_Timer -= diff;
|
||||
}
|
||||
else AggroResetEnd_Timer -= diff;
|
||||
}
|
||||
|
||||
//If she is 20% enrage
|
||||
@@ -162,7 +167,8 @@ public:
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGEHARD);
|
||||
EnragedHard = true;
|
||||
} else EnrageHard_Timer -= diff;
|
||||
}
|
||||
else EnrageHard_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -225,7 +231,8 @@ public:
|
||||
WhirlWind = true;
|
||||
WhirlWind_Timer = urand(25000, 40000);
|
||||
WhirlWindEnd_Timer = 15000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
}
|
||||
else WhirlWind_Timer -= diff;
|
||||
|
||||
if (WhirlWind)
|
||||
{
|
||||
@@ -240,12 +247,14 @@ public:
|
||||
}
|
||||
|
||||
WhirlWindRandom_Timer = urand(3000, 7000);
|
||||
} else WhirlWindRandom_Timer -= diff;
|
||||
}
|
||||
else WhirlWindRandom_Timer -= diff;
|
||||
|
||||
if (WhirlWindEnd_Timer <= diff)
|
||||
{
|
||||
WhirlWind = false;
|
||||
} else WhirlWindEnd_Timer -= diff;
|
||||
}
|
||||
else WhirlWindEnd_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!WhirlWind)
|
||||
@@ -262,13 +271,15 @@ public:
|
||||
|
||||
AggroReset = true;
|
||||
AggroReset_Timer = urand(2000, 5000);
|
||||
} else AggroReset_Timer -= diff;
|
||||
}
|
||||
else AggroReset_Timer -= diff;
|
||||
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WHIRLWINDADD);
|
||||
KnockBack_Timer = urand(10000, 20000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
}
|
||||
else KnockBack_Timer -= diff;
|
||||
}
|
||||
|
||||
if (AggroReset)
|
||||
@@ -278,7 +289,8 @@ public:
|
||||
AggroReset = false;
|
||||
AggroResetEnd_Timer = 5000;
|
||||
AggroReset_Timer = urand(30000, 40000);
|
||||
} else AggroResetEnd_Timer -= diff;
|
||||
}
|
||||
else AggroResetEnd_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -38,144 +38,144 @@ uint32 const BlinkSpells[3] = { 4801, 8195, 20449 };
|
||||
|
||||
class boss_skeram : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_skeram() : CreatureScript("boss_skeram") { }
|
||||
public:
|
||||
boss_skeram() : CreatureScript("boss_skeram") { }
|
||||
|
||||
struct boss_skeramAI : public BossAI
|
||||
struct boss_skeramAI : public BossAI
|
||||
{
|
||||
boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { }
|
||||
_flag = 0;
|
||||
_hpct = 75.0f;
|
||||
me->SetVisible(true);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
if (me->IsSummon())
|
||||
((TempSummon*)me)->UnSummon();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* creature)
|
||||
{
|
||||
// Shift the boss and images (Get it? *Shift*?)
|
||||
uint8 rand = 0;
|
||||
if (_flag != 0)
|
||||
{
|
||||
_flag = 0;
|
||||
_hpct = 75.0f;
|
||||
me->SetVisible(true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
if (me->IsSummon())
|
||||
((TempSummon*)me)->UnSummon();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* creature)
|
||||
{
|
||||
// Shift the boss and images (Get it? *Shift*?)
|
||||
uint8 rand = 0;
|
||||
if (_flag != 0)
|
||||
{
|
||||
while (_flag & (1 << rand))
|
||||
rand = urand(0, 2);
|
||||
DoCast(me, BlinkSpells[rand]);
|
||||
_flag |= (1 << rand);
|
||||
_flag |= (1 << 7);
|
||||
}
|
||||
|
||||
while (_flag & (1 << rand))
|
||||
rand = urand(0, 2);
|
||||
creature->CastSpell(creature, BlinkSpells[rand]);
|
||||
DoCast(me, BlinkSpells[rand]);
|
||||
_flag |= (1 << rand);
|
||||
|
||||
if (_flag & (1 << 7))
|
||||
_flag = 0;
|
||||
|
||||
if (Unit* Target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
creature->AI()->AttackStart(Target);
|
||||
|
||||
float ImageHealthPct;
|
||||
|
||||
if (me->GetHealthPct() < 25.0f)
|
||||
ImageHealthPct = 0.50f;
|
||||
else if (me->GetHealthPct() < 50.0f)
|
||||
ImageHealthPct = 0.20f;
|
||||
else
|
||||
ImageHealthPct = 0.10f;
|
||||
|
||||
creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct);
|
||||
creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f));
|
||||
_flag |= (1 << 7);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
while (_flag & (1 << rand))
|
||||
rand = urand(0, 2);
|
||||
creature->CastSpell(creature, BlinkSpells[rand]);
|
||||
_flag |= (1 << rand);
|
||||
|
||||
if (_flag & (1 << 7))
|
||||
_flag = 0;
|
||||
|
||||
if (Unit* Target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
creature->AI()->AttackStart(Target);
|
||||
|
||||
float ImageHealthPct;
|
||||
|
||||
if (me->GetHealthPct() < 25.0f)
|
||||
ImageHealthPct = 0.50f;
|
||||
else if (me->GetHealthPct() < 50.0f)
|
||||
ImageHealthPct = 0.20f;
|
||||
else
|
||||
ImageHealthPct = 0.10f;
|
||||
|
||||
creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct);
|
||||
creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!me->IsSummon())
|
||||
Talk(SAY_DEATH);
|
||||
else
|
||||
me->RemoveCorpse();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.Reset();
|
||||
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000));
|
||||
events.ScheduleEvent(EVENT_FULLFILMENT, 15000);
|
||||
events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000));
|
||||
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
if (!me->IsSummon())
|
||||
Talk(SAY_DEATH);
|
||||
else
|
||||
me->RemoveCorpse();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.Reset();
|
||||
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000));
|
||||
events.ScheduleEvent(EVENT_FULLFILMENT, 15000);
|
||||
events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000));
|
||||
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
switch (eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
DoCastAOE(SPELL_ARCANE_EXPLOSION, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000));
|
||||
break;
|
||||
case EVENT_FULLFILMENT:
|
||||
/// @todo For some weird reason boss does not cast this
|
||||
// Spell actually works, tested in duel
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true);
|
||||
events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_BLINK:
|
||||
DoCast(me, BlinkSpells[urand(0, 2)]);
|
||||
DoResetThreat();
|
||||
me->SetVisible(true);
|
||||
events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000));
|
||||
break;
|
||||
case EVENT_EARTH_SHOCK:
|
||||
DoCastVictim(SPELL_EARTH_SHOCK);
|
||||
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!me->IsSummon() && me->GetHealthPct() < _hpct)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_IMAGES);
|
||||
Talk(SAY_SPLIT);
|
||||
_hpct -= 25.0f;
|
||||
me->SetVisible(false);
|
||||
events.RescheduleEvent(EVENT_BLINK, 2000);
|
||||
}
|
||||
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
||||
DoMeleeAttackIfReady();
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
DoCastAOE(SPELL_ARCANE_EXPLOSION, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000));
|
||||
break;
|
||||
case EVENT_FULLFILMENT:
|
||||
/// @todo For some weird reason boss does not cast this
|
||||
// Spell actually works, tested in duel
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true);
|
||||
events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_BLINK:
|
||||
DoCast(me, BlinkSpells[urand(0, 2)]);
|
||||
DoResetThreat();
|
||||
me->SetVisible(true);
|
||||
events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000));
|
||||
break;
|
||||
case EVENT_EARTH_SHOCK:
|
||||
DoCastVictim(SPELL_EARTH_SHOCK);
|
||||
events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
float _hpct;
|
||||
uint8 _flag;
|
||||
};
|
||||
if (!me->IsSummon() && me->GetHealthPct() < _hpct)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_IMAGES);
|
||||
Talk(SAY_SPLIT);
|
||||
_hpct -= 25.0f;
|
||||
me->SetVisible(false);
|
||||
events.RescheduleEvent(EVENT_BLINK, 2000);
|
||||
}
|
||||
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
float _hpct;
|
||||
uint8 _flag;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
@@ -185,28 +185,28 @@ class boss_skeram : public CreatureScript
|
||||
|
||||
class spell_skeram_arcane_explosion : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { }
|
||||
public:
|
||||
spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { }
|
||||
|
||||
class spell_skeram_arcane_explosion_SpellScript : public SpellScript
|
||||
class spell_skeram_arcane_explosion_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_skeram_arcane_explosion_SpellScript();
|
||||
targets.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_skeram_arcane_explosion_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_skeram()
|
||||
|
||||
@@ -86,7 +86,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
BugsTimer = 2000;
|
||||
me->ClearUnitState(UNIT_STATE_STUNNED);
|
||||
DontYellWhenDead = false;
|
||||
EnrageTimer = 15*60000;
|
||||
EnrageTimer = 15 * 60000;
|
||||
}
|
||||
|
||||
Creature* GetOtherBoss()
|
||||
@@ -94,14 +94,14 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
return ObjectAccessor::GetCreature(*me, instance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
Unit* pOtherBoss = GetOtherBoss();
|
||||
if (pOtherBoss)
|
||||
{
|
||||
float dPercent = ((float)damage) / ((float)me->GetMaxHealth());
|
||||
int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth()));
|
||||
int ohealth = pOtherBoss->GetHealth()-odmg;
|
||||
int ohealth = pOtherBoss->GetHealth() - odmg;
|
||||
pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0);
|
||||
if (ohealth <= 0)
|
||||
{
|
||||
@@ -161,18 +161,18 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
uint32 mytotal = me->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
|
||||
float mult = ((float)mytotal) / ((float)histotal);
|
||||
if (mult < 1)
|
||||
mult = 1.0f/mult;
|
||||
#define HEAL_BROTHER_AMOUNT 30000.0f
|
||||
mult = 1.0f / mult;
|
||||
#define HEAL_BROTHER_AMOUNT 30000.0f
|
||||
uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT);
|
||||
|
||||
if (mytotal > histotal)
|
||||
{
|
||||
uint32 h = me->GetHealth()+largerAmount;
|
||||
uint32 h = me->GetHealth() + largerAmount;
|
||||
me->SetHealth(std::min(mytotal, h));
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 h = pOtherBoss->GetHealth()+largerAmount;
|
||||
uint32 h = pOtherBoss->GetHealth() + largerAmount;
|
||||
pOtherBoss->SetHealth(std::min(histotal, h));
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,8 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
DoCast(pOtherBoss, SPELL_HEAL_BROTHER);
|
||||
Heal_Timer = 1000;
|
||||
}
|
||||
} else Heal_Timer -= diff;
|
||||
}
|
||||
else Heal_Timer -= diff;
|
||||
}
|
||||
|
||||
void TeleportToMyBrother()
|
||||
@@ -314,7 +315,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
}
|
||||
if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
|
||||
{
|
||||
if (!nearb || (rand()%4) == 0)
|
||||
if (!nearb || (rand() % 4) == 0)
|
||||
nearb = c;
|
||||
}
|
||||
}
|
||||
@@ -359,9 +360,11 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
if (!me->IsNonMeleeSpellCast(true))
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
EnrageTimer = 60*60000;
|
||||
} else EnrageTimer = 0;
|
||||
} else EnrageTimer-=diff;
|
||||
EnrageTimer = 60 * 60000;
|
||||
}
|
||||
else EnrageTimer = 0;
|
||||
}
|
||||
else EnrageTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -396,7 +399,7 @@ public:
|
||||
UnbalancingStrike_Timer = urand(8000, 18000);
|
||||
Scarabs_Timer = urand(7000, 14000);
|
||||
|
||||
//Added. Can be removed if its included in DB.
|
||||
//Added. Can be removed if its included in DB.
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
|
||||
}
|
||||
|
||||
@@ -421,16 +424,18 @@ public:
|
||||
if (UnbalancingStrike_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_UNBALANCING_STRIKE);
|
||||
UnbalancingStrike_Timer = 8000+rand()%12000;
|
||||
} else UnbalancingStrike_Timer -= diff;
|
||||
UnbalancingStrike_Timer = 8000 + rand() % 12000;
|
||||
}
|
||||
else UnbalancingStrike_Timer -= diff;
|
||||
|
||||
if (UpperCut_Timer <= diff)
|
||||
{
|
||||
Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true);
|
||||
if (randomMelee)
|
||||
DoCast(randomMelee, SPELL_UPPERCUT);
|
||||
UpperCut_Timer = 15000+rand()%15000;
|
||||
} else UpperCut_Timer -= diff;
|
||||
UpperCut_Timer = 15000 + rand() % 15000;
|
||||
}
|
||||
else UpperCut_Timer -= diff;
|
||||
|
||||
HandleBugs(diff);
|
||||
|
||||
@@ -441,7 +446,8 @@ public:
|
||||
if (Teleport_Timer <= diff)
|
||||
{
|
||||
TeleportToMyBrother();
|
||||
} else Teleport_Timer -= diff;
|
||||
}
|
||||
else Teleport_Timer -= diff;
|
||||
|
||||
CheckEnrage(diff);
|
||||
|
||||
@@ -517,7 +523,8 @@ public:
|
||||
else
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 2000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
}
|
||||
else ShadowBolt_Timer -= diff;
|
||||
|
||||
//Blizzard_Timer
|
||||
if (Blizzard_Timer <= diff)
|
||||
@@ -526,18 +533,20 @@ public:
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true);
|
||||
if (target)
|
||||
DoCast(target, SPELL_BLIZZARD);
|
||||
Blizzard_Timer = 15000+rand()%15000;
|
||||
} else Blizzard_Timer -= diff;
|
||||
Blizzard_Timer = 15000 + rand() % 15000;
|
||||
}
|
||||
else Blizzard_Timer -= diff;
|
||||
|
||||
if (ArcaneBurst_Timer <= diff)
|
||||
{
|
||||
Unit* mvic;
|
||||
if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true)) != nullptr)
|
||||
if ((mvic = SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true)) != nullptr)
|
||||
{
|
||||
DoCast(mvic, SPELL_ARCANEBURST);
|
||||
ArcaneBurst_Timer = 5000;
|
||||
}
|
||||
} else ArcaneBurst_Timer -= diff;
|
||||
}
|
||||
else ArcaneBurst_Timer -= diff;
|
||||
|
||||
HandleBugs(diff);
|
||||
|
||||
@@ -548,7 +557,8 @@ public:
|
||||
if (Teleport_Timer <= diff)
|
||||
{
|
||||
TeleportToMyBrother();
|
||||
} else Teleport_Timer -= diff;
|
||||
}
|
||||
else Teleport_Timer -= diff;
|
||||
|
||||
CheckEnrage(diff);
|
||||
|
||||
|
||||
@@ -75,217 +75,217 @@ float const RoomRadius = 40.0f; /// @todo Not sure if its correct
|
||||
|
||||
class boss_viscidus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_viscidus() : CreatureScript("boss_viscidus") { }
|
||||
public:
|
||||
boss_viscidus() : CreatureScript("boss_viscidus") { }
|
||||
|
||||
struct boss_viscidusAI : public BossAI
|
||||
struct boss_viscidusAI : public BossAI
|
||||
{
|
||||
boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { }
|
||||
_Reset();
|
||||
_hitcounter = 0;
|
||||
_phase = PHASE_FROST;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void DamageTaken(Unit* attacker, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!attacker || _phase != PHASE_MELEE)
|
||||
return;
|
||||
|
||||
++_hitcounter;
|
||||
|
||||
if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE)
|
||||
{
|
||||
_Reset();
|
||||
_hitcounter = 0;
|
||||
_phase = PHASE_FROST;
|
||||
Talk(EMOTE_EXPLODE);
|
||||
events.Reset();
|
||||
_phase = PHASE_GLOB;
|
||||
DoCast(me, SPELL_VISCIDUS_EXPLODE);
|
||||
me->SetVisible(false);
|
||||
me->RemoveAura(SPELL_TOXIN);
|
||||
me->RemoveAura(SPELL_VISCIDUS_FREEZE);
|
||||
|
||||
uint8 NumGlobes = me->GetHealthPct() / 5.0f;
|
||||
for (uint8 i = 0; i < NumGlobes; ++i)
|
||||
{
|
||||
float Angle = i * 2 * M_PI / NumGlobes;
|
||||
float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius;
|
||||
float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius;
|
||||
float Z = -35.0f;
|
||||
|
||||
if (TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z))
|
||||
{
|
||||
Glob->UpdateAllowedPositionZ(X, Y, Z);
|
||||
Glob->NearTeleportTo(X, Y, Z, 0.0f);
|
||||
Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_hitcounter == HITCOUNTER_SHATTER)
|
||||
Talk(EMOTE_SHATTER);
|
||||
else if (_hitcounter == HITCOUNTER_CRACK)
|
||||
Talk(EMOTE_CRACK);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f)
|
||||
{
|
||||
if (!attacker || _phase != PHASE_MELEE)
|
||||
return;
|
||||
|
||||
++_hitcounter;
|
||||
|
||||
if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE)
|
||||
if (_hitcounter >= HITCOUNTER_FREEZE)
|
||||
{
|
||||
Talk(EMOTE_EXPLODE);
|
||||
events.Reset();
|
||||
_phase = PHASE_GLOB;
|
||||
DoCast(me, SPELL_VISCIDUS_EXPLODE);
|
||||
me->SetVisible(false);
|
||||
me->RemoveAura(SPELL_TOXIN);
|
||||
me->RemoveAura(SPELL_VISCIDUS_FREEZE);
|
||||
|
||||
uint8 NumGlobes = me->GetHealthPct() / 5.0f;
|
||||
for (uint8 i = 0; i < NumGlobes; ++i)
|
||||
{
|
||||
float Angle = i * 2 * M_PI / NumGlobes;
|
||||
float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius;
|
||||
float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius;
|
||||
float Z = -35.0f;
|
||||
|
||||
if (TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z))
|
||||
{
|
||||
Glob->UpdateAllowedPositionZ(X, Y, Z);
|
||||
Glob->NearTeleportTo(X, Y, Z, 0.0f);
|
||||
Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_hitcounter == HITCOUNTER_SHATTER)
|
||||
Talk(EMOTE_SHATTER);
|
||||
else if (_hitcounter == HITCOUNTER_CRACK)
|
||||
Talk(EMOTE_CRACK);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f)
|
||||
{
|
||||
++_hitcounter;
|
||||
|
||||
if (_hitcounter >= HITCOUNTER_FREEZE)
|
||||
{
|
||||
_hitcounter = 0;
|
||||
Talk(EMOTE_FROZEN);
|
||||
_phase = PHASE_MELEE;
|
||||
DoCast(me, SPELL_VISCIDUS_FREEZE);
|
||||
me->RemoveAura(SPELL_VISCIDUS_SLOWED_MORE);
|
||||
events.ScheduleEvent(EVENT_RESET_PHASE, 15000);
|
||||
}
|
||||
else if (_hitcounter >= HITCOUNTER_SLOW_MORE)
|
||||
{
|
||||
Talk(EMOTE_FREEZE);
|
||||
me->RemoveAura(SPELL_VISCIDUS_SLOWED);
|
||||
DoCast(me, SPELL_VISCIDUS_SLOWED_MORE);
|
||||
}
|
||||
else if (_hitcounter >= HITCOUNTER_SLOW)
|
||||
{
|
||||
Talk(EMOTE_SLOW);
|
||||
DoCast(me, SPELL_VISCIDUS_SLOWED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.Reset();
|
||||
InitSpells();
|
||||
}
|
||||
|
||||
void InitSpells()
|
||||
{
|
||||
DoCast(me, SPELL_TOXIN);
|
||||
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000));
|
||||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoCast(me, SPELL_VISCIDUS_SUICIDE);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (_phase == PHASE_GLOB && summons.empty())
|
||||
{
|
||||
DoResetThreat();
|
||||
me->NearTeleportTo(ViscidusCoord.GetPositionX(),
|
||||
ViscidusCoord.GetPositionY(),
|
||||
ViscidusCoord.GetPositionZ(),
|
||||
ViscidusCoord.GetOrientation());
|
||||
|
||||
_hitcounter = 0;
|
||||
_phase = PHASE_FROST;
|
||||
InitSpells();
|
||||
me->SetVisible(true);
|
||||
Talk(EMOTE_FROZEN);
|
||||
_phase = PHASE_MELEE;
|
||||
DoCast(me, SPELL_VISCIDUS_FREEZE);
|
||||
me->RemoveAura(SPELL_VISCIDUS_SLOWED_MORE);
|
||||
events.ScheduleEvent(EVENT_RESET_PHASE, 15000);
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
else if (_hitcounter >= HITCOUNTER_SLOW_MORE)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_POISONBOLT_VOLLEY:
|
||||
DoCast(me, SPELL_POISONBOLT_VOLLEY);
|
||||
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_POISON_SHOCK:
|
||||
DoCast(me, SPELL_POISON_SHOCK);
|
||||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
||||
break;
|
||||
case EVENT_RESET_PHASE:
|
||||
_hitcounter = 0;
|
||||
_phase = PHASE_FROST;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Talk(EMOTE_FREEZE);
|
||||
me->RemoveAura(SPELL_VISCIDUS_SLOWED);
|
||||
DoCast(me, SPELL_VISCIDUS_SLOWED_MORE);
|
||||
}
|
||||
else if (_hitcounter >= HITCOUNTER_SLOW)
|
||||
{
|
||||
Talk(EMOTE_SLOW);
|
||||
DoCast(me, SPELL_VISCIDUS_SLOWED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_phase != PHASE_GLOB)
|
||||
DoMeleeAttackIfReady();
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.Reset();
|
||||
InitSpells();
|
||||
}
|
||||
|
||||
void InitSpells()
|
||||
{
|
||||
DoCast(me, SPELL_TOXIN);
|
||||
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000));
|
||||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoCast(me, SPELL_VISCIDUS_SUICIDE);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (_phase == PHASE_GLOB && summons.empty())
|
||||
{
|
||||
DoResetThreat();
|
||||
me->NearTeleportTo(ViscidusCoord.GetPositionX(),
|
||||
ViscidusCoord.GetPositionY(),
|
||||
ViscidusCoord.GetPositionZ(),
|
||||
ViscidusCoord.GetOrientation());
|
||||
|
||||
_hitcounter = 0;
|
||||
_phase = PHASE_FROST;
|
||||
InitSpells();
|
||||
me->SetVisible(true);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _hitcounter;
|
||||
Phases _phase;
|
||||
};
|
||||
events.Update(diff);
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_viscidusAI(creature);
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_POISONBOLT_VOLLEY:
|
||||
DoCast(me, SPELL_POISONBOLT_VOLLEY);
|
||||
events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_POISON_SHOCK:
|
||||
DoCast(me, SPELL_POISON_SHOCK);
|
||||
events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000));
|
||||
break;
|
||||
case EVENT_RESET_PHASE:
|
||||
_hitcounter = 0;
|
||||
_phase = PHASE_FROST;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_phase != PHASE_GLOB)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _hitcounter;
|
||||
Phases _phase;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_viscidusAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_glob_of_viscidus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_glob_of_viscidus() : CreatureScript("boss_glob_of_viscidus") { }
|
||||
public:
|
||||
npc_glob_of_viscidus() : CreatureScript("boss_glob_of_viscidus") { }
|
||||
|
||||
struct npc_glob_of_viscidusAI : public ScriptedAI
|
||||
struct npc_glob_of_viscidusAI : public ScriptedAI
|
||||
{
|
||||
npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
InstanceScript* Instance = me->GetInstanceScript();
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetData64(DATA_VISCIDUS)))
|
||||
{
|
||||
InstanceScript* Instance = me->GetInstanceScript();
|
||||
if (BossAI* ViscidusAI = dynamic_cast<BossAI*>(Viscidus->GetAI()))
|
||||
ViscidusAI->SummonedCreatureDespawn(me);
|
||||
|
||||
if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetData64(DATA_VISCIDUS)))
|
||||
if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f)
|
||||
{
|
||||
if (BossAI* ViscidusAI = dynamic_cast<BossAI*>(Viscidus->GetAI()))
|
||||
ViscidusAI->SummonedCreatureDespawn(me);
|
||||
|
||||
if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f)
|
||||
{
|
||||
Viscidus->SetVisible(true);
|
||||
Unit::Kill(Viscidus->GetVictim(), Viscidus);
|
||||
}
|
||||
else
|
||||
{
|
||||
Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20);
|
||||
Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS);
|
||||
}
|
||||
Viscidus->SetVisible(true);
|
||||
Unit::Kill(Viscidus->GetVictim(), Viscidus);
|
||||
}
|
||||
else
|
||||
{
|
||||
Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20);
|
||||
Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 /*type*/, uint32 id)
|
||||
{
|
||||
if (id == ROOM_CENTER)
|
||||
{
|
||||
DoCast(me, SPELL_REJOIN_VISCIDUS);
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
summon->UnSummon();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_glob_of_viscidusAI>(creature);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 /*type*/, uint32 id)
|
||||
{
|
||||
if (id == ROOM_CENTER)
|
||||
{
|
||||
DoCast(me, SPELL_REJOIN_VISCIDUS);
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
summon->UnSummon();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_glob_of_viscidusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_viscidus()
|
||||
|
||||
@@ -17,55 +17,55 @@ EndScriptData */
|
||||
|
||||
class instance_temple_of_ahnqiraj : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { }
|
||||
public:
|
||||
instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_temple_of_ahnqiraj_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
//If Vem is dead...
|
||||
bool IsBossDied[3];
|
||||
|
||||
//Storing Skeram, Vem and Kri.
|
||||
uint64 SkeramGUID;
|
||||
uint64 VemGUID;
|
||||
uint64 KriGUID;
|
||||
uint64 VeklorGUID;
|
||||
uint64 VeknilashGUID;
|
||||
uint64 ViscidusGUID;
|
||||
|
||||
uint32 BugTrioDeathCount;
|
||||
|
||||
uint32 CthunPhase;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
return new instance_temple_of_ahnqiraj_InstanceMapScript(map);
|
||||
IsBossDied[0] = false;
|
||||
IsBossDied[1] = false;
|
||||
IsBossDied[2] = false;
|
||||
|
||||
SkeramGUID = 0;
|
||||
VemGUID = 0;
|
||||
KriGUID = 0;
|
||||
VeklorGUID = 0;
|
||||
VeknilashGUID = 0;
|
||||
ViscidusGUID = 0;
|
||||
|
||||
BugTrioDeathCount = 0;
|
||||
|
||||
CthunPhase = 0;
|
||||
}
|
||||
|
||||
struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
//If Vem is dead...
|
||||
bool IsBossDied[3];
|
||||
|
||||
//Storing Skeram, Vem and Kri.
|
||||
uint64 SkeramGUID;
|
||||
uint64 VemGUID;
|
||||
uint64 KriGUID;
|
||||
uint64 VeklorGUID;
|
||||
uint64 VeknilashGUID;
|
||||
uint64 ViscidusGUID;
|
||||
|
||||
uint32 BugTrioDeathCount;
|
||||
|
||||
uint32 CthunPhase;
|
||||
|
||||
void Initialize()
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
IsBossDied[0] = false;
|
||||
IsBossDied[1] = false;
|
||||
IsBossDied[2] = false;
|
||||
|
||||
SkeramGUID = 0;
|
||||
VemGUID = 0;
|
||||
KriGUID = 0;
|
||||
VeklorGUID = 0;
|
||||
VeknilashGUID = 0;
|
||||
ViscidusGUID = 0;
|
||||
|
||||
BugTrioDeathCount = 0;
|
||||
|
||||
CthunPhase = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_SKERAM:
|
||||
SkeramGUID = creature->GetGUID();
|
||||
break;
|
||||
@@ -84,19 +84,19 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
|
||||
case NPC_VISCIDUS:
|
||||
ViscidusGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
//not active in AQ40
|
||||
return false;
|
||||
}
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
//not active in AQ40
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_VEMISDEAD:
|
||||
if (IsBossDied[0])
|
||||
return 1;
|
||||
@@ -117,14 +117,14 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
|
||||
|
||||
case DATA_CTHUN_PHASE:
|
||||
return CthunPhase;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier) const
|
||||
uint64 GetData64(uint32 identifier) const
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case DATA_SKERAM:
|
||||
return SkeramGUID;
|
||||
case DATA_VEM:
|
||||
@@ -137,14 +137,14 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
|
||||
return VeknilashGUID;
|
||||
case DATA_VISCIDUS:
|
||||
return ViscidusGUID;
|
||||
}
|
||||
return 0;
|
||||
} // end GetData64
|
||||
}
|
||||
return 0;
|
||||
} // end GetData64
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_VEM_DEATH:
|
||||
IsBossDied[0] = true;
|
||||
break;
|
||||
@@ -164,9 +164,9 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
|
||||
case DATA_CTHUN_PHASE:
|
||||
CthunPhase = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -66,15 +66,33 @@ public:
|
||||
{
|
||||
switch (asel)
|
||||
{
|
||||
case 0: ability = SPELL_MENDING_BUFF;break;
|
||||
case 1: ability = SPELL_KNOCK_BUFF;break;
|
||||
case 2: ability = SPELL_MANAB_BUFF;break;
|
||||
case 3: ability = SPELL_REFLECTAF_BUFF;break;
|
||||
case 4: ability = SPELL_REFLECTSFr_BUFF;break;
|
||||
case 5: ability = SPELL_THORNS_BUFF;break;
|
||||
case 6: ability = SPELL_THUNDER_BUFF;break;
|
||||
case 7: ability = SPELL_MSTRIKE_BUFF;break;
|
||||
case 8: ability = SPELL_STORM_BUFF;break;
|
||||
case 0:
|
||||
ability = SPELL_MENDING_BUFF;
|
||||
break;
|
||||
case 1:
|
||||
ability = SPELL_KNOCK_BUFF;
|
||||
break;
|
||||
case 2:
|
||||
ability = SPELL_MANAB_BUFF;
|
||||
break;
|
||||
case 3:
|
||||
ability = SPELL_REFLECTAF_BUFF;
|
||||
break;
|
||||
case 4:
|
||||
ability = SPELL_REFLECTSFr_BUFF;
|
||||
break;
|
||||
case 5:
|
||||
ability = SPELL_THORNS_BUFF;
|
||||
break;
|
||||
case 6:
|
||||
ability = SPELL_THUNDER_BUFF;
|
||||
break;
|
||||
case 7:
|
||||
ability = SPELL_MSTRIKE_BUFF;
|
||||
break;
|
||||
case 8:
|
||||
ability = SPELL_STORM_BUFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +114,7 @@ public:
|
||||
if (CreatureGUID == me->GetGUID())
|
||||
return;
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (NearbyGUID[i] == CreatureGUID)
|
||||
return;
|
||||
@@ -111,7 +129,7 @@ public:
|
||||
void GiveBuddyMyList(Creature* c)
|
||||
{
|
||||
aqsentinelAI* cai = CAST_AI(aqsentinelAI, (c)->AI());
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
if (NearbyGUID[i] && NearbyGUID[i] != c->GetGUID())
|
||||
cai->AddBuddyToList(NearbyGUID[i]);
|
||||
cai->AddBuddyToList(me->GetGUID());
|
||||
@@ -119,14 +137,14 @@ public:
|
||||
|
||||
void SendMyListToBuddies()
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
if (Creature* pNearby = ObjectAccessor::GetCreature(*me, NearbyGUID[i]))
|
||||
GiveBuddyMyList(pNearby);
|
||||
}
|
||||
|
||||
void CallBuddiesToAttack(Unit* who)
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
Creature* c = ObjectAccessor::GetCreature(*me, NearbyGUID[i]);
|
||||
if (c)
|
||||
@@ -153,11 +171,11 @@ public:
|
||||
AddBuddyToList((*iter)->GetGUID());
|
||||
}
|
||||
|
||||
int pickAbilityRandom(bool *chosenAbilities)
|
||||
int pickAbilityRandom(bool* chosenAbilities)
|
||||
{
|
||||
for (int t = 0; t < 2; ++t)
|
||||
{
|
||||
for (int i = !t ? (rand()%9) : 0; i < 9; ++i)
|
||||
for (int i = !t ? (rand() % 9) : 0; i < 9; ++i)
|
||||
{
|
||||
if (!chosenAbilities[i])
|
||||
{
|
||||
@@ -171,8 +189,8 @@ public:
|
||||
|
||||
void GetOtherSentinels(Unit* who)
|
||||
{
|
||||
bool *chosenAbilities = new bool[9];
|
||||
memset(chosenAbilities, 0, 9*sizeof(bool));
|
||||
bool* chosenAbilities = new bool[9];
|
||||
memset(chosenAbilities, 0, 9 * sizeof(bool));
|
||||
selectAbility(pickAbilityRandom(chosenAbilities));
|
||||
|
||||
ClearBuddyList();
|
||||
@@ -205,7 +223,7 @@ public:
|
||||
{
|
||||
if (!me->isDead())
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (!NearbyGUID[i])
|
||||
continue;
|
||||
@@ -236,7 +254,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
for (int ni=0; ni<3; ++ni)
|
||||
for (int ni = 0; ni < 3; ++ni)
|
||||
{
|
||||
Creature* sent = ObjectAccessor::GetCreature(*me, NearbyGUID[ni]);
|
||||
if (!sent)
|
||||
|
||||
@@ -8,110 +8,110 @@
|
||||
|
||||
class instance_wailing_caverns : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_wailing_caverns() : InstanceMapScript("instance_wailing_caverns", 43) { }
|
||||
public:
|
||||
instance_wailing_caverns() : InstanceMapScript("instance_wailing_caverns", 43) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_wailing_caverns_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_wailing_caverns_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_wailing_caverns_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
return new instance_wailing_caverns_InstanceMapScript(map);
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
|
||||
DiscipleOfNaralexGUID = 0;
|
||||
SerpentisGUID = 0;
|
||||
}
|
||||
|
||||
struct instance_wailing_caverns_InstanceMapScript : public InstanceScript
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
instance_wailing_caverns_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
if (creature->GetEntry() == NPC_DISCIPLE_OF_NARALEX)
|
||||
DiscipleOfNaralexGUID = creature->GetGUID();
|
||||
else if (creature->GetEntry() == NPC_LORD_SERPENTIS)
|
||||
SerpentisGUID = creature->GetGUID();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
|
||||
DiscipleOfNaralexGUID = 0;
|
||||
SerpentisGUID = 0;
|
||||
case TYPE_LORD_COBRAHN:
|
||||
case TYPE_LORD_PYTHAS:
|
||||
case TYPE_LADY_ANACONDRA:
|
||||
case TYPE_LORD_SERPENTIS:
|
||||
case TYPE_MUTANUS:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
|
||||
if (type == TYPE_LORD_COBRAHN && _encounters[TYPE_LORD_SERPENTIS] != DONE)
|
||||
{
|
||||
if (creature->GetEntry() == NPC_DISCIPLE_OF_NARALEX)
|
||||
DiscipleOfNaralexGUID = creature->GetGUID();
|
||||
else if (creature->GetEntry() == NPC_LORD_SERPENTIS)
|
||||
SerpentisGUID = creature->GetGUID();
|
||||
instance->LoadGrid(-120.163f, -24.624f);
|
||||
if (Creature* serpentis = instance->GetCreature(SerpentisGUID))
|
||||
serpentis->AI()->Talk(SAY_SERPENTIS);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LORD_COBRAHN:
|
||||
case TYPE_LORD_PYTHAS:
|
||||
case TYPE_LADY_ANACONDRA:
|
||||
case TYPE_LORD_SERPENTIS:
|
||||
case TYPE_MUTANUS:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
|
||||
if (type == TYPE_LORD_COBRAHN && _encounters[TYPE_LORD_SERPENTIS] != DONE)
|
||||
{
|
||||
instance->LoadGrid(-120.163f, -24.624f);
|
||||
if (Creature* serpentis = instance->GetCreature(SerpentisGUID))
|
||||
serpentis->AI()->Talk(SAY_SERPENTIS);
|
||||
}
|
||||
|
||||
if (type != TYPE_MUTANUS && _encounters[TYPE_LORD_COBRAHN] == DONE && _encounters[TYPE_LORD_PYTHAS] == DONE &&
|
||||
if (type != TYPE_MUTANUS && _encounters[TYPE_LORD_COBRAHN] == DONE && _encounters[TYPE_LORD_PYTHAS] == DONE &&
|
||||
_encounters[TYPE_LADY_ANACONDRA] == DONE && _encounters[TYPE_LORD_SERPENTIS] == DONE)
|
||||
{
|
||||
instance->LoadGrid(-134.97f, 125.402f);
|
||||
if (Creature* disciple = instance->GetCreature(DiscipleOfNaralexGUID))
|
||||
disciple->AI()->Talk(SAY_DISCIPLE);
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LORD_COBRAHN:
|
||||
case TYPE_LORD_PYTHAS:
|
||||
case TYPE_LADY_ANACONDRA:
|
||||
case TYPE_LORD_SERPENTIS:
|
||||
return _encounters[type];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "W C " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2] << ' ' << _encounters[3] << ' ' << _encounters[4];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'W' && dataHead2 == 'C')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
instance->LoadGrid(-134.97f, 125.402f);
|
||||
if (Creature* disciple = instance->GetCreature(DiscipleOfNaralexGUID))
|
||||
disciple->AI()->Talk(SAY_DISCIPLE);
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LORD_COBRAHN:
|
||||
case TYPE_LORD_PYTHAS:
|
||||
case TYPE_LADY_ANACONDRA:
|
||||
case TYPE_LORD_SERPENTIS:
|
||||
return _encounters[type];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "W C " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2] << ' ' << _encounters[3] << ' ' << _encounters[4];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'W' && dataHead2 == 'C')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
uint64 DiscipleOfNaralexGUID;
|
||||
uint64 SerpentisGUID;
|
||||
};
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
uint64 DiscipleOfNaralexGUID;
|
||||
uint64 SerpentisGUID;
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_wailing_caverns()
|
||||
|
||||
@@ -12,154 +12,154 @@
|
||||
|
||||
class instance_zulfarrak : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_zulfarrak() : InstanceMapScript("instance_zulfarrak", 209) { }
|
||||
public:
|
||||
instance_zulfarrak() : InstanceMapScript("instance_zulfarrak", 209) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_zulfarrak_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_zulfarrak_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_zulfarrak_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
return new instance_zulfarrak_InstanceMapScript(map);
|
||||
_pyramidEventProgress = NOT_STARTED;
|
||||
_gahzrillaSummoned = NOT_STARTED;
|
||||
}
|
||||
|
||||
struct instance_zulfarrak_InstanceMapScript : public InstanceScript
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
instance_zulfarrak_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
if (gameobject->GetEntry() == GO_END_DOOR && _pyramidEventProgress == DONE)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_PYRAMID_EVENT)
|
||||
return _pyramidEventProgress;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
_pyramidEventProgress = NOT_STARTED;
|
||||
_gahzrillaSummoned = NOT_STARTED;
|
||||
case TYPE_PYRAMID_EVENT:
|
||||
_pyramidEventProgress = data;
|
||||
break;
|
||||
case TYPE_GAHZRILLA:
|
||||
_gahzrillaSummoned = data;
|
||||
break;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "Z F " << _pyramidEventProgress << ' ' << _gahzrillaSummoned;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'Z' && dataHead2 == 'F')
|
||||
{
|
||||
if (gameobject->GetEntry() == GO_END_DOOR && _pyramidEventProgress == DONE)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
|
||||
loadStream >> _pyramidEventProgress;
|
||||
loadStream >> _gahzrillaSummoned;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_PYRAMID_EVENT)
|
||||
return _pyramidEventProgress;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_PYRAMID_EVENT:
|
||||
_pyramidEventProgress = data;
|
||||
break;
|
||||
case TYPE_GAHZRILLA:
|
||||
_gahzrillaSummoned = data;
|
||||
break;
|
||||
}
|
||||
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "Z F " << _pyramidEventProgress << ' ' << _gahzrillaSummoned;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'Z' && dataHead2 == 'F')
|
||||
{
|
||||
loadStream >> _pyramidEventProgress;
|
||||
loadStream >> _gahzrillaSummoned;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _pyramidEventProgress;
|
||||
uint32 _gahzrillaSummoned;
|
||||
};
|
||||
private:
|
||||
uint32 _pyramidEventProgress;
|
||||
uint32 _gahzrillaSummoned;
|
||||
};
|
||||
};
|
||||
|
||||
class spell_zulfarrak_summon_zulfarrak_zombies : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_zulfarrak_summon_zulfarrak_zombies() : SpellScriptLoader("spell_zulfarrak_summon_zulfarrak_zombies") { }
|
||||
public:
|
||||
spell_zulfarrak_summon_zulfarrak_zombies() : SpellScriptLoader("spell_zulfarrak_summon_zulfarrak_zombies") { }
|
||||
|
||||
class spell_zulfarrak_summon_zulfarrak_zombies_SpellScript : public SpellScript
|
||||
class spell_zulfarrak_summon_zulfarrak_zombies_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_zulfarrak_summon_zulfarrak_zombies_SpellScript);
|
||||
|
||||
void HandleSummon(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_zulfarrak_summon_zulfarrak_zombies_SpellScript);
|
||||
|
||||
void HandleSummon(SpellEffIndex effIndex)
|
||||
if (effIndex == EFFECT_0)
|
||||
{
|
||||
if (effIndex == EFFECT_0)
|
||||
{
|
||||
if (roll_chance_i(30))
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (roll_chance_i(40))
|
||||
if (roll_chance_i(30))
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
else if (roll_chance_i(40))
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_zulfarrak_summon_zulfarrak_zombies_SpellScript::HandleSummon, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnEffectHit += SpellEffectFn(spell_zulfarrak_summon_zulfarrak_zombies_SpellScript::HandleSummon, EFFECT_1, SPELL_EFFECT_SUMMON);
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_zulfarrak_summon_zulfarrak_zombies_SpellScript;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_zulfarrak_summon_zulfarrak_zombies_SpellScript::HandleSummon, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnEffectHit += SpellEffectFn(spell_zulfarrak_summon_zulfarrak_zombies_SpellScript::HandleSummon, EFFECT_1, SPELL_EFFECT_SUMMON);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_zulfarrak_summon_zulfarrak_zombies_SpellScript;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_zulfarrak_unlocking : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_zulfarrak_unlocking() : SpellScriptLoader("spell_zulfarrak_unlocking") { }
|
||||
public:
|
||||
spell_zulfarrak_unlocking() : SpellScriptLoader("spell_zulfarrak_unlocking") { }
|
||||
|
||||
class spell_zulfarrak_unlocking_SpellScript : public SpellScript
|
||||
class spell_zulfarrak_unlocking_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_zulfarrak_unlocking_SpellScript);
|
||||
|
||||
void HandleOpenLock(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_zulfarrak_unlocking_SpellScript);
|
||||
|
||||
void HandleOpenLock(SpellEffIndex /*effIndex*/)
|
||||
GameObject* cage = GetHitGObj();
|
||||
std::list<WorldObject*> cagesList;
|
||||
acore::AllWorldObjectsInRange objects(GetCaster(), 15.0f);
|
||||
acore::WorldObjectListSearcher<acore::AllWorldObjectsInRange> searcher(GetCaster(), cagesList, objects);
|
||||
GetCaster()->VisitNearbyObject(15.0f, searcher);
|
||||
for (std::list<WorldObject*>::const_iterator itr = cagesList.begin(); itr != cagesList.end(); ++itr)
|
||||
{
|
||||
GameObject* cage = GetHitGObj();
|
||||
std::list<WorldObject*> cagesList;
|
||||
acore::AllWorldObjectsInRange objects(GetCaster(), 15.0f);
|
||||
acore::WorldObjectListSearcher<acore::AllWorldObjectsInRange> searcher(GetCaster(), cagesList, objects);
|
||||
GetCaster()->VisitNearbyObject(15.0f, searcher);
|
||||
for (std::list<WorldObject*>::const_iterator itr = cagesList.begin(); itr != cagesList.end(); ++itr)
|
||||
{
|
||||
if (GameObject* go = (*itr)->ToGameObject())
|
||||
if (go->GetDisplayId() == cage->GetDisplayId())
|
||||
go->UseDoorOrButton(0, false, GetCaster());
|
||||
}
|
||||
if (GameObject* go = (*itr)->ToGameObject())
|
||||
if (go->GetDisplayId() == cage->GetDisplayId())
|
||||
go->UseDoorOrButton(0, false, GetCaster());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_zulfarrak_unlocking_SpellScript::HandleOpenLock, EFFECT_0, SPELL_EFFECT_OPEN_LOCK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_zulfarrak_unlocking_SpellScript();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_zulfarrak_unlocking_SpellScript::HandleOpenLock, EFFECT_0, SPELL_EFFECT_OPEN_LOCK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_zulfarrak_unlocking_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_zulfarrak()
|
||||
|
||||
@@ -85,13 +85,14 @@ public:
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
{
|
||||
DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation());
|
||||
DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 3, unit->GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
DoResetThreat();
|
||||
TeleportTimer = 30000;
|
||||
} else TeleportTimer -= diff;
|
||||
}
|
||||
else TeleportTimer -= diff;
|
||||
|
||||
// //MarkOfFrostTimer
|
||||
// if (MarkOfFrostTimer <= diff)
|
||||
@@ -105,14 +106,16 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_CHILL);
|
||||
ChillTimer = urand(13000, 25000);
|
||||
} else ChillTimer -= diff;
|
||||
}
|
||||
else ChillTimer -= diff;
|
||||
|
||||
//BreathTimer
|
||||
if (BreathTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROSTBREATH);
|
||||
BreathTimer = urand(10000, 15000);
|
||||
} else BreathTimer -= diff;
|
||||
}
|
||||
else BreathTimer -= diff;
|
||||
|
||||
//ManaStormTimer
|
||||
if (ManaStormTimer <= diff)
|
||||
@@ -120,21 +123,24 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_MANASTORM);
|
||||
ManaStormTimer = urand(7500, 12500);
|
||||
} else ManaStormTimer -= diff;
|
||||
}
|
||||
else ManaStormTimer -= diff;
|
||||
|
||||
//ReflectTimer
|
||||
if (ReflectTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_REFLECT);
|
||||
ReflectTimer = urand(20000, 35000);
|
||||
} else ReflectTimer -= diff;
|
||||
}
|
||||
else ReflectTimer -= diff;
|
||||
|
||||
//CleaveTimer
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
CleaveTimer = 7000;
|
||||
} else CleaveTimer -= diff;
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
|
||||
//EnrageTimer
|
||||
if (HealthBelowPct(26) && !Enraged)
|
||||
|
||||
@@ -210,83 +210,83 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
switch (waypointId)
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_MUG_START2, player);
|
||||
break;
|
||||
case 24:
|
||||
Talk(SAY_MUG_BRAZIER, player);
|
||||
|
||||
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2))
|
||||
{
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
SetEscortPaused(true);
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
Talk(SAY_MUG_GRATITUDE);
|
||||
player->GroupEventHappens(QUEST_VORSHA, me);
|
||||
break;
|
||||
case 26:
|
||||
Talk(SAY_MUG_PATROL);
|
||||
break;
|
||||
case 27:
|
||||
Talk(SAY_MUG_RETURN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoWaveSummon()
|
||||
{
|
||||
switch (waveId)
|
||||
{
|
||||
case 1:
|
||||
me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
case 0:
|
||||
Talk(SAY_MUG_START2, player);
|
||||
break;
|
||||
case 2:
|
||||
me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
break;
|
||||
case 3:
|
||||
me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
break;
|
||||
case 4:
|
||||
SetEscortPaused(false);
|
||||
Talk(SAY_MUG_DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 24:
|
||||
Talk(SAY_MUG_BRAZIER, player);
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_PAUSED) && _isBrazierExtinguished)
|
||||
{
|
||||
if (eventTimer < diff)
|
||||
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE * 2))
|
||||
{
|
||||
++waveId;
|
||||
DoWaveSummon();
|
||||
eventTimer = 10000;
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
SetEscortPaused(true);
|
||||
}
|
||||
else
|
||||
eventTimer -= diff;
|
||||
}
|
||||
return;
|
||||
break;
|
||||
case 25:
|
||||
Talk(SAY_MUG_GRATITUDE);
|
||||
player->GroupEventHappens(QUEST_VORSHA, me);
|
||||
break;
|
||||
case 26:
|
||||
Talk(SAY_MUG_PATROL);
|
||||
break;
|
||||
case 27:
|
||||
Talk(SAY_MUG_RETURN);
|
||||
break;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
void DoWaveSummon()
|
||||
{
|
||||
switch (waveId)
|
||||
{
|
||||
case 1:
|
||||
me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
break;
|
||||
case 2:
|
||||
me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
break;
|
||||
case 3:
|
||||
me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
break;
|
||||
case 4:
|
||||
SetEscortPaused(false);
|
||||
Talk(SAY_MUG_DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_PAUSED) && _isBrazierExtinguished)
|
||||
{
|
||||
if (eventTimer < diff)
|
||||
{
|
||||
++waveId;
|
||||
DoWaveSummon();
|
||||
eventTimer = 10000;
|
||||
}
|
||||
else
|
||||
eventTimer -= diff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 eventTimer;
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
if (Creature* creature = GetClosestCreatureWithEntry(go, NPC_MUGLASH, INTERACTION_DISTANCE*2))
|
||||
if (Creature* creature = GetClosestCreatureWithEntry(go, NPC_MUGLASH, INTERACTION_DISTANCE * 2))
|
||||
{
|
||||
if (npc_muglash::npc_muglashAI* pEscortAI = CAST_AI(npc_muglash::npc_muglashAI, creature->AI()))
|
||||
{
|
||||
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
return;
|
||||
}
|
||||
// walk 5 seconds before summoning
|
||||
if (spellhit && morphtimer<5000)
|
||||
if (spellhit && morphtimer < 5000)
|
||||
{
|
||||
morphtimer+=diff;
|
||||
morphtimer += diff;
|
||||
if (morphtimer >= 5000)
|
||||
{
|
||||
DoCast(me, SPELL_POLYMORPH_BACKFIRE); // summon copies
|
||||
@@ -275,7 +275,8 @@ public:
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
} else MustDieTimer -= diff;
|
||||
}
|
||||
else MustDieTimer -= diff;
|
||||
}
|
||||
|
||||
if (!Escape)
|
||||
@@ -287,7 +288,8 @@ public:
|
||||
{
|
||||
DoCast(me, SPELL_RIZZLE_ESCAPE, false);
|
||||
SpellEscapeTimer = 10000;
|
||||
} else SpellEscapeTimer -= diff;
|
||||
}
|
||||
else SpellEscapeTimer -= diff;
|
||||
|
||||
if (TeleportTimer <= diff)
|
||||
{
|
||||
@@ -307,7 +309,8 @@ public:
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]);
|
||||
Escape = true;
|
||||
} else TeleportTimer -= diff;
|
||||
}
|
||||
else TeleportTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -322,11 +325,12 @@ public:
|
||||
{
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
|
||||
{
|
||||
Talk(SAY_RIZZLE_GRENADE, player);
|
||||
DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
|
||||
Talk(SAY_RIZZLE_GRENADE, player);
|
||||
DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
|
||||
}
|
||||
GrenadeTimer = 30000;
|
||||
} else GrenadeTimer -= diff;
|
||||
}
|
||||
else GrenadeTimer -= diff;
|
||||
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
@@ -348,7 +352,8 @@ public:
|
||||
}
|
||||
|
||||
CheckTimer = 1000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -372,7 +377,7 @@ public:
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 10811, creature->GetGUID());
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Azuremyst_Isle
|
||||
@@ -126,7 +126,8 @@ public:
|
||||
|
||||
RunAwayTimer = 10000;
|
||||
SayThanksTimer = 0;
|
||||
} else SayThanksTimer -= diff;
|
||||
}
|
||||
else SayThanksTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -145,7 +146,8 @@ public:
|
||||
{
|
||||
CanSayHelp = true;
|
||||
SayHelpTimer = 20000;
|
||||
} else SayHelpTimer -= diff;
|
||||
}
|
||||
else SayHelpTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -220,7 +222,8 @@ public:
|
||||
Talk(SAY_TEXT);
|
||||
Talk(SAY_EMOTE);
|
||||
EmoteTimer = urand(120000, 150000);
|
||||
} else EmoteTimer -= diff;
|
||||
}
|
||||
else EmoteTimer -= diff;
|
||||
}
|
||||
else if (IsTreeEvent)
|
||||
return;
|
||||
@@ -232,7 +235,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_DYNAMITE);
|
||||
DynamiteTimer = 8000;
|
||||
} else DynamiteTimer -= diff;
|
||||
}
|
||||
else DynamiteTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -481,7 +485,8 @@ public:
|
||||
DespawnNagaFlag(false);
|
||||
me->DespawnOrUnsummon(1);
|
||||
return 5000;
|
||||
default: return 99999999;
|
||||
default:
|
||||
return 99999999;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,7 +579,7 @@ public:
|
||||
|
||||
struct npc_death_ravagerAI : public ScriptedAI
|
||||
{
|
||||
npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){ }
|
||||
npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 RendTimer;
|
||||
uint32 EnragingBiteTimer;
|
||||
@@ -635,70 +640,70 @@ enum BristlelimbCage
|
||||
|
||||
class npc_stillpine_capitive : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_stillpine_capitive() : CreatureScript("npc_stillpine_capitive") { }
|
||||
public:
|
||||
npc_stillpine_capitive() : CreatureScript("npc_stillpine_capitive") { }
|
||||
|
||||
struct npc_stillpine_capitiveAI : public ScriptedAI
|
||||
struct npc_stillpine_capitiveAI : public ScriptedAI
|
||||
{
|
||||
npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
if (GameObject* cage = me->FindNearestGameObject(GO_BRISTELIMB_CAGE, 5.0f))
|
||||
{
|
||||
if (GameObject* cage = me->FindNearestGameObject(GO_BRISTELIMB_CAGE, 5.0f))
|
||||
{
|
||||
cage->SetLootState(GO_JUST_DEACTIVATED);
|
||||
cage->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
_events.Reset();
|
||||
_playerGUID = 0;
|
||||
_movementComplete = false;
|
||||
cage->SetLootState(GO_JUST_DEACTIVATED);
|
||||
cage->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
|
||||
void StartMoving(Player* owner)
|
||||
{
|
||||
if (owner)
|
||||
{
|
||||
Talk(CAPITIVE_SAY, owner);
|
||||
_playerGUID = owner->GetGUID();
|
||||
}
|
||||
Position pos;
|
||||
me->GetNearPosition(pos, 3.0f, 0.0f);
|
||||
me->GetMotionMaster()->MovePoint(POINT_INIT, pos);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != POINT_INIT)
|
||||
return;
|
||||
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
|
||||
|
||||
_movementComplete = true;
|
||||
_events.ScheduleEvent(EVENT_DESPAWN, 3500);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!_movementComplete)
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (_events.ExecuteEvent() == EVENT_DESPAWN)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _playerGUID;
|
||||
EventMap _events;
|
||||
bool _movementComplete;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_stillpine_capitiveAI(creature);
|
||||
_events.Reset();
|
||||
_playerGUID = 0;
|
||||
_movementComplete = false;
|
||||
}
|
||||
|
||||
void StartMoving(Player* owner)
|
||||
{
|
||||
if (owner)
|
||||
{
|
||||
Talk(CAPITIVE_SAY, owner);
|
||||
_playerGUID = owner->GetGUID();
|
||||
}
|
||||
Position pos;
|
||||
me->GetNearPosition(pos, 3.0f, 0.0f);
|
||||
me->GetMotionMaster()->MovePoint(POINT_INIT, pos);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != POINT_INIT)
|
||||
return;
|
||||
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
|
||||
|
||||
_movementComplete = true;
|
||||
_events.ScheduleEvent(EVENT_DESPAWN, 3500);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!_movementComplete)
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (_events.ExecuteEvent() == EVENT_DESPAWN)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _playerGUID;
|
||||
EventMap _events;
|
||||
bool _movementComplete;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_stillpine_capitiveAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class go_bristlelimb_cage : public GameObjectScript
|
||||
|
||||
@@ -80,48 +80,48 @@ public:
|
||||
spawnTimer = 0;
|
||||
switch (phase)
|
||||
{
|
||||
case 0:
|
||||
if (!me->FindNearestCreature(NPC_GREYMIST_WARRIOR, 80.0f, true) && !me->FindNearestCreature(NPC_GREYMIST_HUNTER, 80.0f, true))
|
||||
{
|
||||
Player *player = me->SelectNearestPlayer(100.0f);
|
||||
if (!player)
|
||||
return;
|
||||
case 0:
|
||||
if (!me->FindNearestCreature(NPC_GREYMIST_WARRIOR, 80.0f, true) && !me->FindNearestCreature(NPC_GREYMIST_HUNTER, 80.0f, true))
|
||||
{
|
||||
Player* player = me->SelectNearestPlayer(100.0f);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
phase++;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
if (Creature* cr = me->SummonCreature(NPC_GREYMIST_COASTRUNNER, me->GetPositionX()+irand(-5, 5), me->GetPositionY()+irand(-5, 5), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
phase++;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
if (Creature* cr = me->SummonCreature(NPC_GREYMIST_COASTRUNNER, me->GetPositionX() + irand(-5, 5), me->GetPositionY() + irand(-5, 5), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
}
|
||||
return;
|
||||
case 1:
|
||||
if (!me->FindNearestCreature(NPC_GREYMIST_COASTRUNNER, 80.0f))
|
||||
{
|
||||
Player* player = me->SelectNearestPlayer(100.0f);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
phase++;
|
||||
for (int i = 0; i < 2; ++i)
|
||||
if (Creature* cr = me->SummonCreature(NPC_GREYMIST_WARRIOR, me->GetPositionX() + irand(-5, 5), me->GetPositionY() + irand(-5, 5), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
}
|
||||
return;
|
||||
case 2:
|
||||
if (!me->FindNearestCreature(NPC_GREYMIST_WARRIOR, 80.0f))
|
||||
{
|
||||
Player* player = me->SelectNearestPlayer(100.0f);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
phase++;
|
||||
if (Creature* cr = me->SummonCreature(NPC_GREYMIST_HUNTER, me->GetPositionX() + irand(-5, 5), me->GetPositionY() + irand(-5, 5), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
}
|
||||
return;
|
||||
case 1:
|
||||
if (!me->FindNearestCreature(NPC_GREYMIST_COASTRUNNER, 80.0f))
|
||||
{
|
||||
Player *player = me->SelectNearestPlayer(100.0f);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
phase++;
|
||||
for (int i = 0; i < 2; ++i)
|
||||
if (Creature* cr = me->SummonCreature(NPC_GREYMIST_WARRIOR, me->GetPositionX()+irand(-5, 5), me->GetPositionY()+irand(-5, 5), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
}
|
||||
return;
|
||||
case 2:
|
||||
if (!me->FindNearestCreature(NPC_GREYMIST_WARRIOR, 80.0f))
|
||||
{
|
||||
Player *player = me->SelectNearestPlayer(100.0f);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
phase++;
|
||||
if (Creature* cr = me->SummonCreature(NPC_GREYMIST_HUNTER, me->GetPositionX()+irand(-5, 5), me->GetPositionY()+irand(-5, 5), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetVisible(true);
|
||||
AttackStart(player);
|
||||
}
|
||||
return;
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetVisible(true);
|
||||
AttackStart(player);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
|
||||
if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS)
|
||||
{
|
||||
if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5))
|
||||
if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE * 5))
|
||||
{
|
||||
if (Player* player = GetLeaderForFollower())
|
||||
{
|
||||
@@ -469,7 +469,7 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
@@ -486,7 +486,7 @@ public:
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
|
||||
@@ -45,8 +45,8 @@ enum Caravan
|
||||
|
||||
MAX_CARAVAN_SUMMONS = 3,
|
||||
|
||||
TIME_SHOP_STOP = 10*MINUTE*IN_MILLISECONDS,
|
||||
TIME_HIRE_STOP = 4*MINUTE*IN_MILLISECONDS,
|
||||
TIME_SHOP_STOP = 10 * MINUTE * IN_MILLISECONDS,
|
||||
TIME_HIRE_STOP = 4 * MINUTE * IN_MILLISECONDS,
|
||||
|
||||
// Ambush
|
||||
NPC_KOLKAR_WAYLAYER = 12976,
|
||||
@@ -59,271 +59,271 @@ enum Caravan
|
||||
|
||||
class npc_cork_gizelton : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_cork_gizelton() : CreatureScript("npc_cork_gizelton") { }
|
||||
public:
|
||||
npc_cork_gizelton() : CreatureScript("npc_cork_gizelton") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BODYGUARD_FOR_HIRE)
|
||||
creature->AI()->SetGUID(player->GetGUID(), player->getFaction());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_cork_gizeltonAI(creature);
|
||||
}
|
||||
|
||||
struct npc_cork_gizeltonAI : public npc_escortAI
|
||||
{
|
||||
npc_cork_gizeltonAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BODYGUARD_FOR_HIRE)
|
||||
creature->AI()->SetGUID(player->GetGUID(), player->getFaction());
|
||||
memset(&summons, 0, sizeof(summons));
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
uint64 summons[MAX_CARAVAN_SUMMONS];
|
||||
bool headNorth;
|
||||
|
||||
uint64 _playerGUID;
|
||||
uint32 _faction;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_playerGUID = 0;
|
||||
_faction = 35;
|
||||
headNorth = true;
|
||||
me->setActive(true);
|
||||
events.ScheduleEvent(EVENT_RESTART_ESCORT, 0);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
npc_escortAI::JustRespawned();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
npc_escortAI::InitializeAI();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
RemoveSummons();
|
||||
npc_escortAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
SummonsFollow();
|
||||
ImmuneFlagSet(false, 35);
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void CheckPlayer()
|
||||
{
|
||||
if (_playerGUID)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
if (me->IsWithinDist(player, 60.0f))
|
||||
return;
|
||||
|
||||
_playerGUID = 0;
|
||||
_faction = 35;
|
||||
ImmuneFlagSet(false, _faction);
|
||||
}
|
||||
|
||||
void SetGUID(uint64 playerGUID, int32 faction)
|
||||
{
|
||||
_playerGUID = playerGUID;
|
||||
_faction = faction;
|
||||
SetEscortPaused(false);
|
||||
if (Creature* active = !headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
active->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
events.CancelEvent(EVENT_WAIT_FOR_ASSIST);
|
||||
}
|
||||
|
||||
void SetData(uint32 field, uint32 data)
|
||||
{
|
||||
if (field == 1 && data == 1)
|
||||
if (Player* player = me->SelectNearestPlayer(50.0f))
|
||||
SetGUID(player->GetGUID(), player->getFaction());
|
||||
}
|
||||
|
||||
bool CheckCaravan()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
{
|
||||
if (summons[i] == 0)
|
||||
{
|
||||
SummonHelpers();
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]);
|
||||
if (!summon || me->GetDistance2d(summon) > 25.0f)
|
||||
{
|
||||
SummonHelpers();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
void RemoveSummons()
|
||||
{
|
||||
return new npc_cork_gizeltonAI(creature);
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
{
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
summon->DespawnOrUnsummon();
|
||||
|
||||
summons[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
struct npc_cork_gizeltonAI : public npc_escortAI
|
||||
void SummonHelpers()
|
||||
{
|
||||
npc_cork_gizeltonAI(Creature* creature) : npc_escortAI(creature)
|
||||
RemoveSummons();
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
Creature* cr = nullptr;
|
||||
if ((cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me)))
|
||||
{
|
||||
memset(&summons, 0, sizeof(summons));
|
||||
cr->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
summons[0] = cr->GetGUID();
|
||||
}
|
||||
if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)))
|
||||
summons[1] = cr->GetGUID();
|
||||
if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)))
|
||||
summons[2] = cr->GetGUID();
|
||||
|
||||
EventMap events;
|
||||
uint64 summons[MAX_CARAVAN_SUMMONS];
|
||||
bool headNorth;
|
||||
SummonsFollow();
|
||||
}
|
||||
|
||||
uint64 _playerGUID;
|
||||
uint32 _faction;
|
||||
void SummonedCreatureDies(Creature* creature, Unit*)
|
||||
{
|
||||
if (creature->GetGUID() == summons[0])
|
||||
summons[0] = 0;
|
||||
else if (creature->GetGUID() == summons[1])
|
||||
summons[1] = 0;
|
||||
else if (creature->GetGUID() == summons[2])
|
||||
summons[2] = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
void SummonedCreatureDespawn(Creature* creature)
|
||||
{
|
||||
if (creature->GetGUID() == summons[0])
|
||||
summons[0] = 0;
|
||||
else if (creature->GetGUID() == summons[1])
|
||||
summons[1] = 0;
|
||||
else if (creature->GetGUID() == summons[2])
|
||||
summons[2] = 0;
|
||||
}
|
||||
|
||||
void SummonsFollow()
|
||||
{
|
||||
float dist = 1.0f;
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
{
|
||||
summon->GetMotionMaster()->Clear(false);
|
||||
summon->StopMoving();
|
||||
summon->GetMotionMaster()->MoveFollow(me, dist, M_PI, MOTION_SLOT_ACTIVE);
|
||||
dist += (i == 1 ? 9.5f : 3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void RelocateSummons()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
summon->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
|
||||
void ImmuneFlagSet(bool remove, uint32 faction)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
{
|
||||
summon->setFaction(faction);
|
||||
if (remove)
|
||||
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
else
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
if (remove)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
else
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->setFaction(faction);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
RelocateSummons();
|
||||
switch (waypointId)
|
||||
{
|
||||
_playerGUID = 0;
|
||||
_faction = 35;
|
||||
headNorth = true;
|
||||
me->setActive(true);
|
||||
events.ScheduleEvent(EVENT_RESTART_ESCORT, 0);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
npc_escortAI::JustRespawned();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
npc_escortAI::InitializeAI();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
RemoveSummons();
|
||||
npc_escortAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
SummonsFollow();
|
||||
ImmuneFlagSet(false, 35);
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void CheckPlayer()
|
||||
{
|
||||
if (_playerGUID)
|
||||
// Finished north path
|
||||
case 52:
|
||||
me->SummonCreature(NPC_VENDOR_TRON, -694.61f, 1460.7f, 90.794f, 2.4f, TEMPSUMMON_TIMED_DESPAWN, TIME_SHOP_STOP + 15 * IN_MILLISECONDS);
|
||||
SetEscortPaused(true);
|
||||
events.ScheduleEvent(EVENT_RESUME_PATH, TIME_SHOP_STOP);
|
||||
CheckCaravan();
|
||||
break;
|
||||
// Finished south path
|
||||
case 193:
|
||||
me->SummonCreature(NPC_SUPER_SELLER, -1905.5f, 2463.3f, 61.52f, 5.87f, TEMPSUMMON_TIMED_DESPAWN, TIME_SHOP_STOP + 15 * IN_MILLISECONDS);
|
||||
SetEscortPaused(true);
|
||||
events.ScheduleEvent(EVENT_RESUME_PATH, TIME_SHOP_STOP);
|
||||
CheckCaravan();
|
||||
break;
|
||||
// North -> South - hire
|
||||
case 77:
|
||||
SetEscortPaused(true);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
Talk(SAY_CARAVAN_HIRE);
|
||||
events.ScheduleEvent(EVENT_WAIT_FOR_ASSIST, TIME_HIRE_STOP);
|
||||
break;
|
||||
// Sout -> North - hire
|
||||
case 208:
|
||||
SetEscortPaused(true);
|
||||
if (Creature* rigger = ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
{
|
||||
rigger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
rigger->AI()->Talk(SAY_CARAVAN_HIRE);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_WAIT_FOR_ASSIST, TIME_HIRE_STOP);
|
||||
break;
|
||||
// North -> South - complete
|
||||
case 103:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
if (me->IsWithinDist(player, 60.0f))
|
||||
return;
|
||||
|
||||
_playerGUID = 0;
|
||||
_faction = 35;
|
||||
ImmuneFlagSet(false, _faction);
|
||||
}
|
||||
|
||||
void SetGUID(uint64 playerGUID, int32 faction)
|
||||
{
|
||||
_playerGUID = playerGUID;
|
||||
_faction = faction;
|
||||
SetEscortPaused(false);
|
||||
if (Creature* active = !headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
active->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
events.CancelEvent(EVENT_WAIT_FOR_ASSIST);
|
||||
}
|
||||
|
||||
void SetData(uint32 field, uint32 data)
|
||||
{
|
||||
if (field == 1 && data == 1)
|
||||
if (Player* player = me->SelectNearestPlayer(50.0f))
|
||||
SetGUID(player->GetGUID(), player->getFaction());
|
||||
}
|
||||
|
||||
bool CheckCaravan()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
{
|
||||
if (summons[i] == 0)
|
||||
{
|
||||
SummonHelpers();
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]);
|
||||
if (!summon || me->GetDistance2d(summon) > 25.0f)
|
||||
{
|
||||
SummonHelpers();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemoveSummons()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
{
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
summon->DespawnOrUnsummon();
|
||||
|
||||
summons[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SummonHelpers()
|
||||
{
|
||||
RemoveSummons();
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
Creature* cr = nullptr;
|
||||
if ((cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me)))
|
||||
{
|
||||
cr->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
summons[0] = cr->GetGUID();
|
||||
}
|
||||
if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)))
|
||||
summons[1] = cr->GetGUID();
|
||||
if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)))
|
||||
summons[2] = cr->GetGUID();
|
||||
|
||||
SummonsFollow();
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* creature, Unit*)
|
||||
{
|
||||
if (creature->GetGUID() == summons[0])
|
||||
summons[0] = 0;
|
||||
else if (creature->GetGUID() == summons[1])
|
||||
summons[1] = 0;
|
||||
else if (creature->GetGUID() == summons[2])
|
||||
summons[2] = 0;
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* creature)
|
||||
{
|
||||
if (creature->GetGUID() == summons[0])
|
||||
summons[0] = 0;
|
||||
else if (creature->GetGUID() == summons[1])
|
||||
summons[1] = 0;
|
||||
else if (creature->GetGUID() == summons[2])
|
||||
summons[2] = 0;
|
||||
}
|
||||
|
||||
void SummonsFollow()
|
||||
{
|
||||
float dist = 1.0f;
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
{
|
||||
summon->GetMotionMaster()->Clear(false);
|
||||
summon->StopMoving();
|
||||
summon->GetMotionMaster()->MoveFollow(me, dist, M_PI, MOTION_SLOT_ACTIVE);
|
||||
dist += (i == 1 ? 9.5f : 3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void RelocateSummons()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
summon->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
|
||||
void ImmuneFlagSet(bool remove, uint32 faction)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CARAVAN_SUMMONS; ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, summons[i]))
|
||||
{
|
||||
summon->setFaction(faction);
|
||||
if (remove)
|
||||
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
if (CheckCaravan())
|
||||
player->GroupEventHappens(QUEST_BODYGUARD_FOR_HIRE, player);
|
||||
else
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
player->FailQuest(QUEST_BODYGUARD_FOR_HIRE);
|
||||
}
|
||||
if (remove)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
else
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->setFaction(faction);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
RelocateSummons();
|
||||
switch (waypointId)
|
||||
{
|
||||
// Finished north path
|
||||
case 52:
|
||||
me->SummonCreature(NPC_VENDOR_TRON, -694.61f, 1460.7f, 90.794f, 2.4f, TEMPSUMMON_TIMED_DESPAWN, TIME_SHOP_STOP+15*IN_MILLISECONDS);
|
||||
SetEscortPaused(true);
|
||||
events.ScheduleEvent(EVENT_RESUME_PATH, TIME_SHOP_STOP);
|
||||
CheckCaravan();
|
||||
break;
|
||||
// Finished south path
|
||||
case 193:
|
||||
me->SummonCreature(NPC_SUPER_SELLER, -1905.5f, 2463.3f, 61.52f, 5.87f, TEMPSUMMON_TIMED_DESPAWN, TIME_SHOP_STOP+15*IN_MILLISECONDS);
|
||||
SetEscortPaused(true);
|
||||
events.ScheduleEvent(EVENT_RESUME_PATH, TIME_SHOP_STOP);
|
||||
CheckCaravan();
|
||||
break;
|
||||
// North -> South - hire
|
||||
case 77:
|
||||
SetEscortPaused(true);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
Talk(SAY_CARAVAN_HIRE);
|
||||
events.ScheduleEvent(EVENT_WAIT_FOR_ASSIST, TIME_HIRE_STOP);
|
||||
break;
|
||||
// Sout -> North - hire
|
||||
case 208:
|
||||
SetEscortPaused(true);
|
||||
if (Creature* rigger = ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
{
|
||||
rigger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
rigger->AI()->Talk(SAY_CARAVAN_HIRE);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_WAIT_FOR_ASSIST, TIME_HIRE_STOP);
|
||||
break;
|
||||
// North -> South - complete
|
||||
case 103:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
{
|
||||
if (CheckCaravan())
|
||||
player->GroupEventHappens(QUEST_BODYGUARD_FOR_HIRE, player);
|
||||
else
|
||||
player->FailQuest(QUEST_BODYGUARD_FOR_HIRE);
|
||||
}
|
||||
_playerGUID = 0;
|
||||
CheckPlayer();
|
||||
break;
|
||||
// South -> North - complete
|
||||
case 235:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
{
|
||||
if (CheckCaravan())
|
||||
player->GroupEventHappens(QUEST_GIZELTON_CARAVAN, player);
|
||||
else
|
||||
player->FailQuest(QUEST_GIZELTON_CARAVAN);
|
||||
}
|
||||
_playerGUID = 0;
|
||||
CheckPlayer();
|
||||
break;
|
||||
// North -> South - spawn attackers
|
||||
case 83:
|
||||
case 93:
|
||||
case 100:
|
||||
_playerGUID = 0;
|
||||
CheckPlayer();
|
||||
break;
|
||||
// South -> North - complete
|
||||
case 235:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
{
|
||||
if (CheckCaravan())
|
||||
player->GroupEventHappens(QUEST_GIZELTON_CARAVAN, player);
|
||||
else
|
||||
player->FailQuest(QUEST_GIZELTON_CARAVAN);
|
||||
}
|
||||
_playerGUID = 0;
|
||||
CheckPlayer();
|
||||
break;
|
||||
// North -> South - spawn attackers
|
||||
case 83:
|
||||
case 93:
|
||||
case 100:
|
||||
{
|
||||
if (!_playerGUID)
|
||||
return;
|
||||
@@ -331,11 +331,11 @@ class npc_cork_gizelton : public CreatureScript
|
||||
Creature* cr = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
float o = (i*M_PI/2)+(M_PI/4);
|
||||
float x = me->GetPositionX()+cos(o)*15.0f;
|
||||
float y = me->GetPositionY()+sin(o)*15.0f;
|
||||
if ((cr = me->SummonCreature((i%2 == 0 ? NPC_KOLKAR_WAYLAYER : NPC_KOLKAR_AMBUSHER),
|
||||
x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
|
||||
float o = (i * M_PI / 2) + (M_PI / 4);
|
||||
float x = me->GetPositionX() + cos(o) * 15.0f;
|
||||
float y = me->GetPositionY() + sin(o) * 15.0f;
|
||||
if ((cr = me->SummonCreature((i % 2 == 0 ? NPC_KOLKAR_WAYLAYER : NPC_KOLKAR_AMBUSHER),
|
||||
x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
|
||||
cr->AI()->AttackStart(me);
|
||||
}
|
||||
if (cr)
|
||||
@@ -345,10 +345,10 @@ class npc_cork_gizelton : public CreatureScript
|
||||
}
|
||||
break;
|
||||
}
|
||||
// South -> North - spawn attackers
|
||||
case 221:
|
||||
case 228:
|
||||
case 233:
|
||||
// South -> North - spawn attackers
|
||||
case 221:
|
||||
case 228:
|
||||
case 233:
|
||||
{
|
||||
if (!_playerGUID)
|
||||
return;
|
||||
@@ -356,9 +356,9 @@ class npc_cork_gizelton : public CreatureScript
|
||||
Creature* cr = nullptr;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
float o = i*2*M_PI/3;
|
||||
float x = me->GetPositionX()+cos(o)*10.0f;
|
||||
float y = me->GetPositionY()+sin(o)*10.0f;
|
||||
float o = i * 2 * M_PI / 3;
|
||||
float x = me->GetPositionX() + cos(o) * 10.0f;
|
||||
float y = me->GetPositionY() + sin(o) * 10.0f;
|
||||
uint32 entry = NPC_LESSER_INFERNAL;
|
||||
if (i)
|
||||
entry = i == 1 ? NPC_DOOMWARDER : NPC_NETHER;
|
||||
@@ -373,43 +373,43 @@ class npc_cork_gizelton : public CreatureScript
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 282:
|
||||
events.ScheduleEvent(EVENT_RESTART_ESCORT, 1000);
|
||||
break;
|
||||
case 282:
|
||||
events.ScheduleEvent(EVENT_RESTART_ESCORT, 1000);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateEscortAI(uint32 diff)
|
||||
void UpdateEscortAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_RESUME_PATH:
|
||||
SetEscortPaused(false);
|
||||
if (Creature* talker = headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
talker->AI()->Talk(SAY_CARAVAN_LEAVE);
|
||||
case EVENT_RESUME_PATH:
|
||||
SetEscortPaused(false);
|
||||
if (Creature* talker = headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
talker->AI()->Talk(SAY_CARAVAN_LEAVE);
|
||||
|
||||
headNorth = !headNorth;
|
||||
break;
|
||||
case EVENT_WAIT_FOR_ASSIST:
|
||||
SetEscortPaused(false);
|
||||
if (Creature* active = !headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
active->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
break;
|
||||
case EVENT_RESTART_ESCORT:
|
||||
CheckCaravan();
|
||||
SetDespawnAtEnd(false);
|
||||
Start(true, true, 0, 0, false, false, true);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
headNorth = !headNorth;
|
||||
break;
|
||||
case EVENT_WAIT_FOR_ASSIST:
|
||||
SetEscortPaused(false);
|
||||
if (Creature* active = !headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
|
||||
active->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
break;
|
||||
case EVENT_RESTART_ESCORT:
|
||||
CheckCaravan();
|
||||
SetDespawnAtEnd(false);
|
||||
Start(true, true, 0, 0, false, false, true);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ public:
|
||||
if (spell->Id == SPELL_KODO_KOMBO_ITEM)
|
||||
{
|
||||
if (!(caster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || me->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
|
||||
&& (me->GetEntry() == NPC_AGED_KODO || me->GetEntry() == NPC_DYING_KODO || me->GetEntry() == NPC_ANCIENT_KODO))
|
||||
&& (me->GetEntry() == NPC_AGED_KODO || me->GetEntry() == NPC_DYING_KODO || me->GetEntry() == NPC_ANCIENT_KODO))
|
||||
{
|
||||
me->UpdateEntry(NPC_TAMED_KODO, NULL, false);
|
||||
EnterEvadeMode();
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
|
||||
{
|
||||
{
|
||||
if (npc_escortAI* escortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI()))
|
||||
{
|
||||
escortAI->Start(true, false, player->GetGUID());
|
||||
@@ -589,19 +589,19 @@ enum DemonPortal
|
||||
|
||||
class go_demon_portal : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_demon_portal() : GameObjectScript("go_demon_portal") { }
|
||||
public:
|
||||
go_demon_portal() : GameObjectScript("go_demon_portal") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_PORTAL_OF_THE_LEGION) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_GUARDIAN, 5.0f, true))
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_PORTAL_OF_THE_LEGION) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_GUARDIAN, 5.0f, true))
|
||||
{
|
||||
if (Creature* guardian = player->SummonCreature(NPC_DEMON_GUARDIAN, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
|
||||
guardian->AI()->AttackStart(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
if (Creature* guardian = player->SummonCreature(NPC_DEMON_GUARDIAN, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
|
||||
guardian->AI()->AttackStart(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_desolace()
|
||||
|
||||
@@ -80,362 +80,364 @@ enum Points
|
||||
|
||||
class npc_tiger_matriarch_credit : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { }
|
||||
public:
|
||||
npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { }
|
||||
|
||||
struct npc_tiger_matriarch_creditAI : public ScriptedAI
|
||||
struct npc_tiger_matriarch_creditAI : public ScriptedAI
|
||||
{
|
||||
npc_tiger_matriarch_creditAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_tiger_matriarch_creditAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA)
|
||||
{
|
||||
std::list<Creature*> tigers;
|
||||
GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f);
|
||||
if (!tigers.empty())
|
||||
{
|
||||
for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
|
||||
{
|
||||
if (!(*itr)->IsSummon())
|
||||
continue;
|
||||
|
||||
if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner())
|
||||
if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
|
||||
&& !summoner->IsInCombat())
|
||||
{
|
||||
me->AddAura(SPELL_NO_SUMMON_AURA, summoner);
|
||||
me->AddAura(SPELL_DETECT_INVIS, summoner);
|
||||
summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true);
|
||||
Talk(SAY_MATRIARCH_AGGRO, summoner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_tiger_matriarch_creditAI(creature);
|
||||
SetCombatMovement(false);
|
||||
events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA)
|
||||
{
|
||||
std::list<Creature*> tigers;
|
||||
GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f);
|
||||
if (!tigers.empty())
|
||||
{
|
||||
for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
|
||||
{
|
||||
if (!(*itr)->IsSummon())
|
||||
continue;
|
||||
|
||||
if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner())
|
||||
if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
|
||||
&& !summoner->IsInCombat())
|
||||
{
|
||||
me->AddAura(SPELL_NO_SUMMON_AURA, summoner);
|
||||
me->AddAura(SPELL_DETECT_INVIS, summoner);
|
||||
summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true);
|
||||
Talk(SAY_MATRIARCH_AGGRO, summoner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_tiger_matriarch_creditAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_tiger_matriarch : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") { }
|
||||
public:
|
||||
npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") { }
|
||||
|
||||
struct npc_tiger_matriarchAI : public ScriptedAI
|
||||
struct npc_tiger_matriarchAI : public ScriptedAI
|
||||
{
|
||||
npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature),
|
||||
_tigerGuid(0)
|
||||
{
|
||||
npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature),
|
||||
_tigerGuid(0)
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*target*/)
|
||||
{
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_POUNCE, 100);
|
||||
_events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner)
|
||||
{
|
||||
if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle())
|
||||
return;
|
||||
|
||||
_tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID();
|
||||
if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
|
||||
{
|
||||
me->AddThreat(tiger, 500000.0f);
|
||||
DoCast(me, SPELL_FURIOUS_BITE);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*target*/)
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() != TYPEID_UNIT || !victim->IsSummon())
|
||||
return;
|
||||
|
||||
if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner())
|
||||
{
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_POUNCE, 100);
|
||||
_events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
|
||||
}
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner)
|
||||
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!attacker || !attacker->IsSummon())
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(20))
|
||||
{
|
||||
if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle())
|
||||
return;
|
||||
|
||||
_tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID();
|
||||
if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
|
||||
{
|
||||
me->AddThreat(tiger, 500000.0f);
|
||||
DoCast(me, SPELL_FURIOUS_BITE);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() != TYPEID_UNIT || !victim->IsSummon())
|
||||
return;
|
||||
|
||||
if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner())
|
||||
damage = 0;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner())
|
||||
{
|
||||
vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner);
|
||||
vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true);
|
||||
attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!attacker || !attacker->IsSummon())
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(20))
|
||||
{
|
||||
damage = 0;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner())
|
||||
{
|
||||
vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner);
|
||||
vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true);
|
||||
attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!_tigerGuid)
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_POUNCE:
|
||||
DoCastVictim(SPELL_POUNCE);
|
||||
_events.ScheduleEvent(EVENT_POUNCE, 30000);
|
||||
break;
|
||||
case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA
|
||||
if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
|
||||
{
|
||||
if (tiger->IsSummon())
|
||||
if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner())
|
||||
me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
uint64 _tigerGuid;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_tiger_matriarchAI(creature);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!_tigerGuid)
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_POUNCE:
|
||||
DoCastVictim(SPELL_POUNCE);
|
||||
_events.ScheduleEvent(EVENT_POUNCE, 30000);
|
||||
break;
|
||||
case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA
|
||||
if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
|
||||
{
|
||||
if (tiger->IsSummon())
|
||||
if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner())
|
||||
me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
uint64 _tigerGuid;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_tiger_matriarchAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// These models was found in sniff.
|
||||
/// @todo generalize these models with race from dbc
|
||||
uint32 const trollmodel[] =
|
||||
{11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701,
|
||||
15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357,
|
||||
4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768};
|
||||
{
|
||||
11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701,
|
||||
15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357,
|
||||
4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768
|
||||
};
|
||||
|
||||
class npc_troll_volunteer : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { }
|
||||
public:
|
||||
npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { }
|
||||
|
||||
struct npc_troll_volunteerAI : public ScriptedAI
|
||||
struct npc_troll_volunteerAI : public ScriptedAI
|
||||
{
|
||||
npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (me->isDead() || !me->GetOwner())
|
||||
return;
|
||||
|
||||
Reset();
|
||||
|
||||
switch (urand(0, 3))
|
||||
{
|
||||
case 0:
|
||||
_mountModel = 6471;
|
||||
break;
|
||||
case 1:
|
||||
_mountModel = 6473;
|
||||
break;
|
||||
case 2:
|
||||
_mountModel = 6469;
|
||||
break;
|
||||
default:
|
||||
_mountModel = 6472;
|
||||
break;
|
||||
}
|
||||
me->SetDisplayId(trollmodel[urand(0, 39)]);
|
||||
if (Player* player = me->GetOwner()->ToPlayer())
|
||||
me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_complete = false;
|
||||
me->AddAura(SPELL_VOLUNTEER_AURA, me);
|
||||
me->AddAura(SPELL_MOUNTING_CHECK, me);
|
||||
DoCast(me, SPELL_PETACT_AURA);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
Talk(SAY_VOLUNTEER_START);
|
||||
}
|
||||
|
||||
// This is needed for mount check aura to know what mountmodel the npc got stored
|
||||
uint32 GetMountId()
|
||||
{
|
||||
return _mountModel;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
if (id == POINT_URUZIN)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete)
|
||||
{
|
||||
_complete = true; // Preventing from giving credit twice
|
||||
DoCast(me, SPELL_TURNIN);
|
||||
DoCast(me, SPELL_QUEST_CREDIT);
|
||||
me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK);
|
||||
me->Dismount();
|
||||
Talk(SAY_VOLUNTEER_END);
|
||||
me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _mountModel;
|
||||
bool _complete;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_troll_volunteerAI(creature);
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (me->isDead() || !me->GetOwner())
|
||||
return;
|
||||
|
||||
Reset();
|
||||
|
||||
switch (urand(0, 3))
|
||||
{
|
||||
case 0:
|
||||
_mountModel = 6471;
|
||||
break;
|
||||
case 1:
|
||||
_mountModel = 6473;
|
||||
break;
|
||||
case 2:
|
||||
_mountModel = 6469;
|
||||
break;
|
||||
default:
|
||||
_mountModel = 6472;
|
||||
break;
|
||||
}
|
||||
me->SetDisplayId(trollmodel[urand(0, 39)]);
|
||||
if (Player* player = me->GetOwner()->ToPlayer())
|
||||
me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_complete = false;
|
||||
me->AddAura(SPELL_VOLUNTEER_AURA, me);
|
||||
me->AddAura(SPELL_MOUNTING_CHECK, me);
|
||||
DoCast(me, SPELL_PETACT_AURA);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
Talk(SAY_VOLUNTEER_START);
|
||||
}
|
||||
|
||||
// This is needed for mount check aura to know what mountmodel the npc got stored
|
||||
uint32 GetMountId()
|
||||
{
|
||||
return _mountModel;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
if (id == POINT_URUZIN)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete)
|
||||
{
|
||||
_complete = true; // Preventing from giving credit twice
|
||||
DoCast(me, SPELL_TURNIN);
|
||||
DoCast(me, SPELL_QUEST_CREDIT);
|
||||
me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK);
|
||||
me->Dismount();
|
||||
Talk(SAY_VOLUNTEER_END);
|
||||
me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _mountModel;
|
||||
bool _complete;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_troll_volunteerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI;
|
||||
|
||||
class spell_mount_check : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mount_check() : SpellScriptLoader("spell_mount_check") { }
|
||||
public:
|
||||
spell_mount_check() : SpellScriptLoader("spell_mount_check") { }
|
||||
|
||||
class spell_mount_check_AuraScript : public AuraScript
|
||||
class spell_mount_check_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mount_check_AuraScript)
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareAuraScript(spell_mount_check_AuraScript)
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
Unit* owner = target->GetOwner();
|
||||
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
if (owner->IsMounted() && !target->IsMounted())
|
||||
{
|
||||
if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI()))
|
||||
target->Mount(volunteerAI->GetMountId());
|
||||
}
|
||||
else if (!owner->IsMounted() && target->IsMounted())
|
||||
target->Dismount();
|
||||
|
||||
target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
|
||||
target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mount_check_AuraScript();
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
Unit* owner = target->GetOwner();
|
||||
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
if (owner->IsMounted() && !target->IsMounted())
|
||||
{
|
||||
if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI()))
|
||||
target->Mount(volunteerAI->GetMountId());
|
||||
}
|
||||
else if (!owner->IsMounted() && target->IsMounted())
|
||||
target->Dismount();
|
||||
|
||||
target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
|
||||
target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mount_check_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_voljin_war_drums : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") { }
|
||||
public:
|
||||
spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") { }
|
||||
|
||||
class spell_voljin_war_drums_SpellScript : public SpellScript
|
||||
class spell_voljin_war_drums_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_voljin_war_drums_SpellScript)
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareSpellScript(spell_voljin_war_drums_SpellScript)
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
uint32 motivate = 0;
|
||||
if (target->GetEntry() == NPC_CITIZEN_1)
|
||||
motivate = SPELL_MOTIVATE_1;
|
||||
else if (target->GetEntry() == NPC_CITIZEN_2)
|
||||
motivate = SPELL_MOTIVATE_2;
|
||||
if (motivate)
|
||||
caster->CastSpell(target, motivate, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_voljin_war_drums_SpellScript();
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
uint32 motivate = 0;
|
||||
if (target->GetEntry() == NPC_CITIZEN_1)
|
||||
motivate = SPELL_MOTIVATE_1;
|
||||
else if (target->GetEntry() == NPC_CITIZEN_2)
|
||||
motivate = SPELL_MOTIVATE_2;
|
||||
if (motivate)
|
||||
caster->CastSpell(target, motivate, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_voljin_war_drums_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum VoodooSpells
|
||||
@@ -452,40 +454,40 @@ enum VoodooSpells
|
||||
// 17009
|
||||
class spell_voodoo : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_voodoo() : SpellScriptLoader("spell_voodoo") { }
|
||||
public:
|
||||
spell_voodoo() : SpellScriptLoader("spell_voodoo") { }
|
||||
|
||||
class spell_voodoo_SpellScript : public SpellScript
|
||||
class spell_voodoo_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_voodoo_SpellScript)
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareSpellScript(spell_voodoo_SpellScript)
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) ||
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HEX3) || !sSpellMgr->GetSpellInfo(SPELL_GROW) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_LAUNCH))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, spellid, false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_voodoo_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_voodoo_SpellScript();
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, spellid, false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_voodoo_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_voodoo_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_durotar()
|
||||
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
AttackStart(pAttacker);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* pDoneBy, uint32 &Damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit* pDoneBy, uint32& Damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (Damage >= me->GetHealth() || me->HealthBelowPctDamaged(20, Damage))
|
||||
{
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_archmage_tervoshAI(creature);
|
||||
}
|
||||
@@ -311,133 +311,133 @@ enum SpellScripts
|
||||
|
||||
class spell_ooze_zap : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ooze_zap() : SpellScriptLoader("spell_ooze_zap") { }
|
||||
public:
|
||||
spell_ooze_zap() : SpellScriptLoader("spell_ooze_zap") { }
|
||||
|
||||
class spell_ooze_zap_SpellScript : public SpellScript
|
||||
class spell_ooze_zap_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ooze_zap_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareSpellScript(spell_ooze_zap_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue()))
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct
|
||||
|
||||
if (!GetExplTargetUnit())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (GetHitUnit())
|
||||
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnCheckCast += SpellCheckCastFn(spell_ooze_zap_SpellScript::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ooze_zap_SpellScript();
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue()))
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct
|
||||
|
||||
if (!GetExplTargetUnit())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (GetHitUnit())
|
||||
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnCheckCast += SpellCheckCastFn(spell_ooze_zap_SpellScript::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ooze_zap_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ooze_zap_channel_end : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ooze_zap_channel_end() : SpellScriptLoader("spell_ooze_zap_channel_end") { }
|
||||
public:
|
||||
spell_ooze_zap_channel_end() : SpellScriptLoader("spell_ooze_zap_channel_end") { }
|
||||
|
||||
class spell_ooze_zap_channel_end_SpellScript : public SpellScript
|
||||
class spell_ooze_zap_channel_end_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ooze_zap_channel_end_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareSpellScript(spell_ooze_zap_channel_end_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP_CHANNEL_END))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Player* player = GetCaster()->ToPlayer())
|
||||
player->CastSpell(player, SPELL_OOZE_CHANNEL_CREDIT, true);
|
||||
Unit::Kill(GetHitUnit(), GetHitUnit());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_channel_end_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ooze_zap_channel_end_SpellScript();
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP_CHANNEL_END))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Player* player = GetCaster()->ToPlayer())
|
||||
player->CastSpell(player, SPELL_OOZE_CHANNEL_CREDIT, true);
|
||||
Unit::Kill(GetHitUnit(), GetHitUnit());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_channel_end_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ooze_zap_channel_end_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_energize_aoe : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_energize_aoe() : SpellScriptLoader("spell_energize_aoe") { }
|
||||
public:
|
||||
spell_energize_aoe() : SpellScriptLoader("spell_energize_aoe") { }
|
||||
|
||||
class spell_energize_aoe_SpellScript : public SpellScript
|
||||
class spell_energize_aoe_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_energize_aoe_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareSpellScript(spell_energize_aoe_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ENERGIZED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
|
||||
{
|
||||
if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE)
|
||||
++itr;
|
||||
else
|
||||
targets.erase(itr++);
|
||||
}
|
||||
targets.push_back(GetCaster());
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_energize_aoe_SpellScript();
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ENERGIZED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
|
||||
{
|
||||
if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE)
|
||||
++itr;
|
||||
else
|
||||
targets.erase(itr++);
|
||||
}
|
||||
targets.push_back(GetCaster());
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_energize_aoe_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_dustwallow_marsh()
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
creature->CastSpell(player, SPELL_CENARION_BEACON, false);
|
||||
@@ -64,10 +64,11 @@ public:
|
||||
{
|
||||
if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 2848, creature->GetGUID());
|
||||
} else if (player->GetTeamId() == TEAM_HORDE)
|
||||
SendGossipMenuFor(player, 2845, creature->GetGUID());
|
||||
}
|
||||
else if (player->GetTeamId() == TEAM_HORDE)
|
||||
SendGossipMenuFor(player, 2845, creature->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 2844, creature->GetGUID());
|
||||
}
|
||||
@@ -76,10 +77,11 @@ public:
|
||||
{
|
||||
if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 2849, creature->GetGUID());
|
||||
} else if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||
SendGossipMenuFor(player, 2843, creature->GetGUID());
|
||||
}
|
||||
else if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||
SendGossipMenuFor(player, 2843, creature->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 2842, creature->GetGUID());
|
||||
}
|
||||
@@ -103,25 +105,25 @@ enum AncientMisc
|
||||
|
||||
class at_ancient_leaf : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_ancient_leaf() : AreaTriggerScript("at_ancient_leaf") { }
|
||||
public:
|
||||
at_ancient_leaf() : AreaTriggerScript("at_ancient_leaf") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/)
|
||||
{
|
||||
if (player->IsGameMaster() || !player->IsAlive())
|
||||
return false;
|
||||
|
||||
// Handle Call Ancients event start - The area trigger summons 3 ancients
|
||||
if ((player->GetQuestStatus(QUEST_ANCIENT_LEAF) == QUEST_STATUS_COMPLETE) || (player->GetQuestStatus(QUEST_ANCIENT_LEAF) == QUEST_STATUS_REWARDED))
|
||||
{
|
||||
// If ancients are already spawned, skip the rest
|
||||
if (GetClosestCreatureWithEntry(player, NPC_VARTRUS, 50.0f) || GetClosestCreatureWithEntry(player, NPC_STOMA, 50.0f) || GetClosestCreatureWithEntry(player, NPC_HASTAT, 50.0f))
|
||||
return true;
|
||||
|
||||
player->GetMap()->SummonCreatureGroup(CREATURE_GROUP_ANCIENTS);
|
||||
}
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/)
|
||||
{
|
||||
if (player->IsGameMaster() || !player->IsAlive())
|
||||
return false;
|
||||
|
||||
// Handle Call Ancients event start - The area trigger summons 3 ancients
|
||||
if ((player->GetQuestStatus(QUEST_ANCIENT_LEAF) == QUEST_STATUS_COMPLETE) || (player->GetQuestStatus(QUEST_ANCIENT_LEAF) == QUEST_STATUS_REWARDED))
|
||||
{
|
||||
// If ancients are already spawned, skip the rest
|
||||
if (GetClosestCreatureWithEntry(player, NPC_VARTRUS, 50.0f) || GetClosestCreatureWithEntry(player, NPC_STOMA, 50.0f) || GetClosestCreatureWithEntry(player, NPC_HASTAT, 50.0f))
|
||||
return true;
|
||||
|
||||
player->GetMap()->SummonCreatureGroup(CREATURE_GROUP_ANCIENTS);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_felwood()
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
SendGossipMenuFor(player, 2434, creature->GetGUID());
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (creature->IsVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, 2433, creature->GetGUID());
|
||||
return true;
|
||||
@@ -178,33 +178,33 @@ enum GordunniTrap
|
||||
|
||||
class spell_gordunni_trap : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { }
|
||||
public:
|
||||
spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { }
|
||||
|
||||
class spell_gordunni_trap_SpellScript : public SpellScript
|
||||
class spell_gordunni_trap_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gordunni_trap_SpellScript);
|
||||
|
||||
void HandleDummy()
|
||||
{
|
||||
PrepareSpellScript(spell_gordunni_trap_SpellScript);
|
||||
|
||||
void HandleDummy()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
|
||||
{
|
||||
chest->SetSpellId(GetSpellInfo()->Id);
|
||||
caster->RemoveGameObject(chest, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gordunni_trap_SpellScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
|
||||
{
|
||||
chest->SetSpellId(GetSpellInfo()->Id);
|
||||
caster->RemoveGameObject(chest, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gordunni_trap_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
|
||||
float const Clintar_spirit_WP[41][5] =
|
||||
{
|
||||
//pos_x pos_y pos_z orien waitTime
|
||||
//pos_x pos_y pos_z orien waitTime
|
||||
{7465.28f, -3115.46f, 439.327f, 0.83f, 4000},
|
||||
{7476.49f, -3101, 443.457f, 0.89f, 0},
|
||||
{7486.57f, -3085.59f, 439.478f, 1.07f, 0},
|
||||
@@ -390,7 +390,8 @@ public:
|
||||
if (player && player->IsInCombat() && player->getAttackerForHelper())
|
||||
AttackStart(player->getAttackerForHelper());
|
||||
checkPlayerTimer = 1000;
|
||||
} else checkPlayerTimer -= diff;
|
||||
}
|
||||
else checkPlayerTimer -= diff;
|
||||
}
|
||||
|
||||
if (EventOnWait && EventTimer <= diff)
|
||||
@@ -531,7 +532,8 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (EventOnWait) EventTimer -= diff;
|
||||
}
|
||||
else if (EventOnWait) EventTimer -= diff;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
@@ -662,7 +664,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_DESPAWN, 5*MINUTE*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_DESPAWN, 5 * MINUTE * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
|
||||
@@ -83,7 +83,8 @@ public:
|
||||
player->FailQuest(QUEST_SHATTERED_SALUTE);
|
||||
}
|
||||
Reset();
|
||||
} else ResetTimer -= diff;
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
}
|
||||
|
||||
if (CanTalk && !CanEmote)
|
||||
@@ -93,7 +94,8 @@ public:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
CanEmote = true;
|
||||
ResetTimer = 60000;
|
||||
} else SaluteTimer -= diff;
|
||||
}
|
||||
else SaluteTimer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -149,27 +151,27 @@ public:
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 5733, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, 5734, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
SendGossipMenuFor(player, 5735, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
SendGossipMenuFor(player, 5736, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
SendGossipMenuFor(player, 5737, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+6:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
||||
SendGossipMenuFor(player, 5738, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+7:
|
||||
@@ -186,7 +188,7 @@ public:
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
@@ -221,13 +223,15 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_CHAIN_LIGHTNING);
|
||||
ChainLightningTimer = 9000;
|
||||
} else ChainLightningTimer -= diff;
|
||||
}
|
||||
else ChainLightningTimer -= diff;
|
||||
|
||||
if (ShockTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHOCK);
|
||||
ShockTimer = 15000;
|
||||
} else ShockTimer -= diff;
|
||||
}
|
||||
else ShockTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||
SendGossipMenuFor(player, 7761, creature->GetGUID());
|
||||
//'kill' our trigger to update quest status
|
||||
//'kill' our trigger to update quest status
|
||||
player->KilledMonsterCredit(TRIGGER_RUTGAR, 0);
|
||||
break;
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||
SendGossipMenuFor(player, 7767, creature->GetGUID());
|
||||
//'kill' our trigger to update quest status
|
||||
//'kill' our trigger to update quest status
|
||||
player->KilledMonsterCredit(TRIGGER_FRANKAL, 0);
|
||||
break;
|
||||
}
|
||||
@@ -127,14 +127,14 @@ public:
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
|
||||
creature->GetEntry() == 15170 &&
|
||||
!player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR))
|
||||
creature->GetEntry() == 15170 &&
|
||||
!player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
|
||||
creature->GetEntry() == 15171 &&
|
||||
player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
|
||||
creature->GetEntry() == 15171 &&
|
||||
player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
|
||||
|
||||
SendGossipMenuFor(player, 7754, creature->GetGUID());
|
||||
|
||||
@@ -223,7 +223,7 @@ struct QuestCinematic
|
||||
};
|
||||
|
||||
// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz
|
||||
static QuestCinematic EventAnim[]=
|
||||
static QuestCinematic EventAnim[] =
|
||||
{
|
||||
{ANACHRONOS_SAY_1, 0, 2000},
|
||||
{FANDRAL_SAY_1, 1, 4000},
|
||||
@@ -636,20 +636,20 @@ public:
|
||||
Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true);
|
||||
break;
|
||||
case 51:
|
||||
{
|
||||
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
|
||||
Unit* mob = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
mob = player->FindNearestCreature(entries[i], 50, me);
|
||||
while (mob)
|
||||
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
|
||||
Unit* mob = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
mob->RemoveFromWorld();
|
||||
mob = player->FindNearestCreature(15423, 50, me);
|
||||
mob = player->FindNearestCreature(entries[i], 50, me);
|
||||
while (mob)
|
||||
{
|
||||
mob->RemoveFromWorld();
|
||||
mob = player->FindNearestCreature(15423, 50, me);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 52:
|
||||
Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4);
|
||||
Fandral->AI()->Talk(ANACHRONOS_SAY_9, me);
|
||||
@@ -702,7 +702,7 @@ public:
|
||||
{
|
||||
Talk(ARYGOS_YELL_1);
|
||||
AnachronosQuestTrigger->AI()->EnterEvadeMode();
|
||||
eventEnd=true;
|
||||
eventEnd = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -775,24 +775,27 @@ public:
|
||||
SpellTimer4 = SpawnCast[0].Timer1;
|
||||
Timers = true;
|
||||
}
|
||||
if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414)
|
||||
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
|
||||
{
|
||||
if (SpellTimer1 <= diff)
|
||||
{
|
||||
DoCast(me, SpawnCast[1].SpellId);
|
||||
DoCast(me, 24319);
|
||||
SpellTimer1 = SpawnCast[1].Timer2;
|
||||
} else SpellTimer1 -= diff;
|
||||
}
|
||||
else SpellTimer1 -= diff;
|
||||
if (SpellTimer2 <= diff)
|
||||
{
|
||||
DoCast(me, SpawnCast[2].SpellId);
|
||||
SpellTimer2 = SpawnCast[2].Timer2;
|
||||
} else SpellTimer2 -= diff;
|
||||
}
|
||||
else SpellTimer2 -= diff;
|
||||
if (SpellTimer3 <= diff)
|
||||
{
|
||||
DoCast(me, SpawnCast[3].SpellId);
|
||||
SpellTimer3 = SpawnCast[3].Timer2;
|
||||
} else SpellTimer3 -= diff;
|
||||
}
|
||||
else SpellTimer3 -= diff;
|
||||
}
|
||||
if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
|
||||
{
|
||||
@@ -802,7 +805,8 @@ public:
|
||||
me->AttackStop();
|
||||
DoCast(me, 15533);
|
||||
SpellTimer4 = SpawnCast[0].Timer2;
|
||||
} else SpellTimer4 -= diff;
|
||||
}
|
||||
else SpellTimer4 -= diff;
|
||||
}
|
||||
if (!hasTarget)
|
||||
{
|
||||
@@ -897,7 +901,7 @@ public:
|
||||
if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer))
|
||||
{
|
||||
if (spawn->GetEntry() == 15423)
|
||||
spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4);
|
||||
spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427 + rand() % 4);
|
||||
if (i >= 30) WaveCount = 1;
|
||||
if (i >= 33) WaveCount = 2;
|
||||
if (i >= 45) WaveCount = 3;
|
||||
@@ -934,14 +938,14 @@ public:
|
||||
|
||||
Group::MemberSlotList const& members = EventGroup->GetMemberSlots();
|
||||
|
||||
for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
|
||||
for (Group::member_citerator itr = members.begin(); itr != members.end(); ++itr)
|
||||
{
|
||||
groupMember = ObjectAccessor::GetPlayer(*me, itr->guid);
|
||||
if (!groupMember)
|
||||
continue;
|
||||
if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD);
|
||||
groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD);
|
||||
++FailedMemberCount;
|
||||
}
|
||||
++GroupMemberCount;
|
||||
@@ -973,7 +977,8 @@ public:
|
||||
{
|
||||
Talk(WavesInfo[WaveCount].WaveTextId);
|
||||
Announced = true;
|
||||
} else AnnounceTimer -= diff;
|
||||
}
|
||||
else AnnounceTimer -= diff;
|
||||
|
||||
if (WaveTimer <= diff)
|
||||
SummonNextWave();
|
||||
@@ -1179,33 +1184,33 @@ enum WSTexts
|
||||
|
||||
class go_wind_stone : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_wind_stone() : GameObjectScript("go_wind_stone") { }
|
||||
public:
|
||||
go_wind_stone() : GameObjectScript("go_wind_stone") { }
|
||||
|
||||
private:
|
||||
uint8 GetPlayerRank(Player* player) // For random summoning
|
||||
private:
|
||||
uint8 GetPlayerRank(Player* player) // For random summoning
|
||||
{
|
||||
bool setAura = player->HasAura(AURA_TWILIGHT_SET, player->GetGUID());
|
||||
bool medallionAura = player->HasAura(AURA_MEDALLION, player->GetGUID());
|
||||
bool ringAura = player->HasAura(AURA_RING, player->GetGUID());
|
||||
|
||||
if (setAura && medallionAura && ringAura)
|
||||
return 3;
|
||||
else if (setAura && medallionAura)
|
||||
return 2;
|
||||
else if (setAura)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 GetItems(Player* player, WS type)
|
||||
{
|
||||
uint8 result = 0x0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
bool setAura = player->HasAura(AURA_TWILIGHT_SET, player->GetGUID());
|
||||
bool medallionAura = player->HasAura(AURA_MEDALLION, player->GetGUID());
|
||||
bool ringAura = player->HasAura(AURA_RING, player->GetGUID());
|
||||
|
||||
if (setAura && medallionAura && ringAura)
|
||||
return 3;
|
||||
else if (setAura && medallionAura)
|
||||
return 2;
|
||||
else if (setAura)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 GetItems(Player* player, WS type)
|
||||
{
|
||||
uint8 result = 0x0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TEMPLAR:
|
||||
case TEMPLAR:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_FIRE))
|
||||
result |= FIRE;
|
||||
@@ -1217,7 +1222,7 @@ class go_wind_stone : public GameObjectScript
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
case DUKE:
|
||||
case DUKE:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_DUKE_FIRE))
|
||||
result |= FIRE;
|
||||
@@ -1229,7 +1234,7 @@ class go_wind_stone : public GameObjectScript
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
case ROYAL:
|
||||
case ROYAL:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_ROYAL_FIRE))
|
||||
result |= FIRE;
|
||||
@@ -1241,72 +1246,72 @@ class go_wind_stone : public GameObjectScript
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spellId)
|
||||
void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spellId)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return;
|
||||
SpellInfo const* spellInfoTrigger = sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell);
|
||||
if (!spellInfoTrigger)
|
||||
return;
|
||||
Spell* spell = new Spell(player, spellInfoTrigger, TRIGGERED_NONE);
|
||||
SpellCastResult result = spell->CheckCast(true);
|
||||
delete spell;
|
||||
if (result != SPELL_CAST_OK)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return;
|
||||
SpellInfo const* spellInfoTrigger = sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell);
|
||||
if (!spellInfoTrigger)
|
||||
return;
|
||||
Spell* spell = new Spell(player, spellInfoTrigger, TRIGGERED_NONE);
|
||||
SpellCastResult result = spell->CheckCast(true);
|
||||
delete spell;
|
||||
if (result != SPELL_CAST_OK)
|
||||
if (result == SPELL_FAILED_REAGENTS)
|
||||
{
|
||||
if (result == SPELL_FAILED_REAGENTS)
|
||||
{
|
||||
std::string accountName;
|
||||
AccountMgr::GetName(player->GetSession()->GetAccountId(), accountName);
|
||||
sBan->BanAccount(accountName, "0s", "Wind Stone exploit", "Server");
|
||||
}
|
||||
return;
|
||||
std::string accountName;
|
||||
AccountMgr::GetName(player->GetSession()->GetAccountId(), accountName);
|
||||
sBan->BanAccount(accountName, "0s", "Wind Stone exploit", "Server");
|
||||
}
|
||||
player->CastSpell(player, spellInfoTrigger->Id, false);
|
||||
TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
switch (summons->GetEntry())
|
||||
{
|
||||
case NPC_TEMPLAR_FIRE:
|
||||
case NPC_TEMPLAR_WATER:
|
||||
case NPC_TEMPLAR_AIR:
|
||||
case NPC_TEMPLAR_EARTH:
|
||||
summons->AI()->Talk(SAY_TEMPLAR_AGGRO);
|
||||
break;
|
||||
|
||||
case NPC_DUKE_FIRE:
|
||||
case NPC_DUKE_WATER:
|
||||
case NPC_DUKE_EARTH:
|
||||
case NPC_DUKE_AIR:
|
||||
summons->AI()->Talk(SAY_DUKE_AGGRO);
|
||||
break;
|
||||
case NPC_ROYAL_FIRE:
|
||||
case NPC_ROYAL_AIR:
|
||||
case NPC_ROYAL_EARTH:
|
||||
case NPC_ROYAL_WATER:
|
||||
summons->AI()->Talk(YELL_ROYAL_AGGRO);
|
||||
break;
|
||||
}
|
||||
summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summons->SendMeleeAttackStart(player);
|
||||
summons->CombatStart(player);
|
||||
return;
|
||||
}
|
||||
|
||||
public:
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
player->CastSpell(player, spellInfoTrigger->Id, false);
|
||||
TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
switch (summons->GetEntry())
|
||||
{
|
||||
uint8 rank = GetPlayerRank(player);
|
||||
case NPC_TEMPLAR_FIRE:
|
||||
case NPC_TEMPLAR_WATER:
|
||||
case NPC_TEMPLAR_AIR:
|
||||
case NPC_TEMPLAR_EARTH:
|
||||
summons->AI()->Talk(SAY_TEMPLAR_AGGRO);
|
||||
break;
|
||||
|
||||
uint32 gossipId = go->GetGOInfo()->GetGossipMenuId();
|
||||
switch (gossipId)
|
||||
{
|
||||
case GOSSIPID_LESSER_WS:
|
||||
case NPC_DUKE_FIRE:
|
||||
case NPC_DUKE_WATER:
|
||||
case NPC_DUKE_EARTH:
|
||||
case NPC_DUKE_AIR:
|
||||
summons->AI()->Talk(SAY_DUKE_AGGRO);
|
||||
break;
|
||||
case NPC_ROYAL_FIRE:
|
||||
case NPC_ROYAL_AIR:
|
||||
case NPC_ROYAL_EARTH:
|
||||
case NPC_ROYAL_WATER:
|
||||
summons->AI()->Talk(YELL_ROYAL_AGGRO);
|
||||
break;
|
||||
}
|
||||
summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summons->SendMeleeAttackStart(player);
|
||||
summons->CombatStart(player);
|
||||
}
|
||||
|
||||
public:
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
uint8 rank = GetPlayerRank(player);
|
||||
|
||||
uint32 gossipId = go->GetGOInfo()->GetGossipMenuId();
|
||||
switch (gossipId)
|
||||
{
|
||||
case GOSSIPID_LESSER_WS:
|
||||
{
|
||||
if (rank >= 1) // 1 or 2 or 3
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
@@ -1327,7 +1332,7 @@ class go_wind_stone : public GameObjectScript
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
break;
|
||||
}
|
||||
case GOSSIPID_WS:
|
||||
case GOSSIPID_WS:
|
||||
{
|
||||
if (rank >= 2) // 2 or 3
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_DUKE_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
@@ -1348,7 +1353,7 @@ class go_wind_stone : public GameObjectScript
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_DUKE_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
|
||||
break;
|
||||
}
|
||||
case GOSSIPID_GREATER_WS:
|
||||
case GOSSIPID_GREATER_WS:
|
||||
{
|
||||
if (rank == 3) // 3
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ROYAL_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
@@ -1369,74 +1374,74 @@ class go_wind_stone : public GameObjectScript
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ROYAL_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(gossipId, go), go->GetGUID());
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) override
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(gossipId, go), go->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
switch (action)
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
SummonNPC(go, player, RAND(NPC_TEMPLAR_WATER, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_AIR), SPELL_TEMPLAR_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_FIRE, SPELL_TEMPLAR_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_WATER, SPELL_TEMPLAR_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_EARTH, SPELL_TEMPLAR_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_AIR, SPELL_TEMPLAR_AIR);
|
||||
break;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
SummonNPC(go, player, RAND(NPC_TEMPLAR_WATER, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_AIR), SPELL_TEMPLAR_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_FIRE, SPELL_TEMPLAR_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_WATER, SPELL_TEMPLAR_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_EARTH, SPELL_TEMPLAR_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_AIR, SPELL_TEMPLAR_AIR);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||
SummonNPC(go, player, RAND(NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_DUKE_EARTH, NPC_DUKE_AIR), SPELL_DUKE_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 7:
|
||||
SummonNPC(go, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 8:
|
||||
SummonNPC(go, player, NPC_DUKE_WATER, SPELL_DUKE_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
||||
SummonNPC(go, player, NPC_DUKE_EARTH, SPELL_DUKE_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 10:
|
||||
SummonNPC(go, player, NPC_DUKE_AIR, SPELL_DUKE_AIR);
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||
SummonNPC(go, player, RAND(NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_DUKE_EARTH, NPC_DUKE_AIR), SPELL_DUKE_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 7:
|
||||
SummonNPC(go, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 8:
|
||||
SummonNPC(go, player, NPC_DUKE_WATER, SPELL_DUKE_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
||||
SummonNPC(go, player, NPC_DUKE_EARTH, SPELL_DUKE_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 10:
|
||||
SummonNPC(go, player, NPC_DUKE_AIR, SPELL_DUKE_AIR);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 11:
|
||||
SummonNPC(go, player, RAND(NPC_ROYAL_FIRE, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_WATER), SPELL_ROYAL_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 12:
|
||||
SummonNPC(go, player, NPC_ROYAL_FIRE, SPELL_ROYAL_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 13:
|
||||
SummonNPC(go, player, NPC_ROYAL_WATER, SPELL_ROYAL_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||
SummonNPC(go, player, NPC_ROYAL_EARTH, SPELL_ROYAL_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 15:
|
||||
SummonNPC(go, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR);
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 11:
|
||||
SummonNPC(go, player, RAND(NPC_ROYAL_FIRE, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_WATER), SPELL_ROYAL_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 12:
|
||||
SummonNPC(go, player, NPC_ROYAL_FIRE, SPELL_ROYAL_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 13:
|
||||
SummonNPC(go, player, NPC_ROYAL_WATER, SPELL_ROYAL_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||
SummonNPC(go, player, NPC_ROYAL_EARTH, SPELL_ROYAL_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 15:
|
||||
SummonNPC(go, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_silithus()
|
||||
|
||||
@@ -40,13 +40,13 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
creature->CastSpell(player, 6766, false);
|
||||
|
||||
}
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+2)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 2)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
player->AreaExploredOrEventHappens(6627);
|
||||
@@ -61,11 +61,11 @@ public:
|
||||
|
||||
if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, 5820, creature->GetGUID());
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void Reset(){}
|
||||
void Reset() {}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
|
||||
@@ -77,9 +77,9 @@ public:
|
||||
Player* player = receiver->ToPlayer();
|
||||
|
||||
if (player && player->HasItemCount(11169, 1, false) &&
|
||||
player->HasItemCount(11172, 11, false) &&
|
||||
player->HasItemCount(11173, 1, false) &&
|
||||
!player->HasItemCount(11522, 1, true))
|
||||
player->HasItemCount(11172, 11, false) &&
|
||||
player->HasItemCount(11173, 1, false) &&
|
||||
!player->HasItemCount(11522, 1, true))
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, nullptr);
|
||||
@@ -101,7 +101,8 @@ public:
|
||||
{
|
||||
me->setFaction(91);
|
||||
isFriendly = false;
|
||||
} else SwitchFactionTimer -= diff;
|
||||
}
|
||||
else SwitchFactionTimer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -114,20 +115,23 @@ public:
|
||||
if (me->GetVictim()->GetTypeId() == TYPEID_PLAYER)
|
||||
SendItem(me->GetVictim());
|
||||
SendItemTimer = 5000;
|
||||
} else SendItemTimer -= diff;
|
||||
}
|
||||
else SendItemTimer -= diff;
|
||||
}
|
||||
|
||||
if (FrostShockTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROST_SHOCK);
|
||||
FrostShockTimer = 15000;
|
||||
} else FrostShockTimer -= diff;
|
||||
}
|
||||
else FrostShockTimer -= diff;
|
||||
|
||||
if (AquaJetTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_AQUA_JET);
|
||||
AquaJetTimer = 15000;
|
||||
} else AquaJetTimer -= diff;
|
||||
}
|
||||
else AquaJetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -336,23 +340,23 @@ public:
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 1675, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 1676, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, 1677, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
SendGossipMenuFor(player, 1678, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
SendGossipMenuFor(player, 1679, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF +1)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
SendGossipMenuFor(player, 3558, creature->GetGUID());
|
||||
player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, 3557, creature->GetGUID());
|
||||
return true;
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
//not always use
|
||||
if (rand()%4)
|
||||
if (rand() % 4)
|
||||
return;
|
||||
|
||||
//only aggro text if not player and only in this area
|
||||
@@ -238,7 +238,8 @@ public:
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
} else ResetTimer -= diff;
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -427,7 +428,8 @@ public:
|
||||
}
|
||||
}
|
||||
ChallengerChecker = 1000;
|
||||
} else ChallengerChecker -= diff;
|
||||
}
|
||||
else ChallengerChecker -= diff;
|
||||
|
||||
if (WaveTimer <= diff)
|
||||
{
|
||||
@@ -530,7 +532,7 @@ public:
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
{
|
||||
if (me->getStandState() == UNIT_STAND_STATE_DEAD)
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
IsPostEvent = false;
|
||||
PostEventTimer = 1000;
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
void DoSpawnBandits(int AmbushId)
|
||||
{
|
||||
for (int i = 0; i < 2; ++i)
|
||||
me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
|
||||
me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i + AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
CloseGossipMenuFor(player);
|
||||
player->CompleteQuest(QUEST_SCOOP);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, 738, creature->GetGUID());
|
||||
|
||||
|
||||
@@ -96,31 +96,36 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_BERSERKER_CHARGE);
|
||||
BerserkerChargeTimer = 25000;
|
||||
} else BerserkerChargeTimer -= diff;
|
||||
}
|
||||
else BerserkerChargeTimer -= diff;
|
||||
|
||||
if (UppercutTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_UPPERCUT);
|
||||
UppercutTimer = 20000;
|
||||
} else UppercutTimer -= diff;
|
||||
}
|
||||
else UppercutTimer -= diff;
|
||||
|
||||
if (ThunderclapTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP);
|
||||
ThunderclapTimer = 15000;
|
||||
} else ThunderclapTimer -= diff;
|
||||
}
|
||||
else ThunderclapTimer -= diff;
|
||||
|
||||
if (MortalStrikeTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MORTAL_STRIKE);
|
||||
MortalStrikeTimer = 15000;
|
||||
} else MortalStrikeTimer -= diff;
|
||||
}
|
||||
else MortalStrikeTimer -= diff;
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
CleaveTimer = 7000;
|
||||
} else CleaveTimer -= diff;
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -124,7 +124,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_DEMORALIZINGSHOUT);
|
||||
DemoralizingShoutTimer = 70000;
|
||||
} else DemoralizingShoutTimer -= diff;
|
||||
}
|
||||
else DemoralizingShoutTimer -= diff;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -71,11 +71,21 @@ public:
|
||||
changeEntry = me->GetEntry();
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_SIMONE_NORMAL: changeEntry = NPC_SIMONE_EVIL; break;
|
||||
case NPC_FRANKLIN_NORMAL: changeEntry = NPC_FRANKLIN_EVIL; break;
|
||||
case NPC_ARTORIUS_NORMAL: changeEntry = NPC_ARTORIUS_EVIL; break;
|
||||
case NPC_NELSON_NORMAL: changeEntry = NPC_NELSON_EVIL; break;
|
||||
case NPC_PRECIOUS: changeEntry = NPC_PRECIOUS_EVIL; break;
|
||||
case NPC_SIMONE_NORMAL:
|
||||
changeEntry = NPC_SIMONE_EVIL;
|
||||
break;
|
||||
case NPC_FRANKLIN_NORMAL:
|
||||
changeEntry = NPC_FRANKLIN_EVIL;
|
||||
break;
|
||||
case NPC_ARTORIUS_NORMAL:
|
||||
changeEntry = NPC_ARTORIUS_EVIL;
|
||||
break;
|
||||
case NPC_NELSON_NORMAL:
|
||||
changeEntry = NPC_NELSON_EVIL;
|
||||
break;
|
||||
case NPC_PRECIOUS:
|
||||
changeEntry = NPC_PRECIOUS_EVIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,46 +332,46 @@ class DialogueHelper
|
||||
public:
|
||||
// The array MUST be terminated by {0, 0, 0}
|
||||
DialogueHelper(DialogueEntry const* dialogueArray) :
|
||||
_dialogueArray(dialogueArray),
|
||||
_currentEntry(nullptr),
|
||||
_actionTimer(0)
|
||||
{ }
|
||||
// The array MUST be terminated by {0, 0, 0, 0, 0}
|
||||
_dialogueArray(dialogueArray),
|
||||
_currentEntry(nullptr),
|
||||
_actionTimer(0)
|
||||
{ }
|
||||
// The array MUST be terminated by {0, 0, 0, 0, 0}
|
||||
|
||||
/// Function to initialize the dialogue helper for instances. If not used with instances, GetSpeakerByEntry MUST be overwritten to obtain the speakers
|
||||
/// Set if take first entries or second entries
|
||||
/// Function to initialize the dialogue helper for instances. If not used with instances, GetSpeakerByEntry MUST be overwritten to obtain the speakers
|
||||
/// Set if take first entries or second entries
|
||||
|
||||
void StartNextDialogueText(int32 textEntry)
|
||||
{
|
||||
// Find textEntry
|
||||
bool found = false;
|
||||
void StartNextDialogueText(int32 textEntry)
|
||||
{
|
||||
// Find textEntry
|
||||
bool found = false;
|
||||
|
||||
for (DialogueEntry const* entry = _dialogueArray; entry->TextEntry; ++entry)
|
||||
{
|
||||
if (entry->TextEntry == textEntry)
|
||||
{
|
||||
_currentEntry = entry;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (DialogueEntry const* entry = _dialogueArray; entry->TextEntry; ++entry)
|
||||
{
|
||||
if (entry->TextEntry == textEntry)
|
||||
{
|
||||
_currentEntry = entry;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return;
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
DoNextDialogueStep();
|
||||
}
|
||||
DoNextDialogueStep();
|
||||
}
|
||||
|
||||
void DialogueUpdate(uint32 diff)
|
||||
{
|
||||
if (_actionTimer)
|
||||
{
|
||||
if (_actionTimer <= diff)
|
||||
DoNextDialogueStep();
|
||||
else
|
||||
_actionTimer -= diff;
|
||||
}
|
||||
}
|
||||
void DialogueUpdate(uint32 diff)
|
||||
{
|
||||
if (_actionTimer)
|
||||
{
|
||||
if (_actionTimer <= diff)
|
||||
DoNextDialogueStep();
|
||||
else
|
||||
_actionTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Will be called when a dialogue step was done
|
||||
@@ -579,23 +589,23 @@ public:
|
||||
SetEscortPaused(true);
|
||||
break;
|
||||
case 41:
|
||||
{
|
||||
// Search for all nearest lights and respawn them
|
||||
std::list<GameObject*> eluneLights;
|
||||
GetGameObjectListWithEntryInGrid(eluneLights, me, GO_ELUNE_LIGHT, 20.0f);
|
||||
for (std::list<GameObject*>::const_iterator itr = eluneLights.begin(); itr != eluneLights.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->isSpawned())
|
||||
continue;
|
||||
// Search for all nearest lights and respawn them
|
||||
std::list<GameObject*> eluneLights;
|
||||
GetGameObjectListWithEntryInGrid(eluneLights, me, GO_ELUNE_LIGHT, 20.0f);
|
||||
for (std::list<GameObject*>::const_iterator itr = eluneLights.begin(); itr != eluneLights.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->isSpawned())
|
||||
continue;
|
||||
|
||||
(*itr)->SetRespawnTime(115);
|
||||
(*itr)->Refresh();
|
||||
(*itr)->SetRespawnTime(115);
|
||||
(*itr)->Refresh();
|
||||
}
|
||||
|
||||
if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
|
||||
me->SetFacingToObject(altar);
|
||||
break;
|
||||
}
|
||||
|
||||
if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
|
||||
me->SetFacingToObject(altar);
|
||||
break;
|
||||
}
|
||||
case 42:
|
||||
// Summon the 2 priestess
|
||||
SetEscortPaused(true);
|
||||
|
||||
Reference in New Issue
Block a user