Guest User

game.py

a guest
May 13th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 91.71 KB | None | 0 0
  1. import os
  2. import os
  3. import app
  4. import dbg
  5. import grp
  6. import item
  7. import background
  8. import chr
  9. import chrmgr
  10. import player
  11. import snd
  12. import chat
  13. import event
  14. import textTail
  15. import snd
  16. import net
  17. import effect
  18. import wndMgr
  19. import fly
  20. import systemSetting
  21. import quest
  22. import guild
  23. import skill
  24. import messenger
  25. import locale
  26. import constInfo
  27. import exchange
  28. import ime
  29. import time
  30. import uirunwindow
  31. import ui
  32. import uiCommon
  33. import uiPhaseCurtain
  34. import uiMapNameShower
  35. import uiAffectShower
  36. import uiPlayerGauge
  37. import uiCharacter
  38. import uiTarget
  39. #sistem_de_putere
  40. import event
  41. import constinfo
  42. #sistem_de_putere
  43.  
  44. # PRIVATE_SHOP_PRICE_LIST
  45. import uiPrivateShopBuilder
  46. # END_OF_PRIVATE_SHOP_PRICE_LIST
  47.  
  48. import mouseModule
  49. import consoleModule
  50. import locale
  51.  
  52. import playerSettingModule
  53. import interfaceModule
  54.  
  55. import musicInfo
  56. import debugInfo
  57. import stringCommander
  58.  
  59. from _weakref import proxy
  60. from switchbot import Bot
  61.  
  62. # TEXTTAIL_LIVINGTIME_CONTROL
  63. #if locale.IsJAPAN():
  64. # app.SetTextTailLivingTime(8.0)
  65. # END_OF_TEXTTAIL_LIVINGTIME_CONTROL
  66.  
  67. # SCREENSHOT_CWDSAVE
  68. SCREENSHOT_CWDSAVE = FALSE
  69. SCREENSHOT_DIR = None
  70.  
  71. if locale.IsEUROPE():
  72. SCREENSHOT_CWDSAVE = TRUE
  73.  
  74. if locale.IsCIBN10():
  75. SCREENSHOT_CWDSAVE = FALSE
  76. SCREENSHOT_DIR = "YT2W"
  77.  
  78. cameraDistance = 2000.0
  79. cameraPitch = 35.0
  80. cameraRotation = 0.0
  81. cameraHeight = 100.0
  82.  
  83. testAlignment = 0
  84. BPisLodaded = 0
  85.  
  86. class GameWindow(ui.ScriptWindow):
  87. def __init__(self, stream):
  88. self.RunWindow = None
  89. self.RunWindow = uirunwindow.RunWindow()
  90. ui.ScriptWindow.__init__(self, "GAME")
  91. self.SetWindowName("game")
  92. net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  93. player.SetGameWindow(self)
  94. # BUG_ROUA_EUGEN_PRO_AREA
  95. self.utilizareTaste = time.clock() + 4
  96. # FINAL_BUG_ROUA_EUGEN_PRO_AREA
  97.  
  98. self.quickSlotPageIndex = 0
  99. self.switchbot = Bot()
  100. self.switchbot.Hide()
  101. self.lastPKModeSendedTime = 0
  102. self.pressNumber = None
  103.  
  104. self.guildWarQuestionDialog = None
  105. self.interface = None
  106. self.targetBoard = None
  107. self.console = None
  108. self.mapNameShower = None
  109. self.affectShower = None
  110. self.playerGauge = None
  111.  
  112. self.stream=stream
  113. self.interface = interfaceModule.Interface()
  114. self.interface.MakeInterface()
  115. self.interface.ShowDefaultWindows()
  116.  
  117. self.curtain = uiPhaseCurtain.PhaseCurtain()
  118. self.curtain.speed = 0.03
  119. self.curtain.Hide()
  120.  
  121. self.targetBoard = uiTarget.TargetBoard()
  122. self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  123. self.targetBoard.Hide()
  124.  
  125. self.console = consoleModule.ConsoleWindow()
  126. self.console.BindGameClass(self)
  127. self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  128. self.console.Hide()
  129.  
  130. self.mapNameShower = uiMapNameShower.MapNameShower()
  131. self.affectShower = uiAffectShower.AffectShower()
  132.  
  133. self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  134. self.playerGauge.Hide()
  135.  
  136. self.__SetQuickSlotMode()
  137.  
  138. self.__ServerCommand_Build()
  139. self.__ProcessPreservedServerCommand()
  140.  
  141. def __del__(self):
  142. player.SetGameWindow(0)
  143. net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  144. ui.ScriptWindow.__del__(self)
  145.  
  146. def Open(self):
  147. app.SetFrameSkip(1)
  148.  
  149. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  150.  
  151. #onoare
  152. sistem_onoare_bg = ui.AniImageBox()
  153. sistem_onoare_bg.AppendImage("sistem_onoare/fundal.tga")
  154. self.sistem_onoare_bg = sistem_onoare_bg
  155. self.sistem_onoare_bg.SetPosition(wndMgr.GetScreenWidth()/2-229,0)
  156. self.sistem_onoare_bg.SetSize(459, 204)
  157. self.sistem_onoare_bg.Hide()
  158.  
  159. self.Ucideri_Albastru = ui.TextLine()
  160. self.Ucideri_Albastru.SetDefaultFontName()
  161. self.Ucideri_Albastru.SetParent(self.sistem_onoare_bg)
  162. self.Ucideri_Albastru.SetPosition(87, 85)
  163. self.Ucideri_Albastru.SetText("Regat Albastru: 0")
  164. self.Ucideri_Albastru.SetOutline()
  165. self.Ucideri_Albastru.Show()
  166.  
  167. self.Ucideri_Galben = ui.TextLine()
  168. self.Ucideri_Galben.SetDefaultFontName()
  169. self.Ucideri_Galben.SetParent(self.sistem_onoare_bg)
  170. self.Ucideri_Galben.SetPosition(87, 108)
  171. self.Ucideri_Galben.SetText("Regat Galben: 0")
  172. self.Ucideri_Galben.SetOutline()
  173. self.Ucideri_Galben.Show()
  174.  
  175. self.Ucideri_Rosu = ui.TextLine()
  176. self.Ucideri_Rosu.SetDefaultFontName()
  177. self.Ucideri_Rosu.SetParent(self.sistem_onoare_bg)
  178. self.Ucideri_Rosu.SetPosition(87, 132)
  179. self.Ucideri_Rosu.SetText("Regat Rosu: 0")
  180. self.Ucideri_Rosu.SetOutline()
  181. self.Ucideri_Rosu.Show()
  182.  
  183. #Setare Informatii Kill
  184. self.Total_Ucideri = ui.TextLine()
  185. self.Total_Ucideri.SetDefaultFontName()
  186. self.Total_Ucideri.SetParent(self.sistem_onoare_bg)
  187. self.Total_Ucideri.SetPosition(289, 85)
  188. self.Total_Ucideri.SetText("Puncte Ucideri: 0")
  189. self.Total_Ucideri.SetOutline()
  190. self.Total_Ucideri.Show()
  191.  
  192. self.Puncte_Onoare = ui.TextLine()
  193. self.Puncte_Onoare.SetDefaultFontName()
  194. self.Puncte_Onoare.SetParent(self.sistem_onoare_bg)
  195. self.Puncte_Onoare.SetPosition(289, 108)
  196. self.Puncte_Onoare.SetText("Puncte Onoare: 0")
  197. self.Puncte_Onoare.SetOutline()
  198. self.Puncte_Onoare.Show()
  199.  
  200. self.Utilizari_Ramase = ui.TextLine()
  201. self.Utilizari_Ramase.SetDefaultFontName()
  202. self.Utilizari_Ramase.SetParent(self.sistem_onoare_bg)
  203. self.Utilizari_Ramase.SetPosition(289, 132)
  204. self.Utilizari_Ramase.SetText("Utilizari Ramase: 0")
  205. self.Utilizari_Ramase.SetOutline()
  206. self.Utilizari_Ramase.Show()
  207.  
  208. #Buton Activare
  209. self.Buton_Activareu = ui.Button()
  210. self.Buton_Activareu.SetParent(self.sistem_onoare_bg)
  211. self.Buton_Activareu.SetPosition(180, 60)
  212. self.Buton_Activareu.SetUpVisual("sistem_onoare/activare.tga")
  213. self.Buton_Activareu.SetOverVisual("sistem_onoare/activare_1.tga")
  214. self.Buton_Activareu.SetDownVisual("sistem_onoare/activare.tga")
  215. self.Buton_Activareu.SetEvent(self.__activare_ucideri)
  216. self.Buton_Activareu.Show()
  217. ## sfarsit
  218.  
  219. # Sistem de Putere
  220. PutereBG = ui.AniImageBox()
  221. PutereBG.AppendImage("putere/fundal.tga")
  222. self.PutereBG = PutereBG
  223. self.PutereBG.SetPosition(wndMgr.GetScreenWidth()/2-(399/2),wndMgr.GetScreenHeight()-337)
  224. self.PutereBG.SetSize(399, 301)
  225. self.PutereBG.AddFlag('movable')
  226. self.PutereBG.AddFlag("float")
  227. self.PutereBG.Show()
  228.  
  229. self.PunctePutere_text = ui.TextLine()
  230. self.PunctePutere_text.SetDefaultFontName()
  231. self.PunctePutere_text.SetParent(self.PutereBG)
  232. self.PunctePutere_text.SetPosition(40, 80)
  233. self.PunctePutere_text.SetText("Puncte disponibile:")
  234. self.PunctePutere_text.SetOutline()
  235. self.PunctePutere_text.Show()
  236.  
  237. self.PunctePutere_valoare = ui.TextLine()
  238. self.PunctePutere_valoare.SetDefaultFontName()
  239. self.PunctePutere_valoare.SetParent(self.PutereBG)
  240. self.PunctePutere_valoare.SetPosition(130, 80)
  241. self.PunctePutere_valoare.SetText("0")
  242. self.PunctePutere_valoare.SetOutline()
  243. self.PunctePutere_valoare.Show()
  244.  
  245. self.Bonus1_text = ui.TextLine()
  246. self.Bonus1_text.SetDefaultFontName()
  247. self.Bonus1_text.SetParent(self.PutereBG)
  248. self.Bonus1_text.SetPosition(30, 120)
  249. self.Bonus1_text.SetText("Max. PV")
  250. self.Bonus1_text.SetOutline()
  251. self.Bonus1_text.Show()
  252.  
  253. self.Bonus1_valoare = ui.TextLine()
  254. self.Bonus1_valoare.SetDefaultFontName()
  255. self.Bonus1_valoare.SetParent(self.PutereBG)
  256. self.Bonus1_valoare.SetPosition(133, 120)
  257. self.Bonus1_valoare.SetText("0")
  258. self.Bonus1_valoare.SetOutline()
  259. self.Bonus1_valoare.Show()
  260.  
  261. self.Bonus2_text = ui.TextLine()
  262. self.Bonus2_text.SetDefaultFontName()
  263. self.Bonus2_text.SetParent(self.PutereBG)
  264. self.Bonus2_text.SetPosition(30, 150)
  265. self.Bonus2_text.SetText("Val. Atac")
  266. self.Bonus2_text.SetOutline()
  267. self.Bonus2_text.Show()
  268.  
  269. self.Bonus2_valoare = ui.TextLine()
  270. self.Bonus2_valoare.SetDefaultFontName()
  271. self.Bonus2_valoare.SetParent(self.PutereBG)
  272. self.Bonus2_valoare.SetPosition(133, 150)
  273. self.Bonus2_valoare.SetText("0")
  274. self.Bonus2_valoare.SetOutline()
  275. self.Bonus2_valoare.Show()
  276.  
  277. self.Bonus3_text = ui.TextLine()
  278. self.Bonus3_text.SetDefaultFontName()
  279. self.Bonus3_text.SetParent(self.PutereBG)
  280. self.Bonus3_text.SetPosition(30, 180)
  281. self.Bonus3_text.SetText("Lovitura Critica")
  282. self.Bonus3_text.SetOutline()
  283. self.Bonus3_text.Show()
  284.  
  285. self.Bonus3_valoare = ui.TextLine()
  286. self.Bonus3_valoare.SetDefaultFontName()
  287. self.Bonus3_valoare.SetParent(self.PutereBG)
  288. self.Bonus3_valoare.SetPosition(133, 180)
  289. self.Bonus3_valoare.SetText("0")
  290. self.Bonus3_valoare.SetOutline()
  291. self.Bonus3_valoare.Show()
  292.  
  293. self.Bonus4_text = ui.TextLine()
  294. self.Bonus4_text.SetDefaultFontName()
  295. self.Bonus4_text.SetParent(self.PutereBG)
  296. self.Bonus4_text.SetPosition(30, 210)
  297. self.Bonus4_text.SetText("Patrunzatoare")
  298. self.Bonus4_text.SetOutline()
  299. self.Bonus4_text.Show()
  300.  
  301. self.Bonus4_valoare = ui.TextLine()
  302. self.Bonus4_valoare.SetDefaultFontName()
  303. self.Bonus4_valoare.SetParent(self.PutereBG)
  304. self.Bonus4_valoare.SetPosition(133, 210)
  305. self.Bonus4_valoare.SetText("0")
  306. self.Bonus4_valoare.SetOutline()
  307. self.Bonus4_valoare.Show()
  308.  
  309. self.Buton1_Plus = ui.Button()
  310. self.Buton1_Plus.SetParent(self.PutereBG)
  311. self.Buton1_Plus.SetPosition(180, 117)
  312. self.Buton1_Plus.SetUpVisual("putere/buton_plus.tga")
  313. self.Buton1_Plus.SetOverVisual("putere/buton_plus_1.tga")
  314. self.Buton1_Plus.SetDownVisual("putere/buton_plus_2.tga")
  315. self.Buton1_Plus.SetEvent(self.activare_buton1_buton)
  316. self.Buton1_Plus.Show()
  317.  
  318. self.Buton2_Plus = ui.Button()
  319. self.Buton2_Plus.SetParent(self.PutereBG)
  320. self.Buton2_Plus.SetPosition(180, 147)
  321. self.Buton2_Plus.SetUpVisual("putere/buton_plus.tga")
  322. self.Buton2_Plus.SetOverVisual("putere/buton_plus_1.tga")
  323. self.Buton2_Plus.SetDownVisual("putere/buton_plus_2.tga")
  324. self.Buton2_Plus.SetEvent(self.activare_buton2_buton)
  325. self.Buton2_Plus.Show()
  326.  
  327. self.Buton3_Plus = ui.Button()
  328. self.Buton3_Plus.SetParent(self.PutereBG)
  329. self.Buton3_Plus.SetPosition(180, 177)
  330. self.Buton3_Plus.SetUpVisual("putere/buton_plus.tga")
  331. self.Buton3_Plus.SetOverVisual("putere/buton_plus_1.tga")
  332. self.Buton3_Plus.SetDownVisual("putere/buton_plus_2.tga")
  333. self.Buton3_Plus.SetEvent(self.activare_buton3_buton)
  334. self.Buton3_Plus.Show()
  335.  
  336. self.Buton4_Plus = ui.Button()
  337. self.Buton4_Plus.SetParent(self.PutereBG)
  338. self.Buton4_Plus.SetPosition(180, 207)
  339. self.Buton4_Plus.SetUpVisual("putere/buton_plus.tga")
  340. self.Buton4_Plus.SetOverVisual("putere/buton_plus_1.tga")
  341. self.Buton4_Plus.SetDownVisual("putere/buton_plus_2.tga")
  342. self.Buton4_Plus.SetEvent(self.activare_buton4_buton)
  343. self.Buton4_Plus.Show()
  344.  
  345. self.timp_1 = ui.AniImageBox()
  346. self.timp_1.AppendImage("putere/timp_9.tga")
  347. self.timp_1.SetParent(self.PutereBG)
  348. self.timp_1.SetPosition(237, 75)
  349. self.timp_1.Show()
  350.  
  351. self.Buton_Activare = ui.Button()
  352. self.Buton_Activare.SetParent(self.PutereBG)
  353. self.Buton_Activare.SetPosition(259, 97)
  354. self.Buton_Activare.SetUpVisual("putere/buton_activare.tga")
  355. self.Buton_Activare.SetOverVisual("putere/buton_activare_1.tga")
  356. self.Buton_Activare.SetDownVisual("putere/buton_activare_2.tga")
  357. self.Buton_Activare.SetEvent(self.activare_putere_buton)
  358. self.Buton_Activare.Show()
  359.  
  360. self.bara_goala = ui.AniImageBox()
  361. self.bara_goala.AppendImage("putere/bara_goala.tga")
  362. self.bara_goala.SetParent(self.PutereBG)
  363. self.bara_goala.SetPosition(399/2 - 339/2, 258)
  364. self.bara_goala.Show()
  365.  
  366. self.bara_plina = ui.AniImageBox()
  367. self.bara_plina.AppendImage("putere/bara_plina.tga")
  368. self.bara_plina.SetParent(self.PutereBG)
  369. self.bara_plina.SetPosition(399/2 - 339/2, 258)
  370. self.bara_plina.SetPercentage(100, 100)
  371. self.bara_plina.Show()
  372.  
  373. self.bonus_activ = ui.TextLine()
  374. self.bonus_activ.SetDefaultFontName()
  375. self.bonus_activ.SetParent(self.PutereBG)
  376. self.bonus_activ.SetPosition(245, 211)
  377. self.bonus_activ.SetText("Niciun bonus activ")
  378. self.bonus_activ.SetOutline()
  379. self.bonus_activ.Show()
  380.  
  381. self.PutereBG.Hide()
  382. # Final Sistem de Putere
  383.  
  384. ##START_KILLGUI
  385. KillGuiBg = ui.AniImageBox()
  386. KillGuiBg.AppendImage("d:/ymir work/ui/blue_killgui_interface.tga")
  387. self.KillGuiBg = KillGuiBg
  388.  
  389. self.KillGuiBg.SetPosition(wndMgr.GetScreenWidth()-245,180)
  390.  
  391. self.KillBlauReich = ui.TextLine()
  392. self.KillBlauReich.SetDefaultFontName()
  393. self.KillBlauReich.SetPosition((wndMgr.GetScreenWidth()-225)+124, 455)
  394. self.KillBlauReich.SetText("Regat Albastru: ")
  395. self.KillBlauReich.SetOutline()
  396.  
  397. self.KillGelbReich = ui.TextLine()
  398. self.KillGelbReich.SetDefaultFontName()
  399. self.KillGelbReich.SetPosition((wndMgr.GetScreenWidth()-225)+124, 351)
  400. self.KillGelbReich.SetText("Regat Galben: ")
  401. self.KillGelbReich.SetOutline()
  402.  
  403. self.KillRotReich = ui.TextLine()
  404. self.KillRotReich.SetDefaultFontName()
  405. self.KillRotReich.SetPosition((wndMgr.GetScreenWidth()-225)+124, 240)
  406. self.KillRotReich.SetText("Regat Rosu: ")
  407. self.KillRotReich.SetOutline()
  408.  
  409. self.KillMob = ui.TextLine()
  410. self.KillMob.SetDefaultFontName()
  411. self.KillMob.SetPosition((wndMgr.GetScreenWidth()-225)+124, 568)
  412. self.KillMob.SetText("Monstrii: ")
  413. self.KillMob.SetOutline()
  414. ##END_KILLGUI
  415.  
  416. ##Start buton
  417. self.Activare_Menu = ui.Button()
  418. self.Activare_Menu.SetPosition(wndMgr.GetScreenWidth()-10,wndMgr.GetScreenHeight()/2-54)
  419. self.Activare_Menu.SetUpVisual("zeta/1_1.tga")
  420. self.Activare_Menu.SetOverVisual("zeta/1_2.tga")
  421. self.Activare_Menu.SetDownVisual("zeta/1_3.tga")
  422. self.Activare_Menu.SetEvent(ui.__mem_func__(self.__menubg))
  423. self.Activare_Menu.Show()
  424.  
  425. self.Dezactivare_Menu = ui.Button()
  426. self.Dezactivare_Menu.SetPosition(wndMgr.GetScreenWidth()-60,wndMgr.GetScreenHeight()/2-54)
  427. self.Dezactivare_Menu.SetUpVisual("zeta/2_1.tga")
  428. self.Dezactivare_Menu.SetOverVisual("zeta/2_2.tga")
  429. self.Dezactivare_Menu.SetDownVisual("zeta/2_3.tga")
  430. self.Dezactivare_Menu.SetEvent(ui.__mem_func__(self.__menubg))
  431. self.Dezactivare_Menu.Hide()
  432.  
  433. menu_bg = ui.AniImageBox()
  434. menu_bg.AppendImage("zeta/fundal.tga")
  435. self.menu_bg = menu_bg
  436. self.menu_bg.SetPosition(wndMgr.GetScreenWidth()-50,wndMgr.GetScreenHeight()/2-91)
  437. self.menu_bg.SetSize(50, 301)
  438. self.menu_bg.Hide()
  439.  
  440. self.Bonusuri = ui.Button()
  441. self.Bonusuri.SetParent(self.menu_bg)
  442. self.Bonusuri.SetPosition(9, 10)
  443. self.Bonusuri.SetUpVisual("zeta/11.tga")
  444. self.Bonusuri.SetOverVisual("zeta/12.tga")
  445. self.Bonusuri.SetDownVisual("zeta/11.tga")
  446. self.Bonusuri.SetEvent(ui.__mem_func__(self.__BonusPage))
  447. self.Bonusuri.Show()
  448.  
  449. self.SistemSwicths1 = ui.Button()
  450. self.SistemSwicths1.SetParent(self.menu_bg)
  451. self.SistemSwicths1.SetPosition(7, 42)
  452. self.SistemSwicths1.SetUpVisual("zeta/13.tga")
  453. self.SistemSwicths1.SetOverVisual("zeta/14.tga")
  454. self.SistemSwicths1.SetDownVisual("zeta/13.tga")
  455. #self.SistemSwicths1.SetEvent(self.__runyShow)
  456. self.SistemSwicths1.SetEvent(self.__runyShow)
  457. self.SistemSwicths1.Show()
  458.  
  459. self.Depozit = ui.Button()
  460. self.Depozit.SetParent(self.menu_bg)
  461. self.Depozit.SetPosition(9, 74)
  462. self.Depozit.SetUpVisual("zeta/5.tga")
  463. self.Depozit.SetOverVisual("zeta/6.tga")
  464. self.Depozit.SetDownVisual("zeta/5.tga")
  465. self.Depozit.SetEvent(self.__activare_depozit)
  466. self.Depozit.Show()
  467.  
  468. self.AntiExp = ui.Button()
  469. self.AntiExp.SetParent(self.menu_bg)
  470. self.AntiExp.SetPosition(9, 106)
  471. self.AntiExp.SetUpVisual("zeta/7.tga")
  472. self.AntiExp.SetOverVisual("zeta/8.tga")
  473. self.AntiExp.SetDownVisual("zeta/7.tga")
  474. self.AntiExp.SetEvent(self.__activare_antiexp)
  475. self.AntiExp.Show()
  476.  
  477. self.Teleporter = ui.Button()
  478. self.Teleporter.SetParent(self.menu_bg)
  479. self.Teleporter.SetPosition(9, 138)
  480. self.Teleporter.SetUpVisual("zeta/9.tga")
  481. self.Teleporter.SetOverVisual("zeta/10.tga")
  482. self.Teleporter.SetDownVisual("zeta/9.tga")
  483. self.Teleporter.SetEvent(self.__activare_teleporter)
  484. self.Teleporter.Show()
  485.  
  486. self.SistemPutere1 = ui.Button()
  487. self.SistemPutere1.SetParent(self.menu_bg)
  488. self.SistemPutere1.SetPosition(9, 170)
  489. self.SistemPutere1.SetUpVisual("zeta/15.tga")
  490. self.SistemPutere1.SetOverVisual("zeta/16.tga")
  491. self.SistemPutere1.SetDownVisual("zeta/15.tga")
  492. self.SistemPutere1.SetEvent(self.__sistemputerebarra)
  493. self.SistemPutere1.Show()
  494.  
  495. self.SistemOnoare1 = ui.Button()
  496. self.SistemOnoare1.SetParent(self.menu_bg)
  497. self.SistemOnoare1.SetPosition(9, 202)
  498. self.SistemOnoare1.SetUpVisual("zeta/17.tga")
  499. self.SistemOnoare1.SetOverVisual("zeta/18.tga")
  500. self.SistemOnoare1.SetDownVisual("zeta/17.tga")
  501. self.SistemOnoare1.SetEvent(self.__sistemonoare)
  502. self.SistemOnoare1.Show()
  503. ##stop buton
  504. self.quickSlotPageIndex = 0
  505. self.PickingCharacterIndex = -1
  506. self.PickingItemIndex = -1
  507. self.consoleEnable = FALSE
  508. self.isShowDebugInfo = FALSE
  509. self.ShowNameFlag = FALSE
  510.  
  511. self.enableXMasBoom = FALSE
  512. self.startTimeXMasBoom = 0.0
  513. self.indexXMasBoom = 0
  514.  
  515. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  516.  
  517. app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  518.  
  519. constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  520. constInfo.SET_DEFAULT_CHRNAME_COLOR()
  521. constInfo.SET_DEFAULT_FOG_LEVEL()
  522. constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  523. constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  524. constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  525.  
  526. # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  527. constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  528. # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  529.  
  530. import event
  531. event.SetLeftTimeString(locale.UI_LEFT_TIME)
  532.  
  533. textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  534.  
  535. if constInfo.PVPMODE_TEST_ENABLE:
  536. self.testPKMode = ui.TextLine()
  537. self.testPKMode.SetFontName(locale.UI_DEF_FONT)
  538. self.testPKMode.SetPosition(0, 15)
  539. self.testPKMode.SetWindowHorizontalAlignCenter()
  540. self.testPKMode.SetHorizontalAlignCenter()
  541. self.testPKMode.SetFeather()
  542. self.testPKMode.SetOutline()
  543. self.testPKMode.Show()
  544.  
  545. self.testAlignment = ui.TextLine()
  546. self.testAlignment.SetFontName(locale.UI_DEF_FONT)
  547. self.testAlignment.SetPosition(0, 35)
  548. self.testAlignment.SetWindowHorizontalAlignCenter()
  549. self.testAlignment.SetHorizontalAlignCenter()
  550. self.testAlignment.SetFeather()
  551. self.testAlignment.SetOutline()
  552. self.testAlignment.Show()
  553.  
  554. self.__BuildKeyDict()
  555. self.__BuildDebugInfo()
  556.  
  557. # PRIVATE_SHOP_PRICE_LIST
  558. uiPrivateShopBuilder.Clear()
  559. # END_OF_PRIVATE_SHOP_PRICE_LIST
  560.  
  561. # UNKNOWN_UPDATE
  562. exchange.InitTrading()
  563. # END_OF_UNKNOWN_UPDATE
  564.  
  565. if debugInfo.IsDebugMode():
  566. self.ToggleDebugInfo()
  567.  
  568. ## Sound
  569. snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  570. snd.SetSoundVolume(systemSetting.GetSoundVolume())
  571.  
  572. netFieldMusicFileName = net.GetFieldMusicFileName()
  573. if netFieldMusicFileName:
  574. snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  575. elif musicInfo.fieldMusic != "":
  576. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  577.  
  578. self.__SetQuickSlotMode()
  579. self.__SelectQuickPage(self.quickSlotPageIndex)
  580.  
  581. self.SetFocus()
  582. self.Show()
  583. app.ShowCursor()
  584.  
  585. net.SendEnterGamePacket()
  586.  
  587. # START_GAME_ERROR_EXIT
  588. try:
  589. self.StartGame()
  590. except:
  591. import exception
  592. exception.Abort("GameWindow.Open")
  593. # END_OF_START_GAME_ERROR_EXIT
  594. self.cubeInformation = {}
  595. self.currentCubeNPC = 0
  596.  
  597. def Close(self):
  598. self.Hide()
  599.  
  600. if self.RunWindow:
  601. self.RunWindow.Close()
  602. self.RunWindow = None
  603.  
  604. constInfo.SISTEM_ONOARE = 0
  605. self.sistem_onoare_bg.Hide()
  606.  
  607. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  608. (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  609.  
  610. if musicInfo.fieldMusic != "":
  611. snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  612.  
  613. self.onPressKeyDict = None
  614. self.onClickKeyDict = None
  615.  
  616. chat.Close()
  617. self.menu_bg.Hide()
  618. self.Dezactivare_Menu.Hide()
  619. self.Activare_Menu.Hide()
  620. snd.StopAllSound()
  621. grp.InitScreenEffect()
  622. chr.Destroy()
  623. textTail.Clear()
  624. quest.Clear()
  625. background.Destroy()
  626. guild.Destroy()
  627. messenger.Destroy()
  628. skill.ClearSkillData()
  629. wndMgr.Unlock()
  630. mouseModule.mouseController.DeattachObject()
  631.  
  632. if self.guildWarQuestionDialog:
  633. self.guildWarQuestionDialog.Close()
  634.  
  635. self.guildNameBoard = None
  636. self.partyRequestQuestionDialog = None
  637. self.partyInviteQuestionDialog = None
  638. self.guildInviteQuestionDialog = None
  639. self.guildWarQuestionDialog = None
  640. self.messengerAddFriendQuestion = None
  641.  
  642. # UNKNOWN_UPDATE
  643. self.itemDropQuestionDialog = None
  644. # END_OF_UNKNOWN_UPDATE
  645.  
  646. # QUEST_CONFIRM
  647. self.confirmDialog = None
  648. # END_OF_QUEST_CONFIRM
  649.  
  650. self.PrintCoord = None
  651. self.FrameRate = None
  652. self.Pitch = None
  653. self.Splat = None
  654. self.TextureNum = None
  655. self.ObjectNum = None
  656. self.ViewDistance = None
  657.  
  658. self.ClearDictionary()
  659.  
  660. self.playerGauge = None
  661. self.mapNameShower = None
  662. self.affectShower = None
  663.  
  664. if self.console:
  665. self.console.BindGameClass(0)
  666. self.console.Close()
  667. self.console=None
  668.  
  669. if self.targetBoard:
  670. self.targetBoard.Destroy()
  671. self.targetBoard = None
  672.  
  673. if self.interface:
  674. self.interface.HideAllWindows()
  675. self.interface.Close()
  676. self.interface=None
  677.  
  678. player.ClearSkillDict()
  679. player.ResetCameraRotation()
  680.  
  681. self.KillFocus()
  682. app.HideCursor()
  683.  
  684.  
  685. print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  686.  
  687. def __BuildKeyDict(self):
  688. onPressKeyDict = {}
  689.  
  690.  
  691. onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(1)
  692. onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(2)
  693. onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(3)
  694. onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(4)
  695. onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5)
  696. onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6)
  697. onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7)
  698. onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8)
  699. onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9)
  700. onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(4)
  701. onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(5)
  702. onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(6)
  703. onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
  704. onPressKeyDict[app.DIK_F6] = lambda : self.__afk()
  705. onPressKeyDict[app.DIK_F5] = lambda : self.__showkillgui()
  706. onPressKeyDict[app.DIK_F7] = lambda : self.__runyShow()
  707.  
  708. onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()
  709. onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage()
  710. onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen()
  711. onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack()
  712.  
  713.  
  714. onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp()
  715. onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown()
  716. onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft()
  717. onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight()
  718. onPressKeyDict[app.DIK_W] = lambda : self.MoveUp()
  719. onPressKeyDict[app.DIK_S] = lambda : self.MoveDown()
  720. onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft()
  721. onPressKeyDict[app.DIK_D] = lambda : self.MoveRight()
  722.  
  723. onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  724. onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  725. #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  726. onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  727. onPressKeyDict[app.DIK_G] = self.__PressGKey
  728. onPressKeyDict[app.DIK_Q] = self.__PressQKey
  729.  
  730. onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera()
  731. onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  732. onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  733. onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  734. onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  735. onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  736. onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  737. onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem()
  738. onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem()
  739. onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  740. onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  741. #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  742. onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  743. onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow()
  744. onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey()
  745. #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow()
  746. onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp()
  747. onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown()
  748. onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow()
  749. onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key
  750. onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode()
  751.  
  752. onPressKeyDict[app.DIK_J] = lambda : self.__PressJKey()
  753. onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey()
  754. onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey()
  755. onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
  756.  
  757. # CUBE_TEST
  758. #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow()
  759. # CUBE_TEST_END
  760.  
  761. self.onPressKeyDict = onPressKeyDict
  762.  
  763. onClickKeyDict = {}
  764. onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  765. onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  766. onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  767. onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  768. onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  769.  
  770. onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  771. onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  772. onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  773. onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  774. onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  775. onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  776. onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  777. onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  778. onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  779. onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  780. onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  781. onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  782. onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  783. onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  784. onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  785. onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  786. onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  787. onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  788. onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  789.  
  790.  
  791. #if constInfo.PVPMODE_ACCELKEY_ENABLE:
  792. # onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode()
  793.  
  794. self.onClickKeyDict=onClickKeyDict
  795.  
  796. # BUG_ROUA_EUGEN_PRO_AREA
  797. def __PressNumKey(self,num):
  798. if time.clock() >= self.utilizareTaste:
  799. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  800.  
  801. if num >= 1 and num <= 9:
  802. if(chrmgr.IsPossibleEmoticon(-1)):
  803. chrmgr.SetEmoticon(-1,int(num)-1)
  804. net.SendEmoticon(int(num)-1)
  805. else:
  806. if num >= 1 and num <= 4:
  807. self.pressNumber(num-1)
  808. else:
  809. chat.AppendChat(chat.CHAT_TYPE_INFO, "Mai asteapta cateva secunde pentru a putea folosi comanda.")
  810. # FINAL_BUG_ROUA_EUGEN_PRO_AREA
  811.  
  812. def __ClickBKey(self):
  813. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  814. return
  815. else:
  816. if constInfo.PVPMODE_ACCELKEY_ENABLE:
  817. self.ChangePKMode()
  818.  
  819.  
  820. def __PressJKey(self):
  821. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  822. if player.IsMountingHorse():
  823. net.SendChatPacket("/unmount")
  824. else:
  825. #net.SendChatPacket("/user_horse_ride")
  826. if not uiPrivateShopBuilder.IsBuildingPrivateShop():
  827. for i in xrange(player.INVENTORY_PAGE_SIZE):
  828. if player.GetItemIndex(i) in (71114, 71116, 71118, 71120):
  829. net.SendItemUsePacket(i)
  830. break
  831. def __PressHKey(self):
  832. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  833. net.SendChatPacket("/user_horse_ride")
  834. else:
  835. self.interface.OpenHelpWindow()
  836.  
  837. def __PressBKey(self):
  838. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  839. net.SendChatPacket("/user_horse_back")
  840. else:
  841. state = "EMOTICON"
  842. self.interface.ToggleCharacterWindow(state)
  843.  
  844. def __PressFKey(self):
  845. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  846. net.SendChatPacket("/user_horse_feed")
  847. else:
  848. app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  849.  
  850. def __PressGKey(self):
  851. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  852. net.SendChatPacket("/ride")
  853. else:
  854. if self.ShowNameFlag:
  855. self.interface.ToggleGuildWindow()
  856. else:
  857. app.PitchCamera(app.CAMERA_TO_POSITIVE)
  858.  
  859. def __ReleaseGKey(self):
  860. app.PitchCamera(app.CAMERA_STOP)
  861.  
  862. def __PressQKey(self):
  863. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  864. if 0==interfaceModule.IsQBHide:
  865. interfaceModule.IsQBHide = 1
  866. self.interface.HideAllQuestButton()
  867. else:
  868. interfaceModule.IsQBHide = 0
  869. self.interface.ShowAllQuestButton()
  870. else:
  871. app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  872.  
  873. def __SetQuickSlotMode(self):
  874. self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  875.  
  876. # BUG_ROUA_EUGEN_PRO_AREA
  877. def __PressQuickSlot(self, localSlotIndex):
  878. if time.clock() >= self.utilizareTaste:
  879. player.RequestUseLocalQuickSlot(localSlotIndex)
  880. else:
  881. chat.AppendChat(chat.CHAT_TYPE_INFO, "Mai asteapta cateva secunde pentru a putea folosi comanda.")
  882. # FINAL_BUG_ROUA_EUGEN_PRO_AREA
  883.  
  884. def __SetQuickPageMode(self):
  885. self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  886.  
  887. def __PressQuickSlot(self, localSlotIndex):
  888. player.RequestUseLocalQuickSlot(localSlotIndex)
  889.  
  890. def __SelectQuickPage(self, pageIndex):
  891. self.quickSlotPageIndex = pageIndex
  892. player.SetQuickPage(pageIndex)
  893.  
  894. def ToggleDebugInfo(self):
  895. self.isShowDebugInfo = not self.isShowDebugInfo
  896.  
  897. if self.isShowDebugInfo:
  898. self.PrintCoord.Show()
  899. self.FrameRate.Show()
  900. self.Pitch.Show()
  901. self.Splat.Show()
  902. self.TextureNum.Show()
  903. self.ObjectNum.Show()
  904. self.ViewDistance.Show()
  905. else:
  906. self.PrintCoord.Hide()
  907. self.FrameRate.Hide()
  908. self.Pitch.Hide()
  909. self.Splat.Hide()
  910. self.TextureNum.Hide()
  911. self.ObjectNum.Hide()
  912. self.ViewDistance.Hide()
  913.  
  914. def __BuildDebugInfo(self):
  915. ## Character Position Coordinate
  916. self.PrintCoord = ui.TextLine()
  917. self.PrintCoord.SetFontName(locale.UI_DEF_FONT)
  918. self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  919.  
  920. ## Frame Rate
  921. self.FrameRate = ui.TextLine()
  922. self.FrameRate.SetFontName(locale.UI_DEF_FONT)
  923. self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  924.  
  925. ## Camera Pitch
  926. self.Pitch = ui.TextLine()
  927. self.Pitch.SetFontName(locale.UI_DEF_FONT)
  928. self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  929.  
  930. ## Splat
  931. self.Splat = ui.TextLine()
  932. self.Splat.SetFontName(locale.UI_DEF_FONT)
  933. self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  934.  
  935. # TextureNum
  936. self.TextureNum = ui.TextLine()
  937. self.TextureNum.SetFontName(locale.UI_DEF_FONT)
  938. self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  939.  
  940. # ¿ÀºêÁ§Æ® ±×¸®´Â °³¼ö
  941. self.ObjectNum = ui.TextLine()
  942. self.ObjectNum.SetFontName(locale.UI_DEF_FONT)
  943. self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  944.  
  945. # ½Ã¾ß°Å¸®
  946. self.ViewDistance = ui.TextLine()
  947. self.ViewDistance.SetFontName(locale.UI_DEF_FONT)
  948. self.ViewDistance.SetPosition(0, 0)
  949.  
  950. def __NotifyError(self, msg):
  951. chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  952.  
  953. def ChangePKMode(self):
  954.  
  955. if not app.IsPressed(app.DIK_LCONTROL):
  956. return
  957.  
  958. if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  959. self.__NotifyError(locale.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  960. return
  961.  
  962. curTime = app.GetTime()
  963. if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  964. return
  965.  
  966. self.lastPKModeSendedTime = curTime
  967.  
  968. curPKMode = player.GetPKMode()
  969. nextPKMode = curPKMode + 1
  970. if nextPKMode == player.PK_MODE_PROTECT:
  971. if 0 == player.GetGuildID():
  972. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  973. nextPKMode = 0
  974. else:
  975. nextPKMode = player.PK_MODE_GUILD
  976.  
  977. elif nextPKMode == player.PK_MODE_MAX_NUM:
  978. nextPKMode = 0
  979.  
  980. net.SendChatPacket("/PKMode " + str(nextPKMode))
  981. print "/PKMode " + str(nextPKMode)
  982.  
  983. def OnChangePKMode(self):
  984.  
  985. self.interface.OnChangePKMode()
  986.  
  987. try:
  988. self.__NotifyError(locale.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  989. except KeyError:
  990. print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  991.  
  992. if constInfo.PVPMODE_TEST_ENABLE:
  993. curPKMode = player.GetPKMode()
  994. alignment, grade = chr.testGetPKData()
  995. self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  996. self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  997. self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + locale.TITLE_NAME_LIST[grade] + ")")
  998.  
  999. ###############################################################################################
  1000. ###############################################################################################
  1001. ## Game Callback Functions
  1002.  
  1003. # Start
  1004. def StartGame(self):
  1005. self.RefreshInventory()
  1006. self.RefreshEquipment()
  1007. self.RefreshCharacter()
  1008. self.RefreshSkill()
  1009.  
  1010. # Refresh
  1011. def CheckGameButton(self):
  1012. if self.interface:
  1013. self.interface.CheckGameButton()
  1014.  
  1015. def RefreshAlignment(self):
  1016. self.interface.RefreshAlignment()
  1017.  
  1018. def RefreshStatus(self):
  1019. self.CheckGameButton()
  1020.  
  1021. if self.interface:
  1022. self.interface.RefreshStatus()
  1023.  
  1024. if self.playerGauge:
  1025. self.playerGauge.RefreshGauge()
  1026.  
  1027. def RefreshStamina(self):
  1028. self.interface.RefreshStamina()
  1029.  
  1030. def RefreshSkill(self):
  1031. self.CheckGameButton()
  1032. if self.interface:
  1033. self.interface.RefreshSkill()
  1034.  
  1035. def RefreshQuest(self):
  1036. self.interface.RefreshQuest()
  1037.  
  1038. def RefreshMessenger(self):
  1039. self.interface.RefreshMessenger()
  1040.  
  1041. def RefreshGuildInfoPage(self):
  1042. self.interface.RefreshGuildInfoPage()
  1043.  
  1044. def RefreshGuildBoardPage(self):
  1045. self.interface.RefreshGuildBoardPage()
  1046.  
  1047. def RefreshGuildMemberPage(self):
  1048. self.interface.RefreshGuildMemberPage()
  1049.  
  1050. def RefreshGuildMemberPageGradeComboBox(self):
  1051. self.interface.RefreshGuildMemberPageGradeComboBox()
  1052.  
  1053. def RefreshGuildSkillPage(self):
  1054. self.interface.RefreshGuildSkillPage()
  1055.  
  1056. def RefreshGuildGradePage(self):
  1057. self.interface.RefreshGuildGradePage()
  1058.  
  1059. def RefreshMobile(self):
  1060. if self.interface:
  1061. self.interface.RefreshMobile()
  1062.  
  1063. def OnMobileAuthority(self):
  1064. self.interface.OnMobileAuthority()
  1065.  
  1066. def OnBlockMode(self, mode):
  1067. self.interface.OnBlockMode(mode)
  1068.  
  1069. def OpenQuestWindow(self, skin, idx):
  1070. self.interface.OpenQuestWindow(skin, idx)
  1071.  
  1072. def AskGuildName(self):
  1073.  
  1074. guildNameBoard = uiCommon.InputDialog()
  1075. guildNameBoard.SetTitle(locale.GUILD_NAME)
  1076. guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  1077. guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  1078. guildNameBoard.Open()
  1079.  
  1080. self.guildNameBoard = guildNameBoard
  1081.  
  1082. def ConfirmGuildName(self):
  1083. guildName = self.guildNameBoard.GetText()
  1084. if not guildName:
  1085. return
  1086.  
  1087. if net.IsInsultIn(guildName):
  1088. self.PopupMessage(locale.GUILD_CREATE_ERROR_INSULT_NAME)
  1089. return
  1090.  
  1091. net.SendAnswerMakeGuildPacket(guildName)
  1092. self.guildNameBoard.Close()
  1093. self.guildNameBoard = None
  1094. return TRUE
  1095.  
  1096. def CancelGuildName(self):
  1097. self.guildNameBoard.Close()
  1098. self.guildNameBoard = None
  1099. return TRUE
  1100.  
  1101. ## Refine
  1102. def PopupMessage(self, msg):
  1103. self.stream.popupWindow.Close()
  1104. self.stream.popupWindow.Open(msg, 0, locale.UI_OK)
  1105.  
  1106. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  1107. self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  1108.  
  1109. def AppendMaterialToRefineDialog(self, vnum, count):
  1110. self.interface.AppendMaterialToRefineDialog(vnum, count)
  1111.  
  1112. def RunUseSkillEvent(self, slotIndex, coolTime):
  1113. self.interface.OnUseSkill(slotIndex, coolTime)
  1114.  
  1115. def ClearAffects(self):
  1116. self.affectShower.ClearAffects()
  1117.  
  1118. def SetAffect(self, affect):
  1119. self.affectShower.SetAffect(affect)
  1120.  
  1121. def ResetAffect(self, affect):
  1122. self.affectShower.ResetAffect(affect)
  1123.  
  1124. # UNKNOWN_UPDATE
  1125. def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  1126. self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  1127.  
  1128. def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  1129. self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  1130. # END_OF_UNKNOWN_UPDATE
  1131.  
  1132. def ActivateSkillSlot(self, slotIndex):
  1133. if self.interface:
  1134. self.interface.OnActivateSkill(slotIndex)
  1135.  
  1136. def DeactivateSkillSlot(self, slotIndex):
  1137. if self.interface:
  1138. self.interface.OnDeactivateSkill(slotIndex)
  1139.  
  1140. def RefreshEquipment(self):
  1141. if self.interface:
  1142. self.interface.RefreshInventory()
  1143.  
  1144. def RefreshInventory(self):
  1145. if self.interface:
  1146. self.interface.RefreshInventory()
  1147.  
  1148. def RefreshCharacter(self):
  1149. if self.interface:
  1150. self.interface.RefreshCharacter()
  1151.  
  1152. def OnGameOver(self):
  1153. self.CloseTargetBoard()
  1154. self.OpenRestartDialog()
  1155.  
  1156. def OpenRestartDialog(self):
  1157. self.interface.OpenRestartDialog()
  1158.  
  1159. def ChangeCurrentSkill(self, skillSlotNumber):
  1160. self.interface.OnChangeCurrentSkill(skillSlotNumber)
  1161.  
  1162. ## TargetBoard
  1163. def SetPCTargetBoard(self, vid, name):
  1164. self.targetBoard.Open(vid, name)
  1165.  
  1166. if app.IsPressed(app.DIK_LCONTROL):
  1167.  
  1168. if not player.IsSameEmpire(vid):
  1169. return
  1170.  
  1171. if player.IsMainCharacterIndex(vid):
  1172. return
  1173. elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  1174. return
  1175.  
  1176. self.interface.OpenWhisperDialog(name)
  1177.  
  1178.  
  1179. def RefreshTargetBoardByVID(self, vid):
  1180. self.targetBoard.RefreshByVID(vid)
  1181.  
  1182. def RefreshTargetBoardByName(self, name):
  1183. self.targetBoard.RefreshByName(name)
  1184.  
  1185. def __RefreshTargetBoard(self):
  1186. self.targetBoard.Refresh()
  1187.  
  1188. def SetHPTargetBoard(self, vid, hpPercentage):
  1189. if vid != self.targetBoard.GetTargetVID():
  1190. self.targetBoard.ResetTargetBoard()
  1191. self.targetBoard.SetEnemyVID(vid)
  1192.  
  1193. self.targetBoard.SetHP(hpPercentage)
  1194. self.targetBoard.Show()
  1195.  
  1196. def CloseTargetBoardIfDifferent(self, vid):
  1197. if vid != self.targetBoard.GetTargetVID():
  1198. self.targetBoard.Close()
  1199.  
  1200. def CloseTargetBoard(self):
  1201. self.targetBoard.Close()
  1202.  
  1203. ## View Equipment
  1204. def OpenEquipmentDialog(self, vid):
  1205. self.interface.OpenEquipmentDialog(vid)
  1206.  
  1207. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  1208. self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  1209.  
  1210. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  1211. self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  1212.  
  1213. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  1214. self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  1215.  
  1216. # SHOW_LOCAL_MAP_NAME
  1217. def ShowMapName(self, mapName, x, y):
  1218.  
  1219. if self.mapNameShower:
  1220. self.mapNameShower.ShowMapName(mapName, x, y)
  1221.  
  1222. if self.interface:
  1223. self.interface.SetMapName(mapName)
  1224. # END_OF_SHOW_LOCAL_MAP_NAME
  1225.  
  1226. def BINARY_OpenAtlasWindow(self):
  1227. self.interface.BINARY_OpenAtlasWindow()
  1228.  
  1229. ## Chat
  1230. def OnRecvWhisper(self, mode, name, line):
  1231. global afk
  1232. afk = time.strftime("%H:%M:%S")
  1233. if mode == chat.WHISPER_TYPE_GM:
  1234. self.interface.RegisterGameMasterName(name)
  1235. if line[-25:] == "Scuza-ma sunt AFK":
  1236. net.SendWhisperPacket(name, afk)
  1237. chat.AppendWhisper(mode, name, line)
  1238. self.interface.RecvWhisper(name)
  1239. return
  1240. if constInfo.AFK == 1 and line[-5:] != afk:
  1241. net.SendWhisperPacket(name, "Scuza-ma sunt AFK")
  1242. chat.AppendWhisper(mode, name, line)
  1243. self.interface.RecvWhisper(name)
  1244. else:
  1245. chat.AppendWhisper(mode, name, line)
  1246. self.interface.RecvWhisper(name)
  1247.  
  1248. def OnRecvWhisperSystemMessage(self, mode, name, line):
  1249. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  1250. self.interface.RecvWhisper(name)
  1251.  
  1252. def OnRecvWhisperError(self, mode, name, line):
  1253. if locale.WHISPER_ERROR.has_key(mode):
  1254. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, locale.WHISPER_ERROR[mode](name))
  1255. else:
  1256. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  1257. self.interface.RecvWhisper(name)
  1258.  
  1259. def RecvWhisper(self, name):
  1260. self.interface.RecvWhisper(name)
  1261.  
  1262. def OnPickMoney(self, money):
  1263. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.GAME_PICK_MONEY % (money))
  1264.  
  1265. def OnShopError(self, type):
  1266. try:
  1267. self.PopupMessage(locale.SHOP_ERROR_DICT[type])
  1268. except KeyError:
  1269. self.PopupMessage(locale.SHOP_ERROR_UNKNOWN % (type))
  1270.  
  1271. def OnSafeBoxError(self):
  1272. self.PopupMessage(locale.SAFEBOX_ERROR)
  1273.  
  1274. def OnFishingSuccess(self, isFish, fishName):
  1275. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, locale.FISHING_SUCCESS(isFish, fishName), 2000)
  1276.  
  1277. # ADD_FISHING_MESSAGE
  1278. def OnFishingNotifyUnknown(self):
  1279. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.FISHING_UNKNOWN)
  1280.  
  1281. def OnFishingWrongPlace(self):
  1282. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.FISHING_WRONG_PLACE)
  1283. # END_OF_ADD_FISHING_MESSAGE
  1284.  
  1285. def OnFishingNotify(self, isFish, fishName):
  1286. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.FISHING_NOTIFY(isFish, fishName))
  1287.  
  1288. def OnFishingFailure(self):
  1289. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, locale.FISHING_FAILURE, 2000)
  1290.  
  1291. def OnCannotPickItem(self):
  1292. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.GAME_CANNOT_PICK_ITEM)
  1293.  
  1294. # MINING
  1295. def OnCannotMining(self):
  1296. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.GAME_CANNOT_MINING)
  1297. # END_OF_MINING
  1298.  
  1299. def OnCannotUseSkill(self, vid, type):
  1300. if locale.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  1301. textTail.RegisterInfoTail(vid, locale.USE_SKILL_ERROR_TAIL_DICT[type])
  1302.  
  1303. if locale.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  1304. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.USE_SKILL_ERROR_CHAT_DICT[type])
  1305.  
  1306. def OnCannotShotError(self, vid, type):
  1307. textTail.RegisterInfoTail(vid, locale.SHOT_ERROR_TAIL_DICT.get(type, locale.SHOT_ERROR_UNKNOWN % (type)))
  1308.  
  1309. ## PointReset
  1310. def StartPointReset(self):
  1311. self.interface.OpenPointResetDialog()
  1312.  
  1313. ## Shop
  1314. def StartShop(self, vid):
  1315. self.interface.OpenShopDialog(vid)
  1316.  
  1317. def EndShop(self):
  1318. self.interface.CloseShopDialog()
  1319.  
  1320. def RefreshShop(self):
  1321. self.interface.RefreshShopDialog()
  1322.  
  1323. def SetShopSellingPrice(self, Price):
  1324. pass
  1325.  
  1326. ## Exchange
  1327. def StartExchange(self):
  1328. self.interface.StartExchange()
  1329.  
  1330. def EndExchange(self):
  1331. self.interface.EndExchange()
  1332.  
  1333. def RefreshExchange(self):
  1334. self.interface.RefreshExchange()
  1335.  
  1336. ## Party
  1337. def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1338. partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1339. partyInviteQuestionDialog.SetText(leaderName + locale.PARTY_DO_YOU_JOIN)
  1340. partyInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerPartyInvite(arg))
  1341. partyInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerPartyInvite(arg))
  1342. partyInviteQuestionDialog.Open()
  1343. partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1344. self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1345.  
  1346. def AnswerPartyInvite(self, answer):
  1347.  
  1348. if not self.partyInviteQuestionDialog:
  1349. return
  1350.  
  1351. partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1352.  
  1353. distance = player.GetCharacterDistance(partyLeaderVID)
  1354. if distance < 0.0 or distance > 5000:
  1355. answer = FALSE
  1356.  
  1357. net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1358.  
  1359. self.partyInviteQuestionDialog.Close()
  1360. self.partyInviteQuestionDialog = None
  1361.  
  1362. def AddPartyMember(self, pid, name):
  1363. self.interface.AddPartyMember(pid, name)
  1364.  
  1365. def UpdatePartyMemberInfo(self, pid):
  1366. self.interface.UpdatePartyMemberInfo(pid)
  1367.  
  1368. def RemovePartyMember(self, pid):
  1369. self.interface.RemovePartyMember(pid)
  1370. self.__RefreshTargetBoard()
  1371.  
  1372. def LinkPartyMember(self, pid, vid):
  1373. self.interface.LinkPartyMember(pid, vid)
  1374.  
  1375. def UnlinkPartyMember(self, pid):
  1376. self.interface.UnlinkPartyMember(pid)
  1377.  
  1378. def UnlinkAllPartyMember(self):
  1379. self.interface.UnlinkAllPartyMember()
  1380.  
  1381. def ExitParty(self):
  1382. self.interface.ExitParty()
  1383. self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1384.  
  1385. def ChangePartyParameter(self, distributionMode):
  1386. self.interface.ChangePartyParameter(distributionMode)
  1387.  
  1388. ## Messenger
  1389. def OnMessengerAddFriendQuestion(self, name):
  1390. messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1391. messengerAddFriendQuestion.SetText1(locale.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1392. messengerAddFriendQuestion.SetText2(locale.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1393. messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1394. messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1395. messengerAddFriendQuestion.Open()
  1396. messengerAddFriendQuestion.name = name
  1397. self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1398.  
  1399. def OnAcceptAddFriend(self):
  1400. name = self.messengerAddFriendQuestion.name
  1401. net.SendChatPacket("/messenger_auth y " + name)
  1402. self.OnCloseAddFriendQuestionDialog()
  1403. return TRUE
  1404.  
  1405. def OnDenyAddFriend(self):
  1406. name = self.messengerAddFriendQuestion.name
  1407. net.SendChatPacket("/messenger_auth n " + name)
  1408. self.OnCloseAddFriendQuestionDialog()
  1409. return TRUE
  1410.  
  1411. def OnCloseAddFriendQuestionDialog(self):
  1412. self.messengerAddFriendQuestion.Close()
  1413. self.messengerAddFriendQuestion = None
  1414. return TRUE
  1415.  
  1416. ## SafeBox
  1417. def OpenSafeboxWindow(self, size):
  1418. self.interface.OpenSafeboxWindow(size)
  1419.  
  1420. def RefreshSafebox(self):
  1421. self.interface.RefreshSafebox()
  1422.  
  1423. def RefreshSafeboxMoney(self):
  1424. self.interface.RefreshSafeboxMoney()
  1425.  
  1426. # ITEM_MALL
  1427. def OpenMallWindow(self, size):
  1428. self.interface.OpenMallWindow(size)
  1429.  
  1430. def RefreshMall(self):
  1431. self.interface.RefreshMall()
  1432. # END_OF_ITEM_MALL
  1433.  
  1434. ## Guild
  1435. def RecvGuildInviteQuestion(self, guildID, guildName):
  1436. guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1437. guildInviteQuestionDialog.SetText(guildName + locale.GUILD_DO_YOU_JOIN)
  1438. guildInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerGuildInvite(arg))
  1439. guildInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerGuildInvite(arg))
  1440. guildInviteQuestionDialog.Open()
  1441. guildInviteQuestionDialog.guildID = guildID
  1442. self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1443.  
  1444. def AnswerGuildInvite(self, answer):
  1445.  
  1446. if not self.guildInviteQuestionDialog:
  1447. return
  1448.  
  1449. guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1450. net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1451.  
  1452. self.guildInviteQuestionDialog.Close()
  1453. self.guildInviteQuestionDialog = None
  1454.  
  1455.  
  1456. def DeleteGuild(self):
  1457. self.interface.DeleteGuild()
  1458.  
  1459. ## Clock
  1460. def ShowClock(self, second):
  1461. self.interface.ShowClock(second)
  1462.  
  1463. def HideClock(self):
  1464. self.interface.HideClock()
  1465.  
  1466. ## Emotion
  1467. def BINARY_ActEmotion(self, emotionIndex):
  1468. if self.interface.wndCharacter:
  1469. self.interface.wndCharacter.ActEmotion(emotionIndex)
  1470.  
  1471. ###############################################################################################
  1472. ###############################################################################################
  1473. ## Keyboard Functions
  1474.  
  1475. def CheckFocus(self):
  1476. if FALSE == self.IsFocus():
  1477. if TRUE == self.interface.IsOpenChat():
  1478. self.interface.ToggleChat()
  1479.  
  1480. self.SetFocus()
  1481.  
  1482. def SaveScreen(self):
  1483. print "save screen"
  1484.  
  1485. # SCREENSHOT_CWDSAVE
  1486. if SCREENSHOT_CWDSAVE:
  1487. if not os.path.exists(os.getcwd()+os.sep+"screens"):
  1488. os.mkdir(os.getcwd()+os.sep+"screens")
  1489.  
  1490. (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screens"+os.sep)
  1491. elif SCREENSHOT_DIR:
  1492. (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1493. else:
  1494. (succeeded, name) = grp.SaveScreenShot()
  1495. # END_OF_SCREENSHOT_CWDSAVE
  1496.  
  1497. if succeeded:
  1498. pass
  1499. """
  1500. chat.AppendChat(chat.CHAT_TYPE_INFO, name + locale.SCREENSHOT_SAVE1)
  1501. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.SCREENSHOT_SAVE2)
  1502. """
  1503. else:
  1504. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.SCREENSHOT_SAVE_FAILURE)
  1505.  
  1506. def ShowConsole(self):
  1507. if debugInfo.IsDebugMode() or TRUE == self.consoleEnable:
  1508. player.EndKeyWalkingImmediately()
  1509. self.console.OpenWindow()
  1510.  
  1511. def ShowName(self):
  1512. self.ShowNameFlag = TRUE
  1513. self.playerGauge.EnableShowAlways()
  1514. player.SetQuickPage(self.quickSlotPageIndex+1)
  1515.  
  1516. # ADD_ALWAYS_SHOW_NAME
  1517. def __IsShowName(self):
  1518.  
  1519. if systemSetting.IsAlwaysShowName():
  1520. return TRUE
  1521.  
  1522. if self.ShowNameFlag:
  1523. return TRUE
  1524.  
  1525. return FALSE
  1526. # END_OF_ADD_ALWAYS_SHOW_NAME
  1527.  
  1528. def HideName(self):
  1529. self.ShowNameFlag = FALSE
  1530. self.playerGauge.DisableShowAlways()
  1531. player.SetQuickPage(self.quickSlotPageIndex)
  1532.  
  1533. def ShowMouseImage(self):
  1534. self.interface.ShowMouseImage()
  1535.  
  1536. def HideMouseImage(self):
  1537. self.interface.HideMouseImage()
  1538.  
  1539. def StartAttack(self):
  1540. player.SetAttackKeyState(TRUE)
  1541.  
  1542. def EndAttack(self):
  1543. player.SetAttackKeyState(FALSE)
  1544.  
  1545. def MoveUp(self):
  1546. player.SetSingleDIKKeyState(app.DIK_UP, TRUE)
  1547.  
  1548. def MoveDown(self):
  1549. player.SetSingleDIKKeyState(app.DIK_DOWN, TRUE)
  1550.  
  1551. def MoveLeft(self):
  1552. player.SetSingleDIKKeyState(app.DIK_LEFT, TRUE)
  1553.  
  1554. def MoveRight(self):
  1555. player.SetSingleDIKKeyState(app.DIK_RIGHT, TRUE)
  1556.  
  1557. def StopUp(self):
  1558. player.SetSingleDIKKeyState(app.DIK_UP, FALSE)
  1559.  
  1560. def StopDown(self):
  1561. player.SetSingleDIKKeyState(app.DIK_DOWN, FALSE)
  1562.  
  1563. def StopLeft(self):
  1564. player.SetSingleDIKKeyState(app.DIK_LEFT, FALSE)
  1565.  
  1566. def StopRight(self):
  1567. player.SetSingleDIKKeyState(app.DIK_RIGHT, FALSE)
  1568.  
  1569. def PickUpItem(self):
  1570. player.PickCloseItem()
  1571.  
  1572. ###############################################################################################
  1573. ###############################################################################################
  1574. ## Event Handler
  1575.  
  1576. def OnKeyDown(self, key):
  1577. if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1578. return
  1579.  
  1580. constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
  1581.  
  1582. try:
  1583. self.onPressKeyDict[key]()
  1584. except KeyError:
  1585. pass
  1586. except:
  1587. raise
  1588.  
  1589. return TRUE
  1590.  
  1591. def OnKeyUp(self, key):
  1592. try:
  1593. self.onClickKeyDict[key]()
  1594. except KeyError:
  1595. pass
  1596. except:
  1597. raise
  1598.  
  1599. return TRUE
  1600.  
  1601. def OnMouseLeftButtonDown(self):
  1602. if self.interface.BUILD_OnMouseLeftButtonDown():
  1603. return
  1604.  
  1605. if mouseModule.mouseController.isAttached():
  1606. self.CheckFocus()
  1607. else:
  1608. hyperlink = ui.GetHyperlink()
  1609. if hyperlink:
  1610. return
  1611. else:
  1612. self.CheckFocus()
  1613. player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1614.  
  1615. return TRUE
  1616.  
  1617. def OnMouseLeftButtonUp(self):
  1618.  
  1619. if self.interface.BUILD_OnMouseLeftButtonUp():
  1620. return
  1621.  
  1622. if mouseModule.mouseController.isAttached():
  1623.  
  1624. attachedType = mouseModule.mouseController.GetAttachedType()
  1625. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1626. attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1627. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1628.  
  1629. ## QuickSlot
  1630. if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1631. player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1632.  
  1633. ## Inventory
  1634. elif player.SLOT_TYPE_INVENTORY == attachedType:
  1635.  
  1636. if player.ITEM_MONEY == attachedItemIndex:
  1637. self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1638. else:
  1639. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1640.  
  1641. mouseModule.mouseController.DeattachObject()
  1642.  
  1643. else:
  1644. hyperlink = ui.GetHyperlink()
  1645. if hyperlink:
  1646. if app.IsPressed(app.DIK_LALT):
  1647. link = chat.GetLinkFromHyperlink(hyperlink)
  1648. ime.PasteString(link)
  1649. else:
  1650. self.interface.MakeHyperlinkTooltip(hyperlink)
  1651. return
  1652. else:
  1653. player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  1654.  
  1655. #player.EndMouseWalking()
  1656. return TRUE
  1657.  
  1658. def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  1659. if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1660. if player.IsEquipmentSlot(attachedItemSlotPos):
  1661. self.stream.popupWindow.Close()
  1662. self.stream.popupWindow.Open(locale.EXCHANGE_FAILURE_EQUIP_ITEM, 0, locale.UI_OK)
  1663. else:
  1664. if chr.IsNPC(dstChrID):
  1665. net.SendGiveItemPacket(dstChrID, attachedItemSlotPos, attachedItemCount)
  1666. else:
  1667. net.SendExchangeStartPacket(dstChrID)
  1668. net.SendExchangeItemAddPacket(attachedItemSlotPos, 0)
  1669. else:
  1670. self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1671.  
  1672. def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  1673. if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  1674. net.SendExchangeStartPacket(dstChrID)
  1675. net.SendExchangeElkAddPacket(attachedMoney)
  1676. else:
  1677. self.__DropMoney(attachedType, attachedMoney)
  1678.  
  1679. def __DropMoney(self, attachedType, attachedMoney):
  1680. # PRIVATESHOP_DISABLE_ITEM_DROP - °³ÀλóÁ¡ ¿­°í ÀÖ´Â µ¿¾È ¾ÆÀÌÅÛ ¹ö¸² ¹æÁö
  1681. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1682. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1683. return
  1684. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1685.  
  1686. if attachedMoney>=1000:
  1687. self.stream.popupWindow.Close()
  1688. self.stream.popupWindow.Open(locale.DROP_MONEY_FAILURE_1000_OVER, 0, locale.UI_OK)
  1689. return
  1690.  
  1691. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1692. itemDropQuestionDialog.SetText(locale.DO_YOU_DROP_MONEY % (attachedMoney))
  1693. itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1694. itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1695. itemDropQuestionDialog.Open()
  1696. itemDropQuestionDialog.dropType = attachedType
  1697. itemDropQuestionDialog.dropCount = attachedMoney
  1698. itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  1699. self.itemDropQuestionDialog = itemDropQuestionDialog
  1700.  
  1701. def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  1702. # PRIVATESHOP_DISABLE_ITEM_DROP - °³ÀλóÁ¡ ¿­°í ÀÖ´Â µ¿¾È ¾ÆÀÌÅÛ ¹ö¸² ¹æÁö
  1703. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1704. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1705. return
  1706. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1707.  
  1708. if player.IsEquipmentSlot(attachedItemSlotPos):
  1709. self.stream.popupWindow.Close()
  1710. self.stream.popupWindow.Open(locale.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, locale.UI_OK)
  1711.  
  1712. else:
  1713. dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  1714.  
  1715. item.SelectItem(dropItemIndex)
  1716. dropItemName = item.GetItemName()
  1717.  
  1718. ## Question Text
  1719. questionText = locale.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1720.  
  1721. ## Dialog
  1722. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1723. itemDropQuestionDialog.SetText(questionText)
  1724. itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1725. itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1726. itemDropQuestionDialog.Open()
  1727. itemDropQuestionDialog.dropType = attachedType
  1728. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1729. itemDropQuestionDialog.dropCount = attachedItemCount
  1730. self.itemDropQuestionDialog = itemDropQuestionDialog
  1731.  
  1732. constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1)
  1733.  
  1734. def RequestDropItem(self, answer):
  1735. if not self.itemDropQuestionDialog:
  1736. return
  1737.  
  1738. if answer:
  1739. dropType = self.itemDropQuestionDialog.dropType
  1740. dropCount = self.itemDropQuestionDialog.dropCount
  1741. dropNumber = self.itemDropQuestionDialog.dropNumber
  1742.  
  1743. if player.SLOT_TYPE_INVENTORY == dropType:
  1744. if dropNumber == player.ITEM_MONEY:
  1745. net.SendGoldDropPacketNew(dropCount)
  1746. snd.PlaySound("sound/ui/money.wav")
  1747. else:
  1748. # PRIVATESHOP_DISABLE_ITEM_DROP
  1749. self.__SendDropItemPacket(dropNumber, dropCount)
  1750. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1751.  
  1752. self.itemDropQuestionDialog.Close()
  1753. self.itemDropQuestionDialog = None
  1754.  
  1755. constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
  1756.  
  1757. # PRIVATESHOP_DISABLE_ITEM_DROP
  1758. def __SendDropItemPacket(self, itemVNum, itemCount):
  1759. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1760. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1761. return
  1762.  
  1763. net.SendItemDropPacketNew(itemVNum, itemCount)
  1764. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1765.  
  1766. def OnMouseRightButtonDown(self):
  1767.  
  1768. self.CheckFocus()
  1769.  
  1770. if TRUE == mouseModule.mouseController.isAttached():
  1771. mouseModule.mouseController.DeattachObject()
  1772.  
  1773. else:
  1774. player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  1775.  
  1776. return TRUE
  1777.  
  1778. def OnMouseRightButtonUp(self):
  1779. if TRUE == mouseModule.mouseController.isAttached():
  1780. return TRUE
  1781.  
  1782. player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  1783. return TRUE
  1784.  
  1785. def OnMouseMiddleButtonDown(self):
  1786. player.SetMouseMiddleButtonState(player.MBS_PRESS)
  1787.  
  1788. def OnMouseMiddleButtonUp(self):
  1789. player.SetMouseMiddleButtonState(player.MBS_CLICK)
  1790.  
  1791. def OnUpdate(self):
  1792. app.UpdateGame()
  1793.  
  1794. if self.mapNameShower.IsShow():
  1795. self.mapNameShower.Update()
  1796.  
  1797. if self.isShowDebugInfo:
  1798. self.UpdateDebugInfo()
  1799.  
  1800. if self.enableXMasBoom:
  1801. self.__XMasBoom_Update()
  1802.  
  1803. self.interface.BUILD_OnUpdate()
  1804.  
  1805.  
  1806. def UpdateDebugInfo(self):
  1807. #
  1808. # ij¸¯ÅÍ ÁÂÇ¥ ¹× FPS Ãâ·Â
  1809. (x, y, z) = player.GetMainCharacterPosition()
  1810. nUpdateTime = app.GetUpdateTime()
  1811. nUpdateFPS = app.GetUpdateFPS()
  1812. nRenderFPS = app.GetRenderFPS()
  1813. nFaceCount = app.GetFaceCount()
  1814. fFaceSpeed = app.GetFaceSpeed()
  1815. nST=background.GetRenderShadowTime()
  1816. (fAveRT, nCurRT) = app.GetRenderTime()
  1817. (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  1818. (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  1819. if iPatch == 0:
  1820. iPatch = 1
  1821.  
  1822. #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  1823.  
  1824. self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  1825.  
  1826. self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  1827.  
  1828. if fAveRT>1.0:
  1829. self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  1830.  
  1831. self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  1832. #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  1833. #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  1834. #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  1835. self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  1836.  
  1837. def OnRender(self):
  1838. app.RenderGame()
  1839.  
  1840. if self.console.Console.collision:
  1841. background.RenderCollision()
  1842. chr.RenderCollision()
  1843.  
  1844. (x, y) = app.GetCursorPosition()
  1845.  
  1846. ########################
  1847. # Picking
  1848. ########################
  1849. textTail.UpdateAllTextTail()
  1850.  
  1851. if TRUE == wndMgr.IsPickedWindow(self.hWnd):
  1852.  
  1853. self.PickingCharacterIndex = chr.Pick()
  1854.  
  1855. if -1 != self.PickingCharacterIndex:
  1856. textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  1857. if 0 != self.targetBoard.GetTargetVID():
  1858. textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  1859.  
  1860. # ADD_ALWAYS_SHOW_NAME
  1861. if not self.__IsShowName():
  1862. self.PickingItemIndex = item.Pick()
  1863. if -1 != self.PickingItemIndex:
  1864. textTail.ShowItemTextTail(self.PickingItemIndex)
  1865. # END_OF_ADD_ALWAYS_SHOW_NAME
  1866.  
  1867. ## Show all name in the range
  1868.  
  1869. # ADD_ALWAYS_SHOW_NAME
  1870. if self.__IsShowName():
  1871. textTail.ShowAllTextTail()
  1872. self.PickingItemIndex = textTail.Pick(x, y)
  1873. # END_OF_ADD_ALWAYS_SHOW_NAME
  1874.  
  1875. textTail.UpdateShowingTextTail()
  1876. textTail.ArrangeTextTail()
  1877. if -1 != self.PickingItemIndex:
  1878. textTail.SelectItemName(self.PickingItemIndex)
  1879.  
  1880. grp.PopState()
  1881. grp.SetInterfaceRenderState()
  1882.  
  1883. textTail.Render()
  1884. textTail.HideAllTextTail()
  1885.  
  1886. def OnPressEscapeKey(self):
  1887. if app.TARGET == app.GetCursor():
  1888. app.SetCursor(app.NORMAL)
  1889.  
  1890. elif TRUE == mouseModule.mouseController.isAttached():
  1891. mouseModule.mouseController.DeattachObject()
  1892.  
  1893. else:
  1894. self.interface.OpenSystemDialog()
  1895.  
  1896. return TRUE
  1897.  
  1898. def OnIMEReturn(self):
  1899. if app.IsPressed(app.DIK_LSHIFT):
  1900. self.interface.OpenWhisperDialogWithoutTarget()
  1901. else:
  1902. self.interface.ToggleChat()
  1903. return TRUE
  1904.  
  1905. def OnPressExitKey(self):
  1906. self.interface.ToggleSystemDialog()
  1907. return TRUE
  1908.  
  1909. ## BINARY CALLBACK
  1910. ######################################################################################
  1911.  
  1912. # WEDDING
  1913. def BINARY_LoverInfo(self, name, lovePoint):
  1914. if self.interface.wndMessenger:
  1915. self.interface.wndMessenger.OnAddLover(name, lovePoint)
  1916. if self.affectShower:
  1917. self.affectShower.SetLoverInfo(name, lovePoint)
  1918.  
  1919. def BINARY_UpdateLovePoint(self, lovePoint):
  1920. if self.interface.wndMessenger:
  1921. self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  1922. if self.affectShower:
  1923. self.affectShower.OnUpdateLovePoint(lovePoint)
  1924. # END_OF_WEDDING
  1925.  
  1926. # QUEST_CONFIRM
  1927. def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  1928. confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
  1929. confirmDialog.Open(msg, timeout)
  1930. confirmDialog.SetAcceptEvent(lambda answer=TRUE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1931. confirmDialog.SetCancelEvent(lambda answer=FALSE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1932. self.confirmDialog = confirmDialog
  1933. # END_OF_QUEST_CONFIRM
  1934.  
  1935. # CUBE
  1936. def BINARY_Cube_Open(self):
  1937. self.interface.OpenCubeWindow()
  1938. self.BINARY_Cube_ResultList()
  1939. self.BINARY_Cube_MaterialInfo()
  1940. self.interface.wndCube.Refresh()
  1941.  
  1942. def BINARY_Cube_Close(self):
  1943. self.interface.CloseCubeWindow()
  1944.  
  1945. # Á¦ÀÛ¿¡ ÇÊ¿äÇÑ °ñµå, ¿¹»óµÇ´Â ¿Ï¼ºÇ°ÀÇ VNUM°ú °³¼ö Á¤º¸ update
  1946. def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  1947. self.interface.UpdateCubeInfo(gold, itemVnum, count)
  1948.  
  1949. def BINARY_Cube_Succeed(self, itemVnum, count):
  1950. print "Å¥ºê Á¦ÀÛ ¼º°ø"
  1951. self.interface.SucceedCubeWork(itemVnum, count)
  1952. pass
  1953.  
  1954. def BINARY_Cube_Failed(self):
  1955. print "Å¥ºê Á¦ÀÛ ½ÇÆÐ"
  1956. self.interface.FailedCubeWork()
  1957. pass
  1958.  
  1959. def BINARY_Cube_ResultList(self):
  1960. # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5 ÀÌ·±½ÄÀ¸·Î "/" ¹®ÀÚ·Î ±¸ºÐµÈ ¸®½ºÆ®¸¦ ÁÜ
  1961. #print listText
  1962. listText = constInfo.CRAFTING_RESULT
  1963. self.cubeInformation[constInfo.CRAFTING_NPC_ID] = []
  1964.  
  1965. try:
  1966. for eachInfoText in listText.split("/"):
  1967. eachInfo = eachInfoText.split(",")
  1968. itemVnum = int(eachInfo[0])
  1969. itemCount = int(eachInfo[1])
  1970.  
  1971. self.cubeInformation[constInfo.CRAFTING_NPC_ID].append({"vnum": itemVnum, "count": itemCount})
  1972. self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  1973.  
  1974. resultCount = len(self.cubeInformation[constInfo.CRAFTING_NPC_ID])
  1975. requestCount = 7
  1976. modCount = resultCount % requestCount
  1977. splitCount = resultCount / requestCount
  1978. for i in xrange(splitCount):
  1979. #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  1980. net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  1981.  
  1982. if 0 < modCount:
  1983. #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1984. net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1985.  
  1986. except RuntimeError, msg:
  1987. dbg.TraceError(msg)
  1988. return 0
  1989.  
  1990. pass
  1991.  
  1992. def BINARY_Cube_MaterialInfo(self):
  1993. # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  1994. try:
  1995. #print listText
  1996. listText = constInfo.CRAFTING_NEED
  1997. startIndex = 0
  1998. if 3 > len(listText):
  1999. dbg.TraceError("Wrong Cube Material Infomation")
  2000. return 0
  2001.  
  2002.  
  2003.  
  2004. eachResultList = listText.split("@")
  2005.  
  2006.  
  2007. cubeInfo = self.cubeInformation[constInfo.CRAFTING_NPC_ID]
  2008.  
  2009. itemIndex = 0
  2010. for eachResultText in eachResultList:
  2011. cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  2012. materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  2013.  
  2014. gold = 0
  2015. splitResult = eachResultText.split("/")
  2016. if 1 < len(splitResult):
  2017. gold = int(splitResult[1])
  2018.  
  2019. #print "splitResult : ", splitResult
  2020. eachMaterialList = splitResult[0].split("&")
  2021.  
  2022. i = 0
  2023. for eachMaterialText in eachMaterialList:
  2024. complicatedList = eachMaterialText.split("|")
  2025.  
  2026. if 0 < len(complicatedList):
  2027. for complicatedText in complicatedList:
  2028. (itemVnum, itemCount) = complicatedText.split(",")
  2029. itemVnum = int(itemVnum)
  2030. itemCount = int(itemCount)
  2031. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  2032.  
  2033. materialList[i].append((itemVnum, itemCount))
  2034.  
  2035. else:
  2036. itemVnum, itemCount = eachMaterialText.split(",")
  2037. itemVnum = int(itemVnum)
  2038. itemCount = int(itemCount)
  2039. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  2040.  
  2041. materialList[i].append((itemVnum, itemCount))
  2042.  
  2043. i = i + 1
  2044.  
  2045.  
  2046.  
  2047. itemIndex = itemIndex + 1
  2048.  
  2049. #self.interface.wndCube.Refresh()
  2050.  
  2051. self.interface.wndCube.SetScrollStep(itemIndex)
  2052. except RuntimeError, msg:
  2053. dbg.TraceError(msg)
  2054. return 0
  2055.  
  2056. pass
  2057.  
  2058. # END_OF_CUBE
  2059.  
  2060. def BINARY_SetBigMessage(self, message):
  2061. self.interface.bigBoard.SetTip(message)
  2062.  
  2063. def BINARY_SetTipMessage(self, message):
  2064. self.interface.tipBoard.SetTip(message)
  2065.  
  2066. def BINARY_AppendNotifyMessage(self, type):
  2067. if not type in locale.NOTIFY_MESSAGE:
  2068. return
  2069. chat.AppendChat(chat.CHAT_TYPE_INFO, locale.NOTIFY_MESSAGE[type])
  2070.  
  2071. def BINARY_Guild_EnterGuildArea(self, areaID):
  2072. self.interface.BULID_EnterGuildArea(areaID)
  2073.  
  2074. def BINARY_Guild_ExitGuildArea(self, areaID):
  2075. self.interface.BULID_ExitGuildArea(areaID)
  2076.  
  2077. def BINARY_GuildWar_OnSendDeclare(self, guildID):
  2078. pass
  2079.  
  2080. def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  2081. mainCharacterName = player.GetMainCharacterName()
  2082. masterName = guild.GetGuildMasterName()
  2083. if mainCharacterName == masterName:
  2084. self.__GuildWar_OpenAskDialog(guildID, warType)
  2085.  
  2086. def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  2087. self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  2088.  
  2089. def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  2090. self.interface.OnStartGuildWar(guildSelf, guildOpp)
  2091.  
  2092. def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  2093. self.interface.OnEndGuildWar(guildSelf, guildOpp)
  2094.  
  2095. def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  2096. self.interface.BINARY_SetObserverMode(isEnable)
  2097.  
  2098. def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  2099. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2100.  
  2101. def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  2102. guildID1 = int(guildID1)
  2103. guildID2 = int(guildID2)
  2104. memberCount1 = int(memberCount1)
  2105. memberCount2 = int(memberCount2)
  2106. observerCount = int(observerCount)
  2107.  
  2108. self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  2109. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2110.  
  2111. def __GuildWar_OpenAskDialog(self, guildID, warType):
  2112.  
  2113. guildName = guild.GetGuildName(guildID)
  2114.  
  2115. # REMOVED_GUILD_BUG_FIX
  2116. if "Noname" == guildName:
  2117. return
  2118. # END_OF_REMOVED_GUILD_BUG_FIX
  2119.  
  2120. import uiGuild
  2121. questionDialog = uiGuild.AcceptGuildWarDialog()
  2122. questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  2123. questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  2124. questionDialog.Open(guildName, warType)
  2125.  
  2126. self.guildWarQuestionDialog = questionDialog
  2127.  
  2128. def __GuildWar_CloseAskDialog(self):
  2129. self.guildWarQuestionDialog.Close()
  2130. self.guildWarQuestionDialog = None
  2131.  
  2132. def __GuildWar_OnAccept(self):
  2133.  
  2134. guildName = self.guildWarQuestionDialog.GetGuildName()
  2135.  
  2136. net.SendChatPacket("/war " + guildName)
  2137. self.__GuildWar_CloseAskDialog()
  2138.  
  2139. return 1
  2140.  
  2141. def __GuildWar_OnDecline(self):
  2142.  
  2143. guildName = self.guildWarQuestionDialog.GetGuildName()
  2144.  
  2145. net.SendChatPacket("/nowar " + guildName)
  2146. self.__GuildWar_CloseAskDialog()
  2147.  
  2148. return 1
  2149. ## BINARY CALLBACK
  2150. ######################################################################################
  2151.  
  2152. def __ServerCommand_Build(self):
  2153. serverCommandList={
  2154. "ConsoleEnable" : self.__Console_Enable,
  2155. "DayMode" : self.__DayMode_Update,
  2156. "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update,
  2157. "CloseRestartWindow" : self.__RestartDialog_Close,
  2158. "OpenPrivateShop" : self.__PrivateShop_Open,
  2159. "PartyHealReady" : self.PartyHealReady,
  2160. "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  2161. "CloseSafebox" : self.CommandCloseSafebox,
  2162. "depozit_index" : self.__depozit_questindex,
  2163. "antiexp_index" : self.__antiexp_questindex,
  2164. "teleporter_index" : self.__teleporter_questindex,
  2165.  
  2166. # Craftingsystem by xGr33n & Apo
  2167. "cube_npc_id" : self.CraftingCube1,
  2168. "cs_result" : self.CraftingResult,
  2169. "cs_need" : self.CraftingNeed,
  2170. # Craftingsystem Ende
  2171.  
  2172. # ITEM_MALL
  2173. "CloseMall" : self.CommandCloseMall,
  2174. "ShowMeMallPassword" : self.AskMallPassword,
  2175. "item_mall" : self.__ItemMall_Open,
  2176. # END_OF_ITEM_MALL
  2177.  
  2178. #START_ENERGY_SYSTEM
  2179. "energysystem" : self.__energysystem,
  2180. #END_ENERGY_SYSTEM
  2181.  
  2182. #START_COSTUME_SYSTEM
  2183. "SetCostumeBody" : self.BodySet,
  2184. "SetCostumeHair" : self.HairSet,
  2185. #END_COSTUME_SYSTEM
  2186.  
  2187. "RefineSuceeded" : self.RefineSuceededMessage,
  2188. "RefineFailed" : self.RefineFailedMessage,
  2189. "xmas_snow" : self.__XMasSnow_Enable,
  2190. "xmas_boom" : self.__XMasBoom_Enable,
  2191. "xmas_song" : self.__XMasSong_Enable,
  2192. "xmas_tree" : self.__XMasTree_Enable,
  2193. "newyear_boom" : self.__XMasBoom_Enable,
  2194. "PartyRequest" : self.__PartyRequestQuestion,
  2195. "PartyRequestDenied" : self.__PartyRequestDenied,
  2196. "horse_state" : self.__Horse_UpdateState,
  2197. "hide_horse_state" : self.__Horse_HideState,
  2198. "WarUC" : self.__GuildWar_UpdateMemberCount,
  2199. "test_server" : self.__EnableTestServerFlag,
  2200. "mall" : self.__InGameShop_Show,
  2201.  
  2202. #sistem_de_putere
  2203. "DeschidePutere" : self.__deschideputere,
  2204. "InchidePutere" : self.__inchideputere,
  2205. "questindex_activare_putere" :self.__questindex_activare_putere,
  2206. "questindex_buton1_putere" :self.__questindex_buton1_putere,
  2207. "questindex_buton2_putere" :self.__questindex_buton2_putere,
  2208. "questindex_buton3_putere" :self.__questindex_buton3_putere,
  2209. "questindex_buton4_putere" :self.__questindex_buton4_putere,
  2210. "status_putere" :self.__status_putere,
  2211. "timp_putere" : self.__timp_putere,
  2212. "bonus_activ" : self.__bonus_activ,
  2213. "actualizare_bara_putere" : self.__actualizare_bara_putere,
  2214. "efect_putere" :self.__efect_putere,
  2215. #sistem_de_putere
  2216.  
  2217. # WEDDING
  2218. "lover_login" : self.__LoginLover,
  2219. "lover_logout" : self.__LogoutLover,
  2220. "lover_near" : self.__LoverNear,
  2221. "lover_far" : self.__LoverFar,
  2222. "lover_divorce" : self.__LoverDivorce,
  2223. "PlayMusic" : self.__PlayMusic,
  2224. # END_OF_WEDDING
  2225.  
  2226. "valori_ucideri" : self.__valori_ucideri,
  2227. "sistem_onoare_questindex" : self.__sistem_onoare_questindex,
  2228. "utilizari_kill_ramase" : self.UtilizariUcideriRamase,
  2229. "activare_ucideri" : self.ActicareUcideri,
  2230.  
  2231. # PRIVATE_SHOP_PRICE_LIST
  2232. "MyShopPriceList" : self.__PrivateShop_PriceList,
  2233. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2234.  
  2235. ##KILLGUI
  2236. "ShowKillGui" : self.__showkillgui,
  2237. "HideKillGui" : self.__hidekillgui,
  2238. "KillBlauReich" : self.__KillBlauReich,
  2239. "KillGelbReich" : self.__KillGelbReich,
  2240. "KillRotReich" : self.__KillRotReich,
  2241. "KillMob" : self.__KillMob,
  2242. ##END_KILLGUI
  2243.  
  2244. # NEW_EFFECTS
  2245. "buff8" : self.__buff8,
  2246. "buff9" : self.__buff9,
  2247. "buff10" : self.__buff10,
  2248. "buff11" : self.__buff11,
  2249. "buff12" : self.__buff12,
  2250. "buff13" : self.__buff13,
  2251. "buff14" : self.__buff14,
  2252. "buff15" : self.__buff15,
  2253. "buff16" : self.__buff16,
  2254. "buff17" : self.__buff17,
  2255. "buff18" : self.__buff18,
  2256. "buff19" : self.__buff19,
  2257. "buff20" : self.__buff20,
  2258. "buff21" : self.__buff21,
  2259. "buff22" : self.__buff22,
  2260. "buff23" : self.__buff23,
  2261. # END_NEW_EFFECTS
  2262.  
  2263. # START_EXIT
  2264. "exit" : self.__ClientExit,
  2265. # END_EXIT
  2266.  
  2267. # ARCHIEVEMENT_SYSTEM_START
  2268. "achievement" : self.__AchievementTest,
  2269. "achievementpoints" : self.__ShowAchievementPoints,
  2270. # ARCHIEVEMENT_SYSTEM_END
  2271.  
  2272. #Runy
  2273. "runy_data" : self.__runyData,
  2274. "runy_pokaz" : self.__runyShow,
  2275. "runyq" : self.__runyQuest,
  2276. "runys1" : self.__runySlot1,
  2277. "runys2" : self.__runySlot2,
  2278. "runys3" : self.__runySlot3,
  2279. "runys4" : self.__runySlot4,
  2280. "runys5" : self.__runySlot5,
  2281. "runys6" : self.__runySlot6,
  2282. "runys7" : self.__runySlot7,
  2283. #Runy Ende
  2284. }
  2285.  
  2286. self.serverCommander = stringCommander.Analyzer()
  2287. for serverCommandItem in serverCommandList.items():
  2288. self.serverCommander.SAFE_RegisterCallBack(
  2289. serverCommandItem[0], serverCommandItem[1]
  2290. )
  2291.  
  2292. #START_COSTUME_SYSTEM
  2293. def BodySet(self, vnum):
  2294. constInfo.COSTUME_BODY_VNUM = int(vnum)
  2295.  
  2296. def HairSet(self, vnum):
  2297. constInfo.COSTUME_HAIR_VNUM = int(vnum)
  2298. #END_COSTUME_SYSTEM
  2299.  
  2300. def BINARY_ServerCommand_Run(self, line):
  2301. #dbg.TraceError(line)
  2302. try:
  2303. #print " BINARY_ServerCommand_Run", line
  2304. return self.serverCommander.Run(line)
  2305. except RuntimeError, msg:
  2306. dbg.TraceError(msg)
  2307. return 0
  2308.  
  2309. def __ProcessPreservedServerCommand(self):
  2310. try:
  2311. command = net.GetPreservedServerCommand()
  2312. while command:
  2313. print " __ProcessPreservedServerCommand", command
  2314. self.serverCommander.Run(command)
  2315. command = net.GetPreservedServerCommand()
  2316. except RuntimeError, msg:
  2317. dbg.TraceError(msg)
  2318. return 0
  2319.  
  2320. def PartyHealReady(self):
  2321. self.interface.PartyHealReady()
  2322.  
  2323. def AskSafeboxPassword(self):
  2324. self.interface.AskSafeboxPassword()
  2325.  
  2326. # Buff
  2327. def __buff8(self):
  2328. net.SendChatPacket("(b8)")
  2329. def __buff9(self):
  2330. net.SendChatPacket("(b9)")
  2331. def __buff10(self):
  2332. net.SendChatPacket("(b10)")
  2333. def __buff11(self):
  2334. net.SendChatPacket("(b11)")
  2335. def __buff12(self):
  2336. net.SendChatPacket("(b12)")
  2337. def __buff13(self):
  2338. net.SendChatPacket("(b13)")
  2339. def __buff14(self):
  2340. net.SendChatPacket("(b14)")
  2341. def __buff15(self):
  2342. net.SendChatPacket("(b15)")
  2343. def __buff16(self):
  2344. net.SendChatPacket("(b16)")
  2345. def __buff17(self):
  2346. net.SendChatPacket("(b17)")
  2347. def __buff18(self):
  2348. net.SendChatPacket("(b18)")
  2349. def __buff19(self):
  2350. net.SendChatPacket("(b19)")
  2351. def __buff20(self):
  2352. net.SendChatPacket("(b20)")
  2353. def __buff21(self):
  2354. net.SendChatPacket("(b21)")
  2355. def __buff22(self):
  2356. net.SendChatPacket("(b22)")
  2357. def __buff23(self):
  2358. net.SendChatPacket("(b23)")
  2359. # End Buff
  2360.  
  2361. # ITEM_MALL
  2362. def AskMallPassword(self):
  2363. self.interface.AskMallPassword()
  2364.  
  2365. def __ItemMall_Open(self):
  2366. self.interface.OpenItemMall();
  2367.  
  2368. def CommandCloseMall(self):
  2369. self.interface.CommandCloseMall()
  2370. # END_OF_ITEM_MALL
  2371.  
  2372. def __ClientExit(self):
  2373. import dbg
  2374. app.Abort()
  2375.  
  2376.  
  2377. def RefineSuceededMessage(self):
  2378. snd.PlaySound("sound/ui/make_soket.wav")
  2379. self.PopupMessage(locale.REFINE_SUCCESS)
  2380.  
  2381. def RefineFailedMessage(self):
  2382. snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2383. self.PopupMessage(locale.REFINE_FAILURE)
  2384.  
  2385. def CommandCloseSafebox(self):
  2386. self.interface.CommandCloseSafebox()
  2387.  
  2388. # PRIVATE_SHOP_PRICE_LIST
  2389. def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  2390. uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
  2391. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2392.  
  2393. def __Horse_HideState(self):
  2394. self.affectShower.SetHorseState(0, 0, 0)
  2395.  
  2396. def __Horse_UpdateState(self, level, health, battery):
  2397. self.affectShower.SetHorseState(int(level), int(health), int(battery))
  2398.  
  2399. def __IsXMasMap(self):
  2400. mapDict = ( "metin2_map_n_flame_01",
  2401. "metin2_map_n_desert_01",
  2402. "metin2_map_spiderdungeon",
  2403. "metin2_map_deviltower1", )
  2404.  
  2405. if background.GetCurrentMapName() in mapDict:
  2406. return FALSE
  2407.  
  2408. return TRUE
  2409.  
  2410. def __XMasSnow_Enable(self, mode):
  2411.  
  2412. self.__XMasSong_Enable(mode)
  2413.  
  2414. if "1"==mode:
  2415.  
  2416. if not self.__IsXMasMap():
  2417. return
  2418.  
  2419. print "XMAS_SNOW ON"
  2420. background.EnableSnow(1)
  2421.  
  2422. else:
  2423. print "XMAS_SNOW OFF"
  2424. background.EnableSnow(0)
  2425.  
  2426. def __XMasBoom_Enable(self, mode):
  2427. if "1"==mode:
  2428.  
  2429. if not self.__IsXMasMap():
  2430. return
  2431.  
  2432. print "XMAS_BOOM ON"
  2433. self.__DayMode_Update("dark")
  2434. self.enableXMasBoom = TRUE
  2435. self.startTimeXMasBoom = app.GetTime()
  2436. else:
  2437. print "XMAS_BOOM OFF"
  2438. self.__DayMode_Update("light")
  2439. self.enableXMasBoom = FALSE
  2440.  
  2441. def __XMasTree_Enable(self, grade):
  2442.  
  2443. print "XMAS_TREE ", grade
  2444. background.SetXMasTree(int(grade))
  2445.  
  2446. def __XMasSong_Enable(self, mode):
  2447. if "1"==mode:
  2448. print "XMAS_SONG ON"
  2449.  
  2450. XMAS_BGM = "xmas.mp3"
  2451.  
  2452. if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  2453. if musicInfo.fieldMusic != "":
  2454. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2455.  
  2456. musicInfo.fieldMusic=XMAS_BGM
  2457. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2458.  
  2459. else:
  2460. print "XMAS_SONG OFF"
  2461.  
  2462. if musicInfo.fieldMusic != "":
  2463. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2464.  
  2465. musicInfo.fieldMusic=musicInfo.METIN2THEMA
  2466. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2467.  
  2468. def __RestartDialog_Close(self):
  2469. self.interface.CloseRestartDialog()
  2470.  
  2471. def __Console_Enable(self):
  2472. constInfo.CONSOLE_ENABLE = TRUE
  2473. self.consoleEnable = TRUE
  2474. app.EnableSpecialCameraMode()
  2475. ui.EnablePaste(TRUE)
  2476.  
  2477. ## PrivateShop
  2478. def __PrivateShop_Open(self):
  2479. self.interface.OpenPrivateShopInputNameDialog()
  2480.  
  2481. def BINARY_PrivateShop_Appear(self, vid, text):
  2482. self.interface.AppearPrivateShop(vid, text)
  2483.  
  2484. def BINARY_PrivateShop_Disappear(self, vid):
  2485. self.interface.DisappearPrivateShop(vid)
  2486.  
  2487. ## DayMode
  2488. def __PRESERVE_DayMode_Update(self, mode):
  2489. if "light"==mode:
  2490. background.SetEnvironmentData(0)
  2491. elif "dark"==mode:
  2492.  
  2493. if not self.__IsXMasMap():
  2494. return
  2495.  
  2496. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2497. background.SetEnvironmentData(1)
  2498.  
  2499. def __DayMode_Update(self, mode):
  2500. if "light"==mode:
  2501. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  2502. elif "dark"==mode:
  2503.  
  2504. if not self.__IsXMasMap():
  2505. return
  2506.  
  2507. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  2508.  
  2509. def __DayMode_OnCompleteChangeToLight(self):
  2510. background.SetEnvironmentData(0)
  2511. self.curtain.FadeIn()
  2512.  
  2513. def __DayMode_OnCompleteChangeToDark(self):
  2514. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2515. background.SetEnvironmentData(1)
  2516. self.curtain.FadeIn()
  2517.  
  2518. ## XMasBoom
  2519. def __XMasBoom_Update(self):
  2520.  
  2521. self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  2522. if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  2523. return
  2524.  
  2525. boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  2526. boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  2527.  
  2528. if app.GetTime() - self.startTimeXMasBoom > boomTime:
  2529.  
  2530. self.indexXMasBoom += 1
  2531.  
  2532. for i in xrange(boomCount):
  2533. self.__XMasBoom_Boom()
  2534.  
  2535. def __XMasBoom_Boom(self):
  2536. x, y, z = player.GetMainCharacterPosition()
  2537. randX = app.GetRandom(-150, 150)
  2538. randY = app.GetRandom(-150, 150)
  2539.  
  2540. snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  2541.  
  2542. def __PartyRequestQuestion(self, vid):
  2543. vid = int(vid)
  2544. partyRequestQuestionDialog = uiCommon.QuestionDialog()
  2545. partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + locale.PARTY_DO_YOU_ACCEPT)
  2546. partyRequestQuestionDialog.SetAcceptText(locale.UI_ACCEPT)
  2547. partyRequestQuestionDialog.SetCancelText(locale.UI_DENY)
  2548. partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerPartyRequest(arg))
  2549. partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerPartyRequest(arg))
  2550. partyRequestQuestionDialog.Open()
  2551. partyRequestQuestionDialog.vid = vid
  2552. self.partyRequestQuestionDialog = partyRequestQuestionDialog
  2553.  
  2554. def __AnswerPartyRequest(self, answer):
  2555. if not self.partyRequestQuestionDialog:
  2556. return
  2557.  
  2558. vid = self.partyRequestQuestionDialog.vid
  2559.  
  2560. if answer:
  2561. net.SendChatPacket("/party_request_accept " + str(vid))
  2562. else:
  2563. net.SendChatPacket("/party_request_deny " + str(vid))
  2564.  
  2565. self.partyRequestQuestionDialog.Close()
  2566. self.partyRequestQuestionDialog = None
  2567.  
  2568. def __PartyRequestDenied(self):
  2569. self.PopupMessage(locale.PARTY_REQUEST_DENIED)
  2570.  
  2571. def __EnableTestServerFlag(self):
  2572. app.EnableTestServerFlag()
  2573.  
  2574. def __InGameShop_Show(self, url):
  2575. if constInfo.IN_GAME_SHOP_ENABLE:
  2576. self.interface.OpenWebWindow(url)
  2577.  
  2578. # WEDDING
  2579. def __LoginLover(self):
  2580. if self.interface.wndMessenger:
  2581. self.interface.wndMessenger.OnLoginLover()
  2582.  
  2583. def __LogoutLover(self):
  2584. if self.interface.wndMessenger:
  2585. self.interface.wndMessenger.OnLogoutLover()
  2586. if self.affectShower:
  2587. self.affectShower.HideLoverState()
  2588.  
  2589. def __LoverNear(self):
  2590. if self.affectShower:
  2591. self.affectShower.ShowLoverState()
  2592.  
  2593. def __LoverFar(self):
  2594. if self.affectShower:
  2595. self.affectShower.HideLoverState()
  2596.  
  2597. def __LoverDivorce(self):
  2598. if self.interface.wndMessenger:
  2599. self.interface.wndMessenger.ClearLoverInfo()
  2600. if self.affectShower:
  2601. self.affectShower.ClearLoverState()
  2602.  
  2603. def __PlayMusic(self, flag, filename):
  2604. flag = int(flag)
  2605. if flag:
  2606. snd.FadeOutAllMusic()
  2607. musicInfo.SaveLastPlayFieldMusic()
  2608. snd.FadeInMusic("BGM/" + filename)
  2609. else:
  2610. snd.FadeOutAllMusic()
  2611. musicInfo.LoadLastPlayFieldMusic()
  2612. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2613.  
  2614. # END_OF_WEDDING
  2615.  
  2616. # CRAFTING_SYSTEM_START
  2617. def CraftingCube1(self, npcVNUM):
  2618. constInfo.CRAFTING_NPC_ID = int(npcVNUM)
  2619. def CraftingResult(self, list):
  2620. constInfo.CRAFTING_RESULT = str(list)
  2621. def CraftingNeed(self, list):
  2622. constInfo.CRAFTING_NEED = str(list)
  2623. # CRAFTING_SYSTEM_END
  2624.  
  2625. # Sistem de Putere
  2626. def __deschideputere(self):
  2627. self.PutereBG.Show()
  2628.  
  2629. def __inchideputere(self):
  2630. self.PutereBG.Hide()
  2631.  
  2632. def __questindex_activare_putere(self, questindex):
  2633. constInfo.ACTIVARE_PUTERE_BUTON_QUESTINDEX = int(questindex)
  2634.  
  2635. def activare_putere_buton(self):
  2636. questindex_activare_putere = constInfo.ACTIVARE_PUTERE_BUTON_QUESTINDEX
  2637. event.QuestButtonClick(questindex_activare_putere)
  2638.  
  2639. def __questindex_buton1_putere(self, questindex_buton1):
  2640. constInfo.PLUSARE_BUTON1_QUESTINDEX = int(questindex_buton1)
  2641.  
  2642. def activare_buton1_buton(self):
  2643. questindex_buton1_putere = constInfo.PLUSARE_BUTON1_QUESTINDEX
  2644. event.QuestButtonClick(questindex_buton1_putere)
  2645.  
  2646. def __questindex_buton2_putere(self, questindex_buton2):
  2647. constInfo.PLUSARE_BUTON2_QUESTINDEX = int(questindex_buton2)
  2648.  
  2649. def activare_buton2_buton(self):
  2650. questindex_buton2_putere = constInfo.PLUSARE_BUTON2_QUESTINDEX
  2651. event.QuestButtonClick(questindex_buton2_putere)
  2652.  
  2653. def __questindex_buton3_putere(self, questindex_buton3):
  2654. constInfo.PLUSARE_BUTON3_QUESTINDEX = int(questindex_buton3)
  2655.  
  2656. def activare_buton3_buton(self):
  2657. questindex_buton3_putere = constInfo.PLUSARE_BUTON3_QUESTINDEX
  2658. event.QuestButtonClick(questindex_buton3_putere)
  2659.  
  2660. def __questindex_buton4_putere(self, questindex_buton4):
  2661. constInfo.PLUSARE_BUTON4_QUESTINDEX = int(questindex_buton4)
  2662.  
  2663. def activare_buton4_buton(self):
  2664. questindex_buton4_putere = constInfo.PLUSARE_BUTON4_QUESTINDEX
  2665. event.QuestButtonClick(questindex_buton4_putere)
  2666.  
  2667. def __status_putere(self, bonus1, bonus2, bonus3, bonus4, puncte_disponibile):
  2668. self.Bonus1_valoare.SetText(bonus1)
  2669. self.Bonus2_valoare.SetText(bonus2)
  2670. self.Bonus3_valoare.SetText(bonus3)
  2671. self.Bonus4_valoare.SetText(bonus4)
  2672. self.PunctePutere_valoare.SetText(puncte_disponibile)
  2673. if int(puncte_disponibile) <= 0:
  2674. self.Buton1_Plus.Hide()
  2675. self.Buton2_Plus.Hide()
  2676. self.Buton3_Plus.Hide()
  2677. self.Buton4_Plus.Hide()
  2678. else:
  2679. self.Buton1_Plus.Show()
  2680. self.Buton2_Plus.Show()
  2681. self.Buton3_Plus.Show()
  2682. self.Buton4_Plus.Show()
  2683.  
  2684. def __timp_putere(self, timp):
  2685. self.timp_1 = ui.AniImageBox()
  2686. self.timp_1.AppendImage("putere/timp_" + timp + ".tga")
  2687. self.timp_1.SetParent(self.PutereBG)
  2688. self.timp_1.SetPosition(237, 75)
  2689. self.timp_1.Show()
  2690.  
  2691. def __bonus_activ(self, bonus, bonus_val):
  2692. if int(bonus) == 1:
  2693. self.bonus_activ.SetText("Max. PV: " + bonus_val)
  2694. elif int(bonus) == 2:
  2695. self.bonus_activ.SetText("Val. Atac: " + bonus_val)
  2696. elif int(bonus) == 3:
  2697. self.bonus_activ.SetText("Lovitura Critica: " + bonus_val)
  2698. elif int(bonus) == 4:
  2699. self.bonus_activ.SetText("Patrunzatoare: " + bonus_val)
  2700. else:
  2701. self.bonus_activ.SetText("Niciun bonus activ")
  2702.  
  2703. def __actualizare_bara_putere(self, valoare_bara_putere):
  2704. self.bara_plina.SetPercentage(valoare_bara_putere, 100)
  2705.  
  2706. def __efect_putere(self):
  2707. net.SendChatPacket("(efect_putere)")
  2708. # Final Sistem de Putere
  2709.  
  2710. # ENERGY_SYSTEM_END
  2711. def __energysystem(self, value):
  2712. import constinfo
  2713. constinfo.ENERGY_TYPE = int(value[:value.find("|")])
  2714. constinfo.ENERGY = int(value[value.find("|") + 1:value.find("#")])
  2715. constinfo.ENERGY_END_TIME = long((value[value.find("#") + 1:]))
  2716. # ENERGY_SYSTEM_START
  2717.  
  2718. # ARCHIEVEMENT_SYSTEM_START
  2719. def __ShowAchievementPoints(self, points):
  2720. import uiAchievement
  2721. import uiTaskbar
  2722. self.uiAchievement = uiAchievement.AchievementDialog()
  2723. uiAchievement.AchievementPoints = int(points)
  2724.  
  2725. def __AchievementTest(self, archivement):
  2726. import uiAchievement
  2727. self.uiAchievement = uiAchievement.AchievementDialog()
  2728. self.uiAchievement.Show(1, str(archivement))
  2729. self.uiAchievement.SetTop()
  2730. # ARCHIEVEMENT_SYSTEM_END
  2731.  
  2732. def __menubg(self):
  2733. if constInfo.MENU_BG == 0:
  2734. constInfo.MENU_BG = 1
  2735. self.menu_bg.Show()
  2736. self.Activare_Menu.Hide()
  2737. self.Dezactivare_Menu.Show()
  2738. else:
  2739. constInfo.MENU_BG = 0
  2740. self.menu_bg.Hide()
  2741. self.Activare_Menu.Show()
  2742. self.Dezactivare_Menu.Hide()
  2743. def __BonusPage(self):
  2744. import PaginaBonusuri
  2745. global BPisLodaded
  2746. try:
  2747. if BPisLodaded == 0:
  2748. BPisLodaded = 1
  2749. exec 'PaginaBonusuri.BonusBoardDialog().Show()'
  2750. else:
  2751. exec 'PaginaBonusuri.BonusBoardDialog().Hide()'
  2752. BPisLodaded = 0
  2753. except ImportError:
  2754. import dbg,app
  2755. dbg.Trace('PaginaBonusuri.py Importing error')
  2756. app.Abort
  2757. def __toggleSwitchbot(self):
  2758. if self.switchbot.bot_shown == 1:
  2759. self.switchbot.Hide()
  2760. else:
  2761. self.switchbot.Show()
  2762. def __depozit_questindex(self, value):
  2763. constInfo.DEPOZIT_QUESTINDEX = int(value)
  2764. def __activare_depozit(self):
  2765. activare_depozit = constInfo.DEPOZIT_QUESTINDEX
  2766. event.QuestButtonClick(activare_depozit)
  2767. def __antiexp_questindex(self, value1):
  2768. constInfo.ANTIEXP_QUESTINDEX = int(value1)
  2769. def __activare_antiexp(self):
  2770. activare_antiexp = constInfo.ANTIEXP_QUESTINDEX
  2771. event.QuestButtonClick(activare_antiexp)
  2772. def __teleporter_questindex(self, value2):
  2773. constInfo.TELEPORTER_QUESTINDEX = int(value2)
  2774. def __activare_teleporter(self):
  2775. activare_teleporter = constInfo.TELEPORTER_QUESTINDEX
  2776. event.QuestButtonClick(activare_teleporter)
  2777. def __sistemputerebarra(self):
  2778. if constInfo.SISTEM_PUTERE == 0:
  2779. constInfo.SISTEM_PUTERE = 1
  2780. self.PutereBG.Show()
  2781. chat.AppendChat(chat.CHAT_TYPE_INFO, "[Cryptex]Ai afisat Sistemul de Putere.")
  2782. else:
  2783. constInfo.SISTEM_PUTERE = 0
  2784. self.PutereBG.Hide()
  2785. chat.AppendChat(chat.CHAT_TYPE_INFO, "[Cryptex]Ai ascuns Sistemul de Putere.")
  2786. ## bara meniu sfarsit
  2787.  
  2788. import chat
  2789. def __sistemonoare(self):
  2790. if constInfo.SISTEM_ONOARE == 0:
  2791. constInfo.SISTEM_ONOARE = 1
  2792. self.sistem_onoare_bg.Show()
  2793. chat.AppendChat(chat.CHAT_TYPE_INFO, "[Cryptex]Ai afisat Sistemul de Onoare.")
  2794. else:
  2795. constInfo.SISTEM_ONOARE = 0
  2796. self.sistem_onoare_bg.Hide()
  2797. chat.AppendChat(chat.CHAT_TYPE_INFO, "[Cryptex]Ai ascuns Sistemul de Onoare.")
  2798. def __valori_ucideri(self, rosu, galben, albastru, onoare):
  2799. #Modificare Texte
  2800. self.Ucideri_Albastru.SetText("Regat Albastru: " + albastru)
  2801. self.Ucideri_Galben.SetText("Regat Galben: " + galben)
  2802. self.Ucideri_Rosu.SetText("Regat Rosu: " + rosu)
  2803. self.Puncte_Onoare.SetText("Puncte Onoare: " + onoare)
  2804. total_ucideri = int(albastru) + int(galben) + int(rosu) #Calculare Ucideri Totale
  2805. self.Total_Ucideri.SetText("Puncte Ucideri: " + str(total_ucideri))
  2806.  
  2807. def __sistem_onoare_questindex(self, value):
  2808. constInfo.SISTEM_ONOARE_QUESTINDEX = int(value)
  2809.  
  2810. def __activare_ucideri(self):
  2811. activare_ucideri = constInfo.SISTEM_ONOARE_QUESTINDEX
  2812. event.QuestButtonClick(activare_ucideri)
  2813.  
  2814. def UtilizariUcideriRamase(self, value):
  2815. self.Utilizari_Ramase.SetText("Utilizari Ramase: " + value)
  2816.  
  2817. def ActicareUcideri(self):
  2818. net.SendChatPacket("(efect_omor)")
  2819.  
  2820. def __sistemputerebarra(self):
  2821. if constInfo.SISTEM_PUTERE == 0:
  2822. constInfo.SISTEM_PUTERE = 1
  2823. self.PutereBG.Show()
  2824. chat.AppendChat(chat.CHAT_TYPE_INFO, "[Cryptex]Ai afisat Sistemul de Putere.")
  2825. else:
  2826. constInfo.SISTEM_PUTERE = 0
  2827. self.PutereBG.Hide()
  2828. chat.AppendChat(chat.CHAT_TYPE_INFO, "[Cryptex]Ai ascuns Sistemul de Putere.")
  2829.  
  2830. # AFk Systen
  2831. def __afk(self):
  2832. if constInfo.AFK == 0:
  2833. constInfo.AFK = 1
  2834. self.PopupMessage("[Cryptex]Sistemul afk a fost activat")
  2835. elif constInfo.AFK == 1:
  2836. constInfo.AFK = 0
  2837. self.PopupMessage("[Cryptex]Sistemul afk a fost dezactivat")
  2838. # Afk, sfarsit
  2839. # Kill Gui start
  2840. def __hidekillgui(self):
  2841. self.KillGuiBg.Hide()
  2842. self.KillBlauReich.Hide()
  2843. self.KillGelbReich.Hide()
  2844. self.KillRotReich.Hide()
  2845. self.KillMob.Hide()
  2846.  
  2847. def __showkillgui(self):
  2848. if constInfo.killgui == 0:
  2849. constInfo.killgui = 1
  2850. self.KillGuiBg.Show()
  2851. self.KillBlauReich.Show()
  2852. self.KillGelbReich.Show()
  2853. self.KillRotReich.Show()
  2854. self.KillMob.Show()
  2855. elif constInfo.killgui == 1:
  2856. constInfo.killgui = 0
  2857. self.KillGuiBg.Hide()
  2858. self.KillBlauReich.Hide()
  2859. self.KillGelbReich.Hide()
  2860. self.KillRotReich.Hide()
  2861. self.KillMob.Hide()
  2862.  
  2863. def __KillBlauReich(self, KillBlauReich):
  2864. self.KillBlauReich.SetText("Regat Albastru: " + KillBlauReich)
  2865.  
  2866. def __KillGelbReich(self, KillGelbReich):
  2867. self.KillGelbReich.SetText("Regat Galben: " + KillGelbReich)
  2868.  
  2869. def __KillRotReich(self, KillRotReich):
  2870. self.KillRotReich.SetText("Regat Rosu: " + KillRotReich)
  2871.  
  2872. def __KillMob(self, KillMob):
  2873. self.KillMob.SetText("Monstrii: " + KillMob)
  2874. # Kill Gui end
  2875.  
  2876. # Runy
  2877. def __runyData(self, arg):
  2878. self.RunWindow.SetData(arg)
  2879.  
  2880. def __runyShow(self):
  2881. self.RunWindow.Show()
  2882.  
  2883. def __runyQuest(self, qid):
  2884. constInfo.RUNYQ = int(qid)
  2885.  
  2886. def __runySlot1(self, qid):
  2887. constInfo.RUNYS1 = int(qid)
  2888.  
  2889. def __runySlot2(self, qid):
  2890. constInfo.RUNYS2 = int(qid)
  2891.  
  2892. def __runySlot3(self, qid):
  2893. constInfo.RUNYS3 = int(qid)
  2894.  
  2895. def __runySlot4(self, qid):
  2896. constInfo.RUNYS4 = int(qid)
  2897.  
  2898. def __runySlot5(self, qid):
  2899. constInfo.RUNYS5 = int(qid)
  2900.  
  2901. def __runySlot6(self, qid):
  2902. constInfo.RUNYS6 = int(qid)
  2903.  
  2904. def __runySlot7(self, qid):
  2905. constInfo.RUNYS7 = int(qid)
  2906. # Runy end
Advertisement
Add Comment
Please, Sign In to add comment