Advertisement
Guest User

Untitled

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