Advertisement
Guest User

Untitled

a guest
Jan 27th, 2021
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 82.47 KB | None
  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 snd
  11. import chat
  12. import textTail
  13. import snd
  14. import net
  15. import effect
  16. import wndMgr
  17. import fly
  18. import systemSetting
  19. import quest
  20. import guild
  21. import skill
  22. import messenger
  23. import localeInfo
  24. import constInfo
  25. import exchange
  26. import ime
  27.  
  28. import ui
  29. import uiCommon
  30. import uiPhaseCurtain
  31. import uiMapNameShower
  32. import uiAffectShower
  33. import uiPlayerGauge
  34. import uiCharacter
  35. import uiTarget
  36. import serverInfo
  37. # PRIVATE_SHOP_PRICE_LIST
  38. import uiPrivateShopBuilder
  39. # END_OF_PRIVATE_SHOP_PRICE_LIST
  40.  
  41. import mouseModule
  42. import consoleModule
  43. import localeInfo
  44.  
  45. import playerSettingModule
  46. import interfaceModule
  47.  
  48. import musicInfo
  49. import debugInfo
  50. import stringCommander
  51. import uimall
  52.  
  53. from _weakref import proxy
  54.  
  55. # SCREENSHOT_CWDSAVE
  56. SCREENSHOT_CWDSAVE = True
  57. SCREENSHOT_DIR = None
  58.  
  59. cameraDistance = 1550.0
  60. cameraPitch = 27.0
  61. cameraRotation = 0.0
  62. cameraHeight = 100.0
  63.  
  64. testAlignment = 0
  65.  
  66. class GameWindow(ui.ScriptWindow):
  67. def __init__(self, stream):
  68. ui.ScriptWindow.__init__(self, "GAME")
  69. self.SetWindowName("game")
  70. net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  71. player.SetGameWindow(self)
  72.  
  73. import dailygift
  74. self.wnddailygift = dailygift.DailyGift()
  75.  
  76. self.quickSlotPageIndex = 0
  77. self.lastPKModeSendedTime = 0
  78. self.pressNumber = None
  79.  
  80. self.guildWarQuestionDialog = None
  81. self.interface = None
  82. self.targetBoard = None
  83. self.console = None
  84. self.mapNameShower = None
  85. self.affectShower = None
  86. self.playerGauge = None
  87.  
  88. self.stream=stream
  89. self.interface = interfaceModule.Interface()
  90. self.interface.MakeInterface()
  91. self.interface.ShowDefaultWindows()
  92.  
  93. self.curtain = uiPhaseCurtain.PhaseCurtain()
  94. self.curtain.speed = 0.03
  95. self.curtain.Hide()
  96.  
  97. self.targetBoard = uiTarget.TargetBoard()
  98. self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  99. self.targetBoard.Hide()
  100.  
  101. self.console = consoleModule.ConsoleWindow()
  102. self.console.BindGameClass(self)
  103. self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  104. self.console.Hide()
  105.  
  106. self.mapNameShower = uiMapNameShower.MapNameShower()
  107. self.affectShower = uiAffectShower.AffectShower()
  108.  
  109. self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  110. self.playerGauge.Hide()
  111.  
  112. self.itemDropQuestionDialog = None
  113.  
  114. self.__SetQuickSlotMode()
  115.  
  116. self.__ServerCommand_Build()
  117. self.__ProcessPreservedServerCommand()
  118.  
  119. def __del__(self):
  120. player.SetGameWindow(0)
  121. net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  122. ui.ScriptWindow.__del__(self)
  123.  
  124. def Open(self):
  125. app.SetFrameSkip(1)
  126.  
  127. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  128.  
  129. self.quickSlotPageIndex = 0
  130. self.PickingCharacterIndex = -1
  131. self.PickingItemIndex = -1
  132. self.consoleEnable = False
  133. self.isShowDebugInfo = False
  134. self.ShowNameFlag = False
  135.  
  136. self.enableXMasBoom = False
  137. self.startTimeXMasBoom = 0.0
  138. self.indexXMasBoom = 0
  139.  
  140. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  141.  
  142. app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  143.  
  144. constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  145. constInfo.SET_DEFAULT_CHRNAME_COLOR()
  146. constInfo.SET_DEFAULT_FOG_LEVEL()
  147. constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  148. constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  149. constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  150.  
  151. # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  152. constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  153. # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  154.  
  155. import event
  156. event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
  157.  
  158. textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  159.  
  160. #RACHAS#
  161. Medallas_gui = ui.AniImageBox()
  162. Medallas_gui.SetWindowHorizontalAlignLeft()
  163. Medallas_gui.SetWindowVerticalAlignTop()
  164. Medallas_gui.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  165. self.Medallas_gui = Medallas_gui
  166. self.Medallas_gui.SetPosition(10, 40)
  167.  
  168. self.muertes = ui.TextLine()
  169. self.muertes.SetDefaultFontName()
  170. self.muertes.SetParent(Medallas_gui)
  171. self.muertes.SetPosition(14, 7)
  172. self.muertes.SetText("0")
  173. self.muertes.SetOutline()
  174.  
  175. self.primera_muerte = ui.AniImageBox()
  176. self.primera_muerte.SetParent(Medallas_gui)
  177. self.primera_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/1.dds")
  178. self.primera_muerte.SetPosition(35, 0)
  179.  
  180. self.doble_muerte = ui.AniImageBox()
  181. self.doble_muerte.SetParent(Medallas_gui)
  182. self.doble_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/2.dds")
  183. self.doble_muerte.SetPosition(35 + 33, 0)
  184.  
  185. self.triple_muerte = ui.AniImageBox()
  186. self.triple_muerte.SetParent(Medallas_gui)
  187. self.triple_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/3.dds")
  188. self.triple_muerte.SetPosition(35 + 33 + 33, 0)
  189.  
  190. self.exterminio = ui.AniImageBox()
  191. self.exterminio.SetParent(Medallas_gui)
  192. self.exterminio.AppendImage("d:/ymir work/ui/pattern/medallas/4.dds")
  193. self.exterminio.SetPosition(35+ 33+ 33 + 33, 0)
  194.  
  195. self.muertacular = ui.AniImageBox()
  196. self.muertacular.SetParent(Medallas_gui)
  197. self.muertacular.AppendImage("d:/ymir work/ui/pattern/medallas/5.dds")
  198. self.muertacular.SetPosition(35+ 33+ 33+ 33 + 33, 0)
  199.  
  200. self.bestialidad = ui.AniImageBox()
  201. self.bestialidad.SetParent(Medallas_gui)
  202. self.bestialidad.AppendImage("d:/ymir work/ui/pattern/medallas/6.dds")
  203. self.bestialidad.SetPosition(35+ 33+ 33+ 33+ 33 + 33, 0)
  204.  
  205. self.salvajada = ui.AniImageBox()
  206. self.salvajada.SetParent(Medallas_gui)
  207. self.salvajada.AppendImage("d:/ymir work/ui/pattern/medallas/7.dds")
  208. self.salvajada.SetPosition(35+ 33+ 33+ 33+ 33+ 33 + 33, 0)
  209.  
  210. self.catastrofe = ui.AniImageBox()
  211. self.catastrofe.SetParent(Medallas_gui)
  212. self.catastrofe.AppendImage("d:/ymir work/ui/pattern/medallas/8.dds")
  213. self.catastrofe.SetPosition(35+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 0)
  214.  
  215. self.apocalipsis = ui.AniImageBox()
  216. self.apocalipsis.SetParent(Medallas_gui)
  217. self.apocalipsis.AppendImage("d:/ymir work/ui/pattern/medallas/9.dds")
  218. self.apocalipsis.SetPosition(35+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 0)
  219.  
  220. self.lluvia_muertos = ui.AniImageBox()
  221. self.lluvia_muertos.SetParent(Medallas_gui)
  222. self.lluvia_muertos.AppendImage("d:/ymir work/ui/pattern/medallas/10.dds")
  223. self.lluvia_muertos.SetPosition(35+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 0)
  224.  
  225. self.super_increible = ui.AniImageBox()
  226. self.super_increible.SetParent(Medallas_gui)
  227. self.super_increible.AppendImage("d:/ymir work/ui/pattern/medallas/11.dds")
  228. self.super_increible.SetPosition(35+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 0)
  229.  
  230. #RACHAS#
  231.  
  232. self.daily_reward = ui.Button()
  233. self.daily_reward.SetParent(self)
  234. self.daily_reward.SetPosition(wndMgr.GetScreenWidth()-300,35)
  235. self.daily_reward.SetUpVisual("icon/item/premio0.tga")
  236. self.daily_reward.SetOverVisual("icon/item/premio1.tga")
  237. self.daily_reward.SetDownVisual("icon/item/premio1.tga")
  238. self.daily_reward.SetToolTipText("Daily Rewards")
  239. self.daily_reward.SetEvent(lambda : self.ManagerGiftSystem("Show|"))
  240. self.daily_reward.Show()
  241.  
  242. if constInfo.PVPMODE_TEST_ENABLE:
  243. self.testPKMode = ui.TextLine()
  244. self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT)
  245. self.testPKMode.SetPosition(0, 15)
  246. self.testPKMode.SetWindowHorizontalAlignCenter()
  247. self.testPKMode.SetHorizontalAlignCenter()
  248. self.testPKMode.SetFeather()
  249. self.testPKMode.SetOutline()
  250. self.testPKMode.Show()
  251.  
  252. self.testAlignment = ui.TextLine()
  253. self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT)
  254. self.testAlignment.SetPosition(0, 35)
  255. self.testAlignment.SetWindowHorizontalAlignCenter()
  256. self.testAlignment.SetHorizontalAlignCenter()
  257. self.testAlignment.SetFeather()
  258. self.testAlignment.SetOutline()
  259. self.testAlignment.Show()
  260.  
  261. self.__BuildKeyDict()
  262. self.__BuildDebugInfo()
  263.  
  264. # PRIVATE_SHOP_PRICE_LIST
  265. uiPrivateShopBuilder.Clear()
  266. # END_OF_PRIVATE_SHOP_PRICE_LIST
  267.  
  268. # UNKNOWN_UPDATE
  269. exchange.InitTrading()
  270. # END_OF_UNKNOWN_UPDATE
  271.  
  272.  
  273. ## Sound
  274. snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  275. snd.SetSoundVolume(systemSetting.GetSoundVolume())
  276.  
  277. netFieldMusicFileName = net.GetFieldMusicFileName()
  278. if netFieldMusicFileName:
  279. snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  280. elif musicInfo.fieldMusic != "":
  281. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  282.  
  283. self.__SetQuickSlotMode()
  284. self.__SelectQuickPage(self.quickSlotPageIndex)
  285.  
  286. self.SetFocus()
  287. self.Show()
  288. app.ShowCursor()
  289.  
  290. net.SendEnterGamePacket()
  291.  
  292. # START_GAME_ERROR_EXIT
  293. try:
  294. self.StartGame()
  295. except:
  296. import exception
  297. exception.Abort("GameWindow.Open")
  298. # END_OF_START_GAME_ERROR_EXIT
  299.  
  300. # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ]
  301. self.cubeInformation = {}
  302. self.currentCubeNPC = 0
  303.  
  304. def Close(self):
  305. self.Hide()
  306.  
  307. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  308. (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  309.  
  310. if musicInfo.fieldMusic != "":
  311. snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  312.  
  313. self.onPressKeyDict = None
  314. self.onClickKeyDict = None
  315.  
  316. chat.Close()
  317. snd.StopAllSound()
  318. grp.InitScreenEffect()
  319. chr.Destroy()
  320. textTail.Clear()
  321. quest.Clear()
  322. background.Destroy()
  323. guild.Destroy()
  324. messenger.Destroy()
  325. skill.ClearSkillData()
  326. wndMgr.Unlock()
  327. mouseModule.mouseController.DeattachObject()
  328.  
  329. if self.guildWarQuestionDialog:
  330. self.guildWarQuestionDialog.Close()
  331.  
  332. self.guildNameBoard = None
  333. self.partyRequestQuestionDialog = None
  334. self.partyInviteQuestionDialog = None
  335. self.guildInviteQuestionDialog = None
  336. self.guildWarQuestionDialog = None
  337. self.messengerAddFriendQuestion = None
  338.  
  339. # UNKNOWN_UPDATE
  340. self.itemDropQuestionDialog = None
  341. # END_OF_UNKNOWN_UPDATE
  342.  
  343. # QUEST_CONFIRM
  344. self.confirmDialog = None
  345. # END_OF_QUEST_CONFIRM
  346.  
  347. self.PrintCoord = None
  348. self.FrameRate = None
  349. self.Pitch = None
  350. self.Splat = None
  351. self.TextureNum = None
  352. self.ObjectNum = None
  353. self.ViewDistance = None
  354. self.PrintMousePos = None
  355.  
  356. self.ClearDictionary()
  357.  
  358. self.playerGauge = None
  359. self.mapNameShower = None
  360. self.affectShower = None
  361.  
  362. if self.console:
  363. self.console.BindGameClass(0)
  364. self.console.Close()
  365. self.console=None
  366.  
  367. if self.targetBoard:
  368. self.targetBoard.Destroy()
  369. self.targetBoard = None
  370.  
  371. if self.interface:
  372. self.interface.HideAllWindows()
  373. self.interface.Close()
  374. self.interface=None
  375.  
  376. player.ClearSkillDict()
  377. player.ResetCameraRotation()
  378.  
  379. self.KillFocus()
  380. app.HideCursor()
  381.  
  382. print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  383.  
  384. def __BuildKeyDict(self):
  385. onPressKeyDict = {}
  386.  
  387.  
  388. onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(1)
  389. onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(2)
  390. onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(3)
  391. onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(4)
  392. onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5)
  393. onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6)
  394. onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7)
  395. onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8)
  396. onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9)
  397. onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(4)
  398. onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(5)
  399. onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(6)
  400. onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
  401. onPressKeyDict[app.DIK_F5] = lambda : self.interface.ToggleSwitchbotWindow()
  402. if app.ENABLE_DUNGEON_INFO_SYSTEM:
  403. onPressKeyDict[app.DIK_F6] = lambda : self.interface.ShowDungeonInfoInterface()
  404. onPressKeyDict[app.DIK_F7] = lambda : self.__toggleSwitchbot22()
  405.  
  406. onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()
  407. onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage()
  408. onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen()
  409. onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack()
  410.  
  411. onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp()
  412. onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown()
  413. onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft()
  414. onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight()
  415. onPressKeyDict[app.DIK_W] = lambda : self.MoveUp()
  416. onPressKeyDict[app.DIK_S] = lambda : self.MoveDown()
  417. onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft()
  418. onPressKeyDict[app.DIK_D] = lambda : self.MoveRight()
  419.  
  420. onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  421. onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  422. #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  423. onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  424. onPressKeyDict[app.DIK_G] = self.__PressGKey
  425. onPressKeyDict[app.DIK_Q] = self.__PressQKey
  426.  
  427. onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera()
  428. onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  429. onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  430. onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  431. onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  432. onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  433. onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  434. onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem()
  435. onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem()
  436. onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  437. onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  438. #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  439. onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  440. onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow()
  441. onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo()
  442. onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey()
  443. #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow()
  444. onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp()
  445. onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown()
  446. onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow()
  447. onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key
  448. onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode()
  449.  
  450. onPressKeyDict[app.DIK_J] = lambda : self.BINARY_DROP_ITEM_OPEN()
  451. onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey()
  452. onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey()
  453. onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
  454.  
  455. # CUBE_TEST
  456. #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow()
  457. # CUBE_TEST_END
  458.  
  459. self.onPressKeyDict = onPressKeyDict
  460.  
  461. onClickKeyDict = {}
  462. onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  463. onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  464. onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  465. onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  466. onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  467.  
  468. onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  469. onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  470. onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  471. onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  472. onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  473. onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  474. onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  475. onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  476. onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  477. onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  478. onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  479. onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  480. onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  481. onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  482. onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  483. onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  484. onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  485. onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  486. onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  487.  
  488. #if constInfo.PVPMODE_ACCELKEY_ENABLE:
  489. # onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode()
  490.  
  491. self.onClickKeyDict=onClickKeyDict
  492.  
  493. def __toggleSwitchbot22(self):
  494. import targetTest
  495. self.Dialo = targetTest.Dialog1()
  496. self.Dialo.Show()
  497.  
  498. def __PressNumKey(self,num):
  499. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  500.  
  501. if num >= 1 and num <= 9:
  502. if(chrmgr.IsPossibleEmoticon(-1)):
  503. chrmgr.SetEmoticon(-1,int(num)-1)
  504. net.SendEmoticon(int(num)-1)
  505. else:
  506. if num >= 1 and num <= 4:
  507. self.pressNumber(num-1)
  508.  
  509. def __ClickBKey(self):
  510. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  511. return
  512. else:
  513. if constInfo.PVPMODE_ACCELKEY_ENABLE:
  514. self.ChangePKMode()
  515.  
  516.  
  517. def __PressJKey(self):
  518. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  519. if player.IsMountingHorse():
  520. net.SendChatPacket("/unmount")
  521. else:
  522. #net.SendChatPacket("/user_horse_ride")
  523. if not uiPrivateShopBuilder.IsBuildingPrivateShop():
  524. for i in xrange(player.INVENTORY_PAGE_SIZE*player.INVENTORY_PAGE_COUNT):
  525. if player.GetItemIndex(i) in (71114, 71116, 71118, 71120):
  526. net.SendItemUsePacket(i)
  527. break
  528. def __PressHKey(self):
  529. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  530. net.SendChatPacket("/user_horse_ride")
  531. else:
  532. self.interface.OpenHelpWindow()
  533.  
  534. def __PressBKey(self):
  535. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  536. net.SendChatPacket("/user_horse_back")
  537. else:
  538. state = "EMOTICON"
  539. self.interface.ToggleCharacterWindow(state)
  540.  
  541. def __PressFKey(self):
  542. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  543. net.SendChatPacket("/user_horse_feed")
  544. else:
  545. app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  546.  
  547. def __PressGKey(self):
  548. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  549. net.SendChatPacket("/ride")
  550. else:
  551. if self.ShowNameFlag:
  552. self.interface.ToggleGuildWindow()
  553. else:
  554. app.PitchCamera(app.CAMERA_TO_POSITIVE)
  555.  
  556. def __ReleaseGKey(self):
  557. app.PitchCamera(app.CAMERA_STOP)
  558.  
  559. def __PressQKey(self):
  560. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  561. if 0==interfaceModule.IsQBHide:
  562. interfaceModule.IsQBHide = 1
  563. self.interface.HideAllQuestButton()
  564. else:
  565. interfaceModule.IsQBHide = 0
  566. self.interface.ShowAllQuestButton()
  567. else:
  568. app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  569.  
  570. def __SetQuickSlotMode(self):
  571. self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  572.  
  573. def __SetQuickPageMode(self):
  574. self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  575.  
  576. def __PressQuickSlot(self, localSlotIndex):
  577. if localeInfo.IsARABIC():
  578. if 0 <= localSlotIndex and localSlotIndex < 4:
  579. player.RequestUseLocalQuickSlot(3-localSlotIndex)
  580. else:
  581. player.RequestUseLocalQuickSlot(11-localSlotIndex)
  582. else:
  583. player.RequestUseLocalQuickSlot(localSlotIndex)
  584.  
  585. def __SelectQuickPage(self, pageIndex):
  586. self.quickSlotPageIndex = pageIndex
  587. player.SetQuickPage(pageIndex)
  588.  
  589. def ToggleDebugInfo(self):
  590. self.isShowDebugInfo = not self.isShowDebugInfo
  591.  
  592. if self.isShowDebugInfo:
  593. self.PrintCoord.Show()
  594. self.FrameRate.Show()
  595. self.Pitch.Show()
  596. self.Splat.Show()
  597. self.TextureNum.Show()
  598. self.ObjectNum.Show()
  599. self.ViewDistance.Show()
  600. self.PrintMousePos.Show()
  601. else:
  602. self.PrintCoord.Hide()
  603. self.FrameRate.Hide()
  604. self.Pitch.Hide()
  605. self.Splat.Hide()
  606. self.TextureNum.Hide()
  607. self.ObjectNum.Hide()
  608. self.ViewDistance.Hide()
  609. self.PrintMousePos.Hide()
  610.  
  611. def __BuildDebugInfo(self):
  612. ## Character Position Coordinate
  613. self.PrintCoord = ui.TextLine()
  614. self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
  615. self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  616.  
  617. ## Frame Rate
  618. self.FrameRate = ui.TextLine()
  619. self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  620. self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  621.  
  622. ## Camera Pitch
  623. self.Pitch = ui.TextLine()
  624. self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
  625. self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  626.  
  627. ## Splat
  628. self.Splat = ui.TextLine()
  629. self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
  630. self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  631.  
  632. ##
  633. self.PrintMousePos = ui.TextLine()
  634. self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
  635. self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  636.  
  637. # TextureNum
  638. self.TextureNum = ui.TextLine()
  639. self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
  640. self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  641.  
  642. self.ObjectNum = ui.TextLine()
  643. self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
  644. self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
  645.  
  646. self.ViewDistance = ui.TextLine()
  647. self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
  648. self.ViewDistance.SetPosition(0, 0)
  649.  
  650. def __NotifyError(self, msg):
  651. chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  652.  
  653. def ChangePKMode(self):
  654.  
  655. if not app.IsPressed(app.DIK_LCONTROL):
  656. return
  657.  
  658. if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  659. self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  660. return
  661.  
  662. curTime = app.GetTime()
  663. if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  664. return
  665.  
  666. self.lastPKModeSendedTime = curTime
  667.  
  668. curPKMode = player.GetPKMode()
  669. nextPKMode = curPKMode + 1
  670. if nextPKMode == player.PK_MODE_PROTECT:
  671. if 0 == player.GetGuildID():
  672. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  673. nextPKMode = 0
  674. else:
  675. nextPKMode = player.PK_MODE_GUILD
  676.  
  677. elif nextPKMode == player.PK_MODE_MAX_NUM:
  678. nextPKMode = 0
  679.  
  680. net.SendChatPacket("/PKMode " + str(nextPKMode))
  681. print "/PKMode " + str(nextPKMode)
  682.  
  683. def OnChangePKMode(self):
  684.  
  685. self.interface.OnChangePKMode()
  686.  
  687. try:
  688. self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  689. except KeyError:
  690. print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  691.  
  692. if constInfo.PVPMODE_TEST_ENABLE:
  693. curPKMode = player.GetPKMode()
  694. alignment, grade = chr.testGetPKData()
  695. self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  696. self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  697. self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + localeInfo.TITLE_NAME_LIST[grade] + ")")
  698.  
  699. ###############################################################################################
  700. ###############################################################################################
  701. ## Game Callback Functions
  702.  
  703. # Start
  704. def StartGame(self):
  705. self.RefreshInventory()
  706. self.RefreshEquipment()
  707. self.RefreshCharacter()
  708. self.RefreshSkill()
  709.  
  710. # Refresh
  711. def CheckGameButton(self):
  712. if self.interface:
  713. self.interface.CheckGameButton()
  714.  
  715. def RefreshAlignment(self):
  716. self.interface.RefreshAlignment()
  717.  
  718. def RefreshStatus(self):
  719. self.CheckGameButton()
  720.  
  721. if self.interface:
  722. self.interface.RefreshStatus()
  723.  
  724. if self.playerGauge:
  725. self.playerGauge.RefreshGauge()
  726.  
  727. def RefreshStamina(self):
  728. self.interface.RefreshStamina()
  729.  
  730. def RefreshSkill(self):
  731. self.CheckGameButton()
  732. if self.interface:
  733. self.interface.RefreshSkill()
  734.  
  735. def RefreshQuest(self):
  736. self.interface.RefreshQuest()
  737.  
  738. def RefreshMessenger(self):
  739. self.interface.RefreshMessenger()
  740.  
  741. def RefreshGuildInfoPage(self):
  742. self.interface.RefreshGuildInfoPage()
  743.  
  744. def RefreshGuildBoardPage(self):
  745. self.interface.RefreshGuildBoardPage()
  746.  
  747. def RefreshGuildMemberPage(self):
  748. self.interface.RefreshGuildMemberPage()
  749.  
  750. def RefreshGuildMemberPageGradeComboBox(self):
  751. self.interface.RefreshGuildMemberPageGradeComboBox()
  752.  
  753. def RefreshGuildSkillPage(self):
  754. self.interface.RefreshGuildSkillPage()
  755.  
  756. def RefreshGuildGradePage(self):
  757. self.interface.RefreshGuildGradePage()
  758.  
  759. def RefreshMobile(self):
  760. if self.interface:
  761. self.interface.RefreshMobile()
  762.  
  763. def OnMobileAuthority(self):
  764. self.interface.OnMobileAuthority()
  765.  
  766. def OnBlockMode(self, mode):
  767. self.interface.OnBlockMode(mode)
  768.  
  769. def OpenQuestWindow(self, skin, idx):
  770. if constInfo.INPUT_IGNORE == 1:
  771. return
  772. else:
  773. self.interface.OpenQuestWindow(skin, idx)
  774.  
  775. def AskGuildName(self):
  776.  
  777. guildNameBoard = uiCommon.InputDialog()
  778. guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
  779. guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  780. guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  781. guildNameBoard.Open()
  782.  
  783. self.guildNameBoard = guildNameBoard
  784.  
  785. def ConfirmGuildName(self):
  786. guildName = self.guildNameBoard.GetText()
  787. if not guildName:
  788. return
  789.  
  790. if net.IsInsultIn(guildName):
  791. self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
  792. return
  793.  
  794. net.SendAnswerMakeGuildPacket(guildName)
  795. self.guildNameBoard.Close()
  796. self.guildNameBoard = None
  797. return True
  798.  
  799. def CancelGuildName(self):
  800. self.guildNameBoard.Close()
  801. self.guildNameBoard = None
  802. return True
  803.  
  804. ## Refine
  805. def PopupMessage(self, msg):
  806. self.stream.popupWindow.Close()
  807. self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
  808.  
  809. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  810. self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  811.  
  812. def AppendMaterialToRefineDialog(self, vnum, count):
  813. self.interface.AppendMaterialToRefineDialog(vnum, count)
  814.  
  815. def RunUseSkillEvent(self, slotIndex, coolTime):
  816. self.interface.OnUseSkill(slotIndex, coolTime)
  817.  
  818. def ClearAffects(self):
  819. self.affectShower.ClearAffects()
  820.  
  821. def SetAffect(self, affect):
  822. self.affectShower.SetAffect(affect)
  823.  
  824. def ResetAffect(self, affect):
  825. self.affectShower.ResetAffect(affect)
  826.  
  827. # UNKNOWN_UPDATE
  828. def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  829. self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  830. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  831. self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
  832. elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
  833. self.BINARY_DragonSoulGiveQuilification()
  834.  
  835. def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  836. self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  837. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  838. self.interface.DragonSoulDeactivate()
  839.  
  840.  
  841.  
  842. # END_OF_UNKNOWN_UPDATE
  843.  
  844. def ActivateSkillSlot(self, slotIndex):
  845. if self.interface:
  846. self.interface.OnActivateSkill(slotIndex)
  847.  
  848. def DeactivateSkillSlot(self, slotIndex):
  849. if self.interface:
  850. self.interface.OnDeactivateSkill(slotIndex)
  851.  
  852. def RefreshEquipment(self):
  853. if self.interface:
  854. self.interface.RefreshInventory()
  855.  
  856. def RefreshInventory(self):
  857. if self.interface:
  858. self.interface.RefreshInventory()
  859.  
  860. def RefreshCharacter(self):
  861. if self.interface:
  862. self.interface.RefreshCharacter()
  863.  
  864. def OnGameOver(self):
  865. self.CloseTargetBoard()
  866. self.OpenRestartDialog()
  867.  
  868. def OpenRestartDialog(self):
  869. self.interface.OpenRestartDialog()
  870.  
  871. def ChangeCurrentSkill(self, skillSlotNumber):
  872. self.interface.OnChangeCurrentSkill(skillSlotNumber)
  873.  
  874. ## TargetBoard
  875. def SetPCTargetBoard(self, vid, name):
  876. self.targetBoard.Open(vid, name)
  877.  
  878. if app.IsPressed(app.DIK_LCONTROL):
  879.  
  880. if not player.IsSameEmpire(vid):
  881. return
  882.  
  883. if player.IsMainCharacterIndex(vid):
  884. return
  885. elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  886. return
  887.  
  888. self.interface.OpenWhisperDialog(name)
  889.  
  890.  
  891. def RefreshTargetBoardByVID(self, vid):
  892. self.targetBoard.RefreshByVID(vid)
  893.  
  894. def RefreshTargetBoardByName(self, name):
  895. self.targetBoard.RefreshByName(name)
  896.  
  897. def __RefreshTargetBoard(self):
  898. self.targetBoard.Refresh()
  899.  
  900. if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
  901. def SetHPTargetBoard(self, vid, hpPercentage, iMinHP, iMaxHP):
  902. if vid != self.targetBoard.GetTargetVID():
  903. self.targetBoard.ResetTargetBoard()
  904. self.targetBoard.SetEnemyVID(vid)
  905.  
  906. self.targetBoard.SetHP(hpPercentage, iMinHP, iMaxHP)
  907. self.targetBoard.Show()
  908. else:
  909. def SetHPTargetBoard(self, vid, hpPercentage):
  910. if vid != self.targetBoard.GetTargetVID():
  911. self.targetBoard.ResetTargetBoard()
  912. self.targetBoard.SetEnemyVID(vid)
  913.  
  914. self.targetBoard.SetHP(hpPercentage)
  915. self.targetBoard.Show()
  916.  
  917. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  918. def SetHideCostumeTargetBoard(self,vid,costumeHide):
  919. self.targetBoard.SetCostumeHide(costumeHide)
  920.  
  921. def CloseTargetBoardIfDifferent(self, vid):
  922. if vid != self.targetBoard.GetTargetVID():
  923. self.targetBoard.Close()
  924.  
  925. def CloseTargetBoard(self):
  926. self.targetBoard.Close()
  927.  
  928. ## View Equipment
  929. def OpenEquipmentDialog(self, vid):
  930. self.interface.OpenEquipmentDialog(vid)
  931.  
  932. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  933. self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  934.  
  935. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  936. self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  937.  
  938. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  939. self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  940.  
  941. # SHOW_LOCAL_MAP_NAME
  942. def ShowMapName(self, mapName, x, y):
  943.  
  944. if self.mapNameShower:
  945. self.mapNameShower.ShowMapName(mapName, x, y)
  946.  
  947. if self.interface:
  948. self.interface.SetMapName(mapName)
  949. # END_OF_SHOW_LOCAL_MAP_NAME
  950.  
  951. def BINARY_OpenAtlasWindow(self):
  952. self.interface.BINARY_OpenAtlasWindow()
  953.  
  954. ## Chat
  955. def OnRecvWhisper(self, mode, name, line):
  956. if mode == chat.WHISPER_TYPE_GM:
  957. self.interface.RegisterGameMasterName(name)
  958. chat.AppendWhisper(mode, name, line)
  959. self.interface.RecvWhisper(name)
  960.  
  961. def OnRecvWhisperSystemMessage(self, mode, name, line):
  962. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  963. self.interface.RecvWhisper(name)
  964.  
  965. def OnRecvWhisperError(self, mode, name, line):
  966. if localeInfo.WHISPER_ERROR.has_key(mode):
  967. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
  968. else:
  969. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  970. self.interface.RecvWhisper(name)
  971.  
  972. def RecvWhisper(self, name):
  973. self.interface.RecvWhisper(name)
  974.  
  975. def OnPickMoney(self, money):
  976. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_MONEY % (money))
  977.  
  978. def OnShopError(self, type):
  979. try:
  980. self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
  981. except KeyError:
  982. self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
  983.  
  984. def OnSafeBoxError(self):
  985. self.PopupMessage(localeInfo.SAFEBOX_ERROR)
  986.  
  987. def OnFishingSuccess(self, isFish, fishName):
  988. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
  989.  
  990. # ADD_FISHING_MESSAGE
  991. def OnFishingNotifyUnknown(self):
  992. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
  993.  
  994. def OnFishingWrongPlace(self):
  995. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
  996. # END_OF_ADD_FISHING_MESSAGE
  997.  
  998. def OnFishingNotify(self, isFish, fishName):
  999. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
  1000.  
  1001. def OnFishingFailure(self):
  1002. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
  1003.  
  1004. def OnCannotPickItem(self):
  1005. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
  1006.  
  1007. # MINING
  1008. def OnCannotMining(self):
  1009. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
  1010. # END_OF_MINING
  1011.  
  1012. def OnCannotUseSkill(self, vid, type):
  1013. if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  1014. textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
  1015.  
  1016. if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  1017. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type])
  1018.  
  1019. def OnCannotShotError(self, vid, type):
  1020. textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
  1021.  
  1022. ## PointReset
  1023. def StartPointReset(self):
  1024. self.interface.OpenPointResetDialog()
  1025.  
  1026. ## Shop
  1027. def StartShop(self, vid):
  1028. self.interface.OpenShopDialog(vid)
  1029.  
  1030. def EndShop(self):
  1031. self.interface.CloseShopDialog()
  1032.  
  1033. def RefreshShop(self):
  1034. self.interface.RefreshShopDialog()
  1035.  
  1036. def SetShopSellingPrice(self, Price):
  1037. pass
  1038.  
  1039. ## Exchange
  1040. def StartExchange(self):
  1041. self.interface.StartExchange()
  1042.  
  1043. def EndExchange(self):
  1044. self.interface.EndExchange()
  1045.  
  1046. def RefreshExchange(self):
  1047. self.interface.RefreshExchange()
  1048.  
  1049. ## Party
  1050. def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1051. partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1052. partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
  1053. partyInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerPartyInvite(arg))
  1054. partyInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerPartyInvite(arg))
  1055. partyInviteQuestionDialog.Open()
  1056. partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1057. self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1058.  
  1059. def AnswerPartyInvite(self, answer):
  1060.  
  1061. if not self.partyInviteQuestionDialog:
  1062. return
  1063.  
  1064. partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1065.  
  1066. distance = player.GetCharacterDistance(partyLeaderVID)
  1067. if distance < 0.0 or distance > 5000:
  1068. answer = False
  1069.  
  1070. net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1071.  
  1072. self.partyInviteQuestionDialog.Close()
  1073. self.partyInviteQuestionDialog = None
  1074.  
  1075. def AddPartyMember(self, pid, name):
  1076. self.interface.AddPartyMember(pid, name)
  1077.  
  1078. def UpdatePartyMemberInfo(self, pid):
  1079. self.interface.UpdatePartyMemberInfo(pid)
  1080.  
  1081. def RemovePartyMember(self, pid):
  1082. self.interface.RemovePartyMember(pid)
  1083. self.__RefreshTargetBoard()
  1084.  
  1085. def LinkPartyMember(self, pid, vid):
  1086. self.interface.LinkPartyMember(pid, vid)
  1087.  
  1088. def UnlinkPartyMember(self, pid):
  1089. self.interface.UnlinkPartyMember(pid)
  1090.  
  1091. def UnlinkAllPartyMember(self):
  1092. self.interface.UnlinkAllPartyMember()
  1093.  
  1094. def ExitParty(self):
  1095. self.interface.ExitParty()
  1096. self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1097.  
  1098. def ChangePartyParameter(self, distributionMode):
  1099. self.interface.ChangePartyParameter(distributionMode)
  1100.  
  1101. ## Messenger
  1102. def OnMessengerAddFriendQuestion(self, name):
  1103. messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1104. messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1105. messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1106. messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1107. messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1108. messengerAddFriendQuestion.Open()
  1109. messengerAddFriendQuestion.name = name
  1110. self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1111.  
  1112. def OnAcceptAddFriend(self):
  1113. name = self.messengerAddFriendQuestion.name
  1114. net.SendChatPacket("/messenger_auth y " + name)
  1115. self.OnCloseAddFriendQuestionDialog()
  1116. return True
  1117.  
  1118. def OnDenyAddFriend(self):
  1119. name = self.messengerAddFriendQuestion.name
  1120. net.SendChatPacket("/messenger_auth n " + name)
  1121. self.OnCloseAddFriendQuestionDialog()
  1122. return True
  1123.  
  1124. def OnCloseAddFriendQuestionDialog(self):
  1125. self.messengerAddFriendQuestion.Close()
  1126. self.messengerAddFriendQuestion = None
  1127. return True
  1128.  
  1129. ## SafeBox
  1130. def OpenSafeboxWindow(self, size):
  1131. self.interface.OpenSafeboxWindow(size)
  1132.  
  1133. def RefreshSafebox(self):
  1134. self.interface.RefreshSafebox()
  1135.  
  1136. def RefreshSafeboxMoney(self):
  1137. self.interface.RefreshSafeboxMoney()
  1138.  
  1139. # ITEM_MALL
  1140. def OpenMallWindow(self, size):
  1141. self.interface.OpenMallWindow(size)
  1142.  
  1143. def RefreshMall(self):
  1144. self.interface.RefreshMall()
  1145. # END_OF_ITEM_MALL
  1146.  
  1147. ## Guild
  1148. def RecvGuildInviteQuestion(self, guildID, guildName):
  1149. guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1150. guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
  1151. guildInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerGuildInvite(arg))
  1152. guildInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerGuildInvite(arg))
  1153. guildInviteQuestionDialog.Open()
  1154. guildInviteQuestionDialog.guildID = guildID
  1155. self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1156.  
  1157. def AnswerGuildInvite(self, answer):
  1158.  
  1159. if not self.guildInviteQuestionDialog:
  1160. return
  1161.  
  1162. guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1163. net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1164.  
  1165. self.guildInviteQuestionDialog.Close()
  1166. self.guildInviteQuestionDialog = None
  1167.  
  1168.  
  1169. def DeleteGuild(self):
  1170. self.interface.DeleteGuild()
  1171.  
  1172. ## Clock
  1173. def ShowClock(self, second):
  1174. self.interface.ShowClock(second)
  1175.  
  1176. def HideClock(self):
  1177. self.interface.HideClock()
  1178.  
  1179. ## Emotion
  1180. def BINARY_ActEmotion(self, emotionIndex):
  1181. if self.interface.wndCharacter:
  1182. self.interface.wndCharacter.ActEmotion(emotionIndex)
  1183.  
  1184. ###############################################################################################
  1185. ###############################################################################################
  1186. ## Keyboard Functions
  1187.  
  1188. def CheckFocus(self):
  1189. if False == self.IsFocus():
  1190. if True == self.interface.IsOpenChat():
  1191. self.interface.ToggleChat()
  1192.  
  1193. self.SetFocus()
  1194.  
  1195. def SaveScreen(self):
  1196. print "save screen"
  1197.  
  1198. # SCREENSHOT_CWDSAVE
  1199. if SCREENSHOT_CWDSAVE:
  1200. if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
  1201. os.mkdir(os.getcwd()+os.sep+"screenshot")
  1202.  
  1203. (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
  1204. elif SCREENSHOT_DIR:
  1205. (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1206. else:
  1207. (succeeded, name) = grp.SaveScreenShot()
  1208. # END_OF_SCREENSHOT_CWDSAVE
  1209.  
  1210. if succeeded:
  1211. chat.AppendChat(chat.CHAT_TYPE_INFO, "%s %s %s" % (name, localeInfo.SCREENSHOT_SAVE1, localeInfo.SCREENSHOT_SAVE2))
  1212. else:
  1213. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
  1214.  
  1215. def ShowConsole(self):
  1216. if debugInfo.IsDebugMode() or True == self.consoleEnable:
  1217. player.EndKeyWalkingImmediately()
  1218. self.console.OpenWindow()
  1219.  
  1220. def ShowName(self):
  1221. self.ShowNameFlag = True
  1222. self.playerGauge.EnableShowAlways()
  1223. player.SetQuickPage(self.quickSlotPageIndex+1)
  1224.  
  1225. # ADD_ALWAYS_SHOW_NAME
  1226. def __IsShowName(self):
  1227.  
  1228. if systemSetting.IsAlwaysShowName():
  1229. return True
  1230.  
  1231. if self.ShowNameFlag:
  1232. return True
  1233.  
  1234. return False
  1235. # END_OF_ADD_ALWAYS_SHOW_NAME
  1236.  
  1237. def HideName(self):
  1238. self.ShowNameFlag = False
  1239. self.playerGauge.DisableShowAlways()
  1240. player.SetQuickPage(self.quickSlotPageIndex)
  1241.  
  1242. def ShowMouseImage(self):
  1243. self.interface.ShowMouseImage()
  1244.  
  1245. def HideMouseImage(self):
  1246. self.interface.HideMouseImage()
  1247.  
  1248. def StartAttack(self):
  1249. player.SetAttackKeyState(True)
  1250.  
  1251. def EndAttack(self):
  1252. player.SetAttackKeyState(False)
  1253.  
  1254. def MoveUp(self):
  1255. player.SetSingleDIKKeyState(app.DIK_UP, True)
  1256.  
  1257. def MoveDown(self):
  1258. player.SetSingleDIKKeyState(app.DIK_DOWN, True)
  1259.  
  1260. def MoveLeft(self):
  1261. player.SetSingleDIKKeyState(app.DIK_LEFT, True)
  1262.  
  1263. def MoveRight(self):
  1264. player.SetSingleDIKKeyState(app.DIK_RIGHT, True)
  1265.  
  1266. def StopUp(self):
  1267. player.SetSingleDIKKeyState(app.DIK_UP, False)
  1268.  
  1269. def StopDown(self):
  1270. player.SetSingleDIKKeyState(app.DIK_DOWN, False)
  1271.  
  1272. def StopLeft(self):
  1273. player.SetSingleDIKKeyState(app.DIK_LEFT, False)
  1274.  
  1275. def StopRight(self):
  1276. player.SetSingleDIKKeyState(app.DIK_RIGHT, False)
  1277.  
  1278. def PickUpItem(self):
  1279. player.PickCloseItem()
  1280.  
  1281. ###############################################################################################
  1282. ###############################################################################################
  1283. ## Event Handler
  1284.  
  1285. def OnKeyDown(self, key):
  1286. if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1287. return
  1288.  
  1289. if key == app.DIK_ESC:
  1290. self.RequestDropItem(False)
  1291. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1292.  
  1293. try:
  1294. self.onPressKeyDict[key]()
  1295. except KeyError:
  1296. pass
  1297. except:
  1298. raise
  1299.  
  1300. return True
  1301.  
  1302. def OnKeyUp(self, key):
  1303. try:
  1304. self.onClickKeyDict[key]()
  1305. except KeyError:
  1306. pass
  1307. except:
  1308. raise
  1309.  
  1310. return True
  1311.  
  1312. def OnMouseLeftButtonDown(self):
  1313. if self.interface.BUILD_OnMouseLeftButtonDown():
  1314. return
  1315.  
  1316. if mouseModule.mouseController.isAttached():
  1317. self.CheckFocus()
  1318. else:
  1319. hyperlink = ui.GetHyperlink()
  1320. if hyperlink:
  1321. return
  1322. else:
  1323. self.CheckFocus()
  1324. player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1325.  
  1326. return True
  1327.  
  1328. def OnMouseLeftButtonUp(self):
  1329.  
  1330. if self.interface.BUILD_OnMouseLeftButtonUp():
  1331. return
  1332.  
  1333. if mouseModule.mouseController.isAttached():
  1334.  
  1335. attachedType = mouseModule.mouseController.GetAttachedType()
  1336. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1337. attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1338. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1339.  
  1340. ## QuickSlot
  1341. if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1342. player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1343.  
  1344. ## Inventory
  1345. elif player.SLOT_TYPE_INVENTORY == attachedType:
  1346.  
  1347. if player.ITEM_MONEY == attachedItemIndex:
  1348. self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1349. else:
  1350. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1351.  
  1352. ## DragonSoul
  1353. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1354. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1355.  
  1356. mouseModule.mouseController.DeattachObject()
  1357.  
  1358. else:
  1359. hyperlink = ui.GetHyperlink()
  1360. if hyperlink:
  1361. if app.IsPressed(app.DIK_LALT):
  1362. link = chat.GetLinkFromHyperlink(hyperlink)
  1363. ime.PasteString(link)
  1364. else:
  1365. self.interface.MakeHyperlinkTooltip(hyperlink)
  1366. return
  1367. else:
  1368. player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  1369.  
  1370. #player.EndMouseWalking()
  1371. return True
  1372.  
  1373. def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  1374. if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1375. attachedInvenType = player.SlotTypeToInvenType(attachedType)
  1376. if True == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1377. if player.IsEquipmentSlot(attachedItemSlotPos) and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedType:
  1378. self.stream.popupWindow.Close()
  1379. self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1380. else:
  1381. if chr.IsNPC(dstChrID):
  1382. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1383. else:
  1384. net.SendExchangeStartPacket(dstChrID)
  1385. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1386. else:
  1387. self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1388.  
  1389. def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  1390. if True == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  1391. net.SendExchangeStartPacket(dstChrID)
  1392. net.SendExchangeElkAddPacket(attachedMoney)
  1393. else:
  1394. self.__DropMoney(attachedType, attachedMoney)
  1395.  
  1396. def __DropMoney(self, attachedType, attachedMoney):
  1397. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1398. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1399. return
  1400. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1401.  
  1402. if attachedMoney>=1000:
  1403. self.stream.popupWindow.Close()
  1404. self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
  1405. return
  1406.  
  1407. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1408. itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
  1409. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1410. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1411. itemDropQuestionDialog.Open()
  1412. itemDropQuestionDialog.dropType = attachedType
  1413. itemDropQuestionDialog.dropCount = attachedMoney
  1414. itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  1415. self.itemDropQuestionDialog = itemDropQuestionDialog
  1416.  
  1417. def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  1418. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1419. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1420. return
  1421. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1422.  
  1423. if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
  1424. self.stream.popupWindow.Close()
  1425. self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1426.  
  1427. else:
  1428. if player.SLOT_TYPE_INVENTORY == attachedType:
  1429. dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  1430.  
  1431. item.SelectItem(dropItemIndex)
  1432. dropItemName = item.GetItemName()
  1433.  
  1434. ## Question Text
  1435. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1436.  
  1437. ## Dialog
  1438. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1439. itemDropQuestionDialog.SetText(questionText)
  1440. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1441. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1442. itemDropQuestionDialog.Open()
  1443. itemDropQuestionDialog.dropType = attachedType
  1444. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1445. itemDropQuestionDialog.dropCount = attachedItemCount
  1446. self.itemDropQuestionDialog = itemDropQuestionDialog
  1447.  
  1448. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1449. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1450. dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
  1451.  
  1452. item.SelectItem(dropItemIndex)
  1453. dropItemName = item.GetItemName()
  1454.  
  1455. ## Question Text
  1456. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1457.  
  1458. ## Dialog
  1459. itemDropQuestionDialog = uiCommon.QuestionDialog()
  1460. itemDropQuestionDialog.SetText(questionText)
  1461. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1462. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1463. itemDropQuestionDialog.Open()
  1464. itemDropQuestionDialog.dropType = attachedType
  1465. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1466. itemDropQuestionDialog.dropCount = attachedItemCount
  1467. self.itemDropQuestionDialog = itemDropQuestionDialog
  1468.  
  1469. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1470.  
  1471. def RequestDropItem(self, answer):
  1472. if not self.itemDropQuestionDialog:
  1473. return
  1474.  
  1475. if answer:
  1476. dropType = self.itemDropQuestionDialog.dropType
  1477. dropCount = self.itemDropQuestionDialog.dropCount
  1478. dropNumber = self.itemDropQuestionDialog.dropNumber
  1479.  
  1480. if player.SLOT_TYPE_INVENTORY == dropType:
  1481. if dropNumber == player.ITEM_MONEY:
  1482. net.SendGoldDropPacketNew(dropCount)
  1483. snd.PlaySound("sound/ui/money.wav")
  1484. else:
  1485. # PRIVATESHOP_DISABLE_ITEM_DROP
  1486. self.__SendDropItemPacket(dropNumber, dropCount)
  1487. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1488. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
  1489. # PRIVATESHOP_DISABLE_ITEM_DROP
  1490. self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
  1491. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1492.  
  1493. self.itemDropQuestionDialog.Close()
  1494. self.itemDropQuestionDialog = None
  1495.  
  1496. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1497.  
  1498. # PRIVATESHOP_DISABLE_ITEM_DROP
  1499. def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
  1500. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1501. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1502. return
  1503.  
  1504. net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
  1505. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1506.  
  1507. def OnMouseRightButtonDown(self):
  1508.  
  1509. self.CheckFocus()
  1510.  
  1511. if True == mouseModule.mouseController.isAttached():
  1512. mouseModule.mouseController.DeattachObject()
  1513.  
  1514. else:
  1515. player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  1516.  
  1517. return True
  1518.  
  1519. def OnMouseRightButtonUp(self):
  1520. if True == mouseModule.mouseController.isAttached():
  1521. return True
  1522.  
  1523. player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  1524. return True
  1525.  
  1526. def OnMouseMiddleButtonDown(self):
  1527. player.SetMouseMiddleButtonState(player.MBS_PRESS)
  1528.  
  1529. def OnMouseMiddleButtonUp(self):
  1530. player.SetMouseMiddleButtonState(player.MBS_CLICK)
  1531.  
  1532. def OnUpdate(self):
  1533. app.UpdateGame()
  1534. self.wnddailygift.OnUpdate()
  1535.  
  1536. if self.mapNameShower.IsShow():
  1537. self.mapNameShower.Update()
  1538.  
  1539. if self.isShowDebugInfo:
  1540. self.UpdateDebugInfo()
  1541.  
  1542. if self.enableXMasBoom:
  1543. self.__XMasBoom_Update()
  1544.  
  1545. self.interface.BUILD_OnUpdate()
  1546.  
  1547.  
  1548. def UpdateDebugInfo(self):
  1549. #
  1550. (x, y, z) = player.GetMainCharacterPosition()
  1551. nUpdateTime = app.GetUpdateTime()
  1552. nUpdateFPS = app.GetUpdateFPS()
  1553. nRenderFPS = app.GetRenderFPS()
  1554. nFaceCount = app.GetFaceCount()
  1555. fFaceSpeed = app.GetFaceSpeed()
  1556. nST=background.GetRenderShadowTime()
  1557. (fAveRT, nCurRT) = app.GetRenderTime()
  1558. (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  1559. (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  1560. if iPatch == 0:
  1561. iPatch = 1
  1562.  
  1563. #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  1564.  
  1565. self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  1566. xMouse, yMouse = wndMgr.GetMousePosition()
  1567. self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))
  1568.  
  1569. self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  1570.  
  1571. if fAveRT>1.0:
  1572. self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  1573.  
  1574. self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  1575. #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  1576. #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  1577. #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  1578. self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  1579.  
  1580. def OnRender(self):
  1581. app.RenderGame()
  1582.  
  1583. if self.console.Console.collision:
  1584. background.RenderCollision()
  1585. chr.RenderCollision()
  1586.  
  1587. (x, y) = app.GetCursorPosition()
  1588.  
  1589. ########################
  1590. # Picking
  1591. ########################
  1592. textTail.UpdateAllTextTail()
  1593.  
  1594. if True == wndMgr.IsPickedWindow(self.hWnd):
  1595.  
  1596. self.PickingCharacterIndex = chr.Pick()
  1597.  
  1598. if -1 != self.PickingCharacterIndex:
  1599. textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  1600. if 0 != self.targetBoard.GetTargetVID():
  1601. textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  1602.  
  1603. # ADD_ALWAYS_SHOW_NAME
  1604. if not self.__IsShowName():
  1605. self.PickingItemIndex = item.Pick()
  1606. if -1 != self.PickingItemIndex:
  1607. textTail.ShowItemTextTail(self.PickingItemIndex)
  1608. # END_OF_ADD_ALWAYS_SHOW_NAME
  1609.  
  1610. ## Show all name in the range
  1611.  
  1612. # ADD_ALWAYS_SHOW_NAME
  1613. if self.__IsShowName():
  1614. textTail.ShowAllTextTail()
  1615. self.PickingItemIndex = textTail.Pick(x, y)
  1616. # END_OF_ADD_ALWAYS_SHOW_NAME
  1617.  
  1618. textTail.UpdateShowingTextTail()
  1619. textTail.ArrangeTextTail()
  1620. if -1 != self.PickingItemIndex:
  1621. textTail.SelectItemName(self.PickingItemIndex)
  1622.  
  1623. grp.PopState()
  1624. grp.SetInterfaceRenderState()
  1625.  
  1626. textTail.Render()
  1627. textTail.HideAllTextTail()
  1628.  
  1629. def OnPressEscapeKey(self):
  1630. if app.TARGET == app.GetCursor():
  1631. app.SetCursor(app.NORMAL)
  1632.  
  1633. elif True == mouseModule.mouseController.isAttached():
  1634. mouseModule.mouseController.DeattachObject()
  1635.  
  1636. else:
  1637. self.interface.OpenSystemDialog()
  1638.  
  1639. return True
  1640.  
  1641. def OnIMEReturn(self):
  1642. if app.IsPressed(app.DIK_LSHIFT):
  1643. self.interface.OpenWhisperDialogWithoutTarget()
  1644. else:
  1645. self.interface.ToggleChat()
  1646. return True
  1647.  
  1648. def OnPressExitKey(self):
  1649. self.interface.ToggleSystemDialog()
  1650. return True
  1651.  
  1652. ## BINARY CALLBACK
  1653. ######################################################################################
  1654.  
  1655. # WEDDING
  1656. def BINARY_LoverInfo(self, name, lovePoint):
  1657. if self.interface.wndMessenger:
  1658. self.interface.wndMessenger.OnAddLover(name, lovePoint)
  1659. if self.affectShower:
  1660. self.affectShower.SetLoverInfo(name, lovePoint)
  1661.  
  1662. def BINARY_UpdateLovePoint(self, lovePoint):
  1663. if self.interface.wndMessenger:
  1664. self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  1665. if self.affectShower:
  1666. self.affectShower.OnUpdateLovePoint(lovePoint)
  1667. # END_OF_WEDDING
  1668.  
  1669. if app.ENABLE_SEND_TARGET_INFO:
  1670. def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
  1671. if not raceNum in constInfo.MONSTER_INFO_DATA:
  1672. constInfo.MONSTER_INFO_DATA.update({raceNum : {}})
  1673. constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []})
  1674. curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"]
  1675.  
  1676. isUpgradeable = False
  1677. isMetin = False
  1678. item.SelectItem(itemVnum)
  1679. if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1680. isUpgradeable = True
  1681. elif item.GetItemType() == item.ITEM_TYPE_METIN:
  1682. isMetin = True
  1683.  
  1684. for curItem in curList:
  1685. if isUpgradeable:
  1686. if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
  1687. if not (itemVnum in curItem["vnum_list"]):
  1688. curItem["vnum_list"].append(itemVnum)
  1689. return
  1690. elif isMetin:
  1691. if curItem.has_key("vnum_list"):
  1692. baseVnum = curItem["vnum_list"][0]
  1693. if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
  1694. if not (itemVnum in curItem["vnum_list"]):
  1695. curItem["vnum_list"].append(itemVnum)
  1696. return
  1697. else:
  1698. if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
  1699. return
  1700.  
  1701. if isUpgradeable or isMetin:
  1702. curList.append({"vnum_list":[itemVnum], "count":itemCount})
  1703. else:
  1704. curList.append({"vnum":itemVnum, "count":itemCount})
  1705.  
  1706. def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
  1707. self.targetBoard.RefreshMonsterInfoBoard()
  1708.  
  1709. ########Daily reward##########
  1710. def ManagerGiftSystem(self, cmd):
  1711. cmd = cmd.split("|")
  1712. if cmd[0] == "Show":
  1713. self.wnddailygift.Show()
  1714. elif cmd[0] == "DeleteRewards":
  1715. self.wnddailygift.DeleteRewards()
  1716. elif cmd[0] == "SetDailyReward":
  1717. self.wnddailygift.SetDailyReward(cmd[1]) # numero de la recompensa
  1718. elif cmd[0] == "SetTime":
  1719. self.wnddailygift.SetTime(cmd[1]) # tiempo en numeros grandes
  1720. elif cmd[0] == "SetReward":
  1721. self.wnddailygift.SetReward(cmd[1], cmd[2]) #hacer un array con los items
  1722. elif cmd[0] == "SetRewardDone":
  1723. self.wnddailygift.SetRewardDone()
  1724.  
  1725. # QUEST_CONFIRM
  1726. def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  1727. confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
  1728. confirmDialog.Open(msg, timeout)
  1729. confirmDialog.SetAcceptEvent(lambda answer=True, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1730. confirmDialog.SetCancelEvent(lambda answer=False, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1731. self.confirmDialog = confirmDialog
  1732. # END_OF_QUEST_CONFIRM
  1733.  
  1734. # GIFT command
  1735. def Gift_Show(self):
  1736. self.interface.ShowGift()
  1737.  
  1738. # CUBE
  1739. def BINARY_Cube_Open(self, npcVNUM):
  1740. self.currentCubeNPC = npcVNUM
  1741.  
  1742. self.interface.OpenCubeWindow()
  1743.  
  1744.  
  1745. if npcVNUM not in self.cubeInformation:
  1746. net.SendChatPacket("/cube r_info")
  1747. else:
  1748. cubeInfoList = self.cubeInformation[npcVNUM]
  1749.  
  1750. i = 0
  1751. for cubeInfo in cubeInfoList:
  1752. self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
  1753.  
  1754. j = 0
  1755. for materialList in cubeInfo["materialList"]:
  1756. for materialInfo in materialList:
  1757. itemVnum, itemCount = materialInfo
  1758. self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
  1759. j = j + 1
  1760.  
  1761. i = i + 1
  1762.  
  1763. self.interface.wndCube.Refresh()
  1764.  
  1765. def BINARY_Cube_Close(self):
  1766. self.interface.CloseCubeWindow()
  1767.  
  1768. def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  1769. self.interface.UpdateCubeInfo(gold, itemVnum, count)
  1770.  
  1771. def BINARY_Cube_Succeed(self, itemVnum, count):
  1772. print "큐브 제작 성공"
  1773. self.interface.SucceedCubeWork(itemVnum, count)
  1774. pass
  1775.  
  1776. def BINARY_Cube_Failed(self):
  1777. print "큐브 제작 실패"
  1778. self.interface.FailedCubeWork()
  1779. pass
  1780.  
  1781. def BINARY_Cube_ResultList(self, npcVNUM, listText):
  1782. #print listText
  1783.  
  1784. if npcVNUM == 0:
  1785. npcVNUM = self.currentCubeNPC
  1786.  
  1787. self.cubeInformation[npcVNUM] = []
  1788.  
  1789. try:
  1790. for eachInfoText in listText.split("/"):
  1791. eachInfo = eachInfoText.split(",")
  1792. itemVnum = int(eachInfo[0])
  1793. itemCount = int(eachInfo[1])
  1794.  
  1795. self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
  1796. self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  1797.  
  1798. resultCount = len(self.cubeInformation[npcVNUM])
  1799. requestCount = 7
  1800. modCount = resultCount % requestCount
  1801. splitCount = resultCount / requestCount
  1802. for i in xrange(splitCount):
  1803. #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  1804. net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  1805.  
  1806. if 0 < modCount:
  1807. #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1808. net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1809.  
  1810. except RuntimeError, msg:
  1811. dbg.TraceError(msg)
  1812. return 0
  1813.  
  1814. pass
  1815.  
  1816. def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
  1817. # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  1818. try:
  1819. #print listText
  1820.  
  1821. if 3 > len(listText):
  1822. dbg.TraceError("Wrong Cube Material Infomation")
  1823. return 0
  1824.  
  1825.  
  1826.  
  1827. eachResultList = listText.split("@")
  1828.  
  1829. cubeInfo = self.cubeInformation[self.currentCubeNPC]
  1830.  
  1831. itemIndex = 0
  1832. for eachResultText in eachResultList:
  1833. cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  1834. materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  1835.  
  1836. gold = 0
  1837. splitResult = eachResultText.split("/")
  1838. if 1 < len(splitResult):
  1839. gold = int(splitResult[1])
  1840.  
  1841. #print "splitResult : ", splitResult
  1842. eachMaterialList = splitResult[0].split("&")
  1843.  
  1844. i = 0
  1845. for eachMaterialText in eachMaterialList:
  1846. complicatedList = eachMaterialText.split("|")
  1847.  
  1848. if 0 < len(complicatedList):
  1849. for complicatedText in complicatedList:
  1850. (itemVnum, itemCount) = complicatedText.split(",")
  1851. itemVnum = int(itemVnum)
  1852. itemCount = int(itemCount)
  1853. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1854.  
  1855. materialList[i].append((itemVnum, itemCount))
  1856.  
  1857. else:
  1858. itemVnum, itemCount = eachMaterialText.split(",")
  1859. itemVnum = int(itemVnum)
  1860. itemCount = int(itemCount)
  1861. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1862.  
  1863. materialList[i].append((itemVnum, itemCount))
  1864.  
  1865. i = i + 1
  1866.  
  1867.  
  1868.  
  1869. itemIndex = itemIndex + 1
  1870.  
  1871. self.interface.wndCube.Refresh()
  1872.  
  1873.  
  1874. except RuntimeError, msg:
  1875. dbg.TraceError(msg)
  1876. return 0
  1877.  
  1878. pass
  1879.  
  1880. # END_OF_CUBE
  1881.  
  1882. def BINARY_Highlight_Item(self, inven_type, inven_pos):
  1883. # @fixme003 (+if self.interface:)
  1884. if self.interface:
  1885. self.interface.Highligt_Item(inven_type, inven_pos)
  1886.  
  1887. def BINARY_DragonSoulGiveQuilification(self):
  1888. self.interface.DragonSoulGiveQuilification()
  1889.  
  1890. def BINARY_DragonSoulRefineWindow_Open(self):
  1891. self.interface.OpenDragonSoulRefineWindow()
  1892.  
  1893. def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
  1894. self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
  1895.  
  1896. def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
  1897. self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
  1898.  
  1899. # END of DRAGON SOUL REFINE WINDOW
  1900.  
  1901. def BINARY_SetBigMessage(self, message):
  1902. self.interface.bigBoard.SetTip(message)
  1903.  
  1904. def BINARY_SetTipMessage(self, message):
  1905. self.interface.tipBoard.SetTip(message)
  1906.  
  1907. if app.ENABLE_DUNGEON_INFO_SYSTEM:
  1908. def CleanDungeonInfo(self):
  1909. import constInfo
  1910. constInfo.dungeonInfo = []
  1911.  
  1912. def CleanDungeonRanking(self):
  1913. import constInfo
  1914. constInfo.dungeonRanking["ranking_list"] = []
  1915.  
  1916. def UpdateDungeonInfo(self, type, organization, minLevel, partyMembers, mapIndex, mapName, mapEntrance, mapCoordX, mapCoordY, cooldown, duration, maxLevel, strengthBonus, resistanceBonus, itemVnum, bossVnum, finished, fastestTime, highestDamage):
  1917. type = int(type)
  1918. organization = int(organization)
  1919. minLevel = int(minLevel)
  1920. partyMembers = int(partyMembers)
  1921. mapName = str(mapName).replace("_", " ")
  1922. mapEntrance = str(mapEntrance).replace("_", " ")
  1923. mapIndex = int(mapIndex)
  1924. mapCoordX = int(mapCoordX)
  1925. mapCoordY = int(mapCoordY)
  1926. cooldown = int(cooldown)
  1927. duration = int(duration)
  1928. maxLevel = int(maxLevel)
  1929. strengthBonus = int(strengthBonus)
  1930. resistanceBonus = int(resistanceBonus)
  1931. itemVnum = int(itemVnum)
  1932. finished = int(finished)
  1933. fastestTime = int(fastestTime)
  1934. bossVnum = int(bossVnum)
  1935. highestDamage = int(highestDamage)
  1936.  
  1937. constInfo.dungeonInfo.append(\
  1938. {
  1939. "type" : type,\
  1940. "organization" : organization,\
  1941. "min_level" : minLevel,\
  1942. "party_members" : partyMembers,\
  1943. "map" : mapName,\
  1944. "entrance_map" : mapEntrance,\
  1945. "map_index" : mapIndex,\
  1946. "map_coord_x" : mapCoordX,\
  1947. "map_coord_y" : mapCoordY,\
  1948. "cooldown" : cooldown,\
  1949. "duration" : duration,\
  1950. "max_level" : maxLevel,\
  1951. "strength_bonus" : strengthBonus,\
  1952. "resistance_bonus" : resistanceBonus,\
  1953. "item_vnum" : itemVnum,\
  1954. "boss_vnum" : bossVnum,\
  1955. "finished" : finished,\
  1956. "fastest_time" : fastestTime,\
  1957. "highest_damage" : highestDamage,\
  1958. },
  1959. )
  1960.  
  1961. def UpdateDungeonRanking(self, name, level, pointType):
  1962. name = str(name)
  1963. level = int(level)
  1964. pointType = int(pointType)
  1965.  
  1966. import constInfo
  1967. constInfo.dungeonRanking["ranking_list"].append([name, level, pointType],)
  1968.  
  1969. def OpenDungeonRanking(self):
  1970. import uiDungeonInfo
  1971. self.DungeonRank = uiDungeonInfo.DungeonRank()
  1972. self.DungeonRank.Open()
  1973.  
  1974. def BINARY_AppendNotifyMessage(self, type):
  1975. if not type in localeInfo.NOTIFY_MESSAGE:
  1976. return
  1977. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
  1978.  
  1979. def BINARY_Guild_EnterGuildArea(self, areaID):
  1980. self.interface.BULID_EnterGuildArea(areaID)
  1981.  
  1982. def BINARY_Guild_ExitGuildArea(self, areaID):
  1983. self.interface.BULID_ExitGuildArea(areaID)
  1984.  
  1985. def BINARY_GuildWar_OnSendDeclare(self, guildID):
  1986. pass
  1987.  
  1988. def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  1989. mainCharacterName = player.GetMainCharacterName()
  1990. masterName = guild.GetGuildMasterName()
  1991. if mainCharacterName == masterName:
  1992. self.__GuildWar_OpenAskDialog(guildID, warType)
  1993.  
  1994. def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  1995. self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  1996.  
  1997. def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  1998. self.interface.OnStartGuildWar(guildSelf, guildOpp)
  1999.  
  2000. def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  2001. self.interface.OnEndGuildWar(guildSelf, guildOpp)
  2002.  
  2003. def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  2004. self.interface.BINARY_SetObserverMode(isEnable)
  2005.  
  2006. def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  2007. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2008.  
  2009. def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  2010. guildID1 = int(guildID1)
  2011. guildID2 = int(guildID2)
  2012. memberCount1 = int(memberCount1)
  2013. memberCount2 = int(memberCount2)
  2014. observerCount = int(observerCount)
  2015.  
  2016. self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  2017. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2018.  
  2019. def __GuildWar_OpenAskDialog(self, guildID, warType):
  2020.  
  2021. guildName = guild.GetGuildName(guildID)
  2022.  
  2023. # REMOVED_GUILD_BUG_FIX
  2024. if "Noname" == guildName:
  2025. return
  2026. # END_OF_REMOVED_GUILD_BUG_FIX
  2027.  
  2028. import uiGuild
  2029. questionDialog = uiGuild.AcceptGuildWarDialog()
  2030. questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  2031. questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  2032. questionDialog.Open(guildName, warType)
  2033.  
  2034. self.guildWarQuestionDialog = questionDialog
  2035.  
  2036. def __GuildWar_CloseAskDialog(self):
  2037. self.guildWarQuestionDialog.Close()
  2038. self.guildWarQuestionDialog = None
  2039.  
  2040. def __GuildWar_OnAccept(self):
  2041.  
  2042. guildName = self.guildWarQuestionDialog.GetGuildName()
  2043.  
  2044. net.SendChatPacket("/war " + guildName)
  2045. self.__GuildWar_CloseAskDialog()
  2046.  
  2047. return 1
  2048.  
  2049. def __GuildWar_OnDecline(self):
  2050.  
  2051. guildName = self.guildWarQuestionDialog.GetGuildName()
  2052.  
  2053. net.SendChatPacket("/nowar " + guildName)
  2054. self.__GuildWar_CloseAskDialog()
  2055.  
  2056. return 1
  2057. ## BINARY CALLBACK
  2058. ######################################################################################
  2059.  
  2060. def __ServerCommand_Build(self):
  2061. serverCommandList={
  2062. "ConsoleEnable" : self.__Console_Enable,
  2063. "DayMode" : self.__DayMode_Update,
  2064. "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update,
  2065. "CloseRestartWindow" : self.__RestartDialog_Close,
  2066. "OpenPrivateShop" : self.__PrivateShop_Open,
  2067. "PartyHealReady" : self.PartyHealReady,
  2068. "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  2069. "CloseSafebox" : self.CommandCloseSafebox,
  2070.  
  2071. # ITEM_MALL
  2072. "CloseMall" : self.CommandCloseMall,
  2073. "ShowMeMallPassword" : self.AskMallPassword,
  2074. "item_mall" : self.__ItemMall_Open,
  2075. # END_OF_ITEM_MALL
  2076.  
  2077. "RefineSuceeded" : self.RefineSuceededMessage,
  2078. "RefineFailed" : self.RefineFailedMessage,
  2079. "xmas_snow" : self.__XMasSnow_Enable,
  2080. "xmas_boom" : self.__XMasBoom_Enable,
  2081. "xmas_song" : self.__XMasSong_Enable,
  2082. "xmas_tree" : self.__XMasTree_Enable,
  2083. "newyear_boom" : self.__XMasBoom_Enable,
  2084. "PartyRequest" : self.__PartyRequestQuestion,
  2085. "PartyRequestDenied" : self.__PartyRequestDenied,
  2086. "horse_state" : self.__Horse_UpdateState,
  2087. "hide_horse_state" : self.__Horse_HideState,
  2088. "WarUC" : self.__GuildWar_UpdateMemberCount,
  2089. "test_server" : self.__EnableTestServerFlag,
  2090. "mall" : self.__InGameShop_Show,
  2091. "mall_v3" : uimall.wnd.cqc.ReceiveQuestCommand,
  2092. "getinputbegin" : self.GetInputBegin,
  2093. "getinputend" : self.GetInputEnd,
  2094. "escogerskill" : self.__Input_Get_Vegas_1,
  2095. "escogerskillfin" : self.__Input_Get_Vegas_2,
  2096. "escogerskillinput" : self.__Input_Get_Vegas_3,
  2097. "SELECT_JOB" : self.SelectJob,
  2098.  
  2099. # WEDDING
  2100. "lover_login" : self.__LoginLover,
  2101. "lover_logout" : self.__LogoutLover,
  2102. "lover_near" : self.__LoverNear,
  2103. "lover_far" : self.__LoverFar,
  2104. "lover_divorce" : self.__LoverDivorce,
  2105. "PlayMusic" : self.__PlayMusic,
  2106. # END_OF_WEDDING
  2107.  
  2108. ########Daily Reward##########
  2109. "ManagerGiftSystem" : self.ManagerGiftSystem,
  2110.  
  2111. # PRIVATE_SHOP_PRICE_LIST
  2112. "MyShopPriceList" : self.__PrivateShop_PriceList,
  2113. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2114. #RACHAS#
  2115. "Showmedallas_gui" : self.__showmedallas_gui,
  2116. "Hidemedallas_gui" : self.__hidemedallas_gui,
  2117. "muertes" : self.__muertes,
  2118. "primera_muerte" : self.__primera_muerte,
  2119. "doble_muerte" : self.__doble_muerte,
  2120. "triple_muerte" : self.__triple_muerte,
  2121. "exterminio" : self.__exterminio,
  2122. "muertacular" : self.__muertacular,
  2123. "bestialidad" : self.__bestialidad,
  2124. "salvajada" : self.__salvajada,
  2125. "catastrofe" : self.__catastrofe,
  2126. "apocalipsis" : self.__apocalipsis,
  2127. "lluvia_muertos" : self.__lluvia_muertos,
  2128. "super_increible" : self.__super_increible,
  2129. #FIN RACHAS#
  2130. }
  2131.  
  2132. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  2133. serverCommandList["COSTUME_HIDE_CLEAR"] = self.COSTUME_HIDE_CLEAR
  2134. serverCommandList["COSTUME_HIDE_LIST"] = self.COSTUME_HIDE_LIST
  2135. serverCommandList["COSTUME_HIDE_LOAD"] = self.COSTUME_HIDE_LOAD
  2136.  
  2137. self.serverCommander=stringCommander.Analyzer()
  2138. for serverCommandItem in serverCommandList.items():
  2139. self.serverCommander.SAFE_RegisterCallBack(
  2140. serverCommandItem[0], serverCommandItem[1]
  2141. )
  2142.  
  2143. if app.ENABLE_DUNGEON_INFO_SYSTEM:
  2144. self.serverCommander.SAFE_RegisterCallBack("CleanDungeonInfo", self.CleanDungeonInfo)
  2145. self.serverCommander.SAFE_RegisterCallBack("CleanDungeonRanking", self.CleanDungeonRanking)
  2146. self.serverCommander.SAFE_RegisterCallBack("UpdateDungeonInfo", self.UpdateDungeonInfo)
  2147. self.serverCommander.SAFE_RegisterCallBack("UpdateDungeonRanking", self.UpdateDungeonRanking)
  2148. self.serverCommander.SAFE_RegisterCallBack("OpenDungeonRanking", self.OpenDungeonRanking)
  2149.  
  2150. def BINARY_ServerCommand_Run(self, line):
  2151. try:
  2152. #print " BINARY_ServerCommand_Run", line
  2153. return self.serverCommander.Run(line)
  2154. except RuntimeError, msg:
  2155. dbg.TraceError(msg)
  2156. return 0
  2157.  
  2158. if app.ENABLE_CUBE_RENEWAL_WORLDARD:
  2159. def BINARY_CUBE_RENEWAL_OPEN(self):
  2160. if self.interface:
  2161. self.interface.BINARY_CUBE_RENEWAL_OPEN()
  2162.  
  2163. def __ProcessPreservedServerCommand(self):
  2164. try:
  2165. command = net.GetPreservedServerCommand()
  2166. while command:
  2167. print " __ProcessPreservedServerCommand", command
  2168. self.serverCommander.Run(command)
  2169. command = net.GetPreservedServerCommand()
  2170. except RuntimeError, msg:
  2171. dbg.TraceError(msg)
  2172. return 0
  2173.  
  2174. def PartyHealReady(self):
  2175. self.interface.PartyHealReady()
  2176.  
  2177. def AskSafeboxPassword(self):
  2178. self.interface.AskSafeboxPassword()
  2179.  
  2180. # ITEM_MALL
  2181. def AskMallPassword(self):
  2182. self.interface.AskMallPassword()
  2183.  
  2184. def __ItemMall_Open(self):
  2185. self.interface.OpenItemMall();
  2186.  
  2187. def CommandCloseMall(self):
  2188. self.interface.CommandCloseMall()
  2189. # END_OF_ITEM_MALL
  2190.  
  2191. def RefineSuceededMessage(self):
  2192. snd.PlaySound("sound/ui/make_soket.wav")
  2193. self.PopupMessage(localeInfo.REFINE_SUCCESS)
  2194.  
  2195. def RefineFailedMessage(self):
  2196. snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2197. self.PopupMessage(localeInfo.REFINE_FAILURE)
  2198.  
  2199. def CommandCloseSafebox(self):
  2200. self.interface.CommandCloseSafebox()
  2201.  
  2202. # PRIVATE_SHOP_PRICE_LIST
  2203. def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  2204. uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
  2205. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2206.  
  2207. def __Horse_HideState(self):
  2208. self.affectShower.SetHorseState(0, 0, 0)
  2209.  
  2210. def __Horse_UpdateState(self, level, health, battery):
  2211. self.affectShower.SetHorseState(int(level), int(health), int(battery))
  2212.  
  2213. def __IsXMasMap(self):
  2214. mapDict = ( "metin2_map_n_flame_01",
  2215. "metin2_map_n_desert_01",
  2216. "metin2_map_spiderdungeon",
  2217. "chamber_of_wisdom_dungeon",
  2218. "metin2_map_deviltower1", )
  2219.  
  2220. if background.GetCurrentMapName() in mapDict:
  2221. return False
  2222.  
  2223. return True
  2224.  
  2225. def __XMasSnow_Enable(self, mode):
  2226.  
  2227. self.__XMasSong_Enable(mode)
  2228.  
  2229. if "1"==mode:
  2230.  
  2231. if not self.__IsXMasMap():
  2232. return
  2233.  
  2234. print "XMAS_SNOW ON"
  2235. background.EnableSnow(1)
  2236.  
  2237. else:
  2238. print "XMAS_SNOW OFF"
  2239. background.EnableSnow(0)
  2240.  
  2241. def __XMasBoom_Enable(self, mode):
  2242. if "1"==mode:
  2243.  
  2244. if not self.__IsXMasMap():
  2245. return
  2246.  
  2247. print "XMAS_BOOM ON"
  2248. self.__DayMode_Update("dark")
  2249. self.enableXMasBoom = True
  2250. self.startTimeXMasBoom = app.GetTime()
  2251. else:
  2252. print "XMAS_BOOM OFF"
  2253. self.__DayMode_Update("light")
  2254. self.enableXMasBoom = False
  2255.  
  2256. def __XMasTree_Enable(self, grade):
  2257.  
  2258. print "XMAS_TREE ", grade
  2259. background.SetXMasTree(int(grade))
  2260.  
  2261. def __XMasSong_Enable(self, mode):
  2262. if "1"==mode:
  2263. print "XMAS_SONG ON"
  2264.  
  2265. XMAS_BGM = "xmas.mp3"
  2266.  
  2267. if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  2268. if musicInfo.fieldMusic != "":
  2269. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2270.  
  2271. musicInfo.fieldMusic=XMAS_BGM
  2272. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2273.  
  2274. else:
  2275. print "XMAS_SONG OFF"
  2276.  
  2277. if musicInfo.fieldMusic != "":
  2278. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2279.  
  2280. musicInfo.fieldMusic=musicInfo.METIN2THEMA
  2281. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2282.  
  2283. def __RestartDialog_Close(self):
  2284. self.interface.CloseRestartDialog()
  2285.  
  2286. def __Console_Enable(self):
  2287. constInfo.CONSOLE_ENABLE = True
  2288. self.consoleEnable = True
  2289. app.EnableSpecialCameraMode()
  2290. ui.EnablePaste(True)
  2291.  
  2292. ## PrivateShop
  2293. def __PrivateShop_Open(self):
  2294. self.interface.OpenPrivateShopInputNameDialog()
  2295.  
  2296. def BINARY_PrivateShop_Appear(self, vid, text):
  2297. self.interface.AppearPrivateShop(vid, text)
  2298.  
  2299. def BINARY_PrivateShop_Disappear(self, vid):
  2300. self.interface.DisappearPrivateShop(vid)
  2301.  
  2302. ## DayMode
  2303. def __PRESERVE_DayMode_Update(self, mode):
  2304. if "light"==mode:
  2305. background.SetEnvironmentData(0)
  2306. elif "dark"==mode:
  2307.  
  2308. if not self.__IsXMasMap():
  2309. return
  2310.  
  2311. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2312. background.SetEnvironmentData(1)
  2313.  
  2314. def __DayMode_Update(self, mode):
  2315. if "light"==mode:
  2316. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  2317. elif "dark"==mode:
  2318.  
  2319. if not self.__IsXMasMap():
  2320. return
  2321.  
  2322. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  2323.  
  2324. def __DayMode_OnCompleteChangeToLight(self):
  2325. background.SetEnvironmentData(0)
  2326. self.curtain.FadeIn()
  2327.  
  2328. def __DayMode_OnCompleteChangeToDark(self):
  2329. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2330. background.SetEnvironmentData(1)
  2331. self.curtain.FadeIn()
  2332.  
  2333. ## XMasBoom
  2334. def __XMasBoom_Update(self):
  2335.  
  2336. self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  2337. if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  2338. return
  2339.  
  2340. boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  2341. boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  2342.  
  2343. if app.GetTime() - self.startTimeXMasBoom > boomTime:
  2344.  
  2345. self.indexXMasBoom += 1
  2346.  
  2347. for i in xrange(boomCount):
  2348. self.__XMasBoom_Boom()
  2349.  
  2350. def __XMasBoom_Boom(self):
  2351. x, y, z = player.GetMainCharacterPosition()
  2352. randX = app.GetRandom(-150, 150)
  2353. randY = app.GetRandom(-150, 150)
  2354.  
  2355. snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  2356.  
  2357. def __PartyRequestQuestion(self, vid):
  2358. vid = int(vid)
  2359. partyRequestQuestionDialog = uiCommon.QuestionDialog()
  2360. partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
  2361. partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  2362. partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  2363. partyRequestQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerPartyRequest(arg))
  2364. partyRequestQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerPartyRequest(arg))
  2365. partyRequestQuestionDialog.Open()
  2366. partyRequestQuestionDialog.vid = vid
  2367. self.partyRequestQuestionDialog = partyRequestQuestionDialog
  2368.  
  2369. def __AnswerPartyRequest(self, answer):
  2370. if not self.partyRequestQuestionDialog:
  2371. return
  2372.  
  2373. vid = self.partyRequestQuestionDialog.vid
  2374.  
  2375. if answer:
  2376. net.SendChatPacket("/party_request_accept " + str(vid))
  2377. else:
  2378. net.SendChatPacket("/party_request_deny " + str(vid))
  2379.  
  2380. self.partyRequestQuestionDialog.Close()
  2381. self.partyRequestQuestionDialog = None
  2382.  
  2383. def __PartyRequestDenied(self):
  2384. self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
  2385.  
  2386. def __EnableTestServerFlag(self):
  2387. app.EnableTestServerFlag()
  2388.  
  2389. def __InGameShop_Show(self, url):
  2390. if constInfo.IN_GAME_SHOP_ENABLE:
  2391. self.interface.OpenWebWindow(url)
  2392.  
  2393. # WEDDING
  2394. def __LoginLover(self):
  2395. if self.interface.wndMessenger:
  2396. self.interface.wndMessenger.OnLoginLover()
  2397.  
  2398. def __LogoutLover(self):
  2399. if self.interface.wndMessenger:
  2400. self.interface.wndMessenger.OnLogoutLover()
  2401. if self.affectShower:
  2402. self.affectShower.HideLoverState()
  2403.  
  2404. def __LoverNear(self):
  2405. if self.affectShower:
  2406. self.affectShower.ShowLoverState()
  2407.  
  2408. def __LoverFar(self):
  2409. if self.affectShower:
  2410. self.affectShower.HideLoverState()
  2411.  
  2412. def __LoverDivorce(self):
  2413. if self.interface.wndMessenger:
  2414. self.interface.wndMessenger.ClearLoverInfo()
  2415. if self.affectShower:
  2416. self.affectShower.ClearLoverState()
  2417.  
  2418. if app.ENABLE_MOVE_CHANNEL:
  2419. def __GetServerID(self):
  2420. serverID = 1
  2421. for i in serverInfo.REGION_DICT[0].keys():
  2422. if serverInfo.REGION_DICT[0][i]["name"] == net.GetServerInfo().split(",")[0]:
  2423. serverID = int(i)
  2424. break
  2425.  
  2426. return serverID
  2427.  
  2428. def RefreshChannel(self, channel):
  2429. channelName = ""
  2430. serverName = serverInfo.REGION_DICT[0][self.__GetServerID()]["name"]
  2431. if channel in serverInfo.REGION_DICT[0][self.__GetServerID()]["channel"]:
  2432. channelName = serverInfo.REGION_DICT[0][self.__GetServerID()]["channel"][int(channel)]["name"]
  2433. elif channel == 99:
  2434. channelName = "CH General"
  2435. else:
  2436. channelName = "CH Necunoscut"
  2437.  
  2438. net.SetServerInfo("%s, %s" % (serverName,channelName))
  2439. if self.interface:
  2440. self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
  2441.  
  2442.  
  2443. if app.ENABLE_SWITCHBOT:
  2444. def RefreshSwitchbotWindow(self):
  2445. self.interface.RefreshSwitchbotWindow()
  2446.  
  2447. def RefreshSwitchbotItem(self, slot):
  2448. self.interface.RefreshSwitchbotItem(slot)
  2449.  
  2450. if app.ENABLE_DROP_ITEM_WORLDARD:
  2451. def BINARY_DROP_ITEM_OPEN(self):
  2452. if self.interface:
  2453. self.interface.BINARY_DROP_ITEM_OPEN()
  2454.  
  2455. def __PlayMusic(self, flag, filename):
  2456. flag = int(flag)
  2457. if flag:
  2458. snd.FadeOutAllMusic()
  2459. musicInfo.SaveLastPlayFieldMusic()
  2460. snd.FadeInMusic("BGM/" + filename)
  2461. else:
  2462. snd.FadeOutAllMusic()
  2463. musicInfo.LoadLastPlayFieldMusic()
  2464. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2465.  
  2466. if app.ENABLE_CHANGELOOK_SYSTEM:
  2467. def ActChangeLook(self, iAct):
  2468. if self.interface:
  2469. self.interface.ActChangeLook(iAct)
  2470.  
  2471. def AlertChangeLook(self):
  2472. self.PopupMessage(localeInfo.CHANGE_LOOK_DEL_ITEM)
  2473.  
  2474. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  2475. def COSTUME_HIDE_CLEAR(self):
  2476. self.interface.costume_hide_clear()
  2477.  
  2478. def COSTUME_HIDE_LIST(self,slot,index):
  2479. self.interface.costume_hide_list(slot,index)
  2480.  
  2481. def COSTUME_HIDE_LOAD(self):
  2482. self.interface.costume_hide_load()
  2483.  
  2484. if app.ENABLE_SHOW_CHEST_DROP:
  2485. def BINARY_AddChestDropInfo(self, chestVnum, pageIndex, slotIndex, itemVnum, itemCount):
  2486. if self.interface:
  2487. self.interface.AddChestDropInfo(chestVnum, pageIndex, slotIndex, itemVnum, itemCount)
  2488.  
  2489. def BINARY_RefreshChestDropInfo(self, chestVnum):
  2490. if self.interface:
  2491. self.interface.RefreshChestDropInfo(chestVnum)
  2492.  
  2493. if app.ENABLE_ACCE_SYSTEM:
  2494. def ActAcce(self, iAct, bWindow):
  2495. if self.interface:
  2496. self.interface.ActAcce(iAct, bWindow)
  2497.  
  2498. def AlertAcce(self, bWindow):
  2499. snd.PlaySound("sound/ui/make_soket.wav")
  2500. if bWindow:
  2501. self.PopupMessage(localeInfo.ACCE_DEL_SERVEITEM)
  2502. else:
  2503. self.PopupMessage(localeInfo.ACCE_DEL_ABSORDITEM)
  2504. # END_OF_WEDDING
  2505.  
  2506. def GetInputBegin(self):
  2507. constInfo.INPUT_IGNORE = 1
  2508.  
  2509. def GetInputEnd(self):
  2510. constInfo.INPUT_IGNORE = 0
  2511.  
  2512. #RACHAS#
  2513. def __primera_muerte(self):
  2514. self.primera_muerte.Show()
  2515. snd.PlaySound("sound/ui/1_muerte.wav")
  2516. net.SendChatPacket("(1_muerte)")
  2517.  
  2518. def __doble_muerte(self):
  2519. self.doble_muerte.Show()
  2520. snd.PlaySound("sound/ui/doble_muerte.wav")
  2521. net.SendChatPacket("(doble_muerte)")
  2522.  
  2523. def __triple_muerte(self):
  2524. self.triple_muerte.Show()
  2525. snd.PlaySound("sound/ui/triple_muerte.wav")
  2526. net.SendChatPacket("(triple_muerte)")
  2527.  
  2528. def __exterminio(self):
  2529. self.exterminio.Show()
  2530. snd.PlaySound("sound/ui/exterminio.wav")
  2531. net.SendChatPacket("(exterminio)")
  2532.  
  2533. def __muertacular(self):
  2534. self.muertacular.Show()
  2535. snd.PlaySound("sound/ui/muertacular.wav")
  2536. net.SendChatPacket("(muertacular)")
  2537.  
  2538. def __bestialidad(self):
  2539. self.bestialidad.Show()
  2540. snd.PlaySound("sound/ui/bestialidad.wav")
  2541. net.SendChatPacket("(bestialidad)")
  2542.  
  2543. def __salvajada(self):
  2544. self.salvajada.Show()
  2545. snd.PlaySound("sound/ui/salvajada.wav")
  2546. net.SendChatPacket("(salvajada)")
  2547.  
  2548. def __catastrofe(self):
  2549. self.catastrofe.Show()
  2550. snd.PlaySound("sound/ui/catastrofe.wav")
  2551. net.SendChatPacket("(catastrofe)")
  2552.  
  2553. def __apocalipsis(self):
  2554. self.apocalipsis.Show()
  2555. snd.PlaySound("sound/ui/apocalipsis.wav")
  2556. net.SendChatPacket("(apocalipsis)")
  2557.  
  2558. def __lluvia_muertos(self):
  2559. self.lluvia_muertos.Show()
  2560. snd.PlaySound("sound/ui/lluvia_muertos.wav")
  2561. net.SendChatPacket("(lluvia_muertos)")
  2562.  
  2563. def __super_increible(self):
  2564. self.super_increible.Show()
  2565. snd.PlaySound("sound/ui/super_increible.wav")
  2566. net.SendChatPacket("(super_increible)")
  2567.  
  2568. def __hidemedallas_gui(self):
  2569. self.Medallas_gui.Hide()
  2570. self.primera_muerte.Hide()
  2571. self.doble_muerte.Hide()
  2572. self.triple_muerte.Hide()
  2573. self.exterminio.Hide()
  2574. self.muertacular.Hide()
  2575. self.bestialidad.Hide()
  2576. self.salvajada.Hide()
  2577. self.catastrofe.Hide()
  2578. self.apocalipsis.Hide()
  2579. self.lluvia_muertos.Hide()
  2580. self.super_increible.Hide()
  2581. self.muertes.Hide()
  2582.  
  2583. def __showmedallas_gui(self):
  2584. self.Medallas_gui.Show()
  2585. self.muertes.Show()
  2586.  
  2587. def __muertes(self, muertes):
  2588. self.muertes.SetText(muertes)
  2589.  
  2590. #FIN RACHAS#
  2591.  
  2592. def __Input_Get_Vegas_1(self):
  2593. constInfo.INPUT_IGNORE = 1
  2594.  
  2595. def __Input_Get_Vegas_2(self):
  2596. constInfo.INPUT_IGNORE = 0
  2597.  
  2598. def __Input_Get_Vegas_3(self):
  2599. net.SendQuestInputStringPacket("1")
  2600.  
  2601. def SelectJob(self, cmd):
  2602. import uiselectjob
  2603. cmd = cmd.split('#')
  2604. if cmd[0] == 'QID':
  2605. constInfo.SelectJob['QID'] = int(cmd[1])
  2606. elif cmd[0] == 'INPUT':
  2607. constInfo.INPUT_IGNORE = int(cmd[1])
  2608. elif cmd[0] == 'SEND':
  2609. net.SendQuestInputStringPacket(str(constInfo.SelectJob['QCMD']))
  2610. constInfo.SelectJob['QCMD'] = ''
  2611. elif cmd[0] == 'OPEN':
  2612. self.job_select = uiselectjob.JobSelectWindow()
  2613. self.job_select.Open()
  2614. elif cmd[0] == 'CLOSE':
  2615. self.job_select = uiselectjob.JobSelectWindow()
  2616. self.job_select.RealClose()
  2617.  
  2618. def GetInputStart(self):
  2619. constInfo.INPUT_IGNORE = 1
  2620.  
  2621. def GetInputStop(self):
  2622. constInfo.INPUT_IGNORE = 0
Advertisement
RAW Paste Data Copied
Advertisement