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