Guest User

Untitled

a guest
Apr 15th, 2020
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 190.27 KB | None | 0 0
  1. import os
  2. import app
  3. import dbg
  4. import grp
  5. import item
  6. import background
  7. import chr
  8. import chrmgr
  9. import player
  10. import chat
  11. import translate
  12. import textTail
  13. import event
  14. import uibonuspage
  15. import uipetsystem
  16. import snd
  17. import net
  18. import effect
  19. import wndMgr
  20. import fly
  21. import systemSetting
  22. import quest
  23. import guild
  24. import skill
  25. import messenger
  26. if app.ENABLE_ADMIN_BAN_MANAGER:
  27. import uiadmintool
  28. import uimarbleshop
  29. import localeInfo
  30. import constInfo
  31. import exchange
  32. import uiHealth
  33. import ime
  34. import constInfo2
  35. import mounting
  36. import ui
  37. import uiCommon
  38. import uiPhaseCurtain
  39. import uiMapNameShower
  40. import uiAffectShower
  41. import uiPlayerGauge
  42. import uiCharacter
  43. import uiTarget
  44. import uiTaskbar
  45. import uiteleport
  46. import uiguildstorage
  47. import schicksalrad
  48. # PRIVATE_SHOP_PRICE_LIST
  49. import uiPrivateShopBuilder
  50. # END_OF_PRIVATE_SHOP_PRICE_LIST
  51. import time
  52. # 5Lv Oto Bec Sistemi
  53. import savbec
  54. import surabec
  55. import ninjabec
  56. import samanbec
  57. import lycanbec
  58. import BKTrade
  59. import serverInfo
  60. import mouseModule
  61. import consoleModule
  62. import localeInfo
  63. import gameInfo
  64. import uibkoku
  65. import uiruhtasi
  66. import uinpcekran
  67. import uibiyolog
  68. import uimarbleshop
  69.  
  70. import playerSettingModule
  71. import interfaceModule
  72.  
  73. import musicInfo
  74. import debugInfo
  75. import stringCommander
  76. import uiPrivateShopSearch
  77.  
  78. #AKIRA_EVENT_SYSTEM
  79. import uiAkiraEvent
  80. #END_OF_AKIRA_EVENT_SYSTEM
  81. if app.ENABLE_SUPPORT_SYSTEM:
  82. import uisupportsystem
  83. if app.ENABLE_SWITCHER_MIJAGO:
  84. from switchbot import Bot
  85. import oyunicisiralama
  86. import loncasiralama
  87. import record
  88. import loncatanit
  89. import uilider
  90. import otoavinfo
  91. import uikeyboard
  92. if app.ENABLE_COSTUME_AURA:
  93. import UiRefineAura
  94.  
  95. from _weakref import proxy
  96.  
  97. # TEXTTAIL_LIVINGTIME_CONTROL
  98. #if localeInfo.IsJAPAN():
  99. # app.SetTextTailLivingTime(8.0)
  100. # END_OF_TEXTTAIL_LIVINGTIME_CONTROL
  101.  
  102.  
  103. # SCREENSHOT_CWDSAVE
  104. SCREENSHOT_CWDSAVE = FALSE
  105. SCREENSHOT_DIR = None
  106. import binascii
  107.  
  108. import guildwarkillcounter
  109. import uiGuild
  110.  
  111. if localeInfo.IsEUROPE():
  112. SCREENSHOT_CWDSAVE = TRUE
  113.  
  114. if localeInfo.IsCIBN10():
  115. SCREENSHOT_CWDSAVE = FALSE
  116. SCREENSHOT_DIR = "YT2W"
  117.  
  118. if app.WJ_OFFLINESHOP_SYSTEM:
  119. import uiOfflineShopBuilder
  120. import uiOfflineShop
  121.  
  122. cameraDistance = 1550.0
  123. cameraPitch = 27.0
  124. cameraRotation = 0.0
  125. cameraHeight = 100.0
  126.  
  127. testAlignment = 0
  128. BPisLodaded={0:0}
  129. pet_gui_activado = 0
  130. bonuspp = 0
  131.  
  132. class GameWindow(ui.ScriptWindow):
  133. def __init__(self, stream):
  134. ui.ScriptWindow.__init__(self, "GAME")
  135. self.SetWindowName("game")
  136. net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  137. player.SetGameWindow(self)
  138.  
  139. import dailygift
  140. self.wnddailygift = dailygift.DailyGift()
  141.  
  142. self.quickSlotPageIndex = 0
  143. if app.ENABLE_SWITCHER_MIJAGO:
  144. self.switchbot = Bot()
  145. self.switchbot.Hide()
  146. self.lastPKModeSendedTime = 0
  147. self.LastBoniSwitcherId = 0
  148. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  149. self.newquickSlotPageIndex = 0
  150. self.pressNewNumber = None
  151.  
  152. self.pressNumber = None
  153. self.npcekran = None
  154. self.npcekran = uinpcekran.NPCEkran()
  155. self.npcekran.Hide()
  156. if (app.WJ_COMBAT_ZONE):
  157. import uicombatzone
  158. self.wndCombatZone = uicombatzone.CombatZoneWindow()
  159.  
  160. self.guildWarQuestionDialog = None
  161. self.interface = None
  162. self.targetBoard = None
  163. self.console = None
  164. self.mapNameShower = None
  165. self.affectShower = None
  166. self.playerGauge = None
  167. self.endTime = 0
  168. self.PrivateShopSearch = None
  169. self.petInventoryWnd = None
  170. self.boniSwitcherWnd = []
  171. constInfo.BONI_SWITCHER_LOAD = FALSE
  172. self.itemShopWnd = None
  173. #import uiBoniSwitcher
  174. #for i in xrange(constInfo.SWITCHER_COUNT):
  175. #self.boniSwitcherWnd.append(uiBoniSwitcher.BoniSwitcherDialog(i))
  176. #self.boniSwitcherWnd[i].SetChangeBonusSwitcherEvent(self.__BoniSwitcherShow)
  177. #self.boniSwitcherWnd[i].GAMESetBoniSwitcherCheckEvent(self.__BoniSwitcherCheckEvent)
  178. if app.ENABLE_COSTUME_AURA:
  179. self.RefineAura = UiRefineAura.RefineAura()
  180.  
  181. self.stream=stream
  182. self.interface = interfaceModule.Interface()
  183. self.interface.SetStream(self.stream)
  184. self.interface.MakeInterface()
  185. self.interface.SetOpenBoniSwitcherEvent(self.__BoniSwitcherShow)
  186. self.interface.ShowDefaultWindows()
  187. self.stream.isAutoSelect = 0
  188.  
  189. self.curtain = uiPhaseCurtain.PhaseCurtain()
  190. self.curtain.speed = 0.03
  191. self.curtain.Hide()
  192.  
  193. self.BKTradeSys = BKTrade.BKTrade()
  194. self.BKTradeSys.Close()
  195.  
  196. self.oyunicisiralama = oyunicisiralama.oyunicisirala()
  197. self.loncasiralama = loncasiralama.loncasiralama()
  198. self.recordscreen = record.recordwindow()
  199. self.loncanitanit = loncatanit.loncatanit()
  200.  
  201. self.GuildStorageWindow = uiguildstorage.GuildStorage()
  202.  
  203. self.targetBoard = uiTarget.TargetBoard()
  204. self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  205. self.targetBoard.Hide()
  206.  
  207. #AKIRA_EVENT_SYSTEM
  208. self.akiraEventButton = uiAkiraEvent.AkiraEventButton()
  209. self.akiraEventButton.LoadWindow()
  210. self.akiraEventButton.Hide()
  211. #END_OF_AKIRA_EVENT_SYSTEM
  212.  
  213. self.petmain = uipetsystem.PetSystemMain()
  214. self.petmini = uipetsystem.PetSystemMini()
  215.  
  216. self.console = consoleModule.ConsoleWindow()
  217. self.console.BindGameClass(self)
  218. self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  219. self.console.Hide()
  220.  
  221. if app.ENABLE_SUPPORT_SYSTEM:
  222. self.supportpg = uisupportsystem.SupportMainGui()
  223.  
  224. self.mapNameShower = uiMapNameShower.MapNameShower()
  225. self.LoncaGecmisi = uiGuild.LoncaGecmisUI()
  226. self.LoncaGecmisi.Hide()
  227. self.affectShower = uiAffectShower.AffectShower()
  228. if app.ENABLE_MAINTENANCE_SYSTEM:
  229. import uimaintenance
  230. self.wndMaintenance = uimaintenance.MaintenanceClass()
  231. if app.ENABLE_TICKET_SYSTEM:
  232. import uiticket
  233. self.wndTicket = uiticket.TicketBoard()
  234. self.wndTicketStaff = uiticket.TicketBoardAdmin()
  235. self.wndTicketReply = uiticket.TicketBoardInformationsID()
  236. if app.ENABLE_REBORN_SYSTEM:
  237. import uiReborn
  238. self.wndReborn = uiReborn.RebornClass()
  239. if app.ENABLE_ADMIN_BAN_MANAGER:
  240. self.wndAdminTool = uiadmintool.AdminTool()
  241. self.wndMarbleShop = uimarbleshop.MarbleShopWindow()
  242. # if app.ENABLE_TITLE_SYSTEM:
  243. # import title_system
  244. # self.wndTitleSystem = title_system.Title_System()
  245.  
  246. self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  247. self.playerGauge.Hide()
  248.  
  249. self.guildScoreCounter = guildwarkillcounter.MessageQueue()
  250.  
  251. self.bkoku = uibkoku.BKOku()
  252. self.bkoku.Hide()
  253. self.ruhtasi = uiruhtasi.RuhTasi()
  254. self.ruhtasi.Hide()
  255. self.biyoekran = uibiyolog.BiyologEkran()
  256. self.biyoekran.Hide()
  257. #wj 2014.1.2. ESC키를 누를 시 우선적으로 DropQuestionDialog를 끄도록 만들었다. 하지만 처음에 itemDropQuestionDialog가 선언되어 있지 않아 ERROR가 발생하여 init에서 선언과 동시에 초기화 시킴.
  258. self.itemDropQuestionDialog = None
  259.  
  260. self.__SetQuickSlotMode()
  261. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  262. self.__SetNewQuickSlotMode()
  263.  
  264. self.__ServerCommand_Build()
  265. self.__ProcessPreservedServerCommand()
  266. self.teleport = uiteleport.TeleportWindow()
  267. self.MountingSystem = mounting.MountWindow()
  268. self.SchicksalRad = schicksalrad.RadDesSchicksals()
  269.  
  270.  
  271. def __del__(self):
  272. player.SetGameWindow(0)
  273. net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  274. ui.ScriptWindow.__del__(self)
  275.  
  276. def Open(self):
  277. app.SetFrameSkip(1)
  278.  
  279. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  280. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  281. self.newquickSlotPageIndex = 0
  282.  
  283. Espacio = ui.AniImageBox()
  284. Espacio.SetWindowHorizontalAlignLeft()
  285. Espacio.SetWindowVerticalAlignTop()
  286. Espacio.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  287. self.Espacio = Espacio
  288.  
  289. self.Espacio.SetPosition(10, 80)
  290.  
  291. self.contador_usuarios_guerra = ui.TextLine()
  292. self.contador_usuarios_guerra.SetWindowHorizontalAlignLeft()
  293. self.contador_usuarios_guerra.SetWindowVerticalAlignTop()
  294. self.contador_usuarios_guerra.SetDefaultFontName()
  295. self.contador_usuarios_guerra.SetPosition(24+8, 37+2 +40)
  296. self.contador_usuarios_guerra.SetText("0")
  297. self.contador_usuarios_guerra.SetOutline()
  298.  
  299. self.muertos_guerra = ui.TextLine()
  300. self.muertos_guerra.SetWindowHorizontalAlignLeft()
  301. self.muertos_guerra.SetWindowVerticalAlignTop()
  302. self.muertos_guerra.SetDefaultFontName()
  303. self.muertos_guerra.SetPosition(24+8, 47+2+40)
  304. self.muertos_guerra.SetText("0")
  305. self.muertos_guerra.SetOutline()
  306.  
  307. self.caido_guerra = ui.TextLine()
  308. self.caido_guerra.SetWindowHorizontalAlignLeft()
  309. self.caido_guerra.SetWindowVerticalAlignTop()
  310. self.caido_guerra.SetDefaultFontName()
  311. self.caido_guerra.SetPosition(24+8, 57+2+40)
  312. self.caido_guerra.SetText("0")
  313. self.caido_guerra.SetOutline()
  314.  
  315. self.usuarios_guerra = ui.TextLine()
  316. self.usuarios_guerra.SetWindowHorizontalAlignLeft()
  317. self.usuarios_guerra.SetWindowVerticalAlignTop()
  318. self.usuarios_guerra.SetDefaultFontName()
  319. self.usuarios_guerra.SetPosition(10+8, 37+2+40)
  320. self.usuarios_guerra.SetText("U:")
  321. self.usuarios_guerra.SetOutline()
  322.  
  323. self.ranking_guerra = ui.TextLine()
  324. self.ranking_guerra.SetWindowHorizontalAlignLeft()
  325. self.ranking_guerra.SetWindowVerticalAlignTop()
  326. self.ranking_guerra.SetDefaultFontName()
  327. self.ranking_guerra.SetPosition(10+8, 47+2+40)
  328. self.ranking_guerra.SetText("R:")
  329. self.ranking_guerra.SetOutline()
  330.  
  331. self.ranking_caido = ui.TextLine()
  332. self.ranking_caido.SetWindowHorizontalAlignLeft()
  333. self.ranking_caido.SetWindowVerticalAlignTop()
  334. self.ranking_caido.SetDefaultFontName()
  335. self.ranking_caido.SetPosition(10 +8, 57 +2+40)
  336. self.ranking_caido.SetText("M:")
  337. self.ranking_caido.SetOutline()
  338.  
  339. Medallas_gui = ui.AniImageBox()
  340. Medallas_gui.SetWindowHorizontalAlignLeft()
  341. Medallas_gui.SetWindowVerticalAlignTop()
  342. Medallas_gui.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  343. self.Medallas_gui = Medallas_gui
  344.  
  345. self.Medallas_gui.SetPosition(10, 40)
  346.  
  347. self.muertes = ui.TextLine()
  348. self.muertes.SetWindowHorizontalAlignLeft()
  349. self.muertes.SetWindowVerticalAlignTop()
  350. self.muertes.SetDefaultFontName()
  351. self.muertes.SetPosition(24, 51)
  352. self.muertes.SetText("0")
  353. self.muertes.SetOutline()
  354.  
  355. self.primera_muerte = ui.AniImageBox()
  356. self.primera_muerte.SetWindowHorizontalAlignLeft()
  357. self.primera_muerte.SetWindowVerticalAlignTop()
  358. self.primera_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/1.dds")
  359. self.primera_muerte.SetPosition(43, 40)
  360.  
  361. self.doble_muerte = ui.AniImageBox()
  362. self.doble_muerte.SetWindowHorizontalAlignLeft()
  363. self.doble_muerte.SetWindowVerticalAlignTop()
  364. self.doble_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/2.dds")
  365. self.doble_muerte.SetPosition(43 + 33, 40)
  366.  
  367. self.triple_muerte = ui.AniImageBox()
  368. self.triple_muerte.SetWindowHorizontalAlignLeft()
  369. self.triple_muerte.SetWindowVerticalAlignTop()
  370. self.triple_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/3.dds")
  371. self.triple_muerte.SetPosition(43 + 33 + 33, 40)
  372.  
  373. self.exterminio = ui.AniImageBox()
  374. self.exterminio.SetWindowHorizontalAlignLeft()
  375. self.exterminio.SetWindowVerticalAlignTop()
  376. self.exterminio.AppendImage("d:/ymir work/ui/pattern/medallas/4.dds")
  377. self.exterminio.SetPosition(43+ 33+ 33 + 33, 40)
  378.  
  379. self.muertacular = ui.AniImageBox()
  380. self.muertacular.SetWindowHorizontalAlignLeft()
  381. self.muertacular.SetWindowVerticalAlignTop()
  382. self.muertacular.AppendImage("d:/ymir work/ui/pattern/medallas/5.dds")
  383. self.muertacular.SetPosition(43+ 33+ 33+ 33 + 33, 40)
  384.  
  385. self.bestialidad = ui.AniImageBox()
  386. self.bestialidad.SetWindowHorizontalAlignLeft()
  387. self.bestialidad.SetWindowVerticalAlignTop()
  388. self.bestialidad.AppendImage("d:/ymir work/ui/pattern/medallas/6.dds")
  389. self.bestialidad.SetPosition(43+ 33+ 33+ 33+ 33 + 33, 40)
  390.  
  391. self.salvajada = ui.AniImageBox()
  392. self.salvajada.SetWindowHorizontalAlignLeft()
  393. self.salvajada.SetWindowVerticalAlignTop()
  394. self.salvajada.AppendImage("d:/ymir work/ui/pattern/medallas/7.dds")
  395. self.salvajada.SetPosition(43+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  396.  
  397. self.catastrofe = ui.AniImageBox()
  398. self.catastrofe.SetWindowHorizontalAlignLeft()
  399. self.catastrofe.SetWindowVerticalAlignTop()
  400. self.catastrofe.AppendImage("d:/ymir work/ui/pattern/medallas/8.dds")
  401. self.catastrofe.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  402.  
  403. self.apocalipsis = ui.AniImageBox()
  404. self.apocalipsis.SetWindowHorizontalAlignLeft()
  405. self.apocalipsis.SetWindowVerticalAlignTop()
  406. self.apocalipsis.AppendImage("d:/ymir work/ui/pattern/medallas/9.dds")
  407. self.apocalipsis.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  408.  
  409. self.lluvia_muertos = ui.AniImageBox()
  410. self.lluvia_muertos.SetWindowHorizontalAlignLeft()
  411. self.lluvia_muertos.SetWindowVerticalAlignTop()
  412. self.lluvia_muertos.AppendImage("d:/ymir work/ui/pattern/medallas/10.dds")
  413. self.lluvia_muertos.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  414.  
  415. self.super_increible = ui.AniImageBox()
  416. self.super_increible.SetWindowHorizontalAlignLeft()
  417. self.super_increible.SetWindowVerticalAlignTop()
  418. self.super_increible.AppendImage("d:/ymir work/ui/pattern/medallas/11.dds")
  419. self.super_increible.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  420. #Fin menu
  421.  
  422. self.daily_reward = ui.Button()
  423. self.daily_reward.SetParent(self)
  424. self.daily_reward.SetPosition(wndMgr.GetScreenWidth()-75,230)
  425. self.daily_reward.SetUpVisual("icon/item/50244.tga")
  426. self.daily_reward.SetOverVisual("icon/item/50244.tga")
  427. self.daily_reward.SetDownVisual("icon/item/50244.tga")
  428. self.daily_reward.SetToolTipText("Daily Rewards")
  429. self.daily_reward.SetEvent(lambda : self.ManagerGiftSystem("Show|"))
  430. self.daily_reward.Show()
  431.  
  432. self.quickSlotPageIndex = 0
  433. self.PickingCharacterIndex = -1
  434. self.PickingItemIndex = -1
  435. self.consoleEnable = FALSE
  436. self.isShowDebugInfo = FALSE
  437. self.ShowNameFlag = FALSE
  438.  
  439. self.enableXMasBoom = FALSE
  440. self.startTimeXMasBoom = 0.0
  441. self.indexXMasBoom = 0
  442.  
  443. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  444.  
  445. app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  446.  
  447. constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  448. constInfo.SET_DEFAULT_CHRNAME_COLOR()
  449. constInfo.SET_DEFAULT_FOG_LEVEL()
  450. constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  451. constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  452. constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  453.  
  454. # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  455. constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  456. # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  457.  
  458. import event
  459. event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
  460.  
  461. textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  462.  
  463. if constInfo.PVPMODE_TEST_ENABLE:
  464. self.testPKMode = ui.TextLine()
  465. self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT)
  466. self.testPKMode.SetPosition(0, 15)
  467. self.testPKMode.SetWindowHorizontalAlignCenter()
  468. self.testPKMode.SetHorizontalAlignCenter()
  469. self.testPKMode.SetFeather()
  470. self.testPKMode.SetOutline()
  471. self.testPKMode.Show()
  472.  
  473. self.testAlignment = ui.TextLine()
  474. self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT)
  475. self.testAlignment.SetPosition(0, 35)
  476. self.testAlignment.SetWindowHorizontalAlignCenter()
  477. self.testAlignment.SetHorizontalAlignCenter()
  478. self.testAlignment.SetFeather()
  479. self.testAlignment.SetOutline()
  480. self.testAlignment.Show()
  481.  
  482. self.__BuildKeyDict()
  483. self.__BuildDebugInfo()
  484.  
  485. # PRIVATE_SHOP_PRICE_LIST
  486. uiPrivateShopBuilder.Clear()
  487. # END_OF_PRIVATE_SHOP_PRICE_LIST
  488.  
  489. if app.WJ_OFFLINESHOP_SYSTEM:
  490. uiOfflineShopBuilder.Clear()
  491.  
  492. # UNKNOWN_UPDATE
  493. exchange.InitTrading()
  494. # END_OF_UNKNOWN_UPDATE
  495.  
  496.  
  497. ## Sound
  498. snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  499. snd.SetSoundVolume(systemSetting.GetSoundVolume())
  500.  
  501. netFieldMusicFileName = net.GetFieldMusicFileName()
  502. if netFieldMusicFileName:
  503. snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  504. elif musicInfo.fieldMusic != "":
  505. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  506.  
  507. self.__SetQuickSlotMode()
  508. self.__SelectQuickPage(self.quickSlotPageIndex)
  509.  
  510. self.SetFocus()
  511. self.Show()
  512. app.ShowCursor()
  513.  
  514. net.SendEnterGamePacket()
  515.  
  516. if app.WJ_SECURITY_SYSTEM:
  517. if constInfo.open_security == 0:
  518. net.SendChatPacket("/open_security")
  519. constInfo.open_security = 1
  520.  
  521. if app.PARTY_MATCH:
  522. constInfo.KILITLE = 0
  523.  
  524. # START_GAME_ERROR_EXIT
  525. try:
  526. self.StartGame()
  527. except:
  528. import exception
  529. exception.Abort("GameWindow.Open")
  530. # END_OF_START_GAME_ERROR_EXIT
  531.  
  532. # NPC가 큐브시스템으로 만들 수 있는 아이템들의 목록을 캐싱
  533. # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ]
  534. self.cubeInformation = {}
  535. self.currentCubeNPC = 0
  536. if app.ENABLE_FOG_FIX:
  537. if systemSetting.IsFogMode():
  538. background.SetEnvironmentFog(True)
  539. else:
  540. background.SetEnvironmentFog(False)
  541.  
  542. for i in xrange(10):
  543. if systemSetting.IsSnowTexturesMode():
  544. if background.GetCurrentMapName():
  545. snow_maps = [
  546. "metin2_map_a1",
  547. "metin2_map_b1",
  548. "metin2_map_c1"
  549. ]
  550. snow_maps_textures = {
  551. "metin2_map_a1" : "textureset\metin2_a1_desert.txt",
  552. "metin2_map_b1" : "textureset\metin2_b1_desert.txt",
  553. "metin2_map_c1" : "textureset\metin2_c1_desert.txt", }
  554. if str(background.GetCurrentMapName()) in snow_maps:
  555. background.TextureChange(snow_maps_textures[str(background.GetCurrentMapName())])
  556.  
  557. def Close(self):
  558. self.Hide()
  559. #AKIRA_EVENT_SYSTEM
  560. self.akiraEventButton.Hide()
  561. #END_OF_AKIRA_EVENT_SYSTEM
  562.  
  563. global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  564. (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  565.  
  566. if musicInfo.fieldMusic != "":
  567. snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  568.  
  569. self.onPressKeyDict = None
  570. self.onClickKeyDict = None
  571. if app.ENABLE_COSTUME_AURA:
  572. self.RefineAura.Hide()
  573. uiPrivateShopBuilder.Clear()
  574.  
  575. chat.Close()
  576. # self.menu_bg.Hide()
  577. # self.Dezactivare_Menu.Hide()
  578. # self.Activare_Menu.Hide()
  579. # self.menu_bg2.Hide()
  580. # self.Dezactivare_Menu2.Hide()
  581. # self.Activare_Menu2.Hide()
  582. snd.StopAllSound()
  583. grp.InitScreenEffect()
  584. chr.Destroy()
  585. textTail.Clear()
  586. quest.Clear()
  587. background.Destroy()
  588. guild.Destroy()
  589. messenger.Destroy()
  590. skill.ClearSkillData()
  591. wndMgr.Unlock()
  592. mouseModule.mouseController.DeattachObject()
  593.  
  594. if self.guildWarQuestionDialog:
  595. self.guildWarQuestionDialog.Close()
  596.  
  597. if self.oyunicisiralama.IsShow():
  598. self.oyunicisiralama.Open()
  599.  
  600. if self.loncasiralama.IsShow():
  601. self.loncasiralama.Open()
  602.  
  603. if self.recordscreen.IsShow():
  604. self.recordscreen.Open()
  605.  
  606. if self.loncanitanit.IsShow():
  607. self.loncanitanit.Open()
  608.  
  609. self.guildNameBoard = None
  610. self.partyRequestQuestionDialog = None
  611. self.warPlayerCheckQuestionDialog = None
  612. self.partyInviteQuestionDialog = None
  613. self.guildInviteQuestionDialog = None
  614. self.guildWarQuestionDialog = None
  615. self.messengerAddFriendQuestion = None
  616.  
  617. # UNKNOWN_UPDATE
  618. self.itemDropQuestionDialog = None
  619. # END_OF_UNKNOWN_UPDATE
  620.  
  621. # QUEST_CONFIRM
  622. self.confirmDialog = None
  623. # END_OF_QUEST_CONFIRM
  624. if app.TOURNAMENT_PVP_SYSTEM:
  625. constInfo.TOURNAMENT_WINDOW_IS_SHOWED = 0
  626.  
  627.  
  628. self.PrintCoord = None
  629. self.FrameRate = None
  630. self.Pitch = None
  631. self.Splat = None
  632. self.TextureNum = None
  633. self.ObjectNum = None
  634. self.ViewDistance = None
  635. self.PrintMousePos = None
  636.  
  637. self.ClearDictionary()
  638.  
  639. if app.ENABLE_SUPPORT_SYSTEM:
  640. self.supportpg.Close()
  641.  
  642. self.petmain.Close()
  643. self.petmini.Close()
  644.  
  645. self.playerGauge = None
  646. self.mapNameShower = None
  647. self.LoncaGecmisi = None
  648. self.affectShower = None
  649.  
  650. #uiPrivateShopBuilder.Clear()
  651.  
  652. if self.SchicksalRad.IsShow():
  653. self.SchicksalRad.Open()
  654.  
  655. if self.MountingSystem.IsShow():
  656. self.MountingSystem.Open()
  657.  
  658. if self.console:
  659. self.console.BindGameClass(0)
  660. self.console.Close()
  661. self.console=None
  662.  
  663. if self.ruhtasi:
  664. self.ruhtasi.Destroy()
  665. self.ruhtasi = None
  666.  
  667. if self.bkoku:
  668. self.bkoku.Destroy()
  669. self.bkoku = None
  670.  
  671. if self.npcekran:
  672. self.npcekran.Destroy()
  673. self.npcekran = None
  674.  
  675. if self.targetBoard:
  676. self.targetBoard.Destroy()
  677. self.targetBoard = None
  678. if app.ENABLE_TICKET_SYSTEM:
  679. if self.wndTicket:
  680. self.wndTicket.Hide()
  681.  
  682. if self.wndTicketReply:
  683. self.wndTicketReply.Hide()
  684.  
  685. if self.wndTicketStaff:
  686. self.wndTicketStaff.Hide()
  687. if (app.WJ_COMBAT_ZONE):
  688. if self.wndCombatZone:
  689. self.wndCombatZone.Close()
  690. if app.ENABLE_ADMIN_BAN_MANAGER:
  691. if self.wndAdminTool:
  692. self.wndAdminTool.Hide()
  693. if self.wndMarbleShop:
  694. self.wndMarbleShop.Hide()
  695. # if app.ENABLE_TITLE_SYSTEM:
  696. # self.wndTitleSystem.Close()
  697. if app.ENABLE_REBORN_SYSTEM:
  698. if self.wndReborn.IsShow():
  699. self.wndReborn.Hide()
  700.  
  701. if app.ENABLE_MAINTENANCE_SYSTEM:
  702. if self.wndMaintenance.IsShow():
  703. self.wndMaintenance.Hide()
  704.  
  705. if self.itemShopWnd:
  706. self.itemShopWnd.Destroy()
  707. self.itemShopWnd = None
  708. if self.interface:
  709. self.interface.HideAllWindows()
  710. self.interface.Close()
  711. self.interface=None
  712.  
  713. for i in xrange(len(self.boniSwitcherWnd)):
  714. if self.boniSwitcherWnd[i]:
  715. self.boniSwitcherWnd[i].Destroy()
  716. self.boniSwitcherWnd[i] = None
  717. if self.petInventoryWnd:
  718. self.petInventoryWnd.Destroy()
  719. self.petInventoryWnd = None
  720. player.ClearSkillDict()
  721. player.ResetCameraRotation()
  722.  
  723. self.KillFocus()
  724. app.HideCursor()
  725.  
  726. print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  727.  
  728. def biyoodulac(self, gorev, af1, afv1, af2, afv2, af3, afv3):
  729. self.biyoekran.Show()
  730. self.biyoekran.SetBaslik(str(gorev))
  731. self.biyoekran.SetOdul(af1,afv1,af2,afv2,af3,afv3)
  732.  
  733. def biyologekrankapa(self):
  734. self.biyoekran.Close()
  735.  
  736. def biyolog(self, bioitem, verilen, toplam, kalansure):
  737. self.interface.SetBiyolog(bioitem, verilen, toplam, kalansure)
  738.  
  739. def ruhcac(self):
  740. self.ruhtasi.Show()
  741.  
  742. def bkac(self):
  743. self.bkoku.Show()
  744.  
  745. def npcac(self):
  746. self.npcekran.Show()
  747.  
  748. def __BuildKeyDict(self):
  749. onPressKeyDict = {}
  750.  
  751. ##PressKey 는 누르고 있는 동안 계속 적용되는 키이다.
  752.  
  753. ## 숫자 단축키 퀵슬롯에 이용된다.(이후 숫자들도 퀵 슬롯용 예약)
  754. ## F12 는 클라 디버그용 키이므로 쓰지 않는 게 좋다.
  755. onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(1)
  756. onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(2)
  757. onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(3)
  758. onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(4)
  759. onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5)
  760. onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6)
  761. onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7)
  762. onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8)
  763. onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9)
  764. onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(4)
  765. onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(5)
  766. onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(6)
  767. onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
  768.  
  769. #if app.ENABLE_SWITCHER_MIJAGO:
  770. # onPressKeyDict[app.DIK_F5] = lambda : self.__toggleSwitchbot()
  771. #if app.ENABLE_TITLE_SYSTEM:
  772. # onPressKeyDict[app.DIK_F5] = lambda : self.OpenTitleSystem()
  773. #onPressKeyDict[app.DIK_F5] = lambda : self.npcac()#UZAKTAN NPC
  774. #onPressKeyDict[app.DIK_F6] = lambda : self.recordac()#BOSS SIRALAMA
  775. #onPressKeyDict[app.DIK_F6] = lambda : self.siralamaopen()#OYUNCU SIRALAMA
  776. #onPressKeyDict[app.DIK_F7] = lambda : self.loncasiralamaopen()#LONCA SIRALAMA
  777. #onPressKeyDict[app.DIK_F8] = lambda : self.lonca_tanitim()#LONCA TANITIMI
  778. #if app.ENABLE_ADMIN_BAN_MANAGER:
  779. # onPressKeyDict[app.DIK_F9] = lambda : self.OpenAdminTool()
  780. #onPressKeyDict[app.DIK_TAB] = lambda : self.LoncaIstatistikOpen()
  781.  
  782. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  783. onPressKeyDict[app.DIK_5] = lambda : self.__PressNumNewKey(5)
  784. onPressKeyDict[app.DIK_6] = lambda : self.__PressNumNewKey(6)
  785. onPressKeyDict[app.DIK_7] = lambda : self.__PressNumNewKey(7)
  786. onPressKeyDict[app.DIK_8] = lambda : self.__PressNumNewKey(8)
  787.  
  788. onPressKeyDict[app.DIK_F5] = lambda : self.__PressNewQuickSlot(4)
  789. onPressKeyDict[app.DIK_F6] = lambda : self.__PressNewQuickSlot(5)
  790. onPressKeyDict[app.DIK_F7] = lambda : self.__PressNewQuickSlot(6)
  791. onPressKeyDict[app.DIK_F8] = lambda : self.__PressNewQuickSlot(7)
  792.  
  793. onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()
  794. onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage()
  795. onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen()
  796. onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack()
  797.  
  798. #캐릭터 이동키
  799. onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp()
  800. onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown()
  801. onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft()
  802. onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight()
  803. onPressKeyDict[app.DIK_W] = lambda : self.MoveUp()
  804. onPressKeyDict[app.DIK_S] = lambda : self.MoveDown()
  805. onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft()
  806. onPressKeyDict[app.DIK_D] = lambda : self.MoveRight()
  807.  
  808. onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  809. onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  810. #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  811. onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  812. onPressKeyDict[app.DIK_G] = self.__PressGKey
  813. onPressKeyDict[app.DIK_Q] = self.__PressQKey
  814.  
  815. onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera()
  816. onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  817. onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  818. onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  819. onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  820. onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  821. onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  822. onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem()
  823. onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem()
  824. #onPressKeyDict[app.DIK_X] = lambda: self.interface.ToggleBonusWindow()
  825. onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  826. onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  827. #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  828. onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  829. onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo()
  830. onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow()
  831. onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey()
  832. #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow()
  833. onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp()
  834. onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown()
  835. onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow()
  836. #onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key
  837. onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode()
  838.  
  839. onPressKeyDict[app.DIK_J] = lambda : self.__PressJKey()
  840. onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey()
  841. onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey()
  842. onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
  843.  
  844. if app.WJ_SPLIT_INVENTORY_SYSTEM:
  845. onPressKeyDict[app.DIK_K] = lambda : self.__PressExtendedInventory()
  846.  
  847. #onPressKeyDict[app.DIK_B] = lambda : self.test()
  848. #onPressKeyDict[app.DIK_X] = lambda : self.OtomatikAv()
  849.  
  850. # CUBE_TEST
  851. #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow()
  852. # CUBE_TEST_END
  853.  
  854. self.onPressKeyDict = onPressKeyDict
  855.  
  856. onClickKeyDict = {}
  857. onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  858. onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  859. onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  860. onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  861. onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  862.  
  863. onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  864. onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  865. onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  866. onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  867. onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  868. onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  869. onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  870. onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  871. onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  872. onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  873. onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  874. onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  875. onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  876. onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  877. onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  878. onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  879. onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  880. onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  881. onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  882. onClickKeyDict[app.DIK_P] = lambda: self.OpenPetMainGui()
  883. if app.ENABLE_SUPPORT_SYSTEM:
  884. onClickKeyDict[app.DIK_Y] = lambda: self.OpenSupportGui()
  885.  
  886. #if constInfo.PVPMODE_ACCELKEY_ENABLE:
  887. # onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode()
  888.  
  889. self.onClickKeyDict=onClickKeyDict
  890.  
  891. if app.WJ_SPLIT_INVENTORY_SYSTEM:
  892. def __PressExtendedInventory(self):
  893. if self.interface:
  894. self.interface.ToggleExtendedInventoryWindow()
  895.  
  896. def __PressNumKey(self,num):
  897. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  898.  
  899. if num >= 1 and num <= 9:
  900. if(chrmgr.IsPossibleEmoticon(-1)):
  901. chrmgr.SetEmoticon(-1,int(num)-1)
  902. net.SendEmoticon(int(num)-1)
  903. else:
  904. if num >= 1 and num <= 4:
  905. self.pressNumber(num-1)
  906.  
  907. def __ClickBKey(self):
  908. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  909. return
  910. else:
  911. if constInfo.PVPMODE_ACCELKEY_ENABLE:
  912. self.ChangePKMode()
  913.  
  914.  
  915. def __PressJKey(self):
  916. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  917. if player.IsMountingHorse():
  918. net.SendChatPacket("/unmount")
  919. else:
  920. if not uiPrivateShopBuilder.IsBuildingPrivateShop() or not uiOfflineShopBuilder.IsBuildingOfflineShop():
  921. if app.ENABLE_MOUNT_SYSTEM:
  922. for i in xrange(player.INVENTORY_PAGE_SIZE * 4):
  923. index = player.GetItemIndex(i)
  924. if index:
  925. item.SelectItem(index)
  926. subType = item.GetItemSubType()
  927. if subType == item.USE_MOUNT:
  928. allow = 0
  929. net.SendItemUsePacket(i)
  930. break
  931. else:
  932. for i in xrange(player.INVENTORY_PAGE_SIZE * 4):
  933. if player.GetItemIndex(i) in (52043, 52044, 52045, 71164, 71165, 71166, 71167, 71168, 52091, 52092, 52093, 52094, 52095, 52096, 52097, 52098, 71161, 71131, 52033, 52005, 52019, 71176, 71177):
  934. net.SendItemUsePacket(i)
  935. break
  936. def __PressHKey(self):
  937. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  938. net.SendChatPacket("/user_horse_ride")
  939. else:
  940. self.interface.OpenHelpWindow()
  941.  
  942. def __PressBKey(self):
  943. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  944. net.SendChatPacket("/user_horse_back")
  945. else:
  946. state = "EMOTICON"
  947. self.interface.ToggleCharacterWindow(state)
  948.  
  949. def __PressFKey(self):
  950. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  951. net.SendChatPacket("/user_horse_feed")
  952. else:
  953. app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  954.  
  955. def __PressGKey(self):
  956. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  957. net.SendChatPacket("/user_mount_ride")
  958. else:
  959. if self.ShowNameFlag:
  960. self.interface.ToggleGuildWindow()
  961. else:
  962. app.PitchCamera(app.CAMERA_TO_POSITIVE)
  963.  
  964. """def __PressGKey(self):
  965. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  966. if player.IsMountingHorse():
  967. net.SendChatPacket("/ride")
  968. else:
  969. if not uiPrivateShopBuilder.IsBuildingPrivateShop():
  970. if app.ENABLE_MOUNT_SYSTEM:
  971. for i in xrange(player.INVENTORY_PAGE_SIZE * 4):
  972. index = player.GetItemIndex(i)
  973. if index:
  974. item.SelectItem(index)
  975. subType = item.GetItemSubType()
  976. if subType == item.USE_MOUNT:
  977. allow = 0
  978. net.SendItemUsePacket(i)
  979. break
  980. else:
  981. for i in xrange(player.INVENTORY_PAGE_SIZE * 4):
  982. if player.GetItemIndex(i) in (52043, 52044, 52045, 71164, 71165, 71166, 71167, 71168, 52091, 52092, 52093, 52094, 52095, 52096, 52097, 52098, 71161, 71131, 52033, 52005, 52019, 71176, 71177):
  983. net.SendItemUsePacket(i)
  984. break
  985. else:
  986. app.PitchCamera(app.CAMERA_TO_POSITIVE)"""
  987.  
  988. def __ReleaseGKey(self):
  989. app.PitchCamera(app.CAMERA_STOP)
  990.  
  991. # if app.ENABLE_TITLE_SYSTEM:
  992. # def OpenTitleSystem(self):
  993. # self.wndTitleSystem.OpenWindow()
  994.  
  995. if app.ENABLE_ADMIN_BAN_MANAGER:
  996. def OpenAdminTool(self):
  997. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): # Open window with CTRL + F5
  998. if self.wndAdminTool.IsShow():
  999. self.wndAdminTool.Hide()
  1000. else:
  1001. self.wndAdminTool.Show()
  1002.  
  1003. def __PressQKey(self):
  1004. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  1005. if 0==interfaceModule.IsQBHide:
  1006. interfaceModule.IsQBHide = 1
  1007. self.interface.HideAllQuestButton()
  1008. else:
  1009. interfaceModule.IsQBHide = 0
  1010. self.interface.ShowAllQuestButton()
  1011. else:
  1012. app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  1013.  
  1014. def __PressJKey(self):
  1015. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  1016. if player.IsmountingHorse():
  1017. net.SendChatPacket("/unmount")
  1018. else:
  1019. self.teleport.Open()
  1020.  
  1021. def __SetQuickSlotMode(self):
  1022. self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  1023.  
  1024. def __SetQuickPageMode(self):
  1025. self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  1026.  
  1027. def __PressQuickSlot(self, localSlotIndex):
  1028. if localeInfo.IsARABIC():
  1029. if 0 <= localSlotIndex and localSlotIndex < 4:
  1030. player.RequestUseLocalQuickSlot(3-localSlotIndex)
  1031. else:
  1032. player.RequestUseLocalQuickSlot(11-localSlotIndex)
  1033. else:
  1034. player.RequestUseLocalQuickSlot(localSlotIndex)
  1035.  
  1036. def __SelectQuickPage(self, pageIndex):
  1037. self.quickSlotPageIndex = pageIndex
  1038. player.SetQuickPage(pageIndex)
  1039.  
  1040. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  1041. def __PressNumNewKey(self, key):
  1042. if key > 8:
  1043. return
  1044. if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  1045.  
  1046. if key >= 5 and key <= 8:
  1047. if(chrmgr.IsPossibleEmoticon(- 1)):
  1048. chrmgr.SetEmoticon(- 1, int(key) - 1)
  1049. net.SendEmoticon(int(key) - 1)
  1050. else:
  1051. self.pressNewNumber((key - 1) - 4)
  1052.  
  1053. def __SetNewQuickSlotMode(self):
  1054. self.pressNewNumber = ui.__mem_func__(self.__PressNewQuickSlot)
  1055.  
  1056. def __SetNewQuickPageMode(self):
  1057. self.pressNewNumber = ui.__mem_func__(self.__SelectNewQuickPage)
  1058.  
  1059. def __PressNewQuickSlot(self, localSlotIndex):
  1060. player.RequestUseLocalNewQuickSlot(localSlotIndex)
  1061.  
  1062. def __SelectNewQuickPage(self, pageIndex):
  1063. self.newquickSlotPageIndex = pageIndex
  1064. player.SetNewQuickPage(pageIndex)
  1065.  
  1066. def ToggleDebugInfo(self):
  1067. self.isShowDebugInfo = not self.isShowDebugInfo
  1068.  
  1069. if self.isShowDebugInfo:
  1070. self.PrintCoord.Show()
  1071. self.FrameRate.Show()
  1072. self.Pitch.Show()
  1073. self.Splat.Show()
  1074. self.TextureNum.Show()
  1075. self.ObjectNum.Show()
  1076. self.ViewDistance.Show()
  1077. self.PrintMousePos.Show()
  1078. else:
  1079. self.PrintCoord.Hide()
  1080. self.FrameRate.Hide()
  1081. self.Pitch.Hide()
  1082. self.Splat.Hide()
  1083. self.TextureNum.Hide()
  1084. self.ObjectNum.Hide()
  1085. self.ViewDistance.Hide()
  1086. self.PrintMousePos.Hide()
  1087.  
  1088. def __BuildDebugInfo(self):
  1089. ## Character Position Coordinate
  1090. self.PrintCoord = ui.TextLine()
  1091. self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
  1092. self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  1093.  
  1094. ## Frame Rate
  1095. self.FrameRate = ui.TextLine()
  1096. self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  1097. self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  1098.  
  1099. ## Camera Pitch
  1100. self.Pitch = ui.TextLine()
  1101. self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
  1102. self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  1103.  
  1104. ## Splat
  1105. self.Splat = ui.TextLine()
  1106. self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
  1107. self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  1108.  
  1109. ##
  1110. self.PrintMousePos = ui.TextLine()
  1111. self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
  1112. self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  1113.  
  1114. # TextureNum
  1115. self.TextureNum = ui.TextLine()
  1116. self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
  1117. self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  1118.  
  1119. # 오브젝트 그리는 개수
  1120. self.ObjectNum = ui.TextLine()
  1121. self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
  1122. self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
  1123.  
  1124. # 시야거리
  1125. self.ViewDistance = ui.TextLine()
  1126. self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
  1127. self.ViewDistance.SetPosition(0, 0)
  1128.  
  1129. def __NotifyError(self, msg):
  1130. chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  1131.  
  1132. def ChangePKMode(self):
  1133.  
  1134. if not app.IsPressed(app.DIK_LCONTROL):
  1135. return
  1136.  
  1137. if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  1138. self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  1139. return
  1140.  
  1141. curTime = app.GetTime()
  1142. if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  1143. return
  1144.  
  1145. self.lastPKModeSendedTime = curTime
  1146.  
  1147. curPKMode = player.GetPKMode()
  1148. nextPKMode = curPKMode + 1
  1149. if nextPKMode == player.PK_MODE_PROTECT:
  1150. if 0 == player.GetGuildID():
  1151. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  1152. nextPKMode = 0
  1153. else:
  1154. nextPKMode = player.PK_MODE_GUILD
  1155.  
  1156. elif nextPKMode == player.PK_MODE_MAX_NUM:
  1157. nextPKMode = 0
  1158.  
  1159. net.SendChatPacket("/PKMode " + str(nextPKMode))
  1160. print "/PKMode " + str(nextPKMode)
  1161.  
  1162. def OnChangePKMode(self):
  1163.  
  1164. self.interface.OnChangePKMode()
  1165.  
  1166. try:
  1167. self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  1168. except KeyError:
  1169. print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  1170.  
  1171. if constInfo.PVPMODE_TEST_ENABLE:
  1172. curPKMode = player.GetPKMode()
  1173. alignment, grade = chr.testGetPKData()
  1174. self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  1175. self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  1176. self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + localeInfo.TITLE_NAME_LIST[grade] + ")")
  1177.  
  1178. ###############################################################################################
  1179. ###############################################################################################
  1180. ## Game Callback Functions
  1181.  
  1182. # Start
  1183. def StartGame(self):
  1184. self.RefreshInventory()
  1185. self.RefreshEquipment()
  1186. self.RefreshCharacter()
  1187. self.RefreshSkill()
  1188. szNameValue = "[%s]" % (player.GetName())
  1189. app.SetTitle(szNameValue)
  1190.  
  1191. # Refresh
  1192. def CheckGameButton(self):
  1193. if self.interface:
  1194. self.interface.CheckGameButton()
  1195.  
  1196. def RefreshAlignment(self):
  1197. self.interface.RefreshAlignment()
  1198.  
  1199. if app.WJ_SHOW_ALL_CHANNEL:
  1200. def BINARY_OnChannelPacket(self, channel):
  1201. import net
  1202. server_name = net.GetServerInfo().split(" - ")[0]
  1203. net.SetServerInfo((localeInfo.TEXT_CHANNEL % (server_name, channel)).strip())
  1204. if self.interface:
  1205. self.interface.wndMiniMap.serverInfo.SetText(net.GetServerInfo())
  1206.  
  1207. def RefreshStatus(self):
  1208. self.CheckGameButton()
  1209.  
  1210. if self.interface:
  1211. self.interface.RefreshStatus()
  1212.  
  1213. if self.playerGauge:
  1214. self.playerGauge.RefreshGauge()
  1215.  
  1216. def RefreshStamina(self):
  1217. self.interface.RefreshStamina()
  1218.  
  1219. def RefreshSkill(self):
  1220. self.CheckGameButton()
  1221. if self.interface:
  1222. self.interface.RefreshSkill()
  1223.  
  1224. def RefreshQuest(self):
  1225. self.interface.RefreshQuest()
  1226.  
  1227. def RefreshMessenger(self):
  1228. self.interface.RefreshMessenger()
  1229.  
  1230. def RefreshGuildInfoPage(self):
  1231. self.interface.RefreshGuildInfoPage()
  1232.  
  1233. def RefreshGuildBoardPage(self):
  1234. self.interface.RefreshGuildBoardPage()
  1235.  
  1236. def RefreshGuildMemberPage(self):
  1237. self.interface.RefreshGuildMemberPage()
  1238.  
  1239. def RefreshGuildMemberPageGradeComboBox(self):
  1240. self.interface.RefreshGuildMemberPageGradeComboBox()
  1241.  
  1242. def RefreshGuildSkillPage(self):
  1243. self.interface.RefreshGuildSkillPage()
  1244.  
  1245. def RefreshGuildGradePage(self):
  1246. self.interface.RefreshGuildGradePage()
  1247.  
  1248. def RefreshMobile(self):
  1249. if self.interface:
  1250. self.interface.RefreshMobile()
  1251.  
  1252. def OnMobileAuthority(self):
  1253. self.interface.OnMobileAuthority()
  1254.  
  1255. def OnBlockMode(self, mode):
  1256. self.interface.OnBlockMode(mode)
  1257.  
  1258. def OpenQuestWindow(self, skin, idx):
  1259. if constInfo.CApiSetHide == 1:
  1260. net.SendQuestInputStringPacket(str(constInfo.SendString))
  1261. constInfo.CApiSetHide = 0
  1262. return
  1263.  
  1264. if constInfo.INPUT_IGNORE == 1:
  1265. return
  1266.  
  1267. self.interface.OpenQuestWindow(skin, idx)
  1268.  
  1269. def Mozart(self, data):
  1270. dane = data.split("|")
  1271. constInfo.PLAYER_NAME = str(dane[0])
  1272. constInfo.PLAYER_HP = int(dane[1])
  1273. constInfo.PLAYER_MAX_HP = int(dane[2])
  1274. constInfo.PLAYER_SP = int(dane[3])
  1275. constInfo.PLAYER_MAX_SP = int(dane[4])
  1276.  
  1277. def Tabulejtor(self, id):
  1278. constInfo.STHX = int(id)
  1279.  
  1280. def GetInputOn(self):
  1281. constInfo.INPUT_IGNORE = 1
  1282.  
  1283. def GetInputOff(self):
  1284. constInfo.INPUT_IGNORE = 0
  1285.  
  1286. def GetInputValue(self):
  1287. net.SendQuestInputStringPacket(str(constInfo.VID))
  1288.  
  1289. def OpenQuestWindow(self, skin, idx):
  1290. if constInfo.INPUT_IGNORE == 1:
  1291. return
  1292. else:
  1293. self.interface.OpenQuestWindow(skin, idx)
  1294.  
  1295.  
  1296. def __teleporttahtasi(self):
  1297. if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate():
  1298. return
  1299. import uiisinlanma
  1300. self.isinlanmaxd = uiisinlanma.Isinlanma()
  1301. self.isinlanmaxd.Show()
  1302.  
  1303. def AskGuildName(self):
  1304.  
  1305. guildNameBoard = uiCommon.InputDialog()
  1306. guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
  1307. guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  1308. guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  1309. guildNameBoard.Open()
  1310.  
  1311. self.guildNameBoard = guildNameBoard
  1312.  
  1313. def ConfirmGuildName(self):
  1314. guildName = self.guildNameBoard.GetText()
  1315. if not guildName:
  1316. return
  1317.  
  1318. if net.IsInsultIn(guildName):
  1319. self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
  1320. return
  1321.  
  1322. net.SendAnswerMakeGuildPacket(guildName)
  1323. self.guildNameBoard.Close()
  1324. self.guildNameBoard = None
  1325. return TRUE
  1326.  
  1327. def CancelGuildName(self):
  1328. self.guildNameBoard.Close()
  1329. self.guildNameBoard = None
  1330. return TRUE
  1331.  
  1332. ## Refine
  1333. def PopupMessage(self, msg):
  1334. self.stream.popupWindow.Close()
  1335. self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
  1336.  
  1337. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  1338. self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  1339.  
  1340. def AppendMaterialToRefineDialog(self, vnum, count):
  1341. self.interface.AppendMaterialToRefineDialog(vnum, count)
  1342.  
  1343. def RunUseSkillEvent(self, slotIndex, coolTime):
  1344. self.interface.OnUseSkill(slotIndex, coolTime)
  1345.  
  1346. def ClearAffects(self):
  1347. self.affectShower.ClearAffects()
  1348.  
  1349. def SetAffect(self, affect):
  1350. self.affectShower.SetAffect(affect)
  1351.  
  1352. def ResetAffect(self, affect):
  1353. self.affectShower.ResetAffect(affect)
  1354.  
  1355. # UNKNOWN_UPDATE
  1356. def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  1357. #chat.AppendChat(chat.CHAT_TYPE_INFO, "type: %s | pointIdx: %s | value: %s | duration: %s" % (str(type), str(pointIdx), str(value), str(duration)))
  1358. self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  1359. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  1360. self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
  1361. elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
  1362. self.BINARY_DragonSoulGiveQuilification()
  1363.  
  1364. def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  1365. self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  1366. if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  1367. self.interface.DragonSoulDeactivate()
  1368.  
  1369.  
  1370.  
  1371. # END_OF_UNKNOWN_UPDATE
  1372.  
  1373. def ActivateSkillSlot(self, slotIndex):
  1374. if self.interface:
  1375. self.interface.OnActivateSkill(slotIndex)
  1376.  
  1377. def DeactivateSkillSlot(self, slotIndex):
  1378. if self.interface:
  1379. self.interface.OnDeactivateSkill(slotIndex)
  1380.  
  1381. def RefreshEquipment(self):
  1382. if self.interface:
  1383. self.interface.RefreshInventory()
  1384.  
  1385. def RefreshInventory(self):
  1386. if self.interface:
  1387. self.interface.RefreshInventory()
  1388.  
  1389. def RefreshCharacter(self):
  1390. if self.interface:
  1391. self.interface.RefreshCharacter()
  1392.  
  1393. def OnGameOver(self):
  1394. self.CloseTargetBoard()
  1395. self.OpenRestartDialog()
  1396.  
  1397. def OpenRestartDialog(self):
  1398. self.interface.OpenRestartDialog()
  1399.  
  1400. def ChangeCurrentSkill(self, skillSlotNumber):
  1401. self.interface.OnChangeCurrentSkill(skillSlotNumber)
  1402.  
  1403. if app.WJ_SHOW_STROKE_INFO:
  1404. def RegisterStroke(self, targetVID, value):
  1405. self.targetBoard.RegisterStroke(targetVID, value)
  1406.  
  1407. ## TargetBoard
  1408. def SetPCTargetBoard(self, vid, name):
  1409. self.targetBoard.Open(vid, name)
  1410.  
  1411. if app.IsPressed(app.DIK_LCONTROL):
  1412.  
  1413. if not player.IsSameEmpire(vid):
  1414. return
  1415.  
  1416. if player.IsMainCharacterIndex(vid):
  1417. return
  1418. elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  1419. return
  1420.  
  1421. self.interface.OpenWhisperDialog(name)
  1422.  
  1423.  
  1424. def RefreshTargetBoardByVID(self, vid):
  1425. self.targetBoard.RefreshByVID(vid)
  1426.  
  1427. def RefreshTargetBoardByName(self, name):
  1428. self.targetBoard.RefreshByName(name)
  1429.  
  1430. def __RefreshTargetBoard(self):
  1431. self.targetBoard.Refresh()
  1432.  
  1433. if app.ENABLE_VIEW_TARGET_DECIMAL_HP and app.ENABLE_VIEW_ELEMENT:
  1434. def SetHPTargetBoard(self, vid, hpPercentage, iMinHP, iMaxHP, bElement):
  1435. if vid != self.targetBoard.GetTargetVID():
  1436. self.targetBoard.ResetTargetBoard()
  1437. self.targetBoard.SetEnemyVID(vid)
  1438.  
  1439. self.targetBoard.SetHP(hpPercentage, iMinHP, iMaxHP)
  1440. self.targetBoard.SetElementImage(bElement)
  1441. self.targetBoard.Show()
  1442. else:
  1443. def SetHPTargetBoard(self, vid, hpPercentage):
  1444. if vid != self.targetBoard.GetTargetVID():
  1445. self.targetBoard.ResetTargetBoard()
  1446. self.targetBoard.SetEnemyVID(vid)
  1447.  
  1448. self.targetBoard.SetHP(hpPercentage)
  1449. self.targetBoard.Show()
  1450.  
  1451. def CloseTargetBoardIfDifferent(self, vid):
  1452. if vid != self.targetBoard.GetTargetVID():
  1453. self.targetBoard.Close()
  1454.  
  1455. def CloseTargetBoard(self):
  1456. self.targetBoard.Close()
  1457.  
  1458. ## View Equipment
  1459. def OpenEquipmentDialog(self, vid):
  1460. self.interface.OpenEquipmentDialog(vid)
  1461.  
  1462. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  1463. self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  1464.  
  1465. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  1466. self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  1467.  
  1468. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  1469. self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  1470.  
  1471. # SHOW_LOCAL_MAP_NAME
  1472. def ShowMapName(self, mapName, x, y):
  1473.  
  1474. if self.mapNameShower:
  1475. self.mapNameShower.ShowMapName(mapName, x, y)
  1476.  
  1477. if self.interface:
  1478. self.interface.SetMapName(mapName)
  1479. # END_OF_SHOW_LOCAL_MAP_NAME
  1480.  
  1481. def BINARY_OpenAtlasWindow(self):
  1482. self.interface.BINARY_OpenAtlasWindow()
  1483.  
  1484. ## Chat
  1485. def OnRecvWhisper(self, mode, name, line):
  1486. if mode == chat.WHISPER_TYPE_GM:
  1487. self.interface.RegisterGameMasterName(name)
  1488. chat.AppendWhisper(mode, name, line)
  1489. self.interface.RecvWhisper(name)
  1490.  
  1491. def OnRecvWhisperSystemMessage(self, mode, name, line):
  1492. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  1493. self.interface.RecvWhisper(name)
  1494.  
  1495. def OnRecvWhisperError(self, mode, name, line):
  1496. if localeInfo.WHISPER_ERROR.has_key(mode):
  1497. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
  1498. else:
  1499. chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  1500. self.interface.RecvWhisper(name)
  1501.  
  1502. def RecvWhisper(self, name):
  1503. self.interface.RecvWhisper(name)
  1504.  
  1505. #def OnPickMoney(self, money):
  1506. #chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_MONEY % (money))
  1507. #chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.PrettyNumber(money) + localeInfo.GAME_PICK_MONEY)
  1508.  
  1509. #YangDrop
  1510. def OnPickMoney(self, money):
  1511. if constInfo.YangDrop == 1:
  1512. #chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_MONEY % (money))
  1513. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.PrettyNumber(money) + localeInfo.GAME_PICK_MONEY)
  1514. else:
  1515. return
  1516. #YangDrop
  1517.  
  1518. if app.ENABLE_CHEQUE_SYSTEM:
  1519. def OnPickCheque(self, cheque):
  1520. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHEQUE_SYSTEM_PICK_WON % (cheque))
  1521.  
  1522. def OnShopError(self, type):
  1523. try:
  1524. self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
  1525. except KeyError:
  1526. self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
  1527.  
  1528. def OnSafeBoxError(self):
  1529. self.PopupMessage(localeInfo.SAFEBOX_ERROR)
  1530.  
  1531. def OnFishingSuccess(self, isFish, fishName):
  1532. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
  1533.  
  1534. # ADD_FISHING_MESSAGE
  1535. def OnFishingNotifyUnknown(self):
  1536. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
  1537.  
  1538. def OnFishingWrongPlace(self):
  1539. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
  1540. # END_OF_ADD_FISHING_MESSAGE
  1541.  
  1542. def OnFishingNotify(self, isFish, fishName):
  1543. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
  1544.  
  1545. def OnFishingFailure(self):
  1546. chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
  1547.  
  1548. def OnCannotPickItem(self):
  1549. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
  1550.  
  1551. # MINING
  1552. def OnCannotMining(self):
  1553. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
  1554. # END_OF_MINING
  1555.  
  1556. def OnCannotUseSkill(self, vid, type):
  1557. if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  1558. textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
  1559.  
  1560. if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  1561. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type])
  1562.  
  1563. def OnCannotShotError(self, vid, type):
  1564. textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
  1565.  
  1566. ## PointReset
  1567. def StartPointReset(self):
  1568. self.interface.OpenPointResetDialog()
  1569.  
  1570. ## Shop
  1571. if (app.WJ_COMBAT_ZONE):
  1572. def StartShop(self, vid, points, curLimit, maxLimit):
  1573. self.interface.OpenShopDialog(vid, points, curLimit, maxLimit)
  1574. else:
  1575. def StartShop(self, vid):
  1576. self.interface.OpenShopDialog(vid)
  1577.  
  1578. def EndShop(self):
  1579. self.interface.CloseShopDialog()
  1580.  
  1581. def RefreshShop(self):
  1582. self.interface.RefreshShopDialog()
  1583.  
  1584. def SetShopSellingPrice(self, Price):
  1585. pass
  1586.  
  1587. if app.WJ_OFFLINESHOP_SYSTEM:
  1588. def StartOfflineShop(self, vid):
  1589. if(vid == constInfo.MARKED_SHOP_VID):
  1590. background.DeletePrivateShopPos()
  1591. constInfo.MARKED_SHOP_VID = 0
  1592. self.interface.OpenOfflineShopDialog(vid)
  1593.  
  1594. def EndOfflineShop(self):
  1595. self.interface.CloseOfflineShopDialog()
  1596.  
  1597. def RefreshOfflineShop(self):
  1598. self.interface.RefreshOfflineShopDialog()
  1599.  
  1600. ## Exchange
  1601. def StartExchange(self):
  1602. self.interface.StartExchange()
  1603.  
  1604. def EndExchange(self):
  1605. self.interface.EndExchange()
  1606.  
  1607. def RefreshExchange(self):
  1608. self.interface.RefreshExchange()
  1609.  
  1610. ## Party
  1611. def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1612. partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1613. partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
  1614. partyInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerPartyInvite(arg))
  1615. partyInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerPartyInvite(arg))
  1616. partyInviteQuestionDialog.Open()
  1617. partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1618. self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1619.  
  1620. def AnswerPartyInvite(self, answer):
  1621.  
  1622. if not self.partyInviteQuestionDialog:
  1623. return
  1624.  
  1625. partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1626.  
  1627. distance = player.GetCharacterDistance(partyLeaderVID)
  1628. if distance < 0.0 or distance > 5000:
  1629. answer = FALSE
  1630.  
  1631. net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1632.  
  1633. self.partyInviteQuestionDialog.Close()
  1634. self.partyInviteQuestionDialog = None
  1635.  
  1636. def AddPartyMember(self, pid, name):
  1637. self.interface.AddPartyMember(pid, name)
  1638.  
  1639. def UpdatePartyMemberInfo(self, pid):
  1640. self.interface.UpdatePartyMemberInfo(pid)
  1641.  
  1642. def RemovePartyMember(self, pid):
  1643. self.interface.RemovePartyMember(pid)
  1644. self.__RefreshTargetBoard()
  1645.  
  1646. def LinkPartyMember(self, pid, vid):
  1647. self.interface.LinkPartyMember(pid, vid)
  1648.  
  1649. def UnlinkPartyMember(self, pid):
  1650. self.interface.UnlinkPartyMember(pid)
  1651.  
  1652. def UnlinkAllPartyMember(self):
  1653. self.interface.UnlinkAllPartyMember()
  1654.  
  1655. def ExitParty(self):
  1656. self.interface.ExitParty()
  1657. self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1658.  
  1659. def ChangePartyParameter(self, distributionMode):
  1660. self.interface.ChangePartyParameter(distributionMode)
  1661.  
  1662. ## Messenger
  1663. def OnMessengerAddFriendQuestion(self, name):
  1664. messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1665. messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1666. messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1667. messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1668. messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1669. messengerAddFriendQuestion.Open()
  1670. messengerAddFriendQuestion.name = name
  1671. self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1672.  
  1673. def OnAcceptAddFriend(self):
  1674. name = self.messengerAddFriendQuestion.name
  1675. net.SendChatPacket("/messenger_auth y " + name)
  1676. self.OnCloseAddFriendQuestionDialog()
  1677. return TRUE
  1678.  
  1679. def OnDenyAddFriend(self):
  1680. name = self.messengerAddFriendQuestion.name
  1681. net.SendChatPacket("/messenger_auth n " + name)
  1682. self.OnCloseAddFriendQuestionDialog()
  1683. return TRUE
  1684.  
  1685. def OnCloseAddFriendQuestionDialog(self):
  1686. self.messengerAddFriendQuestion.Close()
  1687. self.messengerAddFriendQuestion = None
  1688. return TRUE
  1689.  
  1690. ## SafeBox
  1691. def OpenSafeboxWindow(self, size):
  1692. self.interface.OpenSafeboxWindow(size)
  1693.  
  1694. def RefreshSafebox(self):
  1695. self.interface.RefreshSafebox()
  1696.  
  1697. def RefreshSafeboxMoney(self):
  1698. self.interface.RefreshSafeboxMoney()
  1699.  
  1700. # ITEM_MALL
  1701. def OpenMallWindow(self, size):
  1702. self.interface.OpenMallWindow(size)
  1703.  
  1704. def RefreshMall(self):
  1705. self.interface.RefreshMall()
  1706. # END_OF_ITEM_MALL
  1707.  
  1708. ## Guild
  1709. def RecvGuildInviteQuestion(self, guildID, guildName):
  1710. guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1711. guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
  1712. guildInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerGuildInvite(arg))
  1713. guildInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerGuildInvite(arg))
  1714. guildInviteQuestionDialog.Open()
  1715. guildInviteQuestionDialog.guildID = guildID
  1716. self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1717.  
  1718. def AnswerGuildInvite(self, answer):
  1719.  
  1720. if not self.guildInviteQuestionDialog:
  1721. return
  1722.  
  1723. guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1724. net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1725.  
  1726. self.guildInviteQuestionDialog.Close()
  1727. self.guildInviteQuestionDialog = None
  1728.  
  1729.  
  1730. def DeleteGuild(self):
  1731. self.interface.DeleteGuild()
  1732.  
  1733. ## Clock
  1734. def ShowClock(self, second):
  1735. self.interface.ShowClock(second)
  1736.  
  1737. def HideClock(self):
  1738. self.interface.HideClock()
  1739.  
  1740. ## Emotion
  1741. def BINARY_ActEmotion(self, emotionIndex):
  1742. if self.interface.wndCharacter:
  1743. self.interface.wndCharacter.ActEmotion(emotionIndex)
  1744.  
  1745. ###############################################################################################
  1746. ###############################################################################################
  1747. ## Keyboard Functions
  1748.  
  1749. def CheckFocus(self):
  1750. if FALSE == self.IsFocus():
  1751. if TRUE == self.interface.IsOpenChat():
  1752. self.interface.ToggleChat()
  1753.  
  1754. self.SetFocus()
  1755.  
  1756. def SaveScreen(self):
  1757. print "save screen"
  1758.  
  1759. # SCREENSHOT_CWDSAVE
  1760. if SCREENSHOT_CWDSAVE:
  1761. if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
  1762. os.mkdir(os.getcwd()+os.sep+"screenshot")
  1763.  
  1764. (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
  1765. elif SCREENSHOT_DIR:
  1766. (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1767. else:
  1768. (succeeded, name) = grp.SaveScreenShot()
  1769. # END_OF_SCREENSHOT_CWDSAVE
  1770.  
  1771. if succeeded:
  1772. pass
  1773. """
  1774. chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1)
  1775. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2)
  1776. """
  1777. else:
  1778. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
  1779.  
  1780. def ShowConsole(self):
  1781. pass
  1782.  
  1783. def ShowName(self):
  1784. self.ShowNameFlag = TRUE
  1785. self.playerGauge.EnableShowAlways()
  1786. player.SetQuickPage(self.quickSlotPageIndex+1)
  1787.  
  1788. # ADD_ALWAYS_SHOW_NAME
  1789. def __IsShowName(self):
  1790.  
  1791. if systemSetting.IsAlwaysShowName():
  1792. return TRUE
  1793.  
  1794. if self.ShowNameFlag:
  1795. return TRUE
  1796.  
  1797. return FALSE
  1798. # END_OF_ADD_ALWAYS_SHOW_NAME
  1799.  
  1800. def HideName(self):
  1801. self.ShowNameFlag = FALSE
  1802. self.playerGauge.DisableShowAlways()
  1803. player.SetQuickPage(self.quickSlotPageIndex)
  1804. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  1805. player.SetNewQuickPage(self.newquickSlotPageIndex)
  1806.  
  1807. def ShowMouseImage(self):
  1808. self.interface.ShowMouseImage()
  1809.  
  1810. def HideMouseImage(self):
  1811. self.interface.HideMouseImage()
  1812.  
  1813. def StartAttack(self):
  1814. MapName = str(background.GetCurrentMapName())
  1815. if MapName == "mapa_guerra" and constInfo.ataque_guerra == 1:
  1816. return
  1817. player.SetAttackKeyState(TRUE)
  1818.  
  1819. if app.ENABLE_REBORN_SYSTEM:
  1820. def SetReborn(self, app):
  1821. import chat
  1822. func_modul = str(app)
  1823. #chat.AppendChat(chat.CHAT_TYPE_INFO, "vegas print number [%s]" % str(app))
  1824. if func_modul == "arg1":
  1825. self.wndReborn.OpenArgument("reborn_1")
  1826. elif func_modul == "arg2":
  1827. self.wndReborn.OpenArgument("reborn_2")
  1828. elif func_modul == "arg3":
  1829. self.wndReborn.OpenArgument("reborn_3")
  1830. elif func_modul == "pro_1":
  1831. self.wndReborn.OpenArgument("pro_1")
  1832. elif func_modul == "pro_0":
  1833. self.wndReborn.OpenArgument("pro_0")
  1834.  
  1835. if app.ENABLE_MAINTENANCE_SYSTEM:
  1836. def BINARY_Update_Maintenance(self, iTime, iDuration, iReason):
  1837. sTime = int(iTime)
  1838. sDuration = int(iDuration)
  1839. sReason = str(iReason)
  1840.  
  1841. if sTime != 0 and sDuration != 0:
  1842. self.wndMaintenance.OpenMaintenance(int(iTime), int(iDuration), str(iReason))
  1843.  
  1844. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  1845. def COSTUME_HIDE_CLEAR(self):
  1846. self.interface.costume_hide_clear()
  1847. def COSTUME_HIDE_LIST(self,slot,index):
  1848. self.interface.costume_hide_list(slot,index)
  1849. def COSTUME_HIDE_LOAD(self):
  1850. self.interface.costume_hide_load()
  1851.  
  1852. if app.ENABLE_COSTUME_AURA:
  1853. def ClearDirRefine(self):
  1854. constInfo.ITEM_REFINE_DIR = {}
  1855.  
  1856. def SetDirRefine(self, i, vnum):
  1857. constInfo.ITEM_REFINE_DIR[i] = vnum
  1858.  
  1859. 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):
  1860. constInfo.REFINE_ITEM_RESULT_1 = result1
  1861. constInfo.REFINE_ITEM_RESULT_2 = result2
  1862. constInfo.ITEM_VNUM_1 = item_vn_1
  1863. constInfo.ITEM_COUNT_1 = item_co_1
  1864. constInfo.ITEM_VNUM_2 = item_vn_2
  1865. constInfo.ITEM_COUNT_2 = item_co_2
  1866. constInfo.ITEM_VNUM_3 = item_vn_3
  1867. constInfo.ITEM_COUNT_3 = item_co_3
  1868. constInfo.ITEM_VNUM_4 = item_vn_4
  1869. constInfo.ITEM_COUNT_4 = item_co_4
  1870. constInfo.PRICE_R = price
  1871.  
  1872. def OpenBoardRefine(self):
  1873. if (self.RefineAura.IsShow()):
  1874. self.RefineAura.Hide()
  1875. else:
  1876. self.RefineAura.Show()
  1877.  
  1878. def EndAttack(self):
  1879. player.SetAttackKeyState(FALSE)
  1880.  
  1881. def MoveUp(self):
  1882. player.SetSingleDIKKeyState(app.DIK_UP, TRUE)
  1883.  
  1884. def MoveDown(self):
  1885. player.SetSingleDIKKeyState(app.DIK_DOWN, TRUE)
  1886.  
  1887. def MoveLeft(self):
  1888. player.SetSingleDIKKeyState(app.DIK_LEFT, TRUE)
  1889.  
  1890. def MoveRight(self):
  1891. player.SetSingleDIKKeyState(app.DIK_RIGHT, TRUE)
  1892.  
  1893. def StopUp(self):
  1894. player.SetSingleDIKKeyState(app.DIK_UP, FALSE)
  1895.  
  1896. def StopDown(self):
  1897. player.SetSingleDIKKeyState(app.DIK_DOWN, FALSE)
  1898.  
  1899. def StopLeft(self):
  1900. player.SetSingleDIKKeyState(app.DIK_LEFT, FALSE)
  1901.  
  1902. def StopRight(self):
  1903. player.SetSingleDIKKeyState(app.DIK_RIGHT, FALSE)
  1904.  
  1905. def PickUpItem(self):
  1906. player.PickCloseItemVector()
  1907.  
  1908. ###############################################################################################
  1909. ###############################################################################################
  1910. ## Event Handler
  1911.  
  1912. def OnKeyDown(self, key):
  1913. if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1914. return
  1915.  
  1916. if key == app.DIK_ESC:
  1917. self.RequestDropItem(False)
  1918. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1919.  
  1920. try:
  1921. self.onPressKeyDict[key]()
  1922. except KeyError:
  1923. pass
  1924. except:
  1925. raise
  1926.  
  1927. return TRUE
  1928.  
  1929. def OnKeyUp(self, key):
  1930. try:
  1931. self.onClickKeyDict[key]()
  1932. except KeyError:
  1933. pass
  1934. except:
  1935. raise
  1936.  
  1937. return TRUE
  1938.  
  1939. def OnMouseLeftButtonDown(self):
  1940. if self.interface.BUILD_OnMouseLeftButtonDown():
  1941. return
  1942.  
  1943. if mouseModule.mouseController.isAttached():
  1944. self.CheckFocus()
  1945. else:
  1946. hyperlink = ui.GetHyperlink()
  1947. if hyperlink:
  1948. return
  1949. else:
  1950. self.CheckFocus()
  1951. player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1952.  
  1953. return TRUE
  1954.  
  1955. def OnMouseLeftButtonUp(self):
  1956.  
  1957. if self.interface.BUILD_OnMouseLeftButtonUp():
  1958. return
  1959.  
  1960. if mouseModule.mouseController.isAttached():
  1961.  
  1962. attachedType = mouseModule.mouseController.GetAttachedType()
  1963. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1964. attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1965. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1966.  
  1967. if app.ENABLE_NEW_QUICK_SLOT_SYSTEM:
  1968. if player.SLOT_TYPE_NEW_QUICK_SLOT == attachedType:
  1969. player.RequestDeleteGlobalNewQuickSlot(attachedItemSlotPos)
  1970.  
  1971. ## QuickSlot
  1972. if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1973. player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1974.  
  1975. ## Inventory
  1976. #elif player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY:
  1977. elif player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedType or player.SLOT_TYPE_STONE_INVENTORY == attachedType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == attachedType:
  1978. if player.ITEM_MONEY == attachedItemIndex:
  1979. self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1980. else:
  1981. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1982.  
  1983. ## DragonSoul
  1984. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1985. self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1986.  
  1987. mouseModule.mouseController.DeattachObject()
  1988.  
  1989. else:
  1990. hyperlink = ui.GetHyperlink()
  1991. if hyperlink:
  1992. if app.IsPressed(app.DIK_LALT):
  1993. link = chat.GetLinkFromHyperlink(hyperlink)
  1994. ime.PasteString(link)
  1995. else:
  1996. self.interface.MakeHyperlinkTooltip(hyperlink)
  1997. return
  1998. else:
  1999. player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  2000.  
  2001. #player.EndMouseWalking()
  2002. return TRUE
  2003.  
  2004. def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  2005. if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedType or player.SLOT_TYPE_STONE_INVENTORY == attachedType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == attachedType:
  2006. attachedInvenType = player.SlotTypeToInvenType(attachedType)
  2007. if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  2008. if player.IsEquipmentSlot(attachedItemSlotPos):
  2009. self.stream.popupWindow.Close()
  2010. self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  2011. else:
  2012. if chr.IsNPC(dstChrID):
  2013. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  2014. else:
  2015. if app.ENABLE_MELEY_LAIR_DUNGEON:
  2016. if chr.IsStone(dstChrID):
  2017. net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  2018. else:
  2019. net.SendExchangeStartPacket(dstChrID)
  2020. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  2021. else:
  2022. net.SendExchangeStartPacket(dstChrID)
  2023. net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  2024. else:
  2025. self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  2026.  
  2027. def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  2028. if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  2029. net.SendExchangeStartPacket(dstChrID)
  2030. net.SendExchangeElkAddPacket(attachedMoney)
  2031. else:
  2032. self.__DropMoney(attachedType, attachedMoney)
  2033.  
  2034. def __DropMoney(self, attachedType, attachedMoney):
  2035. # PRIVATESHOP_DISABLE_ITEM_DROP - 개인상점 열고 있는 동안 아이템 버림 방지
  2036. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2037. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  2038. return
  2039.  
  2040. if app.WJ_OFFLINESHOP_SYSTEM:
  2041. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  2042. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2043. return
  2044.  
  2045. if (uiOfflineShop.IsEditingOfflineShop()):
  2046. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2047. return
  2048.  
  2049. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  2050. if attachedMoney>=1000:
  2051. self.stream.popupWindow.Close()
  2052. self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
  2053. return
  2054.  
  2055. itemDropQuestionDialog = uiCommon.QuestionDialogItem()
  2056. itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
  2057. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  2058. itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg))
  2059. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  2060. itemDropQuestionDialog.Open()
  2061. itemDropQuestionDialog.dropType = attachedType
  2062. itemDropQuestionDialog.dropCount = attachedMoney
  2063. itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  2064. self.itemDropQuestionDialog = itemDropQuestionDialog
  2065.  
  2066. def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  2067. # PRIVATESHOP_DISABLE_ITEM_DROP - 개인상점 열고 있는 동안 아이템 버림 방지
  2068. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2069. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  2070. return
  2071.  
  2072. if app.WJ_OFFLINESHOP_SYSTEM:
  2073. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  2074. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2075. return
  2076.  
  2077. if (uiOfflineShop.IsEditingOfflineShop()):
  2078. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2079. return
  2080.  
  2081. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  2082. if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
  2083. self.stream.popupWindow.Close()
  2084. self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  2085.  
  2086. else:
  2087. if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedType or player.SLOT_TYPE_STONE_INVENTORY == attachedType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == attachedType:
  2088. dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  2089.  
  2090. item.SelectItem(dropItemIndex)
  2091. dropItemName = item.GetItemName()
  2092.  
  2093. ## Question Text
  2094. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP_NEW(dropItemName, attachedItemCount, localeInfo.NumberToMoneyString(((player.GetISellItemPrice(attachedItemSlotPos)*attachedItemCount))))
  2095.  
  2096. ## Dialog
  2097. itemDropQuestionDialog = uiCommon.QuestionDialogItem()
  2098. itemDropQuestionDialog.SetText(questionText)
  2099. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  2100. itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg))
  2101. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  2102. itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg))
  2103. itemDropQuestionDialog.Open()
  2104. itemDropQuestionDialog.dropType = attachedType
  2105. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  2106. itemDropQuestionDialog.dropCount = attachedItemCount
  2107. self.itemDropQuestionDialog = itemDropQuestionDialog
  2108.  
  2109. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  2110. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  2111. dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
  2112.  
  2113. item.SelectItem(dropItemIndex)
  2114. dropItemName = item.GetItemName()
  2115.  
  2116. ## Question Text
  2117. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP_NEW(dropItemName, attachedItemCount, localeInfo.NumberToMoneyString((player.GetISellItemPrice(attachedItemSlotPos)*attachedItemCount)))
  2118.  
  2119. ## Dialog
  2120. itemDropQuestionDialog = uiCommon.QuestionDialogItem()
  2121. itemDropQuestionDialog.SetText(questionText)
  2122. itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  2123. itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg))
  2124. itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  2125. itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg))
  2126. itemDropQuestionDialog.Open()
  2127. itemDropQuestionDialog.dropType = attachedType
  2128. itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  2129. itemDropQuestionDialog.dropCount = attachedItemCount
  2130. self.itemDropQuestionDialog = itemDropQuestionDialog
  2131.  
  2132. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  2133.  
  2134.  
  2135. def RequestDropItem(self, answer):
  2136. if not self.itemDropQuestionDialog:
  2137. return
  2138.  
  2139. if answer:
  2140. dropType = self.itemDropQuestionDialog.dropType
  2141. dropCount = self.itemDropQuestionDialog.dropCount
  2142. dropNumber = self.itemDropQuestionDialog.dropNumber
  2143.  
  2144. if player.SLOT_TYPE_INVENTORY == dropType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == dropType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == dropType or player.SLOT_TYPE_STONE_INVENTORY == dropType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == dropType:
  2145. if dropNumber == player.ITEM_MONEY:
  2146. net.SendGoldDropPacketNew(dropCount)
  2147. snd.PlaySound("sound/ui/money.wav")
  2148. else:
  2149. # PRIVATESHOP_DISABLE_ITEM_DROP
  2150. self.__SendDropItemPacket(dropNumber, dropCount)
  2151. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  2152. elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
  2153. # PRIVATESHOP_DISABLE_ITEM_DROP
  2154. self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
  2155. # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  2156.  
  2157. self.itemDropQuestionDialog.Close()
  2158. self.itemDropQuestionDialog = None
  2159.  
  2160. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  2161.  
  2162. def RequestDestroyItem(self, answer):
  2163. if not self.itemDropQuestionDialog:
  2164. return
  2165. if answer:
  2166. dropType = self.itemDropQuestionDialog.dropType
  2167. dropNumber = self.itemDropQuestionDialog.dropNumber
  2168. if player.SLOT_TYPE_INVENTORY == dropType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == dropType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == dropType or player.SLOT_TYPE_STONE_INVENTORY == dropType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == dropType:
  2169. if dropNumber == player.ITEM_MONEY:
  2170. return
  2171. else:
  2172. self.__SendDestroyItemPacket(dropNumber)
  2173.  
  2174. self.itemDropQuestionDialog.Close()
  2175. self.itemDropQuestionDialog = None
  2176. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  2177.  
  2178. def RequestSellItem(self, answer):
  2179. if not self.itemDropQuestionDialog:
  2180. return
  2181. if answer:
  2182. dropType = self.itemDropQuestionDialog.dropType
  2183. dropNumber = self.itemDropQuestionDialog.dropNumber
  2184. if player.SLOT_TYPE_INVENTORY == dropType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == dropType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == dropType or player.SLOT_TYPE_STONE_INVENTORY == dropType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == dropType:
  2185. if dropNumber == player.ITEM_MONEY:
  2186. return
  2187. else:
  2188. self.__SendSellItemPacket(dropNumber)
  2189.  
  2190. self.itemDropQuestionDialog.Close()
  2191. self.itemDropQuestionDialog = None
  2192. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  2193.  
  2194. def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY):
  2195. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2196. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  2197. return
  2198. net.SendItemDestroyPacket(itemVNum)
  2199.  
  2200. def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
  2201. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2202. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  2203. return
  2204. if app.WJ_OFFLINESHOP_SYSTEM:
  2205. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  2206. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2207. return
  2208.  
  2209. if (uiOfflineShop.IsEditingOfflineShop()):
  2210. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2211. return
  2212. net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
  2213.  
  2214. def __SendSellItemPacket(self, itemVNum, itemInvenTyoe = player.INVENTORY):
  2215. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2216. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  2217. return
  2218. if app.WJ_OFFLINESHOP_SYSTEM:
  2219. if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  2220. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2221. return
  2222.  
  2223. if (uiOfflineShop.IsEditingOfflineShop()):
  2224. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  2225. return
  2226. net.SendChatPacket("/itemsat %d" % (int(itemVNum)))
  2227.  
  2228. def OnMouseRightButtonDown(self):
  2229.  
  2230. self.CheckFocus()
  2231.  
  2232. if TRUE == mouseModule.mouseController.isAttached():
  2233. mouseModule.mouseController.DeattachObject()
  2234.  
  2235. else:
  2236. player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  2237.  
  2238. return TRUE
  2239.  
  2240. def OnMouseRightButtonUp(self):
  2241. if TRUE == mouseModule.mouseController.isAttached():
  2242. return TRUE
  2243.  
  2244. player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  2245. return TRUE
  2246.  
  2247. def OnMouseMiddleButtonDown(self):
  2248. player.SetMouseMiddleButtonState(player.MBS_PRESS)
  2249.  
  2250. def OnMouseMiddleButtonUp(self):
  2251. player.SetMouseMiddleButtonState(player.MBS_CLICK)
  2252.  
  2253. def OnUpdate(self):
  2254. app.UpdateGame()
  2255. self.wnddailygift.OnUpdate()
  2256. # if app.ENABLE_TITLE_SYSTEM:
  2257. # self.wndTitleSystem.OnUpdate()
  2258.  
  2259. if self.mapNameShower.IsShow():
  2260. self.mapNameShower.Update()
  2261.  
  2262. if gameInfo.SYSTEMS_PAKET1==1:
  2263. self.npcac()
  2264. gameInfo.SYSTEMS_PAKET1=0
  2265.  
  2266. if gameInfo.SYSTEMS_PAKET2==1:
  2267. self.lonca_tanitim()
  2268. gameInfo.SYSTEMS_PAKET2=0
  2269.  
  2270. if gameInfo.SYSTEMS_PAKET3==1:
  2271. self.loncasiralamaopen()
  2272. gameInfo.SYSTEMS_PAKET3=0
  2273.  
  2274. if gameInfo.SYSTEMS_PAKET4==1:
  2275. self.siralamaopen()
  2276. gameInfo.SYSTEMS_PAKET4=0
  2277.  
  2278. if gameInfo.SYSTEMS_PAKET5==1:
  2279. self.recordac()
  2280. gameInfo.SYSTEMS_PAKET5=0
  2281.  
  2282. if gameInfo.SYSTEMS_PAKET6==1:
  2283. self.OpenMarbleShop()
  2284. gameInfo.SYSTEMS_PAKET6=0
  2285.  
  2286. if gameInfo.SYSTEMS_PAKET7==1:
  2287. self.OpenTitleSystem()
  2288. gameInfo.SYSTEMS_PAKET7=0
  2289.  
  2290. #if int(translate.panelisle) == 1:
  2291. # self.interface.__MakePrivateShopSearchWindow()
  2292. # translate.panelisle=0
  2293.  
  2294. if self.isShowDebugInfo:
  2295. self.UpdateDebugInfo()
  2296.  
  2297. if self.enableXMasBoom:
  2298. self.__XMasBoom_Update()
  2299.  
  2300. if 1 == constInfo.AUTO_PICK_UP:
  2301. self.PickUpItem()
  2302.  
  2303. self.interface.BUILD_OnUpdate()
  2304. """lastTime = max(0, self.endTime - time.clock())
  2305. if 0 == lastTime:
  2306. self.YoutuberKimdir()
  2307. curTime = time.clock()
  2308. self.endTime = curTime + 4"""
  2309.  
  2310. """def YoutuberKimdir(self):
  2311. if player.IsYoutuber():
  2312. if player.IsSecurityActivate():
  2313. return
  2314. #net.SendChatPacket("(youtuber)")"""
  2315.  
  2316.  
  2317. def UpdateDebugInfo(self):
  2318. #
  2319. # 캐릭터 좌표 및 FPS 출력
  2320. (x, y, z) = player.GetMainCharacterPosition()
  2321. nUpdateTime = app.GetUpdateTime()
  2322. nUpdateFPS = app.GetUpdateFPS()
  2323. nRenderFPS = app.GetRenderFPS()
  2324. nFaceCount = app.GetFaceCount()
  2325. fFaceSpeed = app.GetFaceSpeed()
  2326. nST=background.GetRenderShadowTime()
  2327. (fAveRT, nCurRT) = app.GetRenderTime()
  2328. (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  2329. (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  2330. if iPatch == 0:
  2331. iPatch = 1
  2332.  
  2333. #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  2334.  
  2335. self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  2336. xMouse, yMouse = wndMgr.GetMousePosition()
  2337. self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))
  2338.  
  2339. self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  2340.  
  2341. if fAveRT>1.0:
  2342. self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  2343.  
  2344. self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  2345. #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  2346. #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  2347. #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  2348. self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  2349.  
  2350. def OnRender(self):
  2351. app.RenderGame()
  2352.  
  2353. if self.console.Console.collision:
  2354. background.RenderCollision()
  2355. chr.RenderCollision()
  2356.  
  2357. (x, y) = app.GetCursorPosition()
  2358.  
  2359. ########################
  2360. # Picking
  2361. ########################
  2362. textTail.UpdateAllTextTail()
  2363.  
  2364. if TRUE == wndMgr.IsPickedWindow(self.hWnd):
  2365.  
  2366. self.PickingCharacterIndex = chr.Pick()
  2367.  
  2368. if -1 != self.PickingCharacterIndex:
  2369. textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  2370. if 0 != self.targetBoard.GetTargetVID():
  2371. textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  2372.  
  2373. # ADD_ALWAYS_SHOW_NAME
  2374. if not self.__IsShowName():
  2375. self.PickingItemIndex = item.Pick()
  2376. if -1 != self.PickingItemIndex:
  2377. textTail.ShowItemTextTail(self.PickingItemIndex)
  2378. # END_OF_ADD_ALWAYS_SHOW_NAME
  2379.  
  2380. ## Show all name in the range
  2381.  
  2382. # ADD_ALWAYS_SHOW_NAME
  2383. if self.__IsShowName():
  2384. textTail.ShowAllTextTail()
  2385. self.PickingItemIndex = textTail.Pick(x, y)
  2386. # END_OF_ADD_ALWAYS_SHOW_NAME
  2387.  
  2388. if app.ENABLE_SHOPNAMES_RANGE:
  2389. if systemSetting.IsShowSalesText():
  2390. uiPrivateShopBuilder.UpdateADBoard()
  2391.  
  2392. textTail.UpdateShowingTextTail()
  2393. textTail.ArrangeTextTail()
  2394. if -1 != self.PickingItemIndex:
  2395. textTail.SelectItemName(self.PickingItemIndex)
  2396.  
  2397. grp.PopState()
  2398. grp.SetInterfaceRenderState()
  2399.  
  2400. textTail.Render()
  2401. textTail.HideAllTextTail()
  2402.  
  2403. def OnPressEscapeKey(self):
  2404.  
  2405.  
  2406. if app.TARGET == app.GetCursor():
  2407. app.SetCursor(app.NORMAL)
  2408.  
  2409. elif TRUE == mouseModule.mouseController.isAttached():
  2410. mouseModule.mouseController.DeattachObject()
  2411.  
  2412. else:
  2413. self.interface.OpenSystemDialog()
  2414.  
  2415. if self.recordscreen.IsShow():
  2416. self.recordscreen.Open()
  2417.  
  2418. return TRUE
  2419.  
  2420. def OnIMEReturn(self):
  2421. if app.IsPressed(app.DIK_LSHIFT):
  2422. self.interface.OpenWhisperDialogWithoutTarget()
  2423. else:
  2424. self.interface.ToggleChat()
  2425. return TRUE
  2426.  
  2427. def OnPressExitKey(self):
  2428. self.interface.ToggleSystemDialog()
  2429. return TRUE
  2430.  
  2431. ## BINARY CALLBACK
  2432. ######################################################################################
  2433.  
  2434. if app.WJ_ENABLE_TRADABLE_ICON:
  2435. def BINARY_AddItemToExchange(self, inven_type, inven_pos, display_pos):
  2436. if inven_type == player.INVENTORY:
  2437. self.interface.CantTradableItemExchange(display_pos, inven_pos)
  2438.  
  2439. # WEDDING
  2440. def BINARY_LoverInfo(self, name, lovePoint):
  2441. if self.interface.wndMessenger:
  2442. self.interface.wndMessenger.OnAddLover(name, lovePoint)
  2443. if self.affectShower:
  2444. self.affectShower.SetLoverInfo(name, lovePoint)
  2445.  
  2446. def BINARY_UpdateLovePoint(self, lovePoint):
  2447. if self.interface.wndMessenger:
  2448. self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  2449. if self.affectShower:
  2450. self.affectShower.OnUpdateLovePoint(lovePoint)
  2451. # END_OF_WEDDING
  2452.  
  2453. # QUEST_CONFIRM
  2454. # QUEST_CONFIRM
  2455. def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  2456. confirmDialog = uiCommon.QuestionDialogWithTimeLimit2()
  2457. confirmDialog.Open(msg, timeout)
  2458. confirmDialog.SetAcceptEvent(lambda answer=TRUE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  2459. confirmDialog.SetCancelEvent(lambda answer=FALSE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  2460. self.confirmDialog = confirmDialog
  2461. # END_OF_QUEST_CONFIRM
  2462.  
  2463. # GIFT command
  2464. def Gift_Show(self):
  2465. self.interface.ShowGift()
  2466.  
  2467. # CUBE
  2468. def BINARY_Cube_Open(self, npcVNUM):
  2469. self.currentCubeNPC = npcVNUM
  2470.  
  2471. self.interface.OpenCubeWindow()
  2472.  
  2473.  
  2474. if npcVNUM not in self.cubeInformation:
  2475. net.SendChatPacket("/cube r_info")
  2476. else:
  2477. cubeInfoList = self.cubeInformation[npcVNUM]
  2478.  
  2479. i = 0
  2480. for cubeInfo in cubeInfoList:
  2481. self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
  2482.  
  2483. j = 0
  2484. for materialList in cubeInfo["materialList"]:
  2485. for materialInfo in materialList:
  2486. itemVnum, itemCount = materialInfo
  2487. self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
  2488. j = j + 1
  2489.  
  2490. i = i + 1
  2491.  
  2492. self.interface.wndCube.Refresh()
  2493.  
  2494. def BINARY_Cube_Close(self):
  2495. self.interface.CloseCubeWindow()
  2496.  
  2497. # 제작에 필요한 골드, 예상되는 완성품의 VNUM과 개수 정보 update
  2498. def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  2499. self.interface.UpdateCubeInfo(gold, itemVnum, count)
  2500.  
  2501. def BINARY_Cube_Succeed(self, itemVnum, count):
  2502. print "큐브 제작 성공"
  2503. self.interface.SucceedCubeWork(itemVnum, count)
  2504. pass
  2505.  
  2506. def BINARY_Cube_Failed(self):
  2507. print "큐브 제작 실패"
  2508. self.interface.FailedCubeWork()
  2509. pass
  2510.  
  2511. def BINARY_Cube_ResultList(self, npcVNUM, listText):
  2512. # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5 이런식으로 "/" 문자로 구분된 리스트를 줌
  2513. #print listText
  2514.  
  2515. if npcVNUM == 0:
  2516. npcVNUM = self.currentCubeNPC
  2517.  
  2518. self.cubeInformation[npcVNUM] = []
  2519.  
  2520. try:
  2521. for eachInfoText in listText.split("/"):
  2522. eachInfo = eachInfoText.split(",")
  2523. itemVnum = int(eachInfo[0])
  2524. itemCount = int(eachInfo[1])
  2525.  
  2526. self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
  2527. self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  2528.  
  2529. resultCount = len(self.cubeInformation[npcVNUM])
  2530. requestCount = 7
  2531. modCount = resultCount % requestCount
  2532. splitCount = resultCount / requestCount
  2533. for i in xrange(splitCount):
  2534. #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  2535. net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  2536.  
  2537. if 0 < modCount:
  2538. #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  2539. net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  2540.  
  2541. except RuntimeError, msg:
  2542. dbg.TraceError(msg)
  2543. return 0
  2544.  
  2545. pass
  2546.  
  2547. if app.WJ_ITEM_COMBINATION_SYSTEM:
  2548. ## Costume
  2549. def BINARY_Item_Combination_Open(self, npcVNUM):
  2550. self.interface.OpenItemCombinationWindow()
  2551.  
  2552. def BINARY_Item_Combination_Succeed(self):
  2553. print "Item Combination has succesfully!"
  2554. self.interface.SucceedItemCombinationWork()
  2555. pass
  2556.  
  2557. ## SkillBook
  2558. def BINARY_Skill_Book_Combination_Open(self, npcVNUM):
  2559. self.interface.OpenSkillBookCombinationWindow()
  2560.  
  2561. def BINARY_Skill_Book_Combination_Succeed(self):
  2562. print "Item Combination has succesfully!"
  2563. self.interface.SucceedSkillBookCombinationWork()
  2564. pass
  2565.  
  2566. ## Close
  2567. def BINARY_Combination_Close(self):
  2568. self.interface.CloseCombinationWindow()
  2569.  
  2570. def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
  2571. # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  2572. try:
  2573. #print listText
  2574.  
  2575. if 3 > len(listText):
  2576. dbg.TraceError("Wrong Cube Material Infomation")
  2577. return 0
  2578.  
  2579.  
  2580.  
  2581. eachResultList = listText.split("@")
  2582.  
  2583. cubeInfo = self.cubeInformation[self.currentCubeNPC]
  2584.  
  2585. itemIndex = 0
  2586. for eachResultText in eachResultList:
  2587. cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  2588. materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  2589.  
  2590. gold = 0
  2591. splitResult = eachResultText.split("/")
  2592. if 1 < len(splitResult):
  2593. gold = int(splitResult[1])
  2594.  
  2595. #print "splitResult : ", splitResult
  2596. eachMaterialList = splitResult[0].split("&")
  2597.  
  2598. i = 0
  2599. for eachMaterialText in eachMaterialList:
  2600. complicatedList = eachMaterialText.split("|")
  2601.  
  2602. if 0 < len(complicatedList):
  2603. for complicatedText in complicatedList:
  2604. (itemVnum, itemCount) = complicatedText.split(",")
  2605. itemVnum = int(itemVnum)
  2606. itemCount = int(itemCount)
  2607. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  2608.  
  2609. materialList[i].append((itemVnum, itemCount))
  2610.  
  2611. else:
  2612. itemVnum, itemCount = eachMaterialText.split(",")
  2613. itemVnum = int(itemVnum)
  2614. itemCount = int(itemCount)
  2615. self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  2616.  
  2617. materialList[i].append((itemVnum, itemCount))
  2618.  
  2619. i = i + 1
  2620.  
  2621.  
  2622.  
  2623. itemIndex = itemIndex + 1
  2624.  
  2625. self.interface.wndCube.Refresh()
  2626.  
  2627.  
  2628. except RuntimeError, msg:
  2629. dbg.TraceError(msg)
  2630. return 0
  2631.  
  2632. pass
  2633.  
  2634. # END_OF_CUBE
  2635. 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):
  2636. 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)
  2637.  
  2638. def BINARY_Cards_FieldUpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  2639. self.interface.UpdateCardsFieldInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  2640.  
  2641. def BINARY_Cards_PutReward(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  2642. self.interface.CardsPutReward(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  2643.  
  2644. # def BINARY_Cards_ShowIcon(self, icon):
  2645. # self.interface.CardsShowIcon(icon)
  2646.  
  2647. def BINARY_Cards_Open(self, safemode):
  2648. self.interface.OpenCardsWindow(safemode)
  2649.  
  2650. # 용혼석
  2651. def BINARY_Highlight_Item(self, inven_type, inven_pos):
  2652. if self.interface:
  2653. self.interface.Highligt_Item(inven_type, inven_pos)
  2654.  
  2655. def BINARY_DragonSoulGiveQuilification(self):
  2656. self.interface.DragonSoulGiveQuilification()
  2657.  
  2658. def BINARY_DragonSoulRefineWindow_Open(self):
  2659. self.interface.OpenDragonSoulRefineWindow()
  2660.  
  2661. def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
  2662. self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
  2663.  
  2664. def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
  2665. self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
  2666.  
  2667. # END of DRAGON SOUL REFINE WINDOW
  2668.  
  2669.  
  2670. def BINARY_SetBigMessage(self, message):
  2671. self.interface.bigBoard.SetTip(message)
  2672.  
  2673. def BINARY_SetTipMessage(self, message):
  2674. self.interface.tipBoard.SetTip(message)
  2675.  
  2676. def BINARY_AppendNotifyMessage(self, type):
  2677. if not type in localeInfo.NOTIFY_MESSAGE:
  2678. return
  2679. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
  2680.  
  2681. def BINARY_Guild_EnterGuildArea(self, areaID):
  2682. self.interface.BULID_EnterGuildArea(areaID)
  2683.  
  2684. def BINARY_Guild_ExitGuildArea(self, areaID):
  2685. self.interface.BULID_ExitGuildArea(areaID)
  2686.  
  2687. def BINARY_GuildWar_OnSendDeclare(self, guildID):
  2688. pass
  2689.  
  2690. def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  2691. mainCharacterName = player.GetMainCharacterName()
  2692. masterName = guild.GetGuildMasterName()
  2693. if mainCharacterName == masterName:
  2694. self.__GuildWar_OpenAskDialog(guildID, warType)
  2695.  
  2696. def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  2697. self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  2698.  
  2699. def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  2700. self.interface.OnStartGuildWar(guildSelf, guildOpp)
  2701.  
  2702. def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  2703. self.interface.OnEndGuildWar(guildSelf, guildOpp)
  2704.  
  2705. def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  2706. self.interface.BINARY_SetObserverMode(isEnable)
  2707.  
  2708. def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  2709. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2710.  
  2711. def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  2712. guildID1 = int(guildID1)
  2713. guildID2 = int(guildID2)
  2714. memberCount1 = int(memberCount1)
  2715. memberCount2 = int(memberCount2)
  2716. observerCount = int(observerCount)
  2717.  
  2718. self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  2719. self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2720.  
  2721. def __GuildWar_ProcessKillInput(self, killerName, killerRace, victimName, victimRace):
  2722. self.guildScoreCounter.OnMessage(killerName, killerRace, victimName, victimRace)
  2723.  
  2724. def __GuildWar_OpenAskDialog(self, guildID, warType):
  2725.  
  2726. guildName = guild.GetGuildName(guildID)
  2727.  
  2728. # REMOVED_GUILD_BUG_FIX
  2729. if "Noname" == guildName:
  2730. return
  2731. # END_OF_REMOVED_GUILD_BUG_FIX
  2732.  
  2733. import uiGuild
  2734. questionDialog = uiGuild.AcceptGuildWarDialog()
  2735. questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  2736. questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  2737. questionDialog.Open(guildName, warType)
  2738.  
  2739. self.guildWarQuestionDialog = questionDialog
  2740.  
  2741. def __GuildWar_CloseAskDialog(self):
  2742. self.guildWarQuestionDialog.Close()
  2743. self.guildWarQuestionDialog = None
  2744.  
  2745. def __GuildWar_OnAccept(self):
  2746.  
  2747. guildName = self.guildWarQuestionDialog.GetGuildName()
  2748.  
  2749. net.SendChatPacket("/war " + guildName)
  2750. self.__GuildWar_CloseAskDialog()
  2751.  
  2752. return 1
  2753.  
  2754. def __GuildWar_OnDecline(self):
  2755.  
  2756. guildName = self.guildWarQuestionDialog.GetGuildName()
  2757.  
  2758. net.SendChatPacket("/nowar " + guildName)
  2759. self.__GuildWar_CloseAskDialog()
  2760.  
  2761. return 1
  2762.  
  2763. ## BINARY CALLBACK
  2764. ######################################################################################
  2765.  
  2766. def __ServerCommand_Build(self):
  2767. serverCommandList={
  2768. "karakter_kilit" : self.karakter_kilit,
  2769. "getinputbegin" : self.__Inputget1,
  2770. "getinputend" : self.__Inputget2,
  2771. "getinput" : self.__Inputget3,
  2772. "depozit_index" :self.__depozit_questindex,
  2773. "antiexp_index" :self.__antiexp_questindex,
  2774. "Telep" :self.__MakeTelep,
  2775. "dopes_index" :self.__bonus_questindex,
  2776. "evento_ultimo_superviviente" : self.__evento_ultimo_superviviente,
  2777. "ConsoleEnable" : self.__Console_Enable,
  2778. "gorup_match_search" : self.open_group,
  2779. "DayMode" : self.__DayMode_Update,
  2780. "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update,
  2781. "CloseRestartWindow" : self.__RestartDialog_Close,
  2782. "OpenPrivateShop" : self.__PrivateShop_Open,
  2783. "OpenOfflineShop" : self.__OfflineShop_Open,
  2784. "PartyHealReady" : self.PartyHealReady,
  2785. "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  2786. "CloseSafebox" : self.CommandCloseSafebox,
  2787. "Teleport" : self.Teleport,
  2788. "YansitmaBaslat" : self.interface.OpenYansitma,
  2789.  
  2790. # Fix input quest Start
  2791. "GetInputStringStart" : self.GetInputStringStart,
  2792. "GetInputStringEnd" : self.GetInputStringEnd,
  2793. # Fix input quest End
  2794. #Guildstorage
  2795. "GUILDSTORAGE" : self._GuildStorageCMD,
  2796. "GUILDSTORAGE_ADDITEM" : self._GuildStorageAddItem,
  2797. "GUILDSTORAGE_ADDITEMSLOT" : self._GuildStorageAddItemSlot,
  2798. "GUILDSTORAGE_ADDMEMBER" : self._GuildStorageAddMemberToList,
  2799. "GUILDSTORAGE_ADDTEMPSLOT" : self._GuildStorageTempSlotsAdd,
  2800. "GUILDSTORAGE_ADDLOG" : self._GuildStorageAddLog,
  2801. ##
  2802.  
  2803. "OtomatikAvWindow" : self.__otomatikavstart,
  2804. "sorgu" : self.Uzaktan_ticaret_soru,
  2805. "recordquest" : self.__recordscreen,
  2806. "recordwarning" : self.recordwarning,
  2807. "oyunicisiralama" : self.__oyunicisirala,
  2808. "uyarisiralama" : self.uyarisiralama,
  2809. "loncasiralama" : self.__oyunicilonca,
  2810. "uyariloncasira" : self.uyariloncasira,
  2811. "lonca_tanit" : self.lonca_tanitim,
  2812. "loncatanitim" : self.__loncatanitim,
  2813. "lonca_tanitimi" : self.loncatanitekran,
  2814. "uyari" : self.uyari,
  2815. "lonca_lider_q" : self.lonca_lider_q,
  2816. "lider_ekle" : self.lider_ekle,
  2817. "lider_sifirla" : self.lider_sifirla,
  2818.  
  2819. """#ticaret_gecmisi
  2820. "tic_id" : self.__tic_quest_id,
  2821. "tic_ekle" : self.__tic_gecmis_bilgi_gir,
  2822. "tic_ac" : self.__tic_gecmis_ac,
  2823. "tic_gotur" : self.Close_tic,
  2824.  
  2825. "pazar_log_q" : self.__pazar_log_q,
  2826. "itemi_alan" : self.__itemi_alan,
  2827. "item_isim" : self.__item_isim,
  2828. "item_fiyat" : self.__item_fiyat,
  2829. "pazar_log_q_id" : self.__pazar_log_q_id,
  2830. "pazar_ekle" : self.__pazar_log_bilgi_gir,
  2831. "pazar_ac" : self.__pazar_log_ac,
  2832. "pazar_gotur" : self.Close_p_log,"""
  2833.  
  2834. # PET_SYSTEM
  2835. "PetIsMine" : self.__PetIsMineByVid,
  2836. "ActivarGui" : self.__ActivarGui,
  2837. "SetPetClearItemSlotButtonIndex" : self.__PetSetClearItemSlotButtonIndex,
  2838. "SetPetIncreaseBoniButtonIndex" : self.__PetSetIncreaseBoniButtonIndex,
  2839. "SetPetSendAwayButtonIndex" : self.__PetSetSendAwayButtonIndex,
  2840. "ShowPet" : self.__PetShow,
  2841. "HidePet" : self.__PetHide,
  2842. "GetPetClearSlot" : self.__PetGetClearSlot,
  2843. "GetPetIncreaseBoni" : self.__PetGetIncreaseBoni,
  2844. "SetPet" : self.__PetSet,
  2845. "SetPetHead" : self.__PetSetHead,
  2846. "SetPetNeck" : self.__PetSetNeck,
  2847. "SetPetFoot" : self.__PetSetFoot,
  2848. "SetPetAttackValue" : self.__PetSetAttackValue,
  2849. "SetPetMagicAttackValue" : self.__PetSetMagicAttackValue,
  2850. "SetPetArmorValue" : self.__PetSetArmorValue,
  2851. "SetPetName" : self.__PetSetName,
  2852. "SetPetLevel" : self.__PetSetLevel,
  2853. "SetPetExp" : self.__PetSetExp,
  2854. "SetPetMaxExp" : self.__PetSetMaxExp,
  2855. "SetPetSkillPoints" : self.__PetSetSkillPoints,
  2856. # END_OF_PET_SYSTEM
  2857. # ITEM_MALL
  2858. "CloseMall" : self.CommandCloseMall,
  2859. "ShowMeMallPassword" : self.AskMallPassword,
  2860. "item_mall" : self.__ItemMall_Open,
  2861. # END_OF_ITEM_MALL
  2862.  
  2863. "RefineSuceeded" : self.RefineSuceededMessage,
  2864. "RefineFailed" : self.RefineFailedMessage,
  2865. "xmas_snow" : self.__XMasSnow_Enable,
  2866. "xmas_boom" : self.__XMasBoom_Enable,
  2867. "xmas_song" : self.__XMasSong_Enable,
  2868. "xmas_tree" : self.__XMasTree_Enable,
  2869. "newyear_boom" : self.__XMasBoom_Enable,
  2870. "PartyRequest" : self.__PartyRequestQuestion,
  2871. "PartyRequestDenied" : self.__PartyRequestDenied,
  2872. "horse_state" : self.__Horse_UpdateState,
  2873. "hide_horse_state" : self.__Horse_HideState,
  2874. "WarUC" : self.__GuildWar_UpdateMemberCount,
  2875. "test_server" : self.__EnableTestServerFlag,
  2876. "mall" : self.__InGameShop_Show,
  2877. #PET_SYSTEM
  2878. "PetEvolution" : self.SetPetEvolution,
  2879. "PetName" : self.SetPetName,
  2880. "PetLevel" : self.SetPetLevel,
  2881. "PetDuration" : self.SetPetDuration,
  2882. "PetAgeDuration" : self.SetPetAgeDuration,
  2883. "PetBonus" : self.SetPetBonus,
  2884. "PetSkill" : self.SetPetskill,
  2885. "PetIcon" : self.SetPetIcon,
  2886. "PetExp" : self.SetPetExp,
  2887. "PetUnsummon" : self.PetUnsummon,
  2888. "OpenPetIncubator" : self.OpenPetIncubator,
  2889. #PET_SYSTEM
  2890. # ITEM_SHOP
  2891. "SetISLoadButtonIndex" : self.__ISSetLoadButtonIndex,
  2892. "SetISBuyButtonIndex" : self.__ISSetBuyButtonIndex,
  2893. "GetISBuyID" : self.__ISGetBuyID,
  2894. "GetISBuyID2" : self.__ISGetBuyID2,
  2895. "AddISCategory" : self.__ISAddCategory,
  2896. "SelectISCategory" : self.__ISSelectCategory,
  2897. "ClearISItems" : self.__ISClearItems,
  2898. "AddISItem" : self.__ISAddItem,
  2899. "AddISItemDesc" : self.__ISAddItemDesc,
  2900. "SetISLoadSuccess" : self.__ISSetLoadSuccess,
  2901. "SetISLoadFail" : self.__ISSetLoadFail,
  2902. "SetISBuySuccess" : self.__ISSetBuySuccess,
  2903. "SetISBuyFail" : self.__ISSetBuyFail,
  2904. "SetISCoins" : self.__ISSetCoins,
  2905. "SetISMarks" : self.__ISSetMarks,
  2906. "Showmedallas_gui" : self.__showmedallas_gui,
  2907. "Hidemedallas_gui" : self.__hidemedallas_gui,
  2908. "muertes" : self.__muertes,
  2909. "primera_muerte" : self.__primera_muerte,
  2910. "doble_muerte" : self.__doble_muerte,
  2911. "triple_muerte" : self.__triple_muerte,
  2912. "exterminio" : self.__exterminio,
  2913. "muertacular" : self.__muertacular,
  2914. "bestialidad" : self.__bestialidad,
  2915. "salvajada" : self.__salvajada,
  2916. "catastrofe" : self.__catastrofe,
  2917. "apocalipsis" : self.__apocalipsis,
  2918. "lluvia_muertos" : self.__lluvia_muertos,
  2919. "super_increible" : self.__super_increible,
  2920. "input0" : self.__Input0,
  2921. "input1" : self.__Input1,
  2922.  
  2923. # END_OF_ITEM_SHOP
  2924. # WEDDING
  2925. "lover_login" : self.__LoginLover,
  2926. "lover_logout" : self.__LogoutLover,
  2927. "lover_near" : self.__LoverNear,
  2928. "lover_far" : self.__LoverFar,
  2929. "lover_divorce" : self.__LoverDivorce,
  2930. "PlayMusic" : self.__PlayMusic,
  2931. #transfer costume
  2932. "transferopen" : self.showtransfer,
  2933. "get_input_value" : self.GetInputValue,
  2934. "get_input_start" : self.GetInputOn,
  2935. "get_input_end" : self.GetInputOff,
  2936. "super_quest" : self.Tabulejtor,
  2937. "pvp_zdruwko" : self.Mozart,
  2938. #end transfer
  2939. # END_OF_WEDDING
  2940.  
  2941. "SupportLv" : self.SetSupportLevel,
  2942. "SupportName" : self.SetSupportName,
  2943. "SupportLeave" : self.SupportLeave,
  2944. "SupporInt" : self.SupportInt,
  2945. "SupportExp" : self.SetSupportExp,
  2946. "SupportIcon" : self.SetSupportIcon,
  2947. "SupportSpeciality" : self.SetSupportSpeciality,
  2948.  
  2949. ########Daily Reward##########
  2950. "ManagerGiftSystem" : self.ManagerGiftSystem,
  2951.  
  2952. ########Anti Exp Button by Sanii##########
  2953. "anti_exp" : self.AntiExp,
  2954. "anti_exp_state" : self.AntiExpState,
  2955. "mostrar_usuarios" : self.__mostrar_usuarios,
  2956. "ocultar_usuarios" : self.__ocultar_usuarios,
  2957. "muerto_guerras" : self.__muerto_guerras,
  2958. "alubias" : self.__alubias,
  2959. "proteccion_guerra" : self.__proteccion_guerra,
  2960. "contador_usuarios_guerra" : self.__contador_usuarios_guerra,
  2961. "muertos_guerra" : self.__muertos_guerra,
  2962. "caido_guerra" : self.__caido_guerra,
  2963. "ataque_guerra" : self.__ataque_guerra,
  2964. "ataque_guerra1" : self.__ataque_guerra1,
  2965. "activar_libre" : self.__activar_libre,
  2966. "cerrar_grupo" : self.__grupobug,
  2967. "spirit2" : self.__spirit2,
  2968.  
  2969. # PRIVATE_SHOP_PRICE_LIST
  2970. "MyShopPriceList" : self.__PrivateShop_PriceList,
  2971. "AppendLoncaGecmisi" : self.__Append_Lonca_Gecmisi,
  2972. "WarPlayerCheckReq" : self.__Do_Check_War_Player,
  2973. "loncaistatistik" : self.loncaistatistik,
  2974.  
  2975. "gecmis_q" : self.lonca_gecmis_q,
  2976. "lonca_gecmis_ekle" : self.lonca_gecmis_ekle,
  2977. "gecmistemizle" : self.gecmistemizle,
  2978. "isim_ver" : self.isim_ver,
  2979.  
  2980. # END_OF_PRIVATE_SHOP_PRICE_LIST
  2981.  
  2982. # END_OF_BONI_SWITCHER
  2983. #offshoppannel
  2984. "MountSystem" : self.__MountSystem,
  2985. "SCHICKSAL_RAD" : self.__SchicksalRad,
  2986. # 5Lv Oto Bec Sistemi
  2987. "item_kilit_q" : self.item_kilit_q,
  2988. "kilit" : self._kilit,
  2989. # Savasci Beceri
  2990. "OpenBec1Gui" : self.__BecSystem1,
  2991. "zihinsel_oto_bec" : self.zihinsel_oto_bec,
  2992. "bedensel_oto_bec" : self.bedensel_oto_bec,
  2993.  
  2994. # Sura Beceri
  2995. "OpenBec3Gui" : self.__BecSystem2,
  2996. "karabuyu_oto_bec" : self.karabuyu_oto_bec,
  2997. "buyulusilah_oto_bec" : self.buyulusilah_oto_bec,
  2998.  
  2999. # Ninja Becerileri
  3000. "OpenBec2Gui" : self.__BecSystem3,
  3001. "yakin_oto_bec" : self.yakin_oto_bec,
  3002. "uzak_oto_bec" : self.uzak_oto_bec,
  3003.  
  3004. # Saman Becerileri
  3005. "OpenBec4Gui" : self.__BecSystem4,
  3006. "ejderha_oto_bec" : self.ejderha_oto_bec,
  3007. "iyilestirme_oto_bec" : self.iyilestirme_oto_bec,
  3008.  
  3009. # Lycan Becerileri
  3010. "OpenBec5Gui" : self.__BecSystem5,
  3011. "lycany_oto_bec" : self.lycany_oto_bec,
  3012. #"lycanu_oto_bec" : self.lycanu_oto_bec,
  3013. #Bk Takas
  3014. "bk_trade_sys" : self.__BKTradeSys,
  3015. """YoutuberKimdir" : self.YoutuberKimdir,"""
  3016.  
  3017. "dragonlair_ranking_open" : self.OpenDragonLairRanking,
  3018. "dragonlair_rank" : self.AddDragonLairRanking,
  3019.  
  3020. "OpenGuiGaya" : self.OpenGuiGaya,
  3021. "GayaCheck" : self.GayaCheck,
  3022.  
  3023. "OpenGuiGayaMarket" :self.OpenGuiGayaMarket,
  3024. "GayaMarketSlotsDesblock" : self.GayaMarketSlotsDesblock,
  3025. "GayaMarketItems" : self.GayaMarketItems,
  3026. "GayaMarketClear" : self.GayaMarketClear,
  3027. "GayaMarketTime" : self.GayaTimeMarket,
  3028.  
  3029. "ruhtasiekranac" : self.ruhcac,
  3030. "bkekranac" : self.bkac,
  3031.  
  3032. "biyologodul" : self.biyoodulac,
  3033. "biyologekrankapa" : self.biyologekrankapa,
  3034. "biyolog" : self.biyolog,
  3035.  
  3036. "SetReborn" : self.SetReborn,
  3037.  
  3038. "GW_Kill_Update" : self.__GuildWar_ProcessKillInput,
  3039. "AkiraEventSys" : self.__AkiraEventDataAppend,
  3040. "COSTUME_HIDE_CLEAR" : self.COSTUME_HIDE_CLEAR,
  3041. "COSTUME_HIDE_LIST" : self.COSTUME_HIDE_LIST,
  3042. "COSTUME_HIDE_LOAD" : self.COSTUME_HIDE_LOAD,
  3043. }
  3044.  
  3045. if app.WJ_SECURITY_SYSTEM:
  3046. serverCommandList.update({"OpenSecurityCreate" : self.OpenSecurityCreate })
  3047. serverCommandList.update({"OpenSecurityDialog" : self.OpenSecurityDialog })
  3048. serverCommandList.update({"CloseSecurityCreate" : self.CloseSecurityCreate })
  3049. serverCommandList.update({"CloseSecurityDialog" : self.CloseSecurityDialog })
  3050.  
  3051. if app.ENABLE_MAINTENANCE_SYSTEM:
  3052. serverCommandList.update({"BINARY_Update_Maintenance" : self.BINARY_Update_Maintenance })
  3053.  
  3054. # if app.ENABLE_HIDE_COSTUME_SYSTEM:
  3055. # serverCommandList["COSTUME_HIDE_CLEAR"] = self.COSTUME_HIDE_CLEAR
  3056. # serverCommandList["COSTUME_HIDE_LIST"] = self.COSTUME_HIDE_LIST
  3057. # serverCommandList["COSTUME_HIDE_LOAD"] = self.COSTUME_HIDE_LOAD
  3058. if app.ENABLE_COSTUME_AURA:
  3059. serverCommandList["ClearDirRefine"] = self.ClearDirRefine
  3060. serverCommandList["SetDirRefine"] = self.SetDirRefine
  3061. serverCommandList["AuraRefineInformation"] = self.AuraRefineInformation
  3062. serverCommandList["OpenBoardRefine"] = self.OpenBoardRefine
  3063.  
  3064. self.serverCommander=stringCommander.Analyzer()
  3065. for serverCommandItem in serverCommandList.items():
  3066. self.serverCommander.SAFE_RegisterCallBack(
  3067. serverCommandItem[0], serverCommandItem[1]
  3068. )
  3069.  
  3070. if app.ENABLE_NEW_ENCHANT_ATTR:
  3071. self.serverCommander.SAFE_RegisterCallBack("EnchantAttr_open", self.__OpenEnchantAttr)
  3072.  
  3073. if app.ENABLE_MELEY_LAIR_DUNGEON:
  3074. self.serverCommander.SAFE_RegisterCallBack("meley_open", self.OpenMeleyRanking)
  3075. self.serverCommander.SAFE_RegisterCallBack("meley_rank", self.AddRankMeleyRanking)
  3076.  
  3077. def __MakeTelep(self, qid):
  3078. constInfo.Telepqin= int(qid)
  3079.  
  3080. if app.ENABLE_NEW_ENCHANT_ATTR:
  3081. def __OpenEnchantAttr(self, cell):
  3082. if self.interface:
  3083. new_cell = int(cell.split("#")[1])
  3084. attrType0 = int(cell.split("#")[2])
  3085. attrValue0 = int(cell.split("#")[3])
  3086. attrType1 = int(cell.split("#")[4])
  3087. attrValue1 = int(cell.split("#")[5])
  3088. attrType2 = int(cell.split("#")[6])
  3089. attrValue2 = int(cell.split("#")[7])
  3090. attrType3 = int(cell.split("#")[8])
  3091. attrValue3 = int(cell.split("#")[9])
  3092. attrType4 = int(cell.split("#")[10])
  3093. attrValue4 = int(cell.split("#")[11])
  3094. new_attrSlot = [
  3095. [attrType0, attrValue0],
  3096. [attrType1, attrValue1],
  3097. [attrType2, attrValue2],
  3098. [attrType3, attrValue3],
  3099. [attrType4, attrValue4],
  3100. ]
  3101.  
  3102. self.interface.OpenEnchantAttrWindow(new_cell, new_attrSlot)
  3103.  
  3104. def BINARY_ServerCommand_Run(self, line):
  3105. #dbg.TraceError(line)
  3106. try:
  3107. #print " BINARY_ServerCommand_Run", line
  3108. return self.serverCommander.Run(line)
  3109. except RuntimeError, msg:
  3110. dbg.TraceError(msg)
  3111. return 0
  3112.  
  3113. def loncaistatistik(self,isim,level,durum,oldurme,olum,member):
  3114. self.loncaistatistiktemizle(member)
  3115.  
  3116.  
  3117. if int(member) == 1:
  3118. constInfo.isim1 = "1 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3119. constInfo.oldurme1 = str(oldurme)
  3120. constInfo.olum1 = str(olum)
  3121. if int(durum) == 0:
  3122. constInfo.durum1 = "|cff00ff00|H|hYasiyor"
  3123. if int(durum) == 1:
  3124. constInfo.durum1 = "|cffff0000|Hemp|hOlu"
  3125.  
  3126. if int(member) == 2:
  3127. constInfo.isim2 = "2 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3128. constInfo.oldurme2 = str(oldurme)
  3129. constInfo.olum2 = str(olum)
  3130. if int(durum) == 0:
  3131. constInfo.durum2 = "|cff00ff00|H|hYasiyor"
  3132. if int(durum) == 1:
  3133. constInfo.durum2 = "|cffff0000|Hemp|hOlu"
  3134.  
  3135. if int(member) == 3:
  3136. constInfo.isim3 = "3 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3137. constInfo.oldurme3 = str(oldurme)
  3138. constInfo.olum3 = str(olum)
  3139. if int(durum) == 0:
  3140. constInfo.durum3 = "|cff00ff00|H|hYasiyor"
  3141. if int(durum) == 1:
  3142. constInfo.durum3 = "|cffff0000|Hemp|hOlu"
  3143.  
  3144. if int(member) == 4:
  3145. constInfo.isim4 = "4 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3146. constInfo.oldurme4 = str(oldurme)
  3147. constInfo.olum4 = str(olum)
  3148. if int(durum) == 0:
  3149. constInfo.durum4 = "|cff00ff00|H|hYasiyor"
  3150. if int(durum) == 1:
  3151. constInfo.durum4 = "|cffff0000|Hemp|hOlu"
  3152.  
  3153. if int(member) == 5:
  3154. constInfo.isim5 = "5 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3155. constInfo.oldurme5 = str(oldurme)
  3156. constInfo.olum5 = str(olum)
  3157. if int(durum) == 0:
  3158. constInfo.durum5 = "|cff00ff00|H|hYasiyor"
  3159. if int(durum) == 1:
  3160. constInfo.durum5 = "|cffff0000|Hemp|hOlu"
  3161.  
  3162. if int(member) == 6:
  3163. constInfo.isim6 = "6 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3164. constInfo.oldurme6 = str(oldurme)
  3165. constInfo.olum6 = str(olum)
  3166. if int(durum) == 0:
  3167. constInfo.durum6 = "|cff00ff00|H|hYasiyor"
  3168. if int(durum) == 1:
  3169. constInfo.durum6 = "|cffff0000|Hemp|hOlu"
  3170.  
  3171. if int(member) == 7:
  3172. constInfo.isim7 = "7 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3173. constInfo.oldurme7 = str(oldurme)
  3174. constInfo.olum7 = str(olum)
  3175. if int(durum) == 0:
  3176. constInfo.durum7 = "|cff00ff00|H|hYasiyor"
  3177. if int(durum) == 1:
  3178. constInfo.durum7 = "|cffff0000|Hemp|hOlu"
  3179.  
  3180. if int(member) == 8:
  3181. constInfo.isim8 = "8 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3182. constInfo.oldurme8 = str(oldurme)
  3183. constInfo.olum8 = str(olum)
  3184. if int(durum) == 0:
  3185. constInfo.durum8 = "|cff00ff00|H|hYasiyor"
  3186. if int(durum) == 1:
  3187. constInfo.durum8 = "|cffff0000|Hemp|hOlu"
  3188.  
  3189. if int(member) == 9:
  3190. constInfo.isim9 = "9 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3191. constInfo.oldurme9 = str(oldurme)
  3192. constInfo.olum9 = str(olum)
  3193. if int(durum) == 0:
  3194. constInfo.durum9 = "|cff00ff00|H|hYasiyor"
  3195. if int(durum) == 1:
  3196. constInfo.durum9 = "|cffff0000|Hemp|hOlu"
  3197.  
  3198. if int(member) == 10:
  3199. constInfo.isim10 = "10 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3200. constInfo.oldurme10 = str(oldurme)
  3201. constInfo.olum10 = str(olum)
  3202. if int(durum) == 0:
  3203. constInfo.durum10 = "|cff00ff00|H|hYasiyor"
  3204. if int(durum) == 1:
  3205. constInfo.durum10 = "|cffff0000|Hemp|hOlu"
  3206.  
  3207. if int(member) == 11:
  3208. constInfo.isim11 = "11 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3209. constInfo.oldurme11 = str(oldurme)
  3210. constInfo.olum11 = str(olum)
  3211. if int(durum) == 0:
  3212. constInfo.durum11 = "|cff00ff00|H|hYasiyor"
  3213. if int(durum) == 1:
  3214. constInfo.durum11 = "|cffff0000|Hemp|hOlu"
  3215.  
  3216. if int(member) == 12:
  3217. constInfo.isim12 = "12 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3218. constInfo.oldurme12 = str(oldurme)
  3219. constInfo.olum12 = str(olum)
  3220. if int(durum) == 0:
  3221. constInfo.durum12 = "|cff00ff00|H|hYasiyor"
  3222. if int(durum) == 1:
  3223. constInfo.durum12 = "|cffff0000|Hemp|hOlu"
  3224.  
  3225. if int(member) == 13:
  3226. constInfo.isim13 = "13 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3227. constInfo.oldurme13 = str(oldurme)
  3228. constInfo.olum13 = str(olum)
  3229. if int(durum) == 0:
  3230. constInfo.durum13 = "|cff00ff00|H|hYasiyor"
  3231. if int(durum) == 1:
  3232. constInfo.durum13 = "|cffff0000|Hemp|hOlu"
  3233.  
  3234. if int(member) == 14:
  3235. constInfo.isim14 = "14 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3236. constInfo.oldurme14 = str(oldurme)
  3237. constInfo.olum14 = str(olum)
  3238. if int(durum) == 0:
  3239. constInfo.durum14 = "|cff00ff00|H|hYasiyor"
  3240. if int(durum) == 1:
  3241. constInfo.durum14 = "|cffff0000|Hemp|hOlu"
  3242.  
  3243. if int(member) == 15:
  3244. constInfo.isim15 = "15 - "+str(isim)+"(|cff00ff00|H|hNivel."+str(level)+"|h|r)"
  3245. constInfo.oldurme15 = str(oldurme)
  3246. constInfo.olum15 = str(olum)
  3247. if int(durum) == 0:
  3248. constInfo.durum15 = "|cff00ff00|H|hYasiyor"
  3249. if int(durum) == 1:
  3250. constInfo.durum15 = "|cffff0000|Hemp|hOlu"
  3251.  
  3252.  
  3253. def loncaistatistiktemizle(self,member):
  3254. if int(member) == 1:
  3255. constInfo.isim2 = ""
  3256. constInfo.durum2 = ""
  3257. constInfo.oldurme2 = ""
  3258. constInfo.olum2 = ""
  3259.  
  3260. constInfo.isim3 = ""
  3261. constInfo.durum3 = ""
  3262. constInfo.oldurme3 = ""
  3263. constInfo.olum3 = ""
  3264.  
  3265. constInfo.isim4 = ""
  3266. constInfo.durum4 = ""
  3267. constInfo.oldurme4 = ""
  3268. constInfo.olum4 = ""
  3269.  
  3270. constInfo.isim5 = ""
  3271. constInfo.durum5 = ""
  3272. constInfo.oldurme5 = ""
  3273. constInfo.olum5 = ""
  3274.  
  3275. constInfo.isim6 = ""
  3276. constInfo.durum6 = ""
  3277. constInfo.oldurme6 = ""
  3278. constInfo.olum6 = ""
  3279.  
  3280. constInfo.isim7 = ""
  3281. constInfo.durum7 = ""
  3282. constInfo.oldurme7 = ""
  3283. constInfo.olum7 = ""
  3284.  
  3285. constInfo.isim8 = ""
  3286. constInfo.durum8 = ""
  3287. constInfo.oldurme8 = ""
  3288. constInfo.olum8 = ""
  3289.  
  3290. constInfo.isim9 = ""
  3291. constInfo.durum9 = ""
  3292. constInfo.oldurme9 = ""
  3293. constInfo.olum9 = ""
  3294.  
  3295. constInfo.isim10 = ""
  3296. constInfo.durum10 = ""
  3297. constInfo.oldurme10 = ""
  3298. constInfo.olum10 = ""
  3299.  
  3300. constInfo.isim11 = ""
  3301. constInfo.durum11 = ""
  3302. constInfo.oldurme11 = ""
  3303. constInfo.olum11 = ""
  3304.  
  3305. constInfo.isim12 = ""
  3306. constInfo.durum12 = ""
  3307. constInfo.oldurme12 = ""
  3308. constInfo.olum12 = ""
  3309.  
  3310. constInfo.isim13 = ""
  3311. constInfo.durum13 = ""
  3312. constInfo.oldurme13 = ""
  3313. constInfo.olum13 = ""
  3314.  
  3315. constInfo.isim14 = ""
  3316. constInfo.durum14 = ""
  3317. constInfo.oldurme14 = ""
  3318. constInfo.olum14 = ""
  3319.  
  3320. constInfo.isim15 = ""
  3321. constInfo.durum15 = ""
  3322. constInfo.oldurme15 = ""
  3323. constInfo.olum15 = ""
  3324.  
  3325. if int(member) == 2:
  3326.  
  3327. constInfo.isim3 = ""
  3328. constInfo.durum3 = ""
  3329. constInfo.oldurme3 = ""
  3330. constInfo.olum3 = ""
  3331.  
  3332. constInfo.isim4 = ""
  3333. constInfo.durum4 = ""
  3334. constInfo.oldurme4 = ""
  3335. constInfo.olum4 = ""
  3336.  
  3337. constInfo.isim5 = ""
  3338. constInfo.durum5 = ""
  3339. constInfo.oldurme5 = ""
  3340. constInfo.olum5 = ""
  3341.  
  3342. constInfo.isim6 = ""
  3343. constInfo.durum6 = ""
  3344. constInfo.oldurme6 = ""
  3345. constInfo.olum6 = ""
  3346.  
  3347. constInfo.isim7 = ""
  3348. constInfo.durum7 = ""
  3349. constInfo.oldurme7 = ""
  3350. constInfo.olum7 = ""
  3351.  
  3352. constInfo.isim8 = ""
  3353. constInfo.durum8 = ""
  3354. constInfo.oldurme8 = ""
  3355. constInfo.olum8 = ""
  3356.  
  3357. constInfo.isim9 = ""
  3358. constInfo.durum9 = ""
  3359. constInfo.oldurme9 = ""
  3360. constInfo.olum9 = ""
  3361.  
  3362. constInfo.isim10 = ""
  3363. constInfo.durum10 = ""
  3364. constInfo.oldurme10 = ""
  3365. constInfo.olum10 = ""
  3366.  
  3367. constInfo.isim11 = ""
  3368. constInfo.durum11 = ""
  3369. constInfo.oldurme11 = ""
  3370. constInfo.olum11 = ""
  3371.  
  3372. constInfo.isim12 = ""
  3373. constInfo.durum12 = ""
  3374. constInfo.oldurme12 = ""
  3375. constInfo.olum12 = ""
  3376.  
  3377. constInfo.isim13 = ""
  3378. constInfo.durum13 = ""
  3379. constInfo.oldurme13 = ""
  3380. constInfo.olum13 = ""
  3381.  
  3382. constInfo.isim14 = ""
  3383. constInfo.durum14 = ""
  3384. constInfo.oldurme14 = ""
  3385. constInfo.olum14 = ""
  3386.  
  3387. constInfo.isim15 = ""
  3388. constInfo.durum15 = ""
  3389. constInfo.oldurme15 = ""
  3390. constInfo.olum15 = ""
  3391.  
  3392. if int(member) == 3:
  3393.  
  3394. constInfo.isim4 = ""
  3395. constInfo.durum4 = ""
  3396. constInfo.oldurme4 = ""
  3397. constInfo.olum4 = ""
  3398.  
  3399. constInfo.isim5 = ""
  3400. constInfo.durum5 = ""
  3401. constInfo.oldurme5 = ""
  3402. constInfo.olum5 = ""
  3403.  
  3404. constInfo.isim6 = ""
  3405. constInfo.durum6 = ""
  3406. constInfo.oldurme6 = ""
  3407. constInfo.olum6 = ""
  3408.  
  3409. constInfo.isim7 = ""
  3410. constInfo.durum7 = ""
  3411. constInfo.oldurme7 = ""
  3412. constInfo.olum7 = ""
  3413.  
  3414. constInfo.isim8 = ""
  3415. constInfo.durum8 = ""
  3416. constInfo.oldurme8 = ""
  3417. constInfo.olum8 = ""
  3418.  
  3419. constInfo.isim9 = ""
  3420. constInfo.durum9 = ""
  3421. constInfo.oldurme9 = ""
  3422. constInfo.olum9 = ""
  3423.  
  3424. constInfo.isim10 = ""
  3425. constInfo.durum10 = ""
  3426. constInfo.oldurme10 = ""
  3427. constInfo.olum10 = ""
  3428.  
  3429. constInfo.isim11 = ""
  3430. constInfo.durum11 = ""
  3431. constInfo.oldurme11 = ""
  3432. constInfo.olum11 = ""
  3433.  
  3434. constInfo.isim12 = ""
  3435. constInfo.durum12 = ""
  3436. constInfo.oldurme12 = ""
  3437. constInfo.olum12 = ""
  3438.  
  3439. constInfo.isim13 = ""
  3440. constInfo.durum13 = ""
  3441. constInfo.oldurme13 = ""
  3442. constInfo.olum13 = ""
  3443.  
  3444. constInfo.isim14 = ""
  3445. constInfo.durum14 = ""
  3446. constInfo.oldurme14 = ""
  3447. constInfo.olum14 = ""
  3448.  
  3449. constInfo.isim15 = ""
  3450. constInfo.durum15 = ""
  3451. constInfo.oldurme15 = ""
  3452. constInfo.olum15 = ""
  3453.  
  3454. if int(member) == 4:
  3455.  
  3456. constInfo.isim5 = ""
  3457. constInfo.durum5 = ""
  3458. constInfo.oldurme5 = ""
  3459. constInfo.olum5 = ""
  3460.  
  3461. constInfo.isim6 = ""
  3462. constInfo.durum6 = ""
  3463. constInfo.oldurme6 = ""
  3464. constInfo.olum6 = ""
  3465.  
  3466. constInfo.isim7 = ""
  3467. constInfo.durum7 = ""
  3468. constInfo.oldurme7 = ""
  3469. constInfo.olum7 = ""
  3470.  
  3471. constInfo.isim8 = ""
  3472. constInfo.durum8 = ""
  3473. constInfo.oldurme8 = ""
  3474. constInfo.olum8 = ""
  3475.  
  3476. constInfo.isim9 = ""
  3477. constInfo.durum9 = ""
  3478. constInfo.oldurme9 = ""
  3479. constInfo.olum9 = ""
  3480.  
  3481. constInfo.isim10 = ""
  3482. constInfo.durum10 = ""
  3483. constInfo.oldurme10 = ""
  3484. constInfo.olum10 = ""
  3485.  
  3486. constInfo.isim11 = ""
  3487. constInfo.durum11 = ""
  3488. constInfo.oldurme11 = ""
  3489. constInfo.olum11 = ""
  3490.  
  3491. constInfo.isim12 = ""
  3492. constInfo.durum12 = ""
  3493. constInfo.oldurme12 = ""
  3494. constInfo.olum12 = ""
  3495.  
  3496. constInfo.isim13 = ""
  3497. constInfo.durum13 = ""
  3498. constInfo.oldurme13 = ""
  3499. constInfo.olum13 = ""
  3500.  
  3501. constInfo.isim14 = ""
  3502. constInfo.durum14 = ""
  3503. constInfo.oldurme14 = ""
  3504. constInfo.olum14 = ""
  3505.  
  3506. constInfo.isim15 = ""
  3507. constInfo.durum15 = ""
  3508. constInfo.oldurme15 = ""
  3509. constInfo.olum15 = ""
  3510.  
  3511. if int(member) == 5:
  3512.  
  3513. constInfo.isim6 = ""
  3514. constInfo.durum6 = ""
  3515. constInfo.oldurme6 = ""
  3516. constInfo.olum6 = ""
  3517.  
  3518. constInfo.isim7 = ""
  3519. constInfo.durum7 = ""
  3520. constInfo.oldurme7 = ""
  3521. constInfo.olum7 = ""
  3522.  
  3523. constInfo.isim8 = ""
  3524. constInfo.durum8 = ""
  3525. constInfo.oldurme8 = ""
  3526. constInfo.olum8 = ""
  3527.  
  3528. constInfo.isim9 = ""
  3529. constInfo.durum9 = ""
  3530. constInfo.oldurme9 = ""
  3531. constInfo.olum9 = ""
  3532.  
  3533. constInfo.isim10 = ""
  3534. constInfo.durum10 = ""
  3535. constInfo.oldurme10 = ""
  3536. constInfo.olum10 = ""
  3537.  
  3538. constInfo.isim11 = ""
  3539. constInfo.durum11 = ""
  3540. constInfo.oldurme11 = ""
  3541. constInfo.olum11 = ""
  3542.  
  3543. constInfo.isim12 = ""
  3544. constInfo.durum12 = ""
  3545. constInfo.oldurme12 = ""
  3546. constInfo.olum12 = ""
  3547.  
  3548. constInfo.isim13 = ""
  3549. constInfo.durum13 = ""
  3550. constInfo.oldurme13 = ""
  3551. constInfo.olum13 = ""
  3552.  
  3553. constInfo.isim14 = ""
  3554. constInfo.durum14 = ""
  3555. constInfo.oldurme14 = ""
  3556. constInfo.olum14 = ""
  3557.  
  3558. constInfo.isim15 = ""
  3559. constInfo.durum15 = ""
  3560. constInfo.oldurme15 = ""
  3561. constInfo.olum15 = ""
  3562.  
  3563. if int(member) == 6:
  3564.  
  3565. constInfo.isim7 = ""
  3566. constInfo.durum7 = ""
  3567. constInfo.oldurme7 = ""
  3568. constInfo.olum7 = ""
  3569.  
  3570. constInfo.isim8 = ""
  3571. constInfo.durum8 = ""
  3572. constInfo.oldurme8 = ""
  3573. constInfo.olum8 = ""
  3574.  
  3575. constInfo.isim9 = ""
  3576. constInfo.durum9 = ""
  3577. constInfo.oldurme9 = ""
  3578. constInfo.olum9 = ""
  3579.  
  3580. constInfo.isim10 = ""
  3581. constInfo.durum10 = ""
  3582. constInfo.oldurme10 = ""
  3583. constInfo.olum10 = ""
  3584.  
  3585. constInfo.isim11 = ""
  3586. constInfo.durum11 = ""
  3587. constInfo.oldurme11 = ""
  3588. constInfo.olum11 = ""
  3589.  
  3590. constInfo.isim12 = ""
  3591. constInfo.durum12 = ""
  3592. constInfo.oldurme12 = ""
  3593. constInfo.olum12 = ""
  3594.  
  3595. constInfo.isim13 = ""
  3596. constInfo.durum13 = ""
  3597. constInfo.oldurme13 = ""
  3598. constInfo.olum13 = ""
  3599.  
  3600. constInfo.isim14 = ""
  3601. constInfo.durum14 = ""
  3602. constInfo.oldurme14 = ""
  3603. constInfo.olum14 = ""
  3604.  
  3605. constInfo.isim15 = ""
  3606. constInfo.durum15 = ""
  3607. constInfo.oldurme15 = ""
  3608. constInfo.olum15 = ""
  3609.  
  3610. if int(member) == 7:
  3611.  
  3612. constInfo.isim8 = ""
  3613. constInfo.durum8 = ""
  3614. constInfo.oldurme8 = ""
  3615. constInfo.olum8 = ""
  3616.  
  3617. constInfo.isim9 = ""
  3618. constInfo.durum9 = ""
  3619. constInfo.oldurme9 = ""
  3620. constInfo.olum9 = ""
  3621.  
  3622. constInfo.isim10 = ""
  3623. constInfo.durum10 = ""
  3624. constInfo.oldurme10 = ""
  3625. constInfo.olum10 = ""
  3626.  
  3627. constInfo.isim11 = ""
  3628. constInfo.durum11 = ""
  3629. constInfo.oldurme11 = ""
  3630. constInfo.olum11 = ""
  3631.  
  3632. constInfo.isim12 = ""
  3633. constInfo.durum12 = ""
  3634. constInfo.oldurme12 = ""
  3635. constInfo.olum12 = ""
  3636.  
  3637. constInfo.isim13 = ""
  3638. constInfo.durum13 = ""
  3639. constInfo.oldurme13 = ""
  3640. constInfo.olum13 = ""
  3641.  
  3642. constInfo.isim14 = ""
  3643. constInfo.durum14 = ""
  3644. constInfo.oldurme14 = ""
  3645. constInfo.olum14 = ""
  3646.  
  3647. constInfo.isim15 = ""
  3648. constInfo.durum15 = ""
  3649. constInfo.oldurme15 = ""
  3650. constInfo.olum15 = ""
  3651.  
  3652. if int(member) == 8:
  3653.  
  3654. constInfo.isim9 = ""
  3655. constInfo.durum9 = ""
  3656. constInfo.oldurme9 = ""
  3657. constInfo.olum9 = ""
  3658.  
  3659. constInfo.isim10 = ""
  3660. constInfo.durum10 = ""
  3661. constInfo.oldurme10 = ""
  3662. constInfo.olum10 = ""
  3663.  
  3664. constInfo.isim11 = ""
  3665. constInfo.durum11 = ""
  3666. constInfo.oldurme11 = ""
  3667. constInfo.olum11 = ""
  3668.  
  3669. constInfo.isim12 = ""
  3670. constInfo.durum12 = ""
  3671. constInfo.oldurme12 = ""
  3672. constInfo.olum12 = ""
  3673.  
  3674. constInfo.isim13 = ""
  3675. constInfo.durum13 = ""
  3676. constInfo.oldurme13 = ""
  3677. constInfo.olum13 = ""
  3678.  
  3679. constInfo.isim14 = ""
  3680. constInfo.durum14 = ""
  3681. constInfo.oldurme14 = ""
  3682. constInfo.olum14 = ""
  3683.  
  3684. constInfo.isim15 = ""
  3685. constInfo.durum15 = ""
  3686. constInfo.oldurme15 = ""
  3687. constInfo.olum15 = ""
  3688.  
  3689. if int(member) == 9:
  3690.  
  3691. constInfo.isim10 = ""
  3692. constInfo.durum10 = ""
  3693. constInfo.oldurme10 = ""
  3694. constInfo.olum10 = ""
  3695.  
  3696. constInfo.isim11 = ""
  3697. constInfo.durum11 = ""
  3698. constInfo.oldurme11 = ""
  3699. constInfo.olum11 = ""
  3700.  
  3701. constInfo.isim12 = ""
  3702. constInfo.durum12 = ""
  3703. constInfo.oldurme12 = ""
  3704. constInfo.olum12 = ""
  3705.  
  3706. constInfo.isim13 = ""
  3707. constInfo.durum13 = ""
  3708. constInfo.oldurme13 = ""
  3709. constInfo.olum13 = ""
  3710.  
  3711. constInfo.isim14 = ""
  3712. constInfo.durum14 = ""
  3713. constInfo.oldurme14 = ""
  3714. constInfo.olum14 = ""
  3715.  
  3716. constInfo.isim15 = ""
  3717. constInfo.durum15 = ""
  3718. constInfo.oldurme15 = ""
  3719. constInfo.olum15 = ""
  3720.  
  3721. if int(member) == 10:
  3722.  
  3723. constInfo.isim11 = ""
  3724. constInfo.durum11 = ""
  3725. constInfo.oldurme11 = ""
  3726. constInfo.olum11 = ""
  3727.  
  3728. constInfo.isim12 = ""
  3729. constInfo.durum12 = ""
  3730. constInfo.oldurme12 = ""
  3731. constInfo.olum12 = ""
  3732.  
  3733. constInfo.isim13 = ""
  3734. constInfo.durum13 = ""
  3735. constInfo.oldurme13 = ""
  3736. constInfo.olum13 = ""
  3737.  
  3738. constInfo.isim14 = ""
  3739. constInfo.durum14 = ""
  3740. constInfo.oldurme14 = ""
  3741. constInfo.olum14 = ""
  3742.  
  3743. constInfo.isim15 = ""
  3744. constInfo.durum15 = ""
  3745. constInfo.oldurme15 = ""
  3746. constInfo.olum15 = ""
  3747.  
  3748. if int(member) == 11:
  3749.  
  3750. constInfo.isim12 = ""
  3751. constInfo.durum12 = ""
  3752. constInfo.oldurme12 = ""
  3753. constInfo.olum12 = ""
  3754.  
  3755. constInfo.isim13 = ""
  3756. constInfo.durum13 = ""
  3757. constInfo.oldurme13 = ""
  3758. constInfo.olum13 = ""
  3759.  
  3760. constInfo.isim14 = ""
  3761. constInfo.durum14 = ""
  3762. constInfo.oldurme14 = ""
  3763. constInfo.olum14 = ""
  3764.  
  3765. constInfo.isim15 = ""
  3766. constInfo.durum15 = ""
  3767. constInfo.oldurme15 = ""
  3768. constInfo.olum15 = ""
  3769.  
  3770. if int(member) == 12:
  3771.  
  3772. constInfo.isim13 = ""
  3773. constInfo.durum13 = ""
  3774. constInfo.oldurme13 = ""
  3775. constInfo.olum13 = ""
  3776.  
  3777. constInfo.isim14 = ""
  3778. constInfo.durum14 = ""
  3779. constInfo.oldurme14 = ""
  3780. constInfo.olum14 = ""
  3781.  
  3782. constInfo.isim15 = ""
  3783. constInfo.durum15 = ""
  3784. constInfo.oldurme15 = ""
  3785. constInfo.olum15 = ""
  3786.  
  3787. if int(member) == 13:
  3788.  
  3789. constInfo.isim14 = ""
  3790. constInfo.durum14 = ""
  3791. constInfo.oldurme14 = ""
  3792. constInfo.olum14 = ""
  3793.  
  3794. constInfo.isim15 = ""
  3795. constInfo.durum15 = ""
  3796. constInfo.oldurme15 = ""
  3797. constInfo.olum15 = ""
  3798.  
  3799. if int(member) == 14:
  3800.  
  3801. constInfo.isim15 = ""
  3802. constInfo.durum15 = ""
  3803. constInfo.oldurme15 = ""
  3804. constInfo.olum15 = ""
  3805.  
  3806. def LoncaIstatistikOpen(self):
  3807. import net
  3808. net.SendChatPacket("/loncaistatistik")
  3809. import uiloncaistatistik
  3810. self.loncaistatistik = uiloncaistatistik.LoncaIstatistik()
  3811. self.loncaistatistik.Show()
  3812.  
  3813. def GuildstorageTry(self):
  3814. import uiguildstorage
  3815. self.GuildstorageWindow = uiguildstorage.GuildStorage()
  3816. if self.GuildstorageWindow.IsShow():
  3817. self.GuildstorageWindow.Hide()
  3818. else:
  3819. self.GuildStorageWindow.Show()
  3820.  
  3821. def __ProcessPreservedServerCommand(self):
  3822. try:
  3823. command = net.GetPreservedServerCommand()
  3824. while command:
  3825. print " __ProcessPreservedServerCommand", command
  3826. self.serverCommander.Run(command)
  3827. command = net.GetPreservedServerCommand()
  3828. except RuntimeError, msg:
  3829. dbg.TraceError(msg)
  3830. return 0
  3831.  
  3832. #AKIRA_EVENT_SYSTEM
  3833. def __AkiraEventDataAppend(self,event_data):
  3834. self.akiraEventButton.Open(event_data)
  3835. #END_OF_AKIRA_EVENT_SYSTEM
  3836.  
  3837. def __BKTradeSys(self, arg1, arg2):
  3838. if str(arg1) == "qid":
  3839. constInfo.BK_TRADE_SYSTEM["qid"] = arg2
  3840. if str(arg1) == "get":
  3841. net.SendQuestInputStringPacket(str(constInfo.BK_TRADE_SYSTEM["ItemList"]))
  3842. if str(arg1) == "open":
  3843. self.BKTradeSys.OpenWindow()
  3844. if str(arg1) == "block":
  3845. constInfo.INPUT_IGNORE = 1
  3846. if str(arg1) == "break":
  3847. constInfo.INPUT_IGNORE = 0
  3848.  
  3849. def karakter_kilit(self,qid):
  3850. constInfo.karakter_kilit = int(qid)
  3851.  
  3852. def PartyHealReady(self):
  3853. self.interface.PartyHealReady()
  3854.  
  3855. def AskSafeboxPassword(self):
  3856. self.interface.AskSafeboxPassword()
  3857.  
  3858. # ITEM_MALL
  3859. def AskMallPassword(self):
  3860. self.interface.AskMallPassword()
  3861.  
  3862. def __ItemMall_Open(self):
  3863. self.interface.OpenItemMall();
  3864.  
  3865. def CommandCloseMall(self):
  3866. self.interface.CommandCloseMall()
  3867. # END_OF_ITEM_MALL
  3868.  
  3869. def __deschidere_magazin_questindex(self, value):
  3870. constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX = int(value)
  3871.  
  3872. def __deschidere_magazin(self):
  3873. deschidere_magazin = constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX
  3874. event.QuestButtonClick(deschidere_magazin)
  3875.  
  3876. def RefineSuceededMessage(self):
  3877. snd.PlaySound("sound/ui/make_soket.wav")
  3878. self.PopupMessage(localeInfo.REFINE_SUCCESS)
  3879. translate.yenile=3
  3880.  
  3881. def RefineFailedMessage(self):
  3882. snd.PlaySound("sound/ui/jaeryun_fail.wav")
  3883. self.PopupMessage(localeInfo.REFINE_FAILURE)
  3884.  
  3885. def CommandCloseSafebox(self):
  3886. self.interface.CommandCloseSafebox()
  3887.  
  3888. # PRIVATE_SHOP_PRICE_LIST
  3889. def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  3890. if app.WJ_OFFLINESHOP_SYSTEM:
  3891. uiOfflineShopBuilder.SetOfflineShopItemPrice(itemVNum, itemPrice)
  3892. # END_OF_PRIVATE_SHOP_PRICE_LIST
  3893.  
  3894. def __Append_Lonca_Gecmisi(self, guildName, joinDate, joinTime, memberPosition):
  3895. lastPosition = ""
  3896. if int(memberPosition) == 1:
  3897. lastPosition = "Lider"
  3898. else:
  3899. lastPosition = "Uye"
  3900.  
  3901. lastDate = "%s %s" % (str(joinDate), str(joinTime))
  3902.  
  3903. self.LoncaGecmisi.AppendNewMember(str(guildName), str(lastPosition), str(lastDate))
  3904.  
  3905. def __Do_Check_War_Player(self, targetName, killCount, deadCount):
  3906. warPlayerCheckQuestionDialog = uiCommon.QuestionDialog3()
  3907. warPlayerCheckQuestionDialog.SetText1("%s isimli oyuncu ajan olabilir." % (targetName))
  3908. warPlayerCheckQuestionDialog.SetText2("Olme: %s Oldurme: %s" % (str(deadCount), str(killCount)))
  3909. warPlayerCheckQuestionDialog.SetText3("Savastan atilsin mi?")
  3910. warPlayerCheckQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  3911. warPlayerCheckQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  3912. warPlayerCheckQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerWarCheckRequest(arg))
  3913. warPlayerCheckQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerWarCheckRequest(arg))
  3914. warPlayerCheckQuestionDialog.Open()
  3915. warPlayerCheckQuestionDialog.name = targetName
  3916. self.warPlayerCheckQuestionDialog = warPlayerCheckQuestionDialog
  3917.  
  3918. def __AnswerWarCheckRequest(self, answer):
  3919. if not self.warPlayerCheckQuestionDialog:
  3920. return
  3921.  
  3922. targetName = self.warPlayerCheckQuestionDialog.name
  3923.  
  3924. if answer:
  3925. net.SendChatPacket("/kovkopegi %s" % (str(targetName)))
  3926.  
  3927. self.warPlayerCheckQuestionDialog.Close()
  3928. self.warPlayerCheckQuestionDialog = None
  3929.  
  3930. def SetPetEvolution(self, evo):
  3931. petname = ["Tanar", "Salbatic", "Curajos", "Eroic"]
  3932. self.petmain.SetEvolveName(petname[int(evo)])
  3933.  
  3934. def SetPetName(self, name):
  3935. if len(name) > 1 and name != "":
  3936. self.petmini.Show()
  3937. self.petmain.SetName(name)
  3938.  
  3939. def SetPetLevel(self, level):
  3940. self.petmain.SetLevel(level)
  3941.  
  3942. def SetPetDuration(self, dur, durt):
  3943. if int(durt) > 0:
  3944. self.petmini.SetDuration(dur, durt)
  3945. self.petmain.SetDuration(dur, durt)
  3946.  
  3947. def SetPetAgeDuration(self, age):
  3948. if (int(age)) > 0:
  3949. self.petmain.SetAgeDuration(age)
  3950.  
  3951. def SetPetBonus(self, hp, dif, sp):
  3952. self.petmain.SetHp(hp)
  3953. self.petmain.SetDef(dif)
  3954. self.petmain.SetSp(sp)
  3955.  
  3956. def SetPetskill(self, slot, idx, lv):
  3957. if int(lv) > 0:
  3958. self.petmini.SetSkill(slot, idx, lv)
  3959. self.petmain.SetSkill(slot, idx, lv)
  3960. self.affectShower.BINARY_NEW_AddAffect(5400+int(idx),int(constInfo.LASTAFFECT_POINT)+1,int(constInfo.LASTAFFECT_VALUE)+1, 0)
  3961. if int(slot)==0:
  3962. constInfo.SKILL_PET1=5400+int(idx)
  3963. if int(slot)==1:
  3964. constInfo.SKILL_PET2=5400+int(idx)
  3965. if int(slot)==2:
  3966. constInfo.SKILL_PET3=5400+int(idx)
  3967.  
  3968. def SetPetIcon(self, vnum):
  3969. if int(vnum) > 0:
  3970. self.petmini.SetImageSlot(vnum)
  3971. self.petmain.SetImageSlot(vnum)
  3972.  
  3973. def SetPetExp(self, exp, expi, exptot):
  3974. if int(exptot) > 0:
  3975. self.petmini.SetExperience(exp, expi, exptot)
  3976. self.petmain.SetExperience(exp, expi, exptot)
  3977.  
  3978. def PetUnsummon(self):
  3979. self.petmini.SetDefaultInfo()
  3980. self.petmini.Close()
  3981. self.petmain.SetDefaultInfo()
  3982. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET1),0)
  3983. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET2),0)
  3984. self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET3),0)
  3985. constInfo.SKILL_PET1 = 0
  3986. constInfo.SKILL_PET2 = 0
  3987. constInfo.SKILL_PET3 = 0
  3988.  
  3989. def OpenPetMainGui(self):
  3990. if constInfo.PET_MAIN == 0:
  3991. self.petmain.Show()
  3992. constInfo.PET_MAIN =1
  3993. self.petmain.SetTop()
  3994. else:
  3995. self.petmain.Hide()
  3996. constInfo.PET_MAIN =0
  3997.  
  3998.  
  3999. def OpenPetIncubator(self, pet_new = 0):
  4000. import uipetincubatrice
  4001. self.petinc = uipetincubatrice.PetSystemIncubator(pet_new)
  4002. self.petinc.Show()
  4003. self.petinc.SetTop()
  4004.  
  4005. def OpenPetMini(self):
  4006. self.petmini.Show()
  4007. self.petmini.SetTop()
  4008.  
  4009. def OpenPetFeed(self):
  4010.  
  4011. self.feedwind = uipetfeed.PetFeedWindow()
  4012. self.feedwind.Show()
  4013. self.feedwind.SetTop()
  4014.  
  4015. def Gift_Show(self):
  4016. if constInfo.PET_MAIN == 0:
  4017. self.petmain.Show()
  4018. constInfo.PET_MAIN =1
  4019. self.petmain.SetTop()
  4020. else:
  4021. self.petmain.Hide()
  4022. constInfo.PET_MAIN =0
  4023.  
  4024. def __Horse_HideState(self):
  4025. self.affectShower.SetHorseState(0, 0, 0)
  4026.  
  4027. def __Horse_UpdateState(self, level, health, battery):
  4028. self.affectShower.SetHorseState(int(level), int(health), int(battery))
  4029.  
  4030. def __IsXMasMap(self):
  4031. mapDict = ( "metin2_map_n_flame_01",
  4032. "metin2_map_n_desert_01",
  4033. "metin2_map_spiderdungeon",
  4034. "metin2_map_deviltower1", )
  4035.  
  4036. if background.GetCurrentMapName() in mapDict:
  4037. return FALSE
  4038.  
  4039. return TRUE
  4040.  
  4041. def __XMasSnow_Enable(self, mode):
  4042.  
  4043. self.__XMasSong_Enable(mode)
  4044.  
  4045. if "1"==mode:
  4046.  
  4047. if not self.__IsXMasMap():
  4048. return
  4049.  
  4050. print "XMAS_SNOW ON"
  4051. background.EnableSnow(1)
  4052.  
  4053. else:
  4054. print "XMAS_SNOW OFF"
  4055. background.EnableSnow(0)
  4056.  
  4057. def __XMasBoom_Enable(self, mode):
  4058. if "1"==mode:
  4059.  
  4060. if not self.__IsXMasMap():
  4061. return
  4062.  
  4063. print "XMAS_BOOM ON"
  4064. self.__DayMode_Update("dark")
  4065. self.enableXMasBoom = TRUE
  4066. self.startTimeXMasBoom = app.GetTime()
  4067. else:
  4068. print "XMAS_BOOM OFF"
  4069. self.__DayMode_Update("light")
  4070. self.enableXMasBoom = FALSE
  4071.  
  4072. def __XMasTree_Enable(self, grade):
  4073.  
  4074. print "XMAS_TREE ", grade
  4075. background.SetXMasTree(int(grade))
  4076. # PET_INVENTORY
  4077. def __PetIsMineByVid(self, vid):
  4078. targetName = chr.GetNameByVID(int(vid))
  4079. charName = player.GetName() or chr.GetMainCharacterName()
  4080. if targetName[0:len(charName)] == charName:
  4081. localeInfo.SEND_BACK = "true"
  4082. else:
  4083. localeInfo.SEND_BACK = "false"
  4084.  
  4085. self.__SendTextPacketToQuest()
  4086. localeInfo.SEND_BACK = ""
  4087.  
  4088. def __SendTextPacketToQuest(self):
  4089. net.SendQuestInputStringPacket(localeInfo.SEND_BACK)
  4090.  
  4091. def __Inputget1(self):
  4092. constInfo.INPUT_IGNORE = 1
  4093.  
  4094. def __Inputget2(self):
  4095. constInfo.INPUT_IGNORE = 0
  4096.  
  4097. def __Inputget3(self):
  4098. net.SendQuestInputStringPacket("1")
  4099.  
  4100. def GetInputStringStart(self):
  4101. constInfo.INPUT_IGNORE = 1
  4102.  
  4103. def GetInputStringEnd(self):
  4104. constInfo.INPUT_IGNORE = 0
  4105.  
  4106. def __PetSetClearItemSlotButtonIndex(self, index):
  4107. constInfo2.PET_CLEAR_ITEM_SLOT_BUTTON_INDEX = int(index)
  4108.  
  4109. def __PetSetIncreaseBoniButtonIndex(self, index):
  4110. constInfo2.PET_INCREASE_BONI_BUTTON_INDEX = int(index)
  4111.  
  4112. def __PetSetSendAwayButtonIndex(self, index):
  4113. constInfo2.PET_SEND_AWAY_BUTTON_INDEX = int(index)
  4114.  
  4115. def karakter_kilit(self,qid):
  4116. constInfo.karakter_kilit = int(qid)
  4117.  
  4118. def item_kilit_q(self, id):
  4119. constInfo.ITEM_KILIT = int(id)
  4120.  
  4121. def _kilit(self):
  4122. item_sil_idd = str(constInfo.kilit_id)
  4123. net.SendQuestInputStringPacket(item_sil_idd)
  4124.  
  4125. def __ActivarGui(self):
  4126. global pet_gui_activado
  4127. pet_gui_activado = 1
  4128.  
  4129. def __DeactivarGui(self):
  4130. global pet_gui_activado
  4131. pet_gui_activado = 0
  4132.  
  4133. def __PetShow(self):
  4134. if not self.petInventoryWnd:
  4135. import uiPet
  4136. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4137. self.petInventoryWnd.Show()
  4138.  
  4139. def __PetHide(self):
  4140. if self.petInventoryWnd:
  4141. self.petInventoryWnd.Hide()
  4142.  
  4143. def __PetGetClearSlot(self):
  4144. net.SendQuestInputStringPacket(str(self.petInventoryWnd.GetClearSlot()))
  4145.  
  4146. def __PetGetIncreaseBoni(self):
  4147. net.SendQuestInputStringPacket(str(self.petInventoryWnd.GetIncreaseBoni()))
  4148.  
  4149. def __PetSet(self, itemVnum):
  4150. if not self.petInventoryWnd:
  4151. import uiPet
  4152. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4153. self.petInventoryWnd.SetPet(itemVnum)
  4154.  
  4155. def __PetSetHead(self, itemVnum):
  4156. if not self.petInventoryWnd:
  4157. import uiPet
  4158. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4159. if int(itemVnum) > 0:
  4160. self.petInventoryWnd.SetHeadItem(itemVnum)
  4161. else:
  4162. self.petInventoryWnd.ClearHeadItem()
  4163.  
  4164. def __PetSetNeck(self, itemVnum):
  4165. if not self.petInventoryWnd:
  4166. import uiPet
  4167. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4168. if int(itemVnum) > 0:
  4169. self.petInventoryWnd.SetNeckItem(itemVnum)
  4170. else:
  4171. self.petInventoryWnd.ClearNeckItem()
  4172.  
  4173. def __PetSetFoot(self, itemVnum):
  4174. if not self.petInventoryWnd:
  4175. import uiPet
  4176. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4177. if int(itemVnum) > 0:
  4178. self.petInventoryWnd.SetFootItem(itemVnum)
  4179. else:
  4180. self.petInventoryWnd.ClearFootItem()
  4181.  
  4182. def __PetSetAttackValue(self, value):
  4183. if not self.petInventoryWnd:
  4184. import uiPet
  4185. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4186. self.petInventoryWnd.SetAttackValue(value)
  4187.  
  4188. def __PetSetMagicAttackValue(self, value):
  4189. if not self.petInventoryWnd:
  4190. import uiPet
  4191. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4192. self.petInventoryWnd.SetMagicAttackValue(value)
  4193.  
  4194. def __PetSetArmorValue(self, value):
  4195. if not self.petInventoryWnd:
  4196. import uiPet
  4197. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4198. self.petInventoryWnd.SetArmorValue(value)
  4199.  
  4200. def __PetSetName(self, name):
  4201. if not self.petInventoryWnd:
  4202. import uiPet
  4203. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4204. self.petInventoryWnd.SetName(name.replace("[_]", " "))
  4205.  
  4206. def __PetSetLevel(self, level):
  4207. if not self.petInventoryWnd:
  4208. import uiPet
  4209. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4210. self.petInventoryWnd.SetLevel(level)
  4211.  
  4212. def __PetSetExp(self, exp):
  4213. if not self.petInventoryWnd:
  4214. import uiPet
  4215. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4216. self.petInventoryWnd.SetExp(exp)
  4217. self.petInventoryWnd.UpdateExpBar()
  4218.  
  4219. def __PetSetMaxExp(self, maxexp):
  4220. if not self.petInventoryWnd:
  4221. import uiPet
  4222. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4223. self.petInventoryWnd.SetMaxExp(maxexp)
  4224. self.petInventoryWnd.UpdateExpBar()
  4225.  
  4226. def __PetSetSkillPoints(self, points):
  4227. if not self.petInventoryWnd:
  4228. import uiPet
  4229. self.petInventoryWnd = uiPet.PetInventoryDialog()
  4230. self.petInventoryWnd.SetSkillPoints(points)
  4231. # END_PET_INVENTORY
  4232. def __XMasSong_Enable(self, mode):
  4233. if "1"==mode:
  4234. print "XMAS_SONG ON"
  4235.  
  4236. XMAS_BGM = "xmas.mp3"
  4237.  
  4238. if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  4239. if musicInfo.fieldMusic != "":
  4240. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  4241.  
  4242. musicInfo.fieldMusic=XMAS_BGM
  4243. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  4244.  
  4245. else:
  4246. print "XMAS_SONG OFF"
  4247.  
  4248. if musicInfo.fieldMusic != "":
  4249. snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  4250.  
  4251. musicInfo.fieldMusic=musicInfo.METIN2THEMA
  4252. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  4253.  
  4254. def __RestartDialog_Close(self):
  4255. self.interface.CloseRestartDialog()
  4256.  
  4257. def __otomatikavstart(self):
  4258. otoavinfo.Start = 1
  4259.  
  4260. def OtomatikAv(self):
  4261. import uiotomatikav
  4262. self.otomatikav = uiotomatikav.otomatikav()
  4263. self.otomatikav.Show()
  4264.  
  4265. def __Console_Enable(self):
  4266. constInfo.CONSOLE_ENABLE = TRUE
  4267. self.consoleEnable = TRUE
  4268. app.EnableSpecialCameraMode()
  4269. ui.EnablePaste(TRUE)
  4270.  
  4271. if app.PARTY_MATCH:
  4272. def open_group(self, ayar, index):
  4273. import uipartymatch
  4274. self.wndPartyMatch = uipartymatch.PartyMatchWindow()
  4275. if ayar == "61":
  4276. # self.wndPartyMatch.sifir()
  4277. constInfo.KILITLE = 0
  4278. else:
  4279. if self.interface:
  4280. self.interface.wndMiniMap.open_party_match(ayar, index)
  4281. if ayar == "1":
  4282. self.wndPartyMatch.bilgi_ver(index)
  4283. constInfo.KILITLE = 61
  4284. else:
  4285. constInfo.KILITLE = 0
  4286.  
  4287. def __muerto_guerras(self, id):
  4288. constInfo.muerto_guerras = int(id)
  4289.  
  4290. def __alubias(self):
  4291. for i in xrange(player.INVENTORY_PAGE_SIZE*2):
  4292. if player.GetItemIndex(i) in (70102,):
  4293. net.SendItemUsePacket(i)
  4294. net.SendItemUsePacket(i)
  4295. net.SendItemUsePacket(i)
  4296. net.SendItemUsePacket(i)
  4297. net.SendItemUsePacket(i)
  4298. net.SendItemUsePacket(i)
  4299. break
  4300.  
  4301. def __spirit2(self):
  4302. net.SendChatPacket("(spirit2)")
  4303.  
  4304. def __proteccion_guerra(self):
  4305. net.SendChatPacket("(proteccion_guerra)")
  4306.  
  4307. def __contador_usuarios_guerra(self, contador_usuarios_guerra):
  4308. self.contador_usuarios_guerra.SetText(contador_usuarios_guerra)
  4309.  
  4310. def __muertos_guerra(self, muertos_guerra):
  4311. self.muertos_guerra.SetText(muertos_guerra)
  4312.  
  4313. def __caido_guerra(self, caido_guerra):
  4314. self.caido_guerra.SetText(caido_guerra)
  4315.  
  4316. def __mostrar_usuarios(self):
  4317. self.Espacio.Show()
  4318. self.contador_usuarios_guerra.Show()
  4319. self.muertos_guerra.Show()
  4320. self.caido_guerra.Show()
  4321. self.usuarios_guerra.Show()
  4322. self.ranking_guerra.Show()
  4323. self.ranking_caido.Show()
  4324.  
  4325. def __ocultar_usuarios(self):
  4326. self.Espacio.Hide()
  4327. self.contador_usuarios_guerra.Hide()
  4328. self.muertos_guerra.Hide()
  4329. self.caido_guerra.Hide()
  4330. self.usuarios_guerra.Hide()
  4331. self.ranking_guerra.Hide()
  4332. self.ranking_caido.Hide()
  4333.  
  4334. def __ataque_guerra(self):
  4335. constInfo.ataque_guerra = 1
  4336.  
  4337. def __ataque_guerra1(self):
  4338. constInfo.ataque_guerra = 0
  4339.  
  4340. def __activar_libre(self):
  4341. net.SendChatPacket("/pkmode 2")
  4342.  
  4343. def __grupobug(self):
  4344. net.SendPartyExitPacket()
  4345.  
  4346. ## PrivateShop
  4347. def __PrivateShop_Open(self):
  4348. self.uiNewShop.Show()
  4349.  
  4350. def BINARY_PrivateShop_Appear(self, vid, text):
  4351. if chr.GetInstanceType(vid) in [chr.INSTANCE_TYPE_PLAYER, chr.INSTANCE_TYPE_NPC]:
  4352. self.interface.AppearPrivateShop(vid, text)
  4353.  
  4354. def BINARY_PrivateShop_Disappear(self, vid):
  4355. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER):
  4356. self.interface.DisappearPrivateShop(vid)
  4357.  
  4358. def __OfflineShop_Open(self):
  4359. self.interface.OpenOfflineShopInputNameDialog()
  4360.  
  4361. def BINARY_OfflineShop_Appear(self, vid, text):
  4362. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC):
  4363. self.interface.AppearOfflineShop(vid, text)
  4364.  
  4365. def BINARY_OfflineShop_Disappear(self, vid):
  4366. if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC):
  4367. self.interface.DisappearOfflineShop(vid)
  4368.  
  4369. def BINARY_OfflineShopGui(self, result, i, time):
  4370. if result == 0:
  4371. self.interface.ToggleOfflineShopAdminPanelWindow2()
  4372. else:
  4373. self.interface.ToggleOfflineShopAdminPanelWindow(i, time)
  4374.  
  4375. ## DayMode
  4376. def __PRESERVE_DayMode_Update(self, mode):
  4377. if "light"==mode:
  4378. background.SetEnvironmentData(0)
  4379. elif "dark"==mode:
  4380.  
  4381. if not self.__IsXMasMap():
  4382. return
  4383.  
  4384. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  4385. background.SetEnvironmentData(1)
  4386.  
  4387. def __DayMode_Update(self, mode):
  4388. if "light"==mode:
  4389. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  4390. elif "dark"==mode:
  4391.  
  4392. if not self.__IsXMasMap():
  4393. return
  4394.  
  4395. self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  4396.  
  4397. def __DayMode_OnCompleteChangeToLight(self):
  4398. background.SetEnvironmentData(0)
  4399. self.curtain.FadeIn()
  4400.  
  4401. def __DayMode_OnCompleteChangeToDark(self):
  4402. background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  4403. background.SetEnvironmentData(1)
  4404. self.curtain.FadeIn()
  4405.  
  4406. ## XMasBoom
  4407. def __XMasBoom_Update(self):
  4408.  
  4409. self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  4410. if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  4411. return
  4412.  
  4413. boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  4414. boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  4415.  
  4416. if app.GetTime() - self.startTimeXMasBoom > boomTime:
  4417.  
  4418. self.indexXMasBoom += 1
  4419.  
  4420. for i in xrange(boomCount):
  4421. self.__XMasBoom_Boom()
  4422.  
  4423. def __XMasBoom_Boom(self):
  4424. x, y, z = player.GetMainCharacterPosition()
  4425. randX = app.GetRandom(-150, 150)
  4426. randY = app.GetRandom(-150, 150)
  4427.  
  4428. snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  4429.  
  4430. def __PartyRequestQuestion(self, vid):
  4431. vid = int(vid)
  4432. partyRequestQuestionDialog = uiCommon.QuestionDialog()
  4433. partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
  4434. partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  4435. partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  4436. partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerPartyRequest(arg))
  4437. partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerPartyRequest(arg))
  4438. partyRequestQuestionDialog.Open()
  4439. partyRequestQuestionDialog.vid = vid
  4440. self.partyRequestQuestionDialog = partyRequestQuestionDialog
  4441.  
  4442. def __AnswerPartyRequest(self, answer):
  4443. if not self.partyRequestQuestionDialog:
  4444. return
  4445.  
  4446. vid = self.partyRequestQuestionDialog.vid
  4447.  
  4448. if answer:
  4449. net.SendChatPacket("/party_request_accept " + str(vid))
  4450. else:
  4451. net.SendChatPacket("/party_request_deny " + str(vid))
  4452.  
  4453. self.partyRequestQuestionDialog.Close()
  4454. self.partyRequestQuestionDialog = None
  4455.  
  4456. def __PartyRequestDenied(self):
  4457. self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
  4458.  
  4459. if (app.WJ_COMBAT_ZONE):
  4460. def BINARY_CombatZone_Manager(self, tokens, arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0):
  4461. if tokens == "OpenWindow":
  4462. self.wndCombatZone.Open(arg1, arg2, arg3, arg4)
  4463.  
  4464. elif tokens == "RegisterRank":
  4465. self.wndCombatZone.RegisterRanking()
  4466.  
  4467. elif tokens == "StartFlashing":
  4468. if self.interface:
  4469. self.interface.wndMiniMap.btnCombatZone.FlashEx()
  4470.  
  4471. elif tokens == "RefreshShop":
  4472. if self.interface:
  4473. self.interface.dlgShop.SetCombatZonePoints(arg1)
  4474. self.interface.dlgShop.SetLimitCombatZonePoints(arg2, arg3)
  4475.  
  4476. if app.TOURNAMENT_PVP_SYSTEM:
  4477. def BINARY_Tournament_OnRecvData(self, leftTime, membersOnline_A, membersOnline_B, membersDead_A, membersDead_B, memberLives):
  4478. self.interface.AddTournamentResultWindow(leftTime, membersOnline_A, membersOnline_B, membersDead_A, membersDead_B, memberLives)
  4479.  
  4480. def __EnableTestServerFlag(self):
  4481. app.EnableTestServerFlag()
  4482.  
  4483. def __InGameShop_Show(self, url):
  4484. if constInfo.IN_GAME_SHOP_ENABLE:
  4485. self.interface.OpenWebWindow(url)
  4486.  
  4487. # WEDDING
  4488. def __LoginLover(self):
  4489. if self.interface.wndMessenger:
  4490. self.interface.wndMessenger.OnLoginLover()
  4491.  
  4492. def __LogoutLover(self):
  4493. if self.interface.wndMessenger:
  4494. self.interface.wndMessenger.OnLogoutLover()
  4495. if self.affectShower:
  4496. self.affectShower.HideLoverState()
  4497.  
  4498. def __LoverNear(self):
  4499. if self.affectShower:
  4500. self.affectShower.ShowLoverState()
  4501.  
  4502. def __LoverFar(self):
  4503. if self.affectShower:
  4504. self.affectShower.HideLoverState()
  4505.  
  4506. if app.ENABLE_TICKET_SYSTEM:
  4507. def BINARY_Ticket_Sort_Admin(self, token, val):
  4508. if token == "r":
  4509. if self.wndTicket.IsShow():
  4510. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.TICKET_BTN_ERROR_OPEN)
  4511. return
  4512. else:
  4513. self.wndTicketStaff.Append()
  4514. elif token == "o":
  4515. constInfo.ObjectD["rmdir"][0] = int(val)
  4516. self.wndTicket.Append()
  4517.  
  4518. def BINARY_Ticket_Logs_Team(self, index, ticked_id, char_name, title, content, priority, create_date, status):
  4519. self.wndTicket.AppendLogsTeam(index, ticked_id, char_name, title, content, priority, create_date, status)
  4520.  
  4521. def BINARY_Ticket_Logs_General(self):
  4522. self.wndTicket.AppendLogs()
  4523.  
  4524. def BINARY_Ticket_Logs_Reply(self):
  4525. self.wndTicketReply.AppendLogs()
  4526.  
  4527. def __LoverDivorce(self):
  4528. if self.interface.wndMessenger:
  4529. self.interface.wndMessenger.ClearLoverInfo()
  4530. if self.affectShower:
  4531. self.affectShower.ClearLoverState()
  4532.  
  4533. def __PlayMusic(self, flag, filename):
  4534. flag = int(flag)
  4535. if flag:
  4536. snd.FadeOutAllMusic()
  4537. musicInfo.SaveLastPlayFieldMusic()
  4538. snd.FadeInMusic("BGM/" + filename)
  4539. else:
  4540. snd.FadeOutAllMusic()
  4541. musicInfo.LoadLastPlayFieldMusic()
  4542. snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  4543.  
  4544. def OpenMarbleShop(self):
  4545. if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate():
  4546. return
  4547. if self.wndMarbleShop.IsShow():
  4548. self.wndMarbleShop.Hide()
  4549. else:
  4550. self.wndMarbleShop.Show()
  4551.  
  4552. def OpenDragonLairRanking(self):
  4553. if self.interface:
  4554. self.interface.OpenDragonLairRanking()
  4555.  
  4556. def AddDragonLairRanking(self, data):
  4557. if self.interface:
  4558. line = int(data.split("#")[1])
  4559. name = str(data.split("#")[2])
  4560. empire = int(data.split("#")[3])
  4561. killcount = int(data.split("#")[4])
  4562. self.interface.AddDragonLairRanking(line, name, empire, killcount)
  4563.  
  4564. # END_OF_WEDDING
  4565.  
  4566. """# Ticaret LOG #
  4567. def OpenTicaretLog(self):
  4568. self.Board = ui.BoardWithTitleBar()
  4569. self.Board.SetSize(241+30+215, 271+40+40-17-17)
  4570. self.Board.SetCenterPosition()
  4571. self.Board.AddFlag('movable')
  4572. self.Board.AddFlag('float')
  4573. self.Board.SetTitleName('Ticaret Kayitlarin')
  4574. self.Board.SetCloseEvent(self.Kapat)
  4575. self.Board.Show()
  4576.  
  4577.  
  4578. #self.Ticaret = 1
  4579. self.Bekle3 = app.GetTime()
  4580.  
  4581. self.TekliflerText = ui.TextLine_Alisveris()
  4582. self.TekliflerText.SetParent(self.Board)
  4583. self.TekliflerText.SetPosition(0, 30)
  4584. self.TekliflerText.SetText(str(player.GetName()))
  4585. self.TekliflerText.SetWindowHorizontalAlignCenter()
  4586. self.TekliflerText.SetHorizontalAlignCenter()
  4587. self.TekliflerText.Show()
  4588.  
  4589. self.ThinBoard = ui.ThinBoard()
  4590. self.ThinBoard.SetParent(self.Board)
  4591. self.ThinBoard.SetSize(241-18+26+215, 250)
  4592. self.ThinBoard.SetPosition(10+9-5-3, 48)
  4593. self.ThinBoard.Show()
  4594.  
  4595. self.ListBox=ui.ListBox_Scroll()
  4596. self.ListBox.SetParent(self.Board)
  4597. self.ListBox.SetPosition(10+9, 50)
  4598. self.ListBox.SetSize(241-18+26-8+215, 250)
  4599. #self.ListBox.SetEvent(ui.__mem_func__(self.__OnSelectListBox))
  4600. self.ListBox.Show()
  4601.  
  4602.  
  4603. self.ListBox.ClearItem()
  4604.  
  4605. pos = 0
  4606. if os.path.exists(str(systemInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg"):
  4607. ac = open(str(systemInfo.CLIENT_YOL)+"ticaret_"+str(player.GetName())+".cfg", "r").readlines()
  4608. for i in ac:
  4609. bol = i.split("#")
  4610. self.ListBox.InsertItem(pos, str(bol[1]) + " adli oyuncu ile (" + str(bol[2]) + ") tarihinde ticaret gerceklesti.")
  4611. pos += 1
  4612. else:
  4613. self.ListBox.InsertItem(0, "Yapilan hic ticaret kaydi yok.")
  4614.  
  4615. def Kapat(self):
  4616. self.Board.Hide()
  4617. self.TekliflerText.Hide()
  4618. self.ThinBoard.Hide()
  4619. self.ListBox.Hide()
  4620. self.Ticaret = 0
  4621.  
  4622. ##Log Bilgi Ekran
  4623. def log_ekran(self):
  4624. self.log_Board = ui.BoardWithTitleBar()
  4625. self.log_Board.SetSize(225, 160)
  4626. self.log_Board.SetCenterPosition()
  4627. self.log_Board.AddFlag('movable')
  4628. self.log_Board.AddFlag('float')
  4629. self.log_Board.SetTitleName('Log Sistemi')
  4630. self.log_Board.SetCloseEvent(self.log_Close)
  4631. self.log_Board.Show()
  4632. self.comp = Component()
  4633. self.pazar_img = self.comp.ExpandedImage(self.log_Board , 56, 60, 'd:/ymir work/ui/logsistem/pazar.tga')
  4634. self.tic_img = self.comp.ExpandedImage(self.log_Board , 140, 60, 'd:/ymir work/ui/logsistem/tic.tga')#140
  4635. self.pazar_button = self.comp.Button(self.log_Board, 'Pazar', '', 44, 105, self.__pazar_log_ac, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  4636. self.tic_button = self.comp.Button(self.log_Board, 'Ticaret', '', 127, 105, self.__tic_gecmis_ac, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  4637.  
  4638.  
  4639. def log_Close(self):
  4640. self.log_Board.Hide()
  4641.  
  4642.  
  4643. ##Pazar_log
  4644.  
  4645. def pazar_log_gui(self):
  4646. constInfo.KONTROL2=1
  4647. self.p_log = ui.BoardWithTitleBar()
  4648. self.p_log.SetSize(450, 300)
  4649. self.p_log.SetCenterPosition()
  4650. self.p_log.AddFlag('movable')
  4651. self.p_log.AddFlag('float')
  4652. self.p_log.SetTitleName(translate.GECMIS)
  4653. self.p_log.SetCloseEvent(self.Close_p_log)
  4654. self.p_log.Show()
  4655. self.comp_p_log = Component()
  4656.  
  4657. self.pazar_bilgi_yenile = self.comp_p_log.Button(self.p_log, 'Yenile', translate.YENILEGEC, 0, 0, self.pazar_log_getir, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  4658. self.noo1 = self.comp_p_log.TextLine(self.p_log, '', 44, 48, self.comp_p_log.RGB(255, 125, 0))
  4659. self.kisii1 = self.comp_p_log.TextLine(self.p_log, '', 69, 48, self.comp_p_log.RGB(255, 255, 255))
  4660. self.noo2 = self.comp_p_log.TextLine(self.p_log, '', 44, 68, self.comp_p_log.RGB(255, 125, 0))
  4661. self.kisii2 = self.comp_p_log.TextLine(self.p_log, '', 69, 68, self.comp_p_log.RGB(255, 255, 255))
  4662. self.noo3 = self.comp_p_log.TextLine(self.p_log, '', 44, 88, self.comp_p_log.RGB(255, 125, 0))
  4663. self.kisii3 = self.comp_p_log.TextLine(self.p_log, '', 69, 88, self.comp_p_log.RGB(255, 255, 255))
  4664. self.noo4 = self.comp_p_log.TextLine(self.p_log, '', 44, 108, self.comp_p_log.RGB(255, 125, 0))
  4665. self.kisii4 = self.comp_p_log.TextLine(self.p_log, '', 69, 108, self.comp_p_log.RGB(255, 255, 255))
  4666. self.noo5 = self.comp_p_log.TextLine(self.p_log, '', 44, 128, self.comp_p_log.RGB(255, 125, 0))
  4667. self.kisii5 = self.comp_p_log.TextLine(self.p_log, '', 69, 128, self.comp_p_log.RGB(255, 255, 255))
  4668. self.noo6 = self.comp_p_log.TextLine(self.p_log, '', 44, 148, self.comp_p_log.RGB(255, 125, 0))
  4669. self.kisii6 = self.comp_p_log.TextLine(self.p_log, '', 69, 148, self.comp_p_log.RGB(255, 255, 255))
  4670. self.noo7 = self.comp_p_log.TextLine(self.p_log, '', 44, 168, self.comp_p_log.RGB(255, 125, 0))
  4671. self.kisii7 = self.comp_p_log.TextLine(self.p_log, '', 69, 168, self.comp_p_log.RGB(255, 255, 255))
  4672. self.noo8 = self.comp_p_log.TextLine(self.p_log, '', 44, 188, self.comp_p_log.RGB(255, 125, 0))
  4673. self.kisii8 = self.comp_p_log.TextLine(self.p_log, '', 69, 188, self.comp_p_log.RGB(255, 255, 255))
  4674. self.noo9 = self.comp_p_log.TextLine(self.p_log, '', 44, 208, self.comp_p_log.RGB(255, 125, 0))
  4675. self.kisii9 = self.comp_p_log.TextLine(self.p_log, '', 69, 208, self.comp_p_log.RGB(255, 255, 255))
  4676. self.noo10 = self.comp_p_log.TextLine(self.p_log, '', 44, 228, self.comp_p_log.RGB(255, 125, 0))
  4677. self.kisii10 = self.comp_p_log.TextLine(self.p_log, '', 69, 228, self.comp_p_log.RGB(255, 255, 255))
  4678.  
  4679.  
  4680. import event
  4681. event.QuestButtonClick(constInfo.pazar_log_q_id)
  4682.  
  4683. def Close_p_log(self):
  4684. if constInfo.KONTROL2==1:
  4685. self.p_log.Hide()
  4686. constInfo.KONTROL2=0
  4687.  
  4688. def pazar_log_getir(self):
  4689. if gameInfo.PAZAR_CAN==0:
  4690. import event
  4691. event.QuestButtonClick(constInfo.pazar_log_q_id)
  4692. gameInfo.PAZAR_OPEN=1
  4693. gameInfo.PAZAR_TIME=app.GetTime() + 60
  4694. gameInfo.PAZAR_CAN=1
  4695. else:
  4696. chat.AppendChat(chat.CHAT_TYPE_INFO, translate.YENILE1DK)
  4697.  
  4698. def __pazar_log_ac(self):
  4699. self.pazar_log_gui()
  4700.  
  4701. def __pazar_log_bilgi_gir(self, no, alanname, vnum, fiyat, tarih):
  4702. kod = int(vnum)
  4703. item.SelectItem(kod)
  4704. item_isim = item.GetItemName()
  4705. if no == "1":
  4706. self.noo1.SetText(no)
  4707. self.kisii1.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4708. self.p_log.SetSize(600, 120)
  4709. self.pazar_bilgi_yenile.SetPosition(204, 800)
  4710. elif no == "2":
  4711. self.noo2.SetText(no)
  4712. self.kisii2.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4713. self.p_log.SetSize(600, 140)
  4714. self.pazar_bilgi_yenile.SetPosition(204, 100)
  4715. elif no == "3":
  4716. self.noo3.SetText(no)
  4717. self.kisii3.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4718. self.p_log.SetSize(600, 160)
  4719. self.pazar_bilgi_yenile.SetPosition(204, 120)
  4720. elif no == "4":
  4721. self.noo4.SetText(no)
  4722. self.kisii4.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4723. self.p_log.SetSize(600, 180)
  4724. self.pazar_bilgi_yenile.SetPosition(204, 140)
  4725. elif no == "5":
  4726. self.noo5.SetText(no)
  4727. self.kisii5.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4728. self.p_log.SetSize(600, 200)
  4729. self.pazar_bilgi_yenile.SetPosition(204, 160)
  4730. elif no == "6":
  4731. self.noo6.SetText(no)
  4732. self.kisii6.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4733. self.p_log.SetSize(600, 220)
  4734. self.pazar_bilgi_yenile.SetPosition(204, 180)
  4735. elif no == "7":
  4736. self.noo7.SetText(no)
  4737. self.kisii7.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4738. self.p_log.SetSize(600, 240)
  4739. self.pazar_bilgi_yenile.SetPosition(204, 200)
  4740. elif no == "8":
  4741. self.noo8.SetText(no)
  4742. self.kisii8.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4743. self.p_log.SetSize(600, 260)
  4744. self.pazar_bilgi_yenile.SetPosition(204, 220)
  4745. elif no == "9":
  4746. self.noo9.SetText(no)
  4747. self.kisii9.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4748. self.p_log.SetSize(600, 280)
  4749. self.pazar_bilgi_yenile.SetPosition(204, 240)
  4750. elif no == "10":
  4751. self.noo10.SetText(no)
  4752. self.kisii10.SetText(alanname + " oyuncusu " + item_isim + " itemini " + fiyat + translate.YANGKAR + tarih + " tarihinde aldi")
  4753. self.p_log.SetSize(600, 300)
  4754. self.pazar_bilgi_yenile.SetPosition(204, 260)
  4755.  
  4756. def __pazar_log_q_id(self, id):
  4757. constInfo.pazar_log_q_id = int(id)
  4758.  
  4759.  
  4760. def __pazar_log_q(self, id):
  4761. constInfo.pazar_log_q = int(id)
  4762.  
  4763.  
  4764. def __item_fiyat(self):
  4765. fiyat = constInfo.item_fiyat
  4766. net.SendQuestInputStringPacket(fiyat)
  4767.  
  4768. def __item_isim(self):
  4769. isim = constInfo.item_isim
  4770. net.SendQuestInputStringPacket(isim)
  4771.  
  4772. def __itemi_alan(self):
  4773. alanname = constInfo.itemi_alan
  4774. net.SendQuestInputStringPacket(alanname)
  4775.  
  4776. #Ticaret Gecmi?i
  4777. def __tic_quest_id(self, id):
  4778. constInfo.tic_gecmis = int(id)
  4779.  
  4780. ##Ticaret Gecmi?i
  4781. def ticaret_gecmisi(self):
  4782. constInfo.KONTROL1=1
  4783. self.Board_tic = ui.BoardWithTitleBar()
  4784. self.Board_tic.SetSize(450, 300)
  4785. self.Board_tic.SetCenterPosition()
  4786. self.Board_tic.AddFlag('movable')
  4787. self.Board_tic.AddFlag('float')
  4788. self.Board_tic.SetTitleName('Ticaret Gecmi?i')
  4789. self.Board_tic.SetCloseEvent(self.Close_tic)
  4790. self.Board_tic.Show()
  4791. self.__BuildKeyDict()
  4792. self.comp_tic = Component()
  4793.  
  4794.  
  4795. self.tic_bilgi_yenile = self.comp_tic.Button(self.Board_tic, 'Yenile', 'Ticaret Gecmi?ini Yenile', 0, 0, self.tic_gecmis_getir, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  4796. self.no1 = self.comp_tic.TextLine(self.Board_tic, '', 44, 48, self.comp_tic.RGB(255, 125, 0))
  4797. self.kisi1 = self.comp_tic.TextLine(self.Board_tic, '', 69, 48, self.comp_tic.RGB(255, 255, 255))
  4798. self.no2 = self.comp_tic.TextLine(self.Board_tic, '', 44, 68, self.comp_tic.RGB(255, 125, 0))
  4799. self.kisi2 = self.comp_tic.TextLine(self.Board_tic, '', 69, 68, self.comp_tic.RGB(255, 255, 255))
  4800. self.no3 = self.comp_tic.TextLine(self.Board_tic, '', 44, 88, self.comp_tic.RGB(255, 125, 0))
  4801. self.kisi3 = self.comp_tic.TextLine(self.Board_tic, '', 69, 88, self.comp_tic.RGB(255, 255, 255))
  4802. self.no4 = self.comp_tic.TextLine(self.Board_tic, '', 44, 108, self.comp_tic.RGB(255, 125, 0))
  4803. self.kisi4 = self.comp_tic.TextLine(self.Board_tic, '', 69, 108, self.comp_tic.RGB(255, 255, 255))
  4804. self.no5 = self.comp_tic.TextLine(self.Board_tic, '', 44, 128, self.comp_tic.RGB(255, 125, 0))
  4805. self.kisi5 = self.comp_tic.TextLine(self.Board_tic, '', 69, 128, self.comp_tic.RGB(255, 255, 255))
  4806. self.no6 = self.comp_tic.TextLine(self.Board_tic, '', 44, 148, self.comp_tic.RGB(255, 125, 0))
  4807. self.kisi6 = self.comp_tic.TextLine(self.Board_tic, '', 69, 148, self.comp_tic.RGB(255, 255, 255))
  4808. self.no7 = self.comp_tic.TextLine(self.Board_tic, '', 44, 168, self.comp_tic.RGB(255, 125, 0))
  4809. self.kisi7 = self.comp_tic.TextLine(self.Board_tic, '', 69, 168, self.comp_tic.RGB(255, 255, 255))
  4810. self.no8 = self.comp_tic.TextLine(self.Board_tic, '', 44, 188, self.comp_tic.RGB(255, 125, 0))
  4811. self.kisi8 = self.comp_tic.TextLine(self.Board_tic, '', 69, 188, self.comp_tic.RGB(255, 255, 255))
  4812. self.no9 = self.comp_tic.TextLine(self.Board_tic, '', 44, 208, self.comp_tic.RGB(255, 125, 0))
  4813. self.kisi9 = self.comp_tic.TextLine(self.Board_tic, '', 69, 208, self.comp_tic.RGB(255, 255, 255))
  4814. self.no10 = self.comp_tic.TextLine(self.Board_tic, '', 44, 228, self.comp_tic.RGB(255, 125, 0))
  4815. self.kisi10 = self.comp_tic.TextLine(self.Board_tic, '', 69, 228, self.comp_tic.RGB(255, 255, 255))
  4816.  
  4817.  
  4818. import event
  4819. event.QuestButtonClick(constInfo.tic_gecmis)
  4820.  
  4821. def Close_tic(self):
  4822. if constInfo.KONTROL1==1:
  4823. self.Board_tic.Hide()
  4824. constInfo.KONTROL1=0
  4825.  
  4826. def tic_gecmis_getir(self):
  4827. if gameInfo.TICARET_CAN==0:
  4828. import event
  4829. event.QuestButtonClick(constInfo.tic_gecmis)
  4830. gameInfo.TICARET_OPEN=1
  4831. gameInfo.TICARET_TIME=app.GetTime() + 60
  4832. gameInfo.TICARET_CAN=1
  4833. else:
  4834. chat.AppendChat(chat.CHAT_TYPE_INFO, translate.TICYENILE)
  4835.  
  4836.  
  4837. def __tic_gecmis_ac(self):
  4838. self.ticaret_gecmisi()
  4839.  
  4840. def __tic_gecmis_bilgi_gir(self, no, kisi1, kisii2, tarih):
  4841. if no == "1":
  4842. self.no1.SetText(no)
  4843. self.kisi1.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4844. self.Board_tic.SetSize(450, 120)
  4845. self.tic_bilgi_yenile.SetPosition(204, 800)
  4846. elif no == "2":
  4847. self.no2.SetText(no)
  4848. self.kisi2.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4849. self.Board_tic.SetSize(450, 140)
  4850. self.tic_bilgi_yenile.SetPosition(204, 100)
  4851. elif no == "3":
  4852. self.no3.SetText(no)
  4853. self.kisi3.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4854. self.Board_tic.SetSize(450, 160)
  4855. self.tic_bilgi_yenile.SetPosition(204, 120)
  4856. elif no == "4":
  4857. self.no4.SetText(no)
  4858. self.kisi4.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4859. self.Board_tic.SetSize(450, 180)
  4860. self.tic_bilgi_yenile.SetPosition(204, 140)
  4861. elif no == "5":
  4862. self.no5.SetText(no)
  4863. self.kisi5.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4864. self.Board_tic.SetSize(450, 200)
  4865. self.tic_bilgi_yenile.SetPosition(204, 160)
  4866. elif no == "6":
  4867. self.no6.SetText(no)
  4868. self.kisi6.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4869. self.Board_tic.SetSize(450, 220)
  4870. self.tic_bilgi_yenile.SetPosition(204, 180)
  4871. elif no == "7":
  4872. self.no7.SetText(no)
  4873. self.kisi7.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4874. self.Board_tic.SetSize(450, 240)
  4875. self.tic_bilgi_yenile.SetPosition(204, 200)
  4876. elif no == "8":
  4877. self.no8.SetText(no)
  4878. self.kisi8.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4879. self.Board_tic.SetSize(450, 260)
  4880. self.tic_bilgi_yenile.SetPosition(204, 220)
  4881. elif no == "9":
  4882. self.no9.SetText(no)
  4883. self.kisi9.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4884. self.Board_tic.SetSize(450, 280)
  4885. self.tic_bilgi_yenile.SetPosition(204, 240)
  4886. elif no == "10":
  4887. self.no10.SetText(no)
  4888. self.kisi10.SetText(kisi1 + " ile " + kisii2 + " oyuncusu " + tarih + " tarihinde ticaret yapti")
  4889. self.Board_tic.SetSize(450, 300)
  4890. self.tic_bilgi_yenile.SetPosition(204, 260)"""
  4891.  
  4892. def Uzaktan_ticaret_soru(self, isim, level):
  4893. uzaktan_sorusu = uiCommon.QuestionDialog()
  4894. uzaktan_sorusu.SetText("|cffFDD017|H|h" + str(isim)+ "|cff00ccff" + "(Nivel."+str(level)+")"+ "|h|r" + " Doreste sa negocieze la distanta cu tine.")
  4895. uzaktan_sorusu.SetAcceptEvent(lambda arg=TRUE: self.kabul(isim))
  4896. uzaktan_sorusu.SetCancelEvent(lambda arg=FALSE: self.hayir(isim))
  4897. uzaktan_sorusu.Open()
  4898. self.uzaktan_sorusu = uzaktan_sorusu
  4899. return
  4900.  
  4901. def kabul(self, isim):
  4902. net.SendChatPacket("/uzaktan_ticaret_kabul " + str(isim))
  4903. self.uzaktan_sorusu.Close()
  4904.  
  4905. def hayir(self, isim):
  4906. net.SendChatPacket("/uzaktan_ticaret_hayir " + str(isim))
  4907. self.uzaktan_sorusu.Close()
  4908.  
  4909. if app.ENABLE_SEND_TARGET_INFO:
  4910. def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
  4911. if not raceNum in constInfo.MONSTER_INFO_DATA:
  4912. constInfo.MONSTER_INFO_DATA.update({raceNum : {}})
  4913. constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []})
  4914. curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"]
  4915.  
  4916. isUpgradeable = False
  4917. isMetin = False
  4918. item.SelectItem(itemVnum)
  4919. if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
  4920. isUpgradeable = True
  4921. elif item.GetItemType() == item.ITEM_TYPE_METIN:
  4922. isMetin = True
  4923.  
  4924. for curItem in curList:
  4925. if isUpgradeable:
  4926. if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
  4927. if not (itemVnum in curItem["vnum_list"]):
  4928. curItem["vnum_list"].append(itemVnum)
  4929. return
  4930. elif isMetin:
  4931. if curItem.has_key("vnum_list"):
  4932. baseVnum = curItem["vnum_list"][0]
  4933. if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
  4934. if not (itemVnum in curItem["vnum_list"]):
  4935. curItem["vnum_list"].append(itemVnum)
  4936. return
  4937. else:
  4938. if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
  4939. return
  4940.  
  4941. if isUpgradeable or isMetin:
  4942. curList.append({"vnum_list":[itemVnum], "count":itemCount})
  4943. else:
  4944. curList.append({"vnum":itemVnum, "count":itemCount})
  4945.  
  4946. def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
  4947. self.targetBoard.RefreshMonsterInfoBoard()
  4948.  
  4949. ########Anti Exp Button by Sanii##########
  4950. def AntiExp(self, qid):
  4951. constInfo.ANTI_EXP = int(qid)
  4952.  
  4953. ########Daily reward##########
  4954. def ManagerGiftSystem(self, cmd):
  4955. cmd = cmd.split("|")
  4956. if cmd[0] == "Show":
  4957. self.wnddailygift.Show()
  4958. elif cmd[0] == "DeleteRewards":
  4959. self.wnddailygift.DeleteRewards()
  4960. elif cmd[0] == "SetDailyReward":
  4961. self.wnddailygift.SetDailyReward(cmd[1]) # numero de la recompensa
  4962. elif cmd[0] == "SetTime":
  4963. self.wnddailygift.SetTime(cmd[1]) # tiempo en numeros grandes
  4964. elif cmd[0] == "SetReward":
  4965. self.wnddailygift.SetReward(cmd[1], cmd[2]) #hacer un array con los items
  4966. elif cmd[0] == "SetRewardDone":
  4967. self.wnddailygift.SetRewardDone()
  4968.  
  4969. def AntiExpState(self, state):
  4970. constInfo.ANTI_EXP_STATE = int(state)
  4971.  
  4972. ##########################################
  4973.  
  4974. # BONI_SWITCHER
  4975. def __BoniSwitcherChangeVisible(self):
  4976. if not self.boniSwitcherWnd[self.LastBoniSwitcherId].IsShow():
  4977. self.__HideAllBoniSwitcher()
  4978. self.boniSwitcherWnd[self.LastBoniSwitcherId].Show(FALSE)
  4979. else:
  4980. self.__HideAllBoniSwitcher()
  4981.  
  4982. def __BoniSwitcherShow(self, id):
  4983. lastId = self.LastBoniSwitcherId
  4984. self.LastBoniSwitcherId = id
  4985. if not self.boniSwitcherWnd[id].IsShow():
  4986. self.__HideAllBoniSwitcher()
  4987. (x, y) = self.boniSwitcherWnd[lastId].GetGlobalPosition()
  4988. self.boniSwitcherWnd[id].SetPosition(x, y)
  4989. self.boniSwitcherWnd[id].Show(FALSE)
  4990.  
  4991. def __BoniSwitcherHide(self, id):
  4992. if self.boniSwitcherWnd[id]:
  4993. self.boniSwitcherWnd[id].Hide()
  4994.  
  4995. def __HideAllBoniSwitcher(self):
  4996. for i in xrange(len(self.boniSwitcherWnd)):
  4997. self.__BoniSwitcherHide(i)
  4998.  
  4999. def __ResetBoniFromSwitcher(self):
  5000. constInfo.BONI_LIST_WEAPON = []
  5001. constInfo.BONI_LIST_WEAPON_ADDON = []
  5002. constInfo.BONI_LIST_ARMOR = []
  5003. constInfo.BONI_LIST_BRACELET = []
  5004. constInfo.BONI_LIST_BOOTS = []
  5005. constInfo.BONI_LIST_NECKLACE = []
  5006. constInfo.BONI_LIST_HELMET = []
  5007. constInfo.BONI_LIST_SHIELD = []
  5008. constInfo.BONI_LIST_EARRINGS = []
  5009. # ITEM_SHOP
  5010. def __ItemShopShow(self):
  5011. if not self.itemShopWnd:
  5012. import uiItemShop
  5013. self.itemShopWnd = uiItemShop.ItemShopBoard()
  5014. self.itemShopWnd.Show()
  5015.  
  5016. def __ISSetLoadButtonIndex(self, index):
  5017. constInfo.ITEM_SHOP_LOAD_BUTTON_INDEX = int(index)
  5018.  
  5019. def __ISSetBuyButtonIndex(self, index):
  5020. constInfo.ITEM_SHOP_BUY_BUTTON_INDEX = int(index)
  5021.  
  5022. def __ISGetBuyID(self):
  5023. if self.itemShopWnd:
  5024. net.SendQuestInputStringPacket(self.itemShopWnd.GetBuyItemString())
  5025. else:
  5026. net.SendQuestInputStringPacket("ERROR")
  5027.  
  5028. def __ISGetBuyID2(self):
  5029. if self.itemShopWnd:
  5030. net.SendQuestInputStringPacket(self.itemShopWnd.GetBuyItemString2())
  5031. else:
  5032. net.SendQuestInputStringPacket("ERROR")
  5033.  
  5034. def __Input0(self):
  5035. constInfo.INPUT_IGNORE = 0
  5036.  
  5037. def __Input1(self):
  5038. constInfo.INPUT_IGNORE = 1
  5039.  
  5040. def __ISAddCategory(self, catId, catName):
  5041. self.itemShopWnd.AddCategory(catId, catName.replace("[_]", " "))
  5042.  
  5043. def __primera_muerte(self):
  5044. self.primera_muerte.Show()
  5045. snd.PlaySound("sound/ui/primera_muerte.wav")
  5046. net.SendChatPacket("(primera_muerte)")
  5047.  
  5048. def __doble_muerte(self):
  5049. self.doble_muerte.Show()
  5050. snd.PlaySound("sound/ui/doble_muerte.wav")
  5051. net.SendChatPacket("(doble_muerte)")
  5052.  
  5053. def __triple_muerte(self):
  5054. self.triple_muerte.Show()
  5055. snd.PlaySound("sound/ui/triple_muerte.wav")
  5056. net.SendChatPacket("(triple_muerte)")
  5057.  
  5058. def __exterminio(self):
  5059. self.exterminio.Show()
  5060. snd.PlaySound("sound/ui/exterminio.wav")
  5061. net.SendChatPacket("(exterminio)")
  5062.  
  5063. def __muertacular(self):
  5064. self.muertacular.Show()
  5065. snd.PlaySound("sound/ui/muertacular.wav")
  5066. net.SendChatPacket("(muertacular)")
  5067.  
  5068. def __bestialidad(self):
  5069. self.bestialidad.Show()
  5070. snd.PlaySound("sound/ui/bestialidad.wav")
  5071. net.SendChatPacket("(bestialidad)")
  5072.  
  5073. def __salvajada(self):
  5074. self.salvajada.Show()
  5075. snd.PlaySound("sound/ui/salvajada.wav")
  5076. net.SendChatPacket("(salvajada)")
  5077.  
  5078. def __catastrofe(self):
  5079. self.catastrofe.Show()
  5080. snd.PlaySound("sound/ui/catastrofe.wav")
  5081. net.SendChatPacket("(catastrofe)")
  5082.  
  5083. def __apocalipsis(self):
  5084. self.apocalipsis.Show()
  5085. snd.PlaySound("sound/ui/apocalipsis.wav")
  5086. net.SendChatPacket("(apocalipsis)")
  5087.  
  5088. def __lluvia_muertos(self):
  5089. self.lluvia_muertos.Show()
  5090. snd.PlaySound("sound/ui/lluvia_muertos.wav")
  5091. net.SendChatPacket("(lluvia_muertos)")
  5092.  
  5093. def __super_increible(self):
  5094. self.super_increible.Show()
  5095. snd.PlaySound("sound/ui/super_increible.wav")
  5096. net.SendChatPacket("(super_increible)")
  5097.  
  5098. def __hidemedallas_gui(self):
  5099. self.Medallas_gui.Hide()
  5100. self.primera_muerte.Hide()
  5101. self.doble_muerte.Hide()
  5102. self.triple_muerte.Hide()
  5103. self.exterminio.Hide()
  5104. self.muertacular.Hide()
  5105. self.bestialidad.Hide()
  5106. self.salvajada.Hide()
  5107. self.catastrofe.Hide()
  5108. self.apocalipsis.Hide()
  5109. self.lluvia_muertos.Hide()
  5110. self.super_increible.Hide()
  5111. self.muertes.Hide()
  5112.  
  5113. def __showmedallas_gui(self):
  5114. self.Medallas_gui.Show()
  5115. self.muertes.Show()
  5116.  
  5117. def __muertes(self, muertes):
  5118. self.muertes.SetText(muertes)
  5119.  
  5120. def __ISSelectCategory(self, catId):
  5121. self.itemShopWnd.SelectCategory(catId)
  5122.  
  5123. def __ISClearItems(self):
  5124. self.itemShopWnd.Clear()
  5125.  
  5126. def __ISAddItem(self, catId, itemId, itemVnum, itemCount, itemCost, itemCostType, attr1, val1, attr2, val2, attr3, val3, attr4, val4, attr5, val5, attr6, val6, attr7, val7, sock1, sock2, sock3):
  5127. itemAttr = [[attr1, val1], [attr2, val2], [attr3, val3], [attr4, val4], [attr5, val5], [attr6, val6], [attr7, val7]]
  5128. for attr in itemAttr:
  5129. attr[0] = int(attr[0])
  5130. attr[1] = int(attr[1])
  5131. itemSocket = [int(sock1), int(sock2), int(sock3)]
  5132. self.curIsItem = {
  5133. "cat" : catId,
  5134. "id" : itemId,
  5135. "vnum" : itemVnum,
  5136. "count" : itemCount,
  5137. "desc" : "",
  5138. "cost" : itemCost,
  5139. "cost_type" : itemCostType,
  5140. "attr" : itemAttr,
  5141. "socket" : itemSocket,
  5142. }
  5143.  
  5144. def __ISAddItemDesc(self, itemDesc):
  5145. obj = self.curIsItem
  5146. if not obj:
  5147. return
  5148. obj["desc"] += itemDesc.replace("[_]", " ")
  5149.  
  5150. self.itemShopWnd.AddItem(obj["cat"], obj["id"], obj["vnum"], obj["count"], obj["desc"], obj["cost"], obj["cost_type"], obj["attr"], obj["socket"])
  5151. self.curIsItem = None
  5152.  
  5153. def __ISSetLoadSuccess(self):
  5154. self.itemShopWnd.SetLoadSuccess()
  5155.  
  5156. def __ISSetLoadFail(self):
  5157. self.itemShopWnd.SetLoadFail()
  5158.  
  5159. def __ISSetBuySuccess(self):
  5160. self.itemShopWnd.SetItemBuySuccess()
  5161.  
  5162. def __ISSetBuyFail(self):
  5163. self.itemShopWnd.SetItemBuyFail()
  5164.  
  5165. def __ISSetCoins(self, coins):
  5166. self.itemShopWnd.SetCoins(coins)
  5167.  
  5168. def __ISSetMarks(self, marks):
  5169. self.itemShopWnd.SetMarks(marks)
  5170. # END_ITEM_SHOP
  5171. def __AddBoniToSwitcher(self, EquipType, boniType):
  5172. EquipType = int(EquipType)
  5173. if EquipType == 1:
  5174. constInfo.BONI_LIST_WEAPON.append(int(boniType))
  5175. constInfo.BONI_LIST_WEAPON_ADDON.append(int(boniType))
  5176. elif EquipType == 2:
  5177. constInfo.BONI_LIST_ARMOR.append(int(boniType))
  5178. elif EquipType == 3:
  5179. constInfo.BONI_LIST_BRACELET.append(int(boniType))
  5180. elif EquipType == 4:
  5181. constInfo.BONI_LIST_BOOTS.append(int(boniType))
  5182. elif EquipType == 5:
  5183. constInfo.BONI_LIST_NECKLACE.append(int(boniType))
  5184. elif EquipType == 6:
  5185. constInfo.BONI_LIST_HELMET.append(int(boniType))
  5186. elif EquipType == 7:
  5187. constInfo.BONI_LIST_SHIELD.append(int(boniType))
  5188. elif EquipType == 8:
  5189. constInfo.BONI_LIST_EARRINGS.append(int(boniType))
  5190. elif EquipType == 9:
  5191. constInfo.BONI_LIST_WEAPON_ADDON.append(int(boniType))
  5192.  
  5193. def __AddMaxValueToBoni(self, boniType, maxValue):
  5194. constInfo.BONI_LIST_MAX_VALUE[int(boniType)] = int(maxValue)
  5195.  
  5196. def __SetBoniSwitcherLoad(self):
  5197. constInfo.BONI_SWITCHER_LOAD = TRUE
  5198.  
  5199. def __BoniSwitcherCheckEvent(self, slotPos):
  5200. for boniSwitcher in self.boniSwitcherWnd:
  5201. if boniSwitcher.aktItemPos == int(slotPos):
  5202. return TRUE
  5203. return FALSE
  5204. # END_BONI_SWITCHER
  5205.  
  5206.  
  5207. def Teleport(self, getString):
  5208. if getString.find("index") != -1:
  5209. self.teleport.UpdateIndex(int(getString.split("x")[1]))
  5210. else:
  5211. constInfo.SendString = str(self.teleport.SendToServer)
  5212. constInfo.CApiSetHide = 1
  5213.  
  5214. def __evento_ultimo_superviviente(self):
  5215. import net
  5216. net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING)
  5217.  
  5218. def __Switcher(self):
  5219. import uiswitch
  5220. self.wndSwitch = uiswitch.Switcher()
  5221. self.wndSwitch.Show()
  5222.  
  5223. # def __menubg2(self):
  5224. # if constInfo.MENU_BG2 == 0:
  5225. # constInfo.MENU_BG2 = 1
  5226. # self.menu_bg2.Show()
  5227. # self.Activare_Menu2.Hide()
  5228. # self.Dezactivare_Menu2.Show()
  5229.  
  5230. # else:
  5231. # constInfo.MENU_BG2 = 0
  5232. # self.menu_bg2.Hide()
  5233. # self.Activare_Menu2.Show()
  5234. # self.Dezactivare_Menu2.Hide()
  5235. # def __DMAGAZIN_questindex(self, value):
  5236. # constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX = int(value)
  5237.  
  5238. # def __DeschidereMagazin(self):
  5239. # DeschidereMagazin = constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX
  5240. # event.QuestButtonClick(DeschidereMagazin)
  5241.  
  5242. # def __menubg(self):
  5243. ## if constInfo.MENU_BG == 0:
  5244. # constInfo.MENU_BG = 1
  5245. # self.menu_bg.Show()
  5246. # self.Activare_Menu.Hide()
  5247. # self.Dezactivare_Menu.Show()
  5248. # else:
  5249. # constInfo.MENU_BG = 0
  5250. # self.menu_bg.Hide()
  5251. # self.Activare_Menu.Show()
  5252. # self.Dezactivare_Menu.Hide()
  5253.  
  5254. # def __BonusPage(self):
  5255. # import uibonuspage
  5256. # self.wndBonus = uibonuspage.BonusBoardDialog()
  5257. # self.wndBonus.Show()
  5258.  
  5259. # switchbot
  5260. # def __JINHAN(self):
  5261. # import uistatusup
  5262. # self.wndJinHan = uistatusup.StatusUp()
  5263. # self.wndJinHan.Show()
  5264. # END_switchbot
  5265.  
  5266. def __bonus_questindex(self, value3):
  5267. constInfo.BONUS_QUESTINDEX = int(value3)
  5268.  
  5269. def __activare_bonus(self):
  5270. activare_bonus = constInfo.BONUS_QUESTINDEX
  5271. event.QuestButtonClick(activare_bonus)
  5272.  
  5273. def __depozit_questindex(self, qid):
  5274. constInfo.Depoport= int(qid)
  5275.  
  5276. def __activare_depozit(self):
  5277. activare_depozit = constInfo.DEPOZIT_QUESTINDEX
  5278. event.QuestButtonClick(activare_depozit)
  5279.  
  5280. def __antiexp_questindex(self, value1):
  5281. constInfo.ANTIEXP_QUESTINDEX = int(value1)
  5282.  
  5283. def __activare_antiexp(self):
  5284. activare_antiexp = constInfo.ANTIEXP_QUESTINDEX
  5285. event.QuestButtonClick(activare_antiexp)
  5286.  
  5287. def __teleporter_questindex(self, value2):
  5288. constInfo.TELEPORTER_QUESTINDEX = int(value2)
  5289.  
  5290. def __activare_teleporter(self):
  5291. activare_teleporter = constInfo.TELEPORTER_QUESTINDEX
  5292. event.QuestButtonClick(activare_teleporter)
  5293.  
  5294. def showtransfer(self):
  5295. import uiTransfer
  5296. self.TransferWnd = uiTransfer.TransferWindow()
  5297. self.TransferWnd.Open()
  5298.  
  5299. # 5Lv Beceri Sistemi
  5300. # Gui Sistemleri
  5301. def __BecSystem1(self):
  5302. self.black = savbec.BlackIsinlanma()
  5303. self.black.OpenWindow()
  5304.  
  5305. def __BecSystem2(self):
  5306. self.black = surabec.BlackIsinlanma()
  5307. self.black.OpenWindow()
  5308.  
  5309. def __BecSystem3(self):
  5310. self.black = ninjabec.BlackIsinlanma()
  5311. self.black.OpenWindow()
  5312.  
  5313. def __BecSystem4(self):
  5314. self.black = samanbec.BlackIsinlanma()
  5315. self.black.OpenWindow()
  5316.  
  5317. def __BecSystem5(self):
  5318. self.black = lycanbec.BlackIsinlanma()
  5319. self.black.OpenWindow()
  5320.  
  5321. # Beceri Sistemleri
  5322. # Savasci Becerileri
  5323. def zihinsel_oto_bec(self,qid):
  5324. constInfo.zihinsel_oto_bec = int(qid)
  5325.  
  5326. def bedensel_oto_bec(self,qid):
  5327. constInfo.bedensel_oto_bec = int(qid)
  5328.  
  5329. # Sura Becerileri
  5330. def karabuyu_oto_bec(self,qid):
  5331. constInfo.karabuyu_oto_bec = int(qid)
  5332.  
  5333. def buyulusilah_oto_bec(self,qid):
  5334. constInfo.buyulusilah_oto_bec = int(qid)
  5335.  
  5336. # Ninja Becerileri
  5337. def yakin_oto_bec(self,qid):
  5338. constInfo.yakin_oto_bec = int(qid)
  5339.  
  5340. def uzak_oto_bec(self,qid):
  5341. constInfo.uzak_oto_bec = int(qid)
  5342.  
  5343. # Saman Becerileri
  5344. def ejderha_oto_bec(self,qid):
  5345. constInfo.ejderha_oto_bec = int(qid)
  5346.  
  5347. def iyilestirme_oto_bec(self,qid):
  5348. constInfo.iyilestirme_oto_bec = int(qid)
  5349.  
  5350. # Lycan Becerileri
  5351. def lycany_oto_bec(self,qid):
  5352. constInfo.lycany_oto_bec = int(qid)
  5353.  
  5354. #def lycanu_oto_bec(self,qid):
  5355. # constInfo.lycanu_oto_bec = int(qid)
  5356.  
  5357. #def __showbonus(self):
  5358. # serex = uibonuspage.BonusBoardDialog()
  5359.  
  5360. def __showbonus(self):
  5361. import uiBonusPage
  5362. global bonuspp
  5363. try:
  5364. if bonuspp != 1:
  5365. exec 'uiBonusPage.BonusBoardDialog().Show()'
  5366. else:
  5367. pass
  5368. except ImportError:
  5369. import dbg,app
  5370. dbg.Trace('uiBonusPage.py Importing error')
  5371. app.Abort()
  5372. # guildstorage begin
  5373.  
  5374. def _GuildStorageCMD(self, command):
  5375. cmd = command.split("/")
  5376.  
  5377. if cmd[0] == "OPEN":
  5378. self.interface.GuildStorageWindow.Open(int(cmd[1]))
  5379. elif cmd[0] == "REFRESH":
  5380. self.interface.GuildStorageWindow.RefreshSlots()
  5381. elif cmd[0] == "REFRESH_MONEY":
  5382. self.interface.GuildStorageWindow.SetMoney(cmd[1])
  5383. elif cmd[0] == "REFRESH_MEMBERS":
  5384. self.interface.GuildStorageWindow.Adminpanel["board"].RefreshMembers()
  5385. elif cmd[0] == "CLEAR_TEMPSLOTS":
  5386. constInfo.GUILDSTORAGE["tempslots"] = {"TAB0" : {},"TAB1" : {},"TAB2" : {}}
  5387. elif cmd[0] == "COMPARE_TEMPSLOTS":
  5388. for i in range(3):
  5389. if constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)] != constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)]:
  5390. constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = {}
  5391. constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)]
  5392. self.interface.GuildStorageWindow.RefreshSlots()
  5393. elif cmd[0] == "QID":
  5394. self.GuildStorageQID(cmd[1])
  5395. elif cmd[0] == "QUESTCMD":
  5396. self._GuildStorageQuestCMD()
  5397. #self.teleport = uiteleport.TeleportWindow()
  5398. elif cmd[0] == "MEMBER_COMPLETE":
  5399. constInfo.GUILDSTORAGE["members"] = {}
  5400. self.interface.GuildStorageWindow.ClearMembers()
  5401. import event
  5402. constInfo.GUILDSTORAGE["questCMD"] = "GETMEMBERLIST"
  5403. event.QuestButtonClick(int(constInfo.GUILDSTORAGE["qid"]))
  5404.  
  5405.  
  5406. def _GuildStorageAddItemSlot(self, slot, tab ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
  5407. self.interface.GuildStorageWindow.AddItemSlot(slot, tab ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6)
  5408.  
  5409. def _GuildStorageAddItem(self, slot ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
  5410. slotsWidth = 15
  5411. slotsHeight = 8
  5412. slot = int(slot)
  5413. if slot <= 120:
  5414. constInfo.GUILDSTORAGE["slots"]["TAB0"][slot] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  5415. elif slot > 120 and slot <= 240:
  5416. constInfo.GUILDSTORAGE["slots"]["TAB1"][slot-120] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  5417. elif slot > 240 and slot <= 360:
  5418. constInfo.GUILDSTORAGE["slots"]["TAB2"][slot-240] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  5419.  
  5420. def _GuildStorageTempSlotsAdd(self,slot ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
  5421. slot = int(slot)
  5422. if slot <= 120:
  5423. constInfo.GUILDSTORAGE["tempslots"]["TAB0"][slot] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  5424. elif slot > 120 and slot <= 240:
  5425. constInfo.GUILDSTORAGE["tempslots"]["TAB1"][slot-120] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  5426. elif slot > 240 and slot <= 360:
  5427. constInfo.GUILDSTORAGE["tempslots"]["TAB2"][slot-240] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
  5428.  
  5429. def _GuildStorageAddLog(self,id,name,date,type,do,desc):
  5430. self.interface.GuildStorageWindow.LogsInsert(id,name,date,type,do,desc)
  5431. constInfo.GUILDSTORAGE["logs"][int(id)] = [name,date,type,do,desc]
  5432.  
  5433. def _GuildStorageQuestCMD(self):
  5434. net.SendQuestInputStringPacket(str(constInfo.GUILDSTORAGE["questCMD"]))
  5435. constInfo.GUILDSTORAGE["questCMD"] = "NULL#"
  5436.  
  5437. def GuildStorageQID(self, qid):
  5438. constInfo.GUILDSTORAGE["qid"] = int(qid)
  5439.  
  5440. def _GuildStorageAddMemberToList(self,memberId,member,authority0,authority1,authority2,authority3):
  5441. constInfo.GUILDSTORAGE["members"]["member"+memberId] = [member,int(authority0),int(authority1),int(authority2),int(authority3)]
  5442. # Guildstorage end
  5443. def __MountSystem(self, info, i=0):
  5444. if info=="Item":
  5445. if i!=0:
  5446. constInfo.MountSystem["index"] = int(i)
  5447. self.MountingSystem.Open()
  5448. elif info=="Input":
  5449. net.SendQuestInputStringPacket(str(constInfo.MountSystem["CMD"]))
  5450.  
  5451. def __SchicksalRad(self, cmd):
  5452. CMD = cmd.split("/")
  5453. if CMD[0]=="index":
  5454. constInfo.SCHICKSAL_RAD["index"] = int(CMD[1])
  5455. constInfo.SCHICKSAL_RAD["kosten"] = int(CMD[2])
  5456. constInfo.SCHICKSAL_RAD["free"] = int(CMD[3])
  5457. elif CMD[0]=="input":
  5458. net.SendQuestInputStringPacket(str(constInfo.SCHICKSAL_RAD["ServerCMD"]))
  5459. elif CMD[0]=="free":
  5460. constInfo.SCHICKSAL_RAD["free"] = int(CMD[1])
  5461. elif CMD[0]=="Answer":
  5462. self.SchicksalRad.SetVars(CMD[1], CMD[2], CMD[3], CMD[4], CMD[5])
  5463. constInfo.SCHICKSAL_RAD["free"] = int(CMD[6])
  5464.  
  5465. def __guinameOPEN(self): # use different function names!
  5466. import schicksalrad
  5467. self.SchicksalRad = schicksalrad.RadDesSchicksals()
  5468. self.SchicksalRad.Open()() # naturally use the code which is provided for the GUI
  5469.  
  5470. if app.ENABLE_MELEY_LAIR_DUNGEON:
  5471. def OpenMeleyRanking(self):
  5472. if self.interface:
  5473. self.interface.OpenMeleyRanking()
  5474.  
  5475. def AddRankMeleyRanking(self, data):
  5476. if self.interface:
  5477. line = int(data.split("#")[1])
  5478. name = str(data.split("#")[2])
  5479. members = int(data.split("#")[3])
  5480. seconds = int(data.split("#")[4])
  5481. minutes = seconds // 60
  5482. seconds %= 60
  5483. if seconds > 0:
  5484. time = localeInfo.TIME_MIN_SEC % (minutes, seconds)
  5485. else:
  5486. time = localeInfo.TIME_MIN % (minutes)
  5487.  
  5488. self.interface.RankMeleyRanking(line, name, members, time)
  5489.  
  5490. if app.WJ_SECURITY_SYSTEM:
  5491. def OpenSecurityCreate(self):
  5492. if self.interface:
  5493. self.interface.OpenSecurityCreate()
  5494.  
  5495. def OpenSecurityDialog(self):
  5496. if self.interface:
  5497. self.interface.OpenSecurityDialog()
  5498.  
  5499. def CloseSecurityCreate(self):
  5500. if self.interface:
  5501. self.interface.CloseSecurityCreate()
  5502.  
  5503. def CloseSecurityDialog(self):
  5504. if self.interface:
  5505. self.interface.CloseSecurityDialog()
  5506.  
  5507. if app.ENABLE_SASH_SYSTEM:
  5508. def ActSash(self, iAct, bWindow):
  5509. if self.interface:
  5510. self.interface.ActSash(iAct, bWindow)
  5511.  
  5512. def AlertSash(self, bWindow):
  5513. snd.PlaySound("sound/ui/make_soket.wav")
  5514. if bWindow:
  5515. self.PopupMessage(localeInfo.SASH_DEL_SERVEITEM)
  5516. else:
  5517. self.PopupMessage(localeInfo.SASH_DEL_ABSORDITEM)
  5518.  
  5519. if app.WJ_CHANGELOOK_SYSTEM:
  5520. def ActChangeLook(self, iAct):
  5521. if self.interface:
  5522. self.interface.ActChangeLook(iAct)
  5523.  
  5524. def AlertChangeLook(self):
  5525. self.PopupMessage(localeInfo.CHANGE_LOOK_DEL_ITEM)
  5526.  
  5527. def OpenGuiGaya(self):
  5528. self.interface.OpenGuiGaya()
  5529.  
  5530. def GayaCheck(self):
  5531. self.interface.GayaCheck()
  5532.  
  5533. def OpenGuiGayaMarket(self):
  5534. self.interface.OpenGuiGayaMarket()
  5535.  
  5536. def GayaMarketItems(self,vnums,gaya,count):
  5537. self.interface.GayaMarketItems(vnums,gaya,count)
  5538.  
  5539. def GayaMarketSlotsDesblock(self,slot0,slot1,slot2,slot3,slot4,slot5):
  5540. self.interface.GayaMarketSlotsDesblock(slot0,slot1,slot2,slot3,slot4,slot5)
  5541.  
  5542. def GayaMarketClear(self):
  5543. self.interface.GayaMarketClear()
  5544.  
  5545. def GayaTimeMarket(self, time):
  5546. self.interface.GayaTime(time)
  5547.  
  5548. if app.WJ_SHOP_SEARCH_SYSTEM:
  5549. def OpenPrivateShopSearch(self, type):
  5550. if self.interface:
  5551. self.interface.OpenPrivateShopSearch(type)
  5552.  
  5553. def RefreshShopSearch(self):
  5554. self.interface.RefreshShopSearch()
  5555.  
  5556. def BuyShopSearch(self):
  5557. self.interface.RefreshShopSearch()
  5558. self.PopupMessage(localeInfo.PRIVATESHOPSEARCH_BUY_SUCCESS)
  5559.  
  5560. if app.ENABLE_SHOW_CHEST_DROP:
  5561. def BINARY_AddChestDropInfo(self, chestVnum, pageIndex, slotIndex, itemVnum, itemCount):
  5562. if self.interface:
  5563. self.interface.AddChestDropInfo(chestVnum, pageIndex, slotIndex, itemVnum, itemCount)
  5564.  
  5565. def BINARY_RefreshChestDropInfo(self, chestVnum):
  5566. if self.interface:
  5567. self.interface.RefreshChestDropInfo(chestVnum)
  5568.  
  5569. def lonca_gecmis_q(self, id):
  5570. import constInfo
  5571. constInfo.lonca_gecmis_q = int(id)
  5572.  
  5573. def lonca_gecmis_ekle(self, isim):
  5574. import constInfo
  5575. constInfo.lonca_gecmis_list.append(isim)
  5576.  
  5577. def gecmistemizle(self):
  5578. import constInfo
  5579. constInfo.lonca_gecmis_list = []
  5580.  
  5581. def isim_ver(self):
  5582. import constInfo
  5583. net.SendQuestInputStringPacket(str(constInfo.lonca_gecmis_isim))
  5584.  
  5585. def uyari(self, msg):
  5586. if msg == "bilgiyok":
  5587. self.PopupMessage("Henuz bilgi girilmemis!")
  5588. elif msg == "loncayok":
  5589. self.PopupMessage("Lonca bulunamadi")
  5590.  
  5591. def siralamaopen(self):
  5592. self.oyunicisiralama.Open()
  5593.  
  5594. def __oyunicisirala(self, info):
  5595. CMD = info.split("/")
  5596. if CMD[0]=="index":
  5597. constInfo.oyunicisiralama["index"] = int(CMD[1])
  5598. elif CMD[0]=="input":
  5599. net.SendQuestInputStringPacket(str(constInfo.oyunicisiralama["CMD"]))
  5600. elif CMD[0]=="yeniliste":
  5601. constInfo.oyunicisiralama["Liste"] = []
  5602. elif CMD[0]=="liste":
  5603. constInfo.oyunicisiralama["Liste"].append(CMD[1].split("|"))
  5604. elif CMD[0]=="blok":
  5605. self.oyunicisiralama.LoadPage(CMD[1])
  5606. elif CMD[0]=="sayfa":
  5607. self.oyunicisiralama.Setsayfa(CMD[1])
  5608.  
  5609. def uyarisiralama(self, msg):
  5610. if msg == "bilgiyok":
  5611. self.PopupMessage("Henuz bilgi girilmemis!")
  5612. elif msg == "oyuncuyok":
  5613. self.PopupMessage("Oyuncu bulunamadi!")
  5614.  
  5615. def loncasiralamaopen(self):
  5616. self.loncasiralama.Open()
  5617.  
  5618. def __oyunicilonca(self, info):
  5619. CMD = info.split("/")
  5620. if CMD[0]=="index":
  5621. constInfo.loncasiralama["index"] = int(CMD[1])
  5622. elif CMD[0]=="input":
  5623. net.SendQuestInputStringPacket(str(constInfo.loncasiralama["CMD"]))
  5624. elif CMD[0]=="yeniliste":
  5625. constInfo.loncasiralama["Liste"] = []
  5626. elif CMD[0]=="liste":
  5627. constInfo.loncasiralama["Liste"].append(CMD[1].split("|"))
  5628. elif CMD[0]=="blok":
  5629. self.loncasiralama.LoadPage(CMD[1])
  5630. elif CMD[0]=="sayfa":
  5631. self.loncasiralama.Setsayfa(CMD[1])
  5632.  
  5633. def uyariloncasira(self, msg):
  5634. if msg == "bilgiyok":
  5635. self.PopupMessage("Henuz bilgi girilmemis!")
  5636. elif msg == "oyuncuyok":
  5637. self.PopupMessage("Oyuncu bulunamadi!")
  5638.  
  5639. def recordac(self):
  5640. self.recordscreen.Open()
  5641.  
  5642. def __recordscreen(self, info):
  5643. CMD = info.split("/")
  5644. if CMD[0]=="index":
  5645. constInfo.record["index"] = int(CMD[1])
  5646. elif CMD[0]=="input":
  5647. net.SendQuestInputStringPacket(str(constInfo.record["CMD"]))
  5648. elif CMD[0]=="yeniliste":
  5649. constInfo.record["Liste"] = []
  5650. elif CMD[0]=="liste":
  5651. constInfo.record["Liste"].append(CMD[1].split("|"))
  5652. elif CMD[0]=="blok":
  5653. self.recordscreen.LoadPage(CMD[1])
  5654. elif CMD[0]=="sayfa":
  5655. self.recordscreen.Setsayfa(CMD[1])
  5656.  
  5657. def recordwarning(self, msg):
  5658. if msg == "bilgiyok":
  5659. self.PopupMessage("Bilgi yok!")
  5660. elif msg == "oyuncuyok":
  5661. self.PopupMessage("Oyuncu bulunamadi!")
  5662.  
  5663. def lonca_tanitim(self):
  5664. self.loncanitanit.Open()
  5665.  
  5666. def loncatanitekran(self):
  5667. self.loncanitanit.Open()
  5668.  
  5669. def __loncatanitim(self, info):
  5670. CMD = info.split("/")
  5671. if CMD[0]=="index":
  5672. constInfo.loncani_tanit["index"] = int(CMD[1])
  5673. elif CMD[0]=="input":
  5674. net.SendQuestInputStringPacket(str(constInfo.loncani_tanit["CMD"]))
  5675. elif CMD[0]=="yeniliste":
  5676. constInfo.loncani_tanit["Liste"] = []
  5677. elif CMD[0]=="liste":
  5678. constInfo.loncani_tanit["Liste"].append(CMD[1].split("|"))
  5679. elif CMD[0]=="blok":
  5680. self.loncanitanit.LoadPage(CMD[1])
  5681. elif CMD[0]=="sayfa":
  5682. self.loncanitanit.Setsayfa(CMD[1])
  5683.  
  5684. def lonca_lider_q(self,qid):
  5685. constInfo.lonca_lider_q = int(qid)
  5686.  
  5687. def lider_ekle(self, isim, lonca):
  5688. import constInfo
  5689. constInfo.lider_list.append("#"+isim+"#"+lonca)
  5690.  
  5691. def lider_sifirla(self):
  5692. import constInfo
  5693. constInfo.lider_list = []
  5694.  
  5695. def __BonusPage(self):
  5696. import PaginaBonusuri
  5697. global BPisLodaded
  5698. try:
  5699. if BPisLodaded[0] == 0:
  5700. BPisLodaded[0] = 1
  5701. exec 'PaginaBonusuri.BonusBoardDialog().Show()'
  5702. else:
  5703. BPisLodaded[0] = 0
  5704. exec 'PaginaBonusuri.BonusBoardDialog().Hide()'
  5705.  
  5706. except ImportError:
  5707. import dbg,app
  5708. dbg.Trace('PaginaBonusuri.py Importing error')
  5709. app.Abort
  5710.  
  5711. if app.ENABLE_SUPPORT_SYSTEM:
  5712. def OpenSupportGui(self):
  5713. if constInfo.SUPPORTGUI == 0:
  5714. self.supportpg.Show()
  5715. self.supportpg.SetTop()
  5716. constInfo.SUPPORTGUI = 1
  5717. else:
  5718. self.supportpg.Close()
  5719. constInfo.SUPPORTGUI = 0
  5720.  
  5721. def SetSupportLevel(self, level):
  5722. self.supportpg.SetLevel(level)
  5723. constInfo.SUPPORTLEVEL = int(level)
  5724.  
  5725. def SetSupportName(self, name, name2):
  5726. self.supportpg.SetName(name, name2)
  5727.  
  5728. def SupportLeave(self):
  5729. self.supportpg.SetDefaultInfo()
  5730. self.supportpg.Close()
  5731.  
  5732. def SupportInt(self , ints):
  5733. self.supportpg.SetInt(ints)
  5734.  
  5735. def SetSupportExp(self, exp, exptot):
  5736. if int(exptot) > 0:
  5737. self.supportpg.SetExperience(exp, exptot)
  5738. self.supportpg.SetExperience(exp, exptot)
  5739.  
  5740. def SetSupportIcon(self, vnum):
  5741. if int(vnum) > 0:
  5742. self.supportpg.SetImageSlot(vnum)
  5743. self.supportpg.SetImageSlot(vnum)
  5744.  
  5745. def SetSupportSpeciality(self,speciality):
  5746. self.supportpg.SetSpeciality(speciality)
  5747.  
  5748. #def test(self):
  5749. # background.SetVisiblePart(background.PART_TREE, False)#True
  5750.  
  5751. class Component:
  5752. def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):
  5753. button = ui.Button()
  5754. if parent != None:
  5755. button.SetParent(parent)
  5756. button.SetPosition(x, y)
  5757. button.SetUpVisual(UpVisual)
  5758. button.SetOverVisual(OverVisual)
  5759. button.SetDownVisual(DownVisual)
  5760. button.SetText(buttonName)
  5761. button.SetToolTipText(tooltipText)
  5762. button.Show()
  5763. button.SetEvent(func)
  5764. return button
  5765.  
  5766. def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual):
  5767. button = ui.ToggleButton()
  5768. if parent != None:
  5769. button.SetParent(parent)
  5770. button.SetPosition(x, y)
  5771. button.SetUpVisual(UpVisual)
  5772. button.SetOverVisual(OverVisual)
  5773. button.SetDownVisual(DownVisual)
  5774. button.SetText(buttonName)
  5775. button.SetToolTipText(tooltipText)
  5776. button.Show()
  5777. button.SetToggleUpEvent(funcUp)
  5778. button.SetToggleDownEvent(funcDown)
  5779. return button
  5780.  
  5781. def EditLine(self, parent, editlineText, x, y, width, heigh, max):
  5782. SlotBar = ui.SlotBar()
  5783. if parent != None:
  5784. SlotBar.SetParent(parent)
  5785. SlotBar.SetSize(width, heigh)
  5786. SlotBar.SetPosition(x, y)
  5787. SlotBar.Show()
  5788. Value = ui.EditLine()
  5789. Value.SetParent(SlotBar)
  5790. Value.SetSize(width, heigh)
  5791. Value.SetPosition(1, 1)
  5792. Value.SetMax(max)
  5793. Value.SetLimitWidth(width)
  5794. Value.SetMultiLine()
  5795. Value.SetText(editlineText)
  5796. Value.Show()
  5797. return SlotBar, Value
  5798.  
  5799. def TextLine(self, parent, textlineText, x, y, color):
  5800. textline = ui.TextLine()
  5801. if parent != None:
  5802. textline.SetParent(parent)
  5803. textline.SetPosition(x, y)
  5804. if color != None:
  5805. textline.SetFontColor(color[0], color[1], color[2])
  5806. textline.SetText(textlineText)
  5807. textline.Show()
  5808. return textline
  5809.  
  5810. def RGB(self, r, g, b):
  5811. return (r*255, g*255, b*255)
  5812.  
  5813. def SliderBar(self, parent, sliderPos, func, x, y):
  5814. Slider = ui.SliderBar()
  5815. if parent != None:
  5816. Slider.SetParent(parent)
  5817. Slider.SetPosition(x, y)
  5818. Slider.SetSliderPos(sliderPos / 100)
  5819. Slider.Show()
  5820. Slider.SetEvent(func)
  5821. return Slider
  5822.  
  5823. def ExpandedImage(self, parent, x, y, img):
  5824. image = ui.ExpandedImageBox()
  5825. if parent != None:
  5826. image.SetParent(parent)
  5827. image.SetPosition(x, y)
  5828. image.LoadImage(img)
  5829. image.Show()
  5830. return image
  5831.  
  5832. def ComboBox(self, parent, text, x, y, width):
  5833. combo = ui.ComboBox()
  5834. if parent != None:
  5835. combo.SetParent(parent)
  5836. combo.SetPosition(x, y)
  5837. combo.SetSize(width, 15)
  5838. combo.SetCurrentItem(text)
  5839. combo.Show()
  5840. return combo
  5841.  
  5842. def ThinBoard(self, parent, moveable, x, y, width, heigh, center):
  5843. thin = ui.ThinBoard()
  5844. if parent != None:
  5845. thin.SetParent(parent)
  5846. if moveable == TRUE:
  5847. thin.AddFlag('movable')
  5848. thin.AddFlag('float')
  5849. thin.SetSize(width, heigh)
  5850. thin.SetPosition(x, y)
  5851. if center == TRUE:
  5852. thin.SetCenterPosition()
  5853. thin.Show()
  5854. return thin
  5855.  
  5856. def Gauge(self, parent, width, color, x, y):
  5857. gauge = ui.Gauge()
  5858. if parent != None:
  5859. gauge.SetParent(parent)
  5860. gauge.SetPosition(x, y)
  5861. gauge.MakeGauge(width, color)
  5862. gauge.Show()
  5863. return gauge
  5864.  
  5865. def ListBoxEx(self, parent, x, y, width, heigh):
  5866. bar = ui.Bar()
  5867. if parent != None:
  5868. bar.SetParent(parent)
  5869. bar.SetPosition(x, y)
  5870. bar.SetSize(width, heigh)
  5871. bar.SetColor(0x77000000)
  5872. bar.Show()
  5873. ListBox=ui.ListBoxEx()
  5874. ListBox.SetParent(bar)
  5875. ListBox.SetPosition(0, 0)
  5876. ListBox.SetSize(width, heigh)
  5877. ListBox.Show()
  5878. scroll = ui.ScrollBar()
  5879. scroll.SetParent(ListBox)
  5880. scroll.SetPosition(width-15, 0)
  5881. scroll.SetScrollBarSize(heigh)
  5882. scroll.Show()
  5883. ListBox.SetScrollBar(scroll)
  5884. return bar, ListBox
  5885.  
  5886. if app.ENABLE_SWITCHER_MIJAGO:
  5887. #Switchbot
  5888. def __toggleSwitchbot(self):
  5889. if self.switchbot.bot_shown == 1:
  5890. self.switchbot.Hide()
  5891. else:
  5892. self.switchbot.Show()
  5893. # END_switchbot
Add Comment
Please, Sign In to add comment