- 0
2 Problems with automatic events
-
Posts
-
Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
亲爱的合作伙伴! 目前我们非常需要以下项目: ➡ WhatsApp 老账户 ➡ Twitter 带粉丝和帖子账户(老账户) 请通过以下联系方式与我们联系。我们很高兴与您合作! 我们项目的有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
Dear partners! At the moment we are in great need of the following positions: ➡ WhatsApp OLD Accounts ➡ Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
Dear partners! At the moment we are in great need of the following positions: ➡ WhatsApp OLD Accounts ➡ Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
-
Topics

Question
Kadaritas
Hi guys, im using this events now im my server but i have 2 problems. First, during the events (KOTH and Golems war) everyone can be flag and pk and I have no idea what should I write to change this in the code, and the other is that when you die in KOTH or Golems, you can't res I'm clicking go to village and nothing is happening, im just dead till the event ends and when it ends im still dead in the floor in giran! i just want it to let me res again in the place of the event, like the tvt. I would like to change this to things, can someone help me?... this is the code:
1. import math 2. import sys 3. from com.l2jserver.gameserver import Announcements 4. from com.l2jserver.util import Rnd 5. from java.lang import System 6. from com.l2jserver.gameserver.model.actor.appearance import PcAppearance 7. from com.l2jserver.gameserver import GameTimeController 8. from com.l2jserver.gameserver.model.quest import State 9. from com.l2jserver.gameserver.model.quest import QuestState 10. from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest 11. from com.l2jserver.gameserver.model.actor.instance import L2PcInstance 12. from com.l2jserver.gameserver.model.actor.instance import L2NpcInstance 13. 14. MANAGER = 100400 15. TOPNPC = 100401 16. NPCEA = 90015 17. NPCEB = 90016 18. Raids = [ 25286,25283,25319 ] 19. 20. #MOB DEL EQUIPO A (GOLEMS) 21. MOBEAX = 147087 22. MOBEAY = 152612 23. MOBEAZ = -12171 24. 25. #MOB DEL EQUIPO B (GOLEMS) 26. MOBEBX = 144803 27. MOBEBY = 152614 28. MOBEBZ = -12171 29. 30. #EQUIPOA (GOLEMS) 31. PCAX = 144778 32. PCAY = 152611 33. PCAZ = -12171 34. 35. #Equipo B (GOLEMS) 36. PCBX = 146997 37. PCBY = 152603 38. PCBZ = -12171 39. 40. #MANAGER PARA ANOTARSE 41. MBX1 = 83335 42. MBY1 = 148610 43. MBZ1 = -3405 44. 45. #SPAWN EQUIPO A (KOTH) 46. KPCAX = 143370 47. KPCAY = 161135 48. KPCAZ = -1925 49. 50. #SPAWN EQUIPO B (KOTH) CIMA 51. KPCBX = 144291 52. KPCBY = 157446 53. KPCBZ = -466 54. 55. #BANDERA EQUIPO B (KOTH) 56. KMBX = 144493 57. KMBY = 157331 58. KMBZ = -483 59. 60. #number of participants 61. MountainMinPlayers = 2 62. MountainMaxPlayers = 50 63. 64. EventNpcs = [ 100400, 100401 ] 65. 66. #time between events in milliseconds 67. eventInterval = 1800000 # 30 minutos entre eventos 68. FirstStart = 600000 # el primero empieza a los 10 minutos del restart del server 69. 70. 71. 72. class eventmanager (JQuest): 73. 74. def __init__(self,id,name,descr): 75. 76. JQuest.__init__(self,id,name,descr) 77. self.RaidBosses ={ 78. 79. 0: {'name':"Anakim" , 'id':25286}, 80. 1: {'name':"Lilith" , 'id':25283}, 81. 2: {'name':"Ember" , 'id':25319}, 82. } 83. 84. self.RbCoords ={ 85. 86. 0: {'name':"Primeval Isle" , 'X':10468 , 'Y':-24569 , 'Z':-3650}, 87. 1: {'name':"Farm Area 2" , 'X':-11802 , 'Y':236360 , 'Z':-3271}, 88. 2: {'name':"Giran Harbor" , 'X':47114 , 'Y':187152 , 'Z':-3485}, 89. 3: {'name':"Gludin's Harbor" , 'X':-89418 , 'Y':150682 , 'Z':-3586}, 90. } 91. 92. self.startQuestTimer("EventTrigger", FirstStart, None, None) 93. self.RbSpawn = [] 94. self.rewards ={ 95. 0: {'prize':3470 , 'number':1}, #PREMIO DO EVENTO DE GOLEMS 96. 2: {'prize':3470 , 'number':1}, #PREMIO DO EVENTO KOTH 97. } 98. 99. self.Teams = [] 100. self.Event = [] 101. self.True = True 102. self.False = False 103. self.Group = [] 104. self.EventManager1 = [] 105. self.EventManager = [] 106. self.Registration = [] 107. self.numberPlayers = [] 108. self.One = 1 109. self.Team1 = [] 110. self.Team2 = [] 111. self.numberOfTeams = [] 112. self.Trigger = 1 113. self.Count = 2 114. self.Add = 1 115. self.Full = False 116. self.NpcEa = [] 117. self.EventNames = {0:"Golems War", 1:"Raid Boss", 2:"King of the Hill"} 118. 119. 120. def onAdvEvent (self,event,npc,player): 121. 122. if event == "EventTrigger" : 123. 124. self.startQuestTimer("EventTrigger", 7200000, npc, player) 125. rr = int(Rnd.get(3)) 126. Announcestart = "Automatic Event: " + self.EventNames[rr] 127. Announcements.getInstance().announceToAll(Announcestart) 128. 129. if rr == 0: 130. 131. self.Event = 0 132. eventmanager1 = self.addSpawn(MANAGER,MBX1,MBY1,MBZ1,0,False,0) 133. self.EventManager1 = eventmanager1 134. npcea = self.addSpawn(NPCEA,MOBEAX,MOBEAY,MOBEAZ,0,False,0) 135. npceb = self.addSpawn(NPCEB,MOBEBX,MOBEBY,MOBEBZ,0,False,0) 136. self.addSkillSeeId(NPCEA) 137. self.addSkillSeeId(NPCEB) 138. self.addAttackId(NPCEB) 139. self.addAttackId(NPCEA) 140. self.NpcEa = npcea 141. self.NpcEb = npceb 142. Announcements.getInstance().announceToAll("Registration open for 10 minutes in Giran") 143. self.startQuestTimer("MountainSelect", 600000, npc, player) 144. 145. if rr == 1: 146. 147. self.Event = 1 148. #the spawn coords and which raidboss are both random and 149. #independant from each other 150. ra = int(Rnd.get(3)) 151. rb = int(Rnd.get(4)) 152. self.RbSpawn = [] 153. raidboss = self.RaidBosses[ra]['name'] 154. location = self.RbCoords[rb]['name'] 155. Announcements.getInstance().announceToAll(raidboss + " has just been spawned in " + location + " and will disappear in 2 hours, hurry!") 156. 157. print "## Evento de Raid Boss Iniciado!! ##" 158. 159. self.RbSpawn = self.addSpawn(self.RaidBosses[ra]['id'],self.RbCoords[rb]['X'],self.RbCoords[rb]['Y'],self.RbCoords[rb]['Z'],0,False,0) 160. self.startQuestTimer("RbDespawn", 7200000, npc, player) 161. 162. if rr == 2: 163. 164. self.Event = 2 165. eventmanager1 = self.addSpawn(MANAGER,MBX1,MBY1,MBZ1,0,False,0) 166. self.EventManager1 = eventmanager1 167. topnpc = self.addSpawn(TOPNPC,KMBX,KMBY,KMBZ,0,False,0) 168. self.TopNpc = topnpc 169. Announcements.getInstance().announceToAll("Registration open for 10 minutes in Giran") 170. self.startQuestTimer("KOTHStart", 600000, npc, player) 171. 172. if event == "MountainSelect" : 173. 174. self.EventManager1.deleteMe() 175. totalplayers = len(self.Registration) 176. 177. if totalplayers >= MountainMinPlayers: 178. 179. #5 players per team, max 6 teams can participate 180. self.numberOfTeams = int((len(self.Registration))/2) 181. numberOfTeams = int((len(self.Registration))/2) 182. playerList = list(self.Registration) 183. 184. if (len(playerList) > 0): 185. 186. for i in self.Registration: 187. 188. st = i.getQuestState("eventmanager") 189. st.addNotifyOfDeath(i) 190. 191. Team1 = [] 192. Team2 = [] 193. 194. for i in range(len(playerList)/2) : 195. 196. Team1.append(playerList.pop(Rnd.get(len(playerList)))) 197. 198. Team2 = playerList 199. 200. for i in Team1: 201. 202. i.teleToLocation(PCAX,PCAY,PCAZ)#tele to top of mountain 203. i.getAppearance().setNameColor(0x005de2) #orange 204. i.getAppearance().setTitleColor(0x005de2) #orange 205. i.getQuestState("eventmanager").set("cond","3") 206. 207. for i in Team2: 208. 209. i.teleToLocation(PCBX,PCBY,PCBZ)#tele to location A 210. i.getAppearance().setNameColor(0xd5e200) #yellow 211. i.getAppearance().setTitleColor(0xd5e200) #yellow 212. i.getQuestState("eventmanager").set("cond","4") 213. 214. Announcements.getInstance().announceToAll("Each Team has a Golem in his Spawn, the goal is to kill the golem of Enemy Team before time end.") 215. self.Team1 = Team1 216. self.Team2 = Team2 217. self.numberOfTeams = numberOfTeams 218. 219. self.Attacker = self.Team2 220. self.Defender = self.Team1 221. self.startQuestTimer("round_finish", 600000, npc, player) #sera 1200000 222. 223. else: 224. 225. Announcements.getInstance().announceToAll("Event canceled due to lack of participants.") 226. 227. playerList = list(self.Registration) 228. 229. self.NpcEa.deleteMe() 230. self.NpcEb.deleteMe() 231. self.cancelQuestTimer("round_finish", None, None) 232. self.cancelQuestTimer("15Tofinish", None, None) 233. self.cancelQuestTimer("10Tofinish", None, None) 234. self.cancelQuestTimer("5Tofinish", None, None) 235. self.cancelQuestTimer("1Tofinish", None, None) 236. self.cancelQuestTimer("MountainSelect", None, None) 237. 238. if event == "KOTHStart" : 239. 240. self.EventManager1.deleteMe() 241. totalplayers = len(self.Registration) 242. 243. if totalplayers >= MountainMinPlayers: 244. 245. #5 players per team, max 6 teams can participate 246. self.numberOfTeams = int((len(self.Registration))/2) 247. numberOfTeams = int((len(self.Registration))/2) 248. playerList = list(self.Registration) 249. 250. if (len(playerList) > 0): 251. 252. for i in self.Registration: 253. 254. st = i.getQuestState("eventmanager") 255. st.addNotifyOfDeath(i) 256. 257. Team1 = [] 258. Team2 = [] 259. 260. for i in range(len(playerList)/2) : 261. 262. Team1.append(playerList.pop(Rnd.get(len(playerList)))) 263. 264. Team2 = playerList 265. 266. for i in Team1: 267. 268. i.teleToLocation(KPCAX,KPCAY,KPCAZ)#tele to top of mountain 269. i.getAppearance().setNameColor(0x005de2) #orange 270. i.getAppearance().setTitleColor(0x005de2) #orange 271. i.getQuestState("eventmanager").set("cond","4") 272. 273. for i in Team2: 274. 275. i.teleToLocation(KPCBX,KPCBY,KPCBZ)#tele to location A 276. i.getAppearance().setNameColor(0xd5e200) #yellow 277. i.getAppearance().setTitleColor(0xd5e200) #yellow 278. i.getQuestState("eventmanager").set("cond","3") 279. 280. Announcements.getInstance().announceToAll("On top of the hill has a flag, the participants of Team B should talk with the flag and click the button.") 281. Announcements.getInstance().announceToAll("Participants of Team A must keep off.") 282. 283. self.Team1 = Team1 284. self.Team2 = Team2 285. self.numberOfTeams = numberOfTeams 286. 287. self.Attacker = self.Team2 288. self.Defender = self.Team1 289. self.startQuestTimer("KOTHEnd", 600000, npc, player) #sera 1200000 290. 291. else: 292. 293. Announcements.getInstance().announceToAll("Event canceled due to lack of participants.") 294. 295. playerList = list(self.Registration) 296. 297. self.TopNpc.deleteMe() 298. self.cancelQuestTimer("KOTHEnd", None, None) 299. self.cancelQuestTimer("15Tofinish", None, None) 300. self.cancelQuestTimer("10Tofinish", None, None) 301. self.cancelQuestTimer("5Tofinish", None, None) 302. self.cancelQuestTimer("1Tofinish", None, None) 303. self.cancelQuestTimer("KOTHStart", None, None) 304. 305. if event == "KOTHEnd": 306. 307. self.TopNpc.deleteMe() 308. self.cancelQuestTimer("KOTHEnd", None, None) 309. self.cancelQuestTimer("15Tofinish", None, None) 310. self.cancelQuestTimer("10Tofinish", None, None) 311. self.cancelQuestTimer("5Tofinish", None, None) 312. self.cancelQuestTimer("1Tofinish", None, None) 313. 314. Announcements.getInstance().announceToAll("Evento KOTH - Team Blue won!") 315. rr = self.Event 316. reward = self.rewards 317. playerList = list(self.Registration) 318. 319. for i in self.Team1: 320. 321. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 322. i.getAppearance().setNameColor(0xffffff) 323. i.getAppearance().setTitleColor(0xffffff) 324. st = i.getQuestState("eventmanager") 325. i.getQuestState("eventmanager").set("cond","0") 326. 327. for i in self.Team2: 328. 329. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 330. i.getQuestState("eventmanager").giveItems(reward[rr]['prize'],reward[rr]['number']) 331. i.getQuestState("eventmanager").playSound("ItemSound.quest_fanfare_1") 332. i.getAppearance().setNameColor(0xffffff) 333. i.getAppearance().setTitleColor(0xffffff) 334. i.getQuestState("eventmanager").set("cond","0") 335. 336. if (len(playerList) > 0): 337. 338. for i in playerList: 339. 340. st = i.getQuestState("eventmanager") 341. st.getPlayer().removeNotifyQuestOfDeath(st) 342. self.Registration.remove(i) 343. 344. if event == "round_finish": 345. 346. self.NpcEa.deleteMe() 347. self.NpcEb.deleteMe() 348. self.cancelQuestTimer("round_finish", None, None) 349. self.cancelQuestTimer("15Tofinish", None, None) 350. self.cancelQuestTimer("10Tofinish", None, None) 351. self.cancelQuestTimer("5Tofinish", None, None) 352. self.cancelQuestTimer("1Tofinish", None, None) 353. self.cancelQuestTimer("MountainSelect", None, None) 354. rr = self.Event 355. 356. playerList = list(self.Registration) 357. 358. reward = self.rewards 359. 360. if (len(playerList) > 0): 361. 362. Announcements.getInstance().announceToAll("Golems War ended in a draw, better luck next time") 363. 364. for i in playerList: 365. 366. st = i.getQuestState("eventmanager") 367. st.getPlayer().removeNotifyQuestOfDeath(st) 368. self.Registration.remove(i) 369. 370. for i in self.Team2: 371. 372. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 373. i.getAppearance().setNameColor(0xffffff) 374. st = i.getQuestState("eventmanager") 375. i.getAppearance().setTitleColor(0xffffff) 376. i.getQuestState("eventmanager").set("cond","0") 377. 378. for i in self.Team1: 379. 380. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 381. i.getAppearance().setNameColor(0xffffff) 382. st = i.getQuestState("eventmanager") 383. i.getAppearance().setTitleColor(0xffffff) 384. i.getQuestState("eventmanager").set("cond","0") 385. 386. if event == "RbDespawn": 387. 388. self.RbSpawn.deleteMe() 389. 390. Announcements.getInstance().announceToAll("Raidboss did not die yet and will disappear now!") 391. 392. print "## El Raidboss no ha muerto y desaparecera ahora! ##" 393. 394. 395. 396. def onTalk (self,npc,player) : 397. 398. npcId = npc.getNpcId() 399. cond = player.getQuestState("eventmanager").getInt("cond") 400. 401. if npcId == MANAGER : 402. 403. if not cond == 2: 404. 405. if self.Event == 0: 406. 407. if len(self.Registration) < MountainMaxPlayers: 408. 409. player.getQuestState("eventmanager").set("cond","2") 410. self.Registration.append(player) 411. Reg = list(self.Registration) 412. 413. return "<html><body>You are registered in the Event Golems War! Teams will be formed randomly when the event starts!</body></html>" 414. 415. else: 416. 417. Announcements.getInstance().announceToAll("Loading Event, registration canceled.") 418. self.Full = True 419. return "<html><body>Loading Event, registration canceled.</body></html>" 420. 421. if self.Event == 2: 422. 423. if len(self.Registration) < MountainMaxPlayers: 424. 425. player.getQuestState("eventmanager").set("cond","2") 426. self.Registration.append(player) 427. Reg = list(self.Registration) 428. return "<html><body>You are registered in the Event King of the Hill! Teams will be formed randomly when the event starts!</body></html>" 429. 430. else: 431. 432. Announcements.getInstance().announceToAll("Loading Event, registration canceled.") 433. self.Full = True 434. return "<html><body>Loading Event, registration canceled.</body></html>" 435. 436. else: 437. 438. return "<html><body>You are participating in the event.</body></html>" 439. 440. if npcId == TOPNPC : 441. 442. if not cond == 3: 443. 444. self.TopNpc.deleteMe() 445. playerList = list(self.Registration) 446. self.cancelQuestTimer("KOTHEnd", None, None) 447. self.cancelQuestTimer("15Tofinish", None, None) 448. self.cancelQuestTimer("10Tofinish", None, None) 449. self.cancelQuestTimer("5Tofinish", None, None) 450. self.cancelQuestTimer("1Tofinish", None, None) 451. 452. Announcements.getInstance().announceToAll("Evento KOTH - Red Team won!") 453. rr = self.Event 454. reward = self.rewards 455. 456. for i in self.Team2: 457. 458. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 459. i.getAppearance().setNameColor(0xffffff) 460. i.getAppearance().setTitleColor(0xffffff) 461. i.getQuestState("eventmanager").set("cond","0") 462. 463. for i in self.Team1: 464. 465. i.teleToLocation(MBX1,MBY1,MBZ1) 466. i.getQuestState("eventmanager").giveItems(reward[rr]['prize'],reward[rr]['number']) 467. i.getQuestState("eventmanager").playSound("ItemSound.quest_fanfare_1") 468. i.getAppearance().setNameColor(0xffffff) 469. i.getAppearance().setTitleColor(0xffffff) 470. i.getQuestState("eventmanager").set("cond","0") 471. 472. if (len(playerList) > 0): 473. 474. for i in playerList: 475. 476. st = i.getQuestState("eventmanager") 477. st.getPlayer().removeNotifyQuestOfDeath(st) 478. self.Registration.remove(i) 479. 480. else: 481. 482. return "<html><body>You are a defender!!! Stop talking and defend the flag!!!</body></html>" 483. 484. 485. 486. def onKill (self,npc,player,isPet): 487. 488. npcId = npc.getNpcId() 489. npcObjId = npc.getObjectId() 490. 491. if npcId == NPCEA: 492. 493. self.NpcEa.deleteMe() 494. self.NpcEb.deleteMe() 495. 496. playerList = list(self.Registration) 497. 498. Announcements.getInstance().announceToAll("Golems War: Red Team won!") 499. rr = self.Event 500. reward = self.rewards 501. 502. for i in self.Team2: 503. 504. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 505. i.getAppearance().setNameColor(0xffffff) 506. i.getAppearance().setTitleColor(0xffffff) 507. i.getQuestState("eventmanager").set("cond","0") 508. 509. for i in self.Team1: 510. 511. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 512. i.getQuestState("eventmanager").giveItems(reward[rr]['prize'],reward[rr]['number']) 513. i.getQuestState("eventmanager").playSound("ItemSound.quest_fanfare_1") 514. i.getAppearance().setNameColor(0xffffff) 515. i.getAppearance().setTitleColor(0xffffff) 516. i.getQuestState("eventmanager").set("cond","0") 517. 518. if (len(playerList) > 0): 519. 520. for i in playerList: 521. 522. st = i.getQuestState("eventmanager") 523. st.getPlayer().removeNotifyQuestOfDeath(st) 524. self.Registration.remove(i) 525. 526. self.cancelQuestTimer("round_finish", None, None) 527. self.cancelQuestTimer("15Tofinish", None, None) 528. self.cancelQuestTimer("10Tofinish", None, None) 529. self.cancelQuestTimer("5Tofinish", None, None) 530. self.cancelQuestTimer("1Tofinish", None, None) 531. self.cancelQuestTimer("MountainSelect", None, None) 532. 533. if npcId == NPCEB: 534. 535. self.NpcEa.deleteMe() 536. self.NpcEb.deleteMe() 537. 538. playerList = list(self.Registration) 539. 540. Announcements.getInstance().announceToAll("Golems War: Team Blue won!") 541. rr = self.Event 542. reward = self.rewards 543. 544. for i in self.Team1: 545. 546. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 547. i.getAppearance().setNameColor(0xffffff) 548. i.getAppearance().setTitleColor(0xffffff) 549. st = i.getQuestState("eventmanager") 550. i.getQuestState("eventmanager").set("cond","0") 551. 552. for i in self.Team2: 553. 554. i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town 555. st = i.getQuestState("eventmanager") 556. i.getQuestState("eventmanager").giveItems(reward[rr]['prize'],reward[rr]['number']) 557. i.getQuestState("eventmanager").playSound("ItemSound.quest_fanfare_1") 558. i.getAppearance().setNameColor(0xffffff) 559. i.getAppearance().setTitleColor(0xffffff) 560. i.getQuestState("eventmanager").set("cond","0") 561. 562. if (len(playerList) > 0): 563. 564. for i in playerList: 565. 566. st = i.getQuestState("eventmanager") 567. st.getPlayer().removeNotifyQuestOfDeath(st) 568. self.Registration.remove(i) 569. 570. self.cancelQuestTimer("round_finish", None, None) 571. self.cancelQuestTimer("15Tofinish", None, None) 572. self.cancelQuestTimer("10Tofinish", None, None) 573. self.cancelQuestTimer("5Tofinish", None, None) 574. self.cancelQuestTimer("1Tofinish", None, None) 575. self.cancelQuestTimer("MountainSelect", None, None) 576. 577. if self.Event == 1: 578. 579. if npc == self.RbSpawn: 580. 581. if npc.getObjectId() == self.RbSpawn.getObjectId(): 582. 583. for p in npc.getKnownList().getKnownPlayersInRadius(1300) : 584. 585. rnd = int(Rnd.get(1, 5)) 586. 587. if not rnd == 0 : 588. 589. p.sendMessage("YOU HAVE BEEN REWARDED, LOOK AT YOUR INVENTORY!!") 590. 591. p.addItem("Drop",3470,rnd,player,False) 592. p.addItem("Drop",6578,rnd,player,False) 593. p.addItem("Drop",6577,rnd,player,False) 594. p.addItem("Drop",9627,rnd,player,False) 595. p.addItem("Drop",9627,rnd,player,False) 596. 597. else : 598. 599. p.sendMessage("YOU HAVE NOT BEEN REWARDED!!") 600. 601. self.cancelQuestTimer("RbDespawn", None, None) 602. Announcements.getInstance().announceToAll("Raidboss has been killed, Event is over!") 603. print "## El Raidboss ha muerto, el evento finalizo! ##" 604. 605. 606. 607. def onDeath(self, npc, pc, st) : 608. 609. Aux = st.getPlayer() 610. 611. if self.Event == 0: 612. 613. st.addNotifyOfDeath(st.getPlayer()) 614. 615. if st.getPlayer() in self.Team1: 616. 617. Aux = st.getPlayer() 618. Aux.doRevive() 619. Aux.teleToLocation(PCAX,PCAY,PCAZ)#tele to top of mountain 620. 621. else: 622. 623. Aux = st.getPlayer() 624. Aux.doRevive() 625. Aux.teleToLocation(PCBX,PCBY,PCBZ)#tele to location A 626. 627. if self.Event == 2: 628. 629. st.addNotifyOfDeath(st.getPlayer()) 630. 631. if st.getPlayer() in self.Team1: 632. 633. Aux = st.getPlayer() 634. Aux.doRevive() 635. Aux.teleToLocation(KPCAX,KPCAY,KPCAZ)#tele to top of mountain 636. 637. else: 638. 639. Aux = st.getPlayer() 640. Aux.doRevive() 641. Aux.teleToLocation(KPCBX,KPCBY,KPCBZ)#tele to location A 642. 643. 644. 645. def onAttack(self,npc,player,damage,isPet,null) : 646. 647. if self.Event == 0: 648. npcId = npc.getNpcId() 649. 650. if (npcId == NPCEB): 651. Aux = player 652. 653. if Aux in self.Team1: 654. npc.setIsInvul(True) 655. else : 656. npc.setIsInvul(False) 657. 658. else : 659. Aux = player 660. 661. if Aux in self.Team2: 662. npc.setIsInvul(True) 663. 664. else : 665. npc.setIsInvul(False) 666. return 667. 668. 669. # Quest class and state definition 670. QUEST = eventmanager(-1, "eventmanager", "ai") 671. 672. QUEST.addKillId(NPCEA) 673. QUEST.addKillId(NPCEB) 674. 675. 676. 677. for i in Raids: 678. QUEST.addKillId(i) 679. 680. 681. for i in EventNpcs: 682. QUEST.addTalkId(i) 683. QUEST.addStartNpc(i) 684. 685. 686. print "==========================" 687. print "INFO Cargado EVENT MANAGER" 688. print "=========================="6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now