mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 11:03:47 +00:00
refactor(Scripts/RuinsOfAhnQiraj): Buru eggs (#12822)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
--
|
||||
UPDATE `creature` SET `spawntimesecs` = 120 WHERE `id1` = 15514;
|
||||
|
||||
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 29) AND (`SourceEntry` = 15514) AND (`SourceId` = 0) AND (`ConditionTypeOrReference` = 13);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(29, 0, 15514, 0, 0, 13, 0, 16, 2, 0, 1, 0, 0, '', 'Buru Egg spawn only if Buru is in egg phase.');
|
||||
@@ -4354,6 +4354,13 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_1].Effect = 0;
|
||||
});
|
||||
|
||||
// Explosion
|
||||
ApplySpellFix({ 5255 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
@@ -45,14 +45,13 @@ enum Events
|
||||
{
|
||||
EVENT_DISMEMBER = 1,
|
||||
EVENT_GATHERING_SPEED = 2,
|
||||
EVENT_CREEPING_PLAGUE = 3,
|
||||
EVENT_RESPAWN_EGG = 4,
|
||||
EVENT_CREEPING_PLAGUE = 3
|
||||
};
|
||||
|
||||
enum Phases
|
||||
{
|
||||
PHASE_EGG = 0,
|
||||
PHASE_TRANSFORM = 1
|
||||
PHASE_EGG = 1,
|
||||
PHASE_TRANSFORM = 2
|
||||
};
|
||||
|
||||
struct boss_buru : public BossAI
|
||||
@@ -65,8 +64,10 @@ struct boss_buru : public BossAI
|
||||
|
||||
DoCastSelf(SPELL_FULL_SPEED, true);
|
||||
|
||||
_phase = PHASE_EGG;
|
||||
instance->SetData(DATA_BURU_PHASE, _phase);
|
||||
|
||||
ManipulateEggs(true);
|
||||
_eggs.clear();
|
||||
}
|
||||
|
||||
void ManipulateEggs(bool respawn)
|
||||
@@ -83,11 +84,12 @@ struct boss_buru : public BossAI
|
||||
me->AddThreat(who, 1000000.f);
|
||||
Talk(EMOTE_TARGET, who);
|
||||
DoCastSelf(SPELL_THORNS);
|
||||
_phase = PHASE_EGG;
|
||||
instance->SetData(DATA_BURU_PHASE, _phase);
|
||||
ManipulateEggs(true);
|
||||
me->RemoveAurasDueToSpell(SPELL_FULL_SPEED);
|
||||
events.ScheduleEvent(EVENT_DISMEMBER, 5s);
|
||||
events.ScheduleEvent(EVENT_GATHERING_SPEED, 2s);
|
||||
_phase = PHASE_EGG;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
@@ -125,19 +127,9 @@ struct boss_buru : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid const guid, int32 /*type*/) override
|
||||
{
|
||||
_eggs.push_back(guid);
|
||||
events.ScheduleEvent(EVENT_RESPAWN_EGG, 120s);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
if (attacker->GetEntry() != NPC_BURU_EGG && _phase == PHASE_EGG)
|
||||
{
|
||||
damage = damage * 0.01f; // 99% dmg resist
|
||||
}
|
||||
else if (attacker->GetEntry() == NPC_BURU_EGG)
|
||||
if (attacker->GetEntry() == NPC_BURU_EGG)
|
||||
{
|
||||
me->LowerPlayerDamageReq(damage);
|
||||
}
|
||||
@@ -150,6 +142,7 @@ struct boss_buru : public BossAI
|
||||
me->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED);
|
||||
events.Reset();
|
||||
_phase = PHASE_TRANSFORM;
|
||||
instance->SetData(DATA_BURU_PHASE, _phase);
|
||||
DoResetThreat();
|
||||
events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 2s);
|
||||
DoCastSelf(SPELL_BURU_TRANSFORM);
|
||||
@@ -179,12 +172,6 @@ struct boss_buru : public BossAI
|
||||
DoCastAOE(SPELL_CREEPING_PLAGUE);
|
||||
events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 6s);
|
||||
break;
|
||||
case EVENT_RESPAWN_EGG:
|
||||
if (Creature* egg = me->GetMap()->GetCreature(*_eggs.begin()))
|
||||
egg->Respawn();
|
||||
|
||||
_eggs.pop_front();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -194,7 +181,6 @@ struct boss_buru : public BossAI
|
||||
}
|
||||
private:
|
||||
uint8 _phase;
|
||||
GuidList _eggs;
|
||||
};
|
||||
|
||||
struct npc_buru_egg : public ScriptedAI
|
||||
@@ -204,6 +190,7 @@ struct npc_buru_egg : public ScriptedAI
|
||||
_instance = me->GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetControlled(true, UNIT_STATE_STUNNED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* attacker) override
|
||||
@@ -238,14 +225,17 @@ struct npc_buru_egg : public ScriptedAI
|
||||
{
|
||||
if (Creature* buru = _instance->GetCreature(DATA_BURU))
|
||||
{
|
||||
DoCastSelf(SPELL_EXPLODE);
|
||||
DoCastSelf(SPELL_EXPLODE, true);
|
||||
DoCastSelf(SPELL_BURU_EGG_TRIGGER, true);
|
||||
buru->CastSpell(buru, SPELL_CREATURE_SPECIAL, true);
|
||||
if (buru->GetAI())
|
||||
buru->AI()->SetGUID(me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon(5000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override { }
|
||||
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
SetBossNumber(NUM_ENCOUNTER);
|
||||
LoadObjectData(creatureData, nullptr);
|
||||
_rajaxWaveCounter = 0;
|
||||
_buruPhase = 1;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
@@ -150,20 +151,35 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 /*data*/) override
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == DATA_RAJAXX_WAVE_ENGAGED)
|
||||
switch (type)
|
||||
{
|
||||
_scheduler.CancelGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
_scheduler.Schedule(2min, [this](TaskContext context)
|
||||
{
|
||||
CallNextRajaxxLeader();
|
||||
context.SetGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
context.Repeat();
|
||||
});
|
||||
case DATA_RAJAXX_WAVE_ENGAGED:
|
||||
_scheduler.CancelGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
_scheduler.Schedule(2min, [this](TaskContext context)
|
||||
{
|
||||
CallNextRajaxxLeader();
|
||||
context.SetGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
context.Repeat();
|
||||
});
|
||||
break;
|
||||
case DATA_BURU_PHASE:
|
||||
_buruPhase = data;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
if (type == DATA_BURU_PHASE)
|
||||
return _buruPhase;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit) override
|
||||
{
|
||||
if (Creature* creature = unit->ToCreature())
|
||||
@@ -362,6 +378,7 @@ public:
|
||||
ObjectGuid _andorovGUID;
|
||||
GuidVector _sandVortexes;
|
||||
uint32 _rajaxWaveCounter;
|
||||
uint8 _buruPhase;
|
||||
TaskScheduler _scheduler;
|
||||
};
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ enum DataTypes
|
||||
DATA_ZERRAN = 14,
|
||||
DATA_ANDOROV = 15,
|
||||
|
||||
DATA_BURU_PHASE = 16,
|
||||
|
||||
DATA_ENGAGED_FORMATION = 1
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user