daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
  2. index 1c54887..3e052e8 100644
  3. --- a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
  4. +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
  5. @@ -45,6 +45,9 @@ enum
  6.  
  7.      NPC_SVALA_SORROW            = 26668,
  8.      NPC_ARTHAS_IMAGE            = 29280,
  9. +    NPC_CHANNELER               = 27281,
  10. +    NPC_RITUAL_TARGET           = 27327,
  11. +    NPC_SCOURGE_HULK            = 26555,        // used to check the achiev
  12.  
  13.      SPELL_ARTHAS_VISUAL         = 54134,
  14.  
  15. @@ -53,10 +56,19 @@ enum
  16.      SPELL_TRANSFORMING_FLOATING = 54140,
  17.      SPELL_TRANSFORMING_CHANNEL  = 54142,
  18.  
  19. -    SPELL_RITUAL_OF_SWORD       = 48276,
  20. -    SPELL_CALL_FLAMES           = 48258,
  21. +    SPELL_RITUAL_OF_SWORD       = 48276,        // teleports the boss - casts 54159 on boss (disarm)
  22. +    SPELL_RITUAL_STRIKE         = 48331,        // damage spell - has script target - 27327
  23. +    SPELL_CALL_FLAMES           = 48258,        // sends script event 17841
  24.      SPELL_SINISTER_STRIKE       = 15667,
  25. -    SPELL_SINISTER_STRIKE_H     = 59409
  26. +    SPELL_SINISTER_STRIKE_H     = 59409,
  27. +
  28. +    SPELL_SUMMON_CHANNELER_1    = 48271,
  29. +    SPELL_SUMMON_CHANNELER_2    = 48274,
  30. +    SPELL_SUMMON_CHANNELER_3    = 48275,
  31. +
  32. +    // spells used by channelers
  33. +    SPELL_PARALIZE              = 48278,        // should apply effect 48267
  34. +    SPELL_SHADOWS_IN_THE_DARK   = 59407
  35.  };
  36.  
  37.  /*######
  38. @@ -67,13 +79,13 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  39.  {
  40.      boss_svalaAI(Creature* pCreature) : ScriptedAI(pCreature)
  41.      {
  42. -        m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
  43. +        m_pInstance = (instance_pinnacle*)pCreature->GetInstanceData();
  44.          m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
  45.          m_bIsIntroDone = false;
  46.          Reset();
  47.      }
  48.  
  49. -    ScriptedInstance* m_pInstance;
  50. +    instance_pinnacle* m_pInstance;
  51.      bool m_bIsRegularMode;
  52.  
  53.      Creature* pArthas;
  54. @@ -82,6 +94,10 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  55.      uint32 m_uiIntroTimer;
  56.      uint32 m_uiIntroCount;
  57.  
  58. +    uint32 m_uiSinisterStrikeTimer;
  59. +    uint32 m_uiCallFlamesTimer;
  60. +    bool m_bHasDoneRitual;
  61. +
  62.      void Reset()
  63.      {
  64.          pArthas = NULL;
  65. @@ -89,6 +105,10 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  66.          m_uiIntroTimer = 2500;
  67.          m_uiIntroCount = 0;
  68.  
  69. +        m_uiSinisterStrikeTimer = 10000;
  70. +        m_uiCallFlamesTimer     = urand(10000, 15000);
  71. +        m_bHasDoneRitual        = false;
  72. +
  73.          if (m_creature->isAlive() && m_pInstance && m_pInstance->GetData(TYPE_SVALA) > IN_PROGRESS)
  74.          {
  75.              if (m_creature->GetEntry() != NPC_SVALA_SORROW)
  76. @@ -140,6 +160,14 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  77.              pArthas = pSummoned;
  78.              pSummoned->SetFacingToObject(m_creature);
  79.          }
  80. +        else if (pSummoned->GetEntry() == NPC_CHANNELER)
  81. +        {
  82. +            if (!m_bIsRegularMode)
  83. +                pSummoned->CastSpell(pSummoned, SPELL_SHADOWS_IN_THE_DARK, true);
  84. +
  85. +            // ToDo: fix this spell target and effect
  86. +            //pSummoned->CastSpell(m_creature, SPELL_PARALIZE, true);
  87. +        }
  88.      }
  89.  
  90.      void SummonedCreatureDespawn(Creature* pDespawned)
  91. @@ -157,6 +185,16 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  92.  
  93.              m_creature->UpdateEntry(NPC_SVALA_SORROW);
  94.          }
  95. +        // cast ritual strike after starting the ritual
  96. +        else if (pSpell->Id == SPELL_RITUAL_OF_SWORD)
  97. +            DoCastSpellIfCan(m_creature, SPELL_RITUAL_STRIKE, CAST_TRIGGERED);
  98. +    }
  99. +
  100. +    void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell)
  101. +    {
  102. +        // restore movement after ritual is finished
  103. +        if (pTarget->GetEntry() == NPC_RITUAL_TARGET)
  104. +            m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
  105.      }
  106.  
  107.      void KilledUnit(Unit* pVictim)
  108. @@ -167,6 +205,10 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  109.              case 1: DoScriptText(SAY_SLAY_2, m_creature); break;
  110.              case 2: DoScriptText(SAY_SLAY_3, m_creature); break;
  111.          }
  112. +
  113. +        // set achiev to true if boss kills a hulk
  114. +        if (pVictim->GetEntry() == NPC_SCOURGE_HULK && m_pInstance)
  115. +            m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_HULK, true);
  116.      }
  117.  
  118.      void JustDied(Unit* pKiller)
  119. @@ -188,7 +230,7 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  120.  
  121.      void UpdateAI(const uint32 uiDiff)
  122.      {
  123. -        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
  124. +        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || m_creature->HasAura(SPELL_RITUAL_OF_SWORD))
  125.          {
  126.              if (m_bIsIntroDone)
  127.                  return;
  128. @@ -235,6 +277,48 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI
  129.              return;
  130.          }
  131.  
  132. +        if(m_uiSinisterStrikeTimer < uiDiff)
  133. +        {
  134. +            if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SINISTER_STRIKE : SPELL_SINISTER_STRIKE_H) == CAST_OK)
  135. +                m_uiSinisterStrikeTimer = 10000;
  136. +        }
  137. +        else
  138. +            m_uiSinisterStrikeTimer -= uiDiff;
  139. +
  140. +        if(m_uiCallFlamesTimer < uiDiff)
  141. +        {
  142. +            if (DoCastSpellIfCan(m_creature, SPELL_CALL_FLAMES) == CAST_OK)
  143. +                m_uiCallFlamesTimer = urand(10000, 15000);
  144. +        }
  145. +        else
  146. +            m_uiCallFlamesTimer -= uiDiff;
  147. +
  148. +        // As from patch notes: Svala Sorrowgrave now casts Ritual of the Sword 1 time during the encounter, down from 3.
  149. +        if(m_creature->GetHealthPercent() < 50.0f && !m_bHasDoneRitual)
  150. +        {
  151. +            if(Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
  152. +            {
  153. +                if (DoCastSpellIfCan(pTarget, SPELL_RITUAL_OF_SWORD, CAST_TRIGGERED) == CAST_OK)
  154. +                {
  155. +                    // summon channelers
  156. +                    DoCastSpellIfCan(m_creature, SPELL_SUMMON_CHANNELER_1, CAST_TRIGGERED);
  157. +                    DoCastSpellIfCan(m_creature, SPELL_SUMMON_CHANNELER_2, CAST_TRIGGERED);
  158. +                    DoCastSpellIfCan(m_creature, SPELL_SUMMON_CHANNELER_3, CAST_TRIGGERED);
  159. +
  160. +                    switch(urand(0, 3))
  161. +                    {
  162. +                        case 0: DoScriptText(SAY_SACRIFICE_1, m_creature); break;
  163. +                        case 1: DoScriptText(SAY_SACRIFICE_2, m_creature); break;
  164. +                        case 2: DoScriptText(SAY_SACRIFICE_3, m_creature); break;
  165. +                        case 3: DoScriptText(SAY_SACRIFICE_4, m_creature); break;
  166. +                    }
  167. +
  168. +                    m_creature->GetMotionMaster()->MoveIdle();
  169. +                    m_bHasDoneRitual = true;
  170. +                }
  171. +            }
  172. +        }
  173. +
  174.          DoMeleeAttackIfReady();
  175.      }
  176.  };
  177. @@ -255,17 +339,35 @@ bool AreaTrigger_at_svala_intro(Player* pPlayer, AreaTriggerEntry const* pAt)
  178.      return false;
  179.  }
  180.  
  181. -void AddSC_boss_svala()
  182. +bool ProcessEventId_event_call_flames(uint32 uiEventId, Object* pSource, Object* pTarget, bool bIsStart)
  183.  {
  184. -    Script *newscript;
  185. +    if (instance_pinnacle* pInstance = (instance_pinnacle*)((Creature*)pSource)->GetInstanceData())
  186. +    {
  187. +        if (pInstance->GetData(TYPE_SVALA) != IN_PROGRESS)
  188. +            return false;
  189.  
  190. -    newscript = new Script;
  191. -    newscript->Name = "boss_svala";
  192. -    newscript->GetAI = &GetAI_boss_svala;
  193. -    newscript->RegisterSelf();
  194. +        pInstance->DoProcessCallFlamesEvent();
  195. +        return true;
  196. +    }
  197. +    return false;
  198. +}
  199.  
  200. -    newscript = new Script;
  201. -    newscript->Name = "at_svala_intro";
  202. -    newscript->pAreaTrigger = &AreaTrigger_at_svala_intro;
  203. -    newscript->RegisterSelf();
  204. +void AddSC_boss_svala()
  205. +{
  206. +    Script* pNewScript;
  207. +
  208. +    pNewScript = new Script;
  209. +    pNewScript->Name = "boss_svala";
  210. +    pNewScript->GetAI = &GetAI_boss_svala;
  211. +    pNewScript->RegisterSelf();
  212. +
  213. +    pNewScript = new Script;
  214. +    pNewScript->Name = "at_svala_intro";
  215. +    pNewScript->pAreaTrigger = &AreaTrigger_at_svala_intro;
  216. +    pNewScript->RegisterSelf();
  217. +
  218. +    pNewScript = new Script;
  219. +    pNewScript->Name = "event_call_flames";
  220. +    pNewScript->pProcessEventId = &ProcessEventId_event_call_flames;
  221. +    pNewScript->RegisterSelf();
  222.  }
  223. diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp
  224. index 03527f0..c5daccb 100644
  225. --- a/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp
  226. +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp
  227. @@ -32,6 +32,22 @@ instance_pinnacle::instance_pinnacle(Map* pMap) : ScriptedInstance(pMap)
  228.  void instance_pinnacle::Initialize()
  229.  {
  230.      memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
  231. +
  232. +    for (uint8 i = 0; i < MAX_SPECIAL_ACHIEV_CRITS; ++i)
  233. +        m_abAchievCriteria[i] = false;
  234. +}
  235. +
  236. +void instance_pinnacle::OnCreatureCreate(Creature* pCreature)
  237. +{
  238. +    switch(pCreature->GetEntry())
  239. +    {
  240. +        case NPC_YMIRON:
  241. +            m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
  242. +            break;
  243. +        case NPC_FLAME_BRAZIER:
  244. +            m_lFlameBraziersList.push_back(pCreature->GetObjectGuid());
  245. +            break;
  246. +    }
  247.  }
  248.  
  249.  void instance_pinnacle::OnObjectCreate(GameObject* pGo)
  250. @@ -41,9 +57,15 @@ void instance_pinnacle::OnObjectCreate(GameObject* pGo)
  251.          case GO_DOOR_SKADI:
  252.              if (m_auiEncounter[TYPE_SKADI] == DONE)
  253.                  pGo->SetGoState(GO_STATE_ACTIVE);
  254. -            m_mGoEntryGuidStore[GO_DOOR_SKADI] = pGo->GetObjectGuid();
  255.              break;
  256. +        case GO_DOOR_YMIRON:
  257. +            if (m_auiEncounter[TYPE_YMIRON] == DONE)
  258. +                pGo->SetGoState(GO_STATE_ACTIVE);
  259. +            break;
  260. +        default:
  261. +            return;
  262.      }
  263. +    m_mGoEntryGuidStore[pGo->GetEntry()] = pGo->GetObjectGuid();
  264.  }
  265.  
  266.  void instance_pinnacle::SetData(uint32 uiType, uint32 uiData)
  267. @@ -52,6 +74,9 @@ void instance_pinnacle::SetData(uint32 uiType, uint32 uiData)
  268.      {
  269.          case TYPE_SVALA:
  270.              m_auiEncounter[uiType] = uiData;
  271. +            // set the achiev to false at the beginning of the event
  272. +            if (uiData == IN_PROGRESS)
  273. +                SetSpecialAchievementCriteria(TYPE_ACHIEV_HULK, false);
  274.              break;
  275.          case TYPE_GORTOK:
  276.              m_auiEncounter[uiType] = uiData;
  277. @@ -59,11 +84,12 @@ void instance_pinnacle::SetData(uint32 uiType, uint32 uiData)
  278.          case TYPE_SKADI:
  279.              if (uiData == DONE)
  280.                  DoUseDoorOrButton(GO_DOOR_SKADI);
  281. -
  282.              m_auiEncounter[uiType] = uiData;
  283.              break;
  284.          case TYPE_YMIRON:
  285.              m_auiEncounter[uiType] = uiData;
  286. +            if (uiData == DONE)
  287. +                DoUseDoorOrButton(GO_DOOR_YMIRON);
  288.              break;
  289.          default:
  290.              error_log("SD2: Instance Pinnacle: SetData = %u for type %u does not exist/not implemented.", uiType, uiData);
  291. @@ -115,6 +141,37 @@ void instance_pinnacle::Load(const char* chrIn)
  292.      OUT_LOAD_INST_DATA_COMPLETE;
  293.  }
  294.  
  295. +void instance_pinnacle::SetSpecialAchievementCriteria(uint32 uiType, bool bIsMet)
  296. +{
  297. +    if (uiType < MAX_SPECIAL_ACHIEV_CRITS)
  298. +        m_abAchievCriteria[uiType] = bIsMet;
  299. +}
  300. +
  301. +bool instance_pinnacle::CheckAchievementCriteriaMeet(uint32 uiCriteriaId, Player const* pSource, Unit const* pTarget, uint32 uiMiscValue1 /* = 0*/)
  302. +{
  303. +    switch (uiCriteriaId)
  304. +    {
  305. +        case ACHIEV_CRIT_INCREDIBLE_HULK:
  306. +            return m_abAchievCriteria[TYPE_ACHIEV_HULK];
  307. +        case ACHIEV_CRIT_GIRL_LOVES_SKADI:
  308. +            return m_abAchievCriteria[TYPE_ACHIEV_LOVE_SKADI];
  309. +        case ACHIEV_CRIT_KINGS_BANE:
  310. +            return false;
  311. +
  312. +        default:
  313. +            return false;
  314. +    }
  315. +}
  316. +
  317. +void instance_pinnacle::DoProcessCallFlamesEvent()
  318. +{
  319. +    for (GUIDList::const_iterator itr = m_lFlameBraziersList.begin(); itr != m_lFlameBraziersList.end(); ++itr)
  320. +    {
  321. +        if (Creature* pFlame = instance->GetCreature(*itr))
  322. +            pFlame->CastSpell(pFlame, SPELL_BALL_OF_FLAME, true);
  323. +    }
  324. +}
  325. +
  326.  InstanceData* GetInstanceData_instance_pinnacle(Map* pMap)
  327.  {
  328.      return new instance_pinnacle(pMap);
  329. diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h b/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h
  330. index ae70c7b..e91b274 100644
  331. --- a/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h
  332. +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h
  333. @@ -8,19 +8,34 @@
  334.  enum
  335.  {
  336.      MAX_ENCOUNTER                   = 4,
  337. +    MAX_SPECIAL_ACHIEV_CRITS        = 2,
  338.  
  339.      TYPE_SVALA                      = 0,
  340.      TYPE_GORTOK                     = 1,
  341.      TYPE_SKADI                      = 2,
  342.      TYPE_YMIRON                     = 3,
  343.  
  344. +    TYPE_ACHIEV_HULK                = 0,
  345. +    TYPE_ACHIEV_LOVE_SKADI          = 1,
  346. +
  347.      GO_STASIS_GENERATOR             = 188593,
  348.      GO_DOOR_SKADI                   = 192173,
  349. +    GO_DOOR_YMIRON                  = 192174,
  350.  
  351. +    NPC_FLAME_BRAZIER               = 27273,            // throw flames at players on Svalna event
  352. +    NPC_YMIRON                      = 26861,
  353.      NPC_FURBOLG                     = 26684,
  354.      NPC_WORGEN                      = 26683,
  355.      NPC_JORMUNGAR                   = 26685,
  356. -    NPC_RHINO                       = 26686
  357. +    NPC_RHINO                       = 26686,
  358. +
  359. +    ACHIEV_CRIT_INCREDIBLE_HULK     = 7322,             // Svala achiev - 2043
  360. +    ACHIEV_CRIT_KINGS_BANE          = 7598,             // Ymiron achiev - 2157
  361. +    ACHIEV_CRIT_GIRL_LOVES_SKADI    = 7595,             // Skadi achiev - 2156
  362. +
  363. +    ACHIEV_START_SKADI_ID           = 17726,            // Starts Skadi timed achiev - 1873
  364. +
  365. +    SPELL_BALL_OF_FLAME             = 48246,            // spell used by the flame braziers
  366.  };
  367.  
  368.  class MANGOS_DLL_DECL instance_pinnacle : public ScriptedInstance
  369. @@ -30,6 +45,7 @@ class MANGOS_DLL_DECL instance_pinnacle : public ScriptedInstance
  370.  
  371.          void Initialize();
  372.  
  373. +        void OnCreatureCreate(Creature* pCreature);
  374.          void OnObjectCreate(GameObject* pGo);
  375.  
  376.          void SetData(uint32 uiType, uint32 uiData);
  377. @@ -38,9 +54,17 @@ class MANGOS_DLL_DECL instance_pinnacle : public ScriptedInstance
  378.          const char* Save() { return m_strInstData.c_str(); }
  379.          void Load(const char* chrIn);
  380.  
  381. +        void SetSpecialAchievementCriteria(uint32 uiType, bool bIsMet);
  382. +        bool CheckAchievementCriteriaMeet(uint32 uiCriteriaId, Player const* pSource, Unit const* pTarget, uint32 uiMiscValue1 /* = 0*/);
  383. +
  384. +        void DoProcessCallFlamesEvent();
  385. +
  386.      private:
  387.          uint32 m_auiEncounter[MAX_ENCOUNTER];
  388. +        bool m_abAchievCriteria[MAX_SPECIAL_ACHIEV_CRITS];
  389.          std::string m_strInstData;
  390. +
  391. +        GUIDList m_lFlameBraziersList;
  392.  };
  393.  
  394.  #endif
  395. diff --git a/sql/mangos_scriptname_full.sql b/sql/mangos_scriptname_full.sql
  396. index 3f1fae8..da15924 100644
  397. --- a/sql/mangos_scriptname_full.sql
  398. +++ b/sql/mangos_scriptname_full.sql
  399. @@ -1276,6 +1276,9 @@ DELETE FROM scripted_areatrigger WHERE entry=5140;
  400.  INSERT INTO scripted_areatrigger VALUES (5140,&#039;at_svala_intro&#039;);
  401.  UPDATE creature_template SET ScriptName=&#039;boss_ymiron&#039; WHERE entry=26861;
  402.  UPDATE instance_template SET ScriptName=&#039;instance_pinnacle&#039; WHERE map=575;
  403. +DELETE FROM scripted_event_id WHERE id=17841;
  404. +INSERT INTO scripted_event_id VALUES
  405. +(17841,&#039;event_call_flames&#039;);
  406.  
  407.  /* VAULT OF ARCHAVON */
RAW Paste Data
Top