Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.25 KB | None | 0 0
  1. --##############################################################
  2. --# __ ___ _________ ____________ _____ #
  3. --#| | / / | | | | / _ \ #
  4. --#| | / / | ______| |____ ____| / / \ \ #
  5. --#| | / / | | | | / / \ \ #
  6. --#| |/ / | |______ | | / /_____\ \ #
  7. --#| / | | | | / \ #
  8. --#| \ | ______| | | / ___________ \ #
  9. --#| |\ \ | | | | / / \ \ #
  10. --#| | \ \ | |______ | | / / \ \ #
  11. --#| | \ \ | | | | / / \ \ #
  12. --#|__| \__\ |_________| |__| /__/ \__\ #
  13. --# #
  14. --# Copyright Keta #
  15. --# #
  16. --##############################################################
  17.  
  18. ------------------------------------------------------------------
  19. -------------------------> Locals <-------------------------------
  20. local cityname
  21. local def_gname
  22. local att_gname
  23. local count = 0
  24. local gameisrunning = 0
  25. local stormwinddef = 0
  26. local stormwindatt = 0
  27. local gameislaunching = 0
  28. local flagtakenfirsttime_a = 0
  29. local flagtakenfirsttime_d = 0
  30. local flagpoints = 0
  31. local boss_state = 0
  32. ------------------------------------------------------------------
  33.  
  34. function DefenderNPC_OnGossip(pUnit, event, player)
  35. if player:IsInGuild() then
  36. if (count == 0) then
  37. if player:GetGuildLeader() == player:GetName() then
  38. pUnit:GossipCreateMenu(50, player, 0)
  39. pUnit:GossipMenuAddItem(0, "Myself and my guild are ready to defend our city!", 1, 0)
  40. pUnit:GossipMenuAddItem(0, "[Exit]", 2, 0)
  41. pUnit:GossipSendMenu(player)
  42. else
  43. player:SendBroadcastMessage("You are not the guild leader, you do not have permission to initiate a guild war event. Contact you guild leader to initiate this event")
  44. end
  45. end
  46. if (count == 1) then
  47. pUnit:GossipCreateMenu(51, player, 0)
  48. if def_gname == player:GetGuildName() then
  49. pUnit:GossipMenuAddItem(0, "I am from " .. def_gname .. ". The fight is located in " .. cityname .. ". Let me aid them!", 8, 0)
  50. elseif player:GetGuildLeader() == player:GetName() then
  51. pUnit:GossipMenuAddItem(0, "Myself and my guild wish to challenge " .. def_gname .. " in " .. cityname .. ", and try to take over the city, and claim it for my guild.", 7, 0)
  52. pUnit:GossipMenuAddItem(0, "[Exit]", 2, 0)
  53. pUnit:GossipSendMenu(player)
  54. end
  55. end
  56. if (count == 2) then
  57. pUnit:GossipCreateMenu(51, player, 0)
  58. if def_gname == player:GetGuildName() then
  59. pUnit:GossipMenuAddItem(0, "I am from " .. def_gname .. ". The fight is located in " .. cityname .. ". Let me aid them!", 8, 0)
  60. elseif att_gname == player:GetGuildName() then
  61. pUnit:GossipMenuAddItem(0, "I am from " .. att_gname .. ". The fight is located in " .. cityname .. ". Let me aid them!", 9, 0)
  62. end
  63. pUnit:GossipMenuAddItem(0, "[Exit]", 2, 0)
  64. pUnit:GossipSendMenu(player)
  65. end
  66. else
  67. player:SendBroadcastMessage("You are not currently in a guild. Join one of the guild on the server, or create your own, to enter the game")
  68. end
  69. end
  70.  
  71. function DefenderNPC_Select(pUnit, event, player, id, intid, code)
  72. if (intid == 1) then
  73. pUnit:GossipCreateMenu(52, player, 0)
  74. pUnit:GossipMenuAddItem(0, "Choose a city", 1, 0)
  75. pUnit:GossipMenuAddItem(1, "[Stormwind]", 3, 0)
  76. --pUnit:GossipMenuAddItem(1, "[Ironforge]", 4, 0)
  77. --pUnit:GossipMenuAddItem(1, "[Darnassus]", 5, 0)
  78. --pUnit:GossipMenuAddItem(1, "[Exodar]", 6, 0)
  79. pUnit:GossipMenuAddItem(0, "[Nevemind]", 2, 0)
  80. pUnit:GossipSendMenu(player)
  81. end
  82.  
  83. if (intid == 2) then
  84. player:GossipComplete()
  85. end
  86.  
  87. if (intid == 7) then
  88. SendWorldMessage("" .. player:GetGuildName() .. " has challenged " .. def_gname .. " in " .. cityname .. " and will try and take over the city!", 2)
  89. if math.random(1, 2) == 1 then
  90. player:Teleport(0, -8910.532227, 510.447845, 94, 2.054598)
  91. elseif math.random(1, 2) == 2 then
  92. player:Teleport(0, -8956.366211, 568.134827, 94, 5.616378)
  93. att_gname = player:GetGuildName()
  94. end
  95. end
  96.  
  97. if (intid == 9) then
  98. if math.random(1, 2) == 1 then
  99. player:Teleport(0, -8910.532227, 510.447845, 94, 2.054598)
  100. elseif math.random(1, 2) == 2 then
  101. player:Teleport(0, -8956.366211, 568.134827, 94, 5.616378)
  102. end
  103. end
  104.  
  105. if (intid == 8) then
  106. player:Teleport(0, -8397.78418, 278.347534, 121, 2.238385)
  107. end
  108.  
  109. if (intid == 3) then
  110. SendWorldMessage("The Guild War event has initiated by " .. player:GetName() .. " and is being held in Stormwind City. Those of you who has a guild in the fight, help them in this heroic battle!", 2)
  111. count = count + 1
  112. def_gname = player:GetGuildName()
  113. player:SendBroadcastMessage("The battle will begin soon. Gather your guild members")
  114. cityname = "Stormwind City"
  115. player:Teleport(0, -8397.921875, 278.896240, 121, 2.23)
  116. end
  117.  
  118. if (intid == 4) then
  119. count = count + 1
  120. player:SendBroadcastMessage("The battle will begin soon. Gather your guild members")
  121. cityname = "Ironforge"
  122. player:Teleport(xxx)
  123. end
  124.  
  125. if (intid == 5) then
  126. count = count + 1
  127. player:SendBroadcastMessage("The battle will begin soon. Gather your guild members")
  128. cityname = "Darnassus"
  129. player:Teleport(xxx)
  130. end
  131.  
  132. if (intid == 6) then
  133. count = count + 1
  134. player:SendBroadcastMessage("The battle will begin soon. Gather your guild members")
  135. cityname = "Exodar"
  136. player:Teleport(xxx)
  137. end
  138. end
  139.  
  140. RegisterUnitGossipEvent(135790, 1, "DefenderNPC_OnGossip")
  141. RegisterUnitGossipEvent(135790, 2, "DefenderNPC_Select")
  142.  
  143. ----------------------- Stormwind -------------------------
  144. function StormwindStarterNpc(pUnit, event, player)
  145. pUnit:GossipCreateMenu(100, player, 0)
  146. if stormwinddef == 0 then
  147. pUnit:GossipMenuAddItem(0, "We are ready. Send us out, when you are ready.", 1, 0)
  148. elseif gameislaunching >= 2 then
  149. pUnit:StopChannel()
  150. pUnit:GossipMenuAddItem(0, "I cannot stay here when my city is burning. Send me out to fight!", 3, 0)
  151. end
  152. pUnit:GossipMenuAddItem(0, "[Exit]", 2, 0)
  153. pUnit:GossipSendMenu(player)
  154. end
  155.  
  156. function StormwindStarterNpc_Select(pUnit, event, player, id, intid, code)
  157. if (intid == 1) then
  158. def_gname = player:GetGuildName()
  159. pUnit:RemoveEvents()
  160. pUnit:SendChatMessage(12, 0, "I see you are ready to defend your city. I will initiate the summoning ritual")
  161. player:GossipComplete()
  162. stormwinddef = stormwinddef + 1
  163. gameislaunching = gameislaunching + 1
  164. pUnit:ChannelSpell(13540, pUnit)
  165. end
  166.  
  167. if (intid == 2) then
  168. player:GossipComplete()
  169. end
  170.  
  171. if (intid == 3) then
  172. player:SetFaction(1)
  173. player:FlagPvP()
  174. player:CastSpell(64446)
  175. player:LearnSpell(39957)
  176. player:Teleport(0, -8529.256836, 443.536133, 105, 2.23)
  177. end
  178. end
  179.  
  180. RegisterUnitGossipEvent(880007, 1, "StormwindStarterNpc")
  181. RegisterUnitGossipEvent(880007, 2, "StormwindStarterNpc_Select")
  182.  
  183. -----------------------------------------------------------
  184.  
  185. function StormwindStarterNpc_2(pUnit, event, player)
  186. pUnit:GossipCreateMenu(100, player, 0)
  187. if stormwindatt == 0 then
  188. pUnit:GossipMenuAddItem(0, "We are ready. Send us in, when you are ready.", 1, 0)
  189. elseif gameislaunching == 2 then
  190. pUnit:StopChannel()
  191. pUnit:GossipMenuAddItem(0, "Im not staying here for one second more, send me in!", 3, 0)
  192. elseif gameislaunching == 3 then
  193. pUnit:StopChannel()
  194. pUnit:GossipMenuAddItem(0, "Im not staying here for one second more, send me in!", 4, 0)
  195. end
  196. pUnit:GossipMenuAddItem(0, "[Exit]", 2, 0)
  197. pUnit:GossipSendMenu(player)
  198. end
  199.  
  200. function StormwindStarterNpc_Select2(pUnit, event, player, id, intid, code)
  201. if (intid == 1) then
  202. cityname = "Stormwind City"
  203. att_gname = player:GetGuildName()
  204. pUnit:RemoveEvents()
  205. pUnit:SendChatMessage(12, 0, "I see you are ready to try and take over this city. I will initiate the summoning ritual")
  206. player:GossipComplete()
  207. stormwindatt = stormwindatt + 1
  208. gameislaunching = gameislaunching + 1
  209. pUnit:ChannelSpell(13540, pUnit)
  210. end
  211.  
  212. if (intid == 2) then
  213. player:GossipComplete()
  214. end
  215.  
  216. if (intid == 3) then
  217. gameislaunching = gameislaunching + 1
  218. player:SetFaction(2)
  219. player:FlagPvP()
  220. player:CastSpell(64446)
  221. player:LearnSpell(44797)
  222. player:Teleport(0, -8888.982422, 573.122192, 93.541443, 0.680570)
  223. pUnit:SpawnCreature(100203, -8441.873947, 333.776639, 123.00000, 2.225899, 1, 900000)
  224. pUnit:SpawnGameObject(300300, -8306.773438, 546.262085, 99.602203, 5.419337, 900000)
  225. pUnit:SpawnGameObject(300301, -8989.271484, 850.816528, 29.620016, 2.305417, 900000)
  226. pUnit:SpawnGameObject(300302, -8815.850586, 360.302002, 100.586555, 4.715415, 900000)
  227. pUnit:SpawnGameObject(300303, -8761.326172, 1139.142700, 92.520309, 4.861132, 900000)
  228. pUnit:SpawnGameObject(300304, -8514.320313, 860.751465, 111.039368, 3.761577, 900000)
  229. print("Gameobjects placed")
  230. --SendWorldMessage("" .. def_gname .. " and " .. att_gname .. " is fighting in " .. cityname .. " and trying to take over the city! If you are a member of one of these guild, go aid them!", 2)
  231. pUnit:RegisterEvent("gametime", 900000, 1)
  232. end
  233.  
  234. if (intid == 4) then
  235. player:SetFaction(2)
  236. player:FlagPvP()
  237. player:CastSpell(64446)
  238. player:LearnSpell(44797)
  239. player:Teleport(0, -8888.982422, 573.122192, 93.541443, 0.680570)
  240. end
  241. end
  242.  
  243. function gametime(pUnit, event)
  244. print("Game Ended")
  245. pUnit:RemoveEvents()
  246. if boss_state == 1 then
  247. for k, v in pairs(GetPlayersInWorld()) do
  248. if v:HasSpell(39957) then
  249. v:Teleport(571, 1373.681519, -3208.5271, 163, 5)
  250. v:UnlearnSpell(39957)
  251. end
  252. end
  253. elseif boss_state == 0 then
  254. for k, v in pairs(GetPlayersInWorld()) do
  255. if v:HasSpell(44797) then
  256. v:Teleport(571, 1373.681519, -3208.5271, 163, 5)
  257. v:UnlearnSpell(44797)
  258. end
  259. end
  260. end
  261. end
  262.  
  263. RegisterUnitGossipEvent(880006, 1, "StormwindStarterNpc_2")
  264. RegisterUnitGossipEvent(880006, 2, "StormwindStarterNpc_Select2")
  265.  
  266. function flagpad_OnUse(GameObject,_,player)
  267. if player:HasAura(14268) then
  268. flagpoints = flagpoints + 1
  269. player:RemoveAura(14268)
  270. player:CastSpell(47292)
  271. player:SendBroadcastMessage("You have scored a point, and your opponents has been weakened!")
  272. if player:HasSpell(41855) then -- Dwarven District
  273. player:UnlearnSpell(41855)
  274. elseif player:HasSpell(41853) then -- Mage Quater
  275. player:UnlearnSpell(41853)
  276. elseif player:HasSpell(41865) then -- Old Town
  277. player:UnlearnSpell(41865)
  278. elseif player:HasSpell(41866) then -- The Park
  279. player:UnlearnSpell(41866)
  280. elseif player:HasSpell(41868) then -- Cathedral Square
  281. player:UnlearnSpell(41868)
  282. end
  283. else
  284. player:SendBroadcastMessage("You do not currently carry a flag. Take a flag from any of the flag locations, and capture it here.")
  285. end
  286. end
  287.  
  288. RegisterGameObjectEvent(100200, 4, "flagpad_OnUse")
  289.  
  290. function scoretablet_OnUse(GameObject,_,player)
  291. player:SendBroadcastMessage("The defenders has lost " .. flagpoints .. " flags so far!")
  292. end
  293.  
  294. RegisterGameObjectEvent(100201, 4, "scoretablet_OnUse")
  295.  
  296. function person_OnDeath(event, pPlayer)
  297. if pPlayer:HasAura(14268) then
  298. if pPlayer:HasSpell(41855) then -- Dwarven District
  299. pPlayer:SpawnGameObject(300300, -8306.773438, 546.262085, 99.602203, 5.419337, 0)
  300. pPlayer:RemoveAura(14268)
  301. pPlayer:UnlearnSpell(41855)
  302. elseif pPlayer:HasSpell(41853) then -- Mage Quater
  303. pPlayer:SpawnGameObject(300301, -8989.271484, 850.816528, 29.620016, 2.305417, 0)
  304. pPlayer:RemoveAura(14268)
  305. pPlayer:UnlearnSpell(41853)
  306. elseif pPlayer:HasSpell(41865) then -- Old Town
  307. pPlayer:SpawnGameObject(300302, -8815.850586, 360.302002, 100.586555, 4.715415, 0)
  308. pPlayer:RemoveAura(14268)
  309. pPlayer:UnlearnSpell(41865)
  310. elseif pPlayer:HasSpell(41866) then -- The Park
  311. pPlayer:SpawnGameObject(300303, -8761.326172, 1139.142700, 92.520309, 4.861132, 0)
  312. pPlayer:RemoveAura(14268)
  313. pPlayer:UnlearnSpell(41866)
  314. elseif pPlayer:HasSpell(41868) then -- Cathedral Square
  315. pPlayer:SpawnGameObject(300304, -8514.320313, 860.751465, 111.039368, 3.761577, 0)
  316. pPlayer:RemoveAura(14268)
  317. pPlayer:UnlearnSpell(41868)
  318. end
  319. end
  320. end
  321.  
  322. RegisterServerHook(6, "person_OnDeath")
  323.  
  324. -------------------------------------------------------------------------------------------
  325.  
  326. function Dwarvendistrict_OnUse(GameObject,_,player) -- Dwarvendistrict
  327. if player:GetFaction() == 1 then
  328. player:SendBroadcastMessage("This is one of your flags. Protect it at all cost!")
  329. elseif player:GetFaction() == 2 then
  330. if player:HasAura(14268) then
  331. else
  332. if player:HasAura(1784) or player:HasAura(66) or player:HasAura(642) or player:HasAura(10278) or player:HasAura(5599) or player:HasAura(1022) then
  333. player:SendBroadcastMessage("You cant take the flag while being invisible, invulnerable to any sort of damage or stealthed")
  334. else
  335. player:CastSpell(14268)
  336. player:LearnSpell(41855)
  337. GameObject:Despawn(10, 0)
  338. end
  339. end
  340. end
  341. end
  342.  
  343. RegisterGameObjectEvent(300300, 4, "Dwarvendistrict_OnUse")
  344.  
  345.  
  346. function Magequater_OnUse(GameObject,_,player) -- Magequater
  347. if player:GetFaction() == 1 then
  348. player:SendBroadcastMessage("This is one of your flags. Protect it at all cost!")
  349. elseif player:GetFaction() == 2 then
  350. if player:HasAura(14268) then
  351. else
  352. if player:HasAura(1784) or player:HasAura(66) or player:HasAura(642) or player:HasAura(10278) or player:HasAura(5599) or player:HasAura(1022) then
  353. player:SendBroadcastMessage("You cant take the flag while being invisible, invulnerable to any sort of damage or stealthed")
  354. else
  355. player:CastSpell(14268)
  356. player:LearnSpell(41853)
  357. GameObject:Despawn(10, 0)
  358. end
  359. end
  360. end
  361. end
  362.  
  363. RegisterGameObjectEvent(300301, 4, "Magequater_OnUse")
  364.  
  365.  
  366. function Oldtown_OnUse(GameObject,_,player) -- Oldtown
  367. if player:GetFaction() == 1 then
  368. player:SendBroadcastMessage("This is one of your flags. Protect it at all cost!")
  369. elseif player:GetFaction() == 2 then
  370. if player:HasAura(14268) then
  371. else
  372. if player:HasAura(1784) or player:HasAura(66) or player:HasAura(642) or player:HasAura(10278) or player:HasAura(5599) or player:HasAura(1022) then
  373. player:SendBroadcastMessage("You cant take the flag while being invisible, invulnerable to any sort of damage or stealthed")
  374. else
  375. player:CastSpell(14268)
  376. player:LearnSpell(41865)
  377. GameObject:Despawn(10, 0)
  378. end
  379. end
  380. end
  381. end
  382.  
  383. RegisterGameObjectEvent(300302, 4, "Oldtown_OnUse")
  384.  
  385.  
  386. function Thepark_OnUse(GameObject,_,player) -- Thepark
  387. if player:GetFaction() == 1 then
  388. player:SendBroadcastMessage("This is one of your flags. Protect it at all cost!")
  389. elseif player:GetFaction() == 2 then
  390. if player:HasAura(14268) then
  391. else
  392. if player:HasAura(1784) or player:HasAura(66) or player:HasAura(642) or player:HasAura(10278) or player:HasAura(5599) or player:HasAura(1022) then
  393. player:SendBroadcastMessage("You cant take the flag while being invisible, invulnerable to any sort of damage or stealthed")
  394. else
  395. player:CastSpell(14268)
  396. player:LearnSpell(41866)
  397. GameObject:Despawn(10, 0)
  398. end
  399. end
  400. end
  401. end
  402.  
  403. RegisterGameObjectEvent(300303, 4, "Thepark_OnUse")
  404.  
  405.  
  406. function Cathsquare_OnUse(GameObject,_,player) -- Cathsquare
  407. if player:GetFaction() == 1 then
  408. player:SendBroadcastMessage("This is one of your flags. Protect it at all cost!")
  409. elseif player:GetFaction() == 2 then
  410. if player:HasAura(14268) then
  411. else
  412. if player:HasAura(1784) or player:HasAura(66) or player:HasAura(642) or player:HasAura(10278) or player:HasAura(5599) or player:HasAura(1022) then
  413. player:SendBroadcastMessage("You cant take the flag while being invisible, invulnerable to any sort of damage or stealthed")
  414. else
  415. player:CastSpell(14268)
  416. player:LearnSpell(41868)
  417. GameObject:Despawn(10, 0)
  418. end
  419. end
  420. end
  421. end
  422.  
  423. RegisterGameObjectEvent(300304, 4, "Cathsquare_OnUse")
  424. ----------------------- Stormwind -------------------------
  425.  
  426. ---------------------------- Boss --------------------------------------
  427. function boss_OnCombat(pUnit, event)
  428. pUnit:SendChatMessage(14, 0, "Looks like Im going to have to deal with you myself.")
  429. pUnit:CastSpell(53361)
  430. pUnit:RegisterEvent("SpawnAdds", 3000, 0)
  431. end
  432.  
  433. function boss_OnKilledTarget(pUnit, event)
  434. pUnit:SendChatMessage(12, 0, "I honestly thought you would've been more of a challenge...")
  435. end
  436.  
  437. function boss_OnDeath(pUnit, event)
  438. boss_state = boss_state + 1
  439. pUnit:SendChatMessage(14, 0, "No! This cannot... be...")
  440. pUnit:RegisterEvent("gametime", 1000, 0)
  441. end
  442.  
  443. function boss_OnSpawn(pUnit, event)
  444. pUnit:CastSpell(40733)
  445. pUnit:SetCombatCapable(1)
  446. pUnit:RegisterEvent("disableshield", 3000, 0)
  447. end
  448.  
  449. RegisterUnitEvent(100203, 1, "boss_OnCombat")
  450. RegisterUnitEvent(100203, 3, "boss_OnKilledTarget")
  451. RegisterUnitEvent(100203, 4, "boss_OnDeath")
  452. RegisterUnitEvent(100203, 18, "boss_OnSpawn")
  453.  
  454. ------------------------------------------------------------------
  455.  
  456. function disableshield(pUnit, event)
  457. if (flagpoints == 5) then
  458. pUnit:RemoveAura(40733)
  459. pUnit:SetCombatCapable(0)
  460. pUnit:RemoveEvents()
  461. pUnit:SendChatMessage(14, 0, "They have broken through! Dont let them enter the keep!!!")
  462. end
  463. end
  464.  
  465. function SpawnAdds(pUnit, event)
  466. if pUnit:GetHealthPct() <= 59 then
  467. pUnit:SendChatMessage(14, 0, "You will not defeat me! Archers, assist me!")
  468. pUnit:RemoveEvents()
  469. pUnit:SpawnCreature(100202, -8459.856445, 336.957153, 140.6, 6, 14, 0, 0, 0, 34334)
  470. pUnit:SpawnCreature(100202, -8445.583008, 310.576996, 140.6, 1.328363, 14, 0, 0, 0, 34334)
  471. pUnit:SpawnCreature(100202, -8418.574219, 332.204071, 140.6, 3.26, 14, 0, 0, 0, 34334)
  472. pUnit:SpawnCreature(100202, -8440.947266, 352.062469, 140.6, 4.788041, 14, 0, 0, 0, 34334)
  473. end
  474. end
  475.  
  476. ------------------------------------------------------------------
  477. function add_OnSpawn(pUnit, event)
  478. pUnit:SetCombatRangedCapable(0)
  479. pUnit:SetCombatMeleeCapable(1)
  480. pUnit:SetCombatCapable(1)
  481. pUnit:SetTauntedBy(pUnit:GetRandomPlayer(0))
  482. pUnit:RegisterEvent("shoot_arrow", 6000, 0)
  483. pUnit:RegisterEvent("shoot_autoshoot", 4000, 0)
  484. end
  485.  
  486. RegisterUnitEvent(100202, 18, "add_OnSpawn")
  487.  
  488. function shoot_autoshoot(pUnit, event)
  489. pUnit:CastSpellOnTarget(49197, pUnit:GetRandomPlayer(0))
  490. local armorreduce = math.random(1, 3)
  491. if (armorreduce == 1) then
  492. pUnit:CastSpell(47216)
  493. end
  494. end
  495.  
  496. function shoot_arrow(pUnit, event)
  497. local arrow = math.random(1, 6)
  498. if (arrow == 1) then
  499. pUnit:CastSpellOnTarget(56095, pUnit:GetRandomPlayer(0))
  500. elseif (arrow == 2) then
  501. pUnit:CastSpellOnTarget(42671, pUnit:GetRandomPlayer(4))
  502. elseif (arrow == 3) then
  503. pUnit:CastSpellOnTarget(49197, pUnit:GetRandomPlayer(0))
  504. elseif (arrow == 4) then
  505. pUnit:CastSpellOnTarget(70309, pUnit:GetRandomPlayer(0))
  506. elseif (arrow == 5) then
  507. pUnit:CastSpellOnTarget(19801, pUnit:GetRandomPlayer(0))
  508. elseif (arrow == 6) then
  509. pUnit:CastSpellOnTarget(67993, pUnit:GetRandomPlayer(4))
  510. end
  511. end
  512.  
  513. ---------------------------- Boss --------------------------------------
  514.  
  515. ------------------------- Serverhooks ----------------------------------
  516. function preventcast(event, pPlayer, spellId)
  517. if (spellId == 1784) or (spellId == 66) or (spellId == 642) or (spellId == 10278) or (spellId == 5599) or (spellId == 1022) then
  518. if pPlayer:HasAura(14268) then
  519. if pPlayer:HasSpell(41855) then -- Dwarven District
  520. pPlayer:SpawnGameObject(300300, -8306.773438, 546.262085, 99.602203, 5.419337, 0)
  521. pPlayer:RemoveAura(14268)
  522. pPlayer:UnlearnSpell(41855)
  523. elseif pPlayer:HasSpell(41853) then -- Mage Quater
  524. pPlayer:SpawnGameObject(300301, -8989.271484, 850.816528, 29.620016, 2.305417, 0)
  525. pPlayer:RemoveAura(14268)
  526. pPlayer:UnlearnSpell(41853)
  527. elseif pPlayer:HasSpell(41865) then -- Old Town
  528. pPlayer:SpawnGameObject(300302, -8815.850586, 360.302002, 100.586555, 4.715415, 0)
  529. pPlayer:RemoveAura(14268)
  530. pPlayer:UnlearnSpell(41865)
  531. elseif pPlayer:HasSpell(41866) then -- The Park
  532. pPlayer:SpawnGameObject(300303, -8761.326172, 1139.142700, 92.520309, 4.861132, 0)
  533. pPlayer:RemoveAura(14268)
  534. pPlayer:UnlearnSpell(41866)
  535. elseif pPlayer:HasSpell(41868) then -- Cathedral Square
  536. pPlayer:SpawnGameObject(300304, -8514.320313, 860.751465, 111.039368, 3.761577, 0)
  537. pPlayer:RemoveAura(14268)
  538. pPlayer:UnlearnSpell(41868)
  539. end
  540. end
  541. end
  542. end
  543.  
  544. RegisterServerHook(10, "preventcast")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement