Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "StdAfx.h"
- #include "Setup.h"
- #include "../Common/Base.h"
- #ifdef WIN32
- #pragma warning(disable:4305)
- #endif
- #define TRANCED 810017
- #define BOMB 91563
- #define PYROBLAST 101809
- #define FIREBALL 69583
- #define AE 33273
- class TRANCEDBOSSAI : public MoonScriptBossAI
- {
- public:
- MOONSCRIPT_FACTORY_FUNCTION(TRANCEDBOSSAI, MoonScriptBossAI);
- TRANCEDBOSSAI(Creature* pCreature) : MoonScriptBossAI(pCreature)
- {
- BOMB = AddSpell(BOMB, Target_Current, 20, 0, 10); //spell number, target of spell, percent chance to occur, cast time, cooldown
- PYROBLAST = AddSpell(PYROBLAST, Target_CURRENT, 40, 6, 10);
- AddPhaseSpell(2, AddSpell(FIREBALL, Target_Current, 20, 3, 7));
- AddPhaseSpell(3, AddSpell(AE, TARGET_DESTINATION, 30, 0, 6));
- AddEmote(Event_OnCombatStart, "Fools! You know not with what you intefere!", Text_Yell, 10292);
- AddEmote(Event_OnTargetDied, "You may win today, but my superiors will avenge me tomorrow!", Text_Yell, 10297);
- }
- }
- void OnCombatStart(Unit *pTarget) //sets up phase 1
- {
- if (BOMB != NULL)
- {
- BOMB->mChance = 20.0f;
- BOMB->mCooldown = 10;
- BOMB->mEnabled = true;
- }
- if (PYROBLAST != NULL)
- {
- PYROBLAST->mChance = 40.0f;
- PYROBLAST->mCooldown = 10;
- PYROBLAST->mEnabled = true;
- }
- ParentClass::OnCombatStart(pTarget);
- }
- void OnCombatStop(Unit* pTarget)
- {
- if(GetHealthPercent() >= 1)
- {
- sEventMgr.AddEvent(TO_UNIT(GetUnit()), &Unit::SendChatMessage (uint8)CHAT_MSG_MONSTER_YELL, (uint32)LANG_UNIVERSAL, "Long live Silent Requiem!", EVENT_UNIT_CHAT_MSG, 2000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
- sEventMgr.AddEvent(TO_OBJECT(GetUnit()), &Object::PlaySoundToSet, (uint32)10293, EVENT_UNK, 2000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
- GetUnit()->SetHealthPct(100);
- }
- ParentClass::OnCombatStop(pTarget);
- }
- void AIUpdate()
- {
- if(GetHealthPercent() <= 95 && GetPhase() == 1)
- {
- SetPhase(2);
- if (PYROBLAST != NULL)
- {
- PYROBLAST->mEnabled = false;
- PYROBLAST->mChance = 20.0f;
- }
- if (FIREBALL != NULL)
- {
- FIREBALL->mChance = 20.0f;
- FIREBALL->mEnabled = false;
- }
- }
- if(GetHealthPercent() <= 65 && GetPhase() == 2)
- {
- Emote("Your days are done!", Text_Yell, 10298);
- SetPhase(3);
- if (BOMB != NULL)
- {
- BOMB->mEnabled = false;
- }
- if (AE != NULL)
- {
- AE->mEnabled = true;
- AE->mChance = 30.0f;
- }
- }
- ParentClass::AIUpdate();
- }
- void SetupStratInstance(ScriptMgr * mgr)
- {
- mgr->register_creature_script(TRANCED, &TRANCEDBOSSAI::Create);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement