refactor(Core/Scripts): restyle scripts lib with astyle (#3467)
This commit is contained in:
@@ -69,159 +69,159 @@ enum Events
|
||||
|
||||
class boss_akilzon : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_akilzon() : CreatureScript("boss_akilzon") { }
|
||||
public:
|
||||
boss_akilzon() : CreatureScript("boss_akilzon") { }
|
||||
|
||||
struct boss_akilzonAI : public BossAI
|
||||
struct boss_akilzonAI : public BossAI
|
||||
{
|
||||
boss_akilzonAI(Creature* creature) : BossAI(creature, DATA_AKILZONEVENT)
|
||||
{
|
||||
boss_akilzonAI(Creature* creature) : BossAI(creature, DATA_AKILZONEVENT)
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
|
||||
TargetGUID = 0;
|
||||
CloudGUID = 0;
|
||||
CycloneGUID = 0;
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
StormCount = 0;
|
||||
isRaining = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
|
||||
|
||||
SetWeather(WEATHER_STATE_FINE, 0.0f);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 20000)); // 10 to 20 seconds (bosskillers)
|
||||
events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000)); // 20 to 30 seconds(bosskillers)
|
||||
events.ScheduleEvent(EVENT_CALL_LIGHTNING, urand(10000, 20000)); // totaly random timer. can't find any info on this
|
||||
events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 60000); // 60 seconds(bosskillers)
|
||||
events.ScheduleEvent(EVENT_RAIN, urand(47000, 52000));
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 10 * MINUTE * IN_MILLISECONDS); // 10 minutes till enrage(bosskillers)
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
//DoZoneInCombat();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
_JustDied();
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void SetWeather(uint32 weather, float grade)
|
||||
{
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_WEATHER, (4 + 4 + 4));
|
||||
data << uint32(weather) << float(grade) << uint8(0);
|
||||
|
||||
map->SendToPlayers(&data);
|
||||
}
|
||||
|
||||
void HandleStormSequence(Unit* Cloud) // 1: begin, 2-9: tick, 10: end
|
||||
{
|
||||
if (StormCount < 10 && StormCount > 1)
|
||||
{
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
// deal damage
|
||||
int32 bp0 = 800;
|
||||
for (uint8 i = 2; i < StormCount; ++i)
|
||||
bp0 *= 2;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
std::list<Unit*> tempUnitMap;
|
||||
|
||||
{
|
||||
acore::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS);
|
||||
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
|
||||
cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
|
||||
}
|
||||
|
||||
// deal damage
|
||||
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
|
||||
{
|
||||
if (Unit* target = (*i))
|
||||
{
|
||||
if (Cloud && !Cloud->IsWithinDist(target, 6, false))
|
||||
Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
// visual
|
||||
float x, y, z;
|
||||
z = me->GetPositionZ();
|
||||
for (uint8 i = 0; i < 5 + rand() % 5; ++i)
|
||||
{
|
||||
x = 343.0f + rand() % 60;
|
||||
y = 1380.0f + rand() % 60;
|
||||
if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000))
|
||||
{
|
||||
trigger->setFaction(35);
|
||||
trigger->SetMaxHealth(100000);
|
||||
trigger->SetHealth(100000);
|
||||
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (Cloud)
|
||||
Cloud->CastCustomSpell(trigger, /*43661*/SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, Cloud->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
++StormCount;
|
||||
|
||||
TargetGUID = 0;
|
||||
if (StormCount > 10)
|
||||
{
|
||||
StormCount = 0; // finish
|
||||
events.ScheduleEvent(EVENT_SUMMON_EAGLES, 5000);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
CloudGUID = 0;
|
||||
CycloneGUID = 0;
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
StormCount = 0;
|
||||
isRaining = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
|
||||
|
||||
if (Cloud)
|
||||
Unit::DealDamage(Cloud, Cloud, Cloud->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
SetWeather(WEATHER_STATE_FINE, 0.0f);
|
||||
isRaining = false;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_STORM_SEQUENCE, 1000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 20000)); // 10 to 20 seconds (bosskillers)
|
||||
events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000)); // 20 to 30 seconds(bosskillers)
|
||||
events.ScheduleEvent(EVENT_CALL_LIGHTNING, urand(10000, 20000)); // totaly random timer. can't find any info on this
|
||||
events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 60000); // 60 seconds(bosskillers)
|
||||
events.ScheduleEvent(EVENT_RAIN, urand(47000, 52000));
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 10*MINUTE*IN_MILLISECONDS); // 10 minutes till enrage(bosskillers)
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
//DoZoneInCombat();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
_JustDied();
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void SetWeather(uint32 weather, float grade)
|
||||
{
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_WEATHER, (4+4+4));
|
||||
data << uint32(weather) << float(grade) << uint8(0);
|
||||
|
||||
map->SendToPlayers(&data);
|
||||
}
|
||||
|
||||
void HandleStormSequence(Unit* Cloud) // 1: begin, 2-9: tick, 10: end
|
||||
{
|
||||
if (StormCount < 10 && StormCount > 1)
|
||||
switch (eventId)
|
||||
{
|
||||
// deal damage
|
||||
int32 bp0 = 800;
|
||||
for (uint8 i = 2; i < StormCount; ++i)
|
||||
bp0 *= 2;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
std::list<Unit*> tempUnitMap;
|
||||
|
||||
{
|
||||
acore::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS);
|
||||
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
|
||||
cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
|
||||
}
|
||||
|
||||
// deal damage
|
||||
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
|
||||
{
|
||||
if (Unit* target = (*i))
|
||||
case EVENT_STATIC_DISRUPTION:
|
||||
{
|
||||
if (Cloud && !Cloud->IsWithinDist(target, 6, false))
|
||||
Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
// visual
|
||||
float x, y, z;
|
||||
z = me->GetPositionZ();
|
||||
for (uint8 i = 0; i < 5+rand()%5; ++i)
|
||||
{
|
||||
x = 343.0f+rand()%60;
|
||||
y = 1380.0f+rand()%60;
|
||||
if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000))
|
||||
{
|
||||
trigger->setFaction(35);
|
||||
trigger->SetMaxHealth(100000);
|
||||
trigger->SetHealth(100000);
|
||||
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (Cloud)
|
||||
Cloud->CastCustomSpell(trigger, /*43661*/SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, Cloud->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
++StormCount;
|
||||
|
||||
if (StormCount > 10)
|
||||
{
|
||||
StormCount = 0; // finish
|
||||
events.ScheduleEvent(EVENT_SUMMON_EAGLES, 5000);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
CloudGUID = 0;
|
||||
if (Cloud)
|
||||
Unit::DealDamage(Cloud, Cloud, Cloud->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
SetWeather(WEATHER_STATE_FINE, 0.0f);
|
||||
isRaining = false;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_STORM_SEQUENCE, 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_STATIC_DISRUPTION:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target)
|
||||
target = me->GetVictim();
|
||||
@@ -235,218 +235,218 @@ class boss_akilzon : public CreatureScript
|
||||
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
|
||||
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 18000));
|
||||
break;
|
||||
}
|
||||
case EVENT_GUST_OF_WIND:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target)
|
||||
target = me->GetVictim();
|
||||
if (target)
|
||||
DoCast(target, SPELL_GUST_OF_WIND);
|
||||
events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000));
|
||||
break;
|
||||
}
|
||||
case EVENT_CALL_LIGHTNING:
|
||||
DoCastVictim(SPELL_CALL_LIGHTNING);
|
||||
events.ScheduleEvent(EVENT_CALL_LIGHTNING, urand(12000, 17000)); // totaly random timer. can't find any info on this
|
||||
}
|
||||
case EVENT_GUST_OF_WIND:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target)
|
||||
target = me->GetVictim();
|
||||
if (target)
|
||||
DoCast(target, SPELL_GUST_OF_WIND);
|
||||
events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_ELECTRICAL_STORM:
|
||||
}
|
||||
case EVENT_CALL_LIGHTNING:
|
||||
DoCastVictim(SPELL_CALL_LIGHTNING);
|
||||
events.ScheduleEvent(EVENT_CALL_LIGHTNING, urand(12000, 17000)); // totaly random timer. can't find any info on this
|
||||
break;
|
||||
case EVENT_ELECTRICAL_STORM:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
|
||||
if (!target)
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
|
||||
if (!target)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
target->CastSpell(target, 44007, true); // cloud visual
|
||||
DoCast(target, SPELL_ELECTRICAL_STORM, false); // storm cyclon + visual
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
/// @todo: fix it in correct way, that causes player to can fly until logout
|
||||
/*
|
||||
if (target)
|
||||
{
|
||||
target->SetDisableGravity(true);
|
||||
target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
|
||||
if (Cloud)
|
||||
{
|
||||
CloudGUID = Cloud->GetGUID();
|
||||
Cloud->SetDisableGravity(true);
|
||||
Cloud->StopMoving();
|
||||
Cloud->SetObjectScale(1.0f);
|
||||
Cloud->setFaction(35);
|
||||
Cloud->SetMaxHealth(9999999);
|
||||
Cloud->SetHealth(9999999);
|
||||
Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
StormCount = 1;
|
||||
events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 60000); // 60 seconds(bosskillers)
|
||||
events.ScheduleEvent(EVENT_RAIN, urand(47000, 52000));
|
||||
break;
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
case EVENT_RAIN:
|
||||
if (!isRaining)
|
||||
{
|
||||
SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
|
||||
isRaining = true;
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_RAIN, 1000);
|
||||
break;
|
||||
case EVENT_STORM_SEQUENCE:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, CloudGUID);
|
||||
if (!target || !target->IsAlive())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
else if (Unit* Cyclone = ObjectAccessor::GetUnit(*me, CycloneGUID))
|
||||
Cyclone->CastSpell(target, SPELL_SAND_STORM, true); // keep casting or...
|
||||
HandleStormSequence(target);
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON_EAGLES:
|
||||
Talk(SAY_SUMMON);
|
||||
|
||||
target->CastSpell(target, 44007, true); // cloud visual
|
||||
DoCast(target, SPELL_ELECTRICAL_STORM, false); // storm cyclon + visual
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
target->GetPosition(x, y, z);
|
||||
/// @todo: fix it in correct way, that causes player to can fly until logout
|
||||
/*
|
||||
if (target)
|
||||
{
|
||||
Unit* bird = ObjectAccessor::GetUnit(*me, BirdGUIDs[i]);
|
||||
if (!bird) //they despawned on die
|
||||
target->SetDisableGravity(true);
|
||||
target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ() + 16, 0, 15000);
|
||||
if (Cloud)
|
||||
{
|
||||
CloudGUID = Cloud->GetGUID();
|
||||
Cloud->SetDisableGravity(true);
|
||||
Cloud->StopMoving();
|
||||
Cloud->SetObjectScale(1.0f);
|
||||
Cloud->setFaction(35);
|
||||
Cloud->SetMaxHealth(9999999);
|
||||
Cloud->SetHealth(9999999);
|
||||
Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
StormCount = 1;
|
||||
events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 60000); // 60 seconds(bosskillers)
|
||||
events.ScheduleEvent(EVENT_RAIN, urand(47000, 52000));
|
||||
break;
|
||||
}
|
||||
case EVENT_RAIN:
|
||||
if (!isRaining)
|
||||
{
|
||||
SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
|
||||
isRaining = true;
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_RAIN, 1000);
|
||||
break;
|
||||
case EVENT_STORM_SEQUENCE:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, CloudGUID);
|
||||
if (!target || !target->IsAlive())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
else if (Unit* Cyclone = ObjectAccessor::GetUnit(*me, CycloneGUID))
|
||||
Cyclone->CastSpell(target, SPELL_SAND_STORM, true); // keep casting or...
|
||||
HandleStormSequence(target);
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON_EAGLES:
|
||||
Talk(SAY_SUMMON);
|
||||
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
{
|
||||
Unit* bird = ObjectAccessor::GetUnit(*me, BirdGUIDs[i]);
|
||||
if (!bird) //they despawned on die
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
x = target->GetPositionX() + irand(-10, 10);
|
||||
y = target->GetPositionY() + irand(-10, 10);
|
||||
z = target->GetPositionZ() + urand(16, 20);
|
||||
if (z > 95)
|
||||
z = 95.0f - urand(0, 5);
|
||||
}
|
||||
Creature* creature = me->SummonCreature(NPC_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (creature)
|
||||
{
|
||||
creature->AddThreat(me->GetVictim(), 1.0f);
|
||||
creature->AI()->AttackStart(me->GetVictim());
|
||||
BirdGUIDs[i] = creature->GetGUID();
|
||||
}
|
||||
x = target->GetPositionX() + irand(-10, 10);
|
||||
y = target->GetPositionY() + irand(-10, 10);
|
||||
z = target->GetPositionZ() + urand(16, 20);
|
||||
if (z > 95)
|
||||
z = 95.0f - urand(0, 5);
|
||||
}
|
||||
Creature* creature = me->SummonCreature(NPC_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (creature)
|
||||
{
|
||||
creature->AddThreat(me->GetVictim(), 1.0f);
|
||||
creature->AI()->AttackStart(me->GetVictim());
|
||||
BirdGUIDs[i] = creature->GetGUID();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
Talk(SAY_ENRAGE);
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 600000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
Talk(SAY_ENRAGE);
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 600000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 BirdGUIDs[8];
|
||||
uint64 TargetGUID;
|
||||
uint64 CycloneGUID;
|
||||
uint64 CloudGUID;
|
||||
uint8 StormCount;
|
||||
bool isRaining;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_akilzonAI>(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 BirdGUIDs[8];
|
||||
uint64 TargetGUID;
|
||||
uint64 CycloneGUID;
|
||||
uint64 CloudGUID;
|
||||
uint8 StormCount;
|
||||
bool isRaining;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_akilzonAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_akilzon_eagle : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_akilzon_eagle() : CreatureScript("npc_akilzon_eagle") { }
|
||||
public:
|
||||
npc_akilzon_eagle() : CreatureScript("npc_akilzon_eagle") { }
|
||||
|
||||
struct npc_akilzon_eagleAI : public ScriptedAI
|
||||
struct npc_akilzon_eagleAI : public ScriptedAI
|
||||
{
|
||||
npc_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 EagleSwoop_Timer;
|
||||
bool arrived;
|
||||
uint64 TargetGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
npc_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 EagleSwoop_Timer;
|
||||
bool arrived;
|
||||
uint64 TargetGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
EagleSwoop_Timer = urand(5000, 10000);
|
||||
arrived = true;
|
||||
TargetGUID = 0;
|
||||
me->SetDisableGravity(true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) { }
|
||||
|
||||
|
||||
void MovementInform(uint32, uint32)
|
||||
{
|
||||
arrived = true;
|
||||
if (TargetGUID)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID))
|
||||
DoCast(target, SPELL_EAGLE_SWOOP, true);
|
||||
TargetGUID = 0;
|
||||
me->SetSpeed(MOVE_RUN, 1.2f);
|
||||
EagleSwoop_Timer = urand(5000, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (EagleSwoop_Timer <= diff)
|
||||
EagleSwoop_Timer = 0;
|
||||
else
|
||||
EagleSwoop_Timer -= diff;
|
||||
|
||||
if (arrived)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
float x, y, z;
|
||||
if (EagleSwoop_Timer)
|
||||
{
|
||||
x = target->GetPositionX() + irand(-10, 10);
|
||||
y = target->GetPositionY() + irand(-10, 10);
|
||||
z = target->GetPositionZ() + urand(10, 15);
|
||||
if (z > 95)
|
||||
z = 95.0f - urand(0, 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->GetContactPoint(me, x, y, z);
|
||||
z += 2;
|
||||
me->SetSpeed(MOVE_RUN, 5.0f);
|
||||
TargetGUID = target->GetGUID();
|
||||
}
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
arrived = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_akilzon_eagleAI(creature);
|
||||
EagleSwoop_Timer = urand(5000, 10000);
|
||||
arrived = true;
|
||||
TargetGUID = 0;
|
||||
me->SetDisableGravity(true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) { }
|
||||
|
||||
|
||||
void MovementInform(uint32, uint32)
|
||||
{
|
||||
arrived = true;
|
||||
if (TargetGUID)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID))
|
||||
DoCast(target, SPELL_EAGLE_SWOOP, true);
|
||||
TargetGUID = 0;
|
||||
me->SetSpeed(MOVE_RUN, 1.2f);
|
||||
EagleSwoop_Timer = urand(5000, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (EagleSwoop_Timer <= diff)
|
||||
EagleSwoop_Timer = 0;
|
||||
else
|
||||
EagleSwoop_Timer -= diff;
|
||||
|
||||
if (arrived)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
float x, y, z;
|
||||
if (EagleSwoop_Timer)
|
||||
{
|
||||
x = target->GetPositionX() + irand(-10, 10);
|
||||
y = target->GetPositionY() + irand(-10, 10);
|
||||
z = target->GetPositionZ() + urand(10, 15);
|
||||
if (z > 95)
|
||||
z = 95.0f - urand(0, 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->GetContactPoint(me, x, y, z);
|
||||
z += 2;
|
||||
me->SetSpeed(MOVE_RUN, 5.0f);
|
||||
TargetGUID = target->GetGUID();
|
||||
}
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
arrived = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_akilzon_eagleAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_akilzon()
|
||||
|
||||
@@ -55,83 +55,83 @@ enum Yells
|
||||
|
||||
class boss_halazzi : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_halazzi() : CreatureScript("boss_halazzi") { }
|
||||
public:
|
||||
boss_halazzi() : CreatureScript("boss_halazzi") { }
|
||||
|
||||
struct boss_halazziAI : public ScriptedAI
|
||||
struct boss_halazziAI : public ScriptedAI
|
||||
{
|
||||
boss_halazziAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
boss_halazziAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
SummonList summons;
|
||||
PhaseHalazzi Phase;
|
||||
|
||||
uint32 FrenzyTimer;
|
||||
uint32 SaberlashTimer;
|
||||
uint32 ShockTimer;
|
||||
uint32 TotemTimer;
|
||||
uint32 CheckTimer;
|
||||
uint32 BerserkTimer;
|
||||
uint32 TransformCount;
|
||||
|
||||
uint64 LynxGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
|
||||
summons.DespawnAll();
|
||||
|
||||
LynxGUID = 0;
|
||||
TransformCount = 0;
|
||||
BerserkTimer = 600000;
|
||||
CheckTimer = 1000;
|
||||
|
||||
DoCast(me, SPELL_DUAL_WIELD, true);
|
||||
|
||||
Phase = PHASE_NONE;
|
||||
EnterPhase(PHASE_LYNX);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
|
||||
Talk(SAY_AGGRO);
|
||||
EnterPhase(PHASE_LYNX);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->AI()->AttackStart(me->GetVictim());
|
||||
if (summon->GetEntry() == NPC_SPIRIT_LYNX)
|
||||
LynxGUID = summon->GetGUID();
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE)
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void SpellHit(Unit*, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_TRANSFORM_SPLIT2)
|
||||
EnterPhase(PHASE_HUMAN);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (Phase != PHASE_MERGE)
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterPhase(PhaseHalazzi NextPhase)
|
||||
{
|
||||
switch (NextPhase)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
SummonList summons;
|
||||
PhaseHalazzi Phase;
|
||||
|
||||
uint32 FrenzyTimer;
|
||||
uint32 SaberlashTimer;
|
||||
uint32 ShockTimer;
|
||||
uint32 TotemTimer;
|
||||
uint32 CheckTimer;
|
||||
uint32 BerserkTimer;
|
||||
uint32 TransformCount;
|
||||
|
||||
uint64 LynxGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
|
||||
summons.DespawnAll();
|
||||
|
||||
LynxGUID = 0;
|
||||
TransformCount = 0;
|
||||
BerserkTimer = 600000;
|
||||
CheckTimer = 1000;
|
||||
|
||||
DoCast(me, SPELL_DUAL_WIELD, true);
|
||||
|
||||
Phase = PHASE_NONE;
|
||||
EnterPhase(PHASE_LYNX);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
|
||||
Talk(SAY_AGGRO);
|
||||
EnterPhase(PHASE_LYNX);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->AI()->AttackStart(me->GetVictim());
|
||||
if (summon->GetEntry() == NPC_SPIRIT_LYNX)
|
||||
LynxGUID = summon->GetGUID();
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE)
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void SpellHit(Unit*, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_TRANSFORM_SPLIT2)
|
||||
EnterPhase(PHASE_HUMAN);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (Phase != PHASE_MERGE)
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterPhase(PhaseHalazzi NextPhase)
|
||||
{
|
||||
switch (NextPhase)
|
||||
{
|
||||
case PHASE_LYNX:
|
||||
case PHASE_ENRAGE:
|
||||
if (Phase == PHASE_MERGE)
|
||||
@@ -175,191 +175,201 @@ class boss_halazzi : public CreatureScript
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Phase = NextPhase;
|
||||
}
|
||||
Phase = NextPhase;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (BerserkTimer <= diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
Talk(SAY_BERSERK);
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
BerserkTimer = 60000;
|
||||
}
|
||||
else BerserkTimer -= diff;
|
||||
|
||||
if (BerserkTimer <= diff)
|
||||
if (Phase == PHASE_LYNX || Phase == PHASE_ENRAGE)
|
||||
{
|
||||
if (SaberlashTimer <= diff)
|
||||
{
|
||||
Talk(SAY_BERSERK);
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
BerserkTimer = 60000;
|
||||
} else BerserkTimer -= diff;
|
||||
|
||||
if (Phase == PHASE_LYNX || Phase == PHASE_ENRAGE)
|
||||
{
|
||||
if (SaberlashTimer <= diff)
|
||||
{
|
||||
// A tank with more than 490 defense skills should receive no critical hit
|
||||
//DoCast(me, 41296, true);
|
||||
DoCastVictim(SPELL_SABER_LASH, true);
|
||||
//me->RemoveAurasDueToSpell(41296);
|
||||
SaberlashTimer = 30000;
|
||||
} else SaberlashTimer -= diff;
|
||||
|
||||
if (FrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
FrenzyTimer = urand(10000, 15000);
|
||||
} else FrenzyTimer -= diff;
|
||||
|
||||
if (Phase == PHASE_LYNX)
|
||||
{
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
if (HealthBelowPct(25 * (3 - TransformCount)))
|
||||
EnterPhase(PHASE_SPLIT);
|
||||
CheckTimer = 1000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
// A tank with more than 490 defense skills should receive no critical hit
|
||||
//DoCast(me, 41296, true);
|
||||
DoCastVictim(SPELL_SABER_LASH, true);
|
||||
//me->RemoveAurasDueToSpell(41296);
|
||||
SaberlashTimer = 30000;
|
||||
}
|
||||
else SaberlashTimer -= diff;
|
||||
|
||||
if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE)
|
||||
if (FrenzyTimer <= diff)
|
||||
{
|
||||
if (TotemTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_TOTEM);
|
||||
TotemTimer = 20000;
|
||||
} else TotemTimer -= diff;
|
||||
|
||||
if (ShockTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (target->IsNonMeleeSpellCast(false))
|
||||
DoCast(target, SPELL_EARTHSHOCK);
|
||||
else
|
||||
DoCast(target, SPELL_FLAMESHOCK);
|
||||
ShockTimer = urand(10000, 15000);
|
||||
}
|
||||
} else ShockTimer -= diff;
|
||||
|
||||
if (Phase == PHASE_HUMAN)
|
||||
{
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
if (!HealthAbovePct(20) /*HealthBelowPct(10)*/)
|
||||
EnterPhase(PHASE_MERGE);
|
||||
else
|
||||
{
|
||||
Unit* Lynx = ObjectAccessor::GetUnit(*me, LynxGUID);
|
||||
if (Lynx && !Lynx->HealthAbovePct(20) /*Lynx->HealthBelowPct(10)*/)
|
||||
EnterPhase(PHASE_MERGE);
|
||||
}
|
||||
CheckTimer = 1000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
FrenzyTimer = urand(10000, 15000);
|
||||
}
|
||||
else FrenzyTimer -= diff;
|
||||
|
||||
if (Phase == PHASE_MERGE)
|
||||
if (Phase == PHASE_LYNX)
|
||||
{
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
Unit* Lynx = ObjectAccessor::GetUnit(*me, LynxGUID);
|
||||
if (Lynx)
|
||||
if (HealthBelowPct(25 * (3 - TransformCount)))
|
||||
EnterPhase(PHASE_SPLIT);
|
||||
CheckTimer = 1000;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE)
|
||||
{
|
||||
if (TotemTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_TOTEM);
|
||||
TotemTimer = 20000;
|
||||
}
|
||||
else TotemTimer -= diff;
|
||||
|
||||
if (ShockTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (target->IsNonMeleeSpellCast(false))
|
||||
DoCast(target, SPELL_EARTHSHOCK);
|
||||
else
|
||||
DoCast(target, SPELL_FLAMESHOCK);
|
||||
ShockTimer = urand(10000, 15000);
|
||||
}
|
||||
}
|
||||
else ShockTimer -= diff;
|
||||
|
||||
if (Phase == PHASE_HUMAN)
|
||||
{
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
if (!HealthAbovePct(20) /*HealthBelowPct(10)*/)
|
||||
EnterPhase(PHASE_MERGE);
|
||||
else
|
||||
{
|
||||
Lynx->GetMotionMaster()->MoveFollow(me, 0, 0);
|
||||
me->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
|
||||
if (me->IsWithinDistInMap(Lynx, 6.0f))
|
||||
{
|
||||
if (TransformCount < 3)
|
||||
EnterPhase(PHASE_LYNX);
|
||||
else
|
||||
EnterPhase(PHASE_ENRAGE);
|
||||
}
|
||||
Unit* Lynx = ObjectAccessor::GetUnit(*me, LynxGUID);
|
||||
if (Lynx && !Lynx->HealthAbovePct(20) /*Lynx->HealthBelowPct(10)*/)
|
||||
EnterPhase(PHASE_MERGE);
|
||||
}
|
||||
CheckTimer = 1000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
if (Phase == PHASE_MERGE)
|
||||
{
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Talk(SAY_KILL);
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
Unit* Lynx = ObjectAccessor::GetUnit(*me, LynxGUID);
|
||||
if (Lynx)
|
||||
{
|
||||
Lynx->GetMotionMaster()->MoveFollow(me, 0, 0);
|
||||
me->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
|
||||
if (me->IsWithinDistInMap(Lynx, 6.0f))
|
||||
{
|
||||
if (TransformCount < 3)
|
||||
EnterPhase(PHASE_LYNX);
|
||||
else
|
||||
EnterPhase(PHASE_ENRAGE);
|
||||
}
|
||||
}
|
||||
CheckTimer = 1000;
|
||||
}
|
||||
else CheckTimer -= diff;
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, DONE);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_halazziAI>(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, DONE);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_halazziAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// Spirits Lynx AI
|
||||
class npc_halazzi_lynx : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_halazzi_lynx() : CreatureScript("npc_halazzi_lynx") { }
|
||||
public:
|
||||
npc_halazzi_lynx() : CreatureScript("npc_halazzi_lynx") { }
|
||||
|
||||
struct npc_halazzi_lynxAI : public ScriptedAI
|
||||
struct npc_halazzi_lynxAI : public ScriptedAI
|
||||
{
|
||||
npc_halazzi_lynxAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 FrenzyTimer;
|
||||
uint32 shredder_timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
npc_halazzi_lynxAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
FrenzyTimer = urand(30000, 50000); //frenzy every 30-50 seconds
|
||||
shredder_timer = 4000;
|
||||
}
|
||||
|
||||
uint32 FrenzyTimer;
|
||||
uint32 shredder_timer;
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/ }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (FrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_LYNX_FRENZY);
|
||||
FrenzyTimer = urand(30000, 50000); //frenzy every 30-50 seconds
|
||||
}
|
||||
else FrenzyTimer -= diff;
|
||||
|
||||
if (shredder_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHRED_ARMOR);
|
||||
shredder_timer = 4000;
|
||||
}
|
||||
else shredder_timer -= diff;
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/ }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (FrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_LYNX_FRENZY);
|
||||
FrenzyTimer = urand(30000, 50000); //frenzy every 30-50 seconds
|
||||
} else FrenzyTimer -= diff;
|
||||
|
||||
if (shredder_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHRED_ARMOR);
|
||||
shredder_timer = 4000;
|
||||
} else shredder_timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_halazzi_lynxAI(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_halazzi_lynxAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_halazzi()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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: Boss_Nalorakk
|
||||
@@ -69,384 +69,393 @@ enum Talks
|
||||
|
||||
class boss_nalorakk : public CreatureScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
boss_nalorakk()
|
||||
: CreatureScript("boss_nalorakk")
|
||||
boss_nalorakk()
|
||||
: CreatureScript("boss_nalorakk")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_nalorakkAI : public ScriptedAI
|
||||
{
|
||||
boss_nalorakkAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
MoveEvent = true;
|
||||
MovePhase = 0;
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
struct boss_nalorakkAI : public ScriptedAI
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BrutalSwipe_Timer;
|
||||
uint32 Mangle_Timer;
|
||||
uint32 Surge_Timer;
|
||||
|
||||
uint32 LaceratingSlash_Timer;
|
||||
uint32 RendFlesh_Timer;
|
||||
uint32 DeafeningRoar_Timer;
|
||||
|
||||
uint32 ShapeShift_Timer;
|
||||
uint32 Berserk_Timer;
|
||||
|
||||
bool inBearForm;
|
||||
bool MoveEvent;
|
||||
bool inMove;
|
||||
uint32 MovePhase;
|
||||
uint32 waitTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
boss_nalorakkAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
MoveEvent = true;
|
||||
MovePhase = 0;
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BrutalSwipe_Timer;
|
||||
uint32 Mangle_Timer;
|
||||
uint32 Surge_Timer;
|
||||
|
||||
uint32 LaceratingSlash_Timer;
|
||||
uint32 RendFlesh_Timer;
|
||||
uint32 DeafeningRoar_Timer;
|
||||
|
||||
uint32 ShapeShift_Timer;
|
||||
uint32 Berserk_Timer;
|
||||
|
||||
bool inBearForm;
|
||||
bool MoveEvent;
|
||||
bool inMove;
|
||||
uint32 MovePhase;
|
||||
uint32 waitTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (MoveEvent)
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
inMove = false;
|
||||
waitTimer = 0;
|
||||
me->SetSpeed(MOVE_RUN, 2);
|
||||
me->SetWalk(false);
|
||||
ResetMobs();
|
||||
}
|
||||
else
|
||||
{
|
||||
(*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]);
|
||||
}
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
Surge_Timer = urand(15000, 20000);
|
||||
BrutalSwipe_Timer = urand(7000, 12000);
|
||||
Mangle_Timer = urand(10000, 15000);
|
||||
ShapeShift_Timer = urand(45000, 50000);
|
||||
Berserk_Timer = 600000;
|
||||
|
||||
inBearForm = false;
|
||||
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); /// @todo find the correct equipment id
|
||||
}
|
||||
|
||||
void ResetMobs()
|
||||
{
|
||||
std::list<Creature*> templist;
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(x, y));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllFriendlyCreaturesInGrid check(me);
|
||||
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
|
||||
|
||||
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
|
||||
}
|
||||
|
||||
if (templist.empty())
|
||||
return;
|
||||
|
||||
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
|
||||
if ((*i) && me->GetGUID() != (*i)->GetGUID() && me->IsWithinDistInMap((*i), 25))
|
||||
(*i)->AI()->Reset();
|
||||
}
|
||||
|
||||
void SendAttacker(Unit* target)
|
||||
{
|
||||
std::list<Creature*> templist;
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(x, y));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllFriendlyCreaturesInGrid check(me);
|
||||
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
|
||||
|
||||
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
|
||||
}
|
||||
|
||||
if (templist.empty())
|
||||
return;
|
||||
|
||||
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
|
||||
{
|
||||
if ((*i) && me->IsWithinDistInMap((*i), 25))
|
||||
{
|
||||
(*i)->SetNoCallAssistance(true);
|
||||
(*i)->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
{
|
||||
if (!MoveEvent)
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (!MoveEvent)
|
||||
{
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (me->IsHostileTo(who))
|
||||
{
|
||||
if (!inMove)
|
||||
{
|
||||
switch (MovePhase)
|
||||
{
|
||||
case 0:
|
||||
if (me->IsWithinDistInMap(who, 50))
|
||||
{
|
||||
Talk(SAY_WAVE1);
|
||||
|
||||
(*me).GetMotionMaster()->MovePoint(1, NalorakkWay[1][0], NalorakkWay[1][1], NalorakkWay[1][2]);
|
||||
MovePhase ++;
|
||||
inMove = true;
|
||||
|
||||
SendAttacker(who);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (me->IsWithinDistInMap(who, 40))
|
||||
{
|
||||
Talk(SAY_WAVE2);
|
||||
|
||||
(*me).GetMotionMaster()->MovePoint(3, NalorakkWay[3][0], NalorakkWay[3][1], NalorakkWay[3][2]);
|
||||
MovePhase ++;
|
||||
inMove = true;
|
||||
|
||||
SendAttacker(who);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (me->IsWithinDistInMap(who, 40))
|
||||
{
|
||||
Talk(SAY_WAVE3);
|
||||
|
||||
(*me).GetMotionMaster()->MovePoint(6, NalorakkWay[6][0], NalorakkWay[6][1], NalorakkWay[6][2]);
|
||||
MovePhase ++;
|
||||
inMove = true;
|
||||
|
||||
SendAttacker(who);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (me->IsWithinDistInMap(who, 50))
|
||||
{
|
||||
SendAttacker(who);
|
||||
|
||||
Talk(SAY_WAVE4);
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
MoveEvent = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
if (MoveEvent)
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
inMove = false;
|
||||
waitTimer = 0;
|
||||
me->SetSpeed(MOVE_RUN, 2);
|
||||
me->SetWalk(false);
|
||||
ResetMobs();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, DONE);
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
(*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
if (instance)
|
||||
{
|
||||
switch (urand(0, 1))
|
||||
instance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
Surge_Timer = urand(15000, 20000);
|
||||
BrutalSwipe_Timer = urand(7000, 12000);
|
||||
Mangle_Timer = urand(10000, 15000);
|
||||
ShapeShift_Timer = urand(45000, 50000);
|
||||
Berserk_Timer = 600000;
|
||||
|
||||
inBearForm = false;
|
||||
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); /// @todo find the correct equipment id
|
||||
}
|
||||
|
||||
void ResetMobs()
|
||||
{
|
||||
std::list<Creature*> templist;
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(x, y));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllFriendlyCreaturesInGrid check(me);
|
||||
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
|
||||
|
||||
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
|
||||
}
|
||||
|
||||
if (templist.empty())
|
||||
return;
|
||||
|
||||
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
|
||||
if ((*i) && me->GetGUID() != (*i)->GetGUID() && me->IsWithinDistInMap((*i), 25))
|
||||
(*i)->AI()->Reset();
|
||||
}
|
||||
|
||||
void SendAttacker(Unit* target)
|
||||
{
|
||||
std::list<Creature*> templist;
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(x, y));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllFriendlyCreaturesInGrid check(me);
|
||||
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
|
||||
|
||||
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
|
||||
}
|
||||
|
||||
if (templist.empty())
|
||||
return;
|
||||
|
||||
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
|
||||
{
|
||||
if ((*i) && me->IsWithinDistInMap((*i), 25))
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_KILL_ONE);
|
||||
break;
|
||||
case 1:
|
||||
Talk(SAY_KILL_TWO);
|
||||
break;
|
||||
(*i)->SetNoCallAssistance(true);
|
||||
(*i)->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
void AttackStart(Unit* who) override
|
||||
{
|
||||
if (!MoveEvent)
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (!MoveEvent)
|
||||
{
|
||||
if (MoveEvent)
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (me->IsHostileTo(who))
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (!inMove)
|
||||
return;
|
||||
|
||||
if (MovePhase != id)
|
||||
return;
|
||||
|
||||
switch (MovePhase)
|
||||
{
|
||||
case 2:
|
||||
me->SetOrientation(3.1415f*2);
|
||||
inMove = false;
|
||||
return;
|
||||
case 1:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
MovePhase ++;
|
||||
waitTimer = 1;
|
||||
inMove = true;
|
||||
return;
|
||||
case 5:
|
||||
me->SetOrientation(3.1415f*0.5f);
|
||||
inMove = false;
|
||||
return;
|
||||
case 7:
|
||||
me->SetOrientation(3.1415f*0.5f);
|
||||
inMove = false;
|
||||
return;
|
||||
}
|
||||
switch (MovePhase)
|
||||
{
|
||||
case 0:
|
||||
if (me->IsWithinDistInMap(who, 50))
|
||||
{
|
||||
Talk(SAY_WAVE1);
|
||||
|
||||
(*me).GetMotionMaster()->MovePoint(1, NalorakkWay[1][0], NalorakkWay[1][1], NalorakkWay[1][2]);
|
||||
MovePhase ++;
|
||||
inMove = true;
|
||||
|
||||
SendAttacker(who);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (me->IsWithinDistInMap(who, 40))
|
||||
{
|
||||
Talk(SAY_WAVE2);
|
||||
|
||||
(*me).GetMotionMaster()->MovePoint(3, NalorakkWay[3][0], NalorakkWay[3][1], NalorakkWay[3][2]);
|
||||
MovePhase ++;
|
||||
inMove = true;
|
||||
|
||||
SendAttacker(who);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (me->IsWithinDistInMap(who, 40))
|
||||
{
|
||||
Talk(SAY_WAVE3);
|
||||
|
||||
(*me).GetMotionMaster()->MovePoint(6, NalorakkWay[6][0], NalorakkWay[6][1], NalorakkWay[6][2]);
|
||||
MovePhase ++;
|
||||
inMove = true;
|
||||
|
||||
SendAttacker(who);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (me->IsWithinDistInMap(who, 50))
|
||||
{
|
||||
SendAttacker(who);
|
||||
|
||||
Talk(SAY_WAVE4);
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
MoveEvent = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
ResetMobs();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, DONE);
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
switch (urand(0, 1))
|
||||
{
|
||||
if (waitTimer && inMove)
|
||||
{
|
||||
if (waitTimer <= diff)
|
||||
{
|
||||
(*me).GetMotionMaster()->MovementExpired();
|
||||
(*me).GetMotionMaster()->MovePoint(MovePhase, NalorakkWay[MovePhase][0], NalorakkWay[MovePhase][1], NalorakkWay[MovePhase][2]);
|
||||
waitTimer = 0;
|
||||
} else waitTimer -= diff;
|
||||
}
|
||||
case 0:
|
||||
Talk(SAY_KILL_ONE);
|
||||
break;
|
||||
case 1:
|
||||
Talk(SAY_KILL_TWO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (MoveEvent)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (Berserk_Timer <= diff)
|
||||
if (!inMove)
|
||||
return;
|
||||
|
||||
if (MovePhase != id)
|
||||
return;
|
||||
|
||||
switch (MovePhase)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
Talk(SAY_BERSERK);
|
||||
Berserk_Timer = 600000;
|
||||
} else Berserk_Timer -= diff;
|
||||
case 2:
|
||||
me->SetOrientation(3.1415f * 2);
|
||||
inMove = false;
|
||||
return;
|
||||
case 1:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
MovePhase ++;
|
||||
waitTimer = 1;
|
||||
inMove = true;
|
||||
return;
|
||||
case 5:
|
||||
me->SetOrientation(3.1415f * 0.5f);
|
||||
inMove = false;
|
||||
return;
|
||||
case 7:
|
||||
me->SetOrientation(3.1415f * 0.5f);
|
||||
inMove = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ShapeShift_Timer <= diff)
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (waitTimer && inMove)
|
||||
{
|
||||
if (waitTimer <= diff)
|
||||
{
|
||||
if (inBearForm)
|
||||
{
|
||||
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
|
||||
Talk(SAY_SHIFTEDTOTROLL);
|
||||
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
|
||||
Surge_Timer = urand(15000, 20000);
|
||||
BrutalSwipe_Timer = urand(7000, 12000);
|
||||
Mangle_Timer = urand(10000, 15000);
|
||||
ShapeShift_Timer = urand(45000, 50000);
|
||||
inBearForm = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
|
||||
Talk(SAY_SHIFTEDTOBEAR);
|
||||
DoCast(me, SPELL_BEARFORM, true);
|
||||
LaceratingSlash_Timer = 2000; // dur 18s
|
||||
RendFlesh_Timer = 3000; // dur 5s
|
||||
DeafeningRoar_Timer = urand(5000, 10000); // dur 2s
|
||||
ShapeShift_Timer = urand(20000, 25000); // dur 30s
|
||||
inBearForm = true;
|
||||
}
|
||||
} else ShapeShift_Timer -= diff;
|
||||
(*me).GetMotionMaster()->MovementExpired();
|
||||
(*me).GetMotionMaster()->MovePoint(MovePhase, NalorakkWay[MovePhase][0], NalorakkWay[MovePhase][1], NalorakkWay[MovePhase][2]);
|
||||
waitTimer = 0;
|
||||
}
|
||||
else waitTimer -= diff;
|
||||
}
|
||||
|
||||
if (!inBearForm)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Berserk_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
Talk(SAY_BERSERK);
|
||||
Berserk_Timer = 600000;
|
||||
}
|
||||
else Berserk_Timer -= diff;
|
||||
|
||||
if (ShapeShift_Timer <= diff)
|
||||
{
|
||||
if (inBearForm)
|
||||
{
|
||||
if (BrutalSwipe_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_BRUTALSWIPE);
|
||||
BrutalSwipe_Timer = urand(7000, 12000);
|
||||
} else BrutalSwipe_Timer -= diff;
|
||||
|
||||
if (Mangle_Timer <= diff)
|
||||
{
|
||||
if (me->GetVictim() && !me->GetVictim()->HasAura(SPELL_MANGLEEFFECT))
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLE);
|
||||
Mangle_Timer = 1000;
|
||||
}
|
||||
else Mangle_Timer = urand(10000, 15000);
|
||||
} else Mangle_Timer -= diff;
|
||||
|
||||
if (Surge_Timer <= diff)
|
||||
{
|
||||
Talk(SAY_SURGE);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
|
||||
if (target)
|
||||
DoCast(target, SPELL_SURGE);
|
||||
Surge_Timer = urand(15000, 20000);
|
||||
} else Surge_Timer -= diff;
|
||||
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
|
||||
Talk(SAY_SHIFTEDTOTROLL);
|
||||
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
|
||||
Surge_Timer = urand(15000, 20000);
|
||||
BrutalSwipe_Timer = urand(7000, 12000);
|
||||
Mangle_Timer = urand(10000, 15000);
|
||||
ShapeShift_Timer = urand(45000, 50000);
|
||||
inBearForm = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LaceratingSlash_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_LACERATINGSLASH);
|
||||
LaceratingSlash_Timer = urand(18000, 23000);
|
||||
} else LaceratingSlash_Timer -= diff;
|
||||
|
||||
if (RendFlesh_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_RENDFLESH);
|
||||
RendFlesh_Timer = urand(5000, 10000);
|
||||
} else RendFlesh_Timer -= diff;
|
||||
|
||||
if (DeafeningRoar_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_DEAFENINGROAR);
|
||||
DeafeningRoar_Timer = urand(15000, 20000);
|
||||
} else DeafeningRoar_Timer -= diff;
|
||||
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
|
||||
Talk(SAY_SHIFTEDTOBEAR);
|
||||
DoCast(me, SPELL_BEARFORM, true);
|
||||
LaceratingSlash_Timer = 2000; // dur 18s
|
||||
RendFlesh_Timer = 3000; // dur 5s
|
||||
DeafeningRoar_Timer = urand(5000, 10000); // dur 2s
|
||||
ShapeShift_Timer = urand(20000, 25000); // dur 30s
|
||||
inBearForm = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
else ShapeShift_Timer -= diff;
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_nalorakkAI>(creature);
|
||||
if (!inBearForm)
|
||||
{
|
||||
if (BrutalSwipe_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_BRUTALSWIPE);
|
||||
BrutalSwipe_Timer = urand(7000, 12000);
|
||||
}
|
||||
else BrutalSwipe_Timer -= diff;
|
||||
|
||||
if (Mangle_Timer <= diff)
|
||||
{
|
||||
if (me->GetVictim() && !me->GetVictim()->HasAura(SPELL_MANGLEEFFECT))
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLE);
|
||||
Mangle_Timer = 1000;
|
||||
}
|
||||
else Mangle_Timer = urand(10000, 15000);
|
||||
}
|
||||
else Mangle_Timer -= diff;
|
||||
|
||||
if (Surge_Timer <= diff)
|
||||
{
|
||||
Talk(SAY_SURGE);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
|
||||
if (target)
|
||||
DoCast(target, SPELL_SURGE);
|
||||
Surge_Timer = urand(15000, 20000);
|
||||
}
|
||||
else Surge_Timer -= diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LaceratingSlash_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_LACERATINGSLASH);
|
||||
LaceratingSlash_Timer = urand(18000, 23000);
|
||||
}
|
||||
else LaceratingSlash_Timer -= diff;
|
||||
|
||||
if (RendFlesh_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_RENDFLESH);
|
||||
RendFlesh_Timer = urand(5000, 10000);
|
||||
}
|
||||
else RendFlesh_Timer -= diff;
|
||||
|
||||
if (DeafeningRoar_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_DEAFENINGROAR);
|
||||
DeafeningRoar_Timer = urand(15000, 20000);
|
||||
}
|
||||
else DeafeningRoar_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_nalorakkAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nalorakk()
|
||||
|
||||
@@ -113,189 +113,190 @@ static TransformStruct Transform[4] =
|
||||
|
||||
class boss_zuljin : public CreatureScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
boss_zuljin()
|
||||
: CreatureScript("boss_zuljin")
|
||||
boss_zuljin()
|
||||
: CreatureScript("boss_zuljin")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_zuljinAI : public ScriptedAI
|
||||
{
|
||||
boss_zuljinAI(Creature* creature) : ScriptedAI(creature), Summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 SpiritGUID[4];
|
||||
uint64 ClawTargetGUID;
|
||||
uint64 TankGUID;
|
||||
|
||||
uint32 Phase;
|
||||
uint32 health_20;
|
||||
|
||||
uint32 Intro_Timer;
|
||||
uint32 Berserk_Timer;
|
||||
|
||||
uint32 Whirlwind_Timer;
|
||||
uint32 Grievous_Throw_Timer;
|
||||
|
||||
uint32 Creeping_Paralysis_Timer;
|
||||
uint32 Overpower_Timer;
|
||||
|
||||
uint32 Claw_Rage_Timer;
|
||||
uint32 Lynx_Rush_Timer;
|
||||
uint32 Claw_Counter;
|
||||
uint32 Claw_Loop_Timer;
|
||||
|
||||
uint32 Flame_Whirl_Timer;
|
||||
uint32 Flame_Breath_Timer;
|
||||
uint32 Pillar_Of_Fire_Timer;
|
||||
|
||||
SummonList Summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
|
||||
|
||||
Phase = 0;
|
||||
|
||||
health_20 = me->CountPctFromMaxHealth(20);
|
||||
|
||||
Intro_Timer = 37000;
|
||||
Berserk_Timer = 600000;
|
||||
|
||||
Whirlwind_Timer = 7000;
|
||||
Grievous_Throw_Timer = 8000;
|
||||
|
||||
Creeping_Paralysis_Timer = 7000;
|
||||
Overpower_Timer = 0;
|
||||
|
||||
Claw_Rage_Timer = 5000;
|
||||
Lynx_Rush_Timer = 14000;
|
||||
Claw_Loop_Timer = 0;
|
||||
Claw_Counter = 0;
|
||||
|
||||
Flame_Whirl_Timer = 5000;
|
||||
Flame_Breath_Timer = 6000;
|
||||
Pillar_Of_Fire_Timer = 7000;
|
||||
|
||||
ClawTargetGUID = 0;
|
||||
TankGUID = 0;
|
||||
|
||||
Summons.DespawnAll();
|
||||
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 33975);
|
||||
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
|
||||
//me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
|
||||
}
|
||||
|
||||
struct boss_zuljinAI : public ScriptedAI
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
boss_zuljinAI(Creature* creature) : ScriptedAI(creature), Summons(me)
|
||||
instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
|
||||
Talk(YELL_INTRO);
|
||||
SpawnAdds();
|
||||
EnterPhase(0);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (Intro_Timer)
|
||||
return;
|
||||
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, DONE);
|
||||
|
||||
Talk(YELL_DEATH);
|
||||
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
|
||||
|
||||
if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[3]))
|
||||
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (Phase == 2)
|
||||
AttackStartNoMove(who);
|
||||
else
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void DoMeleeAttackIfReady()
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 SpiritGUID[4];
|
||||
uint64 ClawTargetGUID;
|
||||
uint64 TankGUID;
|
||||
|
||||
uint32 Phase;
|
||||
uint32 health_20;
|
||||
|
||||
uint32 Intro_Timer;
|
||||
uint32 Berserk_Timer;
|
||||
|
||||
uint32 Whirlwind_Timer;
|
||||
uint32 Grievous_Throw_Timer;
|
||||
|
||||
uint32 Creeping_Paralysis_Timer;
|
||||
uint32 Overpower_Timer;
|
||||
|
||||
uint32 Claw_Rage_Timer;
|
||||
uint32 Lynx_Rush_Timer;
|
||||
uint32 Claw_Counter;
|
||||
uint32 Claw_Loop_Timer;
|
||||
|
||||
uint32 Flame_Whirl_Timer;
|
||||
uint32 Flame_Breath_Timer;
|
||||
uint32 Pillar_Of_Fire_Timer;
|
||||
|
||||
SummonList Summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
|
||||
|
||||
Phase = 0;
|
||||
|
||||
health_20 = me->CountPctFromMaxHealth(20);
|
||||
|
||||
Intro_Timer = 37000;
|
||||
Berserk_Timer = 600000;
|
||||
|
||||
Whirlwind_Timer = 7000;
|
||||
Grievous_Throw_Timer = 8000;
|
||||
|
||||
Creeping_Paralysis_Timer = 7000;
|
||||
Overpower_Timer = 0;
|
||||
|
||||
Claw_Rage_Timer = 5000;
|
||||
Lynx_Rush_Timer = 14000;
|
||||
Claw_Loop_Timer = 0;
|
||||
Claw_Counter = 0;
|
||||
|
||||
Flame_Whirl_Timer = 5000;
|
||||
Flame_Breath_Timer = 6000;
|
||||
Pillar_Of_Fire_Timer = 7000;
|
||||
|
||||
ClawTargetGUID = 0;
|
||||
TankGUID = 0;
|
||||
|
||||
Summons.DespawnAll();
|
||||
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 33975);
|
||||
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
|
||||
//me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
|
||||
Talk(YELL_INTRO);
|
||||
SpawnAdds();
|
||||
EnterPhase(0);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (Intro_Timer)
|
||||
return;
|
||||
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, DONE);
|
||||
|
||||
Talk(YELL_DEATH);
|
||||
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
|
||||
|
||||
if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[3]))
|
||||
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (Phase == 2)
|
||||
AttackStartNoMove(who);
|
||||
else
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void DoMeleeAttackIfReady()
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
if (me->isAttackReady() && me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
if (me->isAttackReady() && me->IsWithinMeleeRange(me->GetVictim()))
|
||||
if (Phase == 1 && !Overpower_Timer)
|
||||
{
|
||||
if (Phase == 1 && !Overpower_Timer)
|
||||
uint32 health = me->GetVictim()->GetHealth();
|
||||
me->AttackerStateUpdate(me->GetVictim());
|
||||
if (me->GetVictim() && health == me->GetVictim()->GetHealth())
|
||||
{
|
||||
uint32 health = me->GetVictim()->GetHealth();
|
||||
me->AttackerStateUpdate(me->GetVictim());
|
||||
if (me->GetVictim() && health == me->GetVictim()->GetHealth())
|
||||
{
|
||||
DoCastVictim(SPELL_OVERPOWER, false);
|
||||
Overpower_Timer = 5000;
|
||||
}
|
||||
} else me->AttackerStateUpdate(me->GetVictim());
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
{
|
||||
Creature* creature = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
creature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if (creature)
|
||||
{
|
||||
creature->CastSpell(creature, SPELL_SPIRIT_AURA, true);
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
SpiritGUID[i] = creature->GetGUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DespawnAdds()
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (SpiritGUID[i])
|
||||
{
|
||||
if (Unit* temp = ObjectAccessor::GetUnit(*me, SpiritGUID[i]))
|
||||
{
|
||||
temp->SetVisible(false);
|
||||
temp->setDeathState(DEAD);
|
||||
DoCastVictim(SPELL_OVERPOWER, false);
|
||||
Overpower_Timer = 5000;
|
||||
}
|
||||
}
|
||||
SpiritGUID[i] = 0;
|
||||
else me->AttackerStateUpdate(me->GetVictim());
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
void SpawnAdds()
|
||||
{
|
||||
Creature* creature = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
Summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void EnterPhase(uint32 NextPhase)
|
||||
{
|
||||
switch (NextPhase)
|
||||
creature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if (creature)
|
||||
{
|
||||
creature->CastSpell(creature, SPELL_SPIRIT_AURA, true);
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
SpiritGUID[i] = creature->GetGUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DespawnAdds()
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (SpiritGUID[i])
|
||||
{
|
||||
if (Unit* temp = ObjectAccessor::GetUnit(*me, SpiritGUID[i]))
|
||||
{
|
||||
temp->SetVisible(false);
|
||||
temp->setDeathState(DEAD);
|
||||
}
|
||||
}
|
||||
SpiritGUID[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
Summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
Summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void EnterPhase(uint32 NextPhase)
|
||||
{
|
||||
switch (NextPhase)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
@@ -344,30 +345,31 @@ class boss_zuljin : public CreatureScript
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Phase = NextPhase;
|
||||
}
|
||||
Phase = NextPhase;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!TankGUID)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->GetHealth() < health_20 * (4 - Phase))
|
||||
EnterPhase(Phase + 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
if (Berserk_Timer <= diff)
|
||||
{
|
||||
if (!TankGUID)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
Talk(YELL_BERSERK);
|
||||
Berserk_Timer = 60000;
|
||||
}
|
||||
else Berserk_Timer -= diff;
|
||||
|
||||
if (me->GetHealth() < health_20 * (4 - Phase))
|
||||
EnterPhase(Phase + 1);
|
||||
}
|
||||
|
||||
if (Berserk_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
Talk(YELL_BERSERK);
|
||||
Berserk_Timer = 60000;
|
||||
} else Berserk_Timer -= diff;
|
||||
|
||||
switch (Phase)
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
case 0:
|
||||
if (Intro_Timer)
|
||||
{
|
||||
@@ -375,21 +377,24 @@ class boss_zuljin : public CreatureScript
|
||||
{
|
||||
Talk(YELL_AGGRO);
|
||||
Intro_Timer = 0;
|
||||
} else Intro_Timer -= diff;
|
||||
}
|
||||
else Intro_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Whirlwind_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
Whirlwind_Timer = urand(15000, 20000);
|
||||
} else Whirlwind_Timer -= diff;
|
||||
}
|
||||
else Whirlwind_Timer -= diff;
|
||||
|
||||
if (Grievous_Throw_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_GRIEVOUS_THROW, false);
|
||||
Grievous_Throw_Timer = 10000;
|
||||
} else Grievous_Throw_Timer -= diff;
|
||||
}
|
||||
else Grievous_Throw_Timer -= diff;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@@ -397,13 +402,15 @@ class boss_zuljin : public CreatureScript
|
||||
{
|
||||
DoCast(me, SPELL_CREEPING_PARALYSIS);
|
||||
Creeping_Paralysis_Timer = 20000;
|
||||
} else Creeping_Paralysis_Timer -= diff;
|
||||
}
|
||||
else Creeping_Paralysis_Timer -= diff;
|
||||
|
||||
if (Overpower_Timer <= diff)
|
||||
{
|
||||
// implemented in DoMeleeAttackIfReady()
|
||||
Overpower_Timer = 0;
|
||||
} else Overpower_Timer -= diff;
|
||||
}
|
||||
else Overpower_Timer -= diff;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@@ -455,9 +462,11 @@ class boss_zuljin : public CreatureScript
|
||||
EnterEvadeMode(); // if (target)
|
||||
return;
|
||||
}
|
||||
} else Claw_Loop_Timer -= diff;
|
||||
}
|
||||
else Claw_Loop_Timer -= diff;
|
||||
} //if (TankGUID)
|
||||
} else Claw_Rage_Timer -= diff;
|
||||
}
|
||||
else Claw_Rage_Timer -= diff;
|
||||
|
||||
if (Lynx_Rush_Timer <= diff)
|
||||
{
|
||||
@@ -503,7 +512,8 @@ class boss_zuljin : public CreatureScript
|
||||
return;
|
||||
}
|
||||
} //if (TankGUID)
|
||||
} else Lynx_Rush_Timer -= diff;
|
||||
}
|
||||
else Lynx_Rush_Timer -= diff;
|
||||
|
||||
break;
|
||||
case 4:
|
||||
@@ -511,14 +521,16 @@ class boss_zuljin : public CreatureScript
|
||||
{
|
||||
DoCast(me, SPELL_FLAME_WHIRL);
|
||||
Flame_Whirl_Timer = 12000;
|
||||
}Flame_Whirl_Timer -= diff;
|
||||
}
|
||||
Flame_Whirl_Timer -= diff;
|
||||
|
||||
if (Pillar_Of_Fire_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SUMMON_PILLAR);
|
||||
Pillar_Of_Fire_Timer = 10000;
|
||||
} else Pillar_Of_Fire_Timer -= diff;
|
||||
}
|
||||
else Pillar_Of_Fire_Timer -= diff;
|
||||
|
||||
if (Flame_Breath_Timer <= diff)
|
||||
{
|
||||
@@ -526,59 +538,60 @@ class boss_zuljin : public CreatureScript
|
||||
me->SetInFront(target);
|
||||
DoCast(me, SPELL_FLAME_BREATH);
|
||||
Flame_Breath_Timer = 10000;
|
||||
} else Flame_Breath_Timer -= diff;
|
||||
}
|
||||
else Flame_Breath_Timer -= diff;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!TankGUID)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_zuljinAI>(creature);
|
||||
if (!TankGUID)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_zuljinAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_zuljin_vortex : public CreatureScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
npc_zuljin_vortex()
|
||||
: CreatureScript("npc_zuljin_vortex")
|
||||
npc_zuljin_vortex()
|
||||
: CreatureScript("npc_zuljin_vortex")
|
||||
{
|
||||
}
|
||||
|
||||
struct npc_zuljin_vortexAI : public ScriptedAI
|
||||
{
|
||||
npc_zuljin_vortexAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*target*/) { }
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ZAP_INFORM)
|
||||
DoCast(caster, SPELL_ZAP_DAMAGE, true);
|
||||
}
|
||||
|
||||
struct npc_zuljin_vortexAI : public ScriptedAI
|
||||
void UpdateAI(uint32 /*diff*/)
|
||||
{
|
||||
npc_zuljin_vortexAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*target*/) { }
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ZAP_INFORM)
|
||||
DoCast(caster, SPELL_ZAP_DAMAGE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/)
|
||||
{
|
||||
//if the vortex reach the target, it change his target to another player
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0));
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_zuljin_vortexAI(creature);
|
||||
//if the vortex reach the target, it change his target to another player
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0));
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_zuljin_vortexAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_zuljin()
|
||||
|
||||
@@ -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_zulaman
|
||||
@@ -46,323 +46,359 @@ Position const HarrisonJonesLoc = {120.687f, 1674.0f, 42.0217f, 1.59044f};
|
||||
|
||||
class instance_zulaman : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_zulaman()
|
||||
: InstanceMapScript("instance_zulaman", 568)
|
||||
public:
|
||||
instance_zulaman()
|
||||
: InstanceMapScript("instance_zulaman", 568)
|
||||
{
|
||||
}
|
||||
|
||||
struct instance_zulaman_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint64 HarkorsSatchelGUID;
|
||||
uint64 TanzarsTrunkGUID;
|
||||
uint64 AshlisBagGUID;
|
||||
uint64 KrazsPackageGUID;
|
||||
uint64 StrangeGongGUID;
|
||||
uint64 HarrisonJonesGUID;
|
||||
|
||||
uint64 HexLordGateGUID;
|
||||
uint64 ZulJinGateGUID;
|
||||
uint64 MassiveGateGUID;
|
||||
uint64 AkilzonDoorGUID;
|
||||
uint64 ZulJinDoorGUID;
|
||||
uint64 HalazziDoorGUID;
|
||||
|
||||
uint32 QuestTimer;
|
||||
uint16 BossKilled;
|
||||
uint16 QuestMinute;
|
||||
uint16 ChestLooted;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 RandVendor[RAND_VENDOR];
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
HarkorsSatchelGUID = 0;
|
||||
TanzarsTrunkGUID = 0;
|
||||
AshlisBagGUID = 0;
|
||||
KrazsPackageGUID = 0;
|
||||
StrangeGongGUID = 0;
|
||||
HexLordGateGUID = 0;
|
||||
ZulJinGateGUID = 0;
|
||||
MassiveGateGUID = 0;
|
||||
AkilzonDoorGUID = 0;
|
||||
HalazziDoorGUID = 0;
|
||||
ZulJinDoorGUID = 0;
|
||||
|
||||
HarrisonJonesGUID = 0;
|
||||
|
||||
QuestTimer = 0;
|
||||
QuestMinute = 0;
|
||||
BossKilled = 0;
|
||||
ChestLooted = 0;
|
||||
|
||||
for (uint8 i = 0; i < RAND_VENDOR; ++i)
|
||||
RandVendor[i] = NOT_STARTED;
|
||||
|
||||
m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED;
|
||||
}
|
||||
|
||||
struct instance_zulaman_InstanceMapScript : public InstanceScript
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
uint64 HarkorsSatchelGUID;
|
||||
uint64 TanzarsTrunkGUID;
|
||||
uint64 AshlisBagGUID;
|
||||
uint64 KrazsPackageGUID;
|
||||
uint64 StrangeGongGUID;
|
||||
uint64 HarrisonJonesGUID;
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64 HexLordGateGUID;
|
||||
uint64 ZulJinGateGUID;
|
||||
uint64 MassiveGateGUID;
|
||||
uint64 AkilzonDoorGUID;
|
||||
uint64 ZulJinDoorGUID;
|
||||
uint64 HalazziDoorGUID;
|
||||
void OnPlayerEnter(Player* /*player*/)
|
||||
{
|
||||
if (!HarrisonJonesGUID)
|
||||
instance->SummonCreature(NPC_HARRISON_JONES, HarrisonJonesLoc);
|
||||
}
|
||||
|
||||
uint32 QuestTimer;
|
||||
uint16 BossKilled;
|
||||
uint16 QuestMinute;
|
||||
uint16 ChestLooted;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 RandVendor[RAND_VENDOR];
|
||||
|
||||
void Initialize()
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
HarkorsSatchelGUID = 0;
|
||||
TanzarsTrunkGUID = 0;
|
||||
AshlisBagGUID = 0;
|
||||
KrazsPackageGUID = 0;
|
||||
StrangeGongGUID = 0;
|
||||
HexLordGateGUID = 0;
|
||||
ZulJinGateGUID = 0;
|
||||
MassiveGateGUID = 0;
|
||||
AkilzonDoorGUID = 0;
|
||||
HalazziDoorGUID = 0;
|
||||
ZulJinDoorGUID = 0;
|
||||
|
||||
HarrisonJonesGUID = 0;
|
||||
|
||||
QuestTimer = 0;
|
||||
QuestMinute = 0;
|
||||
BossKilled = 0;
|
||||
ChestLooted = 0;
|
||||
|
||||
for (uint8 i = 0; i < RAND_VENDOR; ++i)
|
||||
RandVendor[i] = NOT_STARTED;
|
||||
|
||||
m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED;
|
||||
case NPC_HARRISON_JONES:
|
||||
HarrisonJonesGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_JANALAI:
|
||||
case NPC_ZULJIN:
|
||||
case NPC_HEXLORD:
|
||||
case NPC_HALAZZI:
|
||||
case NPC_NALORAKK:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
case GO_DOOR_HALAZZI:
|
||||
HalazziDoorGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_ZULJIN:
|
||||
ZulJinGateGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_HEXLORD:
|
||||
HexLordGateGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_MASSIVE_GATE:
|
||||
MassiveGateGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_DOOR_AKILZON:
|
||||
AkilzonDoorGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_DOOR_ZULJIN:
|
||||
ZulJinDoorGUID = go->GetGUID();
|
||||
break;
|
||||
|
||||
return false;
|
||||
case GO_HARKORS_SATCHEL:
|
||||
HarkorsSatchelGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_TANZARS_TRUNK:
|
||||
TanzarsTrunkGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_ASHLIS_BAG:
|
||||
AshlisBagGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_KRAZS_PACKAGE:
|
||||
KrazsPackageGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_STRANGE_GONG:
|
||||
StrangeGongGUID = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CheckInstanceStatus();
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* /*player*/)
|
||||
{
|
||||
if (!HarrisonJonesGUID)
|
||||
instance->SummonCreature(NPC_HARRISON_JONES, HarrisonJonesLoc);
|
||||
}
|
||||
void SummonHostage(uint8 num)
|
||||
{
|
||||
if (!QuestMinute)
|
||||
return;
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
Map::PlayerList::const_iterator i = PlayerList.begin();
|
||||
if (Player* i_pl = i->GetSource())
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
if (Unit* Hostage = i_pl->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0))
|
||||
{
|
||||
case NPC_HARRISON_JONES:
|
||||
HarrisonJonesGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_JANALAI:
|
||||
case NPC_ZULJIN:
|
||||
case NPC_HEXLORD:
|
||||
case NPC_HALAZZI:
|
||||
case NPC_NALORAKK:
|
||||
default:
|
||||
break;
|
||||
Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
void CheckInstanceStatus()
|
||||
{
|
||||
if (BossKilled >= DATA_HALAZZIEVENT)
|
||||
HandleGameObject(HexLordGateGUID, true);
|
||||
|
||||
if (BossKilled >= DATA_HEXLORDEVENT)
|
||||
HandleGameObject(ZulJinGateGUID, true);
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << "S " << BossKilled << ' ' << ChestLooted << ' ' << QuestMinute;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Load(const char* load)
|
||||
{
|
||||
if (!load)
|
||||
return;
|
||||
|
||||
std::istringstream ss(load);
|
||||
//sLog->outError("Zul'aman loaded, %s.", ss.str().c_str());
|
||||
char dataHead; // S
|
||||
uint16 data1, data2, data3;
|
||||
ss >> dataHead >> data1 >> data2 >> data3;
|
||||
//sLog->outError("Zul'aman loaded, %d %d %d.", data1, data2, data3);
|
||||
if (dataHead == 'S')
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_DOOR_HALAZZI: HalazziDoorGUID = go->GetGUID(); break;
|
||||
case GO_GATE_ZULJIN: ZulJinGateGUID = go->GetGUID(); break;
|
||||
case GO_GATE_HEXLORD: HexLordGateGUID = go->GetGUID(); break;
|
||||
case GO_MASSIVE_GATE: MassiveGateGUID = go->GetGUID(); break;
|
||||
case GO_DOOR_AKILZON: AkilzonDoorGUID = go->GetGUID(); break;
|
||||
case GO_DOOR_ZULJIN: ZulJinDoorGUID = go->GetGUID(); break;
|
||||
|
||||
case GO_HARKORS_SATCHEL: HarkorsSatchelGUID = go->GetGUID(); break;
|
||||
case GO_TANZARS_TRUNK: TanzarsTrunkGUID = go->GetGUID(); break;
|
||||
case GO_ASHLIS_BAG: AshlisBagGUID = go->GetGUID(); break;
|
||||
case GO_KRAZS_PACKAGE: KrazsPackageGUID = go->GetGUID(); break;
|
||||
case GO_STRANGE_GONG: StrangeGongGUID = go->GetGUID(); break;
|
||||
default: break;
|
||||
}
|
||||
CheckInstanceStatus();
|
||||
BossKilled = data1;
|
||||
ChestLooted = data2;
|
||||
QuestMinute = data3;
|
||||
}
|
||||
else sLog->outError("Zul'aman: corrupted save data.");
|
||||
}
|
||||
|
||||
void SummonHostage(uint8 num)
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
if (!QuestMinute)
|
||||
return;
|
||||
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
Map::PlayerList::const_iterator i = PlayerList.begin();
|
||||
if (Player* i_pl = i->GetSource())
|
||||
{
|
||||
if (Unit* Hostage = i_pl->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0))
|
||||
case DATA_GONGEVENT:
|
||||
m_auiEncounter[DATA_GONGEVENT] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
SaveToDB();
|
||||
else if (data == DONE)
|
||||
QuestMinute = 21;
|
||||
break;
|
||||
case DATA_NALORAKKEVENT:
|
||||
m_auiEncounter[DATA_NALORAKKEVENT] = data;
|
||||
if (data == DONE)
|
||||
{
|
||||
Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckInstanceStatus()
|
||||
{
|
||||
if (BossKilled >= DATA_HALAZZIEVENT)
|
||||
HandleGameObject(HexLordGateGUID, true);
|
||||
|
||||
if (BossKilled >= DATA_HEXLORDEVENT)
|
||||
HandleGameObject(ZulJinGateGUID, true);
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << "S " << BossKilled << ' ' << ChestLooted << ' ' << QuestMinute;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Load(const char* load)
|
||||
{
|
||||
if (!load)
|
||||
return;
|
||||
|
||||
std::istringstream ss(load);
|
||||
//sLog->outError("Zul'aman loaded, %s.", ss.str().c_str());
|
||||
char dataHead; // S
|
||||
uint16 data1, data2, data3;
|
||||
ss >> dataHead >> data1 >> data2 >> data3;
|
||||
//sLog->outError("Zul'aman loaded, %d %d %d.", data1, data2, data3);
|
||||
if (dataHead == 'S')
|
||||
{
|
||||
BossKilled = data1;
|
||||
ChestLooted = data2;
|
||||
QuestMinute = data3;
|
||||
} else sLog->outError("Zul'aman: corrupted save data.");
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_GONGEVENT:
|
||||
m_auiEncounter[DATA_GONGEVENT] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
SaveToDB();
|
||||
else if (data == DONE)
|
||||
QuestMinute = 21;
|
||||
break;
|
||||
case DATA_NALORAKKEVENT:
|
||||
m_auiEncounter[DATA_NALORAKKEVENT] = data;
|
||||
if (data == DONE)
|
||||
{
|
||||
if (QuestMinute)
|
||||
{
|
||||
QuestMinute += 15;
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute);
|
||||
}
|
||||
SummonHostage(0);
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_AKILZONEVENT:
|
||||
m_auiEncounter[DATA_AKILZONEVENT] = data;
|
||||
HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS);
|
||||
if (data == DONE)
|
||||
{
|
||||
if (QuestMinute)
|
||||
{
|
||||
QuestMinute += 10;
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute);
|
||||
}
|
||||
SummonHostage(1);
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_JANALAIEVENT:
|
||||
m_auiEncounter[DATA_JANALAIEVENT] = data;
|
||||
if (data == DONE)
|
||||
SummonHostage(2);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_HALAZZIEVENT:
|
||||
m_auiEncounter[DATA_HALAZZIEVENT] = data;
|
||||
HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS);
|
||||
if (data == DONE) SummonHostage(3);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_HEXLORDEVENT:
|
||||
m_auiEncounter[DATA_HEXLORDEVENT] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
HandleGameObject(HexLordGateGUID, false);
|
||||
else if (data == NOT_STARTED)
|
||||
CheckInstanceStatus();
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_ZULJINEVENT:
|
||||
m_auiEncounter[DATA_ZULJINEVENT] = data;
|
||||
HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_CHESTLOOTED:
|
||||
++ChestLooted;
|
||||
SaveToDB();
|
||||
break;
|
||||
case TYPE_RAND_VENDOR_1:
|
||||
RandVendor[0] = data;
|
||||
break;
|
||||
case TYPE_RAND_VENDOR_2:
|
||||
RandVendor[1] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
++BossKilled;
|
||||
if (QuestMinute && BossKilled >= DATA_HALAZZIEVENT)
|
||||
{
|
||||
QuestMinute = 0;
|
||||
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
|
||||
}
|
||||
CheckInstanceStatus();
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_GONGEVENT: return m_auiEncounter[DATA_GONGEVENT];
|
||||
case DATA_NALORAKKEVENT: return m_auiEncounter[DATA_NALORAKKEVENT];
|
||||
case DATA_AKILZONEVENT: return m_auiEncounter[DATA_AKILZONEVENT];
|
||||
case DATA_JANALAIEVENT: return m_auiEncounter[DATA_JANALAIEVENT];
|
||||
case DATA_HALAZZIEVENT: return m_auiEncounter[DATA_HALAZZIEVENT];
|
||||
case DATA_HEXLORDEVENT: return m_auiEncounter[DATA_HEXLORDEVENT];
|
||||
case DATA_ZULJINEVENT: return m_auiEncounter[DATA_ZULJINEVENT];
|
||||
case DATA_CHESTLOOTED: return ChestLooted;
|
||||
case TYPE_RAND_VENDOR_1: return RandVendor[0];
|
||||
case TYPE_RAND_VENDOR_2: return RandVendor[1];
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (QuestMinute)
|
||||
{
|
||||
if (QuestTimer <= diff)
|
||||
{
|
||||
QuestMinute--;
|
||||
SaveToDB();
|
||||
QuestTimer += 60000;
|
||||
if (QuestMinute)
|
||||
{
|
||||
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1);
|
||||
QuestMinute += 15;
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute);
|
||||
} else DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
|
||||
}
|
||||
SummonHostage(0);
|
||||
SaveToDB();
|
||||
}
|
||||
QuestTimer -= diff;
|
||||
}
|
||||
break;
|
||||
case DATA_AKILZONEVENT:
|
||||
m_auiEncounter[DATA_AKILZONEVENT] = data;
|
||||
HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS);
|
||||
if (data == DONE)
|
||||
{
|
||||
if (QuestMinute)
|
||||
{
|
||||
QuestMinute += 10;
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute);
|
||||
}
|
||||
SummonHostage(1);
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_JANALAIEVENT:
|
||||
m_auiEncounter[DATA_JANALAIEVENT] = data;
|
||||
if (data == DONE)
|
||||
SummonHostage(2);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_HALAZZIEVENT:
|
||||
m_auiEncounter[DATA_HALAZZIEVENT] = data;
|
||||
HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS);
|
||||
if (data == DONE) SummonHostage(3);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_HEXLORDEVENT:
|
||||
m_auiEncounter[DATA_HEXLORDEVENT] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
HandleGameObject(HexLordGateGUID, false);
|
||||
else if (data == NOT_STARTED)
|
||||
CheckInstanceStatus();
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_ZULJINEVENT:
|
||||
m_auiEncounter[DATA_ZULJINEVENT] = data;
|
||||
HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_CHESTLOOTED:
|
||||
++ChestLooted;
|
||||
SaveToDB();
|
||||
break;
|
||||
case TYPE_RAND_VENDOR_1:
|
||||
RandVendor[0] = data;
|
||||
break;
|
||||
case TYPE_RAND_VENDOR_2:
|
||||
RandVendor[1] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
if (data == DONE)
|
||||
{
|
||||
switch (type)
|
||||
++BossKilled;
|
||||
if (QuestMinute && BossKilled >= DATA_HALAZZIEVENT)
|
||||
{
|
||||
case GO_STRANGE_GONG:
|
||||
return StrangeGongGUID;
|
||||
case GO_MASSIVE_GATE:
|
||||
return MassiveGateGUID;
|
||||
QuestMinute = 0;
|
||||
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
|
||||
}
|
||||
CheckInstanceStatus();
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_GONGEVENT:
|
||||
return m_auiEncounter[DATA_GONGEVENT];
|
||||
case DATA_NALORAKKEVENT:
|
||||
return m_auiEncounter[DATA_NALORAKKEVENT];
|
||||
case DATA_AKILZONEVENT:
|
||||
return m_auiEncounter[DATA_AKILZONEVENT];
|
||||
case DATA_JANALAIEVENT:
|
||||
return m_auiEncounter[DATA_JANALAIEVENT];
|
||||
case DATA_HALAZZIEVENT:
|
||||
return m_auiEncounter[DATA_HALAZZIEVENT];
|
||||
case DATA_HEXLORDEVENT:
|
||||
return m_auiEncounter[DATA_HEXLORDEVENT];
|
||||
case DATA_ZULJINEVENT:
|
||||
return m_auiEncounter[DATA_ZULJINEVENT];
|
||||
case DATA_CHESTLOOTED:
|
||||
return ChestLooted;
|
||||
case TYPE_RAND_VENDOR_1:
|
||||
return RandVendor[0];
|
||||
case TYPE_RAND_VENDOR_2:
|
||||
return RandVendor[1];
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (QuestMinute)
|
||||
{
|
||||
if (QuestTimer <= diff)
|
||||
{
|
||||
QuestMinute--;
|
||||
SaveToDB();
|
||||
QuestTimer += 60000;
|
||||
if (QuestMinute)
|
||||
{
|
||||
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1);
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute);
|
||||
}
|
||||
else DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
|
||||
}
|
||||
QuestTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GO_STRANGE_GONG:
|
||||
return StrangeGongGUID;
|
||||
case GO_MASSIVE_GATE:
|
||||
return MassiveGateGUID;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_zulaman_InstanceMapScript(map);
|
||||
return 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_zulaman_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_zulaman()
|
||||
|
||||
@@ -36,7 +36,7 @@ enum ForestFrog
|
||||
SPELL_SUMMON_AMANI_CHARM_CHEST_2 = 43756, // Amani Charm Box (186734)
|
||||
SPELL_SUMMON_MONEY_BAG = 43774, // Money Bag (186736)
|
||||
SPELL_STEALTH_ = 34189,
|
||||
|
||||
|
||||
// Creatures
|
||||
NPC_FOREST_FROG = 24396,
|
||||
NPC_MANNUTH = 24397,
|
||||
@@ -116,235 +116,321 @@ enum ForestFrog
|
||||
|
||||
class npc_forest_frog : public CreatureScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
npc_forest_frog() : CreatureScript("npc_forest_frog") { }
|
||||
npc_forest_frog() : CreatureScript("npc_forest_frog") { }
|
||||
|
||||
struct npc_forest_frogAI : public ScriptedAI
|
||||
struct npc_forest_frogAI : public ScriptedAI
|
||||
{
|
||||
npc_forest_frogAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_forest_frogAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
uint8 eventTimer;
|
||||
uint64 PlayerGUID;
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
void MovementInform(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && data == POINT_DESPAWN)
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
if (eventTimer)
|
||||
{
|
||||
Player* player = me->GetMap()->GetPlayer(PlayerGUID);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 1:
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH: Talk(SAY_MANNUTH_0, player); break;
|
||||
case NPC_DEEZ: Talk(SAY_DEEZ_0, player); break;
|
||||
case NPC_GALATHRYN: Talk(SAY_GALATHRYN_0, player); break;
|
||||
case NPC_ADARRAH: Talk(SAY_ADARRAH_1, player); break;
|
||||
case NPC_DARWEN: Talk(SAY_DARWEN_0, player); break;
|
||||
case NPC_FUDGERICK: Talk(SAY_FUDGERICK_0, player); break;
|
||||
case NPC_GUNTER: Talk(SAY_GUNTER_0, player); break;
|
||||
case NPC_KYREN: Talk(SAY_KYREN_0, player); break;
|
||||
case NPC_MITZI: Talk(SAY_MITZI_0, player); break;
|
||||
case NPC_CHRISTIAN: Talk(SAY_CHRISTIAN_0, player); break;
|
||||
case NPC_BRENNAN: Talk(SAY_BRENNAN_0, player); break;
|
||||
case NPC_HOLLEE: Talk(SAY_HOLLEE_0, player); break;
|
||||
}
|
||||
eventTimer = 2;
|
||||
events.ScheduleEvent(eventTimer, urand(4000, 5000));
|
||||
break;
|
||||
case 2:
|
||||
if (me->GetEntry() != NPC_GUNTER && me->GetEntry() != NPC_KYREN) // vendors don't kneel?
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_MANNUTH_1, player);
|
||||
break;
|
||||
case NPC_DEEZ:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_DEEZ_1, player);
|
||||
break;
|
||||
case NPC_GALATHRYN:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_GALATHRYN_1, player);
|
||||
break;
|
||||
case NPC_ADARRAH:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_ADARRAH_2, player);
|
||||
break;
|
||||
case NPC_DARWEN:
|
||||
DoCast(me, SPELL_SUMMON_MONEY_BAG, true);
|
||||
me->LoadEquipment(0, true);
|
||||
Talk(SAY_DARWEN_1, player);
|
||||
break;
|
||||
case NPC_FUDGERICK:
|
||||
DoCast(me, SPELL_SUMMON_MONEY_BAG, true);
|
||||
me->LoadEquipment(0, true);
|
||||
Talk(SAY_FUDGERICK_1, player);
|
||||
break;
|
||||
case NPC_GUNTER:
|
||||
Talk(SAY_GUNTER_1, player);
|
||||
break;
|
||||
case NPC_KYREN:
|
||||
Talk(SAY_KYREN_1, player);
|
||||
break;
|
||||
case NPC_MITZI:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_MITZI_1, player);
|
||||
break;
|
||||
case NPC_CHRISTIAN:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_CHRISTIAN_1, player);
|
||||
break;
|
||||
case NPC_BRENNAN:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_BRENNAN_1, player);
|
||||
break;
|
||||
case NPC_HOLLEE:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_HOLLEE_1, player);
|
||||
break;
|
||||
}
|
||||
eventTimer = 3;
|
||||
events.ScheduleEvent(eventTimer, urand(6000, 7000));
|
||||
break;
|
||||
case 3:
|
||||
me->SetStandState(EMOTE_ONESHOT_NONE);
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH: Talk(SAY_MANNUTH_2, player); break;
|
||||
case NPC_DEEZ: Talk(SAY_DEEZ_2, player); break;
|
||||
case NPC_GALATHRYN: Talk(SAY_GALATHRYN_2, player); break;
|
||||
case NPC_ADARRAH: Talk(SAY_ADARRAH_3, player); break;
|
||||
case NPC_DARWEN: Talk(SAY_DARWEN_2, player); break;
|
||||
case NPC_FUDGERICK: Talk(SAY_FUDGERICK_2, player); break;
|
||||
case NPC_GUNTER: Talk(SAY_GUNTER_2, player); break;
|
||||
case NPC_KYREN: Talk(SAY_KYREN_2, player); break;
|
||||
case NPC_MITZI: Talk(SAY_MITZI_2, player); break;
|
||||
case NPC_CHRISTIAN: Talk(SAY_CHRISTIAN_2, player); break;
|
||||
case NPC_BRENNAN: Talk(SAY_BRENNAN_2, player); break;
|
||||
case NPC_HOLLEE: Talk(SAY_HOLLEE_2, player); break;
|
||||
}
|
||||
eventTimer = 4;
|
||||
if (me->GetEntry() == NPC_GUNTER || me->GetEntry() == NPC_KYREN)
|
||||
events.ScheduleEvent(eventTimer, 5*MINUTE*IN_MILLISECONDS); // vendors wait for 5 minutes before running away and despawning
|
||||
else
|
||||
events.ScheduleEvent(eventTimer, 6000);
|
||||
break;
|
||||
case 4:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH: Talk(SAY_MANNUTH_3, player); break;
|
||||
case NPC_DEEZ: Talk(SAY_DEEZ_3, player); break;
|
||||
case NPC_GALATHRYN: Talk(SAY_GALATHRYN_3, player); break;
|
||||
case NPC_ADARRAH: Talk(SAY_ADARRAH_4, player); break;
|
||||
case NPC_DARWEN: Talk(SAY_DARWEN_3, player); break;
|
||||
case NPC_FUDGERICK: Talk(SAY_FUDGERICK_3, player); break;
|
||||
case NPC_MITZI: Talk(SAY_MITZI_3, player); break;
|
||||
case NPC_CHRISTIAN: Talk(SAY_CHRISTIAN_3, player); break;
|
||||
case NPC_BRENNAN: Talk(SAY_BRENNAN_3, player); break;
|
||||
case NPC_HOLLEE: Talk(SAY_HOLLEE_3, player); break;
|
||||
}
|
||||
eventTimer = 5;
|
||||
events.ScheduleEvent(eventTimer, 2000);
|
||||
break;
|
||||
case 5:
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_ADARRAH:
|
||||
DoCast(me, SPELL_STEALTH_, true);
|
||||
break;
|
||||
}
|
||||
if (me->GetPositionY() > 1290.0f)
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESPAWN, 118.2742f, 1400.657f, -9.118711f);
|
||||
else
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESPAWN, 114.3155f, 1244.244f, -20.97606f);
|
||||
eventTimer = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoSpawnRandom()
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
uint32 cEntry = NPC_MANNUTH;
|
||||
switch (urand(0, 9))
|
||||
{
|
||||
case 1: cEntry = NPC_DEEZ; break;
|
||||
case 2: cEntry = NPC_GALATHRYN; break;
|
||||
case 3: cEntry = NPC_ADARRAH; break;
|
||||
case 4: cEntry = NPC_FUDGERICK; break;
|
||||
case 5: cEntry = NPC_DARWEN; break;
|
||||
case 6: cEntry = NPC_MITZI; break;
|
||||
case 7: cEntry = NPC_CHRISTIAN; break;
|
||||
case 8: cEntry = NPC_BRENNAN; break;
|
||||
case 9: cEntry = NPC_HOLLEE; break;
|
||||
}
|
||||
|
||||
if (!instance->GetData(TYPE_RAND_VENDOR_1) && roll_chance_i(10))
|
||||
{
|
||||
cEntry = NPC_GUNTER;
|
||||
instance->SetData(TYPE_RAND_VENDOR_1, DONE);
|
||||
}
|
||||
else if (!instance->GetData(TYPE_RAND_VENDOR_2) && roll_chance_i(10))
|
||||
{
|
||||
cEntry = NPC_KYREN;
|
||||
instance->SetData(TYPE_RAND_VENDOR_2, DONE);
|
||||
}
|
||||
|
||||
// start generic rp
|
||||
eventTimer = 1;
|
||||
events.ScheduleEvent(eventTimer, 3000);
|
||||
|
||||
me->UpdateEntry(cEntry);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == NPC_FOREST_FROG)
|
||||
{
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->SetFacingToObject(caster);
|
||||
PlayerGUID = caster->GetGUID();
|
||||
|
||||
if (roll_chance_i(2))
|
||||
{
|
||||
DoCast(caster, SPELL_PUSH_MOJO, true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESPAWN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||
}
|
||||
else
|
||||
DoSpawnRandom();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_forest_frogAI>(creature);
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
uint8 eventTimer;
|
||||
uint64 PlayerGUID;
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
void MovementInform(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && data == POINT_DESPAWN)
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
if (eventTimer)
|
||||
{
|
||||
Player* player = me->GetMap()->GetPlayer(PlayerGUID);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 1:
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH:
|
||||
Talk(SAY_MANNUTH_0, player);
|
||||
break;
|
||||
case NPC_DEEZ:
|
||||
Talk(SAY_DEEZ_0, player);
|
||||
break;
|
||||
case NPC_GALATHRYN:
|
||||
Talk(SAY_GALATHRYN_0, player);
|
||||
break;
|
||||
case NPC_ADARRAH:
|
||||
Talk(SAY_ADARRAH_1, player);
|
||||
break;
|
||||
case NPC_DARWEN:
|
||||
Talk(SAY_DARWEN_0, player);
|
||||
break;
|
||||
case NPC_FUDGERICK:
|
||||
Talk(SAY_FUDGERICK_0, player);
|
||||
break;
|
||||
case NPC_GUNTER:
|
||||
Talk(SAY_GUNTER_0, player);
|
||||
break;
|
||||
case NPC_KYREN:
|
||||
Talk(SAY_KYREN_0, player);
|
||||
break;
|
||||
case NPC_MITZI:
|
||||
Talk(SAY_MITZI_0, player);
|
||||
break;
|
||||
case NPC_CHRISTIAN:
|
||||
Talk(SAY_CHRISTIAN_0, player);
|
||||
break;
|
||||
case NPC_BRENNAN:
|
||||
Talk(SAY_BRENNAN_0, player);
|
||||
break;
|
||||
case NPC_HOLLEE:
|
||||
Talk(SAY_HOLLEE_0, player);
|
||||
break;
|
||||
}
|
||||
eventTimer = 2;
|
||||
events.ScheduleEvent(eventTimer, urand(4000, 5000));
|
||||
break;
|
||||
case 2:
|
||||
if (me->GetEntry() != NPC_GUNTER && me->GetEntry() != NPC_KYREN) // vendors don't kneel?
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_MANNUTH_1, player);
|
||||
break;
|
||||
case NPC_DEEZ:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_DEEZ_1, player);
|
||||
break;
|
||||
case NPC_GALATHRYN:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_GALATHRYN_1, player);
|
||||
break;
|
||||
case NPC_ADARRAH:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_2, true);
|
||||
Talk(SAY_ADARRAH_2, player);
|
||||
break;
|
||||
case NPC_DARWEN:
|
||||
DoCast(me, SPELL_SUMMON_MONEY_BAG, true);
|
||||
me->LoadEquipment(0, true);
|
||||
Talk(SAY_DARWEN_1, player);
|
||||
break;
|
||||
case NPC_FUDGERICK:
|
||||
DoCast(me, SPELL_SUMMON_MONEY_BAG, true);
|
||||
me->LoadEquipment(0, true);
|
||||
Talk(SAY_FUDGERICK_1, player);
|
||||
break;
|
||||
case NPC_GUNTER:
|
||||
Talk(SAY_GUNTER_1, player);
|
||||
break;
|
||||
case NPC_KYREN:
|
||||
Talk(SAY_KYREN_1, player);
|
||||
break;
|
||||
case NPC_MITZI:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_MITZI_1, player);
|
||||
break;
|
||||
case NPC_CHRISTIAN:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_CHRISTIAN_1, player);
|
||||
break;
|
||||
case NPC_BRENNAN:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_BRENNAN_1, player);
|
||||
break;
|
||||
case NPC_HOLLEE:
|
||||
DoCast(me, SPELL_SUMMON_AMANI_CHARM_CHEST_1, true);
|
||||
Talk(SAY_HOLLEE_1, player);
|
||||
break;
|
||||
}
|
||||
eventTimer = 3;
|
||||
events.ScheduleEvent(eventTimer, urand(6000, 7000));
|
||||
break;
|
||||
case 3:
|
||||
me->SetStandState(EMOTE_ONESHOT_NONE);
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH:
|
||||
Talk(SAY_MANNUTH_2, player);
|
||||
break;
|
||||
case NPC_DEEZ:
|
||||
Talk(SAY_DEEZ_2, player);
|
||||
break;
|
||||
case NPC_GALATHRYN:
|
||||
Talk(SAY_GALATHRYN_2, player);
|
||||
break;
|
||||
case NPC_ADARRAH:
|
||||
Talk(SAY_ADARRAH_3, player);
|
||||
break;
|
||||
case NPC_DARWEN:
|
||||
Talk(SAY_DARWEN_2, player);
|
||||
break;
|
||||
case NPC_FUDGERICK:
|
||||
Talk(SAY_FUDGERICK_2, player);
|
||||
break;
|
||||
case NPC_GUNTER:
|
||||
Talk(SAY_GUNTER_2, player);
|
||||
break;
|
||||
case NPC_KYREN:
|
||||
Talk(SAY_KYREN_2, player);
|
||||
break;
|
||||
case NPC_MITZI:
|
||||
Talk(SAY_MITZI_2, player);
|
||||
break;
|
||||
case NPC_CHRISTIAN:
|
||||
Talk(SAY_CHRISTIAN_2, player);
|
||||
break;
|
||||
case NPC_BRENNAN:
|
||||
Talk(SAY_BRENNAN_2, player);
|
||||
break;
|
||||
case NPC_HOLLEE:
|
||||
Talk(SAY_HOLLEE_2, player);
|
||||
break;
|
||||
}
|
||||
eventTimer = 4;
|
||||
if (me->GetEntry() == NPC_GUNTER || me->GetEntry() == NPC_KYREN)
|
||||
events.ScheduleEvent(eventTimer, 5 * MINUTE * IN_MILLISECONDS); // vendors wait for 5 minutes before running away and despawning
|
||||
else
|
||||
events.ScheduleEvent(eventTimer, 6000);
|
||||
break;
|
||||
case 4:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MANNUTH:
|
||||
Talk(SAY_MANNUTH_3, player);
|
||||
break;
|
||||
case NPC_DEEZ:
|
||||
Talk(SAY_DEEZ_3, player);
|
||||
break;
|
||||
case NPC_GALATHRYN:
|
||||
Talk(SAY_GALATHRYN_3, player);
|
||||
break;
|
||||
case NPC_ADARRAH:
|
||||
Talk(SAY_ADARRAH_4, player);
|
||||
break;
|
||||
case NPC_DARWEN:
|
||||
Talk(SAY_DARWEN_3, player);
|
||||
break;
|
||||
case NPC_FUDGERICK:
|
||||
Talk(SAY_FUDGERICK_3, player);
|
||||
break;
|
||||
case NPC_MITZI:
|
||||
Talk(SAY_MITZI_3, player);
|
||||
break;
|
||||
case NPC_CHRISTIAN:
|
||||
Talk(SAY_CHRISTIAN_3, player);
|
||||
break;
|
||||
case NPC_BRENNAN:
|
||||
Talk(SAY_BRENNAN_3, player);
|
||||
break;
|
||||
case NPC_HOLLEE:
|
||||
Talk(SAY_HOLLEE_3, player);
|
||||
break;
|
||||
}
|
||||
eventTimer = 5;
|
||||
events.ScheduleEvent(eventTimer, 2000);
|
||||
break;
|
||||
case 5:
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_ADARRAH:
|
||||
DoCast(me, SPELL_STEALTH_, true);
|
||||
break;
|
||||
}
|
||||
if (me->GetPositionY() > 1290.0f)
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESPAWN, 118.2742f, 1400.657f, -9.118711f);
|
||||
else
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESPAWN, 114.3155f, 1244.244f, -20.97606f);
|
||||
eventTimer = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoSpawnRandom()
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
uint32 cEntry = NPC_MANNUTH;
|
||||
switch (urand(0, 9))
|
||||
{
|
||||
case 1:
|
||||
cEntry = NPC_DEEZ;
|
||||
break;
|
||||
case 2:
|
||||
cEntry = NPC_GALATHRYN;
|
||||
break;
|
||||
case 3:
|
||||
cEntry = NPC_ADARRAH;
|
||||
break;
|
||||
case 4:
|
||||
cEntry = NPC_FUDGERICK;
|
||||
break;
|
||||
case 5:
|
||||
cEntry = NPC_DARWEN;
|
||||
break;
|
||||
case 6:
|
||||
cEntry = NPC_MITZI;
|
||||
break;
|
||||
case 7:
|
||||
cEntry = NPC_CHRISTIAN;
|
||||
break;
|
||||
case 8:
|
||||
cEntry = NPC_BRENNAN;
|
||||
break;
|
||||
case 9:
|
||||
cEntry = NPC_HOLLEE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!instance->GetData(TYPE_RAND_VENDOR_1) && roll_chance_i(10))
|
||||
{
|
||||
cEntry = NPC_GUNTER;
|
||||
instance->SetData(TYPE_RAND_VENDOR_1, DONE);
|
||||
}
|
||||
else if (!instance->GetData(TYPE_RAND_VENDOR_2) && roll_chance_i(10))
|
||||
{
|
||||
cEntry = NPC_KYREN;
|
||||
instance->SetData(TYPE_RAND_VENDOR_2, DONE);
|
||||
}
|
||||
|
||||
// start generic rp
|
||||
eventTimer = 1;
|
||||
events.ScheduleEvent(eventTimer, 3000);
|
||||
|
||||
me->UpdateEntry(cEntry);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == NPC_FOREST_FROG)
|
||||
{
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->SetFacingToObject(caster);
|
||||
PlayerGUID = caster->GetGUID();
|
||||
|
||||
if (roll_chance_i(2))
|
||||
{
|
||||
DoCast(caster, SPELL_PUSH_MOJO, true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESPAWN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||
}
|
||||
else
|
||||
DoSpawnRandom();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_forest_frogAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -358,80 +444,80 @@ static uint32 ChestEntry[] = {186648, 187021, 186672, 186667};
|
||||
|
||||
class npc_zulaman_hostage : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_zulaman_hostage() : CreatureScript("npc_zulaman_hostage") { }
|
||||
public:
|
||||
npc_zulaman_hostage() : CreatureScript("npc_zulaman_hostage") { }
|
||||
|
||||
struct npc_zulaman_hostageAI : public ScriptedAI
|
||||
struct npc_zulaman_hostageAI : public ScriptedAI
|
||||
{
|
||||
npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
IsLoot = false;
|
||||
}
|
||||
|
||||
bool IsLoot;
|
||||
uint64 PlayerGUID;
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
|
||||
player->SendLoot(me->GetGUID(), LOOT_CORPSE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (IsLoot)
|
||||
DoCast(me, 7, false);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_zulaman_hostageAI(creature);
|
||||
IsLoot = false;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
bool IsLoot;
|
||||
uint64 PlayerGUID;
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
|
||||
player->SendLoot(me->GetGUID(), LOOT_CORPSE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (IsLoot)
|
||||
DoCast(me, 7, false);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_zulaman_hostageAI(creature);
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
|
||||
return true;
|
||||
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
//uint8 progress = instance->GetData(DATA_CHESTLOOTED);
|
||||
instance->SetData(DATA_CHESTLOOTED, 0);
|
||||
float x, y, z;
|
||||
creature->GetPosition(x, y, z);
|
||||
uint32 entry = creature->GetEntry();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
//uint8 progress = instance->GetData(DATA_CHESTLOOTED);
|
||||
instance->SetData(DATA_CHESTLOOTED, 0);
|
||||
float x, y, z;
|
||||
creature->GetPosition(x, y, z);
|
||||
uint32 entry = creature->GetEntry();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (HostageEntry[i] == entry)
|
||||
{
|
||||
if (HostageEntry[i] == entry)
|
||||
{
|
||||
creature->SummonGameObject(ChestEntry[i], x-2, y, z, 0, 0, 0, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
creature->SummonGameObject(ChestEntry[i], x - 2, y, z, 0, 0, 0, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -677,7 +763,7 @@ public:
|
||||
}
|
||||
}
|
||||
else
|
||||
_gongTimer -= diff;
|
||||
_gongTimer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -690,29 +776,29 @@ public:
|
||||
|
||||
class spell_banging_the_gong : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_banging_the_gong() : SpellScriptLoader("spell_banging_the_gong") { }
|
||||
public:
|
||||
spell_banging_the_gong() : SpellScriptLoader("spell_banging_the_gong") { }
|
||||
|
||||
class spell_banging_the_gong_SpellScript : public SpellScript
|
||||
class spell_banging_the_gong_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_banging_the_gong_SpellScript);
|
||||
|
||||
void Activate(SpellEffIndex index)
|
||||
{
|
||||
PrepareSpellScript(spell_banging_the_gong_SpellScript);
|
||||
|
||||
void Activate(SpellEffIndex index)
|
||||
{
|
||||
PreventHitDefaultEffect(index);
|
||||
GetHitGObj()->SendCustomAnim(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_banging_the_gong_SpellScript();
|
||||
PreventHitDefaultEffect(index);
|
||||
GetHitGObj()->SendCustomAnim(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_banging_the_gong_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_zulaman()
|
||||
|
||||
Reference in New Issue
Block a user