Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************
- * Scripted by Jinung
- * for Shindo'Rei
- * Core 4.0.6
- *
- * The Bastion of Twilight
- * boss_halfus - Halfus Wyrmbreaker
- *
- ***********************/
- #include"ScriptPCH.h"
- #include"WorldPacket.h"
- #include"bastion_of_wilight.h"
- #include"ScriptMgr.h"
- #include"ScriptedCreature.h"
- #include"SpellScript.h"
- #include"SpellAuraEffects.h"
- #include"Unit.h"
- enum Spells
- {
- Frienzied = 83693, //Marche
- Frienziedhm = 86161, //A TEST
- Shadow = 38627, //Marche
- Shadowhm = 86167, //A TEST (ou test 86168)
- Barrage = 83721, //Spell scripted (A TEST)
- Scorching = 86164, //Spell scripted (A TEST)
- Firebalz = 61909, //Spell scripted (A TEST)
- Roar = 86170, //Spell scripted (A TEST)
- Malevolent = 39171, //Marche
- Malevolenthm = 86158, //A TEST
- Berzerk = 26662, //Marche
- Unresponsive = 86022, //Marche
- Stone = 83603, //Marche
- Poison = 83609, //A TEST
- Barrageanim = 83720, //Marche
- Netherblind = 83611, //A TEST
- Cyclonewind = 84092, //A TEST
- Aoe_Flames = 74040, //Marche
- };
- enum NPC
- {
- mob_proto = 44687, //Add du boss (Toujours présent)
- mob_storm = 44650,
- mob_slate = 44652,
- mob_nether = 44645,
- mob_time = 44797,
- mob_emerald = 44641,
- mobs_scorching = 987654322, //custom
- };
- enum VAR
- {
- uint32 Hftimer;
- uint32 Hfspecial;
- uint32 Hfvar;
- Hfvar = 0;
- Hftimer = 0;
- };
- class boss_halfus_wyrmbreacker : public CreatureScript
- {
- public:
- boss_halfus_wyrmbreacker() : CreatureScript("boss_halfus_wyrmbreacker"){}
- CreatureAI* GetAI(Creature* pCreature) const
- {
- return new boss_halfus_wyrmbreackerAI(pCreature);
- }
- struct boss_halfus_wyrmbreackerAI : public ScriptedAI
- {
- //imperatif a chaque Boss
- boss_halfus_wyrmbreackerAI(Creature* pCreature) : ScriptedAI(pCreature)
- {
- pMap = me->GetMap();
- pInstance = pCreature->GetInstanceScript();
- }
- InstanceScript *pInstance;
- bool check_in;
- Map* pMap;
- uint32 Shadow_timer;
- uint32 Berzerk_timer;
- uint32 roar_timer;
- uint32 Stone_timer;
- uint32 Phase;
- //Fonction Reset
- void Reset()
- {
- ///Coordonnée Spawn à implémenter: X=-295.889069 Y=-718.576355 Z=888.086852 (DU BOSS ! IMPORTANT!!!!)
- // les DATA sont dans le .h de l'instance
- if (pInstance && (pInstance->GetData(DATA_HALFUS) != DONE && !check_in))
- pInstance->SetData(DATA_HALFUS, NOT_STARTED);
- check_in = false;
- ///////////////////////////////////////////////////////////////////
- // HEALTH! //Lichen -> Formule DB!!!
- // 32,356,000 (10-player mode)
- // 51,530,000 (10-player Heroic mode)
- // 115,950,000 (25-player mode)
- // 184,667,000 (25-player Heroic mode)
- ////////////////////////////////////////////////////////////////////
- me->SummonCreature(mob_storm , -279.158752, -662.997131, 888.090454, 1.0f);
- me->SummonCreature(mob_slate , -276.262177, -695.767517, 888.086853, 1.0f);
- me->SummonCreature(mob_nether, -334.892822, -699.750183, 888.103699, 1.0f);
- me->SummonCreature(mob_time , -325.493347, -730.392883, 888.086975, 1.0f);
- me->SummonCreature(mob_emerald , -342.414001, -722.228943, 888.092773, 1.0f);
- me->SummonCreature(mob_proto , -278.409760, -719.387512, 903.714539, 1.0f);
- roar_timer = 1000000000000000000000000;
- Berzerk_timer = 360000; //6 min to enrage || repoussé à 8 min si vraiment trop "dure"
- //Raid en mode NORMAL!!!
- if(GetDifficulty() = RAID_DIFFICULTY_10MAN_NORMAL || GetDifficulty() = RAID_DIFFICULTY_25MAN_NORMAL)
- {
- switch(urand(1,10)) //10 events différents (3 dragons réveillé sur 5 en nm)
- {
- if(IsHeroic())
- {
- return;
- }
- case 1: mob_storm_rider->Docast(Unresponsive, true);
- mob_slate_dragon->Docast(Unresponsive, true);
- Shadow_timer = 1000000000000000000; //inf
- Stone_timer = 1000000000000000000;
- DoCast(me, Netherblind, true);
- break;
- case 2: mob_storm_rider->Docast(Unresponsive, true);
- mob_nether_scion->Docast(Unresponsive, true);
- //
- Shadow_timer = 1000000000000000000;
- Stone_timer = 35000;
- //
- //
- break;
- case 3: mob_storm_rider->DoCast(Unresponsive, true);
- mob_time_warden->Docast(Unresponsive, true);
- //
- Shadow_timer = 1000000000000000000;
- Stone_timer = 35000;
- DoCast(me, Netherblind, true);
- //
- break;
- case 4: mob_storm_rider->Docast(Unresponsive, true);
- mob_orphaned_whelp->Docast(Unresponsive, true);
- //
- Shadow_timer = 1000000000000000000;
- Stone_timer = 35000;
- DoCast(me, Netherblind, true);
- break;
- case 5: mob_nether_scion->Docast(Unresponsive, true);
- mob_slate_dragon->Docast(Unresponsive, true);
- //
- Shadow_timer = 12000;
- Stone_timer = 1000000000000000000;
- DoCast(me, Cyclonewind, true);
- break;
- case 6: mob_time_warden->Docast(Unresponsive, true);
- mob_slate_dragon->Docast(Unresponsive, true);
- //
- Shadow_timer = 12000;
- Stone_timer = 1000000000000000000;
- DoCast(me, Netherblind, true);
- DoCast(me, Cyclonewind, true);
- break;
- case 7: mob_orphaned_whelp->Docast(Unresponsive, true);
- mob_slate_dragon->Docast(Unresponsive, true);
- //
- Shadow_timer = 12000;
- Stone_timer = 1000000000000000000;
- DoCast(me, Netherblind, true);
- DoCast(me, Cyclonewind, true);
- break;
- case 8: mob_nether_scion->Docast(Unresponsive, true);
- mob_orphaned_whelp->Docast(Unresponsive, true);
- //
- Shadow_timer = 12000;
- Stone_timer = 35000;
- DoCast(me, Cyclonewind, true);
- //
- break;
- case 9: mob_orphaned_whelp->Docast(Unresponsive, true);
- mob_time_warden->Docast(Unresponsive, true);
- //
- Shadow_timer = 12000;
- Stone_timer = 35000;
- DoCast(me, Netherblind, true);
- DoCast(me, Cyclonewind, true);
- break;
- case 10: mob_nether_scion->DoCast(Unresponsive, true);
- mob_time_warden->DoCast(Unresponsive, true);
- //
- Shadow_timer = 12000;
- Stone_timer = 35000;
- DoCast(me, Cyclonewind, true);
- //
- break;
- }
- }
- else //RAID EN MODE HEROÏQUE!
- {
- Shadow_timer = 12000;
- Stone_timer = 35000;
- DoCast(me, Cyclonewind, true);
- DoCast(me, Netherblind, true);
- }
- Phase = 1
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_SILENCE, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CHARM, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true); //Prot
- me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); //Prot
- }
- void KilledUnit(Unit* /*Killed*/)
- {
- switch(urand(0,1))
- {
- case 0:me->MonsterYell("The burden of the damned falls upon you!",LANG_UNIVERSAL,NULL);
- break;
- case 1:me->MonsterYell("The wyrms will eat well tonight! ",LANG_UNIVERSAL,NULL);
- break;
- }
- }
- void JustDied(Unit* /*Kill*/)
- {
- switch(urand(1,1000))
- {
- default:me->MonsterYell("Flesh and sinew, weak but proud. Dare they part the Master's shroud? They stumble fumble groping blind, Finding fate and chaos intertwined.",LANG_UNIVERSAL,NULL);
- break;
- case 666:me->MonsterYell("Jinung est-ce toi?",LANG_UNIVERSAL,NULL);
- break;
- }
- if (pInstance)
- pInstance->SetData(DATA_HALFUS, DONE);
- if(Hfspecial = 1) //Hf id = 5300
- {
- Map::PlayerList const &players = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- itr->getSource()->CompletedAchievement(5300);
- }
- if (GetDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL && GetDifficulty() != RAID_DIFFICULTY_25MAN_NORMAL) //Achievement en hero UNIQUEMENT
- {
- AchievementEntry const *AchievHero = GetAchievementStore()->LookupEntry(5118);
- if (AchievHero)
- {
- if (pMap && pMap->IsRaid())
- {
- Map::PlayerList const &players = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- itr->getSource()->CompletedAchievement(AchievHero);
- }
- }
- }
- }
- void EnterCombat(Unit* /*Ent*/)
- {
- me->MonsterYell("Cho'gall will have your heads! ALL OF THEM!",LANG_UNIVERSAL,NULL);
- if (pInstance)
- pInstance->SetData(DATA_HALFUS, IN_PROGRESS);
- DoZoneInCombat();
- mob_proto_behemoth->DoZoneInCombat(); //Marche?
- }
- //Fonction Update
- void UpdateAI(const uint32 uiDiff)
- {
- if (!UpdateVictim())
- return;
- //Malevolent en 4 modes
- if(mob_slate_dragon->HasAura(86022, false) && mob_slate_draon->IsAlive())
- { if(IsHeroic())
- {
- DoCast(me, Malevolenthm, true);
- }
- else
- DoCast(me, Malevolent, true);
- }
- if(mob_nether_scion->HasAura(86022, false) && mob_nether_scion->IsAlive())
- {
- if(IsHeroic())
- {
- DoCast(me, Frienziedhm, true);
- }
- else
- DoCast(me, Frienzied, true);
- }
- if(mob_nether_scion->HasAura(86022, false))
- {
- DoCast(me, Netherblind, true); //A TEST
- }
- if(mob_storm_rider->HasAura(86022, false))
- {
- DoCast(me, Cyclonewind, true); //A TEST
- }
- //Shadow
- if(Shadow_timer <= uiDiff)
- {
- if(IsHeroic())
- DoCast(me, Shadowhm, true);
- else
- DoCast(me, Shadow, true);
- }
- else
- Shadow_timer -= uiDiff;
- if(Stone_timer <= uiDiff)
- {
- DoCast(me, Stone, true);
- }
- else
- Stone_timer -= uiDiff;
- //Phases
- if(me->GetHealthPct() <= 50 && Phase = 1)
- {
- Phase = 2;
- }
- if(Phase = 2)
- {
- roar_timer = 27000; //27s à ajuster!
- }
- if(Berzerk_timer <= uiDiff)
- {
- DoCast(me, Berz);
- }
- else
- Berzerk_timer -= uiDiff;
- DoMeleeAttackIfReady();
- }
- };
- };
- class mob_storm_rider : public CreatureScript
- {
- public:
- mob_storm_rider() : CreatureScript("mob_storm_rider") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_storm_riderAI (creature);
- }
- struct mob_storm_riderAI : public ScriptedAI
- {
- mob_storm_riderAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Notinevent;
- void Reset()
- {
- if(me->HasAura(86022, true))
- Notinevent = 1;
- }
- void EnterCombat(Unit* /*pWho*/)
- {
- if(Notinevent = 1)
- {
- me->DespawnOrUnsummon();
- }
- boss_halfus_wyrmbreacker->DoZoneInCombat();
- }
- void JustDied(Unit* /*Killer*/)
- {
- if(Hfvar = 1 && Hftimer <= 10000)
- Hfspecial = 1;
- else
- Hftimer = 10000;
- }
- void UpdateAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- return;
- if(me->HasAura(86022, true))
- Notinevent = 1;
- if(Hftimer <= 10000)
- Hfvar = 1;
- else
- {
- Hftimer -= Diff;
- Hfvar = 0;
- }
- DoMeleeAttackIfReady();
- }
- };
- };
- class mob_slate_dragon : public CreatureScript
- {
- public:
- mob_slate_dragon() : CreatureScript("mob_slate_dragon") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_slate_dragonAI (creature);
- }
- struct mob_slate_dragonAI : public ScriptedAI
- {
- mob_slate_dragonAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Notinevent;
- uint32 Hftimer;
- uint32 Hfspecial;
- void Reset()
- {
- if(me->HasAura(86022, true))
- Notinevent = 1;
- }
- void EnterCombat(Unit* /*pWho*/)
- {
- boss_halfus_wyrmbreacker->DoZoneInCombat();
- if(Notinevent = 1)
- {
- me->DespawnOrUnsummon();
- }
- }
- void JustDied(Unit* /*Killer*/)
- {
- if(Hfvar = 1 && Hftimer <= 10000)
- Hfspecial = 1;
- else
- Hftimer = 10000;
- }
- void UpdateAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- return;
- if(me->HasAura(86022, true))
- Notinevent = 1;
- if(Hftimer <= 10000)
- Hfvar = 1;
- else
- {
- Hftimer -= Diff;
- Hfvar = 0;
- }
- DoMeleeAttackIfReady();
- }
- };
- };
- class mob_orphaned_whelp : public CreatureScript
- {
- public:
- mob_orphaned_whelp() : CreatureScript("mob_orphaned_whelp") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_orphaned_whelpAI (creature);
- }
- struct mob_orphaned_whelpAI : public ScriptedAI
- {
- mob_orphaned_whelpAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Notinevent;
- uint32 Hftimer;
- uint32 Hfspecial;
- void Reset()
- {
- if(me->HasAura(86022, true))
- Notinevent = 1;
- }
- void EnterCombat(Unit* /*pWho*/)
- {
- if(Notinevent = 1)
- {
- me->DespawnOrUnsummon();
- }
- boss_halfus_wyrmbreacker->DoZoneInCombat();
- }
- void JustDied(Unit* /*Killer*/)
- {
- if(Hfvar = 1 && Hftimer <= 10000)
- Hfspecial = 1;
- else
- Hftimer = 10000;
- }
- void UpdateAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- return;
- if(me->HasAura(86022, true))
- Notinevent = 1;
- if(Hftimer <= 10000)
- Hfvar = 1;
- else
- {
- Hftimer -= Diff;
- Hfvar = 0;
- }
- DoMeleeAttackIfReady();
- }
- };
- };
- class mob_time_warden : public CreatureScript
- {
- public:
- mob_time_warden() : CreatureScript("mob_time_warden") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_time_wardenAI (creature);
- }
- struct mob_time_wardenAI : public ScriptedAI
- {
- mob_time_wardenAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Notinevent;
- uint32 Hftimer;
- uint32 Hfspecial;
- void Reset()
- {
- if(me->HasAura(86022, true))
- Notinevent = 1;
- }
- void EnterCombat(Unit* /*pWho*/)
- {
- if(Notinevent = 1)
- {
- me->DespawnOrUnsummon();
- }
- boss_halfus_wyrmbreacker->DoZoneInCombat();
- }
- void JustDied(Unit* /*Killer*/)
- {
- if(Hfvar = 1 && Hftimer <= 10000)
- Hfspecial = 1;
- else
- Hftimer = 10000;
- }
- void UpdateAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- return;
- if(me->HasAura(86022, true))
- Notinevent = 1;
- if(Hftimer <= 10000)
- Hfvar = 1;
- else
- {
- Hftimer -= Diff;
- Hfvar = 0;
- }
- DoMeleeAttackIfReady();
- }
- };
- };
- class mob_nether_scion : public CreatureScript
- {
- public:
- mob_nether_scion() : CreatureScript("mob_nether_scion") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_nether_scionAI (creature);
- }
- struct mob_nether_scionAI : public ScriptedAI
- {
- mob_nether_scionAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Notinevent;
- uint32 Hftimer;
- uint32 Hfspecial;
- void Reset()
- {
- if(me->HasAura(86022, true))
- Notinevent = 1;
- }
- void EnterCombat(Unit* /*pWho*/)
- {
- if(Notinevent = 1)
- {
- me->DespawnOrUnsummon();
- }
- boss_halfus_wyrmbreacker->DoZoneInCombat();
- }
- void JustDied(Unit* /*Killer*/)
- {
- if(Hfvar = 1 && Hftimer <= 10000)
- Hfspecial = 1;
- else
- Hftimer = 10000;
- }
- void UpdateAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- return;
- if(me->HasAura(86022, true))
- Notinevent = 1;
- if(Hftimer <= 10000)
- Hfvar = 1;
- else
- {
- Hftimer -= Diff;
- Hfvar = 0;
- }
- DoMeleeAttackIfReady();
- }
- };
- };
- class mob_proto_behemoth : public CreatureScript
- {
- public:
- mob_proto_behemoth() : CreatureScript("mob_proto_behemoth") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- pMap = me->GetMap();
- return new mob_proto_behemothAI (creature);
- }
- Map* pMap;
- uint32 Barrage_timer;
- uint32 Scorching_timer;
- uint32 Firebalz_timer;
- uint32 alreadydone;
- struct mob_proto_behemothAI : public ScriptedAI
- {
- mob_proto_behemothAI(Creature* creature) : ScriptedAI(creature) { }
- void Reset()
- {
- if(mob_time_warden->HasAura(86022, true))
- {
- Barrage_timer = 100000000000000000;
- }
- else
- Barrage_timer = 10000;
- if(mob_orphaned_whelp->HasAura(86022, true))
- {
- Scorching_timer = 100000000000000000;
- }
- else
- Scorching_timer = 20000;
- Firebalz_timer = 9000;
- }
- void EnterCombat(Unit* /*pWho*/)
- {
- DoZoneInCombat();
- boss_halfus_wyrmbreacker->DoZoneInCombat();
- }
- void JustDied(Unit* /*Killer*/)
- {
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if(Firebalz_timer <= uiDiff)
- { Unit* ptarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 5000, true);
- DoCast(ptarget, spell_damagecompensator, true);
- }
- else
- Firebalz_timer -= uiDiff;
- if(Scorching_timer <= uiDiff)
- {
- me->SummonCreature(mob_scorching , -320.712708 , --683.584473, 888.100525, 1.0f);
- }
- else
- Scorching_timer -= uiDiff;
- if(Barrage_timer <= uiDiff)
- {
- Map::PlayerList const &players = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); +2itr)
- {
- DoCast(itr, Barrageanim, true);
- for(uint32 i = 0, i <= 900, i++) //Attente de l'anime
- {
- //Nothing
- }
- DoCast(itr, Barrage, true);
- }
- }
- else
- Barrage_timer -= uiDiff;
- if(me->IsAlive(true))
- { if(alreadydone = 0)
- { if(mob_emerald->IsAlive())
- for(uint i = 0, i <6, i++)
- DoCast(me, Poison, true);
- alreadydone = 1
- }
- // Map::CreatureList const &players = pMap->GetCreature(mob_orphaned_whelp);
- // for (Map::CreatureList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- // {
- // DoCast(me, Poison, true);
- // alreadydone = 1
- // }
- }
- //Don't melee or range (IMPORTANT)
- }
- };
- };
- class spell_damagecompensator : public SpellScriptLoader
- {
- public:
- spell_damagecompensator() : SpellScriptLoader("spell_damagecompensator") { }
- class spell_damagecompensator_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_damagecompensator_AuraScript)
- enum Spells
- {
- Firebalz = 61909,
- };
- bool Load()
- {
- //Si caster = player, ne s'active pas.
- if (Unit * caster = GetCaster())
- if (caster->GetTypeId() == TYPEID_PLAYER)
- return false;
- return true;
- }
- void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- Unit * caster = GetCaster();
- Unit *ptarget = caster->SelectTarget(SELECT_TARGET_RANDOM, 0, 5000);
- DoCast(ptarget, Firebalz, true);
- caster->DealDamage(ptarget, urand(16000, 23000));
- }
- void Register()
- {
- OnEffectApply += AuraEffectApplyFn(spell_damagecompensator_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- }
- };
- AuraScript *GetAuraScript() const
- {
- return new spell_damagecompensator_AuraScript();
- }
- };
- class spell_roardamage : public SpellScriptLoader
- {
- public:
- spell_roardamage() : SpellScriptLoader("spell_roardamage") { }
- AuraScript *GetAuraScript() const
- {
- pMap = me->GetMap();
- return new spell_roardamage_AuraScript();
- }
- class spell_roardamage_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_roardamage_AuraScript)
- Map* pMap;
- enum Spells
- {
- // SPELL_X = ,
- };
- bool Load()
- {
- //Si caster = player, ne s'active pas.
- if (Unit * caster = GetCaster())
- if (caster->GetTypeId() == TYPEID_PLAYER)
- return false;
- return true;
- }
- void HandleEffectCalcAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & canBeRecalculated)
- {
- sLog->outString("Amount of Aura Effect is being calculated now!");
- // we're setting amount to 3
- amount = 3;
- // amount will be never recalculated
- canBeRecalculated = false;
- }
- void HandleEffectCalcPeriodic(AuraEffect const * /*aurEff*/, bool & isPeriodic, int32 & amplitude)
- {
- sLog->outString("Periodic data of Aura Effect is being calculated now!");
- // we're setting aura to be periodic and tick every 2 seconds
- isPeriodic = true;
- amplitude = 1600;
- }
- void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
- {
- Map *pMap;
- if(IsHeroic())
- {
- Unit * caster = GetCaster();
- Map::PlayerList const &players = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- {
- DealDamage(itr, urand(9500, 10500));
- itr->KnockBackFrom(caster->GetPositionX(), caster->GetPositionY(), 25.0, 25.0); //Speed à régler 5.0 = xy ; 2.0 = z
- itr->ApplyAura(SPELL_AURA_MOD_STUN, 2000, true); //Stun 2s
- }
- return;
- }
- else
- {
- Unit * caster = GetCaster();
- Map::PlayerList const &players = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- {
- DealDamage(itr, urand(7600, 8400));
- itr->KnockBackFrom(caster->GetPositionX(), caster->GetPositionY(), 25.0, 25.0); //Speed à régler 5.0 = xy ; 2.0 = z
- itr->ApplyAura(SPELL_AURA_MOD_STUN, 2000, true); //Stun 2s
- }
- return;
- }
- }
- void Register()
- {
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_roardamage_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_roardamage_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_DUMMY);
- DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_roardamage_AuraScript::HandleEffectCalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
- }
- };
- };
- class mobs_scorching : public CreatureScript
- {
- public:
- mobs_scorching() : CreatureScript("mobs_scorching") { }
- CreatureAI* GetAI(Creature* creature) const
- { pMap = me->GetMap();
- return new mobs_scorchingAI (creature);
- }
- struct mobs_scorchingAI : public ScriptedAI
- {
- mobs_scorchingAI(Creature* creature) : ScriptedAI(creature) { }
- Map* pMap;
- uint32 Aoe_Flames_timer;
- uint32 Spawn_timer;
- void Reset()
- {
- Aoe_Flames_timer = 1000;
- Spawn_timer = 5250;
- }
- void EnterCombat(Unit* /*pWho*/) { }
- void JustDied(Unit* /*Killer*/) { }
- void UpdateAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- return;
- if(Aoe_Flames_timer <= Diff)
- {
- Map::PlayerList const &players = pMap->GetPlayers();
- for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); +2itr)
- {
- if(me->IsWithinDistInMap(itr->getSource(), 20.0f))
- {
- DoCast(itr, Aoe_Flames, true)
- }
- }
- }
- else Aoe_Flames_timer -= Diff;
- if(Spawn_timer <= Diff)
- {
- me->DespawnOrUnsummon();
- }
- else Spawn_timer -= uiDiff;
- //Do not attack
- }
- };
- };
- void AddSC_boss_halfus_wyrmbreacker()
- {
- new boss_halfus_wyrmbreacker();
- new mob_storm_rider();
- new mob_slate_dragon();
- new mob_nether_scion();
- new mob_orphaned_whelp();
- new mob_time_warden();
- new mob_proto_behemoth();
- new spell_damagecompensator();
- new spell_roardamage();
- new mobs_scorching();
- }
Add Comment
Please, Sign In to add comment