Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "StdAfx.h" //This uses the existing functions in Arc's Core
- #include "Setup.h" //So does this
- #include "..\Common\base.h" // This is used to include the ArcAI engine commands
- #ifdef WIN32 //This is our structure
- #pragma warning(disable:4305) //This disables an annoying error that may pop up while compiling
- #endif
- //Marcus The Damned
- #define MARCUS 100008 //This is the entry number of the good captain
- //Everything below this is his ability ID numbers.
- #define MARCUS_VOID_ZONES 30533
- #define MARCUS_SHADOW_BOLT 30505
- #define MARCUS_BURNING_SHADOWS 40739
- #define MARCUS_SHADOW_PRISON 40647
- #define MARCUS_SHADOW_NOVA 44984
- #define MARCUS_DISPERSE 47585
- //Aditional NPC's
- #define KING_WYRNN 100007
- class MarcusBossAI : public ArcScriptBossAI
- {
- public:
- ARCSCRIPT_FACTORY_FUNCTION(MarcusBossAI, ArcScriptBossAI);
- MarcusBossAI(Creature* pCreature) : ArcScriptBoss(pCreature)
- {
- marcusVoidZones = AddSpell(MARCUS_VOID_ZONES, Target_RandomPlayer, 33, 4, 20);
- marcusShadowBolt = AddSpell(MARCUS_SHADOW_BOLT, Target_Destination, 9, 3, 12);
- marcusBurningShadows = AddSpell(MARCUS_BURNING_SHADOWS, Target_Current, 15, 0, 8);
- AddPhaseSpell(2, AddSpell(MARCUS_SHADOW_PRISON, Target_Current, 100, 0, 40));
- AddPhaseSpell(2, AddSpell(MARCUS_SHADOW_NOVA, Target_Current, 100, 30, 40));
- AddPhaseSpell(2, AddSpell(MARCUS_DISPERSE, Target_Self, 100, 30, 40));
- AddEmote(Event_OnCombatStart, "Justice... Will... Be Served!", Text_Yell);
- AddEmote(Event_OnTargetDied, "See How The Light... Makes You Weak!", Text_Yell);
- }
- void OnCombatStart(Unit *pTarget)
- {
- // Phase 1
- if (marcusVoidZones != NULL)
- {
- marcusVoidZones->mChance = 33.0f;
- marcusVoidZones->mEnabled = true;
- }
- if (marcusShadowBolt != NULL)
- {
- marcusShadowBolt->mChance = 9.0f;
- marcusShadowBolt->mEnabled = true;
- }
- if (marcusBurningShadows != NULL)
- {
- marcusBurningShadows->mChance = 15.0f;
- marcusBurningShadows->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, "Let The Darkness Flow Through Your Vains!", EVENT_UNIT_CHAT_MSG, 2000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
- GetUnit()->SetHealthPct(100);
- }
- ParentClass::OnCombatStop(pTarget);
- }
- void OnDied(Unit* pKiller)
- {
- Emote("You Can Not Defeat Me! This Is Not The End!", Text_Yell);
- ParentClass::OnDied(pKiller);
- }
- void AIUpdate()
- {
- //Phase 2 (before death)
- if(GetHealthPercent() <= 3 && GetPhase() == 1)
- {
- SetPhase(2);
- wyrnn = SpawnCreature( KING_WYRNN );
- if (wyrnn != NULL)
- {
- Emote("Wyrnn would be spawned here.", Text_Yell);
- }
- if (marcusVoidZones != NULL)
- {
- marcusVoidZones->mChance = 33.0f;
- marcusVoidZones->mEnabled = false;
- }
- if (marcusShadowBolt != NULL)
- {
- marcusShadowBolt->mChance = 9.0f;
- marcusShadowBolt->mEnabled = false;
- }
- if (marcusBurningShadows != NULL)
- {
- marcusBurningShadows->mChance = 15.0f;
- marcusBurningShadows->mEnabled = false;
- }
- if (MARCUS !=NULL)
- {
- MARCUS:Despawn(3000, 0);
- }
- ParentClass::AIUpdate();
- }
- protected:
- SpellDesc * marcusVoidZones;
- SpellDesc * marcusShadowBolt;
- SpellDesc * marcusBurningShadows;
- };
- void SetupHumanQuestInstance(ScriptMgr * mgr)
- {
- mgr->register_creature_script(MARCUS, &MarcusBossAI::Create);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement