Advertisement
Guest User

Untitled

a guest
May 4th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.35 KB | None | 0 0
  1. path: src\scripts\EasternKingdoms\Karazhan\boss_shade_of_aran.cpp
  2. /*
  3. * Copyright (C) 2010-2014 OregonCore <http://www.oregoncore.com/>
  4. * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
  5. * Copyright (C) 2006-2012 ScriptDev2 <http://www.scriptdev2.com/>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20.  
  21. /* ScriptData
  22. SDName: Boss_Shade_of_Aran
  23. +SD%Complete: 98
  24. +SDComment: Elementals should die when Aran is killed.
  25. SDCategory: Karazhan
  26. EndScriptData */
  27.  
  28. #include "ScriptPCH.h"
  29. #include "ScriptedSimpleAI.h"
  30. #include "karazhan.h"
  31. #include "GameObject.h"
  32.  
  33. #define SAY_AGGRO1 -1532073
  34. #define SAY_AGGRO2 -1532074
  35. #define SAY_AGGRO3 -1532075
  36. #define SAY_FLAMEWREATH1 -1532076
  37. #define SAY_FLAMEWREATH2 -1532077
  38. #define SAY_BLIZZARD1 -1532078
  39. #define SAY_BLIZZARD2 -1532079
  40. #define SAY_EXPLOSION1 -1532080
  41. #define SAY_EXPLOSION2 -1532081
  42. #define SAY_DRINK -1532082 //Low Mana / AoE Pyroblast
  43. #define SAY_ELEMENTALS -1532083
  44. #define SAY_KILL1 -1532084
  45. #define SAY_KILL2 -1532085
  46. #define SAY_TIMEOVER -1532086
  47. #define SAY_DEATH -1532087
  48. #define SAY_ATIESH -1532088 //Atiesh is equipped by a raid member
  49.  
  50. //Spells
  51. #define SPELL_FROSTBOLT 29954
  52. #define SPELL_FIREBALL 29953
  53. #define SPELL_ARCMISSLE 29955
  54. #define SPELL_CHAINSOFICE 29991
  55. #define SPELL_DRAGONSBREATH 29964
  56. #define SPELL_MASSSLOW 30035
  57. #define SPELL_FLAME_WREATH 30004 // triggers 29946 on targets
  58. #define SPELL_SUMMON_BLIZZ 29969 // script target on npc 17161 - triggers spell 29952 on target
  59. #define SPELL_AOE_CS 29961
  60. #define SPELL_PLAYERPULL 32265
  61. #define SPELL_AEXPLOSION 29973
  62. #define SPELL_MASS_POLY 29963
  63. #define SPELL_BLINK_CENTER 29967
  64. #define SPELL_ELEMENTALS 29962
  65. #define SPELL_CONJURE 29975
  66. #define SPELL_DRINK 30024
  67. #define SPELL_POTION 32453
  68. #define SPELL_AOE_PYROBLAST 29978
  69.  
  70. //Creature Spells
  71. #define SPELL_CIRCULAR_BLIZZARD 29952
  72. #define SPELL_WATERBOLT 31012
  73. #define SPELL_SHADOW_PYRO 29978
  74.  
  75. //Creatures
  76. #define CREATURE_WATER_ELEMENTAL 17167
  77. #define CREATURE_SHADOW_OF_ARAN 18254
  78. #define CREATURE_ARAN_BLIZZARD 17161
  79.  
  80. enum SuperSpell
  81. {
  82. SUPER_FLAME = 0,
  83. SUPER_BLIZZARD,
  84. SUPER_AE,
  85. };
  86.  
  87. struct boss_aranAI : public ScriptedAI
  88. {
  89. boss_aranAI(Creature *c) : ScriptedAI(c)
  90. {
  91. pInstance = c->GetInstanceData();
  92. }
  93.  
  94. ScriptedInstance* pInstance;
  95.  
  96. uint32 SecondarySpellTimer;
  97. uint32 NormalCastTimer;
  98. uint32 SuperCastTimer;
  99. uint32 BerserkTimer;
  100. uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering.
  101.  
  102. uint8 LastSuperSpell;
  103.  
  104. uint32 FlameWreathTimer;
  105. uint32 FlameWreathCheckTime;
  106. uint64 FlameWreathTarget[3];
  107. float FWTargPosX[3];
  108. float FWTargPosY[3];
  109.  
  110. uint32 CurrentNormalSpell;
  111. uint32 ArcaneCooldown;
  112. uint32 FireCooldown;
  113. uint32 FrostCooldown;
  114.  
  115. uint32 DrinkInturruptTimer;
  116.  
  117. bool ElementalsSpawned;
  118. bool Drinking;
  119. bool DrinkInturrupted;
  120.  
  121. void Reset()
  122. {
  123. SecondarySpellTimer = 5000;
  124. NormalCastTimer = 0;
  125. SuperCastTimer = 35000;
  126. BerserkTimer = 720000;
  127. CloseDoorTimer = 15000;
  128.  
  129. LastSuperSpell = rand()%3;
  130.  
  131. FlameWreathTimer = 0;
  132. FlameWreathCheckTime = 0;
  133.  
  134. CurrentNormalSpell = 0;
  135. ArcaneCooldown = 0;
  136. FireCooldown = 0;
  137. FrostCooldown = 0;
  138.  
  139. DrinkInturruptTimer = 10000;
  140.  
  141. ElementalsSpawned = false;
  142. Drinking = false;
  143. DrinkInturrupted = false;
  144.  
  145. if (pInstance)
  146. {
  147. // Not in progress
  148. pInstance->SetData(TYPE_ARAN, NOT_STARTED);
  149. pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
  150. }
  151. }
  152.  
  153. void KilledUnit(Unit * /*victim*/)
  154. {
  155. DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
  156. }
  157.  
  158. void JustDied(Unit * /*victim*/)
  159. {
  160. DoScriptText(SAY_DEATH, me);
  161.  
  162. if (pInstance)
  163. {
  164. pInstance->SetData(TYPE_ARAN, DONE);
  165. pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
  166. }
  167. }
  168.  
  169. void EnterCombat(Unit * /*who*/)
  170. {
  171. DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
  172.  
  173. if (pInstance)
  174. {
  175. pInstance->SetData(TYPE_ARAN, IN_PROGRESS);
  176. pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
  177. }
  178. }
  179.  
  180. void FlameWreathEffect()
  181. {
  182. std::vector<Unit*> targets;
  183. std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
  184.  
  185. if (!t_list.size())
  186. return;
  187.  
  188. //store the threat list in a different container
  189. for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
  190. {
  191. Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
  192. //only on alive players
  193. if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
  194. targets.push_back(pTarget);
  195. }
  196.  
  197. //cut down to size if we have more than 3 targets
  198. while (targets.size() > 3)
  199. targets.erase(targets.begin()+rand()%targets.size());
  200.  
  201. uint32 i = 0;
  202. for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr)
  203. {
  204. if (*itr)
  205. {
  206. FlameWreathTarget[i] = (*itr)->GetGUID();
  207. FWTargPosX[i] = (*itr)->GetPositionX();
  208. FWTargPosY[i] = (*itr)->GetPositionY();
  209. me->CastSpell((*itr), SPELL_FLAME_WREATH, false);
  210. ++i;
  211. }
  212. }
  213. }
  214.  
  215. void UpdateAI(const uint32 diff)
  216. {
  217. if (!UpdateVictim())
  218. return;
  219.  
  220. if (CloseDoorTimer)
  221. {
  222. if (CloseDoorTimer <= diff)
  223. {
  224. if (pInstance)
  225. {
  226. pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
  227. CloseDoorTimer = 0;
  228. }
  229. } else CloseDoorTimer -= diff;
  230. }
  231.  
  232. //Cooldowns for casts
  233. if (ArcaneCooldown)
  234. {
  235. if (ArcaneCooldown >= diff)
  236. ArcaneCooldown -= diff;
  237. else ArcaneCooldown = 0;
  238. }
  239.  
  240. if (FireCooldown)
  241. {
  242. if (FireCooldown >= diff)
  243. FireCooldown -= diff;
  244. else FireCooldown = 0;
  245. }
  246.  
  247. if (FrostCooldown)
  248. {
  249. if (FrostCooldown >= diff)
  250. FrostCooldown -= diff;
  251. else FrostCooldown = 0;
  252. }
  253.  
  254. if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20)
  255. {
  256. Drinking = true;
  257. me->InterruptNonMeleeSpells(false);
  258.  
  259. DoScriptText(SAY_DRINK, me);
  260.  
  261. if (!DrinkInturrupted)
  262. {
  263. DoCast(me, SPELL_MASS_POLY, true);
  264. DoCast(me, SPELL_CONJURE, false);
  265. DoCast(me, SPELL_DRINK, false);
  266. me->SetStandState(UNIT_STAND_STATE_SIT);
  267. DrinkInturruptTimer = 10000;
  268. }
  269. }
  270.  
  271. //Drink Inturrupt
  272. if (Drinking && DrinkInturrupted)
  273. {
  274. Drinking = false;
  275. me->RemoveAurasDueToSpell(SPELL_DRINK);
  276. me->SetStandState(UNIT_STAND_STATE_STAND);
  277. me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000);
  278. DoCast(me, SPELL_POTION, false);
  279. }
  280.  
  281. //Drink Inturrupt Timer
  282. if (Drinking && !DrinkInturrupted)
  283. if (DrinkInturruptTimer >= diff)
  284. DrinkInturruptTimer -= diff;
  285. else
  286. {
  287. me->SetStandState(UNIT_STAND_STATE_STAND);
  288. DoCast(me, SPELL_POTION, true);
  289. DoCast(me, SPELL_AOE_PYROBLAST, false);
  290. DrinkInturrupted = true;
  291. Drinking = false;
  292. }
  293.  
  294. //Don't execute any more code if we are drinking
  295. if (Drinking)
  296. return;
  297.  
  298. //Normal casts
  299. if (NormalCastTimer <= diff)
  300. {
  301. if (!me->IsNonMeleeSpellCasted(false))
  302. {
  303. Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
  304. if (!pTarget)
  305. return;
  306.  
  307. uint32 Spells[3];
  308. uint8 AvailableSpells = 0;
  309.  
  310. //Check for what spells are not on cooldown
  311. if (!ArcaneCooldown)
  312. {
  313. Spells[AvailableSpells] = SPELL_ARCMISSLE;
  314. ++AvailableSpells;
  315. }
  316. if (!FireCooldown)
  317. {
  318. Spells[AvailableSpells] = SPELL_FIREBALL;
  319. ++AvailableSpells;
  320. }
  321. if (!FrostCooldown)
  322. {
  323. Spells[AvailableSpells] = SPELL_FROSTBOLT;
  324. ++AvailableSpells;
  325. }
  326.  
  327. //If no available spells wait 1 second and try again
  328. if (AvailableSpells)
  329. {
  330. CurrentNormalSpell = Spells[rand() % AvailableSpells];
  331. DoCast(pTarget, CurrentNormalSpell);
  332. }
  333. }
  334. NormalCastTimer = 1000;
  335. } else NormalCastTimer -= diff;
  336.  
  337. if (SecondarySpellTimer <= diff)
  338. {
  339. switch (urand(0,1))
  340. {
  341. case 0:
  342. DoCast(me, SPELL_AOE_CS);
  343. break;
  344. case 1:
  345. if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
  346. DoCast(pTarget, SPELL_CHAINSOFICE);
  347. break;
  348. }
  349. SecondarySpellTimer = urand(5000,20000);
  350. } else SecondarySpellTimer -= diff;
  351.  
  352. if (SuperCastTimer <= diff)
  353. {
  354. uint8 Available[2];
  355.  
  356. switch (LastSuperSpell)
  357. {
  358. case SUPER_AE:
  359. Available[0] = SUPER_FLAME;
  360. Available[1] = SUPER_BLIZZARD;
  361. break;
  362. case SUPER_FLAME:
  363. Available[0] = SUPER_AE;
  364. Available[1] = SUPER_BLIZZARD;
  365. break;
  366. case SUPER_BLIZZARD:
  367. Available[0] = SUPER_FLAME;
  368. Available[1] = SUPER_AE;
  369. break;
  370. }
  371.  
  372. LastSuperSpell = Available[urand(0,1)];
  373.  
  374. switch (LastSuperSpell)
  375. {
  376. case SUPER_AE:
  377. DoScriptText(RAND(SAY_EXPLOSION1, SAY_EXPLOSION2), me);
  378.  
  379. DoCast(me, SPELL_BLINK_CENTER, true);
  380. DoCast(me, SPELL_PLAYERPULL, true);
  381. DoCast(me, SPELL_MASSSLOW, true);
  382. DoCast(SPELL_AEXPLOSION);
  383. break;
  384.  
  385. case SUPER_FLAME:
  386. DoScriptText(RAND(SAY_FLAMEWREATH1, SAY_FLAMEWREATH2), me);
  387.  
  388. FlameWreathTimer = 20000;
  389. FlameWreathCheckTime = 500;
  390.  
  391. FlameWreathTarget[0] = 0;
  392. FlameWreathTarget[1] = 0;
  393. FlameWreathTarget[2] = 0;
  394.  
  395. FlameWreathEffect();
  396. break;
  397.  
  398. case SUPER_BLIZZARD:
  399. DoScriptText(RAND(SAY_BLIZZARD1, SAY_BLIZZARD2), me);
  400.  
  401. Creature* Blizzard = NULL;
  402. Blizzard = me->SummonCreature(CREATURE_ARAN_BLIZZARD, -11179.080f, -1905.279f, 232.008f, 2.9f, TEMPSUMMON_TIMED_DESPAWN, 25000);
  403. if (Blizzard)
  404. {
  405. Blizzard->SetInCombatWithZone();
  406. Blizzard->setFaction(me->getFaction());
  407. me->CastSpell(Blizzard, SPELL_SUMMON_BLIZZ, false);
  408. Blizzard->CastSpell(Blizzard, 29952, false);
  409. Blizzard->GetMotionMaster()->MovePath(90000, false);
  410. }
  411. break;
  412. }
  413.  
  414. SuperCastTimer = urand(35000,40000);
  415. } else SuperCastTimer -= diff;
  416.  
  417. if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40)
  418. {
  419. ElementalsSpawned = true;
  420.  
  421. Creature* ElementalOne = NULL;
  422. Creature* ElementalTwo = NULL;
  423. Creature* ElementalThree = NULL;
  424. Creature* ElementalFour = NULL;
  425.  
  426. ElementalOne = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11168.1f, -1939.29f, 232.092f, 1.46f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
  427. ElementalTwo = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11138.2f, -1915.38f, 232.092f, 3.00f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
  428. ElementalThree = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11161.7f, -1885.36f, 232.092f, 4.59f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
  429. ElementalFour = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11192.4f, -1909.36f, 232.092f, 6.19f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
  430.  
  431. if (ElementalOne)
  432. {
  433. Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
  434. if (!pTarget)
  435. return;
  436.  
  437. DoStartNoMovement(pTarget);
  438. ElementalOne->SetInCombatWithZone();
  439. ElementalOne->CombatStart(pTarget);
  440. ElementalOne->setFaction(me->getFaction());
  441. ElementalOne->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
  442. ElementalOne->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
  443. ElementalOne->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
  444. }
  445.  
  446. if (ElementalTwo)
  447. {
  448. Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
  449. if (!pTarget)
  450. return;
  451.  
  452. DoStartNoMovement(pTarget);
  453. ElementalTwo->SetInCombatWithZone();
  454. ElementalTwo->CombatStart(pTarget);
  455. ElementalTwo->setFaction(me->getFaction());
  456. ElementalTwo->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
  457. ElementalTwo->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
  458. ElementalTwo->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
  459. }
  460.  
  461. if (ElementalThree)
  462. {
  463. Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
  464. if (!pTarget)
  465. return;
  466.  
  467. DoStartNoMovement(pTarget);
  468. ElementalThree->SetInCombatWithZone();
  469. ElementalThree->CombatStart(pTarget);
  470. ElementalThree->setFaction(me->getFaction());
  471. ElementalThree->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
  472. ElementalThree->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
  473. ElementalThree->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
  474. }
  475.  
  476. if (ElementalFour)
  477. {
  478. Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
  479. if (!pTarget)
  480. return;
  481.  
  482. DoStartNoMovement(pTarget);
  483. ElementalFour->SetInCombatWithZone();
  484. ElementalFour->CombatStart(pTarget);
  485. ElementalFour->setFaction(me->getFaction());
  486. ElementalFour->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
  487. ElementalFour->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
  488. ElementalFour->SetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, 0);
  489. }
  490.  
  491. /*
  492.  
  493. for (uint32 i = 0; i < 4; ++i)
  494. {
  495. if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
  496. {
  497. pUnit->Attack(me->getVictim(), true);
  498. pUnit->setFaction(me->getFaction());
  499. }
  500. }
  501.  
  502. DoScriptText(SAY_ELEMENTALS, me);
  503. }
  504.  
  505. if (BerserkTimer <= diff)
  506. {
  507. for (uint32 i = 0; i < 5; ++i)
  508. {
  509. if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
  510. {
  511. pUnit->Attack(me->getVictim(), true);
  512. pUnit->setFaction(me->getFaction());
  513. }
  514. } */
  515.  
  516. DoScriptText(SAY_ELEMENTALS, me);
  517. DoScriptText(SAY_TIMEOVER, me);
  518.  
  519. BerserkTimer = 60000;
  520. } else BerserkTimer -= diff;
  521.  
  522. //Flame Wreath check
  523. if (FlameWreathTimer)
  524. {
  525. if (FlameWreathTimer >= diff)
  526. FlameWreathTimer -= diff;
  527. else FlameWreathTimer = 0;
  528.  
  529. if (FlameWreathCheckTime <= diff)
  530. {
  531. for (uint8 i = 0; i < 3; ++i)
  532. {
  533. if (!FlameWreathTarget[i])
  534. continue;
  535.  
  536. Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]);
  537. if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
  538. {
  539. pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID());
  540. pUnit->CastSpell(pUnit, 11027, true);
  541. FlameWreathTarget[i] = 0;
  542. }
  543. }
  544. FlameWreathCheckTime = 500;
  545. } else FlameWreathCheckTime -= diff;
  546. }
  547.  
  548. if (ArcaneCooldown && FireCooldown && FrostCooldown)
  549. DoMeleeAttackIfReady();
  550. }
  551.  
  552. void DamageTaken(Unit* /*pAttacker*/, uint32 &damage)
  553. {
  554. if (!DrinkInturrupted && Drinking && damage)
  555. DrinkInturrupted = true;
  556. }
  557.  
  558. void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell)
  559. {
  560. //We only care about inturrupt effects and only if they are durring a spell currently being casted
  561. if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST &&
  562. Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST &&
  563. Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
  564. return;
  565.  
  566. //Inturrupt effect
  567. me->InterruptNonMeleeSpells(false);
  568.  
  569. //Normally we would set the cooldown equal to the spell duration
  570. //but we do not have access to the DurationStore
  571.  
  572. switch (CurrentNormalSpell)
  573. {
  574. case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
  575. case SPELL_FIREBALL: FireCooldown = 5000; break;
  576. case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
  577. }
  578. }
  579. };
  580.  
  581. struct water_elementalAI : public ScriptedAI
  582. {
  583. water_elementalAI(Creature *c) : ScriptedAI(c) {}
  584.  
  585. uint32 CastTimer;
  586.  
  587. void Reset()
  588. {
  589. CastTimer = 2000 + (rand()%3000);
  590. }
  591.  
  592. void EnterCombat(Unit* /*who*/) {}
  593.  
  594. void UpdateAI(const uint32 diff)
  595. {
  596. if (!UpdateVictim())
  597. return;
  598.  
  599. if (CastTimer <= diff)
  600. {
  601. DoCast(me->getVictim(), SPELL_WATERBOLT);
  602. CastTimer = urand(2000,5000);
  603. } else CastTimer -= diff;
  604. }
  605. };
  606.  
  607. CreatureAI* GetAI_boss_aran(Creature* pCreature)
  608. {
  609. return new boss_aranAI (pCreature);
  610. }
  611.  
  612. CreatureAI* GetAI_water_elemental(Creature* pCreature)
  613. {
  614. return new water_elementalAI (pCreature);
  615. }
  616.  
  617. // CONVERT TO ACID
  618. CreatureAI* GetAI_shadow_of_aran(Creature* pCreature)
  619. {
  620. outstring_log("OSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry());
  621. SimpleAI* ai = new SimpleAI (pCreature);
  622.  
  623. ai->Spell[0].Enabled = true;
  624. ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
  625. ai->Spell[0].Cooldown = 5000;
  626. ai->Spell[0].First_Cast = 1000;
  627. ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
  628.  
  629. ai->EnterEvadeMode();
  630.  
  631. return ai;
  632. }
  633.  
  634. void AddSC_boss_shade_of_aran()
  635. {
  636. Script *newscript;
  637. newscript = new Script;
  638. newscript->Name = "boss_shade_of_aran";
  639. newscript->GetAI = &GetAI_boss_aran;
  640. newscript->RegisterSelf();
  641.  
  642. newscript = new Script;
  643. newscript->Name = "mob_shadow_of_aran";
  644. newscript->GetAI = &GetAI_shadow_of_aran;
  645. newscript->RegisterSelf();
  646.  
  647. newscript = new Script;
  648. newscript->Name = "mob_aran_elemental";
  649. newscript->GetAI = &GetAI_water_elemental;
  650. newscript->RegisterSelf();
  651. }
  652.  
  653. path: src\game\SpellMgr.cpp
  654.  
  655. @@ -2481,6 +2481,12 @@
  656. mSpellCustomAttr[i] |= SPELL_ATTR_CU_IGNORE_ARMOR;
  657. spellInfo->Attributes |= SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK;
  658. break;
  659. + case 29955: // !TEMP! "Arcane Missiles implict correctly target"
  660. + spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER;
  661. + break;
  662. + case 33206: // !TEMP! "Pain Suppression dispel resistance"
  663. + spellInfo->AttributesEx4 |= SPELL_ATTR_EX4_NOT_STEALABLE;
  664. + break;
  665. case 24905: // Moonkin form -> elune's touch
  666. spellInfo->EffectImplicitTargetA[2] = TARGET_UNIT_CASTER;
  667. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement