Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.97 KB | None | 0 0
  1. #include "StdAfx.h"  //This uses the existing functions in Arc's Core
  2. #include "Setup.h"  //So does this
  3. #include "..\Common\base.h"  // This is used to include the ArcAI engine commands
  4.  
  5. #ifdef WIN32 //This is our structure
  6. #pragma warning(disable:4305)  //This disables an annoying error that may pop up while compiling
  7. #endif
  8.  
  9. //Marcus The Damned
  10. #define MARCUS   100008  //This is the entry number of the good captain
  11.  
  12. //Everything below this is his ability ID numbers.
  13. #define MARCUS_VOID_ZONES        30533  
  14. #define MARCUS_SHADOW_BOLT       30505  
  15. #define MARCUS_BURNING_SHADOWS   40739
  16. #define MARCUS_SHADOW_PRISON     40647
  17. #define MARCUS_SHADOW_NOVA       44984
  18. #define MARCUS_DISPERSE          47585
  19.  
  20. //Aditional NPC's
  21. #define KING_WYRNN              100007              
  22.  
  23. class MarcusBossAI : public ArcScriptBossAI
  24. {
  25. public:
  26.     ARCSCRIPT_FACTORY_FUNCTION(MarcusBossAI, ArcScriptBossAI);
  27.         MarcusBossAI(Creature* pCreature) : ArcScriptBoss(pCreature)
  28.         {
  29.                 marcusVoidZones = AddSpell(MARCUS_VOID_ZONES, Target_RandomPlayer, 33, 4, 20);
  30.                 marcusShadowBolt = AddSpell(MARCUS_SHADOW_BOLT, Target_Destination, 9, 3, 12);
  31.                 marcusBurningShadows = AddSpell(MARCUS_BURNING_SHADOWS, Target_Current, 15, 0, 8);
  32.  
  33.                 AddPhaseSpell(2, AddSpell(MARCUS_SHADOW_PRISON, Target_Current, 100, 0, 40));
  34.                 AddPhaseSpell(2, AddSpell(MARCUS_SHADOW_NOVA, Target_Current, 100, 30, 40));
  35.                 AddPhaseSpell(2, AddSpell(MARCUS_DISPERSE, Target_Self, 100, 30, 40));
  36.  
  37.                 AddEmote(Event_OnCombatStart, "Justice... Will... Be Served!", Text_Yell);
  38.                 AddEmote(Event_OnTargetDied, "See How The Light... Makes You Weak!", Text_Yell);
  39.         }
  40.         void OnCombatStart(Unit *pTarget)
  41.         {
  42.       // Phase 1
  43.       if (marcusVoidZones != NULL)
  44.       {
  45.          marcusVoidZones->mChance = 33.0f;
  46.          marcusVoidZones->mEnabled = true;
  47.       }
  48.       if (marcusShadowBolt != NULL)
  49.       {
  50.          marcusShadowBolt->mChance = 9.0f;
  51.          marcusShadowBolt->mEnabled = true;
  52.       }
  53.       if (marcusBurningShadows != NULL)
  54.       {
  55.          marcusBurningShadows->mChance = 15.0f;
  56.          marcusBurningShadows->mEnabled = true;
  57.       }
  58.                ParentClass::OnCombatStart(pTarget);
  59.        
  60. }
  61.     void OnCombatStop(Unit* pTarget)
  62.     {
  63.         if(GetHealthPercent() >= 1)
  64.         {  
  65.    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);
  66.    GetUnit()->SetHealthPct(100);
  67.         }
  68.                 ParentClass::OnCombatStop(pTarget);
  69.         }
  70.  
  71.     void OnDied(Unit* pKiller)
  72.         {
  73.                 Emote("You Can Not Defeat Me! This Is Not The End!", Text_Yell);
  74.                 ParentClass::OnDied(pKiller);
  75.         }
  76.     void AIUpdate()
  77.     {
  78.         //Phase 2 (before death)
  79.    if(GetHealthPercent() <= 3 && GetPhase() == 1)
  80.                 {
  81.                    SetPhase(2);
  82.          wyrnn = SpawnCreature( KING_WYRNN );
  83.       if (wyrnn != NULL)
  84.       {
  85.           Emote("Wyrnn would be spawned here.", Text_Yell);
  86.       }
  87.  
  88.       if (marcusVoidZones != NULL)
  89.       {
  90.          marcusVoidZones->mChance = 33.0f;
  91.          marcusVoidZones->mEnabled = false;
  92.       }
  93.       if (marcusShadowBolt != NULL)
  94.       {
  95.          marcusShadowBolt->mChance = 9.0f;
  96.          marcusShadowBolt->mEnabled = false;
  97.       }
  98.       if (marcusBurningShadows != NULL)
  99.       {
  100.          marcusBurningShadows->mChance = 15.0f;
  101.          marcusBurningShadows->mEnabled = false;
  102.       }
  103.       if (MARCUS !=NULL)
  104.       {
  105.           MARCUS:Despawn(3000, 0);
  106.                 }
  107.              ParentClass::AIUpdate();
  108.    }
  109.     protected:
  110.       SpellDesc * marcusVoidZones;
  111.       SpellDesc * marcusShadowBolt;
  112.       SpellDesc * marcusBurningShadows;                
  113. };
  114.     void SetupHumanQuestInstance(ScriptMgr * mgr)
  115. {
  116.         mgr->register_creature_script(MARCUS, &MarcusBossAI::Create);
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement