Guest User

Untitled

a guest
Feb 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.82 KB | None | 0 0
  1. diff --git a/contrib/extractor/ad.exe b/contrib/extractor/ad.exe
  2. index a98095e..81b002e 100755
  3. Binary files a/contrib/extractor/ad.exe and b/contrib/extractor/ad.exe differ
  4. diff --git a/src/game/BattleGroundDS.cpp b/src/game/BattleGroundDS.cpp
  5. diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp
  6. index b946fa7..0eeb441 100644
  7. --- a/src/game/BattleGroundMgr.cpp
  8. +++ b/src/game/BattleGroundMgr.cpp
  9. @@ -1498,7 +1498,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
  10. //for arenas there is random map used
  11. if (bg_template->isArena())
  12. {
  13. - BattleGroundTypeId arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL, BATTLEGROUND_DS, BATTLEGROUND_RV};
  14. + BattleGroundTypeId arenas[] = {/*BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL, BATTLEGROUND_DS,*/BATTLEGROUND_RV};
  15. bgTypeId = arenas[urand(0, countof(arenas)-1)];
  16. bg_template = GetBattleGroundTemplate(bgTypeId);
  17. if (!bg_template)
  18. @@ -1526,6 +1526,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
  19.  
  20. BattleGround *bg = NULL;
  21. // create a copy of the BG template
  22. +
  23. switch(bgTypeId)
  24. {
  25. case BATTLEGROUND_AV:
  26. diff --git a/src/game/BattleGroundRV.cpp b/src/game/BattleGroundRV.cpp
  27. index 866fd6c..5329558 100644
  28. --- a/src/game/BattleGroundRV.cpp
  29. +++ b/src/game/BattleGroundRV.cpp
  30. @@ -24,6 +24,14 @@
  31. #include "GameObject.h"
  32. #include "Language.h"
  33.  
  34. +/* ScriptData
  35. +SDName: Ring of Valor
  36. +SD%Complete:
  37. +SDAuthor: Bear and MichalPolko
  38. +SDComment: Need corect pilars and spikes.
  39. +SDCategory: Karazhan
  40. +EndScriptData */
  41. +
  42. BattleGroundRV::BattleGroundRV()
  43. {
  44. m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
  45. @@ -59,10 +67,9 @@ void BattleGroundRV::Update(uint32 diff)
  46. plr->TeleportTo(618, plr->GetPositionX(), plr->GetPositionY(), 29, plr->GetOrientation(), false);
  47. }
  48. m_uiTeleport = 1000;
  49. - }
  50. - else
  51. - m_uiTeleport -= diff;
  52. + }else m_uiTeleport -= diff;
  53.  
  54. + //Pilars
  55. if (m_uiPillarSwitch < diff)
  56. {
  57. for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
  58. @@ -75,7 +82,7 @@ void BattleGroundRV::Update(uint32 diff)
  59.  
  60. for (int i = 0; i < 8; ++i)
  61. {
  62. - if (GameObject * pPillar = plr->GetClosestGameObjectWithEntry(plr, m_uiObjects[i], 100))
  63. + if (GameObject * pPillar = plr->GetClosestGameObjectWithEntry(plr, m_uiObjects[i], 200.0f))
  64. {
  65. pPillar->SetLootState(GO_READY);
  66. pPillar->UseDoorOrButton(RESPAWN_ONE_DAY);
  67. @@ -84,18 +91,42 @@ void BattleGroundRV::Update(uint32 diff)
  68. break; // End on 1 succesful iteration
  69. }
  70. // + urand(0, 30000);
  71. - m_uiPillarSwitch = 120000;
  72. - }
  73. - else
  74. - m_uiPillarSwitch -= diff;
  75. + m_uiPillarSwitch = 20000;
  76. + }else m_uiPillarSwitch -= diff;
  77. +
  78. + if(m_uiSpikesStart < diff)
  79. + {
  80. + m_uiSpikesStart = 10000;
  81. + //m_bSpikes = true;
  82. + }else m_uiSpikesStart -= diff;
  83. +
  84. + if(m_uiSpikesTimer < diff)
  85. + {
  86. + if(m_bSpikes)
  87. + {
  88. + for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
  89. + {
  90. + Player * plr = sObjectMgr.GetPlayer(itr->first);
  91. +
  92. + const int m_uiObjects[4] = {194583, 194584, 194585, 194587};
  93. +
  94. + for (int i = 0; i < 4; ++i)
  95. + {
  96. + if (plr && plr->GetClosestGameObjectWithEntry(plr, m_uiObjects[i], 4.0f))
  97. + {
  98. + plr->CastSpell(plr, SPELL_SPIKES, true);
  99. + }
  100. + }
  101. + }
  102. + }
  103. + m_uiSpikesTimer = 2000;
  104. + }else m_uiSpikesTimer -= diff;
  105.  
  106. - if (m_uiFireTimer < diff)
  107. + if(m_uiSpikesStop < diff)
  108. {
  109. - // Handle Fire-lines
  110. - m_uiFireTimer = 90000 + urand(0, 30000);
  111. - }
  112. - else
  113. - m_uiFireTimer -= diff;
  114. + m_uiSpikesStop = 25000;
  115. + //m_bSpikes = false;
  116. + }else m_uiSpikesStop -= diff;
  117. }
  118. }
  119.  
  120. @@ -187,8 +218,12 @@ void BattleGroundRV::Reset()
  121. //call parent's class reset
  122. BattleGround::Reset();
  123. m_uiTeleport = 22000;
  124. - m_uiFireTimer = 90000;
  125. - m_uiPillarSwitch = 45000 + urand(0, 30000);
  126. + m_uiFireTimer = 15000;
  127. + m_uiPillarSwitch = 20000;
  128. + m_uiSpikesTimer = 1000;
  129. + m_bSpikes = true;
  130. + m_uiSpikesStart = 10000;
  131. + m_uiSpikesStop = 25000;
  132. }
  133.  
  134. bool BattleGroundRV::SetupBattleGround()
  135. diff --git a/src/game/BattleGroundRV.h b/src/game/BattleGroundRV.h
  136. index 95edb3d..19be332 100644
  137. --- a/src/game/BattleGroundRV.h
  138. +++ b/src/game/BattleGroundRV.h
  139. @@ -20,6 +20,83 @@
  140.  
  141. class BattleGround;
  142.  
  143. +enum BattlegroundRVObjectTypes
  144. +{
  145. + BG_RV_OBJECT_BUFF_1,
  146. + BG_RV_OBJECT_BUFF_2,
  147. + BG_RV_OBJECT_FIRE_1,
  148. + BG_RV_OBJECT_FIRE_2,
  149. + BG_RV_OBJECT_FIREDOOR_1,
  150. + BG_RV_OBJECT_FIREDOOR_2,
  151. +
  152. + BG_RV_OBJECT_PILAR_1,
  153. + BG_RV_OBJECT_PILAR_3,
  154. + BG_RV_OBJECT_GEAR_1,
  155. + BG_RV_OBJECT_GEAR_2,
  156. +
  157. + BG_RV_OBJECT_PILAR_2,
  158. + BG_RV_OBJECT_PILAR_4,
  159. + BG_RV_OBJECT_PULLEY_1,
  160. + BG_RV_OBJECT_PULLEY_2,
  161. +/*
  162. + BG_RV_OBJECT_PILAR_COLLISION_1,
  163. + BG_RV_OBJECT_PILAR_COLLISION_2,
  164. + BG_RV_OBJECT_PILAR_COLLISION_3,
  165. + BG_RV_OBJECT_PILAR_COLLISION_4,
  166. +*/
  167. + BG_RV_OBJECT_ELEVATOR_1,
  168. + BG_RV_OBJECT_ELEVATOR_2,
  169. + BG_RV_OBJECT_FENCE_1,
  170. + BG_RV_OBJECT_FENCE_2,
  171. + BG_RV_OBJECT_MAX,
  172. +};
  173. +
  174. +enum BattlegroundRVObjects
  175. +{
  176. + BG_RV_OBJECT_TYPE_BUFF_1 = 184663,
  177. + BG_RV_OBJECT_TYPE_BUFF_2 = 184664,
  178. + BG_RV_OBJECT_TYPE_FIRE_1 = 192704,
  179. + BG_RV_OBJECT_TYPE_FIRE_2 = 192705,
  180. +
  181. + SPELL_SPIKES = 77975,
  182. +
  183. + BG_RV_OBJECT_TYPE_FIREDOOR_2 = 192387,
  184. + BG_RV_OBJECT_TYPE_FIREDOOR_1 = 192388,
  185. + BG_RV_OBJECT_TYPE_PULLEY_1 = 192389,
  186. + BG_RV_OBJECT_TYPE_PULLEY_2 = 192390,
  187. + BG_RV_OBJECT_TYPE_FENCE_1 = 192391,
  188. + BG_RV_OBJECT_TYPE_FENCE_2 = 192392,
  189. + BG_RV_OBJECT_TYPE_GEAR_1 = 192393,
  190. + BG_RV_OBJECT_TYPE_GEAR_2 = 192394,
  191. + BG_RV_OBJECT_TYPE_ELEVATOR_1 = 194582,
  192. + BG_RV_OBJECT_TYPE_ELEVATOR_2 = 194586,
  193. +/*
  194. + BG_RV_OBJECT_TYPE_PILAR_COLLISION_1 = 194580, // axe
  195. + BG_RV_OBJECT_TYPE_PILAR_COLLISION_2 = 194579, // arena
  196. + BG_RV_OBJECT_TYPE_PILAR_COLLISION_3 = 194581, // lightning
  197. + BG_RV_OBJECT_TYPE_PILAR_COLLISION_4 = 194578, // ivory
  198. +*/
  199. + BG_RV_OBJECT_TYPE_PILAR_1 = 194583, // axe
  200. + BG_RV_OBJECT_TYPE_PILAR_2 = 194584, // arena
  201. + BG_RV_OBJECT_TYPE_PILAR_3 = 194585, // lightning
  202. + BG_RV_OBJECT_TYPE_PILAR_4 = 194587, // ivory
  203. +};
  204. +
  205. +enum BattlegroundRVData
  206. +{
  207. + BG_RV_STATE_OPEN_FENCES,
  208. + BG_RV_STATE_OPEN_PILARS,
  209. + BG_RV_STATE_CLOSE_PILARS,
  210. + BG_RV_STATE_OPEN_FIRE,
  211. + BG_RV_STATE_CLOSE_FIRE,
  212. + BG_RV_FIRE_TO_PILAR_TIMER = 20000,
  213. + BG_RV_PILAR_TO_FIRE_TIMER = 5000,
  214. + BG_RV_FIRST_TIMER = 20133,
  215. + BG_RV_WORLD_STATE_A = 0xe10,
  216. + BG_RV_WORLD_STATE_H = 0xe11,
  217. + BG_RV_WORLD_STATE = 0xe1a,
  218. +};
  219. +
  220. class BattleGroundRVScore : public BattleGroundScore
  221. {
  222. public:
  223. @@ -44,6 +121,7 @@ class BattleGroundRV : public BattleGround
  224.  
  225. void RemovePlayer(Player *plr, ObjectGuid guid);
  226. void HandleAreaTrigger(Player *Source, uint32 Trigger);
  227. + void Check();
  228. bool SetupBattleGround();
  229. virtual void Reset();
  230. virtual void FillInitialWorldStates(WorldPacket &d, uint32& count);
  231. @@ -53,5 +131,11 @@ class BattleGroundRV : public BattleGround
  232. uint32 m_uiTeleport;
  233. uint32 m_uiPillarSwitch;
  234. uint32 m_uiFireTimer;
  235. + uint32 m_uiTimer;
  236. + uint32 m_uiState;
  237. + uint32 m_uiSpikesTimer;
  238. + uint32 m_uiSpikesStart;
  239. + uint32 m_uiSpikesStop;
  240. + bool m_bSpikes;
  241. };
  242. #endif
  243. diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp
  244. index 48b458d..4a425df 100644
  245. --- a/src/game/BattleGroundSA.cpp
  246. +++ b/src/game/BattleGroundSA.cpp
  247. @@ -81,7 +81,8 @@ BattleGroundSA::BattleGroundSA()
  248. GateStatus[i] = 1;
  249.  
  250. TimerEnabled = false;
  251. - TimeST2Round = 120000;
  252. + TimeST2Round = 12000000;
  253. + //TimeST2Round = 120000;
  254. Round_timer = 0;
  255. Phase = 1;
  256. GateRoomAncientShrineDamaged = false;
  257. @@ -211,7 +212,8 @@ void BattleGroundSA::Update(uint32 diff)
  258. {
  259. SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_2ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_2ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
  260. RoundScores[1].winner = GetDefender();
  261. - RoundScores[1].time = 601000;
  262. + RoundScores[1].time = 60100000;
  263. + //RoundScores[1].time = 601000;
  264.  
  265. for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
  266. {
  267. @@ -354,9 +356,12 @@ void BattleGroundSA::ResetWorldStates()
  268. void BattleGroundSA::UpdateTimer()
  269. {
  270. uint32 end_of_round = (BG_SA_ROUNDLENGTH - Round_timer);
  271. - UpdateWorldState(BG_SA_TIMER_MINUTES, end_of_round/60000);
  272. + UpdateWorldState(BG_SA_TIMER_MINUTES, end_of_round/600000);
  273. + UpdateWorldState(BG_SA_TIMER_10SEC, (end_of_round%600000)/100000);
  274. + UpdateWorldState(BG_SA_TIMER_SEC, ((end_of_round%60000)%100000)/100000);
  275. + /*UpdateWorldState(BG_SA_TIMER_MINUTES, end_of_round/60000);
  276. UpdateWorldState(BG_SA_TIMER_10SEC, (end_of_round%60000)/10000);
  277. - UpdateWorldState(BG_SA_TIMER_SEC, ((end_of_round%60000)%10000)/1000);
  278. + UpdateWorldState(BG_SA_TIMER_SEC, ((end_of_round%60000)%10000)/1000);*/
  279. }
  280.  
  281. void BattleGroundSA::StartingEventCloseDoors()
  282. @@ -417,7 +422,7 @@ void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
  283. void BattleGroundSA::ResetBattle(uint32 winner, Team teamDefending)
  284. {
  285. Phase = SA_ROUND_TWO;
  286. - shipsTimer = 60000;
  287. + shipsTimer = 40000;
  288. shipsStarted = false;
  289.  
  290. for (int32 i = 0; i <= BG_SA_GATE_MAX; ++i)
  291. diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGroundSA.h
  292. diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
  293. index 59b3e8f..eb20ddf 100644
  294. --- a/src/game/Spell.cpp
  295. +++ b/src/game/Spell.cpp
  296. @@ -7614,14 +7614,33 @@ bool Spell::CheckTarget( Unit* target, SpellEffectIndex eff )
  297. return false;
  298. }
  299.  
  300. - // Checkout if target is behing particular object
  301. - switch(m_spellInfo->Id)
  302. +
  303. + //Check players if is behing GO
  304. + std::list<uint32> objects;
  305. +
  306. + //This is four pilars in Orgrimmar Arena (Ring of Valor).
  307. + if (m_caster->GetMapId() == 618)
  308. + {
  309. + objects.push_back(194583); // axe
  310. + objects.push_back(194584); // arena
  311. + objects.push_back(194585); // lightning
  312. + objects.push_back(194587); // ivory
  313. + }
  314. + else if(m_caster->GetMapId() == 607) //Strand of the Ancients
  315. {
  316. - case 68786: // Permafrost (Garfrost)
  317. - case 70336: // Permafrost Heroic (Garfrost)
  318. + objects.push_back(192549); //Shrine Gates in SOTA!
  319. + objects.push_back(190722); //Green
  320. + objects.push_back(190724); //Blue
  321. + objects.push_back(190723); //Amethyst
  322. + objects.push_back(190726); //Red
  323. + objects.push_back(190727); //Yellow
  324. + objects.push_back(192829); //Moon
  325. + }
  326. +
  327. + if (!objects.empty())
  328. + {
  329. + for(std::list<uint32>::iterator itr = objects.begin(); itr != objects.end(); ++itr)
  330. {
  331. - uint32 uiObjectEntry = 196485;
  332. -
  333. // Description:
  334. // code check out if player is hidden behind GO in circle with diameter equal to GO size
  335. // with center placed on the perimeter of GO
  336. @@ -7632,16 +7651,17 @@ bool Spell::CheckTarget( Unit* target, SpellEffectIndex eff )
  337. // / (T) \<- target in safty circle
  338.  
  339. std::list<GameObject*>lObjectList;
  340. - target->GetGameObjectListWithEntryInGrid(lObjectList, target, uiObjectEntry, target->GetDistance2d(m_caster));
  341. + target->GetGameObjectListWithEntryInGrid(lObjectList, target, *itr, target->GetDistance2d(m_caster));
  342. float fTargetX, fTargetY, fTargetZ;
  343. float fCasterX, fCasterY, fCasterZ;
  344. target->GetPosition(fTargetX, fTargetY, fTargetZ);
  345. m_caster->GetPosition(fCasterX, fCasterY, fCasterZ);
  346. +
  347. for (std::list<GameObject*>::iterator itr = lObjectList.begin(); itr != lObjectList.end(); ++itr)
  348. {
  349. float fObjectSize = (*itr)->GetGOInfo()->size;
  350. if (target->GetDistance2d(*itr) > fObjectSize)
  351. - continue;
  352. + continue;
  353.  
  354. float fObjectX, fObjectY, fObjectZ;
  355. (*itr)->GetPosition(fObjectX, fObjectY, fObjectZ);
  356. @@ -7650,13 +7670,64 @@ bool Spell::CheckTarget( Unit* target, SpellEffectIndex eff )
  357. fCircleY = fObjectY + fObjectSize*sin(fAlpha);
  358. fCircleX = fObjectX + fObjectSize*cos(fAlpha);
  359. if (target->GetDistance2d(fCircleX, fCircleY) <= fObjectSize)
  360. - return false;
  361. + return false;
  362. }
  363. - break;
  364. }
  365. - default: break;
  366. }
  367.  
  368. +
  369. + /*
  370. + //Check players if is behing GO
  371. + std::list<uint32> objects;
  372. + //This is four pilars in Orgrimmar Arena (Ring of Valor).
  373. + if (m_caster->GetMapId() == 618)
  374. + {
  375. + objects.push_back(194583); // axe
  376. + objects.push_back(194584); // arena
  377. + objects.push_back(194585); // lightning
  378. + objects.push_back(194587); // ivory;
  379. + }
  380. + else if (m_spellInfo->Id == 70336)
  381. + objects.push_back(70336);
  382. +
  383. + if (!objects.empty())
  384. + {
  385. + for(std::list<uint32>::iterator itr = objects.begin(); itr != objects.end(); ++itr)
  386. + {
  387. + // Description:
  388. + // code check out if player is hidden behind GO in circle with diameter equal to GO size
  389. + // with center placed on the perimeter of GO
  390. + // C<- caster
  391. + // / \<- cone of spell
  392. + // / \
  393. + // / (o) \<- shelter object
  394. + // / (T) \<- target in safty circle
  395. +
  396. + std::list<GameObject*>lObjectList;
  397. + target->GetGameObjectListWithEntryInGrid(lObjectList, target, *itr, target->GetDistance2d(m_caster));
  398. + float fTargetX, fTargetY, fTargetZ;
  399. + float fCasterX, fCasterY, fCasterZ;
  400. + target->GetPosition(fTargetX, fTargetY, fTargetZ);
  401. + m_caster->GetPosition(fCasterX, fCasterY, fCasterZ);
  402. +
  403. + for (std::list<GameObject*>::iterator itr = lObjectList.begin(); itr != lObjectList.end(); ++itr)
  404. + {
  405. + float fObjectSize = (*itr)->GetGOInfo()->size;
  406. + if (target->GetDistance2d(*itr) > fObjectSize)
  407. + continue;
  408. +
  409. + float fObjectX, fObjectY, fObjectZ;
  410. + (*itr)->GetPosition(fObjectX, fObjectY, fObjectZ);
  411. + float fAlpha = m_caster->GetAngle(fTargetX, fTargetY);
  412. + float fCircleX, fCircleY;
  413. + fCircleY = fObjectY + fObjectSize*sin(fAlpha);
  414. + fCircleX = fObjectX + fObjectSize*cos(fAlpha);
  415. + if (target->GetDistance2d(fCircleX, fCircleY) <= fObjectSize)
  416. + return false;
  417. + }
  418. + }
  419. + }*/
  420. +
  421. // Check Sated & Exhaustion debuffs
  422. if (((m_spellInfo->Id == 2825) && (target->HasAura(57724))) ||
  423. ((m_spellInfo->Id == 32182) && (target->HasAura(57723))))
  424. diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
  425. index 792c03e..bb8b7ea 100644
  426. --- a/src/game/Unit.cpp
  427. +++ b/src/game/Unit.cpp
  428. @@ -5258,6 +5258,56 @@ void Unit::RemoveArenaAuras(bool onleave)
  429. }
  430. }
  431.  
  432. +/*void Unit::HandleArenaPreparation(bool apply)
  433. +{
  434. + ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION, apply);
  435. +
  436. + if (apply)
  437. + {
  438. + // max regen powers at start preparation
  439. + SetHealth(GetMaxHealth());
  440. + SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
  441. + SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
  442. + }
  443. + else
  444. + {
  445. + // reset originally 0 powers at start/leave
  446. + SetPower(POWER_RAGE, 0);
  447. + SetPower(POWER_RUNIC_POWER, 0);
  448. + SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
  449. + SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
  450. +
  451. + // Remove all buffs with duration < 25 sec.
  452. + for(SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end();)
  453. + {
  454. + if (!(iter->second->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_UNK21) &&
  455. + // don't remove stances, shadowform, pally/hunter auras
  456. + !iter->second->IsPassive() && // don't remove passive auras
  457. + iter->second->GetAuraMaxDuration() > 0 &&
  458. + iter->second->GetAuraMaxDuration() <= 25000)
  459. + {
  460. + RemoveSpellAuraHolder(iter->second, AURA_REMOVE_BY_CANCEL);
  461. + iter = m_spellAuraHolders.begin();
  462. + }
  463. + else
  464. + ++iter;
  465. + }
  466. + }
  467. +
  468. + if (GetObjectGuid().IsPet())
  469. + {
  470. + Pet* pet = ((Pet*)this);
  471. + if (pet)
  472. + {
  473. + Unit* owner = pet->GetOwner();
  474. + if (owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
  475. + ((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS);
  476. + }
  477. + }
  478. + else
  479. + CallForAllControlledUnits(ApplyArenaPreparationWithHelper(apply),CONTROLLED_PET|CONTROLLED_GUARDIANS);
  480. +}*/
  481. +
  482. void Unit::HandleArenaPreparation(bool apply)
  483. {
  484. ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION, apply);
  485. diff --git a/src/game/Unit.h b/src/game/Unit.h
  486. index 7dd4ec6..1473fdb 100644
  487. --- a/src/game/Unit.h
  488. +++ b/src/game/Unit.h
  489. @@ -1920,11 +1920,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
  490. SpellAuraProcResult HandleManaShieldAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
  491. SpellAuraProcResult HandleModResistanceAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
  492. SpellAuraProcResult HandleRemoveByDamageChanceProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
  493. - SpellAuraProcResult HandleNULLProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
  494. - {
  495. - // no proc handler for this aura type
  496. - return SPELL_AURA_PROC_OK;
  497. - }
  498. + SpellAuraProcResult HandleObsModHealthProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
  499. + //SpellAuraProcResult HandleObsModManaProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
  500. + SpellAuraProcResult HandleNULLProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/);
  501. SpellAuraProcResult HandleCantTrigger(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
  502. {
  503. // this aura type can't proc
  504. diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
  505. index f008c1d..2c57ca0 100644
  506. --- a/src/game/UnitAuraProcHandler.cpp
  507. +++ b/src/game/UnitAuraProcHandler.cpp
  508. @@ -52,7 +52,8 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]=
  509. &Unit::HandleNULLProc, // 17 SPELL_AURA_MOD_STEALTH_DETECT
  510. &Unit::HandleRemoveByDamageProc, // 18 SPELL_AURA_MOD_INVISIBILITY
  511. &Unit::HandleNULLProc, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION
  512. - &Unit::HandleNULLProc, // 20 SPELL_AURA_OBS_MOD_HEALTH
  513. + &Unit::HandleObsModHealthProc, // 20 SPELL_AURA_OBS_MOD_HEALTH
  514. + //&Unit::HandleObsModManaProc, // 21 SPELL_AURA_OBS_MOD_MANA
  515. &Unit::HandleNULLProc, // 21 SPELL_AURA_OBS_MOD_MANA
  516. &Unit::HandleModResistanceAuraProc, // 22 SPELL_AURA_MOD_RESISTANCE
  517. &Unit::HandleNULLProc, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL
  518. @@ -1872,10 +1873,10 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
  519. // Glyph of Rejuvenation
  520. case 54754:
  521. {
  522. - if (!pVictim || pVictim->GetHealthPercent() >= 50.0f)
  523. + if (!pVictim || pVictim->GetHealthPercent() > 50.0f)
  524. return SPELL_AURA_PROC_FAILED;
  525.  
  526. - target = pVictim;
  527. + //target = pVictim;
  528. triggered_spell_id = 54755;
  529. basepoints[0] = int32(damage * triggerAmount / 100);
  530. break;
  531. @@ -5114,3 +5115,16 @@ SpellAuraProcResult Unit::HandleRemoveByDamageChanceProc(Unit* pVictim, uint32 d
  532.  
  533. return SPELL_AURA_PROC_FAILED;
  534. }
  535. +
  536. +SpellAuraProcResult Unit::HandleObsModHealthProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
  537. +{
  538. + if (triggeredByAura->GetId() == 44521)
  539. + {
  540. + SetHealth(GetMaxHealth());
  541. + SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
  542. + SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
  543. + }
  544. +
  545. + return SPELL_AURA_PROC_OK;
  546. +}
  547. +
Add Comment
Please, Sign In to add comment