1. // game.py file
  2. -----------------------
  3. import os
  4. import app
  5. import dbg
  6. import grp
  7. import item
  8. import time
  9. import background
  10. import chr
  11. import chrmgr
  12. import player
  13. import chat
  14. import textTail
  15. import event
  16. import uibonuspage
  17. from switchbot import Bot
  18. import uipetsystem
  19. import snd
  20. import net
  21. import effect
  22. import wndMgr
  23. import fly
  24. import systemSetting
  25. import quest
  26. import guild
  27. import skill
  28. import messenger
  29. import localeInfo
  30. import constInfo
  31. import exchange
  32. import uiakiralvlgift
  33. import uiHealth
  34. import ime
  35. import mounting
  36. import ui
  37. import uiCommon
  38. import uiPhaseCurtain
  39. import uiMapNameShower
  40. import uiAffectShower
  41. import uiPlayerGauge
  42. import uiCharacter
  43. import uiTarget
  44. import uiTaskbar
  45. import uiteleport
  46. import uiguildstorage
  47. import schicksalrad
  48. # PRIVATE_SHOP_PRICE_LIST
  49. import uiPrivateShopBuilder
  50. # END_OF_PRIVATE_SHOP_PRICE_LIST
  51. # OFFLINE_SHOP_PRICE_LIST
  52. import uiOfflineShopBuilder
  53. # END_OF_OFFLINE_SHOP_PRICE_LIST
  54. import uiOfflineShop
  55. import mouseModule
  56. import consoleModule
  57. import playerSettingModule
  58. import interfaceModule
  59. import musicInfo
  60. import debugInfo
  61. import stringCommander
  62. from _weakref import proxy
  63. from switchbot import Bot
  64. # TEXTTAIL_LIVINGTIME_CONTROL
  65. #if localeInfo.IsJAPAN():
  66. # app.SetTextTailLivingTime(8.0)
  67. # END_OF_TEXTTAIL_LIVINGTIME_CONTROL
  68. # SCREENSHOT_CWDSAVE
  69. SCREENSHOT_CWDSAVE = FALSE
  70. SCREENSHOT_DIR = None
  71. if localeInfo.IsEUROPE():
  72. SCREENSHOT_CWDSAVE = TRUE
  73. #if localeInfo.IsCIBN10():
  74. # SCREENSHOT_CWDSAVE = FALSE
  75. # SCREENSHOT_DIR = "YT2W"
  76. cameraDistance = 1550.0
  77. cameraPitch = 27.0
  78. cameraRotation = 0.0
  79. cameraHeight = 100.0
  80. testAlignment = 0
  81. BPisLodaded = 0
  82. pet_gui_activado = 0
  83. bonuspp = 0
  84. class GameWindow(ui.ScriptWindow):
  85. def __init__(self, stream):
  86. ui.ScriptWindow.__init__(self, "GAME")
  87. self.SetWindowName("game")
  88. net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  89. player.SetGameWindow(self)
  90. self.wndAkiraGift = uiakiralvlgift.AkiraGiftSys()
  91. self.quickSlotPageIndex = 0
  92. self.lastPKModeSendedTime = 0
  93. self.LastBoniSwitcherId = 0
  94. self.pressNumber = None
  95. self.guildWarQuestionDialog = None
  96. self.interface = None
  97. self.targetBoard = None
  98. self.console = None
  99. self.mapNameShower = None
  100. self.affectShower = None
  101. self.playerGauge = None
  102. self.petInventoryWnd = None
  103. self.boniSwitcherWnd = []
  104. constInfo.BONI_SWITCHER_LOAD = FALSE
  105. self.itemShopWnd = None
  106. #import uiBoniSwitcher
  107. #for i in xrange(constInfo.SWITCHER_COUNT):
  108. #self.boniSwitcherWnd.append(uiBoniSwitcher.BoniSwitcherDialog(i))
  109. #self.boniSwitcherWnd[i].SetChangeBonusSwitcherEvent(self.__BoniSwitcherShow)
  110. #self.boniSwitcherWnd[i].GAMESetBoniSwitcherCheckEvent(self.__BoniSwitcherCheckEvent)
  111. self.stream=stream
  112. self.interface = interfaceModule.Interface()
  113. self.interface.SetStream(self.stream)
  114. self.interface.MakeInterface()
  115. self.interface.SetOpenBoniSwitcherEvent(self.__BoniSwitcherShow)
  116. self.interface.ShowDefaultWindows()
  117. self.stream.isAutoSelect = 0
  118. self.curtain = uiPhaseCurtain.PhaseCurtain()
  119. self.curtain.speed = 0.03
  120. self.curtain.Hide()
  121. self.GuildStorageWindow = uiguildstorage.GuildStorage()
  122. self.targetBoard = uiTarget.TargetBoard()
  123. self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  124. self.targetBoard.Hide()
  125. self.petmain = uipetsystem.PetSystemMain()
  126. self.petmini = uipetsystem.PetSystemMini()
  127. self.console = consoleModule.ConsoleWindow()
  128. self.console.BindGameClass(self)
  129. self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  130. self.console.Hide()
  131. '''
  132. self.WolfGuiBg = ui.ImageBox()
  133. self.WolfGuiBg.LoadImage("d:/ymir work/ui/Wolf_button.dds")
  134. self.WolfGuiBg.SetPosition(-2,300)
  135. self.WolfGuiBg.Show()
  136. self.WolfGuiBg_button1 = ui.Button()
  137. self.WolfGuiBg_button1.SetParent(self.WolfGuiBg)
  138. self.WolfGuiBg_button1.SetPosition(6,25)
  139. self.WolfGuiBg_button1.SetUpVisual('d:/ymir work/ui/pu_button.tga')
  140. self.WolfGuiBg_button1.SetOverVisual('d:/ymir work/ui/pu_button.tga')
  141. self.WolfGuiBg_button1.SetDownVisual('d:/ymir work/ui/pu_button.tga')
  142. self.WolfGuiBg_button1.SetEvent(self.ClickOpen_Shops)
  143. self.WolfGuiBg_button1.Show()
  144. self.WolfGuiBg_button2 = ui.Button()
  145. self.WolfGuiBg_button2.SetParent(self.WolfGuiBg)
  146. self.WolfGuiBg_button2.SetPosition(6,60)
  147. self.WolfGuiBg_button2.SetUpVisual('d:/ymir work/kev_icons/bonusage/bp1.tga')
  148. self.WolfGuiBg_button2.SetOverVisual('d:/ymir work/kev_icons/bonusage/bp2.tga')
  149. self.WolfGuiBg_button2.SetDownVisual('d:/ymir work/kev_icons/bonusage/bp3.tga')
  150. self.WolfGuiBg_button2.SetEvent(self.ClickOpen_YouTube)
  151. self.WolfGuiBg_button2.Show()
  152. '''
  153. ##START_KILLGUI
  154. KillGuiBg = ui.ImageBox()
  155. KillGuiBg.LoadImage("d:/ymir work/ui/v1.dds")
  156. self.KillGuiBg = KillGuiBg
  157. self.KillGuiBg.SetPosition(-166,465)
  158. self.KillGuiBg.Show()
  159. self.KillGuiBg_open = ui.Button()
  160. self.KillGuiBg_open.SetPosition(+11,570)
  161. self.KillGuiBg_open.SetUpVisual('d:/ymir work/ui/abrir_kg.tga')
  162. self.KillGuiBg_open.SetOverVisual('d:/ymir work/ui/abrir_raton_kg.tga')
  163. self.KillGuiBg_open.SetDownVisual('d:/ymir work/ui/abrir_pulsado_kg.tga')
  164. self.KillGuiBg_open.SetEvent(self.__OpenKillGui)
  165. self.KillGuiBg_open.Show()
  166. self.KillGuiBg_close = ui.Button()
  167. self.KillGuiBg_close.SetPosition(+178,570)
  168. self.KillGuiBg_close.SetUpVisual('d:/ymir work/ui/cerrar_kg.tga')
  169. self.KillGuiBg_close.SetOverVisual('d:/ymir work/ui/cerrar_raton_kg.tga')
  170. self.KillGuiBg_close.SetDownVisual('d:/ymir work/ui/cerrar_pulsado_kg.tga')
  171. self.KillGuiBg_close.SetEvent(self.__CloseKillGui)
  172. self.KillGuiBg_close.Hide()
  173. self.KillBlauReich = ui.TextLine()
  174. self.KillBlauReich.SetDefaultFontName()
  175. self.KillBlauReich.SetPosition(135,535)
  176. self.KillBlauReich.SetText(localeInfo.KEV_JENO_EMPIRE_GUI_C)
  177. self.KillBlauReich.SetFontColor(253,250,5)
  178. self.KillBlauReich.SetOutline()
  179. #self.KillBlauReich.SetEvent(self.__KillBlauReich)
  180. self.KillBlauReich.Hide()
  181. self.KillGelbReich = ui.TextLine()
  182. self.KillGelbReich.SetDefaultFontName()
  183. self.KillGelbReich.SetPosition(135, 565)
  184. self.KillGelbReich.SetText(localeInfo.KEV_SHNJO_EMPIRE_GUI_C)
  185. self.KillGelbReich.SetFontColor(17,5,253)
  186. self.KillGelbReich.SetOutline()
  187. #self.KillGelbReich.SetEvent(self.__KillGelbReich)
  188. self.KillGelbReich.Hide()
  189. self.KillRotReich = ui.TextLine()
  190. self.KillRotReich.SetDefaultFontName()
  191. self.KillRotReich.SetPosition(135, 595)
  192. self.KillRotReich.SetText(localeInfo.KEV_SHEINSO_EMPIRE_GUI_C)
  193. self.KillRotReich.SetFontColor(50,0,0)
  194. self.KillRotReich.SetOutline()
  195. #self.KillRotReich.SetEvent(self.__KillRotReich)
  196. self.KillRotReich.Hide()
  197. self.KillMob = ui.TextLine()
  198. self.KillMob.SetDefaultFontName()
  199. self.KillMob.SetPosition(135, 625)
  200. self.KillMob.SetText(localeInfo.KEV_MONSTER_KILL_GUI_C)
  201. self.KillMob.SetOutline()
  202. #self.KillMob.SetEvent(self.__KillMob)
  203. self.KillMob.Hide()
  204. self.mapNameShower = uiMapNameShower.MapNameShower()
  205. self.affectShower = uiAffectShower.AffectShower()
  206. self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  207. self.playerGauge.Hide()
  208. #wj 2014.1.2. ESC키를 누를 시 우선적으로 DropQuestionDialog를 끄도록 만들었다. 하지만 처음에 itemDropQuestionDialog가 선언되어 있지 않아 ERROR가 발생하여 init에서 선언과 동시에 초기화 시킴.
  209. self.itemDropQuestionDialog = None
  210. self.__SetQuickSlotMode()
  211. self.__ServerCommand_Build()
  212. self.__ProcessPreservedServerCommand()
  213. self.switchbot = Bot()
  214. self.switchbot.Hide()
  215. self.teleport = uiteleport.TeleportWindow()
  216. self.MountingSystem = mounting.MountWindow()
  217. self.SchicksalRad = schicksalrad.RadDesSchicksals()
  218. ##kevTime in-game
  219. self.timeLine = ui.TextLine()
  220. self.timeLine.SetFontName(localeInfo.UI_DEF_FONT_LARGE)
  221. self.timeLine.SetFontColor(17, 5, 253)
  222. self.timeLine.SetPosition((wndMgr.GetScreenWidth() - 142) / 2, 162)
  223. def __del__(self):
  224. player.SetGameWindow(0)
  225. net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  226. ui.ScriptWindow.__del__(self)
  227. def Open(self):
  228. app.SetFrameSkip(1)
  229. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  230. #self.Activare_Menu = ui.Button()
  231. #self.Activare_Menu.SetPosition(wndMgr.GetScreenWidth()-10,wndMgr.GetScreenHeight()/2-54)
  232. #self.Activare_Menu.SetUpVisual("Jin_Han/1_1.tga")
  233. #self.Activare_Menu.SetOverVisual("Jin_Han/1_2.tga")
  234. #self.Activare_Menu.SetDownVisual("Jin_Han/1_3.tga")
  235. #self.Activare_Menu.SetEvent(ui.__mem_func__(self.__menubg))
  236. #self.Activare_Menu.SetToolTipText("Deschide Meniu.")
  237. #self.Activare_Menu.Show()
  238. # self.Dezactivare_Menu = ui.Button()
  239. # self.Dezactivare_Menu.SetPosition(wndMgr.GetScreenWidth()-60,wndMgr.GetScreenHeight()/2-54)
  240. # self.Dezactivare_Menu.SetUpVisual("Jin_Han/2_1.tga")
  241. # self.Dezactivare_Menu.SetOverVisual("Jin_Han/2_2.tga")
  242. # self.Dezactivare_Menu.SetDownVisual("Jin_Han/2_3.tga")
  243. # self.Activare_Menu.SetToolTipText("Inchide Meniu.")
  244. # self.Dezactivare_Menu.SetEvent(ui.__mem_func__(self.__menubg))
  245. # self.Dezactivare_Menu.Hide()
  246. # menu_bg = ui.AniImageBox()
  247. #menu_bg.AppendImage("Jin_Han/fundal.tga")
  248. # self.menu_bg = menu_bg
  249. # self.menu_bg.SetPosition(wndMgr.GetScreenWidth()-50,wndMgr.GetScreenHeight()/2-91)
  250. # self.menu_bg.SetSize(60, 250)
  251. # self.menu_bg.Hide()
  252. # self.Bonusuri = ui.Button()
  253. # self.Bonusuri.SetParent(self.menu_bg)
  254. # self.Bonusuri.SetPosition(9, 10)
  255. # self.Bonusuri.SetUpVisual("Jin_Han/1.tga")
  256. # self.Bonusuri.SetOverVisual("Jin_Han/2.tga")
  257. ## self.Bonusuri.SetDownVisual("Jin_Han/1.tga")
  258. # self.Bonusuri.SetToolTipText("Deschide Pagina De Bonusuri.")
  259. ## self.Bonusuri.SetEvent(ui.__mem_func__(self.__BonusPage))
  260. # self.Bonusuri.Show()
  261. # self.StatusUp = ui.Button()
  262. # self.StatusUp.SetParent(self.menu_bg)
  263. # self.StatusUp.SetPosition(9, 44)
  264. # self.StatusUp.SetUpVisual("Jin_Han/3.tga")
  265. # self.StatusUp.SetOverVisual("Jin_Han/4.tga")
  266. # self.StatusUp.SetDownVisual("Jin_Han/3.tga")
  267. # self.StatusUp.SetToolTipText("Adauga puncte la status.")
  268. # self.StatusUp.SetEvent(ui.__mem_func__(self.__JINHAN))
  269. # self.StatusUp.Show()
  270. # self.Depozit = ui.Button()
  271. # self.Depozit.SetParent(self.menu_bg)
  272. # self.Depozit.SetPosition(9, 76)
  273. # self.Depozit.SetUpVisual("Jin_Han/5.tga")
  274. # self.Depozit.SetOverVisual("Jin_Han/6.tga")
  275. # self.Depozit.SetDownVisual("Jin_Han/5.tga")
  276. # self.Depozit.SetToolTipText("Deschide Depozit.")
  277. # self.Depozit.SetEvent(self.__activare_depozit)
  278. # self.Depozit.Show()
  279. # self.AntiExp = ui.Button()
  280. # self.AntiExp.SetParent(self.menu_bg)
  281. # self.AntiExp.SetPosition(9, 108)
  282. # self.AntiExp.SetUpVisual("Jin_Han/7.tga")
  283. # self.AntiExp.SetOverVisual("Jin_Han/8.tga")
  284. # self.AntiExp.SetDownVisual("Jin_Han/7.tga")
  285. # self.AntiExp.SetToolTipText("Activeaza Inel Anti Exp.")
  286. # self.AntiExp.SetEvent(self.__activare_antiexp)
  287. # self.AntiExp.Show()
  288. # self.Teleporter = ui.Button()
  289. # self.Teleporter.SetParent(self.menu_bg)
  290. # self.Teleporter.SetPosition(9, 140)
  291. # self.Teleporter.SetUpVisual("Jin_Han/9.tga")
  292. # self.Teleporter.SetOverVisual("Jin_Han/10.tga")
  293. # self.Teleporter.SetDownVisual("Jin_Han/9.tga")
  294. # self.Teleporter.SetToolTipText("Deschide Inel De Teleportare.")
  295. # self.Teleporter.SetEvent(self.__activare_teleporter)
  296. # self.Teleporter.Show()
  297. # self.DeschidereMagazin = ui.Button()
  298. # self.DeschidereMagazin.SetParent(self.menu_bg)
  299. # self.DeschidereMagazin.SetPosition(9, 204)
  300. # self.DeschidereMagazin.SetUpVisual("Jin_Han/sopen.tga")
  301. # self.DeschidereMagazin.SetOverVisual("Jin_Han/sopen1.tga")
  302. # self.DeschidereMagazin.SetDownVisual("Jin_Han/sopen2.tga")
  303. # self.DeschidereMagazin.SetToolTipText("Deschidere Offline Shop.")
  304. # self.DeschidereMagazin.SetEvent(self.__DeschidereMagazin)
  305. # self.DeschidereMagazin.Show()
  306. # self.Switch = ui.Button()
  307. # self.Switch.SetParent(self.menu_bg)
  308. # self.Switch.SetPosition(9, 172)
  309. # self.Switch.SetUpVisual("Jin_Han/s1.tga")
  310. # self.Switch.SetOverVisual("Jin_Han/s1.tga")
  311. # self.Switch.SetDownVisual("Jin_Han/s2.tga")
  312. # self.Switch.SetToolTipText("Switchbot.")
  313. # self.Switch.SetEvent(ui.__mem_func__(self.__toggleSwitchbot))
  314. # self.Switch.Show()
  315. #meniuasd
  316. ## self.Activare_Menu2 = ui.Button()
  317. # self.Activare_Menu2.SetPosition(wndMgr.GetScreenWidth()-270,wndMgr.GetScreenHeight()/1-47)
  318. # self.Activare_Menu2.SetUpVisual("Jin_Han/p1_1.tga")
  319. # self.Activare_Menu2.SetOverVisual("Jin_Han/p1_2.tga")
  320. # self.Activare_Menu2.SetDownVisual("Jin_Han/p1_3.tga")
  321. # self.Activare_Menu2.SetEvent(ui.__mem_func__(self.__menubg2))
  322. # self.Activare_Menu2.SetToolTipText("Deschide Meniu Cu Urmatoarele Atribute: Offline Shop/Info Shop/Retrage Yang/Inchide Shop/Switchbot")
  323. # self.Activare_Menu2.Show()
  324. # self.Dezactivare_Menu2 = ui.Button()
  325. # self.Dezactivare_Menu2.SetPosition(wndMgr.GetScreenWidth()-270,wndMgr.GetScreenHeight()/1-230)
  326. # self.Dezactivare_Menu2.SetUpVisual("Jin_Han/p1_4.tga")
  327. # self.Dezactivare_Menu2.SetOverVisual("Jin_Han/p1_5.tga")
  328. # self.Dezactivare_Menu2.SetDownVisual("Jin_Han/p1_6.tga")
  329. # self.Dezactivare_Menu2.SetToolTipText("Inchidere Meniu")
  330. # self.Dezactivare_Menu2.SetEvent(ui.__mem_func__(self.__menubg2))
  331. # self.Dezactivare_Menu2.Hide()
  332. # menu_bg2 = ui.AniImageBox()
  333. # menu_bg2.AppendImage("Jin_Han/fundal.tga")
  334. # self.menu_bg2 = menu_bg2
  335. # self.menu_bg2.SetPosition(wndMgr.GetScreenWidth()-240,wndMgr.GetScreenHeight()/1-220)
  336. # self.menu_bg2.SetSize(50, 150)
  337. # self.menu_bg2.Hide()
  338. # self.RetrageYang = ui.Button()
  339. # self.RetrageYang.SetParent(self.menu_bg2)
  340. # self.RetrageYang.SetPosition(9, 10)
  341. # self.RetrageYang.SetUpVisual("Jin_Han/smoney.tga")
  342. # self.RetrageYang.SetOverVisual("Jin_Han/smoney1.tga")
  343. # self.RetrageYang.SetDownVisual("Jin_Han/smoney2.tga")
  344. # self.RetrageYang.SetToolTipText("Retrage Yang/Innformatii Shop/Inchide Shop.")
  345. # self.RetrageYang.SetEvent(ui.__mem_func__(self.__RetrageYang))
  346. # self.RetrageYang.Show()
  347. # self.DeschidereMagazin = ui.Button()
  348. # self.DeschidereMagazin.SetParent(self.menu_bg2)
  349. # self.DeschidereMagazin.SetPosition(9, 42)
  350. # self.DeschidereMagazin.SetUpVisual("Jin_Han/sopen.tga")
  351. # self.DeschidereMagazin.SetOverVisual("Jin_Han/sopen1.tga")
  352. # self.DeschidereMagazin.SetDownVisual("Jin_Han/sopen2.tga")
  353. # self.DeschidereMagazin.SetToolTipText("Deschidere Offline Shop.")
  354. # self.DeschidereMagazin.SetEvent(self.__DeschidereMagazin)
  355. # self.DeschidereMagazin.Show()
  356. # self.Switch = ui.Button()
  357. # self.Switch.SetParent(self.menu_bg2)
  358. # self.Switch.SetPosition(9, 74)
  359. # self.Switch.SetUpVisual("Jin_Han/s1.tga")
  360. # self.Switch.SetOverVisual("Jin_Han/s1.tga")
  361. # self.Switch.SetDownVisual("Jin_Han/s2.tga")
  362. # self.Switch.SetToolTipText("Switchbot.")
  363. # self.Switch.SetEvent(ui.__mem_func__(self.__toggleSwitchbot))
  364. # self.Switch.Show()
  365. Espacio = ui.AniImageBox()
  366. Espacio.SetWindowHorizontalAlignLeft()
  367. Espacio.SetWindowVerticalAlignTop()
  368. Espacio.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  369. self.Espacio = Espacio
  370. self.Espacio.SetPosition(10, 80)
  371. self.contador_usuarios_guerra = ui.TextLine()
  372. self.contador_usuarios_guerra.SetWindowHorizontalAlignLeft()
  373. self.contador_usuarios_guerra.SetWindowVerticalAlignTop()
  374. self.contador_usuarios_guerra.SetDefaultFontName()
  375. self.contador_usuarios_guerra.SetPosition(24+8, 37+2 +40)
  376. self.contador_usuarios_guerra.SetText("0")
  377. self.contador_usuarios_guerra.SetOutline()
  378. self.muertos_guerra = ui.TextLine()
  379. self.muertos_guerra.SetWindowHorizontalAlignLeft()
  380. self.muertos_guerra.SetWindowVerticalAlignTop()
  381. self.muertos_guerra.SetDefaultFontName()
  382. self.muertos_guerra.SetPosition(24+8, 47+2+40)
  383. self.muertos_guerra.SetText("0")
  384. self.muertos_guerra.SetOutline()
  385. self.caido_guerra = ui.TextLine()
  386. self.caido_guerra.SetWindowHorizontalAlignLeft()
  387. self.caido_guerra.SetWindowVerticalAlignTop()
  388. self.caido_guerra.SetDefaultFontName()
  389. self.caido_guerra.SetPosition(24+8, 57+2+40)
  390. self.caido_guerra.SetText("0")
  391. self.caido_guerra.SetOutline()
  392. self.usuarios_guerra = ui.TextLine()
  393. self.usuarios_guerra.SetWindowHorizontalAlignLeft()
  394. self.usuarios_guerra.SetWindowVerticalAlignTop()
  395. self.usuarios_guerra.SetDefaultFontName()
  396. self.usuarios_guerra.SetPosition(10+8, 37+2+40)
  397. self.usuarios_guerra.SetText("U:")
  398. self.usuarios_guerra.SetOutline()
  399. self.ranking_guerra = ui.TextLine()
  400. self.ranking_guerra.SetWindowHorizontalAlignLeft()
  401. self.ranking_guerra.SetWindowVerticalAlignTop()
  402. self.ranking_guerra.SetDefaultFontName()
  403. self.ranking_guerra.SetPosition(10+8, 47+2+40)
  404. self.ranking_guerra.SetText("R:")
  405. self.ranking_guerra.SetOutline()
  406. self.ranking_caido = ui.TextLine()
  407. self.ranking_caido.SetWindowHorizontalAlignLeft()
  408. self.ranking_caido.SetWindowVerticalAlignTop()
  409. self.ranking_caido.SetDefaultFontName()
  410. self.ranking_caido.SetPosition(10 +8, 57 +2+40)
  411. self.ranking_caido.SetText("M:")
  412. self.ranking_caido.SetOutline()
  413. Medallas_gui = ui.AniImageBox()
  414. Medallas_gui.SetWindowHorizontalAlignLeft()
  415. Medallas_gui.SetWindowVerticalAlignTop()
  416. Medallas_gui.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  417. self.Medallas_gui = Medallas_gui
  418. self.Medallas_gui.SetPosition(10, 40)
  419. self.muertes = ui.TextLine()
  420. self.muertes.SetWindowHorizontalAlignLeft()
  421. self.muertes.SetWindowVerticalAlignTop()
  422. self.muertes.SetDefaultFontName()
  423. self.muertes.SetPosition(24, 51)
  424. self.muertes.SetText("0")
  425. self.muertes.SetOutline()
  426. self.primera_muerte = ui.AniImageBox()
  427. self.primera_muerte.SetWindowHorizontalAlignLeft()
  428. self.primera_muerte.SetWindowVerticalAlignTop()
  429. self.primera_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/1.dds")
  430. self.primera_muerte.SetPosition(43, 40)
  431. self.doble_muerte = ui.AniImageBox()
  432. self.doble_muerte.SetWindowHorizontalAlignLeft()
  433. self.doble_muerte.SetWindowVerticalAlignTop()
  434. self.doble_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/2.dds")
  435. self.doble_muerte.SetPosition(43 + 33, 40)
  436. self.triple_muerte = ui.AniImageBox()
  437. self.triple_muerte.SetWindowHorizontalAlignLeft()
  438. self.triple_muerte.SetWindowVerticalAlignTop()
  439. self.triple_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/3.dds")
  440. self.triple_muerte.SetPosition(43 + 33 + 33, 40)
  441. self.exterminio = ui.AniImageBox()
  442. self.exterminio.SetWindowHorizontalAlignLeft()
  443. self.exterminio.SetWindowVerticalAlignTop()
  444. self.exterminio.AppendImage("d:/ymir work/ui/pattern/medallas/4.dds")
  445. self.exterminio.SetPosition(43+ 33+ 33 + 33, 40)
  446. self.muertacular = ui.AniImageBox()
  447. self.muertacular.SetWindowHorizontalAlignLeft()
  448. self.muertacular.SetWindowVerticalAlignTop()
  449. self.muertacular.AppendImage("d:/ymir work/ui/pattern/medallas/5.dds")
  450. self.muertacular.SetPosition(43+ 33+ 33+ 33 + 33, 40)
  451. self.bestialidad = ui.AniImageBox()
  452. self.bestialidad.SetWindowHorizontalAlignLeft()
  453. self.bestialidad.SetWindowVerticalAlignTop()
  454. self.bestialidad.AppendImage("d:/ymir work/ui/pattern/medallas/6.dds")
  455. self.bestialidad.SetPosition(43+ 33+ 33+ 33+ 33 + 33, 40)
  456. self.salvajada = ui.AniImageBox()
  457. self.salvajada.SetWindowHorizontalAlignLeft()
  458. self.salvajada.SetWindowVerticalAlignTop()
  459. self.salvajada.AppendImage("d:/ymir work/ui/pattern/medallas/7.dds")
  460. self.salvajada.SetPosition(43+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  461. self.catastrofe = ui.AniImageBox()
  462. self.catastrofe.SetWindowHorizontalAlignLeft()
  463. self.catastrofe.SetWindowVerticalAlignTop()
  464. self.catastrofe.AppendImage("d:/ymir work/ui/pattern/medallas/8.dds")
  465. self.catastrofe.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  466. self.apocalipsis = ui.AniImageBox()
  467. self.apocalipsis.SetWindowHorizontalAlignLeft()
  468. self.apocalipsis.SetWindowVerticalAlignTop()
  469. self.apocalipsis.AppendImage("d:/ymir work/ui/pattern/medallas/9.dds")
  470. self.apocalipsis.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  471. self.lluvia_muertos = ui.AniImageBox()
  472. self.lluvia_muertos.SetWindowHorizontalAlignLeft()
  473. self.lluvia_muertos.SetWindowVerticalAlignTop()
  474. self.lluvia_muertos.AppendImage("d:/ymir work/ui/pattern/medallas/10.dds")
  475. self.lluvia_muertos.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  476. self.super_increible = ui.AniImageBox()
  477. self.super_increible.SetWindowHorizontalAlignLeft()
  478. self.super_increible.SetWindowVerticalAlignTop()
  479. self.super_increible.AppendImage("d:/ymir work/ui/pattern/medallas/11.dds")
  480. self.super_increible.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  481. #Fin menu
  482. self.quickSlotPageIndex = 0
  483. self.switchbot = Bot()
  484. self.switchbot.Hide()
  485. self.PickingCharacterIndex = -1
  486. self.PickingItemIndex = -1
  487. self.consoleEnable = FALSE
  488. self.isShowDebugInfo = FALSE
  489. self.ShowNameFlag = FALSE
  490. self.enableXMasBoom = FALSE
  491. self.startTimeXMasBoom = 0.0
  492. self.indexXMasBoom = 0
  493. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  494. app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  495. constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  496. constInfo.SET_DEFAULT_CHRNAME_COLOR()
  497. constInfo.SET_DEFAULT_FOG_LEVEL()
  498. constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  499. constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  500. constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  501. # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  502. constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  503. # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  504. import event
  505. event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
  506. textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  507. if constInfo.PVPMODE_TEST_ENABLE:
  508. self.testPKMode = ui.TextLine()
  509. self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT)
  510. self.testPKMode.SetPosition(0, 15)
  511. self.testPKMode.SetWindowHorizontalAlignCenter()
  512. self.testPKMode.SetHorizontalAlignCenter()
  513. self.testPKMode.SetFeather()
  514. self.testPKMode.SetOutline()
  515. self.testPKMode.Show()
  516. self.testAlignment = ui.TextLine()
  517. self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT)
  518. self.testAlignment.SetPosition(0, 35)
  519. self.testAlignment.SetWindowHorizontalAlignCenter()
  520. self.testAlignment.SetHorizontalAlignCenter()
  521. self.testAlignment.SetFeather()
  522. self.testAlignment.SetOutline()
  523. self.testAlignment.Show()
  524. self.__BuildKeyDict()
  525. self.__BuildDebugInfo()
  526. # PRIVATE_SHOP_PRICE_LIST
  527. uiPrivateShopBuilder.Clear()
  528. # END_OF_PRIVATE_SHOP_PRICE_LIST
  529. # OFFLINE_SHOP_PRICE_LIST
  530. uiOfflineShopBuilder.Clear()
  531. # END_OF_OFFLINE_SHOP_PRICE_LIST
  532. # UNKNOWN_UPDATE
  533. exchange.InitTrading()
  534. # END_OF_UNKNOWN_UPDATE
  535. ## Sound
  536. snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  537. snd.SetSoundVolume(systemSetting.GetSoundVolume())
  538. netFieldMusicFileName = net.GetFieldMusicFileName()
  539. if netFieldMusicFileName:
  540. snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  541. elif musicInfo.fieldMusic != "":
  542. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  543. self.__SetQuickSlotMode()
  544. self.__SelectQuickPage(self.quickSlotPageIndex)
  545. self.SetFocus()
  546. self.Show()
  547. app.ShowCursor()
  548. net.SendEnterGamePacket()
  549. # START_GAME_ERROR_EXIT
  550. try:
  551. self.StartGame()
  552. except:
  553. import exception
  554. exception.Abort("GameWindow.Open")
  555. # END_OF_START_GAME_ERROR_EXIT
  556. # NPC가 큐브시스템으로 만들 수 있는 아이템들의 목록을 캐싱
  557. # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ]
  558. self.cubeInformation = {}
  559. self.currentCubeNPC = 0
  560. self.acceInformation = {}
  561. self.currentAcceNPC = 0
  562. def Close(self):
  563. self.wndAkiraGift.Close()
  564. self.Hide()
  565. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  566. (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  567. if musicInfo.fieldMusic != "":
  568. snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  569. self.onPressKeyDict = None
  570. self.onClickKeyDict = None
  571. chat.Close()
  572. # self.menu_bg.Hide()
  573. # self.Dezactivare_Menu.Hide()
  574. # self.Activare_Menu.Hide()
  575. # self.menu_bg2.Hide()
  576. # self.Dezactivare_Menu2.Hide()
  577. # self.Activare_Menu2.Hide()
  578. snd.StopAllSound()
  579. grp.InitScreenEffect()
  580. chr.Destroy()
  581. textTail.Clear()
  582. quest.Clear()
  583. background.Destroy()
  584. guild.Destroy()
  585. messenger.Destroy()
  586. skill.ClearSkillData()
  587. wndMgr.Unlock()
  588. mouseModule.mouseController.DeattachObject()
  589. if self.guildWarQuestionDialog:
  590. self.guildWarQuestionDialog.Close()
  591. self.guildNameBoard = None
  592. self.partyRequestQuestionDialog = None
  593. self.partyInviteQuestionDialog = None
  594. self.guildInviteQuestionDialog = None
  595. self.guildWarQuestionDialog = None
  596. self.messengerAddFriendQuestion = None
  597. # UNKNOWN_UPDATE
  598. self.itemDropQuestionDialog = None
  599. # END_OF_UNKNOWN_UPDATE
  600. # QUEST_CONFIRM
  601. self.confirmDialog = None
  602. # END_OF_QUEST_CONFIRM
  603. self.PrintCoord = None
  604. self.FrameRate = None
  605. self.Pitch = None
  606. self.Splat = None
  607. self.TextureNum = None
  608. self.ObjectNum = None
  609. self.ViewDistance = None
  610. self.PrintMousePos = None
  611. self.ClearDictionary()
  612. self.petmain.Close()
  613. self.petmini.Close()
  614. self.playerGauge = None
  615. self.mapNameShower = None
  616. self.affectShower = None
  617. if self.SchicksalRad.IsShow():
  618. self.SchicksalRad.Open()
  619. if self.MountingSystem.IsShow():
  620. self.MountingSystem.Open()
  621. if self.console:
  622. self.console.BindGameClass(0)
  623. self.console.Close()
  624. self.console=None
  625. if self.targetBoard:
  626. self.targetBoard.Destroy()
  627. self.targetBoard = None
  628. if self.itemShopWnd:
  629. self.itemShopWnd.Destroy()
  630. self.itemShopWnd = None
  631. if self.interface:
  632. self.interface.HideAllWindows()
  633. self.interface.Close()
  634. self.interface=None
  635. for i in xrange(len(self.boniSwitcherWnd)):
  636. if self.boniSwitcherWnd[i]:
  637. self.boniSwitcherWnd[i].Destroy()
  638. self.boniSwitcherWnd[i] = None
  639. if self.petInventoryWnd:
  640. self.petInventoryWnd.Destroy()
  641. self.petInventoryWnd = None
  642. player.ClearSkillDict()
  643. player.ResetCameraRotation()
  644. self.KillFocus()
  645. app.HideCursor()
  646. self.KillGuiBg.Hide()
  647. self.KillBlauReich.Hide()
  648. self.KillGelbReich.Hide()
  649. self.KillRotReich.Hide()
  650. self.KillMob.Hide()
  651. self.KillGuiBg_close.Hide()
  652. print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  653. def __BuildKeyDict(self):
  654. onPressKeyDict = {}
  655. ##PressKey 는 누르고 있는 동안 계속 적용되는 키이다.
  656. ## 숫자 단축키 퀵슬롯에 이용된다.(이후 숫자들도 퀵 슬롯용 예약)
  657. ## F12 는 클라 디버그용 키이므로 쓰지 않는 게 좋다.
  658. onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(1)
  659. onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(2)
  660. onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(3)
  661. onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(4)
  662. onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5)
  663. onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6)
  664. onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7)
  665. onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8)
  666. onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9)
  667. onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(4)
  668. onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(5)
  669. onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(6)
  670. onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
  671. onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
  672. onPressKeyDict[app.DIK_F6] = lambda : self.__toggleSwitchbot()
  673. onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()
  674. onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage()
  675. onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen()
  676. onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack()
  677. #캐릭터 이동키
  678. onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp()
  679. onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown()
  680. onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft()
  681. onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight()
  682. onPressKeyDict[app.DIK_W] = lambda : self.MoveUp()
  683. onPressKeyDict[app.DIK_S] = lambda : self.MoveDown()
  684. onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft()
  685. onPressKeyDict[app.DIK_D] = lambda : self.MoveRight()
  686. onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  687. onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  688. #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  689. onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  690. onPressKeyDict[app.DIK_G] = self.__PressGKey
  691. onPressKeyDict[app.DIK_Q] = self.__PressQKey
  692. onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera()
  693. onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  694. onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  695. onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  696. onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  697. onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  698. onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  699. onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem()
  700. onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem()
  701. onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  702. onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  703. #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  704. onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  705. onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow()
  706. onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo()
  707. onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey()
  708. #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow()
  709. onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp()
  710. onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown()
  711. onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow()
  712. onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key
  713. onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode()
  714. onPressKeyDict[app.DIK_J] = lambda : self.__PressJKey()
  715. onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey()
  716. onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey()
  717. onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
  718. onPressKeyDict[app.DIK_X] = lambda : self.__PressXKey()
  719. # CUBE_TEST
  720. #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow()
  721. # CUBE_TEST_END
  722. self.onPressKeyDict = onPressKeyDict
  723. onClickKeyDict = {}
  724. onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  725. onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  726. onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  727. onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  728. onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  729. onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  730. onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  731. onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  732. onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  733. onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  734. onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  735. onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  736. onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  737. onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  738. onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  739. onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  740. onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  741. onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  742. onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  743. onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  744. onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  745. onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  746. onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  747. onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  748. onClickKeyDict[app.DIK_P] = lambda: self.OpenPetMainGui()
  749. #if constInfo.PVPMODE_ACCELKEY_ENABLE:
  750. # onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode()
  751. self.onClickKeyDict=onClickKeyDict
  752. def __PressNumKey(self,num):
  753. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  754. if num >= 1 and num <= 9:
  755. if(chrmgr.IsPossibleEmoticon(-1)):
  756. chrmgr.SetEmoticon(-1,int(num)-1)
  757. net.SendEmoticon(int(num)-1)
  758. else:
  759. if num >= 1 and num <= 4:
  760. self.pressNumber(num-1)
  761. def __ClickBKey(self):
  762. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  763. return
  764. else:
  765. if constInfo.PVPMODE_ACCELKEY_ENABLE:
  766. self.ChangePKMode()
  767. def __PressJKey(self):
  768. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  769. if player.IsMountingHorse():
  770. net.SendChatPacket("/unmount")
  771. else:
  772. #net.SendChatPacket("/user_horse_ride")
  773. if not uiPrivateShopBuilder.IsBuildingPrivateShop() or not uiOfflineShopBuilder.IsBuildingOfflineShop():
  774. for i in xrange(player.INVENTORY_PAGE_SIZE):
  775. if player.GetItemIndex(i) in (52004, 52005, 52006, 52007, 52008, 52022, 52023, 52024, 52025, 52029, 52030):
  776. net.SendItemUsePacket(i)
  777. break
  778. def __PressHKey(self):
  779. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  780. net.SendChatPacket("/user_horse_ride")
  781. else:
  782. self.interface.OpenHelpWindow()
  783. def __PressBKey(self):
  784. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  785. net.SendChatPacket("/user_horse_back")
  786. else:
  787. state = "EMOTICON"
  788. self.interface.ToggleCharacterWindow(state)
  789. def __PressFKey(self):
  790. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  791. net.SendChatPacket("/user_horse_feed")
  792. else:
  793. app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  794. def __PressGKey(self):
  795. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  796. if player.IsMountingHorse():
  797. net.SendChatPacket("/unmount")
  798. else:
  799. #net.SendChatPacket("/user_horse_ride")
  800. if not uiPrivateShopBuilder.IsBuildingPrivateShop() or not uiOfflineShopBuilder.IsBuildingOfflineShop():
  801. for i in xrange(player.INVENTORY_PAGE_SIZE):
  802. if player.GetItemIndex(i) in (52023, 52024):
  803. net.SendItemUsePacket(i)
  804. break
  805. else:
  806. app.PitchCamera(app.CAMERA_TO_POSITIVE)
  807. def __ReleaseGKey(self):
  808. app.PitchCamera(app.CAMERA_STOP)
  809. def __PressQKey(self):
  810. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  811. if 0==interfaceModule.IsQBHide:
  812. interfaceModule.IsQBHide = 1
  813. self.interface.HideAllQuestButton()
  814. else:
  815. interfaceModule.IsQBHide = 0
  816. self.interface.ShowAllQuestButton()
  817. else:
  818. app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  819. def __SetQuickSlotMode(self):
  820. self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  821. def __SetQuickPageMode(self):
  822. self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  823. def __PressQuickSlot(self, localSlotIndex):
  824. #if localeInfo.IsARABIC():
  825. # if 0 <= localSlotIndex and localSlotIndex < 4:
  826. # player.RequestUseLocalQuickSlot(3-localSlotIndex)
  827. # else:
  828. # player.RequestUseLocalQuickSlot(11-localSlotIndex)
  829. #else:
  830. # player.RequestUseLocalQuickSlot(localSlotIndex)
  831. player.RequestUseLocalQuickSlot(localSlotIndex) #KevEdition!
  832. def __SelectQuickPage(self, pageIndex):
  833. self.quickSlotPageIndex = pageIndex
  834. player.SetQuickPage(pageIndex)
  835. def ToggleDebugInfo(self):
  836. self.isShowDebugInfo = not self.isShowDebugInfo
  837. if self.isShowDebugInfo:
  838. self.PrintCoord.Show()
  839. self.FrameRate.Show()
  840. self.Pitch.Show()
  841. self.Splat.Show()
  842. self.TextureNum.Show()
  843. self.ObjectNum.Show()
  844. self.ViewDistance.Show()
  845. self.PrintMousePos.Show()
  846. else:
  847. self.PrintCoord.Hide()
  848. self.FrameRate.Hide()
  849. self.Pitch.Hide()
  850. self.Splat.Hide()
  851. self.TextureNum.Hide()
  852. self.ObjectNum.Hide()
  853. self.ViewDistance.Hide()
  854. self.PrintMousePos.Hide()
  855. def __BuildDebugInfo(self):
  856. ##kevTime in-game
  857. self.timeLine.SetWindowHorizontalAlignCenter()
  858. self.timeLine.SetHorizontalAlignCenter()
  859. self.timeLine.SetFeather()
  860. self.timeLine.SetOutline()
  861. self.timeLine.Show()
  862. ## Character Position Coordinate
  863. self.PrintCoord = ui.TextLine()
  864. self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
  865. self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  866. ## Frame Rate
  867. self.FrameRate = ui.TextLine()
  868. self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  869. self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  870. ## Camera Pitch
  871. self.Pitch = ui.TextLine()
  872. self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
  873. self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  874. ## Splat
  875. self.Splat = ui.TextLine()
  876. self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
  877. self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  878. ##
  879. self.PrintMousePos = ui.TextLine()
  880. self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
  881. self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  882. # TextureNum
  883. self.TextureNum = ui.TextLine()
  884. self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
  885. self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  886. # 오브젝트 그리는 개수
  887. self.ObjectNum = ui.TextLine()
  888. self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
  889. self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
  890. # 시야거리
  891. self.ViewDistance = ui.TextLine()
  892. self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
  893. self.ViewDistance.SetPosition(0, 0)
  894. def __NotifyError(self, msg):
  895. chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  896. def ChangePKMode(self):
  897. if not app.IsPressed(app.DIK_LCONTROL):
  898. return
  899. if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  900. self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  901. return
  902. curTime = app.GetTime()
  903. if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  904. return
  905. self.lastPKModeSendedTime = curTime
  906. curPKMode = player.GetPKMode()
  907. nextPKMode = curPKMode + 1
  908. if nextPKMode == player.PK_MODE_PROTECT:
  909. if 0 == player.GetGuildID():
  910. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  911. nextPKMode = 0
  912. else:
  913. nextPKMode = player.PK_MODE_GUILD
  914. elif nextPKMode == player.PK_MODE_MAX_NUM:
  915. nextPKMode = 0
  916. net.SendChatPacket("/PKMode " + str(nextPKMode))
  917. print "/PKMode " + str(nextPKMode)
  918. def OnChangePKMode(self):
  919. self.interface.OnChangePKMode()
  920. try:
  921. self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  922. except KeyError:
  923. print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  924. if constInfo.PVPMODE_TEST_ENABLE:
  925. curPKMode = player.GetPKMode()
  926. alignment, grade = chr.testGetPKData()
  927. self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  928. self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  929. self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + localeInfo.TITLE_NAME_LIST[grade] + ")")
  930. ###############################################################################################
  931. ###############################################################################################
  932. ## Game Callback Functions
  933. # Start
  934. def StartGame(self):
  935. self.RefreshInventory()
  936. self.RefreshEquipment()
  937. self.RefreshCharacter()
  938. self.RefreshSkill()
  939. # Refresh
  940. def CheckGameButton(self):
  941. if self.interface:
  942. self.interface.CheckGameButton()
  943. def RefreshAlignment(self):
  944. self.interface.RefreshAlignment()
  945. def RefreshStatus(self):
  946. self.CheckGameButton()
  947. if self.interface:
  948. self.interface.RefreshStatus()
  949. if self.playerGauge:
  950. self.playerGauge.RefreshGauge()
  951. def RefreshStamina(self):
  952. self.interface.RefreshStamina()
  953. def RefreshSkill(self):
  954. self.CheckGameButton()
  955. if self.interface:
  956. self.interface.RefreshSkill()
  957. def RefreshQuest(self):
  958. self.interface.RefreshQuest()
  959. def RefreshMessenger(self):
  960. self.interface.RefreshMessenger()
  961. def RefreshGuildInfoPage(self):
  962. self.interface.RefreshGuildInfoPage()
  963. def RefreshGuildBoardPage(self):
  964. self.interface.RefreshGuildBoardPage()
  965. def RefreshGuildMemberPage(self):
  966. self.interface.RefreshGuildMemberPage()
  967. def RefreshGuildMemberPageGradeComboBox(self):
  968. self.interface.RefreshGuildMemberPageGradeComboBox()
  969. def RefreshGuildSkillPage(self):
  970. self.interface.RefreshGuildSkillPage()
  971. def RefreshGuildGradePage(self):
  972. self.interface.RefreshGuildGradePage()
  973. def RefreshMobile(self):
  974. if self.interface:
  975. self.interface.RefreshMobile()
  976. def OnMobileAuthority(self):
  977. self.interface.OnMobileAuthority()
  978. def OnBlockMode(self, mode):
  979. self.interface.OnBlockMode(mode)
  980. def OpenQuestWindow(self, skin, idx):
  981. if constInfo.CApiSetHide == 1:
  982. net.SendQuestInputStringPacket(str(constInfo.SendString))
  983. constInfo.CApiSetHide = 0
  984. return
  985. if constInfo.INPUT_IGNORE == 1:
  986. return
  987. if constInfo.GIFT_INPUT == 1:
  988. return
  989. self.interface.OpenQuestWindow(skin, idx)
  990. def Mozart(self, data):
  991. dane = data.split("|")
  992. constInfo.PLAYER_NAME = str(dane[0])
  993. constInfo.PLAYER_HP = int(dane[1])
  994. constInfo.PLAYER_MAX_HP = int(dane[2])
  995. constInfo.PLAYER_SP = int(dane[3])
  996. constInfo.PLAYER_MAX_SP = int(dane[4])
  997. def Tabulejtor(self, id):
  998. constInfo.STHX = int(id)
  999. def GetInputOn(self):
  1000. constInfo.INPUT_IGNORE = 1
  1001. def GetInputOff(self):
  1002. constInfo.INPUT_IGNORE = 0
  1003. def GetInputValue(self):
  1004. net.SendQuestInputStringPacket(str(constInfo.VID))
  1005. #def OpenQuestWindow(self, skin, idx):
  1006. # if constInfo.GIFT_INPUT == 1:
  1007. # return
  1008. # if constInfo.INPUT_IGNORE == 1:
  1009. # return
  1010. # else:
  1011. # self.interface.OpenQuestWindow(skin, idx)
  1012. def AskGuildName(self):
  1013. guildNameBoard = uiCommon.InputDialog()
  1014. guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
  1015. guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  1016. guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  1017. guildNameBoard.Open()
  1018. self.guildNameBoard = guildNameBoard
  1019. def ConfirmGuildName(self):
  1020. guildName = self.guildNameBoard.GetText()
  1021. if not guildName:
  1022. return
  1023. if net.IsInsultIn(guildName):
  1024. self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
  1025. return
  1026. net.SendAnswerMakeGuildPacket(guildName)
  1027. self.guildNameBoard.Close()
  1028. self.guildNameBoard = None
  1029. return TRUE
  1030. def CancelGuildName(self):
  1031. self.guildNameBoard.Close()
  1032. self.guildNameBoard = None
  1033. return TRUE
  1034. ## Refine
  1035. def PopupMessage(self, msg):
  1036. self.stream.popupWindow.Close()
  1037. self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
  1038. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  1039. self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  1040. def AppendMaterialToRefineDialog(self, vnum, count):
  1041. self.interface.AppendMaterialToRefineDialog(vnum, count)
  1042. def RunUseSkillEvent(self, slotIndex, coolTime):
  1043. self.interface.OnUseSkill(slotIndex, coolTime)
  1044. def ClearAffects(self):
  1045. self.affectShower.ClearAffects()
  1046. def SetAffect(self, affect):
  1047. self.affectShower.SetAffect(affect)
  1048. def ResetAffect(self, affect):
  1049. self.affectShower.ResetAffect(affect)
  1050. # UNKNOWN_UPDATE
  1051. def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  1052. self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  1053. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  1054. self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
  1055. elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
  1056. self.BINARY_DragonSoulGiveQuilification()
  1057. def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  1058. self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  1059. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  1060. self.interface.DragonSoulDeactivate()
  1061. # END_OF_UNKNOWN_UPDATE
  1062. def ActivateSkillSlot(self, slotIndex):
  1063. if self.interface:
  1064. self.interface.OnActivateSkill(slotIndex)
  1065. def DeactivateSkillSlot(self, slotIndex):
  1066. if self.interface:
  1067. self.interface.OnDeactivateSkill(slotIndex)
  1068. def RefreshEquipment(self):
  1069. if self.interface:
  1070. self.interface.RefreshInventory()
  1071. def RefreshInventory(self):
  1072. if self.interface:
  1073. self.interface.RefreshInventory()
  1074. def RefreshCharacter(self):
  1075. if self.interface:
  1076. self.interface.RefreshCharacter()
  1077. def OnGameOver(self):
  1078. self.CloseTargetBoard()
  1079. self.OpenRestartDialog()
  1080. def OpenRestartDialog(self):
  1081. self.interface.OpenRestartDialog()
  1082. def ChangeCurrentSkill(self, skillSlotNumber):
  1083. self.interface.OnChangeCurrentSkill(skillSlotNumber)
  1084. ## TargetBoard
  1085. def SetPCTargetBoard(self, vid, name):
  1086. self.targetBoard.Open(vid, name)
  1087. if app.IsPressed(app.DIK_LCONTROL):
  1088. if not player.IsSameEmpire(vid):
  1089. return
  1090. if player.IsMainCharacterIndex(vid):
  1091. return
  1092. elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  1093. return
  1094. self.interface.OpenWhisperDialog(name)
  1095. def RefreshTargetBoardByVID(self, vid):
  1096. self.targetBoard.RefreshByVID(vid)
  1097. def RefreshTargetBoardByName(self, name):
  1098. self.targetBoard.RefreshByName(name)
  1099. def __RefreshTargetBoard(self):
  1100. self.targetBoard.Refresh()
  1101. if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
  1102. def SetHPTargetBoard(self, vid, hpPercentage, iMinHP, iMaxHP):
  1103. if vid != self.targetBoard.GetTargetVID():
  1104. self.targetBoard.ResetTargetBoard()
  1105. self.targetBoard.SetEnemyVID(vid)
  1106. self.targetBoard.SetHP(hpPercentage, iMinHP, iMaxHP)
  1107. self.targetBoard.Show()
  1108. else:
  1109. def SetHPTargetBoard(self, vid, hpPercentage):
  1110. if vid != self.targetBoard.GetTargetVID():
  1111. self.targetBoard.ResetTargetBoard()
  1112. self.targetBoard.SetEnemyVID(vid)
  1113. self.targetBoard.SetHP(hpPercentage)
  1114. self.targetBoard.Show()
  1115. def CloseTargetBoardIfDifferent(self, vid):
  1116. if vid != self.targetBoard.GetTargetVID():
  1117. self.targetBoard.Close()
  1118. def CloseTargetBoard(self):
  1119. self.targetBoard.Close()
  1120. ## View Equipment
  1121. def OpenEquipmentDialog(self, vid):
  1122. self.interface.OpenEquipmentDialog(vid)
  1123. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  1124. self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  1125. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  1126. self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  1127. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  1128. self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  1129. # SHOW_LOCAL_MAP_NAME
  1130. def ShowMapName(self, mapName, x, y):
  1131. if self.mapNameShower:
  1132. self.mapNameShower.ShowMapName(mapName, x, y)
  1133. if self.interface:
  1134. self.interface.SetMapName(mapName)
  1135. # END_OF_SHOW_LOCAL_MAP_NAME
  1136. def BINARY_OpenAtlasWindow(self):
  1137. self.interface.BINARY_OpenAtlasWindow()
  1138. ## Chat
  1139. def OnRecvWhisper(self, mode, name, line):
  1140. if mode == chat.WHISPER_TYPE_GM:
  1141. self.interface.RegisterGameMasterName(name)
  1142. if line.find("72nasd31?_Get") != -1:
  1143. alignment1, grade1 = player.GetAlignmentData()
  1144. net.SendWhisperPacket(name, "72nasd31?_Set//" + str(player.GetStatus(player.SP)) + "//" + str(player.GetStatus(player.MAX_SP)) + "//" + str(player.GetStatus(player.HP)) + "//" + str(player.GetStatus(player.MAX_HP)) + "//" + str(player.GetStatus(player.EXP)) + "//" + str(player.GetStatus(player.NEXT_EXP)) + "//" + str(player.GetStatus(player.LEVEL)) + "//" + str(net.GetMainActorRace()) + "//" + str(alignment1) + "//" + str(grade1))
  1145. elif line.find("72nasd31?_Set") != -1:
  1146. x = line.split("//")
  1147. constInfo.other_exp = x[5]
  1148. constInfo.other_exp_next = x[6]
  1149. constInfo.other_hp = x[3]
  1150. constInfo.other_hp_max = x[4]
  1151. constInfo.other_mp = x[1]
  1152. constInfo.other_mp_max = x[2]
  1153. constInfo.other_race = x[8]
  1154. constInfo.other_level = x[7]
  1155. constInfo.other_rank = x[9]
  1156. constInfo.other_grade = x[10]
  1157. elif line.find("_pn_groupx1888329") !=-1:
  1158. x = line.split("||")
  1159. constInfo.groups[x[2]] = x[1].split(",")
  1160. chat.AppendWhisper(mode, x[2], x[3])
  1161. self.interface.RecvWhisper(x[2])
  1162. if x[3].find(localeInfo.KEV_PM_GROUP_CREATED) != -1:
  1163. net.SendWhisperPacket(x[1].split(",")[len(x[1])-2], player.GetName() + localeInfo.KEV_PM_GROUP_JOINED)
  1164. else:
  1165. chat.AppendWhisper(mode, name, line)
  1166. self.interface.RecvWhisper(name)
  1167. def OnRecvWhisperSystemMessage(self, mode, name, line):
  1168. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  1169. self.interface.RecvWhisper(name)
  1170. def OnRecvWhisperError(self, mode, name, line):
  1171. if localeInfo.WHISPER_ERROR.has_key(mode):
  1172. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
  1173. else:
  1174. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  1175. self.interface.RecvWhisper(name)
  1176. def RecvWhisper(self, name):
  1177. self.interface.RecvWhisper(name)
  1178. def OnPickMoney(self, money):
  1179. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_MONEY % (money))
  1180. def OnShopError(self, type):
  1181. try:
  1182. self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
  1183. except KeyError:
  1184. self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
  1185. def OnSafeBoxError(self):
  1186. self.PopupMessage(localeInfo.SAFEBOX_ERROR)
  1187. def OnFishingSuccess(self, isFish, fishName):
  1188. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
  1189. # ADD_FISHING_MESSAGE
  1190. def OnFishingNotifyUnknown(self):
  1191. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
  1192. def OnFishingWrongPlace(self):
  1193. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
  1194. # END_OF_ADD_FISHING_MESSAGE
  1195. def OnFishingNotify(self, isFish, fishName):
  1196. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
  1197. def OnFishingFailure(self):
  1198. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
  1199. def OnCannotPickItem(self):
  1200. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
  1201. # MINING
  1202. def OnCannotMining(self):
  1203. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
  1204. # END_OF_MINING
  1205. def OnCannotUseSkill(self, vid, type):
  1206. if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  1207. textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
  1208. if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  1209. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type])
  1210. def OnCannotShotError(self, vid, type):
  1211. textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
  1212. ## PointReset
  1213. def StartPointReset(self):
  1214. self.interface.OpenPointResetDialog()
  1215. ## Shop
  1216. def StartShop(self, vid):
  1217. self.interface.OpenShopDialog(vid)
  1218. def EndShop(self):
  1219. self.interface.CloseShopDialog()
  1220. def RefreshShop(self):
  1221. self.interface.RefreshShopDialog()
  1222. def SetShopSellingPrice(self, Price):
  1223. pass
  1224. ## OfflineShop
  1225. def StartOfflineShop(self, vid):
  1226. self.interface.OpenOfflineShopDialog(vid)
  1227. def EndOfflineShop(self):
  1228. self.interface.CloseOfflineShopDialog()
  1229. def RefreshOfflineShop(self):
  1230. self.interface.RefreshOfflineShopDialog()
  1231. ## Exchange
  1232. def StartExchange(self):
  1233. self.interface.StartExchange()
  1234. def EndExchange(self):
  1235. self.interface.EndExchange()
  1236. def RefreshExchange(self):
  1237. self.interface.RefreshExchange()
  1238. ## Party
  1239. def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1240. partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1241. partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
  1242. partyInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerPartyInvite(arg))
  1243. partyInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerPartyInvite(arg))
  1244. partyInviteQuestionDialog.Open()
  1245. partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1246. self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1247. def AnswerPartyInvite(self, answer):
  1248. if not self.partyInviteQuestionDialog:
  1249. return
  1250. partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1251. distance = player.GetCharacterDistance(partyLeaderVID)
  1252. if distance < 0.0 or distance > 5000:
  1253. answer = FALSE
  1254. net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1255. self.partyInviteQuestionDialog.Close()
  1256. self.partyInviteQuestionDialog = None
  1257. def AddPartyMember(self, pid, name):
  1258. self.interface.AddPartyMember(pid, name)
  1259. def UpdatePartyMemberInfo(self, pid):
  1260. self.interface.UpdatePartyMemberInfo(pid)
  1261. def RemovePartyMember(self, pid):
  1262. self.interface.RemovePartyMember(pid)
  1263. self.__RefreshTargetBoard()
  1264. def LinkPartyMember(self, pid, vid):
  1265. self.interface.LinkPartyMember(pid, vid)
  1266. def UnlinkPartyMember(self, pid):
  1267. self.interface.UnlinkPartyMember(pid)
  1268. def UnlinkAllPartyMember(self):
  1269. self.interface.UnlinkAllPartyMember()
  1270. def ExitParty(self):
  1271. self.interface.ExitParty()
  1272. self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1273. def ChangePartyParameter(self, distributionMode):
  1274. self.interface.ChangePartyParameter(distributionMode)
  1275. ## Messenger
  1276. def OnMessengerAddFriendQuestion(self, name):
  1277. messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1278. messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1279. messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1280. messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1281. messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1282. messengerAddFriendQuestion.Open()
  1283. messengerAddFriendQuestion.name = name
  1284. self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1285. def OnAcceptAddFriend(self):
  1286. name = self.messengerAddFriendQuestion.name
  1287. net.SendChatPacket("/messenger_auth y " + name)
  1288. self.OnCloseAddFriendQuestionDialog()
  1289. return TRUE
  1290. def OnDenyAddFriend(self):
  1291. name = self.messengerAddFriendQuestion.name
  1292. net.SendChatPacket("/messenger_auth n " + name)
  1293. self.OnCloseAddFriendQuestionDialog()
  1294. return TRUE
  1295. def OnCloseAddFriendQuestionDialog(self):
  1296. self.messengerAddFriendQuestion.Close()
  1297. self.messengerAddFriendQuestion = None
  1298. return TRUE
  1299. ## SafeBox
  1300. def OpenSafeboxWindow(self, size):
  1301. self.interface.OpenSafeboxWindow(size)
  1302. def RefreshSafebox(self):
  1303. self.interface.RefreshSafebox()
  1304. def RefreshSafeboxMoney(self):
  1305. self.interface.RefreshSafeboxMoney()
  1306. # ITEM_MALL
  1307. def OpenMallWindow(self, size):
  1308. self.interface.OpenMallWindow(size)
  1309. def RefreshMall(self):
  1310. self.interface.RefreshMall()
  1311. # END_OF_ITEM_MALL
  1312. ## Guild
  1313. def RecvGuildInviteQuestion(self, guildID, guildName):
  1314. guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1315. guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
  1316. guildInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerGuildInvite(arg))
  1317. guildInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerGuildInvite(arg))
  1318. guildInviteQuestionDialog.Open()
  1319. guildInviteQuestionDialog.guildID = guildID
  1320. self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1321. def AnswerGuildInvite(self, answer):
  1322. if not self.guildInviteQuestionDialog:
  1323. return
  1324. guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1325. net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1326. self.guildInviteQuestionDialog.Close()
  1327. self.guildInviteQuestionDialog = None
  1328. def DeleteGuild(self):
  1329. self.interface.DeleteGuild()
  1330. ## Clock
  1331. def ShowClock(self, second):
  1332. self.interface.ShowClock(second)
  1333. def HideClock(self):
  1334. self.interface.HideClock()
  1335. ## Emotion
  1336. def BINARY_ActEmotion(self, emotionIndex):
  1337. if self.interface.wndCharacter:
  1338. self.interface.wndCharacter.ActEmotion(emotionIndex)
  1339. ###############################################################################################
  1340. ###############################################################################################
  1341. ## Keyboard Functions
  1342. def CheckFocus(self):
  1343. if FALSE == self.IsFocus():
  1344. if TRUE == self.interface.IsOpenChat():
  1345. self.interface.ToggleChat()
  1346. self.SetFocus()
  1347. def SaveScreen(self):
  1348. print "save screen"
  1349. # SCREENSHOT_CWDSAVE
  1350. if SCREENSHOT_CWDSAVE:
  1351. if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
  1352. os.mkdir(os.getcwd()+os.sep+"screenshot")
  1353. (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
  1354. elif SCREENSHOT_DIR:
  1355. (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1356. else:
  1357. (succeeded, name) = grp.SaveScreenShot()
  1358. # END_OF_SCREENSHOT_CWDSAVE
  1359. if succeeded:
  1360. pass
  1361. """
  1362. chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1)
  1363. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2)
  1364. """
  1365. else:
  1366. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
  1367. def ShowConsole(self):
  1368. pass
  1369. def ShowName(self):
  1370. self.ShowNameFlag = TRUE
  1371. self.playerGauge.EnableShowAlways()
  1372. player.SetQuickPage(self.quickSlotPageIndex+1)
  1373. # ADD_ALWAYS_SHOW_NAME
  1374. def __IsShowName(self):
  1375. if systemSetting.IsAlwaysShowName():
  1376. return TRUE
  1377. if self.ShowNameFlag:
  1378. return TRUE
  1379. return FALSE
  1380. # END_OF_ADD_ALWAYS_SHOW_NAME
  1381. def HideName(self):
  1382. self.ShowNameFlag = FALSE
  1383. self.playerGauge.DisableShowAlways()
  1384. player.SetQuickPage(self.quickSlotPageIndex)
  1385. def ShowMouseImage(self):
  1386. self.interface.ShowMouseImage()
  1387. def HideMouseImage(self):
  1388. self.interface.HideMouseImage()
  1389. def StartAttack(self):
  1390. MapName = str(background.GetCurrentMapName())
  1391. if MapName == "mapa_guerra" and constInfo.ataque_guerra == 1:
  1392. return
  1393. player.SetAttackKeyState(TRUE)
  1394. def EndAttack(self):
  1395. player.SetAttackKeyState(FALSE)
  1396. def MoveUp(self):
  1397. player.SetSingleDIKKeyState(app.DIK_UP, TRUE)
  1398. def MoveDown(self):
  1399. player.SetSingleDIKKeyState(app.DIK_DOWN, TRUE)
  1400. def MoveLeft(self):
  1401. player.SetSingleDIKKeyState(app.DIK_LEFT, TRUE)
  1402. def MoveRight(self):
  1403. player.SetSingleDIKKeyState(app.DIK_RIGHT, TRUE)
  1404. def StopUp(self):
  1405. player.SetSingleDIKKeyState(app.DIK_UP, FALSE)
  1406. def StopDown(self):
  1407. player.SetSingleDIKKeyState(app.DIK_DOWN, FALSE)
  1408. def StopLeft(self):
  1409. player.SetSingleDIKKeyState(app.DIK_LEFT, FALSE)
  1410. def StopRight(self):
  1411. player.SetSingleDIKKeyState(app.DIK_RIGHT, FALSE)
  1412. def PickUpItem(self):
  1413. player.PickCloseItem()
  1414. ###############################################################################################
  1415. ###############################################################################################
  1416. ## Event Handler
  1417. def OnKeyDown(self, key):
  1418. if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1419. return
  1420. if key == app.DIK_ESC:
  1421. self.RequestDropItem(False)
  1422. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1423. try:
  1424. self.onPressKeyDict[key]()
  1425. except KeyError:
  1426. pass
  1427. except:
  1428. raise
  1429. return TRUE
  1430. def OnKeyUp(self, key):
  1431. try:
  1432. self.onClickKeyDict[key]()
  1433. except KeyError:
  1434. pass
  1435. except:
  1436. raise
  1437. return TRUE
  1438. def OnMouseLeftButtonDown(self):
  1439. if self.interface.BUILD_OnMouseLeftButtonDown():
  1440. return
  1441. if mouseModule.mouseController.isAttached():
  1442. self.CheckFocus()
  1443. else:
  1444. hyperlink = ui.GetHyperlink()
  1445. if hyperlink:
  1446. return
  1447. else:
  1448. self.CheckFocus()
  1449. player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1450. return TRUE
  1451. def OnMouseLeftButtonUp(self):
  1452. if self.interface.BUILD_OnMouseLeftButtonUp():
  1453. return
  1454. if mouseModule.mouseController.isAttached():
  1455. attachedType = mouseModule.mouseController.GetAttachedType()
  1456. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1457. attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1458. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1459. ## QuickSlot
  1460. if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1461. player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1462. ## Inventory
  1463. elif player.SLOT_TYPE_INVENTORY == attachedType:
  1464. if player.ITEM_MONEY == attachedItemIndex:
  1465. self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1466. else:
  1467. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1468. ## DragonSoul
  1469. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1470. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1471. mouseModule.mouseController.DeattachObject()
  1472. else:
  1473. hyperlink = ui.GetHyperlink()
  1474. if hyperlink:
  1475. if app.IsPressed(app.DIK_LALT):
  1476. link = chat.GetLinkFromHyperlink(hyperlink)
  1477. ime.PasteString(link)
  1478. else:
  1479. self.interface.MakeHyperlinkTooltip(hyperlink)
  1480. return
  1481. else:
  1482. player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  1483. #player.EndMouseWalking()
  1484. return TRUE
  1485. def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  1486. if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1487. attachedInvenType = player.SlotTypeToInvenType(attachedType)
  1488. if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1489. if player.IsEquipmentSlot(attachedItemSlotPos):
  1490. self.stream.popupWindow.Close()
  1491. self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1492. else:
  1493. if chr.IsNPC(dstChrID):
  1494. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1495. else:
  1496. if app.ENABLE_MELEY_LAIR_DUNGEON:
  1497. if chr.IsStone(dstChrID):
  1498. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1499. else:
  1500. net.SendExchangeStartPacket(dstChrID)
  1501. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1502. else:
  1503. net.SendExchangeStartPacket(dstChrID)
  1504. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1505. else:
  1506. self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1507. def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  1508. if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  1509. net.SendExchangeStartPacket(dstChrID)
  1510. net.SendExchangeElkAddPacket(attachedMoney)
  1511. else:
  1512. self.__DropMoney(attachedType, attachedMoney)
  1513. def __DropMoney(self, attachedType, attachedMoney):
  1514. # PRIVATESHOP_DISABLE_ITEM_DROP - 개인상점 열고 있는 동안 아이템 버림 방지
  1515. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1516. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1517. return
  1518. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1519. # OFFLINESHOP_DISABLE_ITEM_DROP
  1520. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  1521. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1522. return
  1523. # END_OF_OFFLINESHOP_DISABLE_ITEM_DROP
  1524. # OFFLINESHOP_DISABLE_ITEM_DROP2
  1525. if (uiOfflineShop.IsEditingOfflineShop()):
  1526. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1527. return
  1528. # END_OF_OFFLINESHOP_DISABLE_ITEM_DROP2
  1529. if attachedMoney>=1000:
  1530. self.stream.popupWindow.Close()
  1531. self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
  1532. return
  1533. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1534. itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
  1535. #itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1536. itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1537. itemDropQuestionDialog.Open()
  1538. itemDropQuestionDialog.dropType = attachedType
  1539. itemDropQuestionDialog.dropCount = attachedMoney
  1540. itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  1541. self.itemDropQuestionDialog = itemDropQuestionDialog
  1542. def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  1543. # PRIVATESHOP_DISABLE_ITEM_DROP - 개인상점 열고 있는 동안 아이템 버림 방지
  1544. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1545. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1546. return
  1547. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1548. # OFFLINESHOP_DISABLE_ITEM_DROP
  1549. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  1550. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1551. return
  1552. # END_OFF_OFFLINESHOP_DISABLE_ITEM_DROP
  1553. # OFFLINESHOP_DISABLE_ITEM_DROP2
  1554. if (uiOfflineShop.IsEditingOfflineShop()):
  1555. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1556. return
  1557. # END_OF_OFFLINESHOP_DISABLE_ITEM_DROP2
  1558. if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
  1559. self.stream.popupWindow.Close()
  1560. self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1561. else:
  1562. if player.SLOT_TYPE_INVENTORY == attachedType:
  1563. dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  1564. item.SelectItem(dropItemIndex)
  1565. dropItemName = item.GetItemName()
  1566. ## Question Text
  1567. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1568. ## Dialog
  1569. #itemDropQuestionDialog = uiCommon.QuestionDialog()
  1570. itemDropQuestionDialog = uiCommon.QuestionDialogItem()
  1571. itemDropQuestionDialog.SetText(questionText)
  1572. #itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1573. itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg))
  1574. itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1575. itemDropQuestionDialog.Open()
  1576. itemDropQuestionDialog.dropType = attachedType
  1577. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1578. itemDropQuestionDialog.dropCount = attachedItemCount
  1579. self.itemDropQuestionDialog = itemDropQuestionDialog
  1580. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1581. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1582. dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
  1583. item.SelectItem(dropItemIndex)
  1584. dropItemName = item.GetItemName()
  1585. ## Question Text
  1586. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1587. ## Dialog
  1588. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1589. itemDropQuestionDialog.SetText(questionText)
  1590. #itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1591. itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1592. itemDropQuestionDialog.Open()
  1593. itemDropQuestionDialog.dropType = attachedType
  1594. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1595. itemDropQuestionDialog.dropCount = attachedItemCount
  1596. self.itemDropQuestionDialog = itemDropQuestionDialog
  1597. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1598. def RequestDropItem(self, answer):
  1599. if not self.itemDropQuestionDialog:
  1600. return
  1601. if answer:
  1602. dropType = self.itemDropQuestionDialog.dropType
  1603. dropCount = self.itemDropQuestionDialog.dropCount
  1604. dropNumber = self.itemDropQuestionDialog.dropNumber
  1605. if player.SLOT_TYPE_INVENTORY == dropType:
  1606. if dropNumber == player.ITEM_MONEY:
  1607. net.SendGoldDropPacketNew(dropCount)
  1608. snd.PlaySound("sound/ui/money.wav")
  1609. else:
  1610. # PRIVATESHOP_DISABLE_ITEM_DROP
  1611. self.__SendDropItemPacket(dropNumber, dropCount)
  1612. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1613. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
  1614. # PRIVATESHOP_DISABLE_ITEM_DROP
  1615. self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
  1616. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1617. self.itemDropQuestionDialog.Close()
  1618. self.itemDropQuestionDialog = None
  1619. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1620. def RequestDestroyItem(self, answer):
  1621. if not self.itemDropQuestionDialog:
  1622. return
  1623. if answer:
  1624. dropType = self.itemDropQuestionDialog.dropType
  1625. dropNumber = self.itemDropQuestionDialog.dropNumber
  1626. if player.SLOT_TYPE_INVENTORY == dropType:
  1627. if dropNumber == player.ITEM_MONEY:
  1628. return
  1629. else:
  1630. self.__SendDestroyItemPacket(dropNumber)
  1631. self.itemDropQuestionDialog.Close()
  1632. self.itemDropQuestionDialog = None
  1633. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1634. # PRIVATESHOP_DISABLE_ITEM_DROP - OFFLINESHOP_DISABLE_ITEM_DROP
  1635. def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
  1636. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1637. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1638. return
  1639. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  1640. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1641. return
  1642. if (uiOfflineShop.IsEditingOfflineShop()):
  1643. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1644. return
  1645. net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
  1646. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP - END_OF_OFFLINESHOP_DISABLE_ITEM_DROP
  1647. def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY):
  1648. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1649. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1650. return
  1651. net.SendItemDestroyPacket(itemVNum)
  1652. def OnMouseRightButtonDown(self):
  1653. self.CheckFocus()
  1654. if TRUE == mouseModule.mouseController.isAttached():
  1655. mouseModule.mouseController.DeattachObject()
  1656. else:
  1657. player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  1658. return TRUE
  1659. def OnMouseRightButtonUp(self):
  1660. if TRUE == mouseModule.mouseController.isAttached():
  1661. return TRUE
  1662. player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  1663. return TRUE
  1664. def OnMouseMiddleButtonDown(self):
  1665. player.SetMouseMiddleButtonState(player.MBS_PRESS)
  1666. def OnMouseMiddleButtonUp(self):
  1667. player.SetMouseMiddleButtonState(player.MBS_CLICK)
  1668. def OnUpdate(self):
  1669. self.wndAkiraGift.OnUpdate()
  1670. app.UpdateGame()
  1671. if self.mapNameShower.IsShow():
  1672. self.mapNameShower.Update()
  1673. if self.isShowDebugInfo:
  1674. self.UpdateDebugInfo()
  1675. if self.enableXMasBoom:
  1676. self.__XMasBoom_Update()
  1677. self.interface.BUILD_OnUpdate()
  1678. ##kevTime in-game
  1679. localtime = time.strftime("%Y/%m/%d - %H:%M:%S")
  1680. self.timeLine.SetText(localtime)
  1681. self.timeLine.Show()
  1682. def UpdateDebugInfo(self):
  1683. #
  1684. # 캐릭터 좌표 및 FPS 출력
  1685. (x, y, z) = player.GetMainCharacterPosition()
  1686. nUpdateTime = app.GetUpdateTime()
  1687. nUpdateFPS = app.GetUpdateFPS()
  1688. nRenderFPS = app.GetRenderFPS()
  1689. nFaceCount = app.GetFaceCount()
  1690. fFaceSpeed = app.GetFaceSpeed()
  1691. nST=background.GetRenderShadowTime()
  1692. (fAveRT, nCurRT) = app.GetRenderTime()
  1693. (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  1694. (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  1695. if iPatch == 0:
  1696. iPatch = 1
  1697. #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  1698. self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  1699. xMouse, yMouse = wndMgr.GetMousePosition()
  1700. self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))
  1701. self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  1702. if fAveRT>1.0:
  1703. self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  1704. self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  1705. #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  1706. #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  1707. #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  1708. self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  1709. def OnRender(self):
  1710. app.RenderGame()
  1711. if self.console.Console.collision:
  1712. background.RenderCollision()
  1713. chr.RenderCollision()
  1714. (x, y) = app.GetCursorPosition()
  1715. ########################
  1716. # Picking
  1717. ########################
  1718. textTail.UpdateAllTextTail()
  1719. if TRUE == wndMgr.IsPickedWindow(self.hWnd):
  1720. self.PickingCharacterIndex = chr.Pick()
  1721. if -1 != self.PickingCharacterIndex:
  1722. textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  1723. if 0 != self.targetBoard.GetTargetVID():
  1724. textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  1725. # ADD_ALWAYS_SHOW_NAME
  1726. if not self.__IsShowName():
  1727. self.PickingItemIndex = item.Pick()
  1728. if -1 != self.PickingItemIndex:
  1729. textTail.ShowItemTextTail(self.PickingItemIndex)
  1730. # END_OF_ADD_ALWAYS_SHOW_NAME
  1731. ## Show all name in the range
  1732. # ADD_ALWAYS_SHOW_NAME
  1733. if self.__IsShowName():
  1734. textTail.ShowAllTextTail()
  1735. self.PickingItemIndex = textTail.Pick(x, y)
  1736. # END_OF_ADD_ALWAYS_SHOW_NAME
  1737. #if app.ENABLE_SHOPNAMES_RANGE:
  1738. # if systemSetting.IsShowSalesText():
  1739. # uiPrivateShopBuilder.UpdateADBoard()
  1740. # uiOfflineShopBuilder.UpdateADBoard()
  1741. textTail.UpdateShowingTextTail()
  1742. textTail.ArrangeTextTail()
  1743. if -1 != self.PickingItemIndex:
  1744. textTail.SelectItemName(self.PickingItemIndex)
  1745. grp.PopState()
  1746. grp.SetInterfaceRenderState()
  1747. textTail.Render()
  1748. textTail.HideAllTextTail()
  1749. def OnPressEscapeKey(self):
  1750. if app.TARGET == app.GetCursor():
  1751. app.SetCursor(app.NORMAL)
  1752. elif TRUE == mouseModule.mouseController.isAttached():
  1753. mouseModule.mouseController.DeattachObject()
  1754. else:
  1755. self.interface.OpenSystemDialog()
  1756. return TRUE
  1757. def OnIMEReturn(self):
  1758. if app.IsPressed(app.DIK_LSHIFT):
  1759. self.interface.OpenWhisperDialogWithoutTarget()
  1760. else:
  1761. self.interface.ToggleChat()
  1762. return TRUE
  1763. def OnPressExitKey(self):
  1764. self.interface.ToggleSystemDialog()
  1765. return TRUE
  1766. ## BINARY CALLBACK
  1767. ######################################################################################
  1768. # WEDDING
  1769. def BINARY_LoverInfo(self, name, lovePoint):
  1770. if self.interface.wndMessenger:
  1771. self.interface.wndMessenger.OnAddLover(name, lovePoint)
  1772. if self.affectShower:
  1773. self.affectShower.SetLoverInfo(name, lovePoint)
  1774. def BINARY_UpdateLovePoint(self, lovePoint):
  1775. if self.interface.wndMessenger:
  1776. self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  1777. if self.affectShower:
  1778. self.affectShower.OnUpdateLovePoint(lovePoint)
  1779. # END_OF_WEDDING
  1780. # QUEST_CONFIRM
  1781. def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  1782. confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
  1783. confirmDialog.Open(msg, timeout)
  1784. confirmDialog.SetAcceptEvent(lambda answer=TRUE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1785. confirmDialog.SetCancelEvent(lambda answer=FALSE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1786. self.confirmDialog = confirmDialog
  1787. # END_OF_QUEST_CONFIRM
  1788. # GIFT command
  1789. def Gift_Show(self):
  1790. self.interface.ShowGift()
  1791. # CUBE
  1792. def BINARY_Cube_Open(self, npcVNUM):
  1793. self.currentCubeNPC = npcVNUM
  1794. self.interface.OpenCubeWindow()
  1795. if npcVNUM not in self.cubeInformation:
  1796. net.SendChatPacket("/cube r_info")
  1797. else:
  1798. cubeInfoList = self.cubeInformation[npcVNUM]
  1799. i = 0
  1800. for cubeInfo in cubeInfoList:
  1801. self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
  1802. j = 0
  1803. for materialList in cubeInfo["materialList"]:
  1804. for materialInfo in materialList:
  1805. itemVnum, itemCount = materialInfo
  1806. self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
  1807. j = j + 1
  1808. i = i + 1
  1809. self.interface.wndCube.Refresh()
  1810. def BINARY_Cube_Close(self):
  1811. self.interface.CloseCubeWindow()
  1812. # 제작에 필요한 골드, 예상되는 완성품의 VNUM과 개수 정보 update
  1813. def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  1814. self.interface.UpdateCubeInfo(gold, itemVnum, count)
  1815. # def oyuncu_black(self, black, sari, kirmizi, mavi):
  1816. # #blackdragonx61
  1817. # self.interface.wndMiniMap.online_cok_hojdir_ama_benane(black, sari, kirmizi, mavi)
  1818. def BINARY_Cube_Succeed(self, itemVnum, count):
  1819. print "큐브 제작 성공"
  1820. self.interface.SucceedCubeWork(itemVnum, count)
  1821. pass
  1822. def BINARY_Cube_Failed(self):
  1823. print "큐브 제작 실패"
  1824. self.interface.FailedCubeWork()
  1825. pass
  1826. def BINARY_Cube_ResultList(self, npcVNUM, listText):
  1827. # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5 이런식으로 "/" 문자로 구분된 리스트를 줌
  1828. #print listText
  1829. if npcVNUM == 0:
  1830. npcVNUM = self.currentCubeNPC
  1831. self.cubeInformation[npcVNUM] = []
  1832. try:
  1833. for eachInfoText in listText.split("/"):
  1834. eachInfo = eachInfoText.split(",")
  1835. itemVnum = int(eachInfo[0])
  1836. itemCount = int(eachInfo[1])
  1837. self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
  1838. self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  1839. resultCount = len(self.cubeInformation[npcVNUM])
  1840. requestCount = 7
  1841. modCount = resultCount % requestCount
  1842. splitCount = resultCount / requestCount
  1843. for i in xrange(splitCount):
  1844. #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  1845. net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  1846. if 0 < modCount:
  1847. #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1848. net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1849. except RuntimeError, msg:
  1850. dbg.TraceError(msg)
  1851. return 0
  1852. pass
  1853. def BINARY_Acce_Open(self, npcVNUM):
  1854. self.interface.OpenAcceWindow()
  1855. def BINARY_Acce_Close(self):
  1856. self.interface.CloseAcceWindow()
  1857. def BINARY_Acce_UpdateInfo(self, gold, itemVnum, count, rItemVnum, rCount):
  1858. self.interface.UpdateAcceInfo(gold, itemVnum, count, rItemVnum, rCount)
  1859. def BINARY_Acce_Succeed(self, itemVnum, count):
  1860. print "Making acce has succesfully!"
  1861. self.interface.SucceedAcceWork(itemVnum, count)
  1862. pass
  1863. def BINARY_Acce_Failed(self):
  1864. print "Making acce has failed!"
  1865. self.interface.FailedAcceWork()
  1866. pass
  1867. def BINARY_Acce_Abs_Open(self, npcVNUM):
  1868. self.interface.OpenAcceAbsWindow()
  1869. def BINARY_Acce_Abs_Succeed(self):
  1870. print "Acce absorption has succesfully!"
  1871. self.interface.SucceedAcceAbsWork()
  1872. pass
  1873. def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
  1874. # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  1875. try:
  1876. #print listText
  1877. if 3 > len(listText):
  1878. dbg.TraceError("Wrong Cube Material Infomation")
  1879. return 0
  1880. eachResultList = listText.split("@")
  1881. cubeInfo = self.cubeInformation[self.currentCubeNPC]
  1882. itemIndex = 0
  1883. for eachResultText in eachResultList:
  1884. cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  1885. materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  1886. gold = 0
  1887. splitResult = eachResultText.split("/")
  1888. if 1 < len(splitResult):
  1889. gold = int(splitResult[1])
  1890. #print "splitResult : ", splitResult
  1891. eachMaterialList = splitResult[0].split("&")
  1892. i = 0
  1893. for eachMaterialText in eachMaterialList:
  1894. complicatedList = eachMaterialText.split("|")
  1895. if 0 < len(complicatedList):
  1896. for complicatedText in complicatedList:
  1897. (itemVnum, itemCount) = complicatedText.split(",")
  1898. itemVnum = int(itemVnum)
  1899. itemCount = int(itemCount)
  1900. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1901. materialList[i].append((itemVnum, itemCount))
  1902. else:
  1903. itemVnum, itemCount = eachMaterialText.split(",")
  1904. itemVnum = int(itemVnum)
  1905. itemCount = int(itemCount)
  1906. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1907. materialList[i].append((itemVnum, itemCount))
  1908. i = i + 1
  1909. itemIndex = itemIndex + 1
  1910. self.interface.wndCube.Refresh()
  1911. except RuntimeError, msg:
  1912. dbg.TraceError(msg)
  1913. return 0
  1914. pass
  1915. # END_OF_CUBE
  1916. # 용혼석
  1917. def Highlight_Item(self, inven_type, inven_pos):
  1918. self.interface.Highligt_Item(inven_type, inven_pos)
  1919. def BINARY_Cards_UpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points):
  1920. self.interface.UpdateCardsInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points)
  1921. def BINARY_Cards_FieldUpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  1922. self.interface.UpdateCardsFieldInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  1923. def BINARY_Cards_PutReward(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  1924. self.interface.CardsPutReward(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  1925. def BINARY_Cards_ShowIcon(self):
  1926. self.interface.CardsShowIcon()
  1927. def BINARY_Cards_Open(self, safemode):
  1928. self.interface.OpenCardsWindow(safemode)
  1929. def BINARY_DragonSoulGiveQuilification(self):
  1930. self.interface.DragonSoulGiveQuilification()
  1931. def BINARY_DragonSoulRefineWindow_Open(self):
  1932. self.interface.OpenDragonSoulRefineWindow()
  1933. def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
  1934. self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
  1935. def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
  1936. self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
  1937. # END of DRAGON SOUL REFINE WINDOW
  1938. def BINARY_SetBigMessage(self, message):
  1939. self.interface.bigBoard.SetTip(message)
  1940. def BINARY_SetTipMessage(self, message):
  1941. self.interface.tipBoard.SetTip(message)
  1942. def BINARY_AppendNotifyMessage(self, type):
  1943. if not type in localeInfo.NOTIFY_MESSAGE:
  1944. return
  1945. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
  1946. def BINARY_Guild_EnterGuildArea(self, areaID):
  1947. self.interface.BULID_EnterGuildArea(areaID)
  1948. def BINARY_Guild_ExitGuildArea(self, areaID):
  1949. self.interface.BULID_ExitGuildArea(areaID)
  1950. def BINARY_GuildWar_OnSendDeclare(self, guildID):
  1951. pass
  1952. def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  1953. mainCharacterName = player.GetMainCharacterName()
  1954. masterName = guild.GetGuildMasterName()
  1955. if mainCharacterName == masterName:
  1956. self.__GuildWar_OpenAskDialog(guildID, warType)
  1957. def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  1958. self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  1959. def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  1960. self.interface.OnStartGuildWar(guildSelf, guildOpp)
  1961. def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  1962. self.interface.OnEndGuildWar(guildSelf, guildOpp)
  1963. def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  1964. self.interface.BINARY_SetObserverMode(isEnable)
  1965. def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  1966. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  1967. def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  1968. guildID1 = int(guildID1)
  1969. guildID2 = int(guildID2)
  1970. memberCount1 = int(memberCount1)
  1971. memberCount2 = int(memberCount2)
  1972. observerCount = int(observerCount)
  1973. self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  1974. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  1975. def __GuildWar_OpenAskDialog(self, guildID, warType):
  1976. guildName = guild.GetGuildName(guildID)
  1977. # REMOVED_GUILD_BUG_FIX
  1978. if "Noname" == guildName:
  1979. return
  1980. # END_OF_REMOVED_GUILD_BUG_FIX
  1981. import uiGuild
  1982. questionDialog = uiGuild.AcceptGuildWarDialog()
  1983. questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  1984. questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  1985. questionDialog.Open(guildName, warType)
  1986. self.guildWarQuestionDialog = questionDialog
  1987. def __GuildWar_CloseAskDialog(self):
  1988. self.guildWarQuestionDialog.Close()
  1989. self.guildWarQuestionDialog = None
  1990. def __GuildWar_OnAccept(self):
  1991. guildName = self.guildWarQuestionDialog.GetGuildName()
  1992. net.SendChatPacket("/war " + guildName)
  1993. self.__GuildWar_CloseAskDialog()
  1994. return 1
  1995. def __GuildWar_OnDecline(self):
  1996. guildName = self.guildWarQuestionDialog.GetGuildName()
  1997. net.SendChatPacket("/nowar " + guildName)
  1998. self.__GuildWar_CloseAskDialog()
  1999. return 1
  2000. ## BINARY CALLBACK
  2001. ######################################################################################
  2002. def __ServerCommand_Build(self):
  2003. serverCommandList={
  2004. "mattius" : self._mattiusefekt,
  2005. "getinputbegin" : self.__Inputget1,
  2006. "getinputend" : self.__Inputget2,
  2007. "getinput" : self.__Inputget3,
  2008. "depozit_index" :self.__depozit_questindex,
  2009. "antiexp_index" :self.__antiexp_questindex,
  2010. "Telep" :self.__MakeTelep,
  2011. "dopes_index" :self.__bonus_questindex,
  2012. "evento_ultimo_superviviente" : self.__evento_ultimo_superviviente,
  2013. "ConsoleEnable" : self.__Console_Enable,
  2014. "DayMode" : self.__DayMode_Update,
  2015. "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update,
  2016. "CloseRestartWindow" : self.__RestartDialog_Close,
  2017. "OpenPrivateShop" : self.__PrivateShop_Open,
  2018. "OpenOfflineShop" : self.__OfflineShop_Open,
  2019. "PartyHealReady" : self.PartyHealReady,
  2020. "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  2021. "CloseSafebox" : self.CommandCloseSafebox,
  2022. ##Report_System
  2023. "ReportLogin" : self.ReportLogin,
  2024. "Report" : self.Report,
  2025. "getinputbegin" : self.__Inputget1,
  2026. "getinputend" : self.__Inputget2,
  2027. ##End_Report_System
  2028. "Teamler_on" : self.__Team_On,
  2029. "Teamler_off" : self.__Team_Off,
  2030. "F_Teamler_on" : self.__FTeam_On,
  2031. "F_Teamler_off" : self.__FTeam_Off,
  2032. "Teleport" : self.Teleport,
  2033. ##KILLGUI
  2034. "ShowKillGui" : self.__showkillgui,
  2035. "HideKillGui" : self.__hidekillgui,
  2036. "KillBlauReich" : self.__KillBlauReich,
  2037. "KillGelbReich" : self.__KillGelbReich,
  2038. "KillRotReich" : self.__KillRotReich,
  2039. "KillMob" : self.__KillMob,
  2040. ##END_KILLGUI
  2041. "antiexp" : self.__antiexp,
  2042. #"puttonshops" : self.__puttonshops,
  2043. # Fix input quest Start
  2044. "GetInputStringStart" : self.GetInputStringStart,
  2045. "GetInputStringEnd" : self.GetInputStringEnd,
  2046. # Fix input quest End
  2047. #Guildstorage
  2048. "GUILDSTORAGE" : self._GuildStorageCMD,
  2049. "GUILDSTORAGE_ADDITEM" : self._GuildStorageAddItem,
  2050. "GUILDSTORAGE_ADDITEMSLOT" : self._GuildStorageAddItemSlot,
  2051. "GUILDSTORAGE_ADDMEMBER" : self._GuildStorageAddMemberToList,
  2052. "GUILDSTORAGE_ADDTEMPSLOT" : self._GuildStorageTempSlotsAdd,
  2053. "GUILDSTORAGE_ADDLOG" : self._GuildStorageAddLog,
  2054. ## Fatihbab34 systema
  2055. #HP
  2056. "ticlevel" : self.Den7,
  2057. "pvp_den7" : self.Denn7,
  2058. "pvp_den8" : self.Denn8,
  2059. #Degerler..
  2060. "get_input_value7" : self.GetInputValue7,
  2061. "get_input_start7" : self.GetInputOn7,
  2062. "get_input_end7" : self.GetInputOff7,
  2063. # PET_SYSTEM
  2064. "PetIsMine" : self.__PetIsMineByVid,
  2065. "ActivarGui" : self.__ActivarGui,
  2066. "SetPetClearItemSlotButtonIndex" : self.__PetSetClearItemSlotButtonIndex,
  2067. "SetPetIncreaseBoniButtonIndex" : self.__PetSetIncreaseBoniButtonIndex,
  2068. "SetPetSendAwayButtonIndex" : self.__PetSetSendAwayButtonIndex,
  2069. "ShowPet" : self.__PetShow,
  2070. "HidePet" : self.__PetHide,
  2071. "GetPetClearSlot" : self.__PetGetClearSlot,
  2072. "GetPetIncreaseBoni" : self.__PetGetIncreaseBoni,
  2073. "SetPet" : self.__PetSet,
  2074. "SetPetHead" : self.__PetSetHead,
  2075. "SetPetNeck" : self.__PetSetNeck,
  2076. "SetPetFoot" : self.__PetSetFoot,
  2077. "SetPetAttackValue" : self.__PetSetAttackValue,
  2078. "SetPetMagicAttackValue" : self.__PetSetMagicAttackValue,
  2079. "SetPetArmorValue" : self.__PetSetArmorValue,
  2080. "SetPetName" : self.__PetSetName,
  2081. "SetPetLevel" : self.__PetSetLevel,
  2082. "SetPetExp" : self.__PetSetExp,
  2083. "SetPetMaxExp" : self.__PetSetMaxExp,
  2084. "SetPetSkillPoints" : self.__PetSetSkillPoints,
  2085. # END_OF_PET_SYSTEM
  2086. # ITEM_MALL
  2087. "CloseMall" : self.CommandCloseMall,
  2088. "ShowMeMallPassword" : self.AskMallPassword,
  2089. "item_mall" : self.__ItemMall_Open,
  2090. # END_OF_ITEM_MALL
  2091. "RefineSuceeded" : self.RefineSuceededMessage,
  2092. "RefineFailed" : self.RefineFailedMessage,
  2093. "xmas_snow" : self.__XMasSnow_Enable,
  2094. "xmas_boom" : self.__XMasBoom_Enable,
  2095. "xmas_song" : self.__XMasSong_Enable,
  2096. "xmas_tree" : self.__XMasTree_Enable,
  2097. "newyear_boom" : self.__XMasBoom_Enable,
  2098. "PartyRequest" : self.__PartyRequestQuestion,
  2099. "PartyRequestDenied" : self.__PartyRequestDenied,
  2100. "horse_state" : self.__Horse_UpdateState,
  2101. "hide_horse_state" : self.__Horse_HideState,
  2102. "WarUC" : self.__GuildWar_UpdateMemberCount,
  2103. "test_server" : self.__EnableTestServerFlag,
  2104. "mall" : self.__InGameShop_Show,
  2105. #PET_SYSTEM
  2106. "PetEvolution" : self.SetPetEvolution,
  2107. "PetName" : self.SetPetName,
  2108. "PetLevel" : self.SetPetLevel,
  2109. "PetDuration" : self.SetPetDuration,
  2110. "PetBonus" : self.SetPetBonus,
  2111. "PetSkill" : self.SetPetskill,
  2112. "PetIcon" : self.SetPetIcon,
  2113. "PetExp" : self.SetPetExp,
  2114. "PetUnsummon" : self.PetUnsummon,
  2115. "OpenPetIncubator" : self.OpenPetIncubator,
  2116. #PET_SYSTEM
  2117. # ITEM_SHOP
  2118. "SetISLoadButtonIndex" : self.__ISSetLoadButtonIndex,
  2119. "SetISBuyButtonIndex" : self.__ISSetBuyButtonIndex,
  2120. "GetISBuyID" : self.__ISGetBuyID,
  2121. "GetISBuyID2" : self.__ISGetBuyID2,
  2122. "AddISCategory" : self.__ISAddCategory,
  2123. "SelectISCategory" : self.__ISSelectCategory,
  2124. "ClearISItems" : self.__ISClearItems,
  2125. "AddISItem" : self.__ISAddItem,
  2126. "AddISItemDesc" : self.__ISAddItemDesc,
  2127. "SetISLoadSuccess" : self.__ISSetLoadSuccess,
  2128. "SetISLoadFail" : self.__ISSetLoadFail,
  2129. "SetISBuySuccess" : self.__ISSetBuySuccess,
  2130. "SetISBuyFail" : self.__ISSetBuyFail,
  2131. "SetISCoins" : self.__ISSetCoins,
  2132. "SetISMarks" : self.__ISSetMarks,
  2133. "Showmedallas_gui" : self.__showmedallas_gui,
  2134. "Hidemedallas_gui" : self.__hidemedallas_gui,
  2135. "muertes" : self.__muertes,
  2136. "primera_muerte" : self.__primera_muerte,
  2137. "doble_muerte" : self.__doble_muerte,
  2138. "triple_muerte" : self.__triple_muerte,
  2139. "exterminio" : self.__exterminio,
  2140. "muertacular" : self.__muertacular,
  2141. "bestialidad" : self.__bestialidad,
  2142. "salvajada" : self.__salvajada,
  2143. "catastrofe" : self.__catastrofe,
  2144. "apocalipsis" : self.__apocalipsis,
  2145. "lluvia_muertos" : self.__lluvia_muertos,
  2146. "super_increible" : self.__super_increible,
  2147. "input0" : self.__Input0,
  2148. "input1" : self.__Input1,
  2149. # END_OF_ITEM_SHOP
  2150. # WEDDING
  2151. "lover_login" : self.__LoginLover,
  2152. "lover_logout" : self.__LogoutLover,
  2153. "lover_near" : self.__LoverNear,
  2154. "lover_far" : self.__LoverFar,
  2155. "lover_divorce" : self.__LoverDivorce,
  2156. "PlayMusic" : self.__PlayMusic,
  2157. #transfer costume
  2158. "transferopen" : self.showtransfer,
  2159. "get_input_value" : self.GetInputValue,
  2160. "get_input_start" : self.GetInputOn,
  2161. "get_input_end" : self.GetInputOff,
  2162. "super_quest" : self.Tabulejtor,
  2163. "pvp_zdruwko" : self.Mozart,
  2164. #end transfer
  2165. # END_OF_WEDDING
  2166. "AkiraGiftSys" : self.__AkiraGiftSystem,
  2167. ########Anti Exp Button by Sanii##########
  2168. "anti_exp" : self.AntiExp,
  2169. "anti_exp_state" : self.AntiExpState,
  2170. "mostrar_usuarios" : self.__mostrar_usuarios,
  2171. "ocultar_usuarios" : self.__ocultar_usuarios,
  2172. "muerto_guerras" : self.__muerto_guerras,
  2173. "alubias" : self.__alubias,
  2174. "proteccion_guerra" : self.__proteccion_guerra,
  2175. "contador_usuarios_guerra" : self.__contador_usuarios_guerra,
  2176. "muertos_guerra" : self.__muertos_guerra,
  2177. "caido_guerra" : self.__caido_guerra,
  2178. "ataque_guerra" : self.__ataque_guerra,
  2179. "ataque_guerra1" : self.__ataque_guerra1,
  2180. "activar_libre" : self.__activar_libre,
  2181. "cerrar_grupo" : self.__grupobug,
  2182. "spirit2" : self.__spirit2,
  2183. # PRIVATE_SHOP_PRICE_LIST
  2184. "MyShopPriceList" : self.__PrivateShop_PriceList,
  2185. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2186. # BONI_SWITCHER
  2187. #"ResetBoniFromSwitcher" : self.__ResetBoniFromSwitcher,
  2188. #"AddBoniToSwitcher" : self.__AddBoniToSwitcher,
  2189. #"AddMaxValueToBoni" : self.__AddMaxValueToBoni,
  2190. #"SetBoniSwitcherLoad" : self.__SetBoniSwitcherLoad,
  2191. "AcceMessage" : self.AcceMessage,
  2192. "AcceAbsMessage" : self.AcceAbsMessage,
  2193. # END_OF_BONI_SWITCHER
  2194. #offshoppannel
  2195. "MountSystem" : self.__MountSystem,
  2196. "SCHICKSAL_RAD" : self.__SchicksalRad,
  2197. }
  2198. self.serverCommander=stringCommander.Analyzer()
  2199. for serverCommandItem in serverCommandList.items():
  2200. self.serverCommander.SAFE_RegisterCallBack(
  2201. serverCommandItem[0], serverCommandItem[1]
  2202. )
  2203. if app.ENABLE_MELEY_LAIR_DUNGEON:
  2204. self.serverCommander.SAFE_RegisterCallBack("meley_open", self.OpenMeleyRanking)
  2205. self.serverCommander.SAFE_RegisterCallBack("meley_rank", self.AddRankMeleyRanking)
  2206. def __MakeTelep(self, qid):
  2207. constInfo.Telepqin= int(qid)
  2208. def BINARY_ServerCommand_Run(self, line):
  2209. #dbg.TraceError(line)
  2210. try:
  2211. #print " BINARY_ServerCommand_Run", line
  2212. return self.serverCommander.Run(line)
  2213. except RuntimeError, msg:
  2214. dbg.TraceError(msg)
  2215. return 0
  2216. def GuildstorageTry(self):
  2217. import uiguildstorage
  2218. self.GuildstorageWindow = uiguildstorage.GuildStorage()
  2219. if self.GuildstorageWindow.IsShow():
  2220. self.GuildstorageWindow.Hide()
  2221. else:
  2222. self.GuildStorageWindow.Show()
  2223. def __PythonToLua(self, id):
  2224. constInfo.PYTHONTOLUA = int(id)
  2225. def __PythonIslem(self, PythonIslem):
  2226. if PythonIslem == "PYTHONISLEM":
  2227. net.SendQuestInputStringPacket(constInfo.PYTHONISLEM)
  2228. elif PythonIslem == "PLAYER_VID":
  2229. net.SendQuestInputStringPacket(str(constInfo.PLAYER_VID))
  2230. elif PythonIslem == "SIL_SLOT":
  2231. net.SendQuestInputStringPacket(str(constInfo.SIL_SLOT))
  2232. def __LuaToPython(self, LuaToPython):
  2233. if LuaToPython.find("#quest_input#") != -1:
  2234. constInfo.INPUT = 1
  2235. elif LuaToPython.find("#quest_inputbitir#") != -1:
  2236. constInfo.INPUT = 0
  2237. # elif LuaToPython.find("#rakip_hp_sp#") != -1:
  2238. # constInfo.PLAYER_HP = LuaToPython.split("|")[1]
  2239. # constInfo.PLAYER_MAX_HP = LuaToPython.split("|")[2]
  2240. # elif LuaToPython.find("EP_KARAKTER") != -1:
  2241. # bol = LuaToPython.split("#")
  2242. # constInfo.ACHIEVEMENT_POINTS = int(bol[1])
  2243. # elif LuaToPython.find("ticaret_log") != -1:
  2244. # bol = LuaToPython.split("#")
  2245. # bol2 = LuaToPython.split("|")
  2246. # constInfo.TICARET_LOG.insert(0, bol2[1])
  2247. def __ProcessPreservedServerCommand(self):
  2248. try:
  2249. command = net.GetPreservedServerCommand()
  2250. while command:
  2251. print " __ProcessPreservedServerCommand", command
  2252. self.serverCommander.Run(command)
  2253. command = net.GetPreservedServerCommand()
  2254. except RuntimeError, msg:
  2255. dbg.TraceError(msg)
  2256. return 0
  2257. def ReportLogin(self, id):
  2258. constInfo.ReportLogin = int(id)
  2259. def Report(self):
  2260. net.SendQuestInputStringPacket(constInfo.ReportEntered)
  2261. def __Inputget1(self):
  2262. constInfo.INPUT = 1
  2263. def __Inputget2(self):
  2264. constInfo.INPUT = 0
  2265. def __AkiraGiftSystem(self, arg):
  2266. cmd = arg.split("|")
  2267. if cmd[0] == "Gift_Level":
  2268. self.wndAkiraGift.GiftLevel(str(cmd[1]))
  2269. elif cmd[0] == "Gift_Item_Name":
  2270. self.wndAkiraGift.GiftItemName(str(cmd[1]),str(cmd[2]),str(cmd[3]),str(cmd[4]),str(cmd[5]),str(cmd[6]))
  2271. elif cmd[0] == "Gift_Item_Count":
  2272. self.wndAkiraGift.GiftItemCount(str(cmd[1]),str(cmd[2]),str(cmd[3]),str(cmd[4]),str(cmd[5]),str(cmd[6]))
  2273. elif cmd[0] == "Quest":
  2274. constInfo.Akira_Gift_System["Quest"] = int(cmd[1])
  2275. elif cmd[0] == "Input":
  2276. constInfo.GIFT_INPUT = int(cmd[1])
  2277. elif cmd[0] == "Reload":
  2278. net.SendQuestInputStringPacket(str(constInfo.Akira_Gift_System["Accion"]))
  2279. constInfo.Akira_Gift_System["Accion"] = ""
  2280. elif cmd[0] == "Show":
  2281. self.wndAkiraGift.Show()
  2282. def PartyHealReady(self):
  2283. self.interface.PartyHealReady()
  2284. def AskSafeboxPassword(self):
  2285. self.interface.AskSafeboxPassword()
  2286. def _mattiusefekt(self):
  2287. net.SendChatPacket("(mattius)")
  2288. # ITEM_MALL
  2289. def AskMallPassword(self):
  2290. self.interface.AskMallPassword()
  2291. def __ItemMall_Open(self):
  2292. self.interface.OpenItemMall();
  2293. def CommandCloseMall(self):
  2294. self.interface.CommandCloseMall()
  2295. # END_OF_ITEM_MALL
  2296. def AcceMessage(self):
  2297. snd.PlaySound("sound/ui/make_soket.wav")
  2298. self.PopupMessage(localeInfo.ACCE_DEL_SERVEITEM)
  2299. def __deschidere_magazin_questindex(self, value):
  2300. constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX = int(value)
  2301. def __deschidere_magazin(self):
  2302. deschidere_magazin = constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX
  2303. event.QuestButtonClick(deschidere_magazin)
  2304. def AcceAbsMessage(self):
  2305. snd.PlaySound("sound/ui/make_soket.wav")
  2306. self.PopupMessage(localeInfo.ACCE_DEL_ABSORDITEM)
  2307. def RefineSuceededMessage(self):
  2308. snd.PlaySound("sound/ui/make_soket.wav")
  2309. self.PopupMessage(localeInfo.REFINE_SUCCESS)
  2310. def RefineFailedMessage(self):
  2311. snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2312. self.PopupMessage(localeInfo.REFINE_FAILURE)
  2313. def CommandCloseSafebox(self):
  2314. self.interface.CommandCloseSafebox()
  2315. # PRIVATE_SHOP_PRICE_LIST
  2316. def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  2317. uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
  2318. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2319. def SetPetEvolution(self, evo):
  2320. petname = [localeInfo.KEV_PET_LV_A, localeInfo.KEV_PET_LV_B, localeInfo.KEV_PET_LV_C, localeInfo.KEV_PET_LV_D]
  2321. self.petmain.SetEvolveName(petname[int(evo)])
  2322. def SetPetName(self, name):
  2323. if len(name) > 1 and name != "":
  2324. self.petmini.Show()
  2325. self.petmain.SetName(name)
  2326. def SetPetLevel(self, level):
  2327. self.petmain.SetLevel(level)
  2328. def SetPetDuration(self, dur, durt):
  2329. if int(durt) > 0:
  2330. self.petmini.SetDuration(dur, durt)
  2331. self.petmain.SetDuration(dur, durt)
  2332. def SetPetBonus(self, hp, dif, sp):
  2333. self.petmain.SetHp(hp)
  2334. self.petmain.SetDef(dif)
  2335. self.petmain.SetSp(sp)
  2336. def SetPetskill(self, slot, idx, lv):
  2337. if int(lv) > 0:
  2338. self.petmini.SetSkill(slot, idx, lv)
  2339. self.petmain.SetSkill(slot, idx, lv)
  2340. self.affectShower.BINARY_NEW_AddAffect(5400+int(idx),int(constInfo.LASTAFFECT_POINT)+1,int(constInfo.LASTAFFECT_VALUE)+1, 0)
  2341. if int(slot)==0:
  2342. constInfo.SKILL_PET1=5400+int(idx)
  2343. if int(slot)==1:
  2344. constInfo.SKILL_PET2=5400+int(idx)
  2345. if int(slot)==2:
  2346. constInfo.SKILL_PET3=5400+int(idx)
  2347. def SetPetIcon(self, vnum):
  2348. if int(vnum) > 0:
  2349. self.petmini.SetImageSlot(vnum)
  2350. self.petmain.SetImageSlot(vnum)
  2351. def SetPetExp(self, exp, expi, exptot):
  2352. if int(exptot) > 0:
  2353. self.petmini.SetExperience(exp, expi, exptot)
  2354. self.petmain.SetExperience(exp, expi, exptot)
  2355. def PetUnsummon(self):
  2356. self.petmini.SetDefaultInfo()
  2357. self.petmini.Close()
  2358. self.petmain.SetDefaultInfo()
  2359. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET1),0)
  2360. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET2),0)
  2361. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET3),0)
  2362. constInfo.SKILL_PET1 = 0
  2363. constInfo.SKILL_PET2 = 0
  2364. constInfo.SKILL_PET3 = 0
  2365. def OpenPetMainGui(self):
  2366. self.petmain.Show()
  2367. self.petmain.SetTop()
  2368. def OpenPetIncubator(self, pet_new = 0):
  2369. import uipetincubatrice
  2370. self.petinc = uipetincubatrice.PetSystemIncubator(pet_new)
  2371. self.petinc.Show()
  2372. self.petinc.SetTop()
  2373. def OpenPetMini(self):
  2374. self.petmini.Show()
  2375. self.petmini.SetTop()
  2376. def OpenPetFeed(self):
  2377. self.feedwind = uipetfeed.PetFeedWindow()
  2378. self.feedwind.Show()
  2379. self.feedwind.SetTop()
  2380. def Gift_Show(self):
  2381. if constInfo.PET_MAIN == 0:
  2382. self.petmain.Show()
  2383. constInfo.PET_MAIN =1
  2384. self.petmain.SetTop()
  2385. else:
  2386. self.petmain.Hide()
  2387. constInfo.PET_MAIN =0
  2388. def __Horse_HideState(self):
  2389. self.affectShower.SetHorseState(0, 0, 0)
  2390. def __Horse_UpdateState(self, level, health, battery):
  2391. self.affectShower.SetHorseState(int(level), int(health), int(battery))
  2392. def __IsXMasMap(self):
  2393. mapDict = ( "metin2_map_n_flame_01",
  2394. "metin2_map_n_desert_01",
  2395. "metin2_map_spiderdungeon",
  2396. "metin2_map_deviltower1", )
  2397. if background.GetCurrentMapName() in mapDict:
  2398. return FALSE
  2399. return TRUE
  2400. def __XMasSnow_Enable(self, mode):
  2401. self.__XMasSong_Enable(mode)
  2402. if "1"==mode:
  2403. if not self.__IsXMasMap():
  2404. return
  2405. print "XMAS_SNOW ON"
  2406. background.EnableSnow(1)
  2407. else:
  2408. print "XMAS_SNOW OFF"
  2409. background.EnableSnow(0)
  2410. def __XMasBoom_Enable(self, mode):
  2411. if "1"==mode:
  2412. if not self.__IsXMasMap():
  2413. return
  2414. print "XMAS_BOOM ON"
  2415. self.__DayMode_Update("dark")
  2416. self.enableXMasBoom = TRUE
  2417. self.startTimeXMasBoom = app.GetTime()
  2418. else:
  2419. print "XMAS_BOOM OFF"
  2420. self.__DayMode_Update("light")
  2421. self.enableXMasBoom = FALSE
  2422. def __XMasTree_Enable(self, grade):
  2423. print "XMAS_TREE ", grade
  2424. background.SetXMasTree(int(grade))
  2425. # PET_INVENTORY
  2426. def __PetIsMineByVid(self, vid):
  2427. targetName = chr.GetNameByVID(int(vid))
  2428. charName = player.GetName() or chr.GetMainCharacterName()
  2429. if targetName[0:len(charName)] == charName:
  2430. localeInfo.SEND_BACK = "true"
  2431. else:
  2432. localeInfo.SEND_BACK = "false"
  2433. self.__SendTextPacketToQuest()
  2434. localeInfo.SEND_BACK = ""
  2435. def __SendTextPacketToQuest(self):
  2436. net.SendQuestInputStringPacket(localeInfo.SEND_BACK)
  2437. def __Inputget1(self):
  2438. constInfo.INPUT_IGNORE = 1
  2439. def __Inputget2(self):
  2440. constInfo.INPUT_IGNORE = 0
  2441. def __Inputget3(self):
  2442. net.SendQuestInputStringPacket("1")
  2443. def __PressXKey(self):
  2444. import event
  2445. #self.__DeactivarGui()
  2446. self.__PetHide()
  2447. event.QuestButtonClick(constInfo.PET_SEND_AWAY_BUTTON_INDEX)
  2448. def GetInputStringStart(self):
  2449. constInfo.INPUT_IGNORE = 1
  2450. def GetInputStringEnd(self):
  2451. constInfo.INPUT_IGNORE = 0
  2452. def __PetSetClearItemSlotButtonIndex(self, index):
  2453. constInfo.PET_CLEAR_ITEM_SLOT_BUTTON_INDEX = int(index)
  2454. def __PetSetIncreaseBoniButtonIndex(self, index):
  2455. constInfo.PET_INCREASE_BONI_BUTTON_INDEX = int(index)
  2456. def __PetSetSendAwayButtonIndex(self, index):
  2457. constInfo.PET_SEND_AWAY_BUTTON_INDEX = int(index)
  2458. def __ActivarGui(self):
  2459. global pet_gui_activado
  2460. pet_gui_activado = 1
  2461. def __DeactivarGui(self):
  2462. global pet_gui_activado
  2463. pet_gui_activado = 0
  2464. def __PetShow(self):
  2465. if not self.petInventoryWnd:
  2466. import uiPet
  2467. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2468. self.petInventoryWnd.Show()
  2469. def __PetHide(self):
  2470. if self.petInventoryWnd:
  2471. self.petInventoryWnd.Hide()
  2472. def __PetGetClearSlot(self):
  2473. net.SendQuestInputStringPacket(str(self.petInventoryWnd.GetClearSlot()))
  2474. def __PetGetIncreaseBoni(self):
  2475. net.SendQuestInputStringPacket(str(self.petInventoryWnd.GetIncreaseBoni()))
  2476. def __PetSet(self, itemVnum):
  2477. if not self.petInventoryWnd:
  2478. import uiPet
  2479. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2480. self.petInventoryWnd.SetPet(itemVnum)
  2481. def __PetSetHead(self, itemVnum):
  2482. if not self.petInventoryWnd:
  2483. import uiPet
  2484. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2485. if int(itemVnum) > 0:
  2486. self.petInventoryWnd.SetHeadItem(itemVnum)
  2487. else:
  2488. self.petInventoryWnd.ClearHeadItem()
  2489. def __PetSetNeck(self, itemVnum):
  2490. if not self.petInventoryWnd:
  2491. import uiPet
  2492. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2493. if int(itemVnum) > 0:
  2494. self.petInventoryWnd.SetNeckItem(itemVnum)
  2495. else:
  2496. self.petInventoryWnd.ClearNeckItem()
  2497. def __PetSetFoot(self, itemVnum):
  2498. if not self.petInventoryWnd:
  2499. import uiPet
  2500. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2501. if int(itemVnum) > 0:
  2502. self.petInventoryWnd.SetFootItem(itemVnum)
  2503. else:
  2504. self.petInventoryWnd.ClearFootItem()
  2505. def __PetSetAttackValue(self, value):
  2506. if not self.petInventoryWnd:
  2507. import uiPet
  2508. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2509. self.petInventoryWnd.SetAttackValue(value)
  2510. def __PetSetMagicAttackValue(self, value):
  2511. if not self.petInventoryWnd:
  2512. import uiPet
  2513. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2514. self.petInventoryWnd.SetMagicAttackValue(value)
  2515. def __PetSetArmorValue(self, value):
  2516. if not self.petInventoryWnd:
  2517. import uiPet
  2518. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2519. self.petInventoryWnd.SetArmorValue(value)
  2520. def __PetSetName(self, name):
  2521. if not self.petInventoryWnd:
  2522. import uiPet
  2523. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2524. self.petInventoryWnd.SetName(name.replace("[_]", " "))
  2525. def __PetSetLevel(self, level):
  2526. if not self.petInventoryWnd:
  2527. import uiPet
  2528. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2529. self.petInventoryWnd.SetLevel(level)
  2530. def __PetSetExp(self, exp):
  2531. if not self.petInventoryWnd:
  2532. import uiPet
  2533. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2534. self.petInventoryWnd.SetExp(exp)
  2535. self.petInventoryWnd.UpdateExpBar()
  2536. def __PetSetMaxExp(self, maxexp):
  2537. if not self.petInventoryWnd:
  2538. import uiPet
  2539. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2540. self.petInventoryWnd.SetMaxExp(maxexp)
  2541. self.petInventoryWnd.UpdateExpBar()
  2542. def __PetSetSkillPoints(self, points):
  2543. if not self.petInventoryWnd:
  2544. import uiPet
  2545. self.petInventoryWnd = uiPet.PetInventoryDialog()
  2546. self.petInventoryWnd.SetSkillPoints(points)
  2547. # END_PET_INVENTORY
  2548. def __XMasSong_Enable(self, mode):
  2549. if "1"==mode:
  2550. print "XMAS_SONG ON"
  2551. XMAS_BGM = "xmas.mp3"
  2552. if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  2553. if musicInfo.fieldMusic != "":
  2554. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2555. musicInfo.fieldMusic=XMAS_BGM
  2556. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2557. else:
  2558. print "XMAS_SONG OFF"
  2559. if musicInfo.fieldMusic != "":
  2560. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2561. musicInfo.fieldMusic=musicInfo.METIN2THEMA
  2562. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2563. def __RestartDialog_Close(self):
  2564. self.interface.CloseRestartDialog()
  2565. def __Console_Enable(self):
  2566. constInfo.CONSOLE_ENABLE = TRUE
  2567. self.consoleEnable = TRUE
  2568. app.EnableSpecialCameraMode()
  2569. ui.EnablePaste(TRUE)
  2570. def __muerto_guerras(self, id):
  2571. constInfo.muerto_guerras = int(id)
  2572. def __alubias(self):
  2573. for i in xrange(player.INVENTORY_PAGE_SIZE*2):
  2574. if player.GetItemIndex(i) in (70102,):
  2575. net.SendItemUsePacket(i)
  2576. net.SendItemUsePacket(i)
  2577. net.SendItemUsePacket(i)
  2578. net.SendItemUsePacket(i)
  2579. net.SendItemUsePacket(i)
  2580. net.SendItemUsePacket(i)
  2581. break
  2582. def __spirit2(self):
  2583. net.SendChatPacket("(spirit2)")
  2584. def __proteccion_guerra(self):
  2585. net.SendChatPacket("(proteccion_guerra)")
  2586. def __contador_usuarios_guerra(self, contador_usuarios_guerra):
  2587. self.contador_usuarios_guerra.SetText(contador_usuarios_guerra)
  2588. def __muertos_guerra(self, muertos_guerra):
  2589. self.muertos_guerra.SetText(muertos_guerra)
  2590. def __caido_guerra(self, caido_guerra):
  2591. self.caido_guerra.SetText(caido_guerra)
  2592. def __mostrar_usuarios(self):
  2593. self.Espacio.Show()
  2594. self.contador_usuarios_guerra.Show()
  2595. self.muertos_guerra.Show()
  2596. self.caido_guerra.Show()
  2597. self.usuarios_guerra.Show()
  2598. self.ranking_guerra.Show()
  2599. self.ranking_caido.Show()
  2600. def __ocultar_usuarios(self):
  2601. self.Espacio.Hide()
  2602. self.contador_usuarios_guerra.Hide()
  2603. self.muertos_guerra.Hide()
  2604. self.caido_guerra.Hide()
  2605. self.usuarios_guerra.Hide()
  2606. self.ranking_guerra.Hide()
  2607. self.ranking_caido.Hide()
  2608. def __ataque_guerra(self):
  2609. constInfo.ataque_guerra = 1
  2610. def __ataque_guerra1(self):
  2611. constInfo.ataque_guerra = 0
  2612. def __activar_libre(self):
  2613. net.SendChatPacket("/pkmode 2")
  2614. def __grupobug(self):
  2615. net.SendPartyExitPacket()
  2616. ## PrivateShop
  2617. def __PrivateShop_Open(self):
  2618. self.interface.OpenPrivateShopInputNameDialog()
  2619. def BINARY_PrivateShop_Appear(self, vid, text):
  2620. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER):
  2621. self.interface.AppearPrivateShop(vid, text)
  2622. def BINARY_PrivateShop_Disappear(self, vid):
  2623. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER):
  2624. self.interface.DisappearPrivateShop(vid)
  2625. # OfflineShop
  2626. def __OfflineShop_Open(self):
  2627. self.interface.OpenOfflineShopInputNameDialog()
  2628. def BINARY_OfflineShop_Appear(self, vid, text):
  2629. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC):
  2630. self.interface.AppearOfflineShop(vid, text)
  2631. def BINARY_OfflineShop_Disappear(self, vid):
  2632. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC):
  2633. self.interface.DisappearOfflineShop(vid)
  2634. ## DayMode
  2635. def __PRESERVE_DayMode_Update(self, mode):
  2636. if "light"==mode:
  2637. background.SetEnvironmentData(0)
  2638. elif "dark"==mode:
  2639. if not self.__IsXMasMap():
  2640. return
  2641. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2642. background.SetEnvironmentData(1)
  2643. def __DayMode_Update(self, mode):
  2644. if "light"==mode:
  2645. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  2646. elif "dark"==mode:
  2647. if not self.__IsXMasMap():
  2648. return
  2649. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  2650. def __DayMode_OnCompleteChangeToLight(self):
  2651. background.SetEnvironmentData(0)
  2652. self.curtain.FadeIn()
  2653. def __DayMode_OnCompleteChangeToDark(self):
  2654. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2655. background.SetEnvironmentData(1)
  2656. self.curtain.FadeIn()
  2657. ## XMasBoom
  2658. def __XMasBoom_Update(self):
  2659. self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  2660. if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  2661. return
  2662. boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  2663. boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  2664. if app.GetTime() - self.startTimeXMasBoom > boomTime:
  2665. self.indexXMasBoom += 1
  2666. for i in xrange(boomCount):
  2667. self.__XMasBoom_Boom()
  2668. def __XMasBoom_Boom(self):
  2669. x, y, z = player.GetMainCharacterPosition()
  2670. randX = app.GetRandom(-150, 150)
  2671. randY = app.GetRandom(-150, 150)
  2672. snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  2673. def __PartyRequestQuestion(self, vid):
  2674. vid = int(vid)
  2675. partyRequestQuestionDialog = uiCommon.QuestionDialog()
  2676. partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
  2677. partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  2678. partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  2679. partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerPartyRequest(arg))
  2680. partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerPartyRequest(arg))
  2681. partyRequestQuestionDialog.Open()
  2682. partyRequestQuestionDialog.vid = vid
  2683. self.partyRequestQuestionDialog = partyRequestQuestionDialog
  2684. def __AnswerPartyRequest(self, answer):
  2685. if not self.partyRequestQuestionDialog:
  2686. return
  2687. vid = self.partyRequestQuestionDialog.vid
  2688. if answer:
  2689. net.SendChatPacket("/party_request_accept " + str(vid))
  2690. else:
  2691. net.SendChatPacket("/party_request_deny " + str(vid))
  2692. self.partyRequestQuestionDialog.Close()
  2693. self.partyRequestQuestionDialog = None
  2694. def __PartyRequestDenied(self):
  2695. self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
  2696. def __EnableTestServerFlag(self):
  2697. app.EnableTestServerFlag()
  2698. def __InGameShop_Show(self, url):
  2699. if constInfo.IN_GAME_SHOP_ENABLE:
  2700. self.interface.OpenWebWindow(url)
  2701. def OpenTicaretLog(self):
  2702. self.silButton = ui.Button()
  2703. self.silButton.SetParent(self.Board)
  2704. self.silButton.SetPosition(80+120-56+72, 301)
  2705. self.silButton.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
  2706. self.silButton.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
  2707. self.silButton.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
  2708. self.silButton.SetText("Sil")
  2709. self.silButton.SetToolTipText("Bu logu sil")
  2710. self.silButton.Hide()
  2711. self.silButton.Down()
  2712. self.silButton.SetEvent(lambda : self.LogSil)
  2713. self.ListBox.ClearItem()
  2714. def __OnSelectListBox(self):
  2715. if self.silButton.IsDown():
  2716. self.silButton.SetUp()
  2717. self.silButton.SetUp()
  2718. # WEDDING
  2719. def __LoginLover(self):
  2720. if self.interface.wndMessenger:
  2721. self.interface.wndMessenger.OnLoginLover()
  2722. def __LogoutLover(self):
  2723. if self.interface.wndMessenger:
  2724. self.interface.wndMessenger.OnLogoutLover()
  2725. if self.affectShower:
  2726. self.affectShower.HideLoverState()
  2727. def __LoverNear(self):
  2728. if self.affectShower:
  2729. self.affectShower.ShowLoverState()
  2730. def __LoverFar(self):
  2731. if self.affectShower:
  2732. self.affectShower.HideLoverState()
  2733. def __LoverDivorce(self):
  2734. if self.interface.wndMessenger:
  2735. self.interface.wndMessenger.ClearLoverInfo()
  2736. if self.affectShower:
  2737. self.affectShower.ClearLoverState()
  2738. def __PlayMusic(self, flag, filename):
  2739. flag = int(flag)
  2740. if flag:
  2741. snd.FadeOutAllMusic()
  2742. musicInfo.SaveLastPlayFieldMusic()
  2743. snd.FadeInMusic("BGM/" + filename)
  2744. else:
  2745. snd.FadeOutAllMusic()
  2746. musicInfo.LoadLastPlayFieldMusic()
  2747. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2748. # END_OF_WEDDING
  2749. # Monster Target System
  2750. if app.ENABLE_SEND_TARGET_INFO:
  2751. def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
  2752. if not raceNum in constInfo.MONSTER_INFO_DATA:
  2753. constInfo.MONSTER_INFO_DATA.update({raceNum : {}})
  2754. constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []})
  2755. curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"]
  2756. isUpgradeable = False
  2757. isMetin = False
  2758. item.SelectItem(itemVnum)
  2759. if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2760. isUpgradeable = True
  2761. elif item.GetItemType() == item.ITEM_TYPE_METIN:
  2762. isMetin = True
  2763. for curItem in curList:
  2764. if isUpgradeable:
  2765. if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
  2766. if not (itemVnum in curItem["vnum_list"]):
  2767. curItem["vnum_list"].append(itemVnum)
  2768. return
  2769. elif isMetin:
  2770. if curItem.has_key("vnum_list"):
  2771. baseVnum = curItem["vnum_list"][0]
  2772. if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
  2773. if not (itemVnum in curItem["vnum_list"]):
  2774. curItem["vnum_list"].append(itemVnum)
  2775. return
  2776. else:
  2777. if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
  2778. return
  2779. if isUpgradeable or isMetin:
  2780. curList.append({"vnum_list":[itemVnum], "count":itemCount})
  2781. else:
  2782. curList.append({"vnum":itemVnum, "count":itemCount})
  2783. def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
  2784. self.targetBoard.RefreshMonsterInfoBoard()
  2785. if app.ENABLE_MELEY_LAIR_DUNGEON:
  2786. def OpenMeleyRanking(self):
  2787. if self.interface:
  2788. self.interface.OpenMeleyRanking()
  2789. def AddRankMeleyRanking(self, data):
  2790. if self.interface:
  2791. line = int(data.split("#")[1])
  2792. name = str(data.split("#")[2])
  2793. members = int(data.split("#")[3])
  2794. seconds = int(data.split("#")[4])
  2795. minutes = seconds // 60
  2796. seconds %= 60
  2797. if seconds > 0:
  2798. time = localeInfo.TIME_MIN_SEC % (minutes, seconds)
  2799. else:
  2800. time = localeInfo.TIME_MIN % (minutes)
  2801. self.interface.RankMeleyRanking(line, name, members, time)
  2802. ########Anti Exp Button by Sanii##########
  2803. def AntiExp(self, qid):
  2804. constInfo.ANTI_EXP = int(qid)
  2805. def AntiExpState(self, state):
  2806. constInfo.ANTI_EXP_STATE = int(state)
  2807. ##########################################
  2808. # BONI_SWITCHER
  2809. def __BoniSwitcherChangeVisible(self):
  2810. if not self.boniSwitcherWnd[self.LastBoniSwitcherId].IsShow():
  2811. self.__HideAllBoniSwitcher()
  2812. self.boniSwitcherWnd[self.LastBoniSwitcherId].Show(FALSE)
  2813. else:
  2814. self.__HideAllBoniSwitcher()
  2815. def __BoniSwitcherShow(self, id):
  2816. lastId = self.LastBoniSwitcherId
  2817. self.LastBoniSwitcherId = id
  2818. if not self.boniSwitcherWnd[id].IsShow():
  2819. self.__HideAllBoniSwitcher()
  2820. (x, y) = self.boniSwitcherWnd[lastId].GetGlobalPosition()
  2821. self.boniSwitcherWnd[id].SetPosition(x, y)
  2822. self.boniSwitcherWnd[id].Show(FALSE)
  2823. def __BoniSwitcherHide(self, id):
  2824. if self.boniSwitcherWnd[id]:
  2825. self.boniSwitcherWnd[id].Hide()
  2826. def __HideAllBoniSwitcher(self):
  2827. for i in xrange(len(self.boniSwitcherWnd)):
  2828. self.__BoniSwitcherHide(i)
  2829. def __ResetBoniFromSwitcher(self):
  2830. constInfo.BONI_LIST_WEAPON = []
  2831. constInfo.BONI_LIST_WEAPON_ADDON = []
  2832. constInfo.BONI_LIST_ARMOR = []
  2833. constInfo.BONI_LIST_BRACELET = []
  2834. constInfo.BONI_LIST_BOOTS = []
  2835. constInfo.BONI_LIST_NECKLACE = []
  2836. constInfo.BONI_LIST_HELMET = []
  2837. constInfo.BONI_LIST_SHIELD = []
  2838. constInfo.BONI_LIST_EARRINGS = []
  2839. # ITEM_SHOP
  2840. def __ItemShopShow(self):
  2841. if not self.itemShopWnd:
  2842. import uiItemShop
  2843. self.itemShopWnd = uiItemShop.ItemShopBoard()
  2844. self.itemShopWnd.Show()
  2845. def __ISSetLoadButtonIndex(self, index):
  2846. constInfo.ITEM_SHOP_LOAD_BUTTON_INDEX = int(index)
  2847. def __ISSetBuyButtonIndex(self, index):
  2848. constInfo.ITEM_SHOP_BUY_BUTTON_INDEX = int(index)
  2849. def __ISGetBuyID(self):
  2850. if self.itemShopWnd:
  2851. net.SendQuestInputStringPacket(self.itemShopWnd.GetBuyItemString())
  2852. else:
  2853. net.SendQuestInputStringPacket("ERROR")
  2854. def __ISGetBuyID2(self):
  2855. if self.itemShopWnd:
  2856. net.SendQuestInputStringPacket(self.itemShopWnd.GetBuyItemString2())
  2857. else:
  2858. net.SendQuestInputStringPacket("ERROR")
  2859. def __Input0(self):
  2860. constInfo.INPUT_IGNORE = 0
  2861. def __Input1(self):
  2862. constInfo.INPUT_IGNORE = 1
  2863. def __ISAddCategory(self, catId, catName):
  2864. self.itemShopWnd.AddCategory(catId, catName.replace("[_]", " "))
  2865. def __primera_muerte(self):
  2866. self.primera_muerte.Show()
  2867. snd.PlaySound("sound/ui/primera_muerte.wav")
  2868. net.SendChatPacket("(primera_muerte)")
  2869. def __doble_muerte(self):
  2870. self.doble_muerte.Show()
  2871. snd.PlaySound("sound/ui/doble_muerte.wav")
  2872. net.SendChatPacket("(doble_muerte)")
  2873. def __triple_muerte(self):
  2874. self.triple_muerte.Show()
  2875. snd.PlaySound("sound/ui/triple_muerte.wav")
  2876. net.SendChatPacket("(triple_muerte)")
  2877. def __exterminio(self):
  2878. self.exterminio.Show()
  2879. snd.PlaySound("sound/ui/exterminio.wav")
  2880. net.SendChatPacket("(exterminio)")
  2881. def __muertacular(self):
  2882. self.muertacular.Show()
  2883. snd.PlaySound("sound/ui/muertacular.wav")
  2884. net.SendChatPacket("(muertacular)")
  2885. def __bestialidad(self):
  2886. self.bestialidad.Show()
  2887. snd.PlaySound("sound/ui/bestialidad.wav")
  2888. net.SendChatPacket("(bestialidad)")
  2889. def __salvajada(self):
  2890. self.salvajada.Show()
  2891. snd.PlaySound("sound/ui/salvajada.wav")
  2892. net.SendChatPacket("(salvajada)")
  2893. def __catastrofe(self):
  2894. self.catastrofe.Show()
  2895. snd.PlaySound("sound/ui/catastrofe.wav")
  2896. net.SendChatPacket("(catastrofe)")
  2897. def __apocalipsis(self):
  2898. self.apocalipsis.Show()
  2899. snd.PlaySound("sound/ui/apocalipsis.wav")
  2900. net.SendChatPacket("(apocalipsis)")
  2901. def __lluvia_muertos(self):
  2902. self.lluvia_muertos.Show()
  2903. snd.PlaySound("sound/ui/lluvia_muertos.wav")
  2904. net.SendChatPacket("(lluvia_muertos)")
  2905. def __super_increible(self):
  2906. self.super_increible.Show()
  2907. snd.PlaySound("sound/ui/super_increible.wav")
  2908. net.SendChatPacket("(super_increible)")
  2909. def __hidemedallas_gui(self):
  2910. self.Medallas_gui.Hide()
  2911. self.primera_muerte.Hide()
  2912. self.doble_muerte.Hide()
  2913. self.triple_muerte.Hide()
  2914. self.exterminio.Hide()
  2915. self.muertacular.Hide()
  2916. self.bestialidad.Hide()
  2917. self.salvajada.Hide()
  2918. self.catastrofe.Hide()
  2919. self.apocalipsis.Hide()
  2920. self.lluvia_muertos.Hide()
  2921. self.super_increible.Hide()
  2922. self.muertes.Hide()
  2923. def __showmedallas_gui(self):
  2924. self.Medallas_gui.Show()
  2925. self.muertes.Show()
  2926. def __muertes(self, muertes):
  2927. self.muertes.SetText(muertes)
  2928. def __ISSelectCategory(self, catId):
  2929. self.itemShopWnd.SelectCategory(catId)
  2930. def __ISClearItems(self):
  2931. self.itemShopWnd.Clear()
  2932. def __ISAddItem(self, catId, itemId, itemVnum, itemCount, itemCost, itemCostType, attr1, val1, attr2, val2, attr3, val3, attr4, val4, attr5, val5, attr6, val6, attr7, val7, sock1, sock2, sock3):
  2933. itemAttr = [[attr1, val1], [attr2, val2], [attr3, val3], [attr4, val4], [attr5, val5], [attr6, val6], [attr7, val7]]
  2934. for attr in itemAttr:
  2935. attr[0] = int(attr[0])
  2936. attr[1] = int(attr[1])
  2937. itemSocket = [int(sock1), int(sock2), int(sock3)]
  2938. self.curIsItem = {
  2939. "cat" : catId,
  2940. "id" : itemId,
  2941. "vnum" : itemVnum,
  2942. "count" : itemCount,
  2943. "desc" : "",
  2944. "cost" : itemCost,
  2945. "cost_type" : itemCostType,
  2946. "attr" : itemAttr,
  2947. "socket" : itemSocket,
  2948. }
  2949. def __ISAddItemDesc(self, itemDesc):
  2950. obj = self.curIsItem
  2951. if not obj:
  2952. return
  2953. obj["desc"] += itemDesc.replace("[_]", " ")
  2954. self.itemShopWnd.AddItem(obj["cat"], obj["id"], obj["vnum"], obj["count"], obj["desc"], obj["cost"], obj["cost_type"], obj["attr"], obj["socket"])
  2955. self.curIsItem = None
  2956. def __ISSetLoadSuccess(self):
  2957. self.itemShopWnd.SetLoadSuccess()
  2958. def __ISSetLoadFail(self):
  2959. self.itemShopWnd.SetLoadFail()
  2960. def __ISSetBuySuccess(self):
  2961. self.itemShopWnd.SetItemBuySuccess()
  2962. def __ISSetBuyFail(self):
  2963. self.itemShopWnd.SetItemBuyFail()
  2964. def __ISSetCoins(self, coins):
  2965. self.itemShopWnd.SetCoins(coins)
  2966. def __ISSetMarks(self, marks):
  2967. self.itemShopWnd.SetMarks(marks)
  2968. # END_ITEM_SHOP
  2969. def __AddBoniToSwitcher(self, EquipType, boniType):
  2970. EquipType = int(EquipType)
  2971. if EquipType == 1:
  2972. constInfo.BONI_LIST_WEAPON.append(int(boniType))
  2973. constInfo.BONI_LIST_WEAPON_ADDON.append(int(boniType))
  2974. elif EquipType == 2:
  2975. constInfo.BONI_LIST_ARMOR.append(int(boniType))
  2976. elif EquipType == 3:
  2977. constInfo.BONI_LIST_BRACELET.append(int(boniType))
  2978. elif EquipType == 4:
  2979. constInfo.BONI_LIST_BOOTS.append(int(boniType))
  2980. elif EquipType == 5:
  2981. constInfo.BONI_LIST_NECKLACE.append(int(boniType))
  2982. elif EquipType == 6:
  2983. constInfo.BONI_LIST_HELMET.append(int(boniType))
  2984. elif EquipType == 7:
  2985. constInfo.BONI_LIST_SHIELD.append(int(boniType))
  2986. elif EquipType == 8:
  2987. constInfo.BONI_LIST_EARRINGS.append(int(boniType))
  2988. elif EquipType == 9:
  2989. constInfo.BONI_LIST_WEAPON_ADDON.append(int(boniType))
  2990. def __AddMaxValueToBoni(self, boniType, maxValue):
  2991. constInfo.BONI_LIST_MAX_VALUE[int(boniType)] = int(maxValue)
  2992. def __SetBoniSwitcherLoad(self):
  2993. constInfo.BONI_SWITCHER_LOAD = TRUE
  2994. def __BoniSwitcherCheckEvent(self, slotPos):
  2995. for boniSwitcher in self.boniSwitcherWnd:
  2996. if boniSwitcher.aktItemPos == int(slotPos):
  2997. return TRUE
  2998. return FALSE
  2999. # END_BONI_SWITCHER
  3000. def __antiexp(self, qid):
  3001. constInfo.antiexp = int(qid)
  3002. #def __puttonshops(self, qid):
  3003. #constInfo.puttonshops = int(qid)
  3004. def Teleport(self, getString):
  3005. if getString.find("index") != -1:
  3006. self.teleport.UpdateIndex(int(getString.split("x")[1]))
  3007. else:
  3008. constInfo.SendString = str(self.teleport.SendToServer)
  3009. constInfo.CApiSetHide = 1
  3010. def __evento_ultimo_superviviente(self):
  3011. import net
  3012. net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING)
  3013. def __Switcher(self):
  3014. import uiswitch
  3015. self.wndSwitch = uiswitch.Switcher()
  3016. self.wndSwitch.Show()
  3017. # def __menubg2(self):
  3018. # if constInfo.MENU_BG2 == 0:
  3019. # constInfo.MENU_BG2 = 1
  3020. # self.menu_bg2.Show()
  3021. # self.Activare_Menu2.Hide()
  3022. # self.Dezactivare_Menu2.Show()
  3023. # else:
  3024. # constInfo.MENU_BG2 = 0
  3025. # self.menu_bg2.Hide()
  3026. # self.Activare_Menu2.Show()
  3027. # self.Dezactivare_Menu2.Hide()
  3028. # def __DMAGAZIN_questindex(self, value):
  3029. # constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX = int(value)
  3030. # def __DeschidereMagazin(self):
  3031. # DeschidereMagazin = constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX
  3032. # event.QuestButtonClick(DeschidereMagazin)
  3033. def __toggleSwitchbot(self):
  3034. if self.switchbot.bot_shown == 1:
  3035. self.switchbot.Hide()
  3036. else:
  3037. self.switchbot.Show()
  3038. # def __menubg(self):
  3039. ## if constInfo.MENU_BG == 0:
  3040. # constInfo.MENU_BG = 1
  3041. # self.menu_bg.Show()
  3042. # self.Activare_Menu.Hide()
  3043. # self.Dezactivare_Menu.Show()
  3044. # else:
  3045. # constInfo.MENU_BG = 0
  3046. # self.menu_bg.Hide()
  3047. # self.Activare_Menu.Show()
  3048. # self.Dezactivare_Menu.Hide()
  3049. # def __BonusPage(self):
  3050. # import uibonuspage
  3051. # self.wndBonus = uibonuspage.BonusBoardDialog()
  3052. # self.wndBonus.Show()
  3053. # switchbot
  3054. # def __JINHAN(self):
  3055. # import uistatusup
  3056. # self.wndJinHan = uistatusup.StatusUp()
  3057. # self.wndJinHan.Show()
  3058. # END_switchbot
  3059. def __bonus_questindex(self, value3):
  3060. constInfo.BONUS_QUESTINDEX = int(value3)
  3061. def __activare_bonus(self):
  3062. activare_bonus = constInfo.BONUS_QUESTINDEX
  3063. event.QuestButtonClick(activare_bonus)
  3064. def __depozit_questindex(self, qid):
  3065. constInfo.Depoport= int(qid)
  3066. def __activare_depozit(self):
  3067. activare_depozit = constInfo.DEPOZIT_QUESTINDEX
  3068. event.QuestButtonClick(activare_depozit)
  3069. def __antiexp_questindex(self, value1):
  3070. constInfo.ANTIEXP_QUESTINDEX = int(value1)
  3071. def __activare_antiexp(self):
  3072. activare_antiexp = constInfo.ANTIEXP_QUESTINDEX
  3073. event.QuestButtonClick(activare_antiexp)
  3074. def __teleporter_questindex(self, value2):
  3075. constInfo.TELEPORTER_QUESTINDEX = int(value2)
  3076. def __activare_teleporter(self):
  3077. activare_teleporter = constInfo.TELEPORTER_QUESTINDEX
  3078. event.QuestButtonClick(activare_teleporter)
  3079. def showtransfer(self):
  3080. import uiTransfer
  3081. self.TransferWnd = uiTransfer.TransferWindow()
  3082. self.TransferWnd.Open()
  3083. def Denn7(self, data):
  3084. dane = data.split("|")
  3085. constInfo.PLAYER_LEVEL = str(dane[0])
  3086. def Denn8(self, data):
  3087. dane = data.split("|")
  3088. constInfo.PLAYER_NAMEE = str(dane[0])
  3089. def Den7(self, id):
  3090. constInfo.STHX2 = int(id)
  3091. def GetInputOn7(self):
  3092. constInfo.INPUT_IGNORE = 1
  3093. def GetInputOff7(self):
  3094. constInfo.INPUT_IGNORE = 0
  3095. def GetInputValue7(self): # HP Sistemi de?er girilen sayi*
  3096. net.SendQuestInputStringPacket(str(constInfo.VID2))
  3097. #def OpenQuestWindow(self, skin, idx):
  3098. # if constInfo.INPUT_IGNORE == 1:
  3099. # return
  3100. # else:
  3101. # self.interface.OpenQuestWindow(skin, idx)
  3102. #def __showbonus(self):
  3103. # serex = uibonuspage.BonusBoardDialog()
  3104. def __showbonus(self):
  3105. import uiBonusPage
  3106. global bonuspp
  3107. try:
  3108. if bonuspp != 1:
  3109. exec 'uiBonusPage.BonusBoardDialog().Show()'
  3110. else:
  3111. pass
  3112. except ImportError:
  3113. import dbg,app
  3114. dbg.Trace('uiBonusPage.py Importing error')
  3115. app.Abort()
  3116. # guildstorage begin
  3117. def _GuildStorageCMD(self, command):
  3118. cmd = command.split("/")
  3119. if cmd[0] == "OPEN":
  3120. self.interface.GuildStorageWindow.Open(int(cmd[1]))
  3121. elif cmd[0] == "REFRESH":
  3122. self.interface.GuildStorageWindow.RefreshSlots()
  3123. elif cmd[0] == "REFRESH_MONEY":
  3124. self.interface.GuildStorageWindow.SetMoney(cmd[1])
  3125. elif cmd[0] == "REFRESH_MEMBERS":
  3126. self.interface.GuildStorageWindow.Adminpanel["board"].RefreshMembers()
  3127. elif cmd[0] == "CLEAR_TEMPSLOTS":
  3128. constInfo.GUILDSTORAGE["tempslots"] = {"TAB0" : {},"TAB1" : {},"TAB2" : {}}
  3129. elif cmd[0] == "COMPARE_TEMPSLOTS":
  3130. for i in range(3):
  3131. if constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)] != constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)]:
  3132. constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = {}
  3133. constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)]
  3134. self.interface.GuildStorageWindow.RefreshSlots()
  3135. elif cmd[0] == "QID":
  3136. self.GuildStorageQID(cmd[1])
  3137. elif cmd[0] == "QUESTCMD":
  3138. self._GuildStorageQuestCMD()
  3139. #self.teleport = uiteleport.TeleportWindow()
  3140. elif cmd[0] == "MEMBER_COMPLETE":
  3141. constInfo.GUILDSTORAGE["members"] = {}
  3142. self.interface.GuildStorageWindow.ClearMembers()
  3143. import event
  3144. constInfo.GUILDSTORAGE["questCMD"] = "GETMEMBERLIST"
  3145. event.QuestButtonClick(int(constInfo.GUILDSTORAGE["qid"]))
  3146. def _GuildStorageAddItemSlot(self, slot, tab ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
  3147. self.interface.GuildStorageWindow.AddItemSlot(slot, tab ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6)
  3148. def _GuildStorageAddItem(self, slot ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
  3149. slotsWidth = 15
  3150. slotsHeight = 8
  3151. slot = int(slot)
  3152. if slot <= 120:
  3153. constInfo.GUILDSTORAGE["slots"]["TAB0"][slot] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  3154. elif slot > 120 and slot <= 240:
  3155. constInfo.GUILDSTORAGE["slots"]["TAB1"][slot-120] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  3156. elif slot > 240 and slot <= 360:
  3157. constInfo.GUILDSTORAGE["slots"]["TAB2"][slot-240] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  3158. def _GuildStorageTempSlotsAdd(self,slot ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
  3159. slot = int(slot)
  3160. if slot <= 120:
  3161. constInfo.GUILDSTORAGE["tempslots"]["TAB0"][slot] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  3162. elif slot > 120 and slot <= 240:
  3163. constInfo.GUILDSTORAGE["tempslots"]["TAB1"][slot-120] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  3164. elif slot > 240 and slot <= 360:
  3165. constInfo.GUILDSTORAGE["tempslots"]["TAB2"][slot-240] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  3166. def _GuildStorageAddLog(self,id,name,date,type,do,desc):
  3167. self.interface.GuildStorageWindow.LogsInsert(id,name,date,type,do,desc)
  3168. constInfo.GUILDSTORAGE["logs"][int(id)] = [name,date,type,do,desc]
  3169. def _GuildStorageQuestCMD(self):
  3170. net.SendQuestInputStringPacket(str(constInfo.GUILDSTORAGE["questCMD"]))
  3171. constInfo.GUILDSTORAGE["questCMD"] = "NULL#"
  3172. def GuildStorageQID(self, qid):
  3173. constInfo.GUILDSTORAGE["qid"] = int(qid)
  3174. def _GuildStorageAddMemberToList(self,memberId,member,authority0,authority1,authority2,authority3):
  3175. constInfo.GUILDSTORAGE["members"]["member"+memberId] = [member,int(authority0),int(authority1),int(authority2),int(authority3)]
  3176. # Guildstorage end
  3177. def __MountSystem(self, info, i=0):
  3178. if info=="Item":
  3179. if i!=0:
  3180. constInfo.MountSystem["index"] = int(i)
  3181. self.MountingSystem.Open()
  3182. elif info=="Input":
  3183. net.SendQuestInputStringPacket(str(constInfo.MountSystem["CMD"]))
  3184. def __SchicksalRad(self, cmd):
  3185. CMD = cmd.split("/")
  3186. if CMD[0]=="index":
  3187. constInfo.SCHICKSAL_RAD["index"] = int(CMD[1])
  3188. constInfo.SCHICKSAL_RAD["kosten"] = int(CMD[2])
  3189. constInfo.SCHICKSAL_RAD["free"] = int(CMD[3])
  3190. elif CMD[0]=="input":
  3191. net.SendQuestInputStringPacket(str(constInfo.SCHICKSAL_RAD["ServerCMD"]))
  3192. elif CMD[0]=="free":
  3193. constInfo.SCHICKSAL_RAD["free"] = int(CMD[1])
  3194. elif CMD[0]=="Answer":
  3195. self.SchicksalRad.SetVars(CMD[1], CMD[2], CMD[3], CMD[4], CMD[5])
  3196. constInfo.SCHICKSAL_RAD["free"] = int(CMD[6])
  3197. def __guinameOPEN(self): # use different function names!
  3198. import schicksalrad
  3199. self.SchicksalRad = schicksalrad.RadDesSchicksals()
  3200. self.SchicksalRad.Open()() # naturally use the code which is provided for the GUI
  3201. def __hidekillgui(self):
  3202. self.KillGuiBg.Hide()
  3203. self.KillBlauReich.Hide()
  3204. self.KillGelbReich.Hide()
  3205. self.KillRotReich.Hide()
  3206. self.KillMob.Hide()
  3207. def __showkillgui(self):
  3208. self.KillGuiBg.Show()
  3209. self.KillBlauReich.Show()
  3210. self.KillGelbReich.Show()
  3211. self.KillRotReich.Show()
  3212. self.KillMob.Show()
  3213. def __KillBlauReich(self, KillBlauReich):
  3214. self.KillBlauReich.SetText(localeInfo.KEV_JENO_EMPIRE_GUI + KillBlauReich)
  3215. def __KillGelbReich(self, KillGelbReich):
  3216. self.KillGelbReich.SetText(localeInfo.KEV_SHNJO_EMPIRE_GUI + KillGelbReich)
  3217. def __KillRotReich(self, KillRotReich):
  3218. self.KillRotReich.SetText(localeInfo.KEV_SHEINSO_EMPIRE_GUI + KillRotReich)
  3219. def __KillMob(self, KillMob):
  3220. self.KillMob.SetText(localeInfo.KEV_MONSTER_KILL_GUI + KillMob)
  3221. def __OpenKillGui(self):
  3222. self.KillGuiBg_open.Hide()
  3223. self.KillBlauReich.Show()
  3224. self.KillGelbReich.Show()
  3225. self.KillRotReich.Show()
  3226. self.KillMob.Show()
  3227. self.KillGuiBg.SetPosition(+1,465)
  3228. self.KillGuiBg_close.Show()
  3229. def __CloseKillGui(self):
  3230. self.KillGuiBg_close.Hide()
  3231. self.KillBlauReich.Hide()
  3232. self.KillGelbReich.Hide()
  3233. self.KillRotReich.Hide()
  3234. self.KillMob.Hide()
  3235. self.KillGuiBg.SetPosition(-166,465)
  3236. self.KillGuiBg_open.Show()
  3237. def __Team_On(self, name):
  3238. if self.interface.wndMessenger:
  3239. self.interface.wndMessenger.OnLogin(2, name)
  3240. def __Team_Off(self, name):
  3241. if self.interface.wndMessenger:
  3242. self.interface.wndMessenger.OnLogout(2, name)
  3243. def __FTeam_On(self, name):
  3244. if self.interface.wndMessenger:
  3245. self.interface.wndMessenger.OnLogin(3, name)
  3246. def __FTeam_Off(self, name):
  3247. if self.interface.wndMessenger:
  3248. self.interface.wndMessenger.OnLogout(3, name)
  3249. if app.SKILL_COOLTIME_UPDATE:
  3250. def SkillClearCoolTime(self, slotIndex):
  3251. self.interface.SkillClearCoolTime(slotIndex)
  3252. '''
  3253. def ClickOpen_Shops(self):
  3254. import event
  3255. import constInfo
  3256. qid = constInfo.puttonshops
  3257. event.QuestButtonClick(qid)
  3258. def ClickOpen_YouTube(self):
  3259. chat.AppendChat(CHAT_TYPE_INFO, "under edit")
  3260. '''
Comments powered by Disqus