Guest User

game.py

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