Advertisement
Guest User

npcs_dm_battle

a guest
Aug 4th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 11.61 KB | None | 0 0
  1. /*******************************************************************************************
  2. * __ __ _ *
  3. * /\ \ \___ _ __ ___ ___ ___ / _| |_ *
  4. * / \/ / _ \| '_ ` _ \/ __|/ _ \| |_| __| *
  5. * / /\ / (_) | | | | | \__ \ (_) | _| |_ *
  6. * \_\ \/ \___/|_| |_| |_|___/\___/|_| \__| - www.Nomsoftware.com - *
  7. * The policy of Nomsoftware states: Releasing our software *
  8. * or any other files are protected. You cannot re-release *
  9. * anywhere unless you were given permission. *
  10. * (C) Nomsoftware 'Nomsoft' 2011-2012. All rights reserved. *
  11. ********************************************************************************************/
  12. /**********************************************************
  13. **********************************************************
  14. * Title: *
  15. * NPC Arena Battle(Dire Maul) *
  16. * *
  17. * Idea by: QQrofl *
  18. * Sub-Ideas by: Foereaper *
  19. * Scripted by: QQrofl *
  20. * Fondled by: Faded *
  21. * Mental Support by: Foereaper *
  22. * *
  23. * (C)Nomsoftware 'Nomsoft' 2012 *
  24. *##################################*#####################*
  25. * MAIN SPAWN *
  26. * Arena Commander: *
  27. * -3815.866699f, 1102.770874f, 132.355194f, 6.182988f *
  28. *########################################################*/
  29. #include "ScriptPCH.h"
  30. using namespace std;
  31.  
  32. /* Player */
  33. uint64 m_PlayerGUID;
  34. string playerName;
  35. /* Is Active */
  36. bool isBattleActive = false;
  37. bool hasLogged = false;
  38. bool inZone = true;
  39. /* Is Bosses Dead */
  40. int isWaveBossDead = 0;
  41.  
  42. #define MSG_FIGHT_COMPUTER "I would like to fight!"
  43.  
  44. enum Events
  45. {
  46. EVENT_NONE,
  47. EVENT_CHECK_ACTIVITY, // Check Activity of the battle : if true or false ? can start?
  48. EVENT_CHECK_WAVES, // Checks the waves so it can move on to the next event, if it is allowed
  49. EVENT_CHECK_PLAYER,
  50. EVENT_FIRST_WAVE,
  51. EVENT_FIRST_WAVE_TREAT,
  52. EVENT_FIRST_WAVE_ELITE,
  53. EVENT_SECOND_WAVE,
  54. EVENT_SECOND_WAVE_TREAT,
  55. EVENT_SECOND_WAVE_ELITE,
  56. EVENT_FINAL_WAVE_BOSS,
  57.     EVENT_COMPLETED_WAVES,
  58. };
  59.  
  60. enum bPhases
  61. {
  62. /* Final Boss Phases */
  63. PHASE_START_COMBAT,
  64. PHASE_END,
  65. };
  66.  
  67. enum SpellIds
  68. {
  69. /* First Wave Spells */
  70. /* Red Blood Guard */
  71. SPELL_BERSERKER_CHARGE = 38907,
  72. SPELL_MORTAL_STRIKE = 68783,
  73. SPELL_DEEP_WOUNDS = 23256,
  74. /* First Wave Elite Spells */
  75. /* `- Spore Healer */
  76. SPELL_HEAL_REGROWTH = 48443, //heal+H.O.T.
  77. SPELL_HEAL_NORMAL = 48378, //heal normal
  78. SPELL_HEAL_REJUV = 48441, //H.O.T.
  79. SPELL_HEAL_AURA_HOTS = 38299, // Aura hots
  80. SPELL_FLASH_HEAL = 48071,
  81. SPELL_POWER_WORD_SHIELD = 20697, // Absorbs a ton of damage
  82. SPELL_HEAL_LIFEBLOOM = 67958,
  83. /* `- Hank the Tank */
  84. SPELL_BATTLE_STANCE = 2487, //warrior bstance
  85. SPELL_SHOUT_BUFF = 47436,   //attk pwr self buff
  86. SPELL_TANK_CHARGE = 11578//warrior charge
  87. SPELL_GROUND_STOMP = 47502, //thunderclap
  88. SPELL_EXECUTE = 47471//normal strike
  89. SPELL_TANK_STRIKE = 47450//normal strike
  90. SPELL_INCREASE_BLOCK_VALUE = 67515, // Increases block value
  91. SPELL_SHIELD_BLOCK = 69580, // Blocks attacks
  92. SPELL_INCREASE_DEFENSE_RATING = 60343, // Increases Defense by 180+
  93. SPELL_INCREASE_DODGE_RATING = 18062, // Increase dodge by 96
  94. SPELL_REND = 47465, // Rends the target ~Bleeds
  95. SPELL_SHIELD_BASH = 47488, // Bashes the target with a shield
  96. /* Second Wave Spells */
  97. SPELL_ROGUE_STEALTH = 1784,
  98. SPELL_ROGUE_CHEAP_SHOT = 1833, //in stealth only
  99. SPELL_ROGUE_STRIKE = 48660,
  100. SPELL_ROGUE_FINISHER = 48668,
  101. SPELL_ROGUE_VANISH = 26889, //idea here is to make the sidekicks(and main?) vanish in/out of the fight
  102. SPELL_ROGUE_KICK = 27814,
  103. SPELL_ROGUE_BACKSTAB = 52540,
  104. SPELL_ROGUE_RUPTURE = 48672,
  105. SPELL_ROGUE_KIDNEY_SHOT = 41389,
  106. /* Second Wave Treat Spells */
  107. SPELL_UNHOLY_BONE_SHIELD = 49222,
  108. SPELL_UNHOLY_AOE = 49938,
  109. SPELL_UNHOLY_PLAGUE_STRIKE = 49921,
  110. SPELL_UNHOLY_STANGULATE = 47476,
  111. SPELL_UNHOLY_DEATH_STRIKE = 49924,
  112. SPELL_UNHOLY_ARMY = 42650, // <- should happen with both NPC's simultaneously
  113. SPELL_ENRAGE = 59707,
  114. /* Second Wave Elite Spells */
  115. /* `- Rider Brutes */
  116. SPELL_RIDERS_LIGHTNING = 59159, // aoe
  117. SPELL_RIDERS_CHAIN_LIGHTNING = 49269, // aoe
  118. SPELL_RIDERS_MOONFIRE = 48463,
  119. SPELL_RIDERS_STORM = 48467, // aoe
  120. /* `- Rider Healer */
  121. SPELL_RIDERS_STAM_BUFF = 48161, // fortitude buff
  122. SPELL_RIDERS_SHIELD = 48066, // absorbs damage
  123. SPELL_RIDERS_HEALING_BOLT = 66097,
  124. SPELL_RIDERS_RENEW = 48068,
  125. SPELL_RIDERS_GREATER_HEAL = 48063,
  126. /* Final Wave Boss Spells */
  127. SPELL_DRAGON_FIRE_SHIELD = 57108, //Reduces damage by 95% for 5s
  128. SPELL_DRAGON_ENGULF = 74562,
  129. SPELL_DRAGON_BREATH = 74525,
  130. SPELL_DRAGON_TAIL_WHIP = 74531,
  131. SPELL_DRAGON_BERSERK = 26662,
  132. SPELL_DRAGON_CLAW = 74524,
  133. SPELL_DRAGON_MASSIVE_FLAMESTRIKE = 26558,
  134. //SPELL_DRAGON_FIREBALL_BARRAGE = 37541,
  135. /* Others */
  136. SPELL_TELEPORT_VISUAL = 64446,
  137. /* Disable Class Spells */
  138. SPELL_VANISH_1 = 1856,
  139. SPELL_VANISH_2 = 1857,
  140. SPELL_VANISH_3 = 26889,
  141. };
  142.  
  143. enum SpawnIds
  144. {
  145. /* First Wave */
  146. NPC_RED_BLOOD_GUARD = 88001,
  147. NPC_RED_BLOOD_GUARD_MINI = 88002,
  148. NPC_RED_BLOOD_GUARD_MINI2 = 88003,
  149. NPC_RED_BLOOD_GUARD_MINI3 = 88004,
  150. /* First Wave Treat */
  151. NPC_WAVE_SPAWN_TRIGGER = 88500,
  152. NPC_GARM_WATCHER = 80050,
  153. NPC_FRIGID_PROTO_DRAKE = 80051,
  154. NPC_OSTERKILGR = 80052,
  155. NPC_BLIGHT_FALCONER = 80053,
  156. NPC_CONVERTED_HERO = 80054,
  157. NPC_PORTAL = 88501,
  158.     /* First Wave Elite */ /* NPC : Display ID */
  159. NPC_HANK_THE_TANK = 88011// Tank: 27930 Paladin Tank BE
  160. NPC_FIELD_MEDIC =   88012// Healer: 17544 Spore thing
  161. /* Second Wave */
  162. NPC_ROGUE_INITIATE = 88013, // Main rogue: 24918
  163. NPC_ROGUE_INITIATE_1 =  88014, // Sidekick(easier to kill): 24919
  164. NPC_ROGUE_INITIATE_2 = 88015, // Sidekick(easier to kill): 24919
  165. /* Second Wave Treat */
  166. NPC_THE_UNHOLY = 88016, // Main: 25446
  167. NPC_THE_UNHOLY_TWIN = 88017, // Twin: 25496
  168. NPC_THE_UNHOLY_PET = 88018, // Their Pet: 25467 (no spells, normal attacks just to occupy the player) Maybe just SPELL_PET_BITE ?
  169. /* Second Wave Elite */
  170. NPC_RIDERS_OFTHE_ICE =  88019, // Main/Healer: 25083
  171. NPC_RIDERS_OFTHE_ICE_1 =    88020, // Brute: 25082
  172. NPC_RIDERS_OFTHE_ICE_2 = 88021, // Brute: 25082
  173. /* Final Wave Boss */
  174. NPC_DRAGON_BOSS = 88022, // Dragon: 25015
  175. NPC_DRAGON_BOSS_TRIGGER = 88023,
  176. GOBJECT_DRAGON_BOSS_RUNE = 183036,
  177. };
  178.  
  179. enum eEnums
  180. {
  181. ITEM_INTRAVENOUS_HEALING_POTION = 44698, // You can change the items they can heal with here
  182. DIRE_MAUL_ZONE = 2557,
  183. DIRE_MAUL_AREA = 3217, //3217,
  184. PVP_END_TOKEN = 20558, // You can easily change this
  185. SOUND_HORN_WAVE_START = 7054,
  186. SOUND_WAVE_COMPLETE = 8571,
  187. };
  188.  
  189. struct DragonMove
  190. {
  191. uint32 gobject;
  192. uint32 spellId;
  193. float x, y, z, o;
  194. };
  195.  
  196. uint32 spellDisables[] = { SPELL_VANISH_1, SPELL_VANISH_2, SPELL_VANISH_3 };
  197.  
  198. static Position sTeleOut[] =
  199. {
  200. { -4286.56f, 1330.970f, 161.21f, 0.019994f }
  201. };
  202.  
  203. static DragonMove sMoveData[] =
  204. {
  205. {GOBJECT_DRAGON_BOSS_RUNE, SPELL_DRAGON_MASSIVE_FLAMESTRIKE, -3786.241943f, 1096.538452f, 153.903366f, 6.257603f }
  206. };
  207.  
  208. #define MAX_WAVE_SPAWN_LOCATIONS 20
  209. const uint32 waveList[MAX_WAVE_SPAWN_LOCATIONS] =
  210. {
  211. /* First Wave Ids */
  212. NPC_RED_BLOOD_GUARD,
  213. /* First Wave Treat Ids */
  214. NPC_WAVE_SPAWN_TRIGGER, NPC_GARM_WATCHER, NPC_FRIGID_PROTO_DRAKE, NPC_OSTERKILGR, NPC_BLIGHT_FALCONER, NPC_CONVERTED_HERO, NPC_PORTAL,
  215. /* First Wave Elite Ids */
  216. NPC_HANK_THE_TANK, NPC_FIELD_MEDIC,
  217. /* Second Wave Ids */
  218. NPC_ROGUE_INITIATE, NPC_ROGUE_INITIATE_1, NPC_ROGUE_INITIATE_2,
  219. /* Second Wave Treat Ids */
  220. NPC_THE_UNHOLY, NPC_THE_UNHOLY_TWIN, NPC_THE_UNHOLY_PET,
  221. /* Second Wave Elite Ids */
  222. NPC_RIDERS_OFTHE_ICE, NPC_RIDERS_OFTHE_ICE_1, NPC_RIDERS_OFTHE_ICE_2,
  223. /* Final Wave Boss */
  224. NPC_DRAGON_BOSS,
  225. };
  226.  
  227. static Position m_WaveSpawns[] =
  228. {
  229. /* X Y Z O */
  230. /* All Waves Spawns */
  231. { -3756.859863f, 1097.575317f, 131.969559f, 6.159780f },
  232. /* First Wave Treat */
  233. { -3760.98f, 1082.98f, 131.96f, 0.214342f }, // Portal 1 Location
  234. { -3751.31f, 1106.84f, 131.96f, 5.364266f } // Portal 2 Location
  235. };
  236.  
  237. void MessageOnWave(Creature * me, uint32 eventId)
  238. {
  239. stringstream ss;
  240. switch(eventId)
  241. {
  242. case EVENT_CHECK_ACTIVITY: // Before Wave 1 starts
  243. ss << playerName.c_str()
  244. << " get ready! Next wave begins in 10 seconds!";
  245. break;
  246.  
  247. case EVENT_CHECK_WAVES:
  248. {
  249. if( isWaveBossDead == 1)
  250. {
  251. ss << "I can't believe it! "
  252. << playerName.c_str()
  253. << " has killed the Red Blood Guard! We will see next wave, which is in 25 seconds, gear up!";
  254. }
  255. else if (isWaveBossDead == 2)
  256. {
  257. ss << "This is unreal! "
  258. << playerName.c_str()
  259. << " has dominated the treat wave! Next wave is in 35 seconds! Get ready for a good experience.";
  260. }
  261. else if (isWaveBossDead == 3)
  262. {  
  263. ss << "Holy shit! "
  264. << playerName.c_str()
  265. << " has demolished the elite! Good luck getting through the others... Second wave begins in 25 seconds! You may want to heal...";
  266. }
  267. else if (isWaveBossDead == 4)
  268. {
  269. ss << "Excellent! "
  270. << playerName.c_str()
  271. << " has stricken down the rogues! Well done! Next wave is in 35 seconds, be prepared!";
  272. }
  273. else if (isWaveBossDead == 5)
  274. {
  275. ss << "Zing! I can't believe what I'm seeing! "
  276. << playerName.c_str()
  277. << " has defeated the Unholy Twins, EPIC WIN! Next wave in 40 seconds, get ready!";
  278. }
  279. else if (isWaveBossDead == 6)
  280. {
  281. ss << "WOW! No Way! "
  282. << playerName.c_str()
  283. << " has stopped the riders dead in their tracks. Great job! Final wave beings in 35 seconds, get buffed up!";
  284. }
  285. else if (isWaveBossDead == 7)
  286. {
  287. ss << "Just...a moment of silence. "
  288. << playerName.c_str()
  289. << " has just won this entire challenge! Congratulations!";
  290. }
  291. }break;
  292.  
  293. case EVENT_FIRST_WAVE:
  294. ss << "First wave has begun!"
  295. << " From the blood gates of hell, here is,"
  296. << " Arena Master, Red Blood Guard!";
  297. break;
  298.  
  299. case EVENT_FIRST_WAVE_TREAT:
  300. ss << "First treat wave has begun!"
  301. << " Bounding across the continent, you will face many challenges!";
  302. break;
  303.  
  304. case EVENT_FIRST_WAVE_ELITE:
  305. ss << "First elite wave has begun!"
  306. << " Say your last words, this elite team wont give you another chance to."
  307. << " Entering the arena, Hank the Tank and his heal happy spore companion. Prepare for the worst!";
  308. break;
  309.  
  310. case EVENT_SECOND_WAVE:
  311. ss << "Second wave has begun!"
  312. << " Trust your eyes and dont blink, this team of initiates only provide pain!"
  313. << " The quick, the stealthy.. The Rogue Initiates, maybe run?";
  314. break;
  315.  
  316. case EVENT_SECOND_WAVE_TREAT:
  317. ss << "Second treat wave has begun!"
  318. << " From the depths of the underworld, they were sent back here to take care of business!"
  319. << " The deadliest duo, the Unholy Twins - Seal your fate, destroy them!";
  320. break;
  321.  
  322. case EVENT_SECOND_WAVE_ELITE:
  323. ss << "Second elite wave has begun!"
  324. << " The Riders of the Ice have entered the arena!"
  325. << " Don't be fooled by their size, they will walk all over you. Attack!";
  326. break;
  327.  
  328. case EVENT_FINAL_WAVE_BOSS:
  329. ss << "From deep into the Earth's core "
  330. << " there lies a entirely different aspect of a challenge. "
  331. << " Get Ready! Arena Dragon is here!";
  332. break;
  333. }
  334. me->MonsterYell(ss.str().c_str(), LANG_UNIVERSAL, me->GetGUID());
  335. }
  336.  
  337. void DoSendCompleteMessage(string who)
  338. {
  339. stringstream ss;
  340. ss << who.c_str()
  341. << " has completed the Dire Maul Arena Event!"
  342. << "The event is now opened and ready for another victim!";
  343. sWorld->SendGlobalText(ss.str().c_str(), NULL);
  344. }
  345.  
  346. void AddEndRewards(Player * player, uint32 honoramount, uint32 tokenId, uint32 tokenAmount)
  347. {
  348. uint32 curHonor = player->GetHonorPoints();
  349. player->SetHonorPoints(curHonor + honoramount);
  350. ChatHandler(player->GetSession()).PSendSysMessage("Added %u honor!", honoramount);
  351. player->AddItem(tokenId, tokenAmount);
  352. }
  353. /* End Battle Functions */
  354. void DoEndBattle(Creature * me)
  355. {
  356. isBattleActive = false;
  357. m_PlayerGUID = NULL;
  358. playerName = "";
  359. me->DespawnOrUnsummon(1);
  360. }
  361.  
  362. void DoEndBattle(Creature * me, SummonList summons)
  363. {
  364. isBattleActive = false;
  365. m_PlayerGUID = NULL;
  366. playerName = "";
  367. summons.DespawnAll();
  368. me->DespawnOrUnsummon(1);
  369. }
  370. /* Increase Health Function ~ Boss Fight Pet */
  371. void DoIncreaseHealth(Creature * me, float size)
  372. {
  373. me->SetHealth(me->GetMaxHealth()+40000);
  374. me->SetFloatValue(OBJECT_FIELD_SCALE_X, size);
  375. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement