1. import os
  2. import pythonApi
  3. app = __import__(pythonApi.GetModuleName("app"))
  4. chrmgr = __import__(pythonApi.GetModuleName("chrmgr"))
  5. import dbg
  6. import grp
  7. import item
  8. import background
  9. chr = __import__(pythonApi.GetModuleName("chr"))
  10. pack = __import__(pythonApi.GetModuleName("pack"))
  11. player = __import__(pythonApi.GetModuleName("player"))
  12. import snd
  13. import chat
  14. import textTail
  15. import snd
  16. net = __import__(pythonApi.GetModuleName("net"))
  17. import effect
  18. import wndMgr
  19. import fly
  20. import systemSetting
  21. import quest
  22. import guild
  23. import skill
  24. import messenger
  25. import localeInfo
  26. import constInfo
  27. import uiruhtasi
  28. import exchange
  29. import ime
  30. import uiSearchShop
  31. import uiScriptLocale
  32. import ui
  33. import uiCommon
  34. import uiPhaseCurtain
  35. import uiMapNameShower
  36. import uiAffectShower
  37. import uiPlayerGauge
  38. import uiCharacter
  39. import uiTarget
  40. import uipetsystem,uiDungeonInfo
  41. import time
  42. # PRIVATE_SHOP_PRICE_LIST
  43. import uiPrivateShopBuilder
  44. # END_OF_PRIVATE_SHOP_PRICE_LIST
  45. import background
  46. import mouseModule
  47. import consoleModule
  48. import localeInfo
  49. import playerSettingModule
  50. import interfaceModule
  51. import day
  52. import musicInfo
  53. import debugInfo
  54. import stringCommander
  55. import uigamemasterpanel
  56. import nonplayer
  57. import uisupportsystem
  58. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  59. import uichangelook
  60. if app.ENABLE_COSTUME_AURA:
  61. import UiRefineAura
  62. #fixme -- add module in userinterface/pythonApplicationModule
  63. #if app.ENABLE_SUPPORT_SYSTEM:
  64. import uisupportsystem
  65. from _weakref import proxy
  66. # SCREENSHOT_CWDSAVE
  67. SCREENSHOT_CWDSAVE = False
  68. SCREENSHOT_DIR = None
  69. if localeInfo.IsEUROPE():
  70. SCREENSHOT_CWDSAVE = True
  71. if localeInfo.IsCIBN10():
  72. SCREENSHOT_CWDSAVE = False
  73. SCREENSHOT_DIR = "YT2W"
  74. cameraDistance = 1550.0
  75. cameraPitch = 27.0
  76. cameraRotation = 0.0
  77. cameraHeight = 100.0
  78. testAlignment = 0
  79. if app.ENABLE_BIOLOG_SYSTEM:
  80. import uiprofessionalbiolog
  81. SUB_RACE_FLAG_TO_ELEMENT = {
  82. 1 << 11 : 1,
  83. 1 << 12 : 2,
  84. 1 << 13 : 3,
  85. 1 << 14 : 4,
  86. 1 << 15 : 5,
  87. 1 << 16 : 6,
  88. }
  89. class GameWindow(ui.ScriptWindow):
  90. def __init__(self, stream):
  91. ui.ScriptWindow.__init__(self, "GAME")
  92. self.SetWindowName("game")
  93. net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  94. player.SetGameWindow(self)
  95. day.nacht = 0
  96. day.tag = 0
  97. import dailygift
  98. self.wnddailygift = dailygift.DailyGift()
  99. self.uiNewShopCreate = None
  100. self.uiNewShop = None
  101. self.ruhtasi = uiruhtasi.RuhTasi()
  102. self.ruhtasi.Hide()
  103. self.uiSearchShopBtn = ui.Button()
  104. self.uiSearchShopBtn.SetUpVisual("news/search.tga")
  105. self.uiSearchShopBtn.SetOverVisual("news/search.tga")
  106. self.uiSearchShopBtn.SetDownVisual("news/search.tga")
  107. self.uiSearchShopBtn.SetText("")
  108. self.uiSearchShopBtn.SetToolTipText(uiScriptLocale.SHOP_SEARCH_TITLE)
  109. self.uiSearchShopBtn.SetPosition(int((wndMgr.GetScreenWidth()*0.80)), 0)
  110. self.uiSearchShopBtn.SetEvent(self.OnClickSearch)
  111. self.uiSearchShopBtn.Show()
  112. self.uiSearchShop=uiSearchShop.ShopSearch()
  113. self.uiSearchShop.SetPosition(100,100)
  114. self.uiSearchShop.AddFlag('movable')
  115. self.uiSearchShop.AddFlag('float')
  116. self.uiSearchShop.Close()
  117. Medallas_gui = ui.AniImageBox()
  118. Medallas_gui.SetWindowHorizontalAlignLeft()
  119. Medallas_gui.SetWindowVerticalAlignTop()
  120. Medallas_gui.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  121. self.Medallas_gui = Medallas_gui
  122. self.Medallas_gui.SetPosition(10, 60)
  123. self.Medallas_gui.Hide()
  124. self.muertes = ui.TextLine()
  125. self.muertes.SetWindowHorizontalAlignLeft()
  126. self.muertes.SetWindowVerticalAlignTop()
  127. self.muertes.SetDefaultFontName()
  128. self.muertes.SetPosition(24, 71)
  129. self.muertes.SetText("0")
  130. self.muertes.SetOutline()
  131. self.muertes.Hide()
  132. self.primera_muerte = ui.AniImageBox()
  133. self.primera_muerte.SetWindowHorizontalAlignLeft()
  134. self.primera_muerte.SetWindowVerticalAlignTop()
  135. self.primera_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/1.dds")
  136. self.primera_muerte.SetPosition(43, 60)
  137. self.primera_muerte.Hide()
  138. self.doble_muerte = ui.AniImageBox()
  139. self.doble_muerte.SetWindowHorizontalAlignLeft()
  140. self.doble_muerte.SetWindowVerticalAlignTop()
  141. self.doble_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/2.dds")
  142. self.doble_muerte.SetPosition(43 + 33, 60)
  143. self.doble_muerte.Hide()
  144. self.triple_muerte = ui.AniImageBox()
  145. self.triple_muerte.SetWindowHorizontalAlignLeft()
  146. self.triple_muerte.SetWindowVerticalAlignTop()
  147. self.triple_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/3.dds")
  148. self.triple_muerte.SetPosition(43 + 33 + 33, 60)
  149. self.triple_muerte.Hide()
  150. self.exterminio = ui.AniImageBox()
  151. self.exterminio.SetWindowHorizontalAlignLeft()
  152. self.exterminio.SetWindowVerticalAlignTop()
  153. self.exterminio.AppendImage("d:/ymir work/ui/pattern/medallas/4.dds")
  154. self.exterminio.SetPosition(43+ 33+ 33 + 33, 60)
  155. self.muertacular = ui.AniImageBox()
  156. self.muertacular.SetWindowHorizontalAlignLeft()
  157. self.muertacular.SetWindowVerticalAlignTop()
  158. self.muertacular.AppendImage("d:/ymir work/ui/pattern/medallas/5.dds")
  159. self.muertacular.SetPosition(43+ 33+ 33+ 33 + 33, 60)
  160. self.bestialidad = ui.AniImageBox()
  161. self.bestialidad.SetWindowHorizontalAlignLeft()
  162. self.bestialidad.SetWindowVerticalAlignTop()
  163. self.bestialidad.AppendImage("d:/ymir work/ui/pattern/medallas/6.dds")
  164. self.bestialidad.SetPosition(43+ 33+ 33+ 33+ 33 + 33, 60)
  165. self.salvajada = ui.AniImageBox()
  166. self.salvajada.SetWindowHorizontalAlignLeft()
  167. self.salvajada.SetWindowVerticalAlignTop()
  168. self.salvajada.AppendImage("d:/ymir work/ui/pattern/medallas/7.dds")
  169. self.salvajada.SetPosition(43+ 33+ 33+ 33+ 33+ 33 + 33, 60)
  170. self.catastrofe = ui.AniImageBox()
  171. self.catastrofe.SetWindowHorizontalAlignLeft()
  172. self.catastrofe.SetWindowVerticalAlignTop()
  173. self.catastrofe.AppendImage("d:/ymir work/ui/pattern/medallas/8.dds")
  174. self.catastrofe.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 60)
  175. self.apocalipsis = ui.AniImageBox()
  176. self.apocalipsis.SetWindowHorizontalAlignLeft()
  177. self.apocalipsis.SetWindowVerticalAlignTop()
  178. self.apocalipsis.AppendImage("d:/ymir work/ui/pattern/medallas/9.dds")
  179. self.apocalipsis.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 60)
  180. self.lluvia_muertos = ui.AniImageBox()
  181. self.lluvia_muertos.SetWindowHorizontalAlignLeft()
  182. self.lluvia_muertos.SetWindowVerticalAlignTop()
  183. self.lluvia_muertos.AppendImage("d:/ymir work/ui/pattern/medallas/10.dds")
  184. self.lluvia_muertos.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 60)
  185. self.super_increible = ui.AniImageBox()
  186. self.super_increible.SetWindowHorizontalAlignLeft()
  187. self.super_increible.SetWindowVerticalAlignTop()
  188. self.super_increible.AppendImage("d:/ymir work/ui/pattern/medallas/11.dds")
  189. self.super_increible.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 60)
  190. #Fin menu
  191. self.quickSlotPageIndex = 0
  192. self.lastPKModeSendedTime = 0
  193. self.pressNumber = None
  194. if (app.WJ_COMBAT_ZONE):
  195. import uicombatzone
  196. self.wndCombatZone = uicombatzone.CombatZoneWindow()
  197. self.guildWarQuestionDialog = None
  198. self.interface = None
  199. self.targetBoard = None
  200. self.console = None
  201. self.mapNameShower = None
  202. self.affectShower = None
  203. self.playerGauge = None
  204. if app.ENABLE_COSTUME_AURA:
  205. self.RefineAura = UiRefineAura.RefineAura()
  206. self.stream=stream
  207. self.interface = interfaceModule.Interface()
  208. self.interface.MakeInterface()
  209. self.interface.ShowDefaultWindows()
  210. self.curtain = uiPhaseCurtain.PhaseCurtain()
  211. self.curtain.speed = 0.03
  212. self.curtain.Hide()
  213. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  214. self.ChangeLookWindow = uichangelook.ChangeLookWindow()
  215. self.targetBoard = uiTarget.TargetBoard()
  216. self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  217. self.targetBoard.Hide()
  218. self.petmain = uipetsystem.PetSystemMain()
  219. self.petmini = uipetsystem.PetSystemMini()
  220. self.console = consoleModule.ConsoleWindow()
  221. self.console.BindGameClass(self)
  222. self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  223. self.console.Hide()
  224. # if app.ENABLE_SUPPORT_SYSTEM:
  225. self.supportpg = uisupportsystem.SupportMainGui()
  226. self.supportpg = uisupportsystem.SupportMainGui()
  227. self.supportpg.Close()
  228. self.mapNameShower = uiMapNameShower.MapNameShower()
  229. self.affectShower = uiAffectShower.AffectShower()
  230. if app.ENABLE_TITLE_SYSTEM:
  231. import title_system
  232. self.wndTitleSystem = title_system.Title_System()
  233. import uimaintenance
  234. self.wndMaintenance = uimaintenance.MaintenanceClass()
  235. self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  236. self.playerGauge.Hide()
  237. #wj 2014.1.2. ESCإ°¸¦ ´©¸¦ ½أ ؟ى¼±ہûہ¸·خ DropQuestionDialog¸¦ ²ôµµ·د ¸¸µé¾ْ´ظ. ادءِ¸¸ أ³ہ½؟، itemDropQuestionDialog°، ¼±¾ًµا¾î ہضءِ ¾ت¾ئ ERROR°، ¹ك»‎اد؟© init؟،¼­ ¼±¾ً°ْ µ؟½أ؟، أت±âب­ ½أإ´.
  238. self.itemDropQuestionDialog = None
  239. self.__SetQuickSlotMode()
  240. self.__ServerCommand_Build()
  241. self.__ProcessPreservedServerCommand()
  242. def __del__(self):
  243. player.SetGameWindow(0)
  244. net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  245. ui.ScriptWindow.__del__(self)
  246. def Open(self):
  247. app.SetFrameSkip(1)
  248. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  249. self.quickSlotPageIndex = 0
  250. self.PickingCharacterIndex = -1
  251. self.PickingItemIndex = -1
  252. self.consoleEnable = False
  253. self.isShowDebugInfo = False
  254. self.ShowNameFlag = False
  255. self.litere_event = ui.Button()
  256. self.litere_event.SetParent(self)
  257. self.litere_event.SetPosition(wndMgr.GetScreenWidth()-300,50)
  258. self.litere_event.SetUpVisual("d:/ymir work/eventlitere/status_letters.tga")
  259. self.litere_event.SetOverVisual("d:/ymir work/eventlitere/status_letters.tga")
  260. self.litere_event.SetDownVisual("d:/ymir work/eventlitere/status_letters.tga")
  261. self.litere_event.SetToolTipText("Abrir evento")
  262. self.litere_event.SetEvent(lambda : net.SendChatPacket("/letters_open"))
  263. self.enableXMasBoom = False
  264. self.startTimeXMasBoom = 0.0
  265. self.indexXMasBoom = 0
  266. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  267. app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  268. if str(background.GetCurrentMapName()) == "metin2_12zi_stage" and app.ENABLE_12ZI:
  269. constInfo.SET_CAMERA_MAX_DISTANCE_12ZI()
  270. else:
  271. constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  272. constInfo.SET_DEFAULT_CHRNAME_COLOR()
  273. constInfo.SET_DEFAULT_FOG_LEVEL()
  274. constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  275. constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  276. constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  277. # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  278. constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  279. # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  280. import event
  281. event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
  282. textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  283. Espacio = ui.AniImageBox()
  284. Espacio.AddFlag("movable")
  285. Espacio.AddFlag("float")
  286. Espacio.SetWindowHorizontalAlignLeft()
  287. Espacio.SetWindowVerticalAlignTop()
  288. Espacio.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  289. self.Espacio = Espacio
  290. self.Espacio.SetPosition(10, 80)
  291. self.contador_usuarios_guerra = ui.TextLine()
  292. self.contador_usuarios_guerra.SetParent(Espacio)
  293. self.contador_usuarios_guerra.SetDefaultFontName()
  294. self.contador_usuarios_guerra.SetPosition(10, 0)
  295. self.contador_usuarios_guerra.SetText("0")
  296. self.contador_usuarios_guerra.SetOutline()
  297. self.muertos_guerra = ui.TextLine()
  298. self.muertos_guerra.SetParent(Espacio)
  299. self.muertos_guerra.SetDefaultFontName()
  300. self.muertos_guerra.SetPosition(10, 10)
  301. self.muertos_guerra.SetText("0")
  302. self.muertos_guerra.SetOutline()
  303. self.caido_guerra = ui.TextLine()
  304. self.caido_guerra.SetParent(Espacio)
  305. self.caido_guerra.SetDefaultFontName()
  306. self.caido_guerra.SetPosition(10, 20)
  307. self.caido_guerra.SetText("0")
  308. self.caido_guerra.SetOutline()
  309. if constInfo.PVPMODE_TEST_ENABLE:
  310. self.testPKMode = ui.TextLine()
  311. self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT)
  312. self.testPKMode.SetPosition(0, 15)
  313. self.testPKMode.SetWindowHorizontalAlignCenter()
  314. self.testPKMode.SetHorizontalAlignCenter()
  315. self.testPKMode.SetFeather()
  316. self.testPKMode.SetOutline()
  317. self.testPKMode.Show()
  318. self.testAlignment = ui.TextLine()
  319. self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT)
  320. self.testAlignment.SetPosition(0, 35)
  321. self.testAlignment.SetWindowHorizontalAlignCenter()
  322. self.testAlignment.SetHorizontalAlignCenter()
  323. self.testAlignment.SetFeather()
  324. self.testAlignment.SetOutline()
  325. self.testAlignment.Show()
  326. self.__BuildKeyDict()
  327. self.__BuildDebugInfo()
  328. import uiNewShop
  329. self.uiNewShop = uiNewShop.ShopDialog()
  330. self.uiNewShop.Close()
  331. self.uiNewShopCreate = uiNewShop.ShopDialogCreate()
  332. self.uiNewShopCreate.Hide()
  333. # PRIVATE_SHOP_PRICE_LIST
  334. uiPrivateShopBuilder.Clear()
  335. # END_OF_PRIVATE_SHOP_PRICE_LIST
  336. # UNKNOWN_UPDATE
  337. exchange.InitTrading()
  338. # END_OF_UNKNOWN_UPDATE
  339. #if debugInfo.IsDebugMode():
  340. # self.ToggleDebugInfo()
  341. self.ToggleFPSInfo()
  342. ## Sound
  343. snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  344. snd.SetSoundVolume(systemSetting.GetSoundVolume())
  345. netFieldMusicFileName = net.GetFieldMusicFileName()
  346. if netFieldMusicFileName:
  347. snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  348. elif musicInfo.fieldMusic != "":
  349. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  350. self.__SetQuickSlotMode()
  351. self.__SelectQuickPage(self.quickSlotPageIndex)
  352. self.SetFocus()
  353. self.Show()
  354. app.ShowCursor()
  355. net.SendEnterGamePacket()
  356. # START_GAME_ERROR_EXIT
  357. try:
  358. self.StartGame()
  359. except:
  360. import exception
  361. exception.Abort("GameWindow.Open")
  362. # END_OF_START_GAME_ERROR_EXIT
  363. # NPC°، إ¥؛ê½أ½؛إغہ¸·خ ¸¸µé ¼ِ ہض´آ ¾ئہجإغµéہا ¸ٌ·دہ» ؤ³½ج
  364. # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ]
  365. self.cubeInformation = {}
  366. self.currentCubeNPC = 0
  367. if app.ENABLE_FOG_FIX:
  368. if systemSetting.IsFogMode():
  369. background.SetEnvironmentFog(True)
  370. else:
  371. background.SetEnvironmentFog(False)
  372. def Close(self):
  373. self.__ocultar_usuarios()
  374. self.Medallas_gui.Hide()
  375. self.primera_muerte.Hide()
  376. self.doble_muerte.Hide()
  377. self.triple_muerte.Hide()
  378. self.exterminio.Hide()
  379. self.muertacular.Hide()
  380. self.bestialidad.Hide()
  381. self.salvajada.Hide()
  382. self.catastrofe.Hide()
  383. self.apocalipsis.Hide()
  384. self.lluvia_muertos.Hide()
  385. self.super_increible.Hide()
  386. self.muertes.Hide()
  387. self.Hide()
  388. if self.uiNewShop:
  389. self.uiNewShop.Hide()
  390. self.uiNewShopCreate.Hide()
  391. uiPrivateShopBuilder.Clear()
  392. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  393. (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  394. if musicInfo.fieldMusic != "":
  395. snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  396. self.onPressKeyDict = None
  397. self.onClickKeyDict = None
  398. if app.ENABLE_COSTUME_AURA:
  399. self.RefineAura.Hide()
  400. chat.Close()
  401. snd.StopAllSound()
  402. grp.InitScreenEffect()
  403. chr.Destroy()
  404. textTail.Clear()
  405. quest.Clear()
  406. background.Destroy()
  407. guild.Destroy()
  408. messenger.Destroy()
  409. skill.ClearSkillData()
  410. wndMgr.Unlock()
  411. mouseModule.mouseController.DeattachObject()
  412. if self.guildWarQuestionDialog:
  413. self.guildWarQuestionDialog.Close()
  414. self.guildNameBoard = None
  415. self.partyRequestQuestionDialog = None
  416. self.partyInviteQuestionDialog = None
  417. self.guildInviteQuestionDialog = None
  418. self.guildWarQuestionDialog = None
  419. self.messengerAddFriendQuestion = None
  420. # UNKNOWN_UPDATE
  421. self.itemDropQuestionDialog = None
  422. # END_OF_UNKNOWN_UPDATE
  423. # QUEST_CONFIRM
  424. self.confirmDialog = None
  425. # END_OF_QUEST_CONFIRM
  426. if self.uiSearchShop:
  427. self.uiSearchShop.Close()
  428. self.uiSearchShop=0
  429. self.PrintCoord = None
  430. self.FrameRate = None
  431. self.Pitch = None
  432. self.Splat = None
  433. self.TextureNum = None
  434. self.ObjectNum = None
  435. self.ViewDistance = None
  436. self.PrintMousePos = None
  437. self.ClearDictionary()
  438. #if app.ENABLE_SUPPORT_SYSTEM:
  439. self.supportpg.Close()
  440. self.petmain.Close()
  441. self.petmini.Close()
  442. self.playerGauge = None
  443. self.mapNameShower = None
  444. self.affectShower = None
  445. if self.console:
  446. self.console.BindGameClass(0)
  447. self.console.Close()
  448. self.console=None
  449. if self.ruhtasi:
  450. self.ruhtasi.Destroy()
  451. self.ruhtasi = None
  452. if self.wndMaintenance.IsShow():
  453. self.wndMaintenance.Hide()
  454. if self.targetBoard:
  455. self.targetBoard.Destroy()
  456. self.targetBoard = None
  457. if (app.WJ_COMBAT_ZONE):
  458. if self.wndCombatZone:
  459. self.wndCombatZone.Close()
  460. if app.ENABLE_TITLE_SYSTEM:
  461. self.wndTitleSystem.Close()
  462. if self.interface:
  463. self.interface.HideAllWindows()
  464. self.interface.Close()
  465. self.interface=None
  466. player.ClearSkillDict()
  467. player.ResetCameraRotation()
  468. self.KillFocus()
  469. app.HideCursor()
  470. print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  471. def ruhcac(self):
  472. self.ruhtasi.Show()
  473. def __BuildKeyDict(self):
  474. onPressKeyDict = {}
  475. ##PressKey ´آ ´©¸£°ي ہض´آ µ؟¾ب °è¼س ہû؟ëµا´آ إ°ہج´ظ.
  476. ## ¼‎ہع ´ـأàإ° ؤü½½·ش؟، ہج؟ëµب´ظ.(ہجبؤ ¼‎ہعµéµµ ؤü ½½·ش؟ë ؟¹¾à)
  477. ## F12 ´آ إ¬¶َ µً¹ِ±×؟ë إ°ہج¹ا·خ ¾²ءِ ¾ت´آ °ش ءء´ظ.
  478. onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(4)
  479. onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(3)
  480. onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(2)
  481. onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(1)
  482. onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5)
  483. onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6)
  484. onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7)
  485. onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8)
  486. onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9)
  487. onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(7)
  488. onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(6)
  489. onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(5)
  490. onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(4)
  491. onPressKeyDict[app.DIK_F5] = lambda : self.GameMasterPanel()
  492. onPressKeyDict[app.DIK_F6] = lambda: self.interface.ShowItemFinder ()
  493. onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()
  494. onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage()
  495. onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen()
  496. onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack()
  497. #ؤ³¸¯إح ہجµ؟إ°
  498. onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp()
  499. onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown()
  500. onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft()
  501. onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight()
  502. onPressKeyDict[app.DIK_W] = lambda : self.MoveUp()
  503. onPressKeyDict[app.DIK_S] = lambda : self.MoveDown()
  504. onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft()
  505. onPressKeyDict[app.DIK_D] = lambda : self.MoveRight()
  506. onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  507. onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  508. #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  509. onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  510. onPressKeyDict[app.DIK_G] = self.__PressGKey
  511. onPressKeyDict[app.DIK_Q] = self.__PressQKey
  512. onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera()
  513. onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  514. onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  515. onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  516. onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  517. onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  518. onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  519. onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem()
  520. onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem()
  521. onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  522. onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  523. #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  524. onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  525. onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow()
  526. onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo()
  527. onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey()
  528. #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow()
  529. onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp()
  530. onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown()
  531. onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow()
  532. #onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key
  533. onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode()
  534. onPressKeyDict[app.DIK_Y] = lambda: self.OpenSupportGui()
  535. onPressKeyDict[app.DIK_J] = lambda : self.__PressJKey()
  536. onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey()
  537. onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey()
  538. onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
  539. self.onPressKeyDict = onPressKeyDict
  540. onClickKeyDict = {}
  541. onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  542. onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  543. onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  544. onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  545. onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  546. onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  547. onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  548. onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  549. onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  550. onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  551. onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  552. onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  553. onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  554. onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  555. onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  556. onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  557. onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  558. onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  559. onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  560. onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  561. onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  562. onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  563. onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  564. onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  565. onClickKeyDict[app.DIK_P] = lambda: self.OpenPetMainGui()
  566. self.onClickKeyDict=onClickKeyDict
  567. def __PressNumKey(self,num):
  568. MapName = str(background.GetCurrentMapName())
  569. if MapName == "mapa_guerra":
  570. if constInfo.ataque_guerra == 1:
  571. return
  572. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  573. if num >= 1 and num <= 9:
  574. if(chrmgr.IsPossibleEmoticon(-1)):
  575. chrmgr.SetEmoticon(-1,int(num)-1)
  576. net.SendEmoticon(int(num)-1)
  577. else:
  578. if num >= 1 and num <= 4:
  579. self.pressNumber(num-1)
  580. def __ClickBKey(self):
  581. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  582. return
  583. else:
  584. if constInfo.PVPMODE_ACCELKEY_ENABLE:
  585. self.ChangePKMode()
  586. def __PressJKey(self):
  587. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  588. if player.IsMountingHorse():
  589. net.SendChatPacket("/unmount")
  590. else:
  591. #net.SendChatPacket("/user_horse_ride")
  592. if not uiPrivateShopBuilder.IsBuildingPrivateShop():
  593. for i in xrange(player.INVENTORY_PAGE_SIZE*player.INVENTORY_PAGE_COUNT):
  594. if player.GetItemIndex(i) in (71114, 71116, 71118, 71120):
  595. net.SendItemUsePacket(i)
  596. break
  597. def __PressHKey(self):
  598. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  599. net.SendChatPacket("/user_horse_ride")
  600. else:
  601. self.interface.OpenHelpWindow()
  602. def __PressBKey(self):
  603. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  604. net.SendChatPacket("/user_horse_back")
  605. else:
  606. state = "EMOTICON"
  607. self.interface.ToggleCharacterWindow(state)
  608. def __PressFKey(self):
  609. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  610. net.SendChatPacket("/user_horse_feed")
  611. else:
  612. app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  613. def __PressGKey(self):
  614. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  615. net.SendChatPacket("/ride")
  616. else:
  617. if self.ShowNameFlag:
  618. self.interface.ToggleGuildWindow()
  619. else:
  620. app.PitchCamera(app.CAMERA_TO_POSITIVE)
  621. def __ReleaseGKey(self):
  622. app.PitchCamera(app.CAMERA_STOP)
  623. def __PressQKey(self):
  624. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  625. if 0==interfaceModule.IsQBHide:
  626. interfaceModule.IsQBHide = 1
  627. self.interface.HideAllQuestButton()
  628. else:
  629. interfaceModule.IsQBHide = 0
  630. self.interface.ShowAllQuestButton()
  631. else:
  632. app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  633. def __SetQuickSlotMode(self):
  634. self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  635. def __SetQuickPageMode(self):
  636. self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  637. def __PressQuickSlot(self, localSlotIndex):
  638. player.RequestUseLocalQuickSlot(localSlotIndex)
  639. def __SelectQuickPage(self, pageIndex):
  640. self.quickSlotPageIndex = pageIndex
  641. player.SetQuickPage(pageIndex)
  642. def ToggleFPSInfo(self):
  643. self.FrameRate.Show()
  644. def ToggleDebugInfo(self):
  645. self.isShowDebugInfo = not self.isShowDebugInfo
  646. if self.isShowDebugInfo:
  647. self.PrintCoord.Show()
  648. self.FrameRate.Show()
  649. self.Pitch.Show()
  650. self.Splat.Show()
  651. self.TextureNum.Show()
  652. self.ObjectNum.Show()
  653. self.ViewDistance.Show()
  654. self.PrintMousePos.Show()
  655. else:
  656. self.PrintCoord.Hide()
  657. self.FrameRate.Hide()
  658. self.Pitch.Hide()
  659. self.Splat.Hide()
  660. self.TextureNum.Hide()
  661. self.ObjectNum.Hide()
  662. self.ViewDistance.Hide()
  663. self.PrintMousePos.Hide()
  664. def __BuildDebugInfo(self):
  665. ## Character Position Coordinate
  666. self.PrintCoord = ui.TextLine()
  667. self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
  668. self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  669. ## Frame Rate
  670. #self.FrameRate = ui.TextLine()
  671. #self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  672. #self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  673. self.FrameRate = ui.TextLine()
  674. self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  675. self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 85, 180) #Change -200 for x coordinate, 20 for y coordinate
  676. ## Camera Pitch
  677. self.Pitch = ui.TextLine()
  678. self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
  679. self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  680. ## Splat
  681. self.Splat = ui.TextLine()
  682. self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
  683. self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  684. ##
  685. self.PrintMousePos = ui.TextLine()
  686. self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
  687. self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  688. # TextureNum
  689. self.TextureNum = ui.TextLine()
  690. self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
  691. self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  692. # ؟ہ؛êء§ئ® ±×¸®´آ °³¼ِ
  693. self.ObjectNum = ui.TextLine()
  694. self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
  695. self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
  696. # ½أ¾ك°إ¸®
  697. self.ViewDistance = ui.TextLine()
  698. self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
  699. self.ViewDistance.SetPosition(0, 0)
  700. def __NotifyError(self, msg):
  701. chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  702. def ChangePKMode(self):
  703. if not app.IsPressed(app.DIK_LCONTROL):
  704. return
  705. if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  706. self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  707. return
  708. curTime = app.GetTime()
  709. if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  710. return
  711. self.lastPKModeSendedTime = curTime
  712. curPKMode = player.GetPKMode()
  713. nextPKMode = curPKMode + 1
  714. if nextPKMode == player.PK_MODE_PROTECT:
  715. if 0 == player.GetGuildID():
  716. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  717. nextPKMode = 0
  718. else:
  719. nextPKMode = player.PK_MODE_GUILD
  720. elif nextPKMode == player.PK_MODE_MAX_NUM:
  721. nextPKMode = 0
  722. net.SendChatPacket("/PKMode " + str(nextPKMode))
  723. print "/PKMode " + str(nextPKMode)
  724. def OnChangePKMode(self):
  725. self.interface.OnChangePKMode()
  726. try:
  727. self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  728. except KeyError:
  729. print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  730. if constInfo.PVPMODE_TEST_ENABLE:
  731. curPKMode = player.GetPKMode()
  732. alignment, grade = chr.testGetPKData()
  733. self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  734. self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  735. self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + localeInfo.TITLE_NAME_LIST[grade] + ")")
  736. ###############################################################################################
  737. ###############################################################################################
  738. ## Game Callback Functions
  739. # Start
  740. def StartGame(self):
  741. self.RefreshInventory()
  742. self.RefreshEquipment()
  743. self.RefreshCharacter()
  744. self.RefreshSkill()
  745. # Refresh
  746. def CheckGameButton(self):
  747. if self.interface:
  748. self.interface.CheckGameButton()
  749. def RefreshAlignment(self):
  750. self.interface.RefreshAlignment()
  751. if app.WJ_SHOW_ALL_CHANNEL:
  752. def BINARY_OnChannelPacket(self, channel):
  753. dict = {'name' : ' الفترة التجربية '}
  754. if channel == 99:
  755. net.SetServerInfo((localeInfo.TEXT_CHANNEL_EVENTOS % (dict['name'], str("Especial"))).strip())
  756. if self.interface:
  757. self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
  758. else:
  759. net.SetServerInfo((localeInfo.TEXT_CHANNEL % (dict['name'], channel)).strip())
  760. if self.interface:
  761. self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
  762. def RefreshStatus(self):
  763. self.CheckGameButton()
  764. if self.interface:
  765. self.interface.RefreshStatus()
  766. if self.playerGauge:
  767. self.playerGauge.RefreshGauge()
  768. def RefreshStamina(self):
  769. self.interface.RefreshStamina()
  770. def RefreshSkill(self):
  771. self.CheckGameButton()
  772. if self.interface:
  773. self.interface.RefreshSkill()
  774. def RefreshQuest(self):
  775. self.interface.RefreshQuest()
  776. def RefreshMessenger(self):
  777. self.interface.RefreshMessenger()
  778. def RefreshGuildInfoPage(self):
  779. self.interface.RefreshGuildInfoPage()
  780. def RefreshGuildBoardPage(self):
  781. self.interface.RefreshGuildBoardPage()
  782. def RefreshGuildMemberPage(self):
  783. self.interface.RefreshGuildMemberPage()
  784. def RefreshGuildMemberPageGradeComboBox(self):
  785. self.interface.RefreshGuildMemberPageGradeComboBox()
  786. def RefreshGuildSkillPage(self):
  787. self.interface.RefreshGuildSkillPage()
  788. def RefreshGuildGradePage(self):
  789. self.interface.RefreshGuildGradePage()
  790. def RefreshMobile(self):
  791. if self.interface:
  792. self.interface.RefreshMobile()
  793. def OnMobileAuthority(self):
  794. self.interface.OnMobileAuthority()
  795. def OnBlockMode(self, mode):
  796. self.interface.OnBlockMode(mode)
  797. def OpenQuestWindow(self, skin, idx):
  798. if not constInfo.INPUT_IGNORE:
  799. self.interface.OpenQuestWindow(skin, idx)
  800. def AskGuildName(self):
  801. guildNameBoard = uiCommon.InputDialog()
  802. guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
  803. guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  804. guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  805. guildNameBoard.Open()
  806. self.guildNameBoard = guildNameBoard
  807. def ConfirmGuildName(self):
  808. guildName = self.guildNameBoard.GetText()
  809. if not guildName:
  810. return
  811. if net.IsInsultIn(guildName):
  812. self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
  813. return
  814. net.SendAnswerMakeGuildPacket(guildName)
  815. self.guildNameBoard.Close()
  816. self.guildNameBoard = None
  817. return True
  818. def CancelGuildName(self):
  819. self.guildNameBoard.Close()
  820. self.guildNameBoard = None
  821. return True
  822. ## Refine
  823. def PopupMessage(self, msg):
  824. self.stream.popupWindow.Close()
  825. self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
  826. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  827. self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  828. def AppendMaterialToRefineDialog(self, vnum, count):
  829. self.interface.AppendMaterialToRefineDialog(vnum, count)
  830. def RunUseSkillEvent(self, slotIndex, coolTime):
  831. self.interface.OnUseSkill(slotIndex, coolTime)
  832. def ClearAffects(self):
  833. self.affectShower.ClearAffects()
  834. def SetAffect(self, affect):
  835. self.affectShower.SetAffect(affect)
  836. def ResetAffect(self, affect):
  837. self.affectShower.ResetAffect(affect)
  838. # UNKNOWN_UPDATE
  839. def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  840. self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  841. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  842. self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
  843. elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
  844. self.BINARY_DragonSoulGiveQuilification()
  845. def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  846. self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  847. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  848. self.interface.DragonSoulDeactivate()
  849. # END_OF_UNKNOWN_UPDATE
  850. def ActivateSkillSlot(self, slotIndex):
  851. if self.interface:
  852. self.interface.OnActivateSkill(slotIndex)
  853. def DeactivateSkillSlot(self, slotIndex):
  854. if self.interface:
  855. self.interface.OnDeactivateSkill(slotIndex)
  856. def RefreshEquipment(self):
  857. if self.interface:
  858. self.interface.RefreshInventory()
  859. def RefreshInventory(self):
  860. if self.interface:
  861. self.interface.RefreshInventory()
  862. def RefreshCharacter(self):
  863. if self.interface:
  864. self.interface.RefreshCharacter()
  865. if app.RENEWAL_DEAD_PACKET:
  866. def OnGameOver(self, d_time):
  867. self.CloseTargetBoard()
  868. self.OpenRestartDialog(d_time)
  869. else:
  870. def OnGameOver(self):
  871. self.CloseTargetBoard()
  872. self.OpenRestartDialog()
  873. if app.RENEWAL_DEAD_PACKET:
  874. def OpenRestartDialog(self, d_time):
  875. self.interface.OpenRestartDialog(d_time)
  876. else:
  877. def OpenRestartDialog(self):
  878. self.interface.OpenRestartDialog()
  879. if app.ENABLE_12ZI:
  880. def OpenUI12zi(self, yellowmark, greenmark, yellowreward, greenreward, goldreward):
  881. self.interface.OpenUI12zi(int(yellowmark,16), int(greenmark,16), int(yellowreward), int(greenreward), int(goldreward))
  882. def Refresh12ziTimer(self, currentFloor, jumpCount, limitTime, elapseTime):
  883. self.interface.Refresh12ziTimer(currentFloor, jumpCount, limitTime, elapseTime)
  884. def Show12ziJumpButton(self):
  885. self.interface.Show12ziJumpButton()
  886. def Hide12ziTimer(self):
  887. self.interface.Hide12ziTimer()
  888. def OpenReviveDialog(self, vid, itemcount):
  889. self.targetBoard.OpenReviveDialog(vid, itemcount);
  890. def RefreshShopItemToolTip(self):
  891. self.interface.RefreshShopItemToolTip()
  892. def NotEnoughPrism(self, itemcount):
  893. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOT_ENOUGH_PRISM % (itemcount))
  894. def ChangeCurrentSkill(self, skillSlotNumber):
  895. self.interface.OnChangeCurrentSkill(skillSlotNumber)
  896. if app.WJ_SHOW_STROKE_INFO:
  897. def RegisterStroke(self, targetVID, value):
  898. self.targetBoard.RegisterStroke(targetVID, value)
  899. ## TargetBoard
  900. def SetPCTargetBoard(self, vid, name):
  901. MapName = str(background.GetCurrentMapName())
  902. if MapName == "mapa_guerra":
  903. if player.IsSameEmpire(vid):
  904. mouseModule.mouseController.DeattachObject()
  905. return
  906. self.targetBoard.Open(vid, name)
  907. if app.IsPressed(app.DIK_LCONTROL):
  908. if not player.IsSameEmpire(vid):
  909. return
  910. if player.IsMainCharacterIndex(vid):
  911. return
  912. elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  913. return
  914. self.interface.OpenWhisperDialog(name)
  915. def RefreshTargetBoardByVID(self, vid):
  916. self.targetBoard.RefreshByVID(vid)
  917. def RefreshTargetBoardByName(self, name):
  918. self.targetBoard.RefreshByName(name)
  919. def __RefreshTargetBoard(self):
  920. self.targetBoard.Refresh()
  921. if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
  922. def SetHPTargetBoard(self, vid, hpPercentage, iMinHP, iMaxHP, vnum):
  923. if vid != self.targetBoard.GetTargetVID():
  924. self.targetBoard.ResetTargetBoard()
  925. self.targetBoard.SetEnemyVID(vid)
  926. self.targetBoard.SetHP(hpPercentage, iMinHP, iMaxHP)
  927. dwRaceFlag = nonplayer.GetMonsterRaceFlag(vnum)
  928. elementId = self.GetElementByRaceFlag(dwRaceFlag)
  929. self.targetBoard.SetElementImage(elementId)
  930. self.targetBoard.Show()
  931. else:
  932. def SetHPTargetBoard(self, vid, hpPercentage):
  933. if vid != self.targetBoard.GetTargetVID():
  934. self.targetBoard.ResetTargetBoard()
  935. self.targetBoard.SetEnemyVID(vid)
  936. self.targetBoard.SetHP(hpPercentage)
  937. self.targetBoard.Show()
  938. if app.ENABLE_TARGET_AFFECT:
  939. def ClearTargetAffects(self):
  940. self.targetBoard.ClearAffects()
  941. def AddTargetBoardAffect(self, affect, duration):
  942. self.targetBoard.AddAffect(affect, duration)
  943. def RemoveTargetBoardAffect(self, affect):
  944. self.targetBoard.RemoveAffect(affect)
  945. def CloseTargetBoardIfDifferent(self, vid):
  946. if vid != self.targetBoard.GetTargetVID():
  947. self.targetBoard.Close()
  948. def CloseTargetBoard(self):
  949. self.targetBoard.Close()
  950. def HAS_FLAG(self, value, flag):
  951. return (value & flag) == flag
  952. def GetElementByRaceFlag(self, raceFlag):
  953. if raceFlag == 0:
  954. return 0
  955. for i in xrange(17):
  956. curFlag = 1 << i
  957. if self.HAS_FLAG(raceFlag, curFlag):
  958. if SUB_RACE_FLAG_TO_ELEMENT.has_key(curFlag):
  959. return SUB_RACE_FLAG_TO_ELEMENT[curFlag]
  960. return 0
  961. ## View Equipment
  962. def OpenEquipmentDialog(self, vid):
  963. self.interface.OpenEquipmentDialog(vid)
  964. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  965. self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  966. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  967. self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  968. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  969. self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  970. # SHOW_LOCAL_MAP_NAME
  971. def ShowMapName(self, mapName, x, y):
  972. if self.mapNameShower:
  973. self.mapNameShower.ShowMapName(mapName, x, y)
  974. if self.interface:
  975. self.interface.SetMapName(mapName)
  976. # END_OF_SHOW_LOCAL_MAP_NAME
  977. def BINARY_OpenAtlasWindow(self):
  978. self.interface.BINARY_OpenAtlasWindow()
  979. ## Chat
  980. def OnRecvWhisper(self, mode, name, line):
  981. if mode == chat.WHISPER_TYPE_GM:
  982. self.interface.RegisterGameMasterName(name)
  983. chat.AppendWhisper(mode, name, line)
  984. self.interface.RecvWhisper(name)
  985. def OnRecvWhisperSystemMessage(self, mode, name, line):
  986. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  987. self.interface.RecvWhisper(name)
  988. def OnRecvWhisperError(self, mode, name, line):
  989. if localeInfo.WHISPER_ERROR.has_key(mode):
  990. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
  991. else:
  992. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  993. self.interface.RecvWhisper(name)
  994. def RecvWhisper(self, name):
  995. self.interface.RecvWhisper(name)
  996. def OnPickMoney(self, money):
  997. self.interface.OnPickMoneyNew(money)
  998. if app.ENABLE_12ZI:
  999. def SetBeadCount(self, value):
  1000. self.interface.SetBeadCount(value)
  1001. def NextBeadUpdateTime(self, value):
  1002. self.interface.NextBeadUpdateTime(value)
  1003. if app.ENABLE_CHEQUE_SYSTEM:
  1004. def OnPickCheque(self, cheque):
  1005. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHEQUE_SYSTEM_PICK_WON % (cheque))
  1006. def OnShopError(self, type):
  1007. try:
  1008. self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
  1009. except KeyError:
  1010. self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
  1011. def OnSafeBoxError(self):
  1012. self.PopupMessage(localeInfo.SAFEBOX_ERROR)
  1013. def OnFishingSuccess(self, isFish, fishName):
  1014. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
  1015. # ADD_FISHING_MESSAGE
  1016. def OnFishingNotifyUnknown(self):
  1017. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
  1018. def OnFishingWrongPlace(self):
  1019. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
  1020. # END_OF_ADD_FISHING_MESSAGE
  1021. def OnFishingNotify(self, isFish, fishName):
  1022. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
  1023. def OnFishingFailure(self):
  1024. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
  1025. def OnCannotPickItem(self):
  1026. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
  1027. # MINING
  1028. def OnCannotMining(self):
  1029. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
  1030. # END_OF_MINING
  1031. def OnCannotUseSkill(self, vid, type):
  1032. if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  1033. textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
  1034. if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  1035. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type])
  1036. def OnCannotShotError(self, vid, type):
  1037. textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
  1038. ## PointReset
  1039. def StartPointReset(self):
  1040. self.interface.OpenPointResetDialog()
  1041. ## Shop
  1042. if (app.WJ_COMBAT_ZONE):
  1043. def StartShop(self, vid, points, curLimit, maxLimit):
  1044. self.interface.OpenShopDialog(vid, points, curLimit, maxLimit)
  1045. else:
  1046. def StartShop(self, vid):
  1047. self.interface.OpenShopDialog(vid)
  1048. def EndShop(self):
  1049. self.interface.CloseShopDialog()
  1050. def RefreshShop(self):
  1051. self.interface.RefreshShopDialog()
  1052. def SetShopSellingPrice(self, Price):
  1053. pass
  1054. ## Exchange
  1055. def StartExchange(self):
  1056. self.interface.StartExchange()
  1057. def EndExchange(self):
  1058. self.interface.EndExchange()
  1059. def RefreshExchange(self):
  1060. self.interface.RefreshExchange()
  1061. ## Party
  1062. def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1063. partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1064. partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
  1065. partyInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerPartyInvite(arg))
  1066. partyInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerPartyInvite(arg))
  1067. partyInviteQuestionDialog.Open()
  1068. partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1069. self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1070. def AnswerPartyInvite(self, answer):
  1071. if not self.partyInviteQuestionDialog:
  1072. return
  1073. partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1074. distance = player.GetCharacterDistance(partyLeaderVID)
  1075. if distance < 0.0 or distance > 5000:
  1076. answer = False
  1077. net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1078. self.partyInviteQuestionDialog.Close()
  1079. self.partyInviteQuestionDialog = None
  1080. if app.BL_PARTY_UPDATE:
  1081. def AddPartyMember(self, pid, name, mapIdx, channel):
  1082. self.interface.AddPartyMember(pid, name, mapIdx, channel)
  1083. else:
  1084. def AddPartyMember(self, pid, name):
  1085. self.interface.AddPartyMember(pid, name)
  1086. def UpdatePartyMemberInfo(self, pid):
  1087. self.interface.UpdatePartyMemberInfo(pid)
  1088. def RemovePartyMember(self, pid):
  1089. self.interface.RemovePartyMember(pid)
  1090. self.__RefreshTargetBoard()
  1091. if app.BL_PARTY_UPDATE:
  1092. def LinkPartyMember(self, pid, vid, mapIdx, channel):
  1093. self.interface.LinkPartyMember(pid, vid, mapIdx, channel)
  1094. else:
  1095. def LinkPartyMember(self, pid, vid):
  1096. self.interface.LinkPartyMember(pid, vid)
  1097. def UnlinkPartyMember(self, pid):
  1098. self.interface.UnlinkPartyMember(pid)
  1099. def UnlinkAllPartyMember(self):
  1100. self.interface.UnlinkAllPartyMember()
  1101. def ExitParty(self):
  1102. self.interface.ExitParty()
  1103. self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1104. def ChangePartyParameter(self, distributionMode):
  1105. self.interface.ChangePartyParameter(distributionMode)
  1106. ## Messenger
  1107. def OnMessengerAddFriendQuestion(self, name):
  1108. messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1109. messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1110. messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1111. messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1112. messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1113. messengerAddFriendQuestion.Open()
  1114. messengerAddFriendQuestion.name = name
  1115. self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1116. def OnAcceptAddFriend(self):
  1117. name = self.messengerAddFriendQuestion.name
  1118. net.SendChatPacket("/messenger_auth y " + name)
  1119. self.OnCloseAddFriendQuestionDialog()
  1120. return True
  1121. def OnDenyAddFriend(self):
  1122. name = self.messengerAddFriendQuestion.name
  1123. net.SendChatPacket("/messenger_auth n " + name)
  1124. self.OnCloseAddFriendQuestionDialog()
  1125. return True
  1126. def OnCloseAddFriendQuestionDialog(self):
  1127. self.messengerAddFriendQuestion.Close()
  1128. self.messengerAddFriendQuestion = None
  1129. return True
  1130. ## SafeBox
  1131. def OpenSafeboxWindow(self, size):
  1132. self.interface.OpenSafeboxWindow(size)
  1133. def RefreshSafebox(self):
  1134. self.interface.RefreshSafebox()
  1135. def RefreshSafeboxMoney(self):
  1136. self.interface.RefreshSafeboxMoney()
  1137. # ITEM_MALL
  1138. def OpenMallWindow(self, size):
  1139. self.interface.OpenMallWindow(size)
  1140. def RefreshMall(self):
  1141. self.interface.RefreshMall()
  1142. # END_OF_ITEM_MALL
  1143. ## Guild
  1144. def RecvGuildInviteQuestion(self, guildID, guildName):
  1145. guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1146. guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
  1147. guildInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerGuildInvite(arg))
  1148. guildInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerGuildInvite(arg))
  1149. guildInviteQuestionDialog.Open()
  1150. guildInviteQuestionDialog.guildID = guildID
  1151. self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1152. def AnswerGuildInvite(self, answer):
  1153. if not self.guildInviteQuestionDialog:
  1154. return
  1155. guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1156. net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1157. self.guildInviteQuestionDialog.Close()
  1158. self.guildInviteQuestionDialog = None
  1159. def DeleteGuild(self):
  1160. self.interface.DeleteGuild()
  1161. ## Clock
  1162. def ShowClock(self, second):
  1163. self.interface.ShowClock(second)
  1164. def HideClock(self):
  1165. self.interface.HideClock()
  1166. ## Emotion
  1167. def BINARY_ActEmotion(self, emotionIndex):
  1168. if self.interface.wndCharacter:
  1169. self.interface.wndCharacter.ActEmotion(emotionIndex)
  1170. ###############################################################################################
  1171. ###############################################################################################
  1172. ## Keyboard Functions
  1173. def CheckFocus(self):
  1174. if False == self.IsFocus():
  1175. if True == self.interface.IsOpenChat():
  1176. self.interface.ToggleChat()
  1177. self.SetFocus()
  1178. def SaveScreen(self):
  1179. print "save screen"
  1180. # SCREENSHOT_CWDSAVE
  1181. if SCREENSHOT_CWDSAVE:
  1182. if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
  1183. os.mkdir(os.getcwd()+os.sep+"screenshot")
  1184. (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
  1185. elif SCREENSHOT_DIR:
  1186. (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1187. else:
  1188. (succeeded, name) = grp.SaveScreenShot()
  1189. # END_OF_SCREENSHOT_CWDSAVE
  1190. if succeeded:
  1191. pass
  1192. """
  1193. chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1)
  1194. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2)
  1195. """
  1196. else:
  1197. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
  1198. def ShowConsole(self):
  1199. if debugInfo.IsDebugMode() or True == self.consoleEnable:
  1200. player.EndKeyWalkingImmediately()
  1201. self.console.OpenWindow()
  1202. def ShowName(self):
  1203. self.ShowNameFlag = True
  1204. self.playerGauge.EnableShowAlways()
  1205. player.SetQuickPage(self.quickSlotPageIndex+1)
  1206. # ADD_ALWAYS_SHOW_NAME
  1207. def __IsShowName(self):
  1208. if systemSetting.IsAlwaysShowName():
  1209. return True
  1210. if self.ShowNameFlag:
  1211. return True
  1212. return False
  1213. # END_OF_ADD_ALWAYS_SHOW_NAME
  1214. def HideName(self):
  1215. self.ShowNameFlag = False
  1216. self.playerGauge.DisableShowAlways()
  1217. player.SetQuickPage(self.quickSlotPageIndex)
  1218. def GameMasterPanel(self):
  1219. import uigamemasterpanel
  1220. if chr.IsGameMaster(player.GetMainCharacterIndex()):
  1221. self.GMPaneL = uigamemasterpanel.GMPaneL()
  1222. self.GMPaneL.Show()
  1223. def ShowMouseImage(self):
  1224. self.interface.ShowMouseImage()
  1225. def HideMouseImage(self):
  1226. self.interface.HideMouseImage()
  1227. def StartAttack(self):
  1228. MapName = str(background.GetCurrentMapName())
  1229. if MapName == "mapa_guerra" and constInfo.ataque_guerra == 1:
  1230. return
  1231. player.SetAttackKeyState(True)
  1232. def EndAttack(self):
  1233. player.SetAttackKeyState(False)
  1234. def BINARY_Update_Maintenance(self, iTime, iDuration, iReason):
  1235. sTime = int(iTime)
  1236. sDuration = int(iDuration)
  1237. sReason = str(iReason)
  1238. if sTime != 0 and sDuration != 0:
  1239. self.wndMaintenance.OpenMaintenance(int(iTime), int(iDuration), str(iReason))
  1240. def MoveUp(self):
  1241. player.SetSingleDIKKeyState(app.DIK_UP, True)
  1242. def MoveDown(self):
  1243. player.SetSingleDIKKeyState(app.DIK_DOWN, True)
  1244. def MoveLeft(self):
  1245. player.SetSingleDIKKeyState(app.DIK_LEFT, True)
  1246. def MoveRight(self):
  1247. player.SetSingleDIKKeyState(app.DIK_RIGHT, True)
  1248. def StopUp(self):
  1249. player.SetSingleDIKKeyState(app.DIK_UP, False)
  1250. def StopDown(self):
  1251. player.SetSingleDIKKeyState(app.DIK_DOWN, False)
  1252. def StopLeft(self):
  1253. player.SetSingleDIKKeyState(app.DIK_LEFT, False)
  1254. def StopRight(self):
  1255. player.SetSingleDIKKeyState(app.DIK_RIGHT, False)
  1256. def PickUpItem(self):
  1257. #player.PickCloseItem()
  1258. player.PickCloseItemVector()
  1259. ###############################################################################################
  1260. ###############################################################################################
  1261. ## Event Handler
  1262. def OnKeyDown(self, key):
  1263. if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1264. return
  1265. if key == app.DIK_ESC:
  1266. self.RequestDropItem(False)
  1267. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1268. try:
  1269. self.onPressKeyDict[key]()
  1270. except KeyError:
  1271. pass
  1272. except:
  1273. raise
  1274. return True
  1275. def OnKeyUp(self, key):
  1276. try:
  1277. self.onClickKeyDict[key]()
  1278. except KeyError:
  1279. pass
  1280. except:
  1281. raise
  1282. return True
  1283. def OnMouseLeftButtonDown(self):
  1284. if self.interface.BUILD_OnMouseLeftButtonDown():
  1285. return
  1286. if mouseModule.mouseController.isAttached():
  1287. self.CheckFocus()
  1288. else:
  1289. hyperlink = ui.GetHyperlink()
  1290. if hyperlink:
  1291. return
  1292. else:
  1293. self.CheckFocus()
  1294. player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1295. return True
  1296. def OnMouseLeftButtonUp(self):
  1297. if self.interface.BUILD_OnMouseLeftButtonUp():
  1298. return
  1299. if mouseModule.mouseController.isAttached():
  1300. attachedType = mouseModule.mouseController.GetAttachedType()
  1301. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1302. attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1303. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1304. ## QuickSlot
  1305. if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1306. player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1307. ## Inventory
  1308. elif player.SLOT_TYPE_INVENTORY == attachedType:
  1309. if player.ITEM_MONEY == attachedItemIndex:
  1310. self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1311. else:
  1312. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1313. ## DragonSoul
  1314. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1315. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1316. if app.ENABLE_SPECIAL_STORAGE:
  1317. if player.SLOT_TYPE_UPGRADE_INVENTORY == attachedType or\
  1318. player.SLOT_TYPE_BOOK_INVENTORY == attachedType or\
  1319. player.SLOT_TYPE_STONE_INVENTORY == attachedType or\
  1320. player.SLOT_TYPE_CHEST_INVENTORY == attachedType or\
  1321. player.SLOT_TYPE_BONUS_INVENTORY == attachedType or\
  1322. player.SLOT_TYPE_VARIUS_INVENTORY == attachedType:
  1323. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1324. mouseModule.mouseController.DeattachObject()
  1325. else:
  1326. hyperlink = ui.GetHyperlink()
  1327. if hyperlink:
  1328. if app.IsPressed(app.DIK_LALT):
  1329. link = chat.GetLinkFromHyperlink(hyperlink)
  1330. ime.PasteString(link)
  1331. else:
  1332. self.interface.MakeHyperlinkTooltip(hyperlink)
  1333. return
  1334. else:
  1335. player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  1336. #player.EndMouseWalking()
  1337. return True
  1338. def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  1339. if app.ENABLE_SPECIAL_STORAGE:
  1340. if player.SLOT_TYPE_INVENTORY == attachedType or\
  1341. player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType or\
  1342. player.SLOT_TYPE_UPGRADE_INVENTORY == attachedType or\
  1343. player.SLOT_TYPE_BOOK_INVENTORY == attachedType or\
  1344. player.SLOT_TYPE_STONE_INVENTORY == attachedType or\
  1345. player.SLOT_TYPE_CHEST_INVENTORY == attachedType or\
  1346. player.SLOT_TYPE_BONUS_INVENTORY == attachedType or\
  1347. player.SLOT_TYPE_VARIUS_INVENTORY == attachedType:
  1348. attachedInvenType = player.SlotTypeToInvenType(attachedType)
  1349. if True == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1350. if player.IsEquipmentSlot(attachedItemSlotPos) and\
  1351. player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedType and\
  1352. player.SLOT_TYPE_UPGRADE_INVENTORY != attachedType and\
  1353. player.SLOT_TYPE_BOOK_INVENTORY != attachedType and\
  1354. player.SLOT_TYPE_STONE_INVENTORY != attachedType and\
  1355. player.SLOT_TYPE_CHEST_INVENTORY != attachedType and\
  1356. player.SLOT_TYPE_BONUS_INVENTORY != attachedType and\
  1357. player.SLOT_TYPE_VARIUS_INVENTORY != attachedType:
  1358. self.stream.popupWindow.Close()
  1359. self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1360. else:
  1361. if chr.IsNPC(dstChrID):
  1362. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1363. else:
  1364. net.SendExchangeStartPacket(dstChrID)
  1365. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1366. else:
  1367. self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1368. else:
  1369. if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1370. attachedInvenType = player.SlotTypeToInvenType(attachedType)
  1371. if True == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1372. if player.IsEquipmentSlot(attachedItemSlotPos) and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedType:
  1373. self.stream.popupWindow.Close()
  1374. self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1375. else:
  1376. if chr.IsNPC(dstChrID):
  1377. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1378. else:
  1379. net.SendExchangeStartPacket(dstChrID)
  1380. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1381. else:
  1382. self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1383. def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  1384. if True == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  1385. net.SendExchangeStartPacket(dstChrID)
  1386. net.SendExchangeElkAddPacket(attachedMoney)
  1387. else:
  1388. self.__DropMoney(attachedType, attachedMoney)
  1389. def __DropMoney(self, attachedType, attachedMoney):
  1390. # PRIVATESHOP_DISABLE_ITEM_DROP - °³ہخ»َء، ؟­°ي ہض´آ µ؟¾ب ¾ئہجإغ ¹ِ¸² ¹وءِ
  1391. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1392. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1393. return
  1394. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1395. if attachedMoney>=1000:
  1396. self.stream.popupWindow.Close()
  1397. self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
  1398. return
  1399. # itemDropQuestionDialog = uiCommon.QuestionDialog()
  1400. itemDropQuestionDialog = uiCommon.ItemQuestionDialog()
  1401. itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
  1402. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1403. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1404. itemDropQuestionDialog.window_type = "inv"
  1405. itemDropQuestionDialog.Open(1, "", attachedMoney)
  1406. itemDropQuestionDialog.dropType = attachedType
  1407. itemDropQuestionDialog.dropCount = attachedMoney
  1408. itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  1409. self.itemDropQuestionDialog = itemDropQuestionDialog
  1410. def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  1411. # PRIVATESHOP_DISABLE_ITEM_DROP - °³ہخ»َء، ؟­°ي ہض´آ µ؟¾ب ¾ئہجإغ ¹ِ¸² ¹وءِ
  1412. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1413. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1414. return
  1415. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1416. if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
  1417. self.stream.popupWindow.Close()
  1418. self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1419. else:
  1420. if player.SLOT_TYPE_INVENTORY == attachedType:
  1421. dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  1422. item.SelectItem(dropItemIndex)
  1423. dropItemName = item.GetItemName()
  1424. ## Question Text
  1425. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1426. ## Dialog
  1427. # itemDropQuestionDialog = uiCommon.QuestionDialogItem()
  1428. itemDropQuestionDialog = uiCommon.ItemQuestionDialog()
  1429. itemDropQuestionDialog.SetText(questionText)
  1430. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1431. itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem(arg))
  1432. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1433. itemDropQuestionDialog.window_type = "inv"
  1434. itemDropQuestionDialog.count = attachedItemCount
  1435. itemDropQuestionDialog.Open(dropItemIndex,attachedItemSlotPos)
  1436. itemDropQuestionDialog.dropType = attachedType
  1437. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1438. itemDropQuestionDialog.dropCount = attachedItemCount
  1439. self.itemDropQuestionDialog = itemDropQuestionDialog
  1440. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1441. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1442. dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
  1443. item.SelectItem(dropItemIndex)
  1444. dropItemName = item.GetItemName()
  1445. ## Question Text
  1446. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1447. ## Dialog
  1448. # itemDropQuestionDialog = uiCommon.QuestionDialog()
  1449. itemDropQuestionDialog = uiCommon.ItemQuestionDialog()
  1450. itemDropQuestionDialog.SetText(questionText)
  1451. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1452. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1453. itemDropQuestionDialog.window_type = "dragon"
  1454. itemDropQuestionDialog.count = attachedItemCount
  1455. itemDropQuestionDialog.Open(dropItemIndex, attachedItemSlotPos)
  1456. itemDropQuestionDialog.dropType = attachedType
  1457. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1458. itemDropQuestionDialog.dropCount = attachedItemCount
  1459. self.itemDropQuestionDialog = itemDropQuestionDialog
  1460. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1461. if app.ENABLE_SPECIAL_STORAGE:
  1462. if player.SLOT_TYPE_UPGRADE_INVENTORY == attachedType or\
  1463. player.SLOT_TYPE_BOOK_INVENTORY == attachedType or\
  1464. player.SLOT_TYPE_STONE_INVENTORY == attachedType or\
  1465. player.SLOT_TYPE_CHEST_INVENTORY == attachedType or\
  1466. player.SLOT_TYPE_BONUS_INVENTORY == attachedType or\
  1467. player.SLOT_TYPE_VARIUS_INVENTORY == attachedType:
  1468. dropItemIndex = player.GetItemIndex(player.SlotTypeToInvenType(attachedType), attachedItemSlotPos)
  1469. item.SelectItem(dropItemIndex)
  1470. dropItemName = item.GetItemName()
  1471. ## Question Text
  1472. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1473. ## Dialog
  1474. # itemDropQuestionDialog = uiCommon.QuestionDialog()
  1475. itemDropQuestionDialog = uiCommon.ItemQuestionDialog()
  1476. itemDropQuestionDialog.SetText(questionText)
  1477. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1478. itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDropItem(arg))
  1479. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1480. if player.SLOT_TYPE_UPGRADE_INVENTORY == attachedType:
  1481. itemDropQuestionDialog.window_type = "upp"
  1482. elif player.SLOT_TYPE_BOOK_INVENTORY == attachedType:
  1483. itemDropQuestionDialog.window_type = "book"
  1484. elif player.SLOT_TYPE_STONE_INVENTORY == attachedType:
  1485. itemDropQuestionDialog.window_type = "stone"
  1486. itemDropQuestionDialog.count = attachedItemCount
  1487. itemDropQuestionDialog.Open(dropItemIndex, attachedItemSlotPos)
  1488. itemDropQuestionDialog.dropType = attachedType
  1489. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1490. itemDropQuestionDialog.dropCount = attachedItemCount
  1491. self.itemDropQuestionDialog = itemDropQuestionDialog
  1492. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1493. def RequestDropItem(self, answer):
  1494. if not self.itemDropQuestionDialog:
  1495. return
  1496. if answer:
  1497. dropType = self.itemDropQuestionDialog.dropType
  1498. dropCount = self.itemDropQuestionDialog.dropCount
  1499. dropNumber = self.itemDropQuestionDialog.dropNumber
  1500. if player.SLOT_TYPE_INVENTORY == dropType:
  1501. if dropNumber == player.ITEM_MONEY:
  1502. net.SendGoldDropPacketNew(dropCount)
  1503. snd.PlaySound("sound/ui/money.wav")
  1504. else:
  1505. # PRIVATESHOP_DISABLE_ITEM_DROP
  1506. self.__SendDropItemPacket(dropNumber, dropCount)
  1507. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1508. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
  1509. # PRIVATESHOP_DISABLE_ITEM_DROP
  1510. self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
  1511. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1512. if app.ENABLE_SPECIAL_STORAGE:
  1513. if player.SLOT_TYPE_UPGRADE_INVENTORY == dropType or\
  1514. player.SLOT_TYPE_BOOK_INVENTORY == dropType or\
  1515. player.SLOT_TYPE_STONE_INVENTORY == dropType or\
  1516. player.SLOT_TYPE_CHEST_INVENTORY == dropType or\
  1517. player.SLOT_TYPE_BONUS_INVENTORY == dropType or\
  1518. player.SLOT_TYPE_VARIUS_INVENTORY == dropType:
  1519. self.__SendDropItemPacket(dropNumber, dropCount, player.SlotTypeToInvenType(dropType))
  1520. self.itemDropQuestionDialog.Close()
  1521. self.itemDropQuestionDialog = None
  1522. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1523. def RequestDestroyItem(self, answer):
  1524. if not self.itemDropQuestionDialog:
  1525. return
  1526. if answer:
  1527. dropType = self.itemDropQuestionDialog.dropType
  1528. dropCount = self.itemDropQuestionDialog.dropCount
  1529. dropNumber = self.itemDropQuestionDialog.dropNumber
  1530. if player.SLOT_TYPE_INVENTORY == dropType:
  1531. if dropNumber == player.ITEM_MONEY:
  1532. return
  1533. else:
  1534. self.__SendDestroyItemPacket(dropNumber)
  1535. self.itemDropQuestionDialog.Close()
  1536. self.itemDropQuestionDialog = None
  1537. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1538. # PRIVATESHOP_DISABLE_ITEM_DROP
  1539. def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
  1540. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1541. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1542. return
  1543. net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
  1544. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1545. def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY):
  1546. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1547. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1548. return
  1549. net.SendItemDestroyPacket(itemVNum)
  1550. def OnMouseRightButtonDown(self):
  1551. self.CheckFocus()
  1552. if True == mouseModule.mouseController.isAttached():
  1553. mouseModule.mouseController.DeattachObject()
  1554. else:
  1555. player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  1556. return True
  1557. def OnMouseRightButtonUp(self):
  1558. if True == mouseModule.mouseController.isAttached():
  1559. return True
  1560. player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  1561. return True
  1562. def OnMouseMiddleButtonDown(self):
  1563. player.SetMouseMiddleButtonState(player.MBS_PRESS)
  1564. def OnMouseMiddleButtonUp(self):
  1565. player.SetMouseMiddleButtonState(player.MBS_CLICK)
  1566. def OnUpdate(self):
  1567. self.wnddailygift.OnUpdate()
  1568. app.UpdateGame()
  1569. if app.ENABLE_TITLE_SYSTEM:
  1570. self.wndTitleSystem.OnUpdate()
  1571. if self.mapNameShower.IsShow():
  1572. self.mapNameShower.Update()
  1573. if self.isShowDebugInfo:
  1574. self.UpdateDebugInfo()
  1575. if self.enableXMasBoom:
  1576. self.__XMasBoom_Update()
  1577. if constInfo.E_LITERE_STATUS == 1:
  1578. self.litere_event.Show()
  1579. else:
  1580. self.litere_event.Hide()
  1581. self.UpdateFPSInfo()
  1582. self.interface.BUILD_OnUpdate()
  1583. def UpdateFPSInfo(self):
  1584. nRenderFPS = app.GetRenderFPS()
  1585. self.FrameRate.SetText("FPS: %3d" % (nRenderFPS))
  1586. #self.FrameRate.SetPackedFontColor(ui.GenerateColor(255, 0, 0)) #delete this line if you want normal color (like in debug mode)
  1587. def UpdateDebugInfo(self):
  1588. #
  1589. # ؤ³¸¯إح ءآا¥ ¹× FPS أâ·آ
  1590. (x, y, z) = player.GetMainCharacterPosition()
  1591. nUpdateTime = app.GetUpdateTime()
  1592. nUpdateFPS = app.GetUpdateFPS()
  1593. nRenderFPS = app.GetRenderFPS()
  1594. nFaceCount = app.GetFaceCount()
  1595. fFaceSpeed = app.GetFaceSpeed()
  1596. nST=background.GetRenderShadowTime()
  1597. (fAveRT, nCurRT) = app.GetRenderTime()
  1598. (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  1599. (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  1600. if iPatch == 0:
  1601. iPatch = 1
  1602. #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  1603. self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  1604. xMouse, yMouse = wndMgr.GetMousePosition()
  1605. self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))
  1606. self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  1607. if fAveRT>1.0:
  1608. self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  1609. self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  1610. #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  1611. #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  1612. #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  1613. self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  1614. def OnRender(self):
  1615. app.RenderGame()
  1616. if self.console.Console.collision:
  1617. background.RenderCollision()
  1618. chr.RenderCollision()
  1619. (x, y) = app.GetCursorPosition()
  1620. ########################
  1621. # Picking
  1622. ########################
  1623. textTail.UpdateAllTextTail()
  1624. if True == wndMgr.IsPickedWindow(self.hWnd):
  1625. self.PickingCharacterIndex = chr.Pick()
  1626. if -1 != self.PickingCharacterIndex:
  1627. textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  1628. if 0 != self.targetBoard.GetTargetVID():
  1629. textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  1630. # ADD_ALWAYS_SHOW_NAME
  1631. if not self.__IsShowName():
  1632. self.PickingItemIndex = item.Pick()
  1633. if -1 != self.PickingItemIndex:
  1634. textTail.ShowItemTextTail(self.PickingItemIndex)
  1635. # END_OF_ADD_ALWAYS_SHOW_NAME
  1636. ## Show all name in the range
  1637. # ADD_ALWAYS_SHOW_NAME
  1638. if self.__IsShowName():
  1639. textTail.ShowAllTextTail()
  1640. self.PickingItemIndex = textTail.Pick(x, y)
  1641. # END_OF_ADD_ALWAYS_SHOW_NAME
  1642. if systemSetting.IsShowSalesText():
  1643. uiPrivateShopBuilder.UpdateADBoard()
  1644. textTail.UpdateShowingTextTail()
  1645. textTail.ArrangeTextTail()
  1646. if -1 != self.PickingItemIndex:
  1647. textTail.SelectItemName(self.PickingItemIndex)
  1648. grp.PopState()
  1649. grp.SetInterfaceRenderState()
  1650. textTail.Render()
  1651. textTail.HideAllTextTail()
  1652. def OnPressEscapeKey(self):
  1653. if app.TARGET == app.GetCursor():
  1654. app.SetCursor(app.NORMAL)
  1655. elif True == mouseModule.mouseController.isAttached():
  1656. mouseModule.mouseController.DeattachObject()
  1657. else:
  1658. self.interface.OpenSystemDialog()
  1659. return True
  1660. def OnIMEReturn(self):
  1661. if app.IsPressed(app.DIK_LSHIFT):
  1662. self.interface.OpenWhisperDialogWithoutTarget()
  1663. else:
  1664. self.interface.ToggleChat()
  1665. return True
  1666. def OnPressExitKey(self):
  1667. self.interface.ToggleSystemDialog()
  1668. return True
  1669. ## BINARY CALLBACK
  1670. ######################################################################################
  1671. # EXCHANGE
  1672. if app.WJ_ENABLE_TRADABLE_ICON:
  1673. def BINARY_AddItemToExchange(self, inven_type, inven_pos, display_pos):
  1674. if inven_type == player.INVENTORY:
  1675. self.interface.CantTradableItemExchange(display_pos, inven_pos)
  1676. # END_OF_EXCHANGE
  1677. # WEDDING
  1678. def BINARY_LoverInfo(self, name, lovePoint):
  1679. if self.interface.wndMessenger:
  1680. self.interface.wndMessenger.OnAddLover(name, lovePoint)
  1681. if self.affectShower:
  1682. self.affectShower.SetLoverInfo(name, lovePoint)
  1683. def BINARY_UpdateLovePoint(self, lovePoint):
  1684. if self.interface.wndMessenger:
  1685. self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  1686. if self.affectShower:
  1687. self.affectShower.OnUpdateLovePoint(lovePoint)
  1688. # END_OF_WEDDING
  1689. if app.ENABLE_SEND_TARGET_INFO:
  1690. def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
  1691. if not raceNum in constInfo.MONSTER_INFO_DATA:
  1692. constInfo.MONSTER_INFO_DATA.update({raceNum : {}})
  1693. constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []})
  1694. curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"]
  1695. isUpgradeable = False
  1696. isMetin = False
  1697. item.SelectItem(itemVnum)
  1698. if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1699. isUpgradeable = True
  1700. elif item.GetItemType() == item.ITEM_TYPE_METIN:
  1701. isMetin = True
  1702. for curItem in curList:
  1703. if isUpgradeable:
  1704. if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
  1705. if not (itemVnum in curItem["vnum_list"]):
  1706. curItem["vnum_list"].append(itemVnum)
  1707. return
  1708. elif isMetin:
  1709. if curItem.has_key("vnum_list"):
  1710. baseVnum = curItem["vnum_list"][0]
  1711. if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
  1712. if not (itemVnum in curItem["vnum_list"]):
  1713. curItem["vnum_list"].append(itemVnum)
  1714. return
  1715. else:
  1716. if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
  1717. return
  1718. if isUpgradeable or isMetin:
  1719. curList.append({"vnum_list":[itemVnum], "count":itemCount})
  1720. else:
  1721. curList.append({"vnum":itemVnum, "count":itemCount})
  1722. def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
  1723. self.targetBoard.RefreshMonsterInfoBoard()
  1724. # QUEST_CONFIRM
  1725. def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  1726. confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
  1727. confirmDialog.SetText1(msg)
  1728. confirmDialog.Open(timeout)
  1729. confirmDialog.SetAcceptEvent(lambda answer=True, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1730. confirmDialog.SetCancelEvent(lambda answer=False, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1731. self.confirmDialog = confirmDialog
  1732. # END_OF_QUEST_CONFIRM
  1733. # GIFT command
  1734. def Gift_Show(self):
  1735. self.interface.ShowGift()
  1736. # CUBE
  1737. def BINARY_Cube_Open(self, npcVNUM):
  1738. self.currentCubeNPC = npcVNUM
  1739. self.interface.OpenCubeWindow()
  1740. if npcVNUM not in self.cubeInformation:
  1741. net.SendChatPacket("/cube r_info")
  1742. else:
  1743. cubeInfoList = self.cubeInformation[npcVNUM]
  1744. i = 0
  1745. for cubeInfo in cubeInfoList:
  1746. self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
  1747. j = 0
  1748. for materialList in cubeInfo["materialList"]:
  1749. for materialInfo in materialList:
  1750. itemVnum, itemCount = materialInfo
  1751. self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
  1752. j = j + 1
  1753. i = i + 1
  1754. self.interface.wndCube.Refresh()
  1755. def BINARY_Cube_Close(self):
  1756. self.interface.CloseCubeWindow()
  1757. # ء¦ہغ؟، ات؟نار °ٌµه, ؟¹»َµا´آ ؟د¼؛ا°ہا VNUM°ْ °³¼ِ ء¤؛¸ update
  1758. def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  1759. self.interface.UpdateCubeInfo(gold, itemVnum, count)
  1760. def BINARY_Cube_Succeed(self, itemVnum, count):
  1761. print "إ¥؛ê ء¦ہغ ¼؛°ّ"
  1762. self.interface.SucceedCubeWork(itemVnum, count)
  1763. pass
  1764. def BINARY_Cube_Failed(self):
  1765. print "إ¥؛ê ء¦ہغ ½ائذ"
  1766. self.interface.FailedCubeWork()
  1767. pass
  1768. def BINARY_Cube_ResultList(self, npcVNUM, listText):
  1769. # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5 ہج·±½ؤہ¸·خ "/" ¹®ہع·خ ±¸؛ذµب ¸®½؛ئ®¸¦ ءـ
  1770. #print listText
  1771. if npcVNUM == 0:
  1772. npcVNUM = self.currentCubeNPC
  1773. self.cubeInformation[npcVNUM] = []
  1774. try:
  1775. for eachInfoText in listText.split("/"):
  1776. eachInfo = eachInfoText.split(",")
  1777. itemVnum = int(eachInfo[0])
  1778. itemCount = int(eachInfo[1])
  1779. self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
  1780. self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  1781. resultCount = len(self.cubeInformation[npcVNUM])
  1782. requestCount = 7
  1783. modCount = resultCount % requestCount
  1784. splitCount = resultCount / requestCount
  1785. for i in xrange(splitCount):
  1786. #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  1787. net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  1788. if 0 < modCount:
  1789. #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1790. net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1791. except RuntimeError, msg:
  1792. dbg.TraceError(msg)
  1793. return 0
  1794. pass
  1795. def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
  1796. # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  1797. try:
  1798. #print listText
  1799. if 3 > len(listText):
  1800. dbg.TraceError("Wrong Cube Material Infomation")
  1801. return 0
  1802. eachResultList = listText.split("@")
  1803. cubeInfo = self.cubeInformation[self.currentCubeNPC]
  1804. itemIndex = 0
  1805. for eachResultText in eachResultList:
  1806. cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  1807. materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  1808. gold = 0
  1809. splitResult = eachResultText.split("/")
  1810. if 1 < len(splitResult):
  1811. gold = int(splitResult[1])
  1812. #print "splitResult : ", splitResult
  1813. eachMaterialList = splitResult[0].split("&")
  1814. i = 0
  1815. for eachMaterialText in eachMaterialList:
  1816. complicatedList = eachMaterialText.split("|")
  1817. if 0 < len(complicatedList):
  1818. for complicatedText in complicatedList:
  1819. (itemVnum, itemCount) = complicatedText.split(",")
  1820. itemVnum = int(itemVnum)
  1821. itemCount = int(itemCount)
  1822. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1823. materialList[i].append((itemVnum, itemCount))
  1824. else:
  1825. itemVnum, itemCount = eachMaterialText.split(",")
  1826. itemVnum = int(itemVnum)
  1827. itemCount = int(itemCount)
  1828. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1829. materialList[i].append((itemVnum, itemCount))
  1830. i = i + 1
  1831. itemIndex = itemIndex + 1
  1832. self.interface.wndCube.Refresh()
  1833. except RuntimeError, msg:
  1834. dbg.TraceError(msg)
  1835. return 0
  1836. pass
  1837. # END_OF_CUBE
  1838. if app.ENABLE_ATTR_TRANSFER_SYSTEM:
  1839. def BINARY_AttrTransfer_Open(self):
  1840. self.interface.OpenAttrTransferWindow()
  1841. def BINARY_AttrTransfer_Close(self):
  1842. self.interface.CloseAttrTransferWindow()
  1843. def BINARY_AttrTransfer_Success(self):
  1844. self.interface.AttrTransferSuccess()
  1845. # ؟ëب¥¼®
  1846. def BINARY_Highlight_Item(self, inven_type, inven_pos):
  1847. # @fixme003 (+if self.interface:)
  1848. if self.interface:
  1849. self.interface.Highligt_Item(inven_type, inven_pos)
  1850. def BINARY_Cards_UpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points):
  1851. self.interface.UpdateCardsInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points)
  1852. def BINARY_Cards_FieldUpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  1853. self.interface.UpdateCardsFieldInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  1854. def BINARY_Cards_PutReward(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  1855. self.interface.CardsPutReward(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  1856. def BINARY_Cards_ShowIcon(self):
  1857. self.interface.CardsShowIcon()
  1858. def BINARY_Cards_Open(self, safemode):
  1859. self.interface.OpenCardsWindow(safemode)
  1860. def BINARY_DragonSoulGiveQuilification(self):
  1861. self.interface.DragonSoulGiveQuilification()
  1862. def BINARY_DragonSoulRefineWindow_Open(self):
  1863. self.interface.OpenDragonSoulRefineWindow()
  1864. def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
  1865. self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
  1866. def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
  1867. self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
  1868. # END of DRAGON SOUL REFINE WINDOW
  1869. def BINARY_SetBigMessage(self, message):
  1870. self.interface.bigBoard.SetTip(message)
  1871. def BINARY_SetTipMessage(self, message):
  1872. self.interface.tipBoard.SetTip(message)
  1873. if app.ENABLE_12ZI:
  1874. def BINARY_SetMissionMessage(self, message):
  1875. if app.ENABLE_CHAT_MISSION_ALTERNATIVE:
  1876. self.interface.missionBoard.SetMission(message.replace("_", " "))
  1877. else:
  1878. self.interface.missionBoard.SetMission(message)
  1879. def BINARY_SetSubMissionMessage(self, message):
  1880. self.interface.missionBoard.SetSubMission(message)
  1881. def BINARY_CleanMissionMessage(self):
  1882. self.interface.missionBoard.CleanMission()
  1883. def BINARY_AppendNotifyMessage(self, type):
  1884. if not type in localeInfo.NOTIFY_MESSAGE:
  1885. return
  1886. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
  1887. def BINARY_Guild_EnterGuildArea(self, areaID):
  1888. self.interface.BULID_EnterGuildArea(areaID)
  1889. def BINARY_Guild_ExitGuildArea(self, areaID):
  1890. self.interface.BULID_ExitGuildArea(areaID)
  1891. def BINARY_GuildWar_OnSendDeclare(self, guildID):
  1892. pass
  1893. def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  1894. mainCharacterName = player.GetMainCharacterName()
  1895. masterName = guild.GetGuildMasterName()
  1896. if mainCharacterName == masterName:
  1897. self.__GuildWar_OpenAskDialog(guildID, warType)
  1898. def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  1899. self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  1900. def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  1901. self.interface.OnStartGuildWar(guildSelf, guildOpp)
  1902. def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  1903. self.interface.OnEndGuildWar(guildSelf, guildOpp)
  1904. def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  1905. self.interface.BINARY_SetObserverMode(isEnable)
  1906. def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  1907. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  1908. def BINARY_UpdateUserCount(self, userCount):
  1909. self.interface.wndMiniMap.UpdateUserCount(userCount)
  1910. # PROFESSIONAL_BIOLOG_SYSTEM
  1911. if app.ENABLE_BIOLOG_SYSTEM:
  1912. def BINARY_Biolog_Update(self, pLeftTime, pCountActual, pCountNeed, pVnum):
  1913. uiprofessionalbiolog.BIOLOG_BINARY_LOADED["time"][0] = int(pLeftTime) + app.GetGlobalTimeStamp()
  1914. uiprofessionalbiolog.BIOLOG_BINARY_LOADED["countActual"][0] = str(pCountActual)
  1915. uiprofessionalbiolog.BIOLOG_BINARY_LOADED["countNeed"][0] = str(pCountNeed)
  1916. uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0] = int(pVnum)
  1917. def BINARY_Biolog_SendMessage(self, pMessage):
  1918. if str(pMessage) != "":
  1919. self.wndBiologMessage = uiCommon.PopupDialog()
  1920. self.wndBiologMessage.SetWidth(350)
  1921. self.wndBiologMessage.SetText((str(pMessage).replace("$"," ")))
  1922. self.wndBiologMessage.Show()
  1923. else:
  1924. chat.AppendChat(chat.CHAT_TYPE_INFO, "Error, i could not initialize message from server!")
  1925. def BINARY_Biolog_PopUp(self, iRewardType, iRewardItem, iBonusName_1, iBonusValue_1, iBonusName_2, iBonusValue_2):
  1926. self.wndBiologSlider = uiprofessionalbiolog.Biolog_FinishSlider()
  1927. self.wndBiologSlider.BINARY_BiologPopUp_Load([str(iRewardType), int(iRewardItem), str(iBonusName_1), int(iBonusValue_1), str(iBonusName_2), int(iBonusValue_2)])
  1928. self.wndBiologSlider.Show()
  1929. def BINARY_Biolog_SelectReward(self, iTypeWindow, iRewardType, iBonusName_1, iBonusValue_1, iBonusName_2, iBonusValue_2, iBonusName_3, iBonusValue_3):
  1930. self.wndBiologSelectReward = uiprofessionalbiolog.Biolog_SelectReward()
  1931. self.wndBiologSelectReward.Open_SelectRewardType([int(iTypeWindow), str(iRewardType), str(iBonusName_1), int(iBonusValue_1), str(iBonusName_2), int(iBonusValue_2), str(iBonusName_3), int(iBonusValue_3)])
  1932. self.wndBiologSelectReward.SetTitle((str(iRewardType).replace("$"," ")))
  1933. self.wndBiologSelectReward.SetCenterPosition()
  1934. self.wndBiologSelectReward.SetTop()
  1935. self.wndBiologSelectReward.Show()
  1936. # END_OF_PROFESSIONAL_BIOLOG_SYSTEM
  1937. def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  1938. guildID1 = int(guildID1)
  1939. guildID2 = int(guildID2)
  1940. memberCount1 = int(memberCount1)
  1941. memberCount2 = int(memberCount2)
  1942. observerCount = int(observerCount)
  1943. self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  1944. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  1945. def __GuildWar_OpenAskDialog(self, guildID, warType):
  1946. guildName = guild.GetGuildName(guildID)
  1947. # REMOVED_GUILD_BUG_FIX
  1948. if "Noname" == guildName:
  1949. return
  1950. # END_OF_REMOVED_GUILD_BUG_FIX
  1951. import uiGuild
  1952. questionDialog = uiGuild.AcceptGuildWarDialog()
  1953. questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  1954. questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  1955. questionDialog.Open(guildName, warType)
  1956. self.guildWarQuestionDialog = questionDialog
  1957. def __GuildWar_CloseAskDialog(self):
  1958. self.guildWarQuestionDialog.Close()
  1959. self.guildWarQuestionDialog = None
  1960. def __GuildWar_OnAccept(self):
  1961. guildName = self.guildWarQuestionDialog.GetGuildName()
  1962. net.SendChatPacket("/war " + guildName)
  1963. self.__GuildWar_CloseAskDialog()
  1964. return 1
  1965. def __GuildWar_OnDecline(self):
  1966. guildName = self.guildWarQuestionDialog.GetGuildName()
  1967. net.SendChatPacket("/nowar " + guildName)
  1968. self.__GuildWar_CloseAskDialog()
  1969. return 1
  1970. ## BINARY CALLBACK
  1971. ######################################################################################
  1972. def __ServerCommand_Build(self):
  1973. serverCommandList={
  1974. "ConsoleEnable" : self.__Console_Enable,
  1975. "DayMode" : self.__DayMode_Update,
  1976. "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update,
  1977. "CloseRestartWindow" : self.__RestartDialog_Close,
  1978. "OpenPrivateShop" : self.__PrivateShop_Open,
  1979. "ruhtasiekranac" : self.ruhcac,
  1980. "PartyHealReady" : self.PartyHealReady,
  1981. "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  1982. "CloseSafebox" : self.CommandCloseSafebox,
  1983. 'PARTY_E' : self._PartyEmotionsCMD,
  1984. # ITEM_MALL
  1985. "CloseMall" : self.CommandCloseMall,
  1986. "ShowMeMallPassword" : self.AskMallPassword,
  1987. "item_mall" : self.__ItemMall_Open,
  1988. "envanter" : self.envanter_kilitle_quest,
  1989. # END_OF_ITEM_MALL
  1990. "requestWarpToCharcater" : self.__RequestWarpToCharacter,
  1991. ##NEW SHOP
  1992. "OpenItemshop" : self.OpenItemShop,
  1993. "shop" : self.NewShop,
  1994. "shop_clear" : self.ShopClear,
  1995. "shop_add" : self.ShopAdd,
  1996. "shop_item" : self.ShopItem,
  1997. "shop_cost" : self.ShopCost,
  1998. "shop_cost_clear" : self.ShopCostClear,
  1999. "shop_item_clear" : self.ShopItemClear,
  2000. #####GIFT SYSTEM
  2001. "gift_clear" : self.gift_clear,
  2002. "gift_item" : self.gift_item,
  2003. "gift_info" : self.gift_show,
  2004. "gift_load" : self.gift_load,
  2005. "decoracion" : self.__OpenDecoration,
  2006. ###
  2007. "RefineSuceeded" : self.RefineSuceededMessage,
  2008. "RefineFailed" : self.RefineFailedMessage,
  2009. "xmas_snow" : self.__XMasSnow_Enable,
  2010. "xmas_boom" : self.__XMasBoom_Enable,
  2011. "xmas_song" : self.__XMasSong_Enable,
  2012. "xmas_tree" : self.__XMasTree_Enable,
  2013. "newyear_boom" : self.__XMasBoom_Enable,
  2014. "PartyRequest" : self.__PartyRequestQuestion,
  2015. "PartyRequestDenied" : self.__PartyRequestDenied,
  2016. "horse_state" : self.__Horse_UpdateState,
  2017. "hide_horse_state" : self.__Horse_HideState,
  2018. "WarUC" : self.__GuildWar_UpdateMemberCount,
  2019. "test_server" : self.__EnableTestServerFlag,
  2020. "mall" : self.__InGameShop_Show,
  2021. # PROFESSIONAL_BIOLOG_SYSTEM
  2022. "BINARY_Biolog_Update" : self.BINARY_Biolog_Update,
  2023. "BINARY_Biolog_SendMessage" : self.BINARY_Biolog_SendMessage,
  2024. "BINARY_Biolog_PopUp" : self.BINARY_Biolog_PopUp,
  2025. "BINARY_Biolog_SelectReward" : self.BINARY_Biolog_SelectReward,
  2026. # END_OF_PROFESSIONAL_BIOLOG_SYSTEM
  2027. "IShop_BanneData" : self.IShop_BanneData,
  2028. "IShop_BestSellersItems" : self.IShop_BestSellersItems,
  2029. "IShop_Items" : self.IShop_Items,
  2030. "IShop_Category" : self.IShop_Category,
  2031. "IShop_tombola" : self.IShop_tombola,
  2032. "IShop_Update" : self.IShop_Update,
  2033. "IShop_tombola_winner" : self.IShop_tombola_winner,
  2034. "Ishop_Hisotry" : self.Ishop_Hisotry,
  2035. "Showmedallas_gui" : self.__showmedallas_gui,
  2036. "cerrar_gui" : self.__hidemedallas_gui,
  2037. "muertes" : self.__muertes,
  2038. "primera_muerte" : self.__primera_muerte,
  2039. "doble_muerte" : self.__doble_muerte,
  2040. "triple_muerte" : self.__triple_muerte,
  2041. "exterminio" : self.__exterminio,
  2042. "muertacular" : self.__muertacular,
  2043. "bestialidad" : self.__bestialidad,
  2044. "salvajada" : self.__salvajada,
  2045. "catastrofe" : self.__catastrofe,
  2046. "apocalipsis" : self.__apocalipsis,
  2047. "lluvia_muertos" : self.__lluvia_muertos,
  2048. "super_increible" : self.__super_increible,
  2049. "BINARY_Update_Maintenance" : self.BINARY_Update_Maintenance,
  2050. "PetEvolution" : self.SetPetEvolution,
  2051. "PetName" : self.SetPetName,
  2052. "PetLevel" : self.SetPetLevel,
  2053. "PetDuration" : self.SetPetDuration,
  2054. "PetBonus" : self.SetPetBonus,
  2055. "PetSkill" : self.SetPetskill,
  2056. "PetIcon" : self.SetPetIcon,
  2057. "PetExp" : self.SetPetExp,
  2058. "PetUnsummon" : self.PetUnsummon,
  2059. "OpenPetIncubator" : self.OpenPetIncubator,
  2060. #Shop Decoration
  2061. "OpenDecoration" :self.__OpenDecoration,
  2062. #Shop Decoration
  2063. # WEDDING
  2064. "lover_login" : self.__LoginLover,
  2065. "lover_logout" : self.__LogoutLover,
  2066. "lover_near" : self.__LoverNear,
  2067. "lover_far" : self.__LoverFar,
  2068. "lover_divorce" : self.__LoverDivorce,
  2069. "PlayMusic" : self.__PlayMusic,
  2070. #WARNME - remove manually if disable shaman system
  2071. # if app.ENABLE_SUPPORT_SYSTEM:
  2072. "SupportLv" : self.SetSupportLevel,
  2073. "SupportName" : self.SetSupportName,
  2074. "SupportLeave" : self.SupportLeave,
  2075. "SupporInt" : self.SupportInt,
  2076. "SupportExp" : self.SetSupportExp,
  2077. "SupportIcon" : self.SetSupportIcon,
  2078. "SupportSpeciality" : self.SetSupportSpeciality,
  2079. #WARNME_END
  2080. ########################### GAYA SYSTEM #################################
  2081. "OpenGuiGaya" : self.OpenGuiGaya,
  2082. "GayaCheck" : self.GayaCheck,
  2083. "OpenGuiGayaMarket" :self.OpenGuiGayaMarket,
  2084. "GayaMarketSlotsDesblock" : self.GayaMarketSlotsDesblock,
  2085. "GayaMarketItems" : self.GayaMarketItems,
  2086. "GayaMarketClear" : self.GayaMarketClear,
  2087. "GayaMarketTime" : self.GayaTimeMarket,
  2088. ####################### END GAYA SYSTEM ######################################
  2089. # END_OF_WEDDING
  2090. "evento_letras" :self.send_status,
  2091. "letters_drop" :self.SDropLitere,
  2092. "OpenLetterWindow" :self.interface.ShowBoardEvent,
  2093. "teleport_quest" : self.__TeleportQuestManager,
  2094. "antiexp_index" : self.__BlockExpQuestManager,
  2095. "offshop_index" : self.__OffShopQuestManager,
  2096. "mostrar_usuarios" : self.__mostrar_usuarios,
  2097. "ocultar_usuarios" : self.__ocultar_usuarios,
  2098. "muerto_guerras" : self.__muerto_guerras,
  2099. "proteccion_guerra" : self.__proteccion_guerra,
  2100. "contador_usuarios_guerra" : self.__contador_usuarios_guerra,
  2101. "muertos_guerra" : self.__muertos_guerra,
  2102. "caido_guerra" : self.__caido_guerra,
  2103. "ataque_guerra" : self.__ataque_guerra,
  2104. "ataque_guerra1" : self.__ataque_guerra1,
  2105. "activar_libre" : self.__activar_libre,
  2106. "cerrar_grupo" : self.__grupobug,
  2107. "spirit2" : self.__spirit2,
  2108. "ManagerGiftSystem" : self.ManagerGiftSystem,
  2109. # PRIVATE_SHOP_PRICE_LIST
  2110. "MyShopPriceList" : self.__PrivateShop_PriceList,
  2111. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2112. "attrtransfermessage" : self.AttrTransferMessage,
  2113. # ChangeCH
  2114. "Update" : self.Update,
  2115. # EndChangeCH
  2116. "openregalo" : self.__regalo,
  2117. }
  2118. if app.ENABLE_DUNGEON_INFO_SYSTEM:
  2119. serverCommandList.update({
  2120. "DungeonInfo" : self.DungeonInfo,
  2121. "CleanDungeonInfo" : self.CleanDungeonInfo,
  2122. "CleanDungeonRanking" : self.CleanDungeonRanking,
  2123. "GetDungeonInfo" : self.GetDungeonInfo,
  2124. "UpdateDungeonInfo" : self.UpdateDungeonInfo,
  2125. "OpenDungeonRanking" : self.OpenDungeonRanking,
  2126. "OpenDungeon" : self.opendungeon,
  2127. "UpdateDungeonRanking" : self.UpdateDungeonRanking,
  2128. "TiempoDungeonInfo" : self.TiempoDungeonInfoTorre,
  2129. "TiempoDungeonInfoCata" : self.TiempoDungeonInfoCata,
  2130. "TiempoDungeonInfoNemere" : self.TiempoDungeonInfoNemere,
  2131. "TiempoDungeonInfoPuertas" : self.TiempoDungeonInfoPuertas,
  2132. "TiempoDungeonInfoSlime" : self.TiempoDungeonInfoSlime,
  2133. "TiempoDungeonInfoArya" : self.TiempoDungeonInfoArya,
  2134. "TiempoDungeonInfoBosque" : self.TiempoDungeonInfoBosque,
  2135. "TiempoDungeonInfoOrco" : self.TiempoDungeonInfoOrco,
  2136. "TiempoDungeonInfoIsla" : self.TiempoDungeonInfoIsla,
  2137. "TiempoDungeonInfoBeran" : self.TiempoDungeonInfoBeran,
  2138. "TiempoDungeonInfoJotuns" : self.TiempoDungeonInfoJotuns,
  2139. "TiempoDungeonInfoHydra" : self.TiempoDungeonInfoHydra,
  2140. "TiempoDungeonInfoValentine" : self.TiempoDungeonInfoValentine,
  2141. "TiempoDungeonInfonavidad" : self.TiempoDungeonInfonavidad,
  2142. "TiempoDungeonInfoHallowen" : self.TiempoDungeonInfoHallowen,
  2143. })
  2144. if app.ENABLE_CHEQUE_SYSTEM:
  2145. serverCommandList.update({"MyShopPriceListNew" : self.__PrivateShop_PriceListNew,})
  2146. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  2147. serverCommandList["COSTUME_HIDE_CLEAR"] = self.COSTUME_HIDE_CLEAR
  2148. serverCommandList["COSTUME_HIDE_LIST"] = self.COSTUME_HIDE_LIST
  2149. serverCommandList["COSTUME_HIDE_LOAD"] = self.COSTUME_HIDE_LOAD
  2150. if app.ENABLE_COSTUME_AURA:
  2151. serverCommandList["ClearDirRefine"] = self.ClearDirRefine
  2152. serverCommandList["SetDirRefine"] = self.SetDirRefine
  2153. serverCommandList["AuraRefineInformation"] = self.AuraRefineInformation
  2154. serverCommandList["OpenBoardRefine"] = self.OpenBoardRefine
  2155. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  2156. serverCommandList.update({"ChangeLookWindow" : self.OpenChangeLookWindow})
  2157. if app.ENABLE_ATTR_6TH_7TH_SYSTEM:
  2158. serverCommandList["attr_6th_7th"] = self.attr_6th_7th
  2159. serverCommandList["Attr67Add"] = self.Attr67Add
  2160. if app.ENABLE_DEFENSE_WAVE:
  2161. serverCommandList["BINARY_Update_Mast_HP"] = self.BINARY_Update_Mast_HP
  2162. serverCommandList["BINARY_Update_Mast_Window"] = self.BINARY_Update_Mast_Window
  2163. if app.ENABLE_12ZI:
  2164. serverCommandList["NextFloorButton"] = self.Show12ziJumpButton
  2165. serverCommandList["OpenUI12zi"] = self.OpenUI12zi
  2166. if app.ENABLE_SOUL_SYSTEM:
  2167. serverCommandList["RefineSoulSuceeded"] = self.__RefineSoulSuceededMessage
  2168. serverCommandList["RefineSoulFailed"] = self.__RefineSoulFailedMessage
  2169. if app.ENABLE_TARGET_AFFECT:
  2170. serverCommandList["AddTargetBoardAffect"] = self.AddTargetBoardAffect
  2171. serverCommandList["RemoveTargetBoardAffect"] = self.RemoveTargetBoardAffect
  2172. if app.ENABLE_SPECIAL_STORAGE:
  2173. serverCommandList["auto_stack_storage"] = self.interface.AutoStackStorage
  2174. self.serverCommander=stringCommander.Analyzer()
  2175. for serverCommandItem in serverCommandList.items():
  2176. self.serverCommander.SAFE_RegisterCallBack(
  2177. serverCommandItem[0], serverCommandItem[1]
  2178. )
  2179. def BINARY_ServerCommand_Run(self, line):
  2180. #dbg.TraceError(line)
  2181. try:
  2182. #print " BINARY_ServerCommand_Run", line
  2183. return self.serverCommander.Run(line)
  2184. except RuntimeError, msg:
  2185. dbg.TraceError(msg)
  2186. return 0
  2187. def __TeleportQuestManager(self, questindex):
  2188. constInfo.TELEPORT_QUEST = questindex
  2189. def __BlockExpQuestManager(self, questindex):
  2190. constInfo.BLOCKEXP_QUEST = questindex
  2191. def __OffShopQuestManager(self, questindex):
  2192. constInfo.OFFSHOP_QUEST = questindex
  2193. def __ProcessPreservedServerCommand(self):
  2194. try:
  2195. command = net.GetPreservedServerCommand()
  2196. while command:
  2197. print " __ProcessPreservedServerCommand", command
  2198. self.serverCommander.Run(command)
  2199. command = net.GetPreservedServerCommand()
  2200. except RuntimeError, msg:
  2201. dbg.TraceError(msg)
  2202. return 0
  2203. def PartyHealReady(self):
  2204. self.interface.PartyHealReady()
  2205. def AskSafeboxPassword(self):
  2206. self.interface.AskSafeboxPassword()
  2207. # ITEM_MALL
  2208. def AskMallPassword(self):
  2209. self.interface.AskMallPassword()
  2210. def __ItemMall_Open(self):
  2211. self.interface.OpenItemMall();
  2212. def CommandCloseMall(self):
  2213. self.interface.CommandCloseMall()
  2214. # END_OF_ITEM_MALL
  2215. def AttrTransferMessage(self):
  2216. snd.PlaySound("sound/ui/make_soket.wav")
  2217. self.PopupMessage(localeInfo.COMB_ALERT)
  2218. def RefineSuceededMessage(self):
  2219. snd.PlaySound("sound/ui/make_soket.wav")
  2220. self.PopupMessage(localeInfo.REFINE_SUCCESS)
  2221. def RefineFailedMessage(self):
  2222. snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2223. self.PopupMessage(localeInfo.REFINE_FAILURE)
  2224. if app.ENABLE_SOUL_SYSTEM:
  2225. def __RefineSoulSuceededMessage(self):
  2226. snd.PlaySound("sound/ui/make_soket.wav")
  2227. self.PopupMessage(localeInfo.SOUL_REFINE_SUCCESS)
  2228. def __RefineSoulFailedMessage(self):
  2229. snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2230. self.PopupMessage(localeInfo.SOUL_REFINE_FAILURE)
  2231. def CommandCloseSafebox(self):
  2232. self.interface.CommandCloseSafebox()
  2233. # PRIVATE_SHOP_PRICE_LIST
  2234. def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  2235. uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
  2236. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2237. def SetPetEvolution(self, evo):
  2238. petname = [" شاب ", " بري ", " شجاع ", " بطولي "]
  2239. self.petmain.SetEvolveName(petname[int(evo)])
  2240. def SetPetName(self, name):
  2241. if len(name) > 1 and name != "":
  2242. self.petmini.Show()
  2243. self.petmain.SetName(name)
  2244. def SetPetLevel(self, level):
  2245. self.petmain.SetLevel(level)
  2246. def SetPetDuration(self, dur, durt):
  2247. if int(durt) > 0:
  2248. self.petmini.SetDuration(dur, durt)
  2249. self.petmain.SetDuration(dur, durt)
  2250. def SetPetBonus(self, hp, dif, sp):
  2251. self.petmain.SetHp(hp)
  2252. self.petmain.SetDef(dif)
  2253. self.petmain.SetSp(sp)
  2254. def SetPetskill(self, slot, idx, lv):
  2255. self.petmini.SetSkill(slot, idx, lv)
  2256. self.petmain.SetSkill(slot, idx, lv)
  2257. self.affectShower.BINARY_NEW_AddAffect(5400+int(idx),int(constInfo.LASTAFFECT_POINT)+1,int(constInfo.LASTAFFECT_VALUE)+1, 0)
  2258. if int(slot)==0:
  2259. constInfo.SKILL_PET1=5400+int(idx)
  2260. if int(slot)==1:
  2261. constInfo.SKILL_PET2=5400+int(idx)
  2262. if int(slot)==2:
  2263. constInfo.SKILL_PET3=5400+int(idx)
  2264. def SetPetIcon(self, vnum):
  2265. if int(vnum) > 0:
  2266. self.petmini.SetImageSlot(vnum)
  2267. self.petmain.SetImageSlot(vnum)
  2268. def SetPetExp(self, exp, expi, exptot):
  2269. if int(exptot) > 0:
  2270. self.petmini.SetExperience(exp, expi, exptot)
  2271. self.petmain.SetExperience(exp, expi, exptot)
  2272. def PetUnsummon(self):
  2273. self.petmini.SetDefaultInfo()
  2274. self.petmini.Close()
  2275. self.petmain.SetDefaultInfo()
  2276. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET1),0)
  2277. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET2),0)
  2278. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET3),0)
  2279. constInfo.SKILL_PET1 = 0
  2280. constInfo.SKILL_PET2 = 0
  2281. constInfo.SKILL_PET3 = 0
  2282. def OpenPetMainGui(self):
  2283. self.petmain.Show()
  2284. self.petmain.SetTop()
  2285. def OpenPetIncubator(self, pet_new = 0):
  2286. import uipetincubatrice
  2287. self.petinc = uipetincubatrice.PetSystemIncubator(pet_new)
  2288. self.petinc.Show()
  2289. self.petinc.SetTop()
  2290. def OpenPetMini(self):
  2291. self.petmini.Show()
  2292. self.petmini.SetTop()
  2293. def OpenPetFeed(self):
  2294. self.feedwind = uipetfeed.PetFeedWindow()
  2295. self.feedwind.Show()
  2296. self.feedwind.SetTop()
  2297. def Gift_Show(self):
  2298. if constInfo.PET_MAIN == 0:
  2299. self.petmain.Show()
  2300. constInfo.PET_MAIN =1
  2301. self.petmain.SetTop()
  2302. else:
  2303. self.petmain.Hide()
  2304. constInfo.PET_MAIN =0
  2305. if app.ENABLE_CHEQUE_SYSTEM:
  2306. def __PrivateShop_PriceListNew(self, itemVNum, itemPrice, itemCheque):
  2307. uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
  2308. uiPrivateShopBuilder.SetPrivateShopItemCheque(itemVNum, itemCheque)
  2309. def __Horse_HideState(self):
  2310. self.affectShower.SetHorseState(0, 0, 0)
  2311. def __Horse_UpdateState(self, level, health, battery):
  2312. self.affectShower.SetHorseState(int(level), int(health), int(battery))
  2313. def __IsXMasMap(self):
  2314. mapDict = ( "metin2_map_n_flame_01",
  2315. "metin2_map_n_desert_01",
  2316. "metin2_map_spiderdungeon",
  2317. "metin2_map_deviltower1",
  2318. "chamber_of_wisdom_dungeon", )
  2319. if background.GetCurrentMapName() in mapDict:
  2320. return False
  2321. return True
  2322. def __XMasSnow_Enable(self, mode):
  2323. self.__XMasSong_Enable(mode)
  2324. if "1"==mode:
  2325. if not self.__IsXMasMap():
  2326. return
  2327. print "XMAS_SNOW ON"
  2328. background.EnableSnow(1)
  2329. else:
  2330. print "XMAS_SNOW OFF"
  2331. background.EnableSnow(0)
  2332. #Shop Decoration
  2333. def __OpenDecoration(self):
  2334. self.interface.OpenShopDecoration()
  2335. #Shop Decoration
  2336. def __XMasBoom_Enable(self, mode):
  2337. if "1"==mode:
  2338. if not self.__IsXMasMap():
  2339. return
  2340. print "XMAS_BOOM ON"
  2341. self.__DayMode_Update("dark")
  2342. self.enableXMasBoom = True
  2343. self.startTimeXMasBoom = app.GetTime()
  2344. else:
  2345. print "XMAS_BOOM OFF"
  2346. self.__DayMode_Update("light")
  2347. self.enableXMasBoom = False
  2348. def __XMasTree_Enable(self, grade):
  2349. print "XMAS_TREE ", grade
  2350. background.SetXMasTree(int(grade))
  2351. def __XMasSong_Enable(self, mode):
  2352. if "1"==mode:
  2353. print "XMAS_SONG ON"
  2354. XMAS_BGM = "xmas.mp3"
  2355. if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  2356. if musicInfo.fieldMusic != "":
  2357. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2358. musicInfo.fieldMusic=XMAS_BGM
  2359. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2360. else:
  2361. print "XMAS_SONG OFF"
  2362. if musicInfo.fieldMusic != "":
  2363. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2364. musicInfo.fieldMusic=musicInfo.METIN2THEMA
  2365. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2366. def __RestartDialog_Close(self):
  2367. self.interface.CloseRestartDialog()
  2368. def __Console_Enable(self):
  2369. constInfo.CONSOLE_ENABLE = True
  2370. self.consoleEnable = True
  2371. app.EnableSpecialCameraMode()
  2372. ui.EnablePaste(True)
  2373. ## PrivateShop
  2374. def __PrivateShop_Open(self):
  2375. #self.interface.OpenPrivateShopInputNameDialog()
  2376. if app.WJ_ENABLE_TRADABLE_ICON:
  2377. self.uiNewShopCreate.privateShopBuilder.BindInterface(self.interface)
  2378. self.uiNewShopCreate.privateShopBuilder.SetInven(self.interface.wndInventory)
  2379. self.uiNewShopCreate.privateShopBuilder.wndInventory.BindWindow(self.interface.privateShopBuilder)
  2380. self.uiNewShop.Show()
  2381. def BINARY_PrivateShop_Appear(self, vid, text):
  2382. if chr.GetInstanceType(vid) in [chr.INSTANCE_TYPE_PLAYER, chr.INSTANCE_TYPE_NPC]:
  2383. self.interface.AppearPrivateShop(vid, text)
  2384. def BINARY_PrivateShop_Disappear(self, vid):
  2385. self.interface.DisappearPrivateShop(vid)
  2386. ## DayMode
  2387. def __PRESERVE_DayMode_Update(self, mode):
  2388. if "light"==mode:
  2389. background.SetEnvironmentData(0)
  2390. elif "dark"==mode:
  2391. if not self.__IsXMasMap():
  2392. return
  2393. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2394. background.SetEnvironmentData(1)
  2395. def __DayMode_Update(self, mode):
  2396. if "light"==mode:
  2397. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  2398. elif "dark"==mode:
  2399. if not self.__IsXMasMap():
  2400. return
  2401. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  2402. def __DayMode_OnCompleteChangeToLight(self):
  2403. background.SetEnvironmentData(0)
  2404. self.curtain.FadeIn()
  2405. def __DayMode_OnCompleteChangeToDark(self):
  2406. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2407. background.SetEnvironmentData(1)
  2408. self.curtain.FadeIn()
  2409. ## XMasBoom
  2410. def __XMasBoom_Update(self):
  2411. self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  2412. if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  2413. return
  2414. boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  2415. boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  2416. if app.GetTime() - self.startTimeXMasBoom > boomTime:
  2417. self.indexXMasBoom += 1
  2418. for i in xrange(boomCount):
  2419. self.__XMasBoom_Boom()
  2420. def __XMasBoom_Boom(self):
  2421. x, y, z = player.GetMainCharacterPosition()
  2422. randX = app.GetRandom(-150, 150)
  2423. randY = app.GetRandom(-150, 150)
  2424. snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  2425. def __PartyRequestQuestion(self, vid):
  2426. vid = int(vid)
  2427. partyRequestQuestionDialog = uiCommon.QuestionDialog()
  2428. partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
  2429. partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  2430. partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  2431. partyRequestQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerPartyRequest(arg))
  2432. partyRequestQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerPartyRequest(arg))
  2433. partyRequestQuestionDialog.Open()
  2434. partyRequestQuestionDialog.vid = vid
  2435. self.partyRequestQuestionDialog = partyRequestQuestionDialog
  2436. def __AnswerPartyRequest(self, answer):
  2437. if not self.partyRequestQuestionDialog:
  2438. return
  2439. vid = self.partyRequestQuestionDialog.vid
  2440. if answer:
  2441. net.SendChatPacket("/party_request_accept " + str(vid))
  2442. else:
  2443. net.SendChatPacket("/party_request_deny " + str(vid))
  2444. self.partyRequestQuestionDialog.Close()
  2445. self.partyRequestQuestionDialog = None
  2446. def __PartyRequestDenied(self):
  2447. self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
  2448. if (app.WJ_COMBAT_ZONE):
  2449. def BINARY_CombatZone_Manager(self, tokens, arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0):
  2450. if tokens == "OpenWindow":
  2451. self.wndCombatZone.Open(arg1, arg2, arg3, arg4)
  2452. elif tokens == "RegisterRank":
  2453. self.wndCombatZone.RegisterRanking()
  2454. elif tokens == "StartFlashing":
  2455. if self.interface:
  2456. #self.interface.wndMiniMap.btnCombatZone.FlashEx()
  2457. pass
  2458. elif tokens == "RefreshShop":
  2459. if self.interface:
  2460. self.interface.dlgShop.SetCombatZonePoints(arg1)
  2461. self.interface.dlgShop.SetLimitCombatZonePoints(arg2, arg3)
  2462. def __EnableTestServerFlag(self):
  2463. app.EnableTestServerFlag()
  2464. def __InGameShop_Show(self, url):
  2465. if constInfo.IN_GAME_SHOP_ENABLE:
  2466. self.interface.OpenWebWindow(url)
  2467. # WEDDING
  2468. def __LoginLover(self):
  2469. if self.interface.wndMessenger:
  2470. self.interface.wndMessenger.OnLoginLover()
  2471. def __LogoutLover(self):
  2472. if self.interface.wndMessenger:
  2473. self.interface.wndMessenger.OnLogoutLover()
  2474. if self.affectShower:
  2475. self.affectShower.HideLoverState()
  2476. def __LoverNear(self):
  2477. if self.affectShower:
  2478. self.affectShower.ShowLoverState()
  2479. if app.ENABLE_ATTR_6TH_7TH_SYSTEM:
  2480. def attr_6th_7th(self):
  2481. self.interface.OpenAttr67AddDialog()
  2482. def Attr67Add(self):
  2483. self.wndPopupDialog = uiCommon.PopupDialog()
  2484. self.wndPopupDialog.SetText(localeInfo.ATTR_6TH_7TH_POSSIBILITY)
  2485. self.wndPopupDialog.Open()
  2486. def __LoverFar(self):
  2487. if self.affectShower:
  2488. self.affectShower.HideLoverState()
  2489. def __LoverDivorce(self):
  2490. if self.interface.wndMessenger:
  2491. self.interface.wndMessenger.ClearLoverInfo()
  2492. if self.affectShower:
  2493. self.affectShower.ClearLoverState()
  2494. if app.ENABLE_DEFENSE_WAVE:
  2495. def BINARY_Update_Mast_HP(self, hp):
  2496. self.interface.BINARY_Update_Mast_HP(int(hp))
  2497. def BINARY_Update_Mast_Window(self, i):
  2498. self.interface.BINARY_Update_Mast_Window(int(i))
  2499. def __Attr67AddWindow(self):
  2500. import uiattr67add
  2501. self.Attr67AddWindow = uiattr67add.Attr67AddWindow()
  2502. self.Attr67AddWindow.Show()
  2503. def __PlayMusic(self, flag, filename):
  2504. flag = int(flag)
  2505. if flag:
  2506. snd.FadeOutAllMusic()
  2507. musicInfo.SaveLastPlayFieldMusic()
  2508. snd.FadeInMusic("BGM/" + filename)
  2509. else:
  2510. snd.FadeOutAllMusic()
  2511. musicInfo.LoadLastPlayFieldMusic()
  2512. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2513. # END_OF_WEDDING
  2514. def GetInputStart(self):
  2515. constInfo.INPUT_IGNORE = 1
  2516. def GetInputStop(self):
  2517. constInfo.INPUT_IGNORE = 0
  2518. def _PartyEmotionsCMD(self, command):
  2519. cmd = command.split('/')
  2520. if cmd[0] == 'QID':
  2521. constInfo.PARTY_E['qid'] = int(cmd[1])
  2522. if app.ENABLE_SASH_SYSTEM:
  2523. def ActSash(self, iAct, bWindow):
  2524. if self.interface:
  2525. self.interface.ActSash(iAct, bWindow)
  2526. def AlertSash(self, bWindow):
  2527. snd.PlaySound("sound/ui/make_soket.wav")
  2528. if bWindow:
  2529. self.PopupMessage(localeInfo.SASH_DEL_SERVEITEM)
  2530. else:
  2531. self.PopupMessage(localeInfo.SASH_DEL_ABSORDITEM)
  2532. #ChangeCH
  2533. def Update(self, ch):
  2534. import serverInfo
  2535. net.SetServerInfo("%s, CH%s" % (serverInfo.SERVER_NAME, str(ch)))
  2536. constInfo.ch = int(ch)
  2537. #EndChangeCH
  2538. if app.ENABLE_SHOW_CHEST_DROP:
  2539. def BINARY_AddChestDropInfo(self, chestVnum, pageIndex, slotIndex, itemVnum, itemCount):
  2540. if self.interface:
  2541. self.interface.AddChestDropInfo(chestVnum, pageIndex, slotIndex, itemVnum, itemCount)
  2542. def BINARY_RefreshChestDropInfo(self, chestVnum):
  2543. if self.interface:
  2544. self.interface.RefreshChestDropInfo(chestVnum)
  2545. ####SHOP SYSTEM#####
  2546. def NewShop(self):
  2547. if self.uiNewShop:
  2548. self.uiNewShop.Show()
  2549. def ShopClear(self):
  2550. if self.uiNewShop:
  2551. self.uiNewShop.HideAll()
  2552. constInfo.MyShops=[]
  2553. def ShopCostClear(self):
  2554. constInfo.shop_cost=[]
  2555. def ShopCost(self,id,time,time_val,price):
  2556. constInfo.shop_cost.append({"id":int(id),"time":int(time),"time_val":int(time_val),"price":int(price)})
  2557. def ShopAdd(self,shop_id,shop_vid,szSign,gold,cheque,count,sold,days,date_close):
  2558. if self.uiNewShop:
  2559. shop={
  2560. "id":shop_id,
  2561. "vid":shop_vid,
  2562. "name":szSign.replace("\\"," ").replace("_","#"),
  2563. "gold":gold,
  2564. "cheque":cheque,
  2565. "sold":sold,
  2566. "items":int(count)-int(sold),
  2567. "days":days,
  2568. "time":date_close
  2569. }
  2570. self.uiNewShop.Load(shop)
  2571. constInfo.MyShops.append(shop)
  2572. def ShopItemClear(self):
  2573. if self.uiNewShop:
  2574. self.uiNewShop.ClearItems()
  2575. def ShopItem(self,data):
  2576. d=data.split("#")
  2577. id=d[0]
  2578. vnum=d[1]
  2579. dwVnum=d[2]
  2580. count=d[3]
  2581. slot=d[4]
  2582. price=d[5]
  2583. cheque=d[6]
  2584. s=d[7]
  2585. a=d[8]
  2586. sockets=[]
  2587. for key in s.split("|"):
  2588. sockets.append(int(key))
  2589. attrs=[]
  2590. for key in a.split("|"):
  2591. a=key.split(",")
  2592. attrs.append([int(a[0]),int(a[1])])
  2593. if self.uiNewShop:
  2594. self.uiNewShop.AddItem(slot,{"id":id,"vnum":vnum,"dwVnum":dwVnum,"count":count,"price":price,"cheque":cheque,"sockets":sockets,"attrs":attrs})
  2595. ####GIFT SYSTEM#####
  2596. def gift_clear(self):
  2597. constInfo.gift_items={}
  2598. self.interface.ClearGift()
  2599. def gift_item(self, id, vnum, dwVnum, count, pos, date_add, give, reason, szSockets, szAttrs):
  2600. sockets=[]
  2601. for key in szSockets.split("|"):
  2602. sockets.append(int(key))
  2603. attrs=[]
  2604. for key in szAttrs.split("|"):
  2605. a=key.split(",")
  2606. attrs.append([int(a[0]),int(a[1])])
  2607. constInfo.gift_items[int(pos)]={"id":int(id),"vnum":int(vnum),"dwVnum":int(dwVnum),"count":int(count),"pos":int(pos),"date_add":int(date_add),"reason":reason.replace("_"," "),"give":give.replace("_"," "),"sockets":sockets,"attrs":attrs}
  2608. def gift_load(self):
  2609. self.interface.wndGiftBox.Refresh()
  2610. def gift_show(self,pages):
  2611. self.interface.wndGiftBox.pageNum=int(pages)
  2612. self.interface.OpenGift()
  2613. def OnClickSearch(self):
  2614. if not self.uiSearchShop.IsShow():
  2615. self.uiSearchShop.Show()
  2616. self.uiSearchShop.SetCenterPosition()
  2617. else:
  2618. self.uiSearchShop.Hide()
  2619. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  2620. def COSTUME_HIDE_CLEAR(self):
  2621. self.interface.costume_hide_clear()
  2622. def COSTUME_HIDE_LIST(self,slot,index):
  2623. self.interface.costume_hide_list(slot,index)
  2624. def COSTUME_HIDE_LOAD(self):
  2625. self.interface.costume_hide_load()
  2626. def __muerto_guerras(self, id):
  2627. constInfo.muerto_guerras = int(id)
  2628. def __spirit2(self):
  2629. net.SendChatPacket("(spirit2)")
  2630. def __proteccion_guerra(self):
  2631. net.SendChatPacket("(proteccion_guerra)")
  2632. def __contador_usuarios_guerra(self, contador_usuarios_guerra):
  2633. self.contador_usuarios_guerra.SetText("U:"+contador_usuarios_guerra)
  2634. def __muertos_guerra(self, muertos_guerra):
  2635. self.muertos_guerra.SetText("R:"+muertos_guerra)
  2636. def __caido_guerra(self, caido_guerra):
  2637. self.caido_guerra.SetText("M:"+caido_guerra)
  2638. def __mostrar_usuarios(self):
  2639. self.Espacio.Show()
  2640. self.contador_usuarios_guerra.Show()
  2641. self.muertos_guerra.Show()
  2642. self.caido_guerra.Show()
  2643. def __ocultar_usuarios(self):
  2644. self.Espacio.Hide()
  2645. self.contador_usuarios_guerra.Hide()
  2646. self.muertos_guerra.Hide()
  2647. self.caido_guerra.Hide()
  2648. def __ataque_guerra(self):
  2649. constInfo.ataque_guerra = 1
  2650. def __ataque_guerra1(self):
  2651. constInfo.ataque_guerra = 0
  2652. def __activar_libre(self):
  2653. net.SendChatPacket("/pkmode 2")
  2654. def __grupobug(self):
  2655. net.SendPartyExitPacket()
  2656. if app.ENABLE_DUNGEON_INFO_SYSTEM:
  2657. def DungeonInfo(self, questindex):
  2658. constInfo.dungeonData["quest_index"] = questindex
  2659. def CleanDungeonInfo(self):
  2660. constInfo.dungeonInfo = []
  2661. def CleanDungeonRanking(self):
  2662. constInfo.dungeonRanking["ranking_list"] = []
  2663. def GetDungeonInfo(self, cmd):
  2664. cmd = cmd.split("#")
  2665. if cmd[0] == "INPUT":
  2666. constInfo.INPUT_IGNORE = int(cmd[1])
  2667. elif cmd[0] == "CMD":
  2668. net.SendQuestInputStringPacket(constInfo.dungeonData["quest_cmd"])
  2669. constInfo.dungeonData["quest_cmd"] = ""
  2670. else:
  2671. pass
  2672. def UpdateDungeonInfo(self, type, organization, levelLimit, partyMembers, mapName, mapIndex, mapCoordX, mapCoordY, cooldown, duration, entranceMapName, strengthBonusName, resistanceBonusName, itemVnum, BossVnum, finished, fastestTime, highestDamage):
  2673. type = int(type)
  2674. organization = int(organization)
  2675. levelLimit = int(levelLimit)
  2676. partyMembers = int(partyMembers)
  2677. mapName = str(mapName).replace("_", " ")
  2678. mapIndex = int(mapIndex)
  2679. mapCoordX = int(mapCoordX)
  2680. mapCoordY = int(mapCoordY)
  2681. cooldown = int(cooldown)
  2682. duration = int(duration)
  2683. entranceMapName = str(entranceMapName).replace("_", " ")
  2684. strengthBonusName = str(strengthBonusName).replace("_", " ")
  2685. resistanceBonusName = str(resistanceBonusName).replace("_", " ")
  2686. itemVnum = int(itemVnum)
  2687. BossVnum = int(BossVnum)
  2688. finished = int(finished)
  2689. fastestTime = int(fastestTime)
  2690. highestDamage = int(highestDamage)
  2691. constInfo.dungeonInfo.append(\
  2692. {
  2693. "type" : type,\
  2694. "organization" : organization,\
  2695. "level_limit" : levelLimit,\
  2696. "party_members" : partyMembers,\
  2697. "map" : mapName,\
  2698. "map_index" : mapIndex,\
  2699. "map_coord_x" : mapCoordX,\
  2700. "map_coord_y" : mapCoordY,\
  2701. "cooldown" : cooldown,\
  2702. "duration" : duration,\
  2703. "entrance_map" : entranceMapName,\
  2704. "strength_bonus" : strengthBonusName,\
  2705. "resistance_bonus" : resistanceBonusName,\
  2706. "item_vnum" : itemVnum,
  2707. "boss_vnum" : BossVnum,
  2708. "finished" : finished,
  2709. "fastest_time" : fastestTime,
  2710. "highest_damage" : highestDamage,
  2711. },
  2712. )
  2713. def UpdateDungeonRanking(self, data):
  2714. name = str(data.split("#")[1])
  2715. level = int(data.split("#")[2])
  2716. pointType = int(data.split("#")[3])
  2717. constInfo.dungeonRanking["ranking_list"].append([name, level, pointType],)
  2718. def TiempoDungeonInfoTorre(self, data):
  2719. index_torre = int(data.split("#")[1])
  2720. tiempo_torre = int(data.split("#")[2])
  2721. constInfo.dungeontiempo["maptorre"] = int(index_torre)
  2722. constInfo.dungeontiempo["tiempo_torre"] = 0
  2723. def TiempoDungeonInfoCata(self, data):
  2724. index_cata = int(data.split("#")[1])
  2725. tiempo_cata= int(data.split("#")[2])
  2726. constInfo.dungeontiempo["mapcata"] = int(index_cata)
  2727. constInfo.dungeontiempo["tiempo_cata"] = int(tiempo_cata)
  2728. def TiempoDungeonInfoNemere(self, data):
  2729. index_nemere = int(data.split("#")[1])
  2730. tiempo_nemere = int(data.split("#")[2])
  2731. constInfo.dungeontiempo["mapnemere"] = int(index_nemere)
  2732. constInfo.dungeontiempo["tiempo_nemere"] = int(tiempo_nemere)
  2733. def TiempoDungeonInfoPuertas(self, data):
  2734. index_puertas = int(data.split("#")[1])
  2735. tiempo_puertas = int(data.split("#")[2])
  2736. constInfo.dungeontiempo["mappuertas"] = int(index_puertas)
  2737. constInfo.dungeontiempo["tiempo_puertas"] = int(tiempo_puertas)
  2738. def TiempoDungeonInfoSlime(self, data):
  2739. index_slime = int(data.split("#")[1])
  2740. tiempo_slime = int(data.split("#")[2])
  2741. constInfo.dungeontiempo["mapslime"] = int(index_slime)
  2742. constInfo.dungeontiempo["tiempo_slime"] = int(tiempo_slime)
  2743. def TiempoDungeonInfoArya(self, data):
  2744. index_arya = int(data.split("#")[1])
  2745. tiempo_arya = int(data.split("#")[2])
  2746. constInfo.dungeontiempo["maparya"] = int(index_arya)
  2747. constInfo.dungeontiempo["tiempo_arya"] = int(tiempo_arya)
  2748. def TiempoDungeonInfoBosque(self, data):
  2749. index_bosque = int(data.split("#")[1])
  2750. tiempo_bosque = int(data.split("#")[2])
  2751. constInfo.dungeontiempo["mapbosque"] = int(index_bosque)
  2752. constInfo.dungeontiempo["tiempo_bosque"] = int(tiempo_bosque)
  2753. def TiempoDungeonInfoOrco(self, data):
  2754. index_orco = int(data.split("#")[1])
  2755. tiempo_orco = int(data.split("#")[2])
  2756. constInfo.dungeontiempo["maporco"] = int(index_orco)
  2757. constInfo.dungeontiempo["tiempo_orco"] = int(tiempo_orco)
  2758. def TiempoDungeonInfoIsla(self, data):
  2759. index_isla = int(data.split("#")[1])
  2760. tiempo_isla = int(data.split("#")[2])
  2761. constInfo.dungeontiempo["mapisla"] = int(index_isla)
  2762. constInfo.dungeontiempo["tiempo_isla"] = int(tiempo_isla)
  2763. def TiempoDungeonInfoBeran(self, data):
  2764. index_beran = int(data.split("#")[1])
  2765. tiempo_beran = int(data.split("#")[2])
  2766. constInfo.dungeontiempo["mapberan"] = int(index_beran)
  2767. constInfo.dungeontiempo["tiempo_beran"] = int(tiempo_beran)
  2768. def TiempoDungeonInfoJotuns(self, data):
  2769. index_jotuns = int(data.split("#")[1])
  2770. tiempo_jotuns = int(data.split("#")[2])
  2771. constInfo.dungeontiempo["mapochoa"] = int(index_jotuns)
  2772. constInfo.dungeontiempo["tiempo_ochoa"] = int(tiempo_jotuns)
  2773. def TiempoDungeonInfoHydra(self, data):
  2774. index_hydra = int(data.split("#")[1])
  2775. tiempo_hydra = int(data.split("#")[2])
  2776. constInfo.dungeontiempo["maphydra"] = int(index_hydra)
  2777. constInfo.dungeontiempo["tiempo_hydra"] = int(tiempo_hydra)
  2778. def TiempoDungeonInfoValentine(self, data):
  2779. index_valentine = int(data.split("#")[1])
  2780. tiempo_valentine = int(data.split("#")[2])
  2781. constInfo.dungeontiempo["mapvalentine"] = int(index_valentine)
  2782. constInfo.dungeontiempo["tiempo_valentine"] = int(tiempo_valentine)
  2783. def TiempoDungeonInfonavidad(self, data):
  2784. index_navidad = int(data.split("#")[1])
  2785. tiempo_navidad = int(data.split("#")[2])
  2786. constInfo.dungeontiempo["mapnavidad"] = int(index_navidad)
  2787. constInfo.dungeontiempo["tiempo_navidad"] = int(tiempo_navidad)
  2788. def TiempoDungeonInfoHallowen(self, data):
  2789. index_hallowen = int(data.split("#")[1])
  2790. tiempo_hallowen = int(data.split("#")[2])
  2791. constInfo.dungeontiempo["maphallowen"] = int(index_hallowen)
  2792. constInfo.dungeontiempo["tiempo_hallowen"] = int(tiempo_hallowen)
  2793. def OpenDungeonRanking(self):
  2794. self.DungeonRank = uiDungeonInfo.DungeonRank()
  2795. self.DungeonRank.Open()
  2796. def opendungeon(self):
  2797. self.interface.ToggleDungeonInfoWindow()
  2798. def __regalo(self):
  2799. # self.interface.ToggleRegaloDiario()
  2800. self.ManagerGiftSystem("Show|")
  2801. def __RequestWarpToCharacter(self, name):
  2802. self.questionDialogWarp = uiCommon.QuestionDialogWithTimeLimit()
  2803. self.questionDialogWarp.SetText1(localeInfo.REQUEST_WARP_TO_CHARACTER % (name))
  2804. self.questionDialogWarp.SetTimeOverMsg(" عندما تكون متأكدًا ، حاول مرة أخرى ")
  2805. self.questionDialogWarp.SetTimeOverEvent(self.WarpCancelEvent, False)
  2806. self.questionDialogWarp.SetAcceptText(localeInfo.UI_ACCEPT)
  2807. self.questionDialogWarp.SetCancelText(localeInfo.UI_DENY)
  2808. self.questionDialogWarp.SetAcceptEvent(lambda arg = True: self.WarpAcceptEvent(name))
  2809. self.questionDialogWarp.SetCancelEvent(lambda arg = False: self.WarpCancelEvent(arg))
  2810. self.questionDialogWarp.Open(10)
  2811. self.questionDialogWarp.SetTop()
  2812. def WarpAcceptEvent(self, name):
  2813. net.SendMessengerSummonByNamePacket(name)
  2814. self.questionDialogWarp.Close()
  2815. def WarpCancelEvent(self, pregunta):
  2816. if pregunta == False:
  2817. self.questionDialogWarp.Close()
  2818. def __primera_muerte(self):
  2819. self.primera_muerte.Show()
  2820. snd.PlaySound("sound/ui/1_muerte.wav")
  2821. net.SendChatPacket("(1_muerte)")
  2822. def __doble_muerte(self):
  2823. self.doble_muerte.Show()
  2824. snd.PlaySound("sound/ui/doble_muerte.wav")
  2825. net.SendChatPacket("(doble_muerte)")
  2826. def __triple_muerte(self):
  2827. self.triple_muerte.Show()
  2828. snd.PlaySound("sound/ui/triple_muerte.wav")
  2829. net.SendChatPacket("(triple_muerte)")
  2830. def __exterminio(self):
  2831. self.exterminio.Show()
  2832. snd.PlaySound("sound/ui/exterminio.wav")
  2833. net.SendChatPacket("(exterminio)")
  2834. def __muertacular(self):
  2835. self.muertacular.Show()
  2836. snd.PlaySound("sound/ui/muertacular.wav")
  2837. net.SendChatPacket("(muertacular)")
  2838. def __bestialidad(self):
  2839. self.bestialidad.Show()
  2840. snd.PlaySound("sound/ui/bestialidad.wav")
  2841. net.SendChatPacket("(bestialidad)")
  2842. def __salvajada(self):
  2843. self.salvajada.Show()
  2844. snd.PlaySound("sound/ui/salvajada.wav")
  2845. net.SendChatPacket("(salvajada)")
  2846. def __catastrofe(self):
  2847. self.catastrofe.Show()
  2848. snd.PlaySound("sound/ui/catastrofe.wav")
  2849. net.SendChatPacket("(catastrofe)")
  2850. def __apocalipsis(self):
  2851. self.apocalipsis.Show()
  2852. snd.PlaySound("sound/ui/apocalipsis.wav")
  2853. net.SendChatPacket("(apocalipsis)")
  2854. def __lluvia_muertos(self):
  2855. self.lluvia_muertos.Show()
  2856. snd.PlaySound("sound/ui/lluvia_muertos.wav")
  2857. net.SendChatPacket("(lluvia_muertos)")
  2858. def __super_increible(self):
  2859. self.super_increible.Show()
  2860. snd.PlaySound("sound/ui/super_increible.wav")
  2861. net.SendChatPacket("(super_increible)")
  2862. def __hidemedallas_gui(self):
  2863. self.Medallas_gui.Hide()
  2864. self.primera_muerte.Hide()
  2865. self.doble_muerte.Hide()
  2866. self.triple_muerte.Hide()
  2867. self.exterminio.Hide()
  2868. self.muertacular.Hide()
  2869. self.bestialidad.Hide()
  2870. self.salvajada.Hide()
  2871. self.catastrofe.Hide()
  2872. self.apocalipsis.Hide()
  2873. self.lluvia_muertos.Hide()
  2874. self.super_increible.Hide()
  2875. self.muertes.Hide()
  2876. def __showmedallas_gui(self):
  2877. self.Medallas_gui.Show()
  2878. self.muertes.Show()
  2879. def __muertes(self, muertes):
  2880. self.muertes.SetText(muertes)
  2881. def SDropLitere(self, item_vnum, item_count, index, size):
  2882. constInfo.drop_letters[int(index)]={"iVnum":int(item_vnum),"iCount":int(item_count)}
  2883. constInfo.vnums_letters = int(size)
  2884. def send_status(self, status):
  2885. constInfo.E_LITERE_STATUS = int(status)
  2886. def day_night(self):
  2887. localtime = time.strftime("%H")
  2888. if day.nacht == 0:
  2889. if localtime == "01" or localtime == "02" or localtime == "03" or localtime == "04" or localtime == "05" or localtime == "06" or localtime == "07" or localtime == "00" or localtime == "23" or localtime == "22" or localtime == "21":
  2890. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2891. background.SetEnvironmentData(1)
  2892. day.tag = 0
  2893. day.nacht = 1
  2894. if day.tag == 0:
  2895. if localtime == "11" or localtime == "12" or localtime == "13" or localtime == "14" or localtime == "15" or localtime == "16" or localtime == "17":
  2896. background.SetEnvironmentData(0)
  2897. day.tag = 1
  2898. day.nacht = 0
  2899. if localtime == "08" or localtime == "09" or localtime == "10" or localtime == "18" or localtime == "19" or localtime == "20":
  2900. background.RegisterEnvironmentData(2, constInfo.ENVIRONMENT_EVENING)
  2901. background.SetEnvironmentData(2)
  2902. day.tag = 1
  2903. day.nacht = 0
  2904. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  2905. def OpenChangeLookWindow(self):
  2906. self.ChangeLookWindow.Open()
  2907. # ITEM SHOP
  2908. def IShop_BanneData(self, src):
  2909. self.interface.IShop_BanneData(src)
  2910. def IShop_BestSellersItems(self, id, vnum):
  2911. self.interface.IShop_BestSellersItems(int(id), int(vnum))
  2912. def OpenItemShop(self):
  2913. self.interface.ShowN()
  2914. def IShop_Items(self, id, vnum, price, count, top, atrt0, atrv0, atrt1, atrv1, atrt2, atrv2, atrt3, atrv3, atrt4, atrv4, atrt5, atrv5, atrt6, atrv6, socket0, socket1, socket2, socket3, socket4, socket5, cat, desc):
  2915. self.interface.IShop_Items(int(id), int(vnum), int(price), int(count), int(top), int(atrt0), int(atrv0), int(atrt1), int(atrv1), int(atrt2), int(atrv2), int(atrt3), int(atrv3), int(atrt4), int(atrv4), int(atrt5), int(atrv5), int(atrt6), int(atrv6), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(cat), int(desc))
  2916. def IShop_Category(self, id, src):
  2917. self.interface.IShop_Category(id, src)
  2918. #chat.AppendChat(chat.CHAT_TYPE_INFO, str(id)+" - "+ str(src))
  2919. def IShop_tombola(self, id, vnum, count):
  2920. self.interface.IShop_tombola(int(id), int(vnum), 1)
  2921. def IShop_Update(self, coins, mds):
  2922. self.interface.IShop_Update(int(coins), int(mds))
  2923. def IShop_tombola_winner(self, pos):
  2924. self.interface.IShop_tombola_winner(int(pos))
  2925. def Ishop_Hisotry(self, id, vnum, cantidad, precio, origen):
  2926. self.interface.Ishop_Hisotry(int(id), int(vnum), int(cantidad), int(precio), str(origen))
  2927. # ITEM SHOP
  2928. if app.ENABLE_COSTUME_AURA:
  2929. def ClearDirRefine(self):
  2930. constInfo.ITEM_REFINE_DIR = {}
  2931. def SetDirRefine(self, i, vnum):
  2932. constInfo.ITEM_REFINE_DIR[i] = vnum
  2933. def AuraRefineInformation(self, result1, result2, item_vn_1, item_co_1, item_vn_2, item_co_2, item_vn_3, item_co_3, item_vn_4, item_co_4, price):
  2934. constInfo.REFINE_ITEM_RESULT_1 = result1
  2935. constInfo.REFINE_ITEM_RESULT_2 = result2
  2936. constInfo.ITEM_VNUM_1 = item_vn_1
  2937. constInfo.ITEM_COUNT_1 = item_co_1
  2938. constInfo.ITEM_VNUM_2 = item_vn_2
  2939. constInfo.ITEM_COUNT_2 = item_co_2
  2940. constInfo.ITEM_VNUM_3 = item_vn_3
  2941. constInfo.ITEM_COUNT_3 = item_co_3
  2942. constInfo.ITEM_VNUM_4 = item_vn_4
  2943. constInfo.ITEM_COUNT_4 = item_co_4
  2944. constInfo.PRICE_R = price
  2945. def OpenBoardRefine(self):
  2946. if (self.RefineAura.IsShow()):
  2947. self.RefineAura.Hide()
  2948. else:
  2949. self.RefineAura.Show()
  2950. if app.ENABLE_SWITCHBOT:
  2951. def RefreshSwitchbotWindow(self):
  2952. self.interface.RefreshSwitchbotWindow()
  2953. def RefreshSwitchbotItem(self, slot):
  2954. self.interface.RefreshSwitchbotItem(slot)
  2955. if app.ENABLE_CUBE_RENEWAL_WORLDARD:
  2956. def BINARY_CUBE_RENEWAL_OPEN(self):
  2957. if self.interface:
  2958. self.interface.BINARY_CUBE_RENEWAL_OPEN()
  2959. if app.ENVANTER_KILIT:
  2960. def envanter_kilitle_quest(self, value):
  2961. constInfo.ENVANTERRR_BLACK = int(value)
  2962. #if app.ENABLE_SUPPORT_SYSTEM:
  2963. def OpenSupportGui(self):
  2964. if constInfo.SUPPORTGUI == 0:
  2965. self.supportpg.Show()
  2966. self.supportpg.SetTop()
  2967. constInfo.SUPPORTGUI = 1
  2968. else:
  2969. self.supportpg.Close()
  2970. constInfo.SUPPORTGUI = 0
  2971. def SetSupportLevel(self, level):
  2972. self.supportpg.SetLevel(level)
  2973. constInfo.SUPPORTLEVEL = int(level)
  2974. def SetSupportName(self, name, name2):
  2975. self.supportpg.SetName(name, name2)
  2976. def SupportLeave(self):
  2977. self.supportpg.SetDefaultInfo()
  2978. self.supportpg.Close()
  2979. def SupportInt(self , ints):
  2980. self.supportpg.SetInt(ints)
  2981. def SetSupportExp(self, exp, exptot):
  2982. if int(exptot) > 0:
  2983. self.supportpg.SetExperience(exp, exptot)
  2984. self.supportpg.SetExperience(exp, exptot)
  2985. def SetSupportIcon(self, vnum):
  2986. if int(vnum) > 0:
  2987. self.supportpg.SetImageSlot(vnum)
  2988. self.supportpg.SetImageSlot(vnum)
  2989. def SetSupportSpeciality(self,speciality):
  2990. self.supportpg.SetSpeciality(speciality)
  2991. ############################### GAYA SYSTEM ###############################
  2992. def OpenGuiGaya(self):
  2993. self.interface.OpenGuiGaya()
  2994. def GayaCheck(self):
  2995. self.interface.GayaCheck()
  2996. def OpenGuiGayaMarket(self):
  2997. self.interface.OpenGuiGayaMarket()
  2998. def GayaMarketItems(self,vnums,gaya,count):
  2999. self.interface.GayaMarketItems(vnums,gaya,count)
  3000. def GayaMarketSlotsDesblock(self,slot0,slot1,slot2,slot3,slot4,slot5):
  3001. self.interface.GayaMarketSlotsDesblock(slot0,slot1,slot2,slot3,slot4,slot5)
  3002. def GayaMarketClear(self):
  3003. self.interface.GayaMarketClear()
  3004. def GayaTimeMarket(self, time):
  3005. self.interface.GayaTime(time)
  3006. ######################################## END GAYA SYSTEM ################################
  3007. def ManagerGiftSystem(self, cmd):
  3008. cmd = cmd.split("|")
  3009. if cmd[0] == "Show":
  3010. self.wnddailygift.Show()
  3011. elif cmd[0] == "DeleteRewards":
  3012. self.wnddailygift.DeleteRewards()
  3013. elif cmd[0] == "SetDailyReward":
  3014. self.wnddailygift.SetDailyReward(cmd[1]) # رقم المكافأة
  3015. elif cmd[0] == "SetTime":
  3016. self.wnddailygift.SetTime(cmd[1]) # الوقت بأعداد كبيرة
  3017. elif cmd[0] == "SetReward":
  3018. self.wnddailygift.SetReward(cmd[1], cmd[2]) #hacer un array con los items
  3019. elif cmd[0] == "SetRewardDone":
  3020. self.wnddailygift.SetRewardDone()
Comments powered by Disqus