Advertisement
Guest User

Untitled

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