Guest User

Untitled

a guest
Sep 22nd, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 115.25 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 textTail
  12. import event
  13. import uibonuspage
  14. from switchbot import Bot
  15.  
  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. import localeInfo
  27. import constInfo
  28. import exchange
  29. import uiHealth
  30. import ime
  31. import constInfo2
  32.  
  33. import ui
  34. import uiCommon
  35. import uiPhaseCurtain
  36. import uiMapNameShower
  37. import uiAffectShower
  38. import uiPlayerGauge
  39. import uiCharacter
  40. import uiTarget
  41. import uiTaskbar
  42. import uiteleport
  43. import uiguildstorage
  44.  
  45. # PRIVATE_SHOP_PRICE_LIST
  46. import uiPrivateShopBuilder
  47. # END_OF_PRIVATE_SHOP_PRICE_LIST
  48.  
  49. # OFFLINE_SHOP_PRICE_LIST
  50. import uiOfflineShopBuilder
  51. # END_OF_OFFLINE_SHOP_PRICE_LIST
  52. import uiOfflineShop
  53.  
  54. import mouseModule
  55. import consoleModule
  56. import localeInfo
  57.  
  58. import playerSettingModule
  59. import interfaceModule
  60.  
  61. import musicInfo
  62. import debugInfo
  63. import stringCommander
  64.  
  65. from _weakref import proxy
  66.  
  67. # TEXTTAIL_LIVINGTIME_CONTROL
  68. #if localeInfo.IsJAPAN():
  69. #   app.SetTextTailLivingTime(8.0)
  70. # END_OF_TEXTTAIL_LIVINGTIME_CONTROL
  71.  
  72.  
  73. # SCREENSHOT_CWDSAVE
  74. SCREENSHOT_CWDSAVE = FALSE
  75. SCREENSHOT_DIR = None
  76.  
  77. if localeInfo.IsEUROPE():
  78.     SCREENSHOT_CWDSAVE = TRUE
  79.  
  80. if localeInfo.IsCIBN10():
  81.     SCREENSHOT_CWDSAVE = FALSE
  82.     SCREENSHOT_DIR = "YT2W"
  83.  
  84. cameraDistance = 1550.0
  85. cameraPitch = 27.0
  86. cameraRotation = 0.0
  87. cameraHeight = 100.0
  88.  
  89. testAlignment = 0
  90. BPisLodaded = 0
  91. pet_gui_activado = 0
  92. bonuspp = 0
  93.  
  94. class GameWindow(ui.ScriptWindow):
  95.     def __init__(self, stream):
  96.         ui.ScriptWindow.__init__(self, "GAME")
  97.         self.SetWindowName("game")
  98.         net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  99.         player.SetGameWindow(self)
  100.  
  101.         self.lastupdate = 0
  102.         self.lastupdatee = 0
  103.         self.quickSlotPageIndex = 0
  104.         self.lastPKModeSendedTime = 0
  105.         self.LastBoniSwitcherId = 0
  106.        
  107.         self.pressNumber = None
  108.  
  109.         self.guildWarQuestionDialog = None
  110.         self.interface = None
  111.         self.targetBoard = None
  112.         self.console = None
  113.         self.mapNameShower = None
  114.         self.affectShower = None
  115.         self.playerGauge = None
  116.         self.petInventoryWnd = None
  117.         self.boniSwitcherWnd = []
  118.         constInfo.BONI_SWITCHER_LOAD = FALSE
  119.         self.itemShopWnd = None
  120.         #import uiBoniSwitcher
  121.         #for i in xrange(constInfo.SWITCHER_COUNT):
  122.             #self.boniSwitcherWnd.append(uiBoniSwitcher.BoniSwitcherDialog(i))
  123.             #self.boniSwitcherWnd[i].SetChangeBonusSwitcherEvent(self.__BoniSwitcherShow)
  124.             #self.boniSwitcherWnd[i].GAMESetBoniSwitcherCheckEvent(self.__BoniSwitcherCheckEvent)
  125.  
  126.         self.stream=stream
  127.         self.interface = interfaceModule.Interface()
  128.         self.interface.SetStream(self.stream)
  129.         self.interface.MakeInterface()
  130.         self.interface.SetOpenBoniSwitcherEvent(self.__BoniSwitcherShow)
  131.         self.interface.ShowDefaultWindows()
  132.         self.stream.isAutoSelect = 0
  133.  
  134.         self.curtain = uiPhaseCurtain.PhaseCurtain()
  135.         self.curtain.speed = 0.03
  136.         self.curtain.Hide()
  137.        
  138.         self.GuildStorageWindow = uiguildstorage.GuildStorage()
  139.        
  140.         self.targetBoard = uiTarget.TargetBoard()
  141.         self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  142.         self.targetBoard.Hide()
  143.  
  144.         self.console = consoleModule.ConsoleWindow()
  145.         self.console.BindGameClass(self)
  146.         self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  147.         self.console.Hide()
  148.  
  149.         self.mapNameShower = uiMapNameShower.MapNameShower()
  150.         self.affectShower = uiAffectShower.AffectShower()
  151.  
  152.         self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  153.         self.playerGauge.Hide()
  154.  
  155.         #wj 2014.1.2. ESCŰ�� ���� �� �켱������ DropQuestionDialog�� ������ �������. ������ ó���� itemDropQuestionDialog�� ����Ǿ� ���� �ʾ� ERROR�� �߻��Ͽ� init���� ����� ���ÿ� �ʱ�ȭ ��Ŵ.
  156.         self.itemDropQuestionDialog = None     
  157.        
  158.         self.__SetQuickSlotMode()
  159.  
  160.         self.__ServerCommand_Build()
  161.         self.__ProcessPreservedServerCommand()
  162.         self.teleport = uiteleport.TeleportWindow()
  163.  
  164.     def __del__(self):
  165.         player.SetGameWindow(0)
  166.         net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  167.         ui.ScriptWindow.__del__(self)
  168.  
  169.     def Open(self):
  170.         app.SetFrameSkip(1)
  171.  
  172.         self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  173.        
  174.        
  175.         self.Activare_Menu = ui.Button()
  176.         self.Activare_Menu.SetPosition(wndMgr.GetScreenWidth()-10,wndMgr.GetScreenHeight()/2-54)
  177.         self.Activare_Menu.SetUpVisual("Jin_Han/1_1.tga")
  178.         self.Activare_Menu.SetOverVisual("Jin_Han/1_2.tga")
  179.         self.Activare_Menu.SetDownVisual("Jin_Han/1_3.tga")
  180.         self.Activare_Menu.SetEvent(ui.__mem_func__(self.__menubg))
  181.         self.Activare_Menu.SetToolTipText("Deschide Meniu.")
  182.         self.Activare_Menu.Show()
  183.                
  184.         self.Dezactivare_Menu = ui.Button()
  185.         self.Dezactivare_Menu.SetPosition(wndMgr.GetScreenWidth()-60,wndMgr.GetScreenHeight()/2-54)
  186.         self.Dezactivare_Menu.SetUpVisual("Jin_Han/2_1.tga")
  187.         self.Dezactivare_Menu.SetOverVisual("Jin_Han/2_2.tga")
  188.         self.Dezactivare_Menu.SetDownVisual("Jin_Han/2_3.tga")
  189.         self.Activare_Menu.SetToolTipText("Inchide Meniu.")    
  190.         self.Dezactivare_Menu.SetEvent(ui.__mem_func__(self.__menubg))
  191.         self.Dezactivare_Menu.Hide()
  192.  
  193.         menu_bg = ui.AniImageBox()
  194.         menu_bg.AppendImage("Jin_Han/fundal.tga")
  195.         self.menu_bg = menu_bg
  196.         self.menu_bg.SetPosition(wndMgr.GetScreenWidth()-50,wndMgr.GetScreenHeight()/2-91)
  197.         self.menu_bg.SetSize(60, 250)  
  198.         self.menu_bg.Hide()
  199.                
  200.         self.Bonusuri = ui.Button()
  201.         self.Bonusuri.SetParent(self.menu_bg)
  202.         self.Bonusuri.SetPosition(9, 10)
  203.         self.Bonusuri.SetUpVisual("Jin_Han/1.tga")
  204.         self.Bonusuri.SetOverVisual("Jin_Han/2.tga")
  205.         self.Bonusuri.SetDownVisual("Jin_Han/1.tga")
  206.         self.Bonusuri.SetToolTipText("Deschide Pagina De Bonusuri.")           
  207.         self.Bonusuri.SetEvent(ui.__mem_func__(self.__BonusPage))
  208.         self.Bonusuri.Show()
  209.                
  210.         self.StatusUp = ui.Button()
  211.         self.StatusUp.SetParent(self.menu_bg)
  212.         self.StatusUp.SetPosition(9, 44)
  213.         self.StatusUp.SetUpVisual("Jin_Han/3.tga")
  214.         self.StatusUp.SetOverVisual("Jin_Han/4.tga")
  215.         self.StatusUp.SetDownVisual("Jin_Han/3.tga")
  216.         self.StatusUp.SetToolTipText("Adauga puncte la status.")           
  217.         self.StatusUp.SetEvent(ui.__mem_func__(self.__JINHAN))
  218.         self.StatusUp.Show()
  219.                
  220.         self.Depozit = ui.Button()
  221.         self.Depozit.SetParent(self.menu_bg)
  222.         self.Depozit.SetPosition(9, 76)
  223.         self.Depozit.SetUpVisual("Jin_Han/5.tga")
  224.         self.Depozit.SetOverVisual("Jin_Han/6.tga")
  225.         self.Depozit.SetDownVisual("Jin_Han/5.tga")
  226.         self.Depozit.SetToolTipText("Deschide Depozit.")       
  227.         self.Depozit.SetEvent(self.__activare_depozit)
  228.         self.Depozit.Show()
  229.                
  230.         self.AntiExp = ui.Button()
  231.         self.AntiExp.SetParent(self.menu_bg)
  232.         self.AntiExp.SetPosition(9, 108)
  233.         self.AntiExp.SetUpVisual("Jin_Han/7.tga")
  234.         self.AntiExp.SetOverVisual("Jin_Han/8.tga")
  235.         self.AntiExp.SetDownVisual("Jin_Han/7.tga")
  236.         self.AntiExp.SetToolTipText("Activeaza Inel Anti Exp.")
  237.         self.AntiExp.SetEvent(self.__activare_antiexp)
  238.         self.AntiExp.Show()
  239.  
  240.         self.Teleporter = ui.Button()
  241.         self.Teleporter.SetParent(self.menu_bg)
  242.         self.Teleporter.SetPosition(9, 140)
  243.         self.Teleporter.SetUpVisual("Jin_Han/9.tga")
  244.         self.Teleporter.SetOverVisual("Jin_Han/10.tga")
  245.         self.Teleporter.SetDownVisual("Jin_Han/9.tga")
  246.         self.Teleporter.SetToolTipText("Deschide Inel De Teleportare.")
  247.         self.Teleporter.SetEvent(self.__activare_teleporter)
  248.         self.Teleporter.Show()
  249.        
  250. #       self.DeschidereMagazin = ui.Button()
  251. #       self.DeschidereMagazin.SetParent(self.menu_bg)
  252. #       self.DeschidereMagazin.SetPosition(9, 204)
  253. #       self.DeschidereMagazin.SetUpVisual("Jin_Han/sopen.tga")
  254. #       self.DeschidereMagazin.SetOverVisual("Jin_Han/sopen1.tga")
  255. #       self.DeschidereMagazin.SetDownVisual("Jin_Han/sopen2.tga")
  256. #       self.DeschidereMagazin.SetToolTipText("Deschidere Offline Shop.")  
  257. #       self.DeschidereMagazin.SetEvent(self.__DeschidereMagazin)
  258. #       self.DeschidereMagazin.Show()
  259.                
  260.         self.Switch = ui.Button()
  261.         self.Switch.SetParent(self.menu_bg)
  262.         self.Switch.SetPosition(9, 172)
  263.         self.Switch.SetUpVisual("Jin_Han/s1.tga")
  264.         self.Switch.SetOverVisual("Jin_Han/s1.tga")
  265.         self.Switch.SetDownVisual("Jin_Han/s2.tga")
  266.         self.Switch.SetToolTipText("Switchbot.")
  267.         self.Switch.SetEvent(ui.__mem_func__(self.__toggleSwitchbot))
  268.         self.Switch.Show() 
  269.  
  270. #meniuasd
  271. ##      self.Activare_Menu2 = ui.Button()
  272. #       self.Activare_Menu2.SetPosition(wndMgr.GetScreenWidth()-270,wndMgr.GetScreenHeight()/1-47)
  273. #       self.Activare_Menu2.SetUpVisual("Jin_Han/p1_1.tga")
  274. #       self.Activare_Menu2.SetOverVisual("Jin_Han/p1_2.tga")
  275. #       self.Activare_Menu2.SetDownVisual("Jin_Han/p1_3.tga")
  276. #       self.Activare_Menu2.SetEvent(ui.__mem_func__(self.__menubg2))
  277. #       self.Activare_Menu2.SetToolTipText("Deschide Meniu Cu Urmatoarele Atribute: Offline Shop/Info Shop/Retrage Yang/Inchide Shop/Switchbot")   
  278. #       self.Activare_Menu2.Show()
  279.                
  280. #       self.Dezactivare_Menu2 = ui.Button()
  281. #       self.Dezactivare_Menu2.SetPosition(wndMgr.GetScreenWidth()-270,wndMgr.GetScreenHeight()/1-230)
  282. #       self.Dezactivare_Menu2.SetUpVisual("Jin_Han/p1_4.tga")
  283. #       self.Dezactivare_Menu2.SetOverVisual("Jin_Han/p1_5.tga")
  284. #       self.Dezactivare_Menu2.SetDownVisual("Jin_Han/p1_6.tga")
  285. #       self.Dezactivare_Menu2.SetToolTipText("Inchidere Meniu")           
  286. #       self.Dezactivare_Menu2.SetEvent(ui.__mem_func__(self.__menubg2))       
  287. #       self.Dezactivare_Menu2.Hide()
  288.  
  289. #       menu_bg2 = ui.AniImageBox()
  290. #       menu_bg2.AppendImage("Jin_Han/fundal.tga")
  291. #       self.menu_bg2 = menu_bg2
  292. #       self.menu_bg2.SetPosition(wndMgr.GetScreenWidth()-240,wndMgr.GetScreenHeight()/1-220)
  293. #       self.menu_bg2.SetSize(50, 150)  
  294. #       self.menu_bg2.Hide()
  295.                
  296. #       self.RetrageYang = ui.Button()
  297. #       self.RetrageYang.SetParent(self.menu_bg2)
  298. #       self.RetrageYang.SetPosition(9, 10)
  299. #       self.RetrageYang.SetUpVisual("Jin_Han/smoney.tga")
  300. #       self.RetrageYang.SetOverVisual("Jin_Han/smoney1.tga")
  301. #       self.RetrageYang.SetDownVisual("Jin_Han/smoney2.tga")
  302. #       self.RetrageYang.SetToolTipText("Retrage Yang/Innformatii Shop/Inchide Shop.")
  303. #       self.RetrageYang.SetEvent(ui.__mem_func__(self.__RetrageYang))
  304. #       self.RetrageYang.Show()
  305.                
  306. #       self.DeschidereMagazin = ui.Button()
  307. #       self.DeschidereMagazin.SetParent(self.menu_bg2)
  308. #       self.DeschidereMagazin.SetPosition(9, 42)
  309. #       self.DeschidereMagazin.SetUpVisual("Jin_Han/sopen.tga")
  310. #       self.DeschidereMagazin.SetOverVisual("Jin_Han/sopen1.tga")
  311. #       self.DeschidereMagazin.SetDownVisual("Jin_Han/sopen2.tga")
  312. #       self.DeschidereMagazin.SetToolTipText("Deschidere Offline Shop.")  
  313. #       self.DeschidereMagazin.SetEvent(self.__DeschidereMagazin)
  314. #       self.DeschidereMagazin.Show()
  315.                
  316. #       self.Switch = ui.Button()
  317. #       self.Switch.SetParent(self.menu_bg2)
  318. #       self.Switch.SetPosition(9, 74)
  319. #       self.Switch.SetUpVisual("Jin_Han/s1.tga")
  320. #       self.Switch.SetOverVisual("Jin_Han/s1.tga")
  321. #       self.Switch.SetDownVisual("Jin_Han/s2.tga")
  322. #       self.Switch.SetToolTipText("Switchbot.")
  323. #       self.Switch.SetEvent(ui.__mem_func__(self.__toggleSwitchbot))
  324. #       self.Switch.Show()         
  325.         Espacio = ui.AniImageBox()
  326.         Espacio.SetWindowHorizontalAlignLeft()
  327.         Espacio.SetWindowVerticalAlignTop()
  328.         Espacio.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  329.         self.Espacio = Espacio
  330.        
  331.         self.Espacio.SetPosition(10, 80)
  332.  
  333.         self.contador_usuarios_guerra = ui.TextLine()
  334.         self.contador_usuarios_guerra.SetWindowHorizontalAlignLeft()
  335.         self.contador_usuarios_guerra.SetWindowVerticalAlignTop()
  336.         self.contador_usuarios_guerra.SetDefaultFontName()
  337.         self.contador_usuarios_guerra.SetPosition(24+8, 37+2 +40)
  338.         self.contador_usuarios_guerra.SetText("0")
  339.         self.contador_usuarios_guerra.SetOutline()
  340.  
  341.         self.muertos_guerra = ui.TextLine()
  342.         self.muertos_guerra.SetWindowHorizontalAlignLeft()
  343.         self.muertos_guerra.SetWindowVerticalAlignTop()
  344.         self.muertos_guerra.SetDefaultFontName()
  345.         self.muertos_guerra.SetPosition(24+8, 47+2+40)
  346.         self.muertos_guerra.SetText("0")
  347.         self.muertos_guerra.SetOutline()
  348.  
  349.         self.caido_guerra = ui.TextLine()
  350.         self.caido_guerra.SetWindowHorizontalAlignLeft()
  351.         self.caido_guerra.SetWindowVerticalAlignTop()
  352.         self.caido_guerra.SetDefaultFontName()
  353.         self.caido_guerra.SetPosition(24+8, 57+2+40)
  354.         self.caido_guerra.SetText("0")
  355.         self.caido_guerra.SetOutline()
  356.  
  357.         self.usuarios_guerra = ui.TextLine()
  358.         self.usuarios_guerra.SetWindowHorizontalAlignLeft()
  359.         self.usuarios_guerra.SetWindowVerticalAlignTop()
  360.         self.usuarios_guerra.SetDefaultFontName()
  361.         self.usuarios_guerra.SetPosition(10+8, 37+2+40)
  362.         self.usuarios_guerra.SetText("U:")
  363.         self.usuarios_guerra.SetOutline()
  364.  
  365.         self.ranking_guerra = ui.TextLine()
  366.         self.ranking_guerra.SetWindowHorizontalAlignLeft()
  367.         self.ranking_guerra.SetWindowVerticalAlignTop()
  368.         self.ranking_guerra.SetDefaultFontName()
  369.         self.ranking_guerra.SetPosition(10+8, 47+2+40)
  370.         self.ranking_guerra.SetText("R:")
  371.         self.ranking_guerra.SetOutline()
  372.  
  373.         self.ranking_caido = ui.TextLine()
  374.         self.ranking_caido.SetWindowHorizontalAlignLeft()
  375.         self.ranking_caido.SetWindowVerticalAlignTop()
  376.         self.ranking_caido.SetDefaultFontName()
  377.         self.ranking_caido.SetPosition(10 +8, 57 +2+40)
  378.         self.ranking_caido.SetText("M:")
  379.         self.ranking_caido.SetOutline()
  380.  
  381.         Medallas_gui = ui.AniImageBox()
  382.         Medallas_gui.SetWindowHorizontalAlignLeft()
  383.         Medallas_gui.SetWindowVerticalAlignTop()
  384.         Medallas_gui.AppendImage("d:/ymir work/ui/pattern/medallas/espacio.dds")
  385.         self.Medallas_gui = Medallas_gui
  386.        
  387.         self.Medallas_gui.SetPosition(10, 40)
  388.  
  389.         self.muertes = ui.TextLine()
  390.         self.muertes.SetWindowHorizontalAlignLeft()
  391.         self.muertes.SetWindowVerticalAlignTop()
  392.         self.muertes.SetDefaultFontName()
  393.         self.muertes.SetPosition(24, 51)
  394.         self.muertes.SetText("0")
  395.         self.muertes.SetOutline()
  396.  
  397.         self.primera_muerte = ui.AniImageBox()
  398.         self.primera_muerte.SetWindowHorizontalAlignLeft()
  399.         self.primera_muerte.SetWindowVerticalAlignTop()
  400.         self.primera_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/1.dds")
  401.         self.primera_muerte.SetPosition(43, 40)
  402.  
  403.         self.doble_muerte = ui.AniImageBox()
  404.         self.doble_muerte.SetWindowHorizontalAlignLeft()
  405.         self.doble_muerte.SetWindowVerticalAlignTop()
  406.         self.doble_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/2.dds")
  407.         self.doble_muerte.SetPosition(43 + 33, 40)
  408.  
  409.         self.triple_muerte = ui.AniImageBox()
  410.         self.triple_muerte.SetWindowHorizontalAlignLeft()
  411.         self.triple_muerte.SetWindowVerticalAlignTop()
  412.         self.triple_muerte.AppendImage("d:/ymir work/ui/pattern/medallas/3.dds")
  413.         self.triple_muerte.SetPosition(43 + 33 + 33, 40)
  414.  
  415.         self.exterminio = ui.AniImageBox()
  416.         self.exterminio.SetWindowHorizontalAlignLeft()
  417.         self.exterminio.SetWindowVerticalAlignTop()
  418.         self.exterminio.AppendImage("d:/ymir work/ui/pattern/medallas/4.dds")
  419.         self.exterminio.SetPosition(43+ 33+ 33 + 33, 40)
  420.  
  421.         self.muertacular = ui.AniImageBox()
  422.         self.muertacular.SetWindowHorizontalAlignLeft()
  423.         self.muertacular.SetWindowVerticalAlignTop()
  424.         self.muertacular.AppendImage("d:/ymir work/ui/pattern/medallas/5.dds")
  425.         self.muertacular.SetPosition(43+ 33+ 33+ 33 + 33, 40)
  426.  
  427.         self.bestialidad = ui.AniImageBox()
  428.         self.bestialidad.SetWindowHorizontalAlignLeft()
  429.         self.bestialidad.SetWindowVerticalAlignTop()
  430.         self.bestialidad.AppendImage("d:/ymir work/ui/pattern/medallas/6.dds")
  431.         self.bestialidad.SetPosition(43+ 33+ 33+ 33+ 33 + 33, 40)
  432.  
  433.         self.salvajada = ui.AniImageBox()
  434.         self.salvajada.SetWindowHorizontalAlignLeft()
  435.         self.salvajada.SetWindowVerticalAlignTop()
  436.         self.salvajada.AppendImage("d:/ymir work/ui/pattern/medallas/7.dds")
  437.         self.salvajada.SetPosition(43+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  438.  
  439.         self.catastrofe = ui.AniImageBox()
  440.         self.catastrofe.SetWindowHorizontalAlignLeft()
  441.         self.catastrofe.SetWindowVerticalAlignTop()
  442.         self.catastrofe.AppendImage("d:/ymir work/ui/pattern/medallas/8.dds")
  443.         self.catastrofe.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  444.  
  445.         self.apocalipsis = ui.AniImageBox()
  446.         self.apocalipsis.SetWindowHorizontalAlignLeft()
  447.         self.apocalipsis.SetWindowVerticalAlignTop()
  448.         self.apocalipsis.AppendImage("d:/ymir work/ui/pattern/medallas/9.dds")
  449.         self.apocalipsis.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  450.  
  451.         self.lluvia_muertos = ui.AniImageBox()
  452.         self.lluvia_muertos.SetWindowHorizontalAlignLeft()
  453.         self.lluvia_muertos.SetWindowVerticalAlignTop()
  454.         self.lluvia_muertos.AppendImage("d:/ymir work/ui/pattern/medallas/10.dds")
  455.         self.lluvia_muertos.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  456.  
  457.         self.super_increible = ui.AniImageBox()
  458.         self.super_increible.SetWindowHorizontalAlignLeft()
  459.         self.super_increible.SetWindowVerticalAlignTop()
  460.         self.super_increible.AppendImage("d:/ymir work/ui/pattern/medallas/11.dds")
  461.         self.super_increible.SetPosition(43+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33+ 33 + 33, 40)
  462.  
  463.         #Fin menu
  464.        
  465.         self.quickSlotPageIndex = 0
  466.         self.switchbot = Bot()
  467.         self.switchbot.Hide()
  468.         self.PickingCharacterIndex = -1
  469.         self.PickingItemIndex = -1
  470.         self.consoleEnable = FALSE
  471.         self.isShowDebugInfo = FALSE
  472.         self.ShowNameFlag = FALSE
  473.  
  474.         self.enableXMasBoom = FALSE
  475.         self.startTimeXMasBoom = 0.0
  476.         self.indexXMasBoom = 0
  477.  
  478.         global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  479.  
  480.         app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  481.  
  482.         constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  483.         constInfo.SET_DEFAULT_CHRNAME_COLOR()
  484.         constInfo.SET_DEFAULT_FOG_LEVEL()
  485.         constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  486.         constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  487.         constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  488.  
  489.         # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  490.         constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  491.         # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  492.  
  493.         import event
  494.         event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
  495.  
  496.         textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  497.  
  498.         if constInfo.PVPMODE_TEST_ENABLE:
  499.             self.testPKMode = ui.TextLine()
  500.             self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT)
  501.             self.testPKMode.SetPosition(0, 15)
  502.             self.testPKMode.SetWindowHorizontalAlignCenter()
  503.             self.testPKMode.SetHorizontalAlignCenter()
  504.             self.testPKMode.SetFeather()
  505.             self.testPKMode.SetOutline()
  506.             self.testPKMode.Show()
  507.  
  508.             self.testAlignment = ui.TextLine()
  509.             self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT)
  510.             self.testAlignment.SetPosition(0, 35)
  511.             self.testAlignment.SetWindowHorizontalAlignCenter()
  512.             self.testAlignment.SetHorizontalAlignCenter()
  513.             self.testAlignment.SetFeather()
  514.             self.testAlignment.SetOutline()
  515.             self.testAlignment.Show()
  516.  
  517.         self.__BuildKeyDict()
  518.         self.__BuildDebugInfo()
  519.  
  520.         # PRIVATE_SHOP_PRICE_LIST
  521.         uiPrivateShopBuilder.Clear()
  522.         # END_OF_PRIVATE_SHOP_PRICE_LIST
  523.        
  524.         # OFFLINE_SHOP_PRICE_LIST
  525.         uiOfflineShopBuilder.Clear()
  526.         # END_OF_OFFLINE_SHOP_PRICE_LIST
  527.  
  528.         # UNKNOWN_UPDATE
  529.         exchange.InitTrading()
  530.         # END_OF_UNKNOWN_UPDATE
  531.  
  532.  
  533.         ## Sound
  534.         snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  535.         snd.SetSoundVolume(systemSetting.GetSoundVolume())
  536.  
  537.         netFieldMusicFileName = net.GetFieldMusicFileName()
  538.         if netFieldMusicFileName:
  539.             snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  540.         elif musicInfo.fieldMusic != "":                       
  541.             snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  542.  
  543.         self.__SetQuickSlotMode()
  544.         self.__SelectQuickPage(self.quickSlotPageIndex)
  545.  
  546.         self.SetFocus()
  547.         self.Show()
  548.         app.ShowCursor()
  549.  
  550.         net.SendEnterGamePacket()
  551.  
  552.         # START_GAME_ERROR_EXIT
  553.         try:
  554.             self.StartGame()
  555.         except:
  556.             import exception
  557.             exception.Abort("GameWindow.Open")
  558.         # END_OF_START_GAME_ERROR_EXIT
  559.        
  560.         # NPC�� ť��ý������� ���� �� �ִ� �����۵��� ����� ij��
  561.         # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ]
  562.         self.cubeInformation = {}
  563.         self.currentCubeNPC = 0
  564.         self.acceInformation = {}
  565.         self.currentAcceNPC = 0
  566.        
  567.     def Close(self):
  568.         self.Hide()
  569.  
  570.         global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  571.         (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  572.  
  573.         if musicInfo.fieldMusic != "":
  574.             snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  575.  
  576.         self.onPressKeyDict = None
  577.         self.onClickKeyDict = None
  578.  
  579.         chat.Close()
  580.         self.menu_bg.Hide()
  581.         self.Dezactivare_Menu.Hide()
  582.         self.Activare_Menu.Hide()
  583. #       self.menu_bg2.Hide()
  584. #       self.Dezactivare_Menu2.Hide()
  585. #       self.Activare_Menu2.Hide()     
  586.         snd.StopAllSound()
  587.         grp.InitScreenEffect()
  588.         chr.Destroy()
  589.         textTail.Clear()
  590.         quest.Clear()
  591.         background.Destroy()
  592.         guild.Destroy()
  593.         messenger.Destroy()
  594.         skill.ClearSkillData()
  595.         wndMgr.Unlock()
  596.         mouseModule.mouseController.DeattachObject()
  597.  
  598.         if self.guildWarQuestionDialog:
  599.             self.guildWarQuestionDialog.Close()
  600.  
  601.         self.guildNameBoard = None
  602.         self.partyRequestQuestionDialog = None
  603.         self.partyInviteQuestionDialog = None
  604.         self.guildInviteQuestionDialog = None
  605.         self.guildWarQuestionDialog = None
  606.         self.messengerAddFriendQuestion = None
  607.  
  608.         # UNKNOWN_UPDATE
  609.         self.itemDropQuestionDialog = None
  610.         # END_OF_UNKNOWN_UPDATE
  611.  
  612.         # QUEST_CONFIRM
  613.         self.confirmDialog = None
  614.         # END_OF_QUEST_CONFIRM
  615.        
  616.        
  617.  
  618.         self.PrintCoord = None
  619.         self.FrameRate = None
  620.         self.Pitch = None
  621.         self.Splat = None
  622.         self.TextureNum = None
  623.         self.ObjectNum = None
  624.         self.ViewDistance = None
  625.         self.PrintMousePos = None
  626.  
  627.         self.ClearDictionary()
  628.  
  629.         self.playerGauge = None
  630.         self.mapNameShower = None
  631.         self.affectShower = None
  632.  
  633.         if self.console:
  634.             self.console.BindGameClass(0)
  635.             self.console.Close()
  636.             self.console=None
  637.        
  638.         if self.targetBoard:
  639.             self.targetBoard.Destroy()
  640.             self.targetBoard = None
  641.         if self.itemShopWnd:
  642.             self.itemShopWnd.Destroy()
  643.             self.itemShopWnd = None
  644.         if self.interface:
  645.             self.interface.HideAllWindows()
  646.             self.interface.Close()
  647.             self.interface=None
  648.  
  649.         for i in xrange(len(self.boniSwitcherWnd)):
  650.             if self.boniSwitcherWnd[i]:
  651.                 self.boniSwitcherWnd[i].Destroy()
  652.                 self.boniSwitcherWnd[i] = None
  653.         if self.petInventoryWnd:
  654.             self.petInventoryWnd.Destroy()
  655.             self.petInventoryWnd = None
  656.         player.ClearSkillDict()
  657.         player.ResetCameraRotation()
  658.  
  659.         self.KillFocus()
  660.         app.HideCursor()
  661.  
  662.         print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  663.  
  664.     def __BuildKeyDict(self):
  665.         onPressKeyDict = {}
  666.  
  667.         ##PressKey �� ������ �ִ� ���� ��� ����Ǵ� Ű�̴�.
  668.        
  669.         ## ���� ����Ű �����Կ� �̿�ȴ�.(���� ���ڵ鵵 �� ���Կ� ����)
  670.         ## F12 �� Ŭ�� ����׿� Ű�̹Ƿ� ���� �ʴ� �� ����.
  671.         onPressKeyDict[app.DIK_1]   = lambda : self.__PressNumKey(1)
  672.         onPressKeyDict[app.DIK_2]   = lambda : self.__PressNumKey(2)
  673.         onPressKeyDict[app.DIK_3]   = lambda : self.__PressNumKey(3)
  674.         onPressKeyDict[app.DIK_4]   = lambda : self.__PressNumKey(4)
  675.         onPressKeyDict[app.DIK_5]   = lambda : self.__PressNumKey(5)
  676.         onPressKeyDict[app.DIK_6]   = lambda : self.__PressNumKey(6)
  677.         onPressKeyDict[app.DIK_7]   = lambda : self.__PressNumKey(7)
  678.         onPressKeyDict[app.DIK_8]   = lambda : self.__PressNumKey(8)
  679.         onPressKeyDict[app.DIK_9]   = lambda : self.__PressNumKey(9)
  680.         onPressKeyDict[app.DIK_F1]  = lambda : self.__PressQuickSlot(4)
  681.         onPressKeyDict[app.DIK_F2]  = lambda : self.__PressQuickSlot(5)
  682.         onPressKeyDict[app.DIK_F3]  = lambda : self.__PressQuickSlot(6)
  683.         onPressKeyDict[app.DIK_F4]  = lambda : self.__PressQuickSlot(7)
  684.  
  685.  
  686.         onPressKeyDict[app.DIK_LALT]        = lambda : self.ShowName()
  687.         onPressKeyDict[app.DIK_LCONTROL]    = lambda : self.ShowMouseImage()
  688.         onPressKeyDict[app.DIK_SYSRQ]       = lambda : self.SaveScreen()
  689.         onPressKeyDict[app.DIK_SPACE]       = lambda : self.StartAttack()
  690.  
  691.         #ij���� �̵�Ű
  692.         onPressKeyDict[app.DIK_UP]          = lambda : self.MoveUp()
  693.         onPressKeyDict[app.DIK_DOWN]        = lambda : self.MoveDown()
  694.         onPressKeyDict[app.DIK_LEFT]        = lambda : self.MoveLeft()
  695.         onPressKeyDict[app.DIK_RIGHT]       = lambda : self.MoveRight()
  696.         onPressKeyDict[app.DIK_W]           = lambda : self.MoveUp()
  697.         onPressKeyDict[app.DIK_S]           = lambda : self.MoveDown()
  698.         onPressKeyDict[app.DIK_A]           = lambda : self.MoveLeft()
  699.         onPressKeyDict[app.DIK_D]           = lambda : self.MoveRight()
  700.  
  701.         onPressKeyDict[app.DIK_E]           = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  702.         onPressKeyDict[app.DIK_R]           = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  703.         #onPressKeyDict[app.DIK_F]          = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  704.         onPressKeyDict[app.DIK_T]           = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  705.         onPressKeyDict[app.DIK_G]           = self.__PressGKey
  706.         onPressKeyDict[app.DIK_Q]           = self.__PressQKey
  707.  
  708.         onPressKeyDict[app.DIK_NUMPAD9]     = lambda: app.MovieResetCamera()
  709.         onPressKeyDict[app.DIK_NUMPAD4]     = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  710.         onPressKeyDict[app.DIK_NUMPAD6]     = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  711.         onPressKeyDict[app.DIK_PGUP]        = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  712.         onPressKeyDict[app.DIK_PGDN]        = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  713.         onPressKeyDict[app.DIK_NUMPAD8]     = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  714.         onPressKeyDict[app.DIK_NUMPAD2]     = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  715.         onPressKeyDict[app.DIK_GRAVE]       = lambda : self.PickUpItem()
  716.         onPressKeyDict[app.DIK_Z]           = lambda : self.PickUpItem()
  717.         onPressKeyDict[app.DIK_C]           = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  718.         onPressKeyDict[app.DIK_V]           = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  719.         #onPressKeyDict[app.DIK_B]          = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  720.         onPressKeyDict[app.DIK_N]           = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  721.         onPressKeyDict[app.DIK_I]           = lambda : self.interface.ToggleInventoryWindow()
  722.         onPressKeyDict[app.DIK_M]           = lambda : self.interface.PressMKey()
  723.         #onPressKeyDict[app.DIK_H]          = lambda : self.interface.OpenHelpWindow()
  724.         onPressKeyDict[app.DIK_ADD]         = lambda : self.interface.MiniMapScaleUp()
  725.         onPressKeyDict[app.DIK_SUBTRACT]    = lambda : self.interface.MiniMapScaleDown()
  726.         onPressKeyDict[app.DIK_L]           = lambda : self.interface.ToggleChatLogWindow()
  727.         onPressKeyDict[app.DIK_COMMA]       = lambda : self.ShowConsole()       # "`" key
  728.         onPressKeyDict[app.DIK_LSHIFT]      = lambda : self.__SetQuickPageMode()
  729.  
  730.         onPressKeyDict[app.DIK_J]           = lambda : self.__PressJKey()
  731.         onPressKeyDict[app.DIK_H]           = lambda : self.__PressHKey()
  732.         onPressKeyDict[app.DIK_B]           = lambda : self.__PressBKey()
  733.         onPressKeyDict[app.DIK_F]           = lambda : self.__PressFKey()
  734.         onPressKeyDict[app.DIK_X]           = lambda : self.__PressXKey()
  735.  
  736.         # CUBE_TEST
  737.         #onPressKeyDict[app.DIK_K]          = lambda : self.interface.OpenCubeWindow()
  738.         # CUBE_TEST_END
  739.  
  740.         self.onPressKeyDict = onPressKeyDict
  741.  
  742.         onClickKeyDict = {}
  743.         onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  744.         onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  745.         onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  746.         onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  747.         onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  748.  
  749.         onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  750.         onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  751.         onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  752.         onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  753.         onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  754.         onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  755.         onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  756.         onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  757.         onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  758.         onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  759.         onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  760.         onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  761.         onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  762.         onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  763.         onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  764.         onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  765.         onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  766.         onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  767.         onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  768.  
  769.         #if constInfo.PVPMODE_ACCELKEY_ENABLE:
  770.         #   onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode()
  771.  
  772.         self.onClickKeyDict=onClickKeyDict
  773.  
  774.     def __PressNumKey(self,num):
  775.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  776.            
  777.             if num >= 1 and num <= 9:
  778.                 if(chrmgr.IsPossibleEmoticon(-1)):             
  779.                     chrmgr.SetEmoticon(-1,int(num)-1)
  780.                     net.SendEmoticon(int(num)-1)
  781.         else:
  782.             if num >= 1 and num <= 4:
  783.                 self.pressNumber(num-1)
  784.  
  785.     def __ClickBKey(self):
  786.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  787.             return
  788.         else:
  789.             if constInfo.PVPMODE_ACCELKEY_ENABLE:
  790.                 self.ChangePKMode()
  791.  
  792.  
  793.     def __PressJKey(self):
  794.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  795.             if player.IsMountingHorse():
  796.                 net.SendChatPacket("/unmount")
  797.             else:
  798.                 #net.SendChatPacket("/user_horse_ride")
  799.                 if not uiPrivateShopBuilder.IsBuildingPrivateShop() or not uiOfflineShopBuilder.IsBuildingOfflineShop():
  800.                     for i in xrange(player.INVENTORY_PAGE_SIZE):
  801.                         if player.GetItemIndex(i) in (71114, 71116, 71118, 71120):
  802.                             net.SendItemUsePacket(i)
  803.                             break
  804.     def __PressHKey(self):
  805.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  806.             net.SendChatPacket("/user_horse_ride")
  807.         else:
  808.             self.interface.OpenHelpWindow()
  809.  
  810.     def __PressBKey(self):
  811.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  812.             net.SendChatPacket("/user_horse_back")
  813.         else:
  814.             state = "EMOTICON"
  815.             self.interface.ToggleCharacterWindow(state)
  816.  
  817.     def __PressFKey(self):
  818.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  819.             net.SendChatPacket("/user_horse_feed") 
  820.         else:
  821.             app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  822.  
  823.     def __PressGKey(self):
  824.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  825.             net.SendChatPacket("/ride")
  826.         else:
  827.             if self.ShowNameFlag:
  828.                 self.interface.ToggleGuildWindow()
  829.             else:
  830.                 app.PitchCamera(app.CAMERA_TO_POSITIVE)
  831.  
  832.     def __ReleaseGKey(self):
  833.         app.PitchCamera(app.CAMERA_STOP)
  834.  
  835.     def __PressQKey(self):
  836.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  837.             if 0==interfaceModule.IsQBHide:
  838.                 interfaceModule.IsQBHide = 1
  839.                 self.interface.HideAllQuestButton()
  840.             else:
  841.                 interfaceModule.IsQBHide = 0
  842.                 self.interface.ShowAllQuestButton()
  843.         else:
  844.             app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  845.  
  846.     def __PressJKey(self):
  847.         if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  848.             if player.IsmountingHorse():
  849.                 net.SendChatPacket("/unmount")
  850.             else:
  851.                 self.teleport.Open()
  852.    
  853.     def __SetQuickSlotMode(self):
  854.         self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  855.  
  856.     def __SetQuickPageMode(self):
  857.         self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  858.  
  859.     def __PressQuickSlot(self, localSlotIndex):
  860.         if localeInfo.IsARABIC():
  861.             if 0 <= localSlotIndex and localSlotIndex < 4:
  862.                 player.RequestUseLocalQuickSlot(3-localSlotIndex)
  863.             else:
  864.                 player.RequestUseLocalQuickSlot(11-localSlotIndex)
  865.         else:
  866.             player.RequestUseLocalQuickSlot(localSlotIndex)        
  867.  
  868.     def __SelectQuickPage(self, pageIndex):
  869.         self.quickSlotPageIndex = pageIndex
  870.         player.SetQuickPage(pageIndex)
  871.  
  872.     def ToggleDebugInfo(self):
  873.         self.isShowDebugInfo = not self.isShowDebugInfo
  874.  
  875.         if self.isShowDebugInfo:
  876.             self.PrintCoord.Show()
  877.             self.FrameRate.Show()
  878.             self.Pitch.Show()
  879.             self.Splat.Show()
  880.             self.TextureNum.Show()
  881.             self.ObjectNum.Show()
  882.             self.ViewDistance.Show()
  883.             self.PrintMousePos.Show()
  884.         else:
  885.             self.PrintCoord.Hide()
  886.             self.FrameRate.Hide()
  887.             self.Pitch.Hide()
  888.             self.Splat.Hide()
  889.             self.TextureNum.Hide()
  890.             self.ObjectNum.Hide()
  891.             self.ViewDistance.Hide()
  892.             self.PrintMousePos.Hide()
  893.  
  894.     def __BuildDebugInfo(self):
  895.         ## Character Position Coordinate
  896.         self.PrintCoord = ui.TextLine()
  897.         self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
  898.         self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  899.        
  900.         ## Frame Rate
  901.         self.FrameRate = ui.TextLine()
  902.         self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  903.         self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  904.  
  905.         ## Camera Pitch
  906.         self.Pitch = ui.TextLine()
  907.         self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
  908.         self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  909.  
  910.         ## Splat
  911.         self.Splat = ui.TextLine()
  912.         self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
  913.         self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  914.        
  915.         ##
  916.         self.PrintMousePos = ui.TextLine()
  917.         self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
  918.         self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  919.  
  920.         # TextureNum
  921.         self.TextureNum = ui.TextLine()
  922.         self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
  923.         self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  924.  
  925.         # ������Ʈ �׸��� ����
  926.         self.ObjectNum = ui.TextLine()
  927.         self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
  928.         self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
  929.  
  930.         # �þ߰Ÿ�
  931.         self.ViewDistance = ui.TextLine()
  932.         self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
  933.         self.ViewDistance.SetPosition(0, 0)
  934.  
  935.     def __NotifyError(self, msg):
  936.         chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  937.  
  938.     def ChangePKMode(self):
  939.  
  940.         if not app.IsPressed(app.DIK_LCONTROL):
  941.             return
  942.  
  943.         if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  944.             self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  945.             return
  946.  
  947.         curTime = app.GetTime()
  948.         if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  949.             return
  950.  
  951.         self.lastPKModeSendedTime = curTime
  952.  
  953.         curPKMode = player.GetPKMode()
  954.         nextPKMode = curPKMode + 1
  955.         if nextPKMode == player.PK_MODE_PROTECT:
  956.             if 0 == player.GetGuildID():
  957.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  958.                 nextPKMode = 0
  959.             else:
  960.                 nextPKMode = player.PK_MODE_GUILD
  961.  
  962.         elif nextPKMode == player.PK_MODE_MAX_NUM:
  963.             nextPKMode = 0
  964.  
  965.         net.SendChatPacket("/PKMode " + str(nextPKMode))
  966.         print "/PKMode " + str(nextPKMode)
  967.  
  968.     def OnChangePKMode(self):
  969.  
  970.         self.interface.OnChangePKMode()
  971.  
  972.         try:
  973.             self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  974.         except KeyError:
  975.             print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  976.  
  977.         if constInfo.PVPMODE_TEST_ENABLE:
  978.             curPKMode = player.GetPKMode()
  979.             alignment, grade = chr.testGetPKData()
  980.             self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  981.             self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  982.             self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + localeInfo.TITLE_NAME_LIST[grade] + ")")
  983.  
  984.     ###############################################################################################
  985.     ###############################################################################################
  986.     ## Game Callback Functions
  987.  
  988.     # Start
  989.     def StartGame(self):
  990.         self.RefreshInventory()
  991.         self.RefreshEquipment()
  992.         self.RefreshCharacter()
  993.         self.RefreshSkill()
  994.  
  995.     # Refresh
  996.     def CheckGameButton(self):
  997.         if self.interface:
  998.             self.interface.CheckGameButton()
  999.  
  1000.     def RefreshAlignment(self):
  1001.         self.interface.RefreshAlignment()
  1002.  
  1003.     def RefreshStatus(self):
  1004.         self.CheckGameButton()
  1005.  
  1006.         if self.interface:
  1007.             self.interface.RefreshStatus()
  1008.  
  1009.         if self.playerGauge:
  1010.             self.playerGauge.RefreshGauge()
  1011.  
  1012.     def RefreshStamina(self):
  1013.         self.interface.RefreshStamina()
  1014.  
  1015.     def RefreshSkill(self):
  1016.         self.CheckGameButton()
  1017.         if self.interface:
  1018.             self.interface.RefreshSkill()
  1019.  
  1020.     def RefreshQuest(self):
  1021.         self.interface.RefreshQuest()
  1022.  
  1023.     def RefreshMessenger(self):
  1024.         self.interface.RefreshMessenger()
  1025.  
  1026.     def RefreshGuildInfoPage(self):
  1027.         self.interface.RefreshGuildInfoPage()
  1028.  
  1029.     def RefreshGuildBoardPage(self):
  1030.         self.interface.RefreshGuildBoardPage()
  1031.  
  1032.     def RefreshGuildMemberPage(self):
  1033.         self.interface.RefreshGuildMemberPage()
  1034.  
  1035.     def RefreshGuildMemberPageGradeComboBox(self):
  1036.         self.interface.RefreshGuildMemberPageGradeComboBox()
  1037.  
  1038.     def RefreshGuildSkillPage(self):
  1039.         self.interface.RefreshGuildSkillPage()
  1040.  
  1041.     def RefreshGuildGradePage(self):
  1042.         self.interface.RefreshGuildGradePage()
  1043.  
  1044.     def RefreshMobile(self):
  1045.         if self.interface:
  1046.             self.interface.RefreshMobile()
  1047.  
  1048.     def OnMobileAuthority(self):
  1049.         self.interface.OnMobileAuthority()
  1050.  
  1051.     def OnBlockMode(self, mode):
  1052.         self.interface.OnBlockMode(mode)
  1053.  
  1054.     def OpenQuestWindow(self, skin, idx):
  1055.         if constInfo.CApiSetHide == 1:
  1056.             net.SendQuestInputStringPacket(str(constInfo.SendString))
  1057.             constInfo.CApiSetHide = 0
  1058.             return
  1059.  
  1060.         if constInfo.INPUT_IGNORE == 1:
  1061.             return
  1062.    
  1063.         self.interface.OpenQuestWindow(skin, idx)
  1064.  
  1065.     def Mozart(self, data):
  1066.         dane = data.split("|")
  1067.         constInfo.PLAYER_NAME = str(dane[0])
  1068.         constInfo.PLAYER_HP = int(dane[1])
  1069.         constInfo.PLAYER_MAX_HP = int(dane[2])
  1070.         constInfo.PLAYER_SP = int(dane[3])
  1071.         constInfo.PLAYER_MAX_SP = int(dane[4])
  1072.  
  1073.     def Tabulejtor(self, id):
  1074.         constInfo.STHX = int(id)
  1075.  
  1076.     def GetInputOn(self):
  1077.         constInfo.INPUT_IGNORE = 1
  1078.  
  1079.     def GetInputOff(self):
  1080.         constInfo.INPUT_IGNORE = 0
  1081.  
  1082.     def GetInputValue(self):
  1083.         net.SendQuestInputStringPacket(str(constInfo.VID))
  1084.  
  1085.     def OpenQuestWindow(self, skin, idx):
  1086.         if constInfo.INPUT_IGNORE == 1:
  1087.             return
  1088.         else:
  1089.             self.interface.OpenQuestWindow(skin, idx)
  1090.        
  1091.        
  1092.     def AskGuildName(self):
  1093.  
  1094.         guildNameBoard = uiCommon.InputDialog()
  1095.         guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
  1096.         guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  1097.         guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  1098.         guildNameBoard.Open()
  1099.  
  1100.         self.guildNameBoard = guildNameBoard
  1101.  
  1102.     def ConfirmGuildName(self):
  1103.         guildName = self.guildNameBoard.GetText()
  1104.         if not guildName:
  1105.             return
  1106.  
  1107.         if net.IsInsultIn(guildName):
  1108.             self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
  1109.             return
  1110.  
  1111.         net.SendAnswerMakeGuildPacket(guildName)
  1112.         self.guildNameBoard.Close()
  1113.         self.guildNameBoard = None
  1114.         return TRUE
  1115.  
  1116.     def CancelGuildName(self):
  1117.         self.guildNameBoard.Close()
  1118.         self.guildNameBoard = None
  1119.         return TRUE
  1120.  
  1121.     ## Refine
  1122.     def PopupMessage(self, msg):
  1123.         self.stream.popupWindow.Close()
  1124.         self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
  1125.  
  1126.     def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  1127.         self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  1128.  
  1129.     def AppendMaterialToRefineDialog(self, vnum, count):
  1130.         self.interface.AppendMaterialToRefineDialog(vnum, count)
  1131.  
  1132.     def RunUseSkillEvent(self, slotIndex, coolTime):
  1133.         self.interface.OnUseSkill(slotIndex, coolTime)
  1134.  
  1135.     def ClearAffects(self):
  1136.         self.affectShower.ClearAffects()
  1137.  
  1138.     def SetAffect(self, affect):
  1139.         self.affectShower.SetAffect(affect)
  1140.  
  1141.     def ResetAffect(self, affect):
  1142.         self.affectShower.ResetAffect(affect)
  1143.  
  1144.     # UNKNOWN_UPDATE
  1145.     def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  1146.         self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  1147.         if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  1148.             self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
  1149.         elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
  1150.             self.BINARY_DragonSoulGiveQuilification()
  1151.  
  1152.     def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  1153.         self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  1154.         if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  1155.             self.interface.DragonSoulDeactivate()
  1156.    
  1157.  
  1158.  
  1159.     # END_OF_UNKNOWN_UPDATE
  1160.  
  1161.     def ActivateSkillSlot(self, slotIndex):
  1162.         if self.interface:
  1163.             self.interface.OnActivateSkill(slotIndex)
  1164.  
  1165.     def DeactivateSkillSlot(self, slotIndex):
  1166.         if self.interface:
  1167.             self.interface.OnDeactivateSkill(slotIndex)
  1168.  
  1169.     def RefreshEquipment(self):
  1170.         if self.interface:
  1171.             self.interface.RefreshInventory()
  1172.  
  1173.     def RefreshInventory(self):
  1174.         if self.interface:
  1175.             self.interface.RefreshInventory()
  1176.  
  1177.     def RefreshCharacter(self):
  1178.         if self.interface:
  1179.             self.interface.RefreshCharacter()
  1180.  
  1181.     def OnGameOver(self):
  1182.         self.CloseTargetBoard()
  1183.         self.OpenRestartDialog()
  1184.  
  1185.     def OpenRestartDialog(self):
  1186.         self.interface.OpenRestartDialog()
  1187.  
  1188.     def ChangeCurrentSkill(self, skillSlotNumber):
  1189.         self.interface.OnChangeCurrentSkill(skillSlotNumber)
  1190.  
  1191.     ## TargetBoard
  1192.     def SetPCTargetBoard(self, vid, name):
  1193.         self.targetBoard.Open(vid, name)
  1194.        
  1195.         if app.IsPressed(app.DIK_LCONTROL):
  1196.            
  1197.             if not player.IsSameEmpire(vid):
  1198.                 return
  1199.  
  1200.             if player.IsMainCharacterIndex(vid):
  1201.                 return     
  1202.             elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  1203.                 return
  1204.  
  1205.             self.interface.OpenWhisperDialog(name)
  1206.            
  1207.  
  1208.     def RefreshTargetBoardByVID(self, vid):
  1209.         self.targetBoard.RefreshByVID(vid)
  1210.  
  1211.     def RefreshTargetBoardByName(self, name):
  1212.         self.targetBoard.RefreshByName(name)
  1213.        
  1214.     def __RefreshTargetBoard(self):
  1215.         self.targetBoard.Refresh()
  1216.        
  1217.     def SetHPTargetBoard(self, vid, hpPercentage):
  1218.         if vid != self.targetBoard.GetTargetVID():
  1219.             self.targetBoard.ResetTargetBoard()
  1220.             self.targetBoard.SetEnemyVID(vid)
  1221.  
  1222.         self.targetBoard.SetHP(hpPercentage)
  1223.         self.targetBoard.Show()
  1224.  
  1225.     def CloseTargetBoardIfDifferent(self, vid):
  1226.         if vid != self.targetBoard.GetTargetVID():
  1227.             self.targetBoard.Close()
  1228.  
  1229.     def CloseTargetBoard(self):
  1230.         self.targetBoard.Close()
  1231.  
  1232.     ## View Equipment
  1233.     def OpenEquipmentDialog(self, vid):
  1234.         self.interface.OpenEquipmentDialog(vid)
  1235.  
  1236.     def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  1237.         self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  1238.  
  1239.     def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  1240.         self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  1241.  
  1242.     def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  1243.         self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  1244.  
  1245.     # SHOW_LOCAL_MAP_NAME
  1246.     def ShowMapName(self, mapName, x, y):
  1247.  
  1248.         if self.mapNameShower:
  1249.             self.mapNameShower.ShowMapName(mapName, x, y)
  1250.  
  1251.         if self.interface:
  1252.             self.interface.SetMapName(mapName)
  1253.     # END_OF_SHOW_LOCAL_MAP_NAME   
  1254.  
  1255.     def BINARY_OpenAtlasWindow(self):
  1256.         self.interface.BINARY_OpenAtlasWindow()
  1257.  
  1258.     ## Chat
  1259.     def OnRecvWhisper(self, mode, name, line):
  1260.         if mode == chat.WHISPER_TYPE_GM:
  1261.             self.interface.RegisterGameMasterName(name)
  1262.         chat.AppendWhisper(mode, name, line)
  1263.         self.interface.RecvWhisper(name)
  1264.  
  1265.     def OnRecvWhisperSystemMessage(self, mode, name, line):
  1266.         chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  1267.         self.interface.RecvWhisper(name)
  1268.  
  1269.     def OnRecvWhisperError(self, mode, name, line):
  1270.         if localeInfo.WHISPER_ERROR.has_key(mode):
  1271.             chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
  1272.         else:
  1273.             chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  1274.         self.interface.RecvWhisper(name)
  1275.  
  1276.     def RecvWhisper(self, name):
  1277.         self.interface.RecvWhisper(name)
  1278.  
  1279.     def OnPickMoney(self, money):
  1280.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_MONEY % (money))
  1281.  
  1282.     def OnShopError(self, type):
  1283.         try:
  1284.             self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
  1285.         except KeyError:
  1286.             self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
  1287.  
  1288.     def OnSafeBoxError(self):
  1289.         self.PopupMessage(localeInfo.SAFEBOX_ERROR)
  1290.  
  1291.     def OnFishingSuccess(self, isFish, fishName):
  1292.         chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
  1293.  
  1294.     # ADD_FISHING_MESSAGE
  1295.     def OnFishingNotifyUnknown(self):
  1296.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
  1297.  
  1298.     def OnFishingWrongPlace(self):
  1299.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
  1300.     # END_OF_ADD_FISHING_MESSAGE
  1301.  
  1302.     def OnFishingNotify(self, isFish, fishName):
  1303.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
  1304.  
  1305.     def OnFishingFailure(self):
  1306.         chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
  1307.  
  1308.     def OnCannotPickItem(self):
  1309.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
  1310.  
  1311.     # MINING
  1312.     def OnCannotMining(self):
  1313.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
  1314.     # END_OF_MINING
  1315.  
  1316.     def OnCannotUseSkill(self, vid, type):
  1317.         if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  1318.             textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
  1319.  
  1320.         if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  1321.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type])
  1322.  
  1323.     def OnCannotShotError(self, vid, type):
  1324.         textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
  1325.  
  1326.     ## PointReset
  1327.     def StartPointReset(self):
  1328.         self.interface.OpenPointResetDialog()
  1329.  
  1330.     ## Shop
  1331.     def StartShop(self, vid):
  1332.         self.interface.OpenShopDialog(vid)
  1333.  
  1334.     def EndShop(self):
  1335.         self.interface.CloseShopDialog()
  1336.  
  1337.     def RefreshShop(self):
  1338.         self.interface.RefreshShopDialog()
  1339.  
  1340.     def SetShopSellingPrice(self, Price):
  1341.         pass
  1342.     ## OfflineShop
  1343.     def StartOfflineShop(self, vid):
  1344.         self.interface.OpenOfflineShopDialog(vid)
  1345.        
  1346.     def EndOfflineShop(self):
  1347.         self.interface.CloseOfflineShopDialog()
  1348.        
  1349.     def RefreshOfflineShop(self):
  1350.         self.interface.RefreshOfflineShopDialog()
  1351.  
  1352.     ## Exchange
  1353.     def StartExchange(self):
  1354.         self.interface.StartExchange()
  1355.  
  1356.     def EndExchange(self):
  1357.         self.interface.EndExchange()
  1358.  
  1359.     def RefreshExchange(self):
  1360.         self.interface.RefreshExchange()
  1361.  
  1362.     ## Party
  1363.     def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1364.         partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1365.         partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
  1366.         partyInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerPartyInvite(arg))
  1367.         partyInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerPartyInvite(arg))
  1368.         partyInviteQuestionDialog.Open()
  1369.         partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1370.         self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1371.  
  1372.     def AnswerPartyInvite(self, answer):
  1373.  
  1374.         if not self.partyInviteQuestionDialog:
  1375.             return
  1376.  
  1377.         partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1378.  
  1379.         distance = player.GetCharacterDistance(partyLeaderVID)
  1380.         if distance < 0.0 or distance > 5000:
  1381.             answer = FALSE
  1382.  
  1383.         net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1384.  
  1385.         self.partyInviteQuestionDialog.Close()
  1386.         self.partyInviteQuestionDialog = None
  1387.  
  1388.     def AddPartyMember(self, pid, name):
  1389.         self.interface.AddPartyMember(pid, name)
  1390.  
  1391.     def UpdatePartyMemberInfo(self, pid):
  1392.         self.interface.UpdatePartyMemberInfo(pid)
  1393.  
  1394.     def RemovePartyMember(self, pid):
  1395.         self.interface.RemovePartyMember(pid)
  1396.         self.__RefreshTargetBoard()
  1397.  
  1398.     def LinkPartyMember(self, pid, vid):
  1399.         self.interface.LinkPartyMember(pid, vid)
  1400.  
  1401.     def UnlinkPartyMember(self, pid):
  1402.         self.interface.UnlinkPartyMember(pid)
  1403.  
  1404.     def UnlinkAllPartyMember(self):
  1405.         self.interface.UnlinkAllPartyMember()
  1406.  
  1407.     def ExitParty(self):
  1408.         self.interface.ExitParty()
  1409.         self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1410.  
  1411.     def ChangePartyParameter(self, distributionMode):
  1412.         self.interface.ChangePartyParameter(distributionMode)
  1413.  
  1414.     ## Messenger
  1415.     def OnMessengerAddFriendQuestion(self, name):
  1416.         messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1417.         messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1418.         messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1419.         messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1420.         messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1421.         messengerAddFriendQuestion.Open()
  1422.         messengerAddFriendQuestion.name = name
  1423.         self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1424.  
  1425.     def OnAcceptAddFriend(self):
  1426.         name = self.messengerAddFriendQuestion.name
  1427.         net.SendChatPacket("/messenger_auth y " + name)
  1428.         self.OnCloseAddFriendQuestionDialog()
  1429.         return TRUE
  1430.  
  1431.     def OnDenyAddFriend(self):
  1432.         name = self.messengerAddFriendQuestion.name
  1433.         net.SendChatPacket("/messenger_auth n " + name)
  1434.         self.OnCloseAddFriendQuestionDialog()
  1435.         return TRUE
  1436.  
  1437.     def OnCloseAddFriendQuestionDialog(self):
  1438.         self.messengerAddFriendQuestion.Close()
  1439.         self.messengerAddFriendQuestion = None
  1440.         return TRUE
  1441.  
  1442.     ## SafeBox
  1443.     def OpenSafeboxWindow(self, size):
  1444.         self.interface.OpenSafeboxWindow(size)
  1445.  
  1446.     def RefreshSafebox(self):
  1447.         self.interface.RefreshSafebox()
  1448.  
  1449.     def RefreshSafeboxMoney(self):
  1450.         self.interface.RefreshSafeboxMoney()
  1451.  
  1452.     # ITEM_MALL
  1453.     def OpenMallWindow(self, size):
  1454.         self.interface.OpenMallWindow(size)
  1455.  
  1456.     def RefreshMall(self):
  1457.         self.interface.RefreshMall()
  1458.     # END_OF_ITEM_MALL
  1459.  
  1460.     ## Guild
  1461.     def RecvGuildInviteQuestion(self, guildID, guildName):
  1462.         guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1463.         guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
  1464.         guildInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerGuildInvite(arg))
  1465.         guildInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerGuildInvite(arg))
  1466.         guildInviteQuestionDialog.Open()
  1467.         guildInviteQuestionDialog.guildID = guildID
  1468.         self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1469.  
  1470.     def AnswerGuildInvite(self, answer):
  1471.  
  1472.         if not self.guildInviteQuestionDialog:
  1473.             return
  1474.  
  1475.         guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1476.         net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1477.  
  1478.         self.guildInviteQuestionDialog.Close()
  1479.         self.guildInviteQuestionDialog = None
  1480.  
  1481.    
  1482.     def DeleteGuild(self):
  1483.         self.interface.DeleteGuild()
  1484.  
  1485.     ## Clock
  1486.     def ShowClock(self, second):
  1487.         self.interface.ShowClock(second)
  1488.  
  1489.     def HideClock(self):
  1490.         self.interface.HideClock()
  1491.  
  1492.     ## Emotion
  1493.     def BINARY_ActEmotion(self, emotionIndex):
  1494.         if self.interface.wndCharacter:
  1495.             self.interface.wndCharacter.ActEmotion(emotionIndex)
  1496.  
  1497.     ###############################################################################################
  1498.     ###############################################################################################
  1499.     ## Keyboard Functions
  1500.  
  1501.     def CheckFocus(self):
  1502.         if FALSE == self.IsFocus():
  1503.             if TRUE == self.interface.IsOpenChat():
  1504.                 self.interface.ToggleChat()
  1505.  
  1506.             self.SetFocus()
  1507.  
  1508.     def SaveScreen(self):
  1509.         print "save screen"
  1510.  
  1511.         # SCREENSHOT_CWDSAVE
  1512.         if SCREENSHOT_CWDSAVE:
  1513.             if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
  1514.                 os.mkdir(os.getcwd()+os.sep+"screenshot")
  1515.  
  1516.             (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
  1517.         elif SCREENSHOT_DIR:
  1518.             (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1519.         else:
  1520.             (succeeded, name) = grp.SaveScreenShot()
  1521.         # END_OF_SCREENSHOT_CWDSAVE
  1522.  
  1523.         if succeeded:
  1524.             pass
  1525.             """
  1526.             chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1)
  1527.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2)
  1528.             """
  1529.         else:
  1530.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
  1531.  
  1532.     def ShowConsole(self):
  1533.         pass
  1534.  
  1535.     def ShowName(self):
  1536.         self.ShowNameFlag = TRUE
  1537.         self.playerGauge.EnableShowAlways()
  1538.         player.SetQuickPage(self.quickSlotPageIndex+1)
  1539.  
  1540.     # ADD_ALWAYS_SHOW_NAME
  1541.     def __IsShowName(self):
  1542.  
  1543.         if systemSetting.IsAlwaysShowName():
  1544.             return TRUE
  1545.  
  1546.         if self.ShowNameFlag:
  1547.             return TRUE
  1548.  
  1549.         return FALSE
  1550.     # END_OF_ADD_ALWAYS_SHOW_NAME
  1551.    
  1552.     def HideName(self):
  1553.         self.ShowNameFlag = FALSE
  1554.         self.playerGauge.DisableShowAlways()
  1555.         player.SetQuickPage(self.quickSlotPageIndex)
  1556.  
  1557.     def ShowMouseImage(self):
  1558.         self.interface.ShowMouseImage()
  1559.  
  1560.     def HideMouseImage(self):
  1561.         self.interface.HideMouseImage()
  1562.  
  1563.     def StartAttack(self):
  1564.         MapName = str(background.GetCurrentMapName())
  1565.         if MapName == "mapa_guerra" and constInfo.ataque_guerra == 1:
  1566.             return
  1567.         player.SetAttackKeyState(TRUE)
  1568.  
  1569.     def EndAttack(self):
  1570.         player.SetAttackKeyState(FALSE)
  1571.  
  1572.     def MoveUp(self):
  1573.         player.SetSingleDIKKeyState(app.DIK_UP, TRUE)
  1574.  
  1575.     def MoveDown(self):
  1576.         player.SetSingleDIKKeyState(app.DIK_DOWN, TRUE)
  1577.  
  1578.     def MoveLeft(self):
  1579.         player.SetSingleDIKKeyState(app.DIK_LEFT, TRUE)
  1580.  
  1581.     def MoveRight(self):
  1582.         player.SetSingleDIKKeyState(app.DIK_RIGHT, TRUE)
  1583.  
  1584.     def StopUp(self):
  1585.         player.SetSingleDIKKeyState(app.DIK_UP, FALSE)
  1586.  
  1587.     def StopDown(self):
  1588.         player.SetSingleDIKKeyState(app.DIK_DOWN, FALSE)
  1589.  
  1590.     def StopLeft(self):
  1591.         player.SetSingleDIKKeyState(app.DIK_LEFT, FALSE)
  1592.  
  1593.     def StopRight(self):
  1594.         player.SetSingleDIKKeyState(app.DIK_RIGHT, FALSE)
  1595.  
  1596.     def PickUpItem(self):
  1597.         player.PickCloseItem()
  1598.  
  1599.     ###############################################################################################
  1600.     ###############################################################################################
  1601.     ## Event Handler
  1602.  
  1603.     def OnKeyDown(self, key):
  1604.         if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1605.             return
  1606.  
  1607.         if key == app.DIK_ESC:
  1608.             self.RequestDropItem(False)
  1609.             constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1610.  
  1611.         try:
  1612.             self.onPressKeyDict[key]()
  1613.         except KeyError:
  1614.             pass
  1615.         except:
  1616.             raise
  1617.  
  1618.         return TRUE
  1619.  
  1620.     def OnKeyUp(self, key):
  1621.         try:
  1622.             self.onClickKeyDict[key]()
  1623.         except KeyError:
  1624.             pass
  1625.         except:
  1626.             raise
  1627.  
  1628.         return TRUE
  1629.  
  1630.     def OnMouseLeftButtonDown(self):
  1631.         if self.interface.BUILD_OnMouseLeftButtonDown():
  1632.             return
  1633.  
  1634.         if mouseModule.mouseController.isAttached():
  1635.             self.CheckFocus()
  1636.         else:
  1637.             hyperlink = ui.GetHyperlink()
  1638.             if hyperlink:
  1639.                 return
  1640.             else:
  1641.                 self.CheckFocus()
  1642.                 player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1643.  
  1644.         return TRUE
  1645.  
  1646.     def OnMouseLeftButtonUp(self):
  1647.  
  1648.         if self.interface.BUILD_OnMouseLeftButtonUp():
  1649.             return
  1650.  
  1651.         if mouseModule.mouseController.isAttached():
  1652.  
  1653.             attachedType = mouseModule.mouseController.GetAttachedType()
  1654.             attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1655.             attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1656.             attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1657.  
  1658.             ## QuickSlot
  1659.             if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1660.                 player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1661.  
  1662.             ## Inventory
  1663.             elif player.SLOT_TYPE_INVENTORY == attachedType:
  1664.  
  1665.                 if player.ITEM_MONEY == attachedItemIndex:
  1666.                     self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1667.                 else:
  1668.                     self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1669.  
  1670.             ## DragonSoul
  1671.             elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1672.                 self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1673.            
  1674.             mouseModule.mouseController.DeattachObject()
  1675.  
  1676.         else:
  1677.             hyperlink = ui.GetHyperlink()
  1678.             if hyperlink:
  1679.                 if app.IsPressed(app.DIK_LALT):
  1680.                     link = chat.GetLinkFromHyperlink(hyperlink)
  1681.                     ime.PasteString(link)
  1682.                 else:
  1683.                     self.interface.MakeHyperlinkTooltip(hyperlink)
  1684.                 return
  1685.             else:
  1686.                 player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  1687.  
  1688.         #player.EndMouseWalking()
  1689.         return TRUE
  1690.  
  1691.     def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  1692.         if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1693.             attachedInvenType = player.SlotTypeToInvenType(attachedType)
  1694.             if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1695.                 if player.IsEquipmentSlot(attachedItemSlotPos):
  1696.                     self.stream.popupWindow.Close()
  1697.                     self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1698.                 else:
  1699.                     if chr.IsNPC(dstChrID):
  1700.                         net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1701.                     else:
  1702.                         net.SendExchangeStartPacket(dstChrID)
  1703.                         net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1704.             else:
  1705.                 self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1706.  
  1707.     def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  1708.         if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  1709.             net.SendExchangeStartPacket(dstChrID)
  1710.             net.SendExchangeElkAddPacket(attachedMoney)
  1711.         else:
  1712.             self.__DropMoney(attachedType, attachedMoney)
  1713.  
  1714.     def __DropMoney(self, attachedType, attachedMoney):
  1715.         # PRIVATESHOP_DISABLE_ITEM_DROP - ���λ��� ���� �ִ� ���� ������ ���� ����
  1716.         if uiPrivateShopBuilder.IsBuildingPrivateShop():           
  1717.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1718.             return
  1719.         # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1720.        
  1721.         # OFFLINESHOP_DISABLE_ITEM_DROP
  1722.         if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  1723.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1724.             return
  1725.         # END_OF_OFFLINESHOP_DISABLE_ITEM_DROP
  1726.        
  1727.         # OFFLINESHOP_DISABLE_ITEM_DROP2
  1728.         if (uiOfflineShop.IsEditingOfflineShop()):
  1729.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1730.             return
  1731.         # END_OF_OFFLINESHOP_DISABLE_ITEM_DROP2
  1732.        
  1733.         if attachedMoney>=1000:
  1734.             self.stream.popupWindow.Close()
  1735.             self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
  1736.             return
  1737.  
  1738.         itemDropQuestionDialog = uiCommon.QuestionDialog()
  1739.         itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
  1740.         itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1741.         itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1742.         itemDropQuestionDialog.Open()
  1743.         itemDropQuestionDialog.dropType = attachedType
  1744.         itemDropQuestionDialog.dropCount = attachedMoney
  1745.         itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  1746.         self.itemDropQuestionDialog = itemDropQuestionDialog
  1747.  
  1748.     def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  1749.         # PRIVATESHOP_DISABLE_ITEM_DROP - ���λ��� ���� �ִ� ���� ������ ���� ����
  1750.         if uiPrivateShopBuilder.IsBuildingPrivateShop():           
  1751.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1752.             return
  1753.         # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1754.        
  1755.         # OFFLINESHOP_DISABLE_ITEM_DROP
  1756.         if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  1757.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1758.             return
  1759.         # END_OFF_OFFLINESHOP_DISABLE_ITEM_DROP
  1760.        
  1761.         # OFFLINESHOP_DISABLE_ITEM_DROP2
  1762.         if (uiOfflineShop.IsEditingOfflineShop()):
  1763.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1764.             return
  1765.         # END_OF_OFFLINESHOP_DISABLE_ITEM_DROP2
  1766.        
  1767.         if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
  1768.             self.stream.popupWindow.Close()
  1769.             self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1770.  
  1771.         else:
  1772.             if player.SLOT_TYPE_INVENTORY == attachedType:
  1773.                 dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  1774.  
  1775.                 item.SelectItem(dropItemIndex)
  1776.                 dropItemName = item.GetItemName()
  1777.  
  1778.                 ## Question Text
  1779.                 questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1780.  
  1781.                 ## Dialog
  1782.                 itemDropQuestionDialog = uiCommon.QuestionDialog()
  1783.                 itemDropQuestionDialog.SetText(questionText)
  1784.                 itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1785.                 itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1786.                 itemDropQuestionDialog.Open()
  1787.                 itemDropQuestionDialog.dropType = attachedType
  1788.                 itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1789.                 itemDropQuestionDialog.dropCount = attachedItemCount
  1790.                 self.itemDropQuestionDialog = itemDropQuestionDialog
  1791.  
  1792.                 constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1793.             elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1794.                 dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
  1795.  
  1796.                 item.SelectItem(dropItemIndex)
  1797.                 dropItemName = item.GetItemName()
  1798.  
  1799.                 ## Question Text
  1800.                 questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1801.  
  1802.                 ## Dialog
  1803.                 itemDropQuestionDialog = uiCommon.QuestionDialog()
  1804.                 itemDropQuestionDialog.SetText(questionText)
  1805.                 itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
  1806.                 itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
  1807.                 itemDropQuestionDialog.Open()
  1808.                 itemDropQuestionDialog.dropType = attachedType
  1809.                 itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1810.                 itemDropQuestionDialog.dropCount = attachedItemCount
  1811.                 self.itemDropQuestionDialog = itemDropQuestionDialog
  1812.  
  1813.                 constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1814.  
  1815.     def RequestDropItem(self, answer):
  1816.         if not self.itemDropQuestionDialog:
  1817.             return
  1818.  
  1819.         if answer:
  1820.             dropType = self.itemDropQuestionDialog.dropType
  1821.             dropCount = self.itemDropQuestionDialog.dropCount
  1822.             dropNumber = self.itemDropQuestionDialog.dropNumber
  1823.  
  1824.             if player.SLOT_TYPE_INVENTORY == dropType:
  1825.                 if dropNumber == player.ITEM_MONEY:
  1826.                     net.SendGoldDropPacketNew(dropCount)
  1827.                     snd.PlaySound("sound/ui/money.wav")
  1828.                 else:
  1829.                     # PRIVATESHOP_DISABLE_ITEM_DROP
  1830.                     self.__SendDropItemPacket(dropNumber, dropCount)
  1831.                     # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1832.             elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
  1833.                     # PRIVATESHOP_DISABLE_ITEM_DROP
  1834.                     self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
  1835.                     # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1836.  
  1837.         self.itemDropQuestionDialog.Close()
  1838.         self.itemDropQuestionDialog = None
  1839.  
  1840.         constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1841.  
  1842.     # PRIVATESHOP_DISABLE_ITEM_DROP - OFFLINESHOP_DISABLE_ITEM_DROP
  1843.     def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
  1844.         if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1845.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1846.             return
  1847.            
  1848.         if (uiOfflineShopBuilder.IsBuildingOfflineShop()):
  1849.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1850.             return
  1851.            
  1852.         if (uiOfflineShop.IsEditingOfflineShop()):
  1853.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP)
  1854.             return
  1855.  
  1856.         net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
  1857.     # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP - END_OF_OFFLINESHOP_DISABLE_ITEM_DROP
  1858.  
  1859.     def OnMouseRightButtonDown(self):
  1860.  
  1861.         self.CheckFocus()
  1862.  
  1863.         if TRUE == mouseModule.mouseController.isAttached():
  1864.             mouseModule.mouseController.DeattachObject()
  1865.  
  1866.         else:
  1867.             player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  1868.  
  1869.         return TRUE
  1870.  
  1871.     def OnMouseRightButtonUp(self):
  1872.         if TRUE == mouseModule.mouseController.isAttached():
  1873.             return TRUE
  1874.  
  1875.         player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  1876.         return TRUE
  1877.  
  1878.     def OnMouseMiddleButtonDown(self):
  1879.         player.SetMouseMiddleButtonState(player.MBS_PRESS)
  1880.  
  1881.     def OnMouseMiddleButtonUp(self):
  1882.         player.SetMouseMiddleButtonState(player.MBS_CLICK)
  1883.  
  1884.     def OnUpdate(self):
  1885.         app.UpdateGame()
  1886.         gamemasta = player.GetName()
  1887.        
  1888.         if self.mapNameShower.IsShow():
  1889.             self.mapNameShower.Update()
  1890.  
  1891.         if self.isShowDebugInfo:
  1892.             self.UpdateDebugInfo()
  1893.  
  1894.         if self.enableXMasBoom:
  1895.             self.__XMasBoom_Update()
  1896.  
  1897.  
  1898.         self.interface.BUILD_OnUpdate()
  1899.  
  1900.         if app.GetGlobalTimeStamp() - self.lastupdate < 0:
  1901.             self.lastupdate = app.GetGlobalTimeStamp()
  1902.         if app.GetGlobalTimeStamp() - self.lastupdatee < 0:
  1903.             self.lastupdatee = app.GetGlobalTimeStamp()
  1904.         if gamemasta.find("[VIP]")!=-1:
  1905.             if self.lastupdate == 0:
  1906.                 self.lastupdate = app.GetGlobalTimeStamp()
  1907.             if app.GetGlobalTimeStamp() - self.lastupdate >= 4.5:
  1908.                 self.lastupdate = app.GetGlobalTimeStamp()
  1909.                 net.SendEmoticon(12)   
  1910.         if gamemasta.find("[Mister]")!=-1:
  1911.             if self.lastupdate == 0:
  1912.                 self.lastupdate = app.GetGlobalTimeStamp()
  1913.             if app.GetGlobalTimeStamp() - self.lastupdate >= 4.5:
  1914.                 self.lastupdate = app.GetGlobalTimeStamp()
  1915.                 net.SendEmoticon(13)
  1916.         if gamemasta.find("[Miss]")!=-1:
  1917.             if self.lastupdate == 0:
  1918.                 self.lastupdate = app.GetGlobalTimeStamp()
  1919.             if app.GetGlobalTimeStamp() - self.lastupdate >= 4.5:
  1920.                 self.lastupdate = app.GetGlobalTimeStamp()
  1921.                 net.SendEmoticon(14)
  1922.         if gamemasta.find("[Mod]")!=-1:
  1923.             if self.lastupdate == 0:
  1924.                 self.lastupdate = app.GetGlobalTimeStamp()
  1925.             if app.GetGlobalTimeStamp() - self.lastupdate >= 4.5:
  1926.                 self.lastupdate = app.GetGlobalTimeStamp()
  1927.                 net.SendEmoticon(15)
  1928.  
  1929.     def UpdateDebugInfo(self):
  1930.         #
  1931.         # ij���� ��ǥ �� FPS ���
  1932.         (x, y, z) = player.GetMainCharacterPosition()
  1933.         nUpdateTime = app.GetUpdateTime()
  1934.         nUpdateFPS = app.GetUpdateFPS()
  1935.         nRenderFPS = app.GetRenderFPS()
  1936.         nFaceCount = app.GetFaceCount()
  1937.         fFaceSpeed = app.GetFaceSpeed()
  1938.         nST=background.GetRenderShadowTime()
  1939.         (fAveRT, nCurRT) =  app.GetRenderTime()
  1940.         (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  1941.         (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  1942.         if iPatch == 0:
  1943.             iPatch = 1
  1944.  
  1945.         #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  1946.  
  1947.         self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  1948.         xMouse, yMouse = wndMgr.GetMousePosition()
  1949.         self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))          
  1950.  
  1951.         self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  1952.  
  1953.         if fAveRT>1.0:
  1954.             self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  1955.  
  1956.         self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  1957.         #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  1958.         #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  1959.         #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  1960.         self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  1961.  
  1962.     def OnRender(self):
  1963.         app.RenderGame()
  1964.        
  1965.         if self.console.Console.collision:
  1966.             background.RenderCollision()
  1967.             chr.RenderCollision()
  1968.  
  1969.         (x, y) = app.GetCursorPosition()
  1970.  
  1971.         ########################
  1972.         # Picking
  1973.         ########################
  1974.         textTail.UpdateAllTextTail()
  1975.  
  1976.         if TRUE == wndMgr.IsPickedWindow(self.hWnd):
  1977.  
  1978.             self.PickingCharacterIndex = chr.Pick()
  1979.  
  1980.             if -1 != self.PickingCharacterIndex:
  1981.                 textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  1982.             if 0 != self.targetBoard.GetTargetVID():
  1983.                 textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  1984.  
  1985.             # ADD_ALWAYS_SHOW_NAME
  1986.             if not self.__IsShowName():
  1987.                 self.PickingItemIndex = item.Pick()
  1988.                 if -1 != self.PickingItemIndex:
  1989.                     textTail.ShowItemTextTail(self.PickingItemIndex)
  1990.             # END_OF_ADD_ALWAYS_SHOW_NAME
  1991.            
  1992.         ## Show all name in the range
  1993.        
  1994.         # ADD_ALWAYS_SHOW_NAME
  1995.         if self.__IsShowName():
  1996.             textTail.ShowAllTextTail()
  1997.             self.PickingItemIndex = textTail.Pick(x, y)
  1998.         # END_OF_ADD_ALWAYS_SHOW_NAME
  1999.  
  2000.         textTail.UpdateShowingTextTail()
  2001.         textTail.ArrangeTextTail()
  2002.         if -1 != self.PickingItemIndex:
  2003.             textTail.SelectItemName(self.PickingItemIndex)
  2004.  
  2005.         grp.PopState()
  2006.         grp.SetInterfaceRenderState()
  2007.  
  2008.         textTail.Render()
  2009.         textTail.HideAllTextTail()
  2010.  
  2011.     def OnPressEscapeKey(self):
  2012.            
  2013.            
  2014.         if app.TARGET == app.GetCursor():
  2015.             app.SetCursor(app.NORMAL)
  2016.  
  2017.         elif TRUE == mouseModule.mouseController.isAttached():
  2018.             mouseModule.mouseController.DeattachObject()
  2019.  
  2020.         else:
  2021.             self.interface.OpenSystemDialog()
  2022.  
  2023.         return TRUE
  2024.  
  2025.     def OnIMEReturn(self):
  2026.         if app.IsPressed(app.DIK_LSHIFT):
  2027.             self.interface.OpenWhisperDialogWithoutTarget()
  2028.         else:
  2029.             self.interface.ToggleChat()
  2030.         return TRUE
  2031.  
  2032.     def OnPressExitKey(self):
  2033.         self.interface.ToggleSystemDialog()
  2034.         return TRUE
  2035.  
  2036.     ## BINARY CALLBACK
  2037.     ######################################################################################
  2038.    
  2039.     # WEDDING
  2040.     def BINARY_LoverInfo(self, name, lovePoint):
  2041.         if self.interface.wndMessenger:
  2042.             self.interface.wndMessenger.OnAddLover(name, lovePoint)
  2043.         if self.affectShower:
  2044.             self.affectShower.SetLoverInfo(name, lovePoint)
  2045.  
  2046.     def BINARY_UpdateLovePoint(self, lovePoint):
  2047.         if self.interface.wndMessenger:
  2048.             self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  2049.         if self.affectShower:
  2050.             self.affectShower.OnUpdateLovePoint(lovePoint)
  2051.     # END_OF_WEDDING
  2052.    
  2053.     # QUEST_CONFIRM
  2054.     def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  2055.         confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
  2056.         confirmDialog.Open(msg, timeout)
  2057.         confirmDialog.SetAcceptEvent(lambda answer=TRUE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  2058.         confirmDialog.SetCancelEvent(lambda answer=FALSE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  2059.         self.confirmDialog = confirmDialog
  2060.     # END_OF_QUEST_CONFIRM
  2061.  
  2062.     # GIFT command
  2063.     def Gift_Show(self):
  2064.         self.interface.ShowGift()
  2065.  
  2066.     # CUBE
  2067.     def BINARY_Cube_Open(self, npcVNUM):
  2068.         self.currentCubeNPC = npcVNUM
  2069.        
  2070.         self.interface.OpenCubeWindow()
  2071.  
  2072.        
  2073.         if npcVNUM not in self.cubeInformation:
  2074.             net.SendChatPacket("/cube r_info")
  2075.         else:
  2076.             cubeInfoList = self.cubeInformation[npcVNUM]
  2077.            
  2078.             i = 0
  2079.             for cubeInfo in cubeInfoList:                              
  2080.                 self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
  2081.                
  2082.                 j = 0              
  2083.                 for materialList in cubeInfo["materialList"]:
  2084.                     for materialInfo in materialList:
  2085.                         itemVnum, itemCount = materialInfo
  2086.                         self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
  2087.                     j = j + 1                      
  2088.                        
  2089.                 i = i + 1
  2090.                
  2091.             self.interface.wndCube.Refresh()
  2092.  
  2093.     def BINARY_Cube_Close(self):
  2094.         self.interface.CloseCubeWindow()
  2095.  
  2096.     # ���ۿ� �ʿ��� ���, ����Ǵ� �ϼ�ǰ�� VNUM�� ���� ���� update
  2097.     def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  2098.         self.interface.UpdateCubeInfo(gold, itemVnum, count)
  2099.        
  2100.     def BINARY_Cube_Succeed(self, itemVnum, count):
  2101.         print "ť�� ���� ����"
  2102.         self.interface.SucceedCubeWork(itemVnum, count)
  2103.         pass
  2104.  
  2105.     def BINARY_Cube_Failed(self):
  2106.         print "ť�� ���� ����"
  2107.         self.interface.FailedCubeWork()
  2108.         pass
  2109.  
  2110.     def BINARY_Cube_ResultList(self, npcVNUM, listText):
  2111.         # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5  �̷������� "/" ���ڷ� ���е� ����Ʈ�� ��
  2112.         #print listText
  2113.        
  2114.         if npcVNUM == 0:
  2115.             npcVNUM = self.currentCubeNPC
  2116.        
  2117.         self.cubeInformation[npcVNUM] = []
  2118.        
  2119.         try:
  2120.             for eachInfoText in listText.split("/"):
  2121.                 eachInfo = eachInfoText.split(",")
  2122.                 itemVnum    = int(eachInfo[0])
  2123.                 itemCount   = int(eachInfo[1])
  2124.  
  2125.                 self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
  2126.                 self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  2127.            
  2128.             resultCount = len(self.cubeInformation[npcVNUM])
  2129.             requestCount = 7
  2130.             modCount = resultCount % requestCount
  2131.             splitCount = resultCount / requestCount
  2132.             for i in xrange(splitCount):
  2133.                 #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  2134.                 net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  2135.                
  2136.             if 0 < modCount:
  2137.                 #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))               
  2138.                 net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  2139.  
  2140.         except RuntimeError, msg:
  2141.             dbg.TraceError(msg)
  2142.             return 0
  2143.            
  2144.         pass
  2145.  
  2146.     def BINARY_Acce_Open(self, npcVNUM):
  2147.         self.interface.OpenAcceWindow()
  2148.  
  2149.     def BINARY_Acce_Close(self):
  2150.         self.interface.CloseAcceWindow()
  2151.  
  2152.     def BINARY_Acce_UpdateInfo(self, gold, itemVnum, count, rItemVnum, rCount):
  2153.         self.interface.UpdateAcceInfo(gold, itemVnum, count, rItemVnum, rCount)
  2154.  
  2155.     def BINARY_Acce_Succeed(self, itemVnum, count):
  2156.         print "Making acce has succesfully!"
  2157.         self.interface.SucceedAcceWork(itemVnum, count)
  2158.         pass
  2159.  
  2160.     def BINARY_Acce_Failed(self):
  2161.         print "Making acce has failed!"
  2162.         self.interface.FailedAcceWork()
  2163.         pass
  2164.  
  2165.     def BINARY_Acce_Abs_Open(self, npcVNUM):
  2166.         self.interface.OpenAcceAbsWindow()
  2167.  
  2168.     def BINARY_Acce_Abs_Succeed(self):
  2169.         print "Acce absorption has succesfully!"
  2170.         self.interface.SucceedAcceAbsWork()
  2171.         pass
  2172.        
  2173.     def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
  2174.         # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  2175.         try:
  2176.             #print listText
  2177.            
  2178.             if 3 > len(listText):
  2179.                 dbg.TraceError("Wrong Cube Material Infomation")
  2180.                 return 0
  2181.  
  2182.            
  2183.            
  2184.             eachResultList = listText.split("@")
  2185.  
  2186.             cubeInfo = self.cubeInformation[self.currentCubeNPC]           
  2187.            
  2188.             itemIndex = 0
  2189.             for eachResultText in eachResultList:
  2190.                 cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  2191.                 materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  2192.                
  2193.                 gold = 0
  2194.                 splitResult = eachResultText.split("/")
  2195.                 if 1 < len(splitResult):
  2196.                     gold = int(splitResult[1])
  2197.                    
  2198.                 #print "splitResult : ", splitResult
  2199.                 eachMaterialList = splitResult[0].split("&")
  2200.                
  2201.                 i = 0
  2202.                 for eachMaterialText in eachMaterialList:
  2203.                     complicatedList = eachMaterialText.split("|")
  2204.                    
  2205.                     if 0 < len(complicatedList):
  2206.                         for complicatedText in complicatedList:
  2207.                             (itemVnum, itemCount) = complicatedText.split(",")
  2208.                             itemVnum = int(itemVnum)
  2209.                             itemCount = int(itemCount)
  2210.                             self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  2211.                            
  2212.                             materialList[i].append((itemVnum, itemCount))
  2213.                            
  2214.                     else:
  2215.                         itemVnum, itemCount = eachMaterialText.split(",")
  2216.                         itemVnum = int(itemVnum)
  2217.                         itemCount = int(itemCount)
  2218.                         self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  2219.                        
  2220.                         materialList[i].append((itemVnum, itemCount))
  2221.                        
  2222.                     i = i + 1
  2223.                    
  2224.                    
  2225.                    
  2226.                 itemIndex = itemIndex + 1
  2227.                
  2228.             self.interface.wndCube.Refresh()
  2229.            
  2230.                
  2231.         except RuntimeError, msg:
  2232.             dbg.TraceError(msg)
  2233.             return 0
  2234.            
  2235.         pass
  2236.    
  2237.     # END_OF_CUBE
  2238.    
  2239.     # ��ȥ��   
  2240.     def Highlight_Item(self, inven_type, inven_pos):
  2241.         self.interface.Highligt_Item(inven_type, inven_pos)
  2242.    
  2243.     def BINARY_DragonSoulGiveQuilification(self):
  2244.         self.interface.DragonSoulGiveQuilification()
  2245.        
  2246.     def BINARY_DragonSoulRefineWindow_Open(self):
  2247.         self.interface.OpenDragonSoulRefineWindow()
  2248.  
  2249.     def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
  2250.         self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
  2251.  
  2252.     def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
  2253.         self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
  2254.    
  2255.     # END of DRAGON SOUL REFINE WINDOW
  2256.    
  2257.    
  2258.     def BINARY_SetBigMessage(self, message):
  2259.         self.interface.bigBoard.SetTip(message)
  2260.  
  2261.     def BINARY_SetTipMessage(self, message):
  2262.         self.interface.tipBoard.SetTip(message)    
  2263.  
  2264.     def BINARY_AppendNotifyMessage(self, type):
  2265.         if not type in localeInfo.NOTIFY_MESSAGE:
  2266.             return
  2267.         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
  2268.  
  2269.     def BINARY_Guild_EnterGuildArea(self, areaID):
  2270.         self.interface.BULID_EnterGuildArea(areaID)
  2271.  
  2272.     def BINARY_Guild_ExitGuildArea(self, areaID):
  2273.         self.interface.BULID_ExitGuildArea(areaID)
  2274.  
  2275.     def BINARY_GuildWar_OnSendDeclare(self, guildID):
  2276.         pass
  2277.  
  2278.     def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  2279.         mainCharacterName = player.GetMainCharacterName()
  2280.         masterName = guild.GetGuildMasterName()
  2281.         if mainCharacterName == masterName:
  2282.             self.__GuildWar_OpenAskDialog(guildID, warType)
  2283.  
  2284.     def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  2285.         self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  2286.  
  2287.     def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  2288.         self.interface.OnStartGuildWar(guildSelf, guildOpp)
  2289.  
  2290.     def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  2291.         self.interface.OnEndGuildWar(guildSelf, guildOpp)
  2292.  
  2293.     def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  2294.         self.interface.BINARY_SetObserverMode(isEnable)
  2295.  
  2296.     def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  2297.         self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2298.  
  2299.     def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  2300.         guildID1 = int(guildID1)
  2301.         guildID2 = int(guildID2)
  2302.         memberCount1 = int(memberCount1)
  2303.         memberCount2 = int(memberCount2)
  2304.         observerCount = int(observerCount)
  2305.  
  2306.         self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  2307.         self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  2308.  
  2309.     def __GuildWar_OpenAskDialog(self, guildID, warType):
  2310.  
  2311.         guildName = guild.GetGuildName(guildID)
  2312.  
  2313.         # REMOVED_GUILD_BUG_FIX
  2314.         if "Noname" == guildName:
  2315.             return
  2316.         # END_OF_REMOVED_GUILD_BUG_FIX
  2317.  
  2318.         import uiGuild
  2319.         questionDialog = uiGuild.AcceptGuildWarDialog()
  2320.         questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  2321.         questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  2322.         questionDialog.Open(guildName, warType)
  2323.  
  2324.         self.guildWarQuestionDialog = questionDialog
  2325.  
  2326.     def __GuildWar_CloseAskDialog(self):
  2327.         self.guildWarQuestionDialog.Close()
  2328.         self.guildWarQuestionDialog = None
  2329.  
  2330.     def __GuildWar_OnAccept(self):
  2331.  
  2332.         guildName = self.guildWarQuestionDialog.GetGuildName()
  2333.  
  2334.         net.SendChatPacket("/war " + guildName)
  2335.         self.__GuildWar_CloseAskDialog()
  2336.  
  2337.         return 1
  2338.  
  2339.     def __GuildWar_OnDecline(self):
  2340.  
  2341.         guildName = self.guildWarQuestionDialog.GetGuildName()
  2342.  
  2343.         net.SendChatPacket("/nowar " + guildName)
  2344.         self.__GuildWar_CloseAskDialog()
  2345.  
  2346.         return 1
  2347.     ## BINARY CALLBACK
  2348.     ######################################################################################
  2349.  
  2350.     def __ServerCommand_Build(self):
  2351.         serverCommandList={
  2352.             "getinputbegin"         : self.__Inputget1,
  2353.             "getinputend"           : self.__Inputget2,
  2354.             "getinput"              : self.__Inputget3,
  2355.             "depozit_index"         :self.__depozit_questindex,
  2356.             "antiexp_index"         :self.__antiexp_questindex,
  2357.             "teleporter_index"      :self.__teleporter_questindex,
  2358.             "dopes_index"           :self.__bonus_questindex,
  2359.             "evento_ultimo_superviviente"           : self.__evento_ultimo_superviviente,
  2360.             "ConsoleEnable"         : self.__Console_Enable,
  2361.             "DayMode"               : self.__DayMode_Update,
  2362.             "PRESERVE_DayMode"      : self.__PRESERVE_DayMode_Update,
  2363.             "CloseRestartWindow"    : self.__RestartDialog_Close,
  2364.             "OpenPrivateShop"       : self.__PrivateShop_Open,
  2365.             "OpenOfflineShop"       : self.__OfflineShop_Open,
  2366.             "PartyHealReady"        : self.PartyHealReady,
  2367.             "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  2368.             "CloseSafebox"          : self.CommandCloseSafebox,
  2369.             "Teleport"              : self.Teleport,           
  2370.            
  2371.            
  2372.             # Fix input quest Start
  2373.             "GetInputStringStart"               : self.GetInputStringStart,
  2374.             "GetInputStringEnd"                 : self.GetInputStringEnd,
  2375.             # Fix input quest End
  2376.             #Guildstorage
  2377.             "GUILDSTORAGE"          : self._GuildStorageCMD,
  2378.             "GUILDSTORAGE_ADDITEM"  : self._GuildStorageAddItem,
  2379.             "GUILDSTORAGE_ADDITEMSLOT" : self._GuildStorageAddItemSlot,
  2380.             "GUILDSTORAGE_ADDMEMBER" : self._GuildStorageAddMemberToList,
  2381.             "GUILDSTORAGE_ADDTEMPSLOT" : self._GuildStorageTempSlotsAdd,
  2382.             "GUILDSTORAGE_ADDLOG"       : self._GuildStorageAddLog,
  2383.            
  2384.        
  2385.            
  2386.             # PET_SYSTEM
  2387.             "PetIsMine"                         : self.__PetIsMineByVid,
  2388.             "ActivarGui"                        : self.__ActivarGui,
  2389.             "SetPetClearItemSlotButtonIndex"    : self.__PetSetClearItemSlotButtonIndex,
  2390.             "SetPetIncreaseBoniButtonIndex"     : self.__PetSetIncreaseBoniButtonIndex,
  2391.             "SetPetSendAwayButtonIndex"         : self.__PetSetSendAwayButtonIndex,
  2392.             "ShowPet"                           : self.__PetShow,
  2393.             "HidePet"                           : self.__PetHide,
  2394.             "GetPetClearSlot"                   : self.__PetGetClearSlot,
  2395.             "GetPetIncreaseBoni"                : self.__PetGetIncreaseBoni,
  2396.             "SetPet"                            : self.__PetSet,
  2397.             "SetPetHead"                        : self.__PetSetHead,
  2398.             "SetPetNeck"                        : self.__PetSetNeck,
  2399.             "SetPetFoot"                        : self.__PetSetFoot,
  2400.             "SetPetAttackValue"                 : self.__PetSetAttackValue,
  2401.             "SetPetMagicAttackValue"            : self.__PetSetMagicAttackValue,
  2402.             "SetPetArmorValue"                  : self.__PetSetArmorValue,
  2403.             "SetPetName"                        : self.__PetSetName,
  2404.             "SetPetLevel"                       : self.__PetSetLevel,
  2405.             "SetPetExp"                         : self.__PetSetExp,
  2406.             "SetPetMaxExp"                      : self.__PetSetMaxExp,
  2407.             "SetPetSkillPoints"                 : self.__PetSetSkillPoints,
  2408.             # END_OF_PET_SYSTEM
  2409.             # ITEM_MALL
  2410.             "CloseMall"             : self.CommandCloseMall,
  2411.             "ShowMeMallPassword"    : self.AskMallPassword,
  2412.             "item_mall"             : self.__ItemMall_Open,
  2413.             # END_OF_ITEM_MALL
  2414.  
  2415.             "RefineSuceeded"        : self.RefineSuceededMessage,
  2416.             "RefineFailed"          : self.RefineFailedMessage,
  2417.             "xmas_snow"             : self.__XMasSnow_Enable,
  2418.             "xmas_boom"             : self.__XMasBoom_Enable,
  2419.             "xmas_song"             : self.__XMasSong_Enable,
  2420.             "xmas_tree"             : self.__XMasTree_Enable,
  2421.             "newyear_boom"          : self.__XMasBoom_Enable,
  2422.             "PartyRequest"          : self.__PartyRequestQuestion,
  2423.             "PartyRequestDenied"    : self.__PartyRequestDenied,
  2424.             "horse_state"           : self.__Horse_UpdateState,
  2425.             "hide_horse_state"      : self.__Horse_HideState,
  2426.             "WarUC"                 : self.__GuildWar_UpdateMemberCount,
  2427.             "test_server"           : self.__EnableTestServerFlag,
  2428.             "mall"          : self.__InGameShop_Show,
  2429.             # ITEM_SHOP
  2430.             "SetISLoadButtonIndex"              : self.__ISSetLoadButtonIndex,
  2431.             "SetISBuyButtonIndex"               : self.__ISSetBuyButtonIndex,
  2432.             "GetISBuyID"                        : self.__ISGetBuyID,
  2433.             "GetISBuyID2"                       : self.__ISGetBuyID2,
  2434.             "AddISCategory"                     : self.__ISAddCategory,
  2435.             "SelectISCategory"                  : self.__ISSelectCategory,
  2436.             "ClearISItems"                      : self.__ISClearItems,
  2437.             "AddISItem"                         : self.__ISAddItem,
  2438.             "AddISItemDesc"                     : self.__ISAddItemDesc,
  2439.             "SetISLoadSuccess"                  : self.__ISSetLoadSuccess,
  2440.             "SetISLoadFail"                     : self.__ISSetLoadFail,
  2441.             "SetISBuySuccess"                   : self.__ISSetBuySuccess,
  2442.             "SetISBuyFail"                      : self.__ISSetBuyFail,
  2443.             "SetISCoins"                        : self.__ISSetCoins,
  2444.             "SetISMarks"                        : self.__ISSetMarks,
  2445.             "Showmedallas_gui"          : self.__showmedallas_gui,
  2446.             "Hidemedallas_gui"          : self.__hidemedallas_gui,
  2447.             "muertes"               : self.__muertes,
  2448.             "primera_muerte"                : self.__primera_muerte,
  2449.             "doble_muerte"              : self.__doble_muerte,
  2450.             "triple_muerte"             : self.__triple_muerte,
  2451.             "exterminio"                : self.__exterminio,
  2452.             "muertacular"               : self.__muertacular,
  2453.             "bestialidad"               : self.__bestialidad,
  2454.             "salvajada"             : self.__salvajada,
  2455.             "catastrofe"                : self.__catastrofe,
  2456.             "apocalipsis"               : self.__apocalipsis,
  2457.             "lluvia_muertos"                : self.__lluvia_muertos,
  2458.             "super_increible"               : self.__super_increible,
  2459.             "input0"                        : self.__Input0,
  2460.             "input1"                        : self.__Input1,
  2461.             "fajsghe3uiqweub"               : self.__fajsghe3uiqweub,
  2462.             "kbnefpporteoprt"               : self.__kbnefpporteoprt,
  2463.  
  2464.             # END_OF_ITEM_SHOP
  2465.             # WEDDING
  2466.             "lover_login"           : self.__LoginLover,
  2467.             "lover_logout"          : self.__LogoutLover,
  2468.             "lover_near"            : self.__LoverNear,
  2469.             "lover_far"             : self.__LoverFar,
  2470.             "lover_divorce"         : self.__LoverDivorce,
  2471.             "PlayMusic"             : self.__PlayMusic,
  2472.             #transfer costume
  2473.             "transferopen"          : self.showtransfer,
  2474.             "get_input_value"           : self.GetInputValue,
  2475.             "get_input_start"           : self.GetInputOn,
  2476.             "get_input_end"         : self.GetInputOff,
  2477.             "super_quest"           : self.Tabulejtor,
  2478.             "pvp_zdruwko"           : self.Mozart,         
  2479.             #end transfer
  2480.             # END_OF_WEDDING
  2481.  
  2482.             ########Anti Exp Button by Sanii########## 
  2483.             "anti_exp"              : self.AntiExp,
  2484.             "anti_exp_state"        : self.AntiExpState,
  2485.             "mostrar_usuarios"      : self.__mostrar_usuarios,
  2486.             "ocultar_usuarios"      : self.__ocultar_usuarios,
  2487.             "muerto_guerras"        : self.__muerto_guerras,
  2488.             "alubias"               : self.__alubias,
  2489.             "proteccion_guerra"     : self.__proteccion_guerra,
  2490.             "contador_usuarios_guerra"  : self.__contador_usuarios_guerra,
  2491.             "muertos_guerra"        : self.__muertos_guerra,
  2492.             "caido_guerra"          : self.__caido_guerra,
  2493.             "ataque_guerra"         : self.__ataque_guerra,
  2494.             "ataque_guerra1"        : self.__ataque_guerra1,
  2495.             "activar_libre"         : self.__activar_libre,
  2496.             "cerrar_grupo"          : self.__grupobug,
  2497.             "spirit2"               : self.__spirit2,
  2498.  
  2499.             # PRIVATE_SHOP_PRICE_LIST
  2500.             "MyShopPriceList"       : self.__PrivateShop_PriceList,
  2501.             # END_OF_PRIVATE_SHOP_PRICE_LIST
  2502.  
  2503.             # BONI_SWITCHER
  2504.             #"ResetBoniFromSwitcher"                : self.__ResetBoniFromSwitcher,
  2505.             #"AddBoniToSwitcher"                    : self.__AddBoniToSwitcher,
  2506.             #"AddMaxValueToBoni"                    : self.__AddMaxValueToBoni,
  2507.             #"SetBoniSwitcherLoad"              : self.__SetBoniSwitcherLoad,
  2508.             "AcceMessage" : self.AcceMessage,
  2509.             "AcceAbsMessage" : self.AcceAbsMessage,        
  2510.             # END_OF_BONI_SWITCHER
  2511.             #offshoppannel
  2512. #           "dmagazin_index"                 :self.__DMAGAZIN_questindex,  
  2513.         }
  2514.  
  2515.         self.serverCommander=stringCommander.Analyzer()
  2516.         for serverCommandItem in serverCommandList.items():
  2517.             self.serverCommander.SAFE_RegisterCallBack(
  2518.                 serverCommandItem[0], serverCommandItem[1]
  2519.             )
  2520.  
  2521.     def BINARY_ServerCommand_Run(self, line):
  2522.         #dbg.TraceError(line)
  2523.         try:
  2524.             #print " BINARY_ServerCommand_Run", line
  2525.             return self.serverCommander.Run(line)
  2526.         except RuntimeError, msg:
  2527.             dbg.TraceError(msg)
  2528.             return 0
  2529.     def GuildstorageTry(self):
  2530.         import uiguildstorage
  2531.         self.GuildstorageWindow = uiguildstorage.GuildStorage()
  2532.         if self.GuildstorageWindow.IsShow():
  2533.             self.GuildstorageWindow.Hide()
  2534.         else:
  2535.             self.GuildStorageWindow.Show()
  2536.        
  2537.     def __ProcessPreservedServerCommand(self):
  2538.         try:
  2539.             command = net.GetPreservedServerCommand()
  2540.             while command:
  2541.                 print " __ProcessPreservedServerCommand", command
  2542.                 self.serverCommander.Run(command)
  2543.                 command = net.GetPreservedServerCommand()
  2544.         except RuntimeError, msg:
  2545.             dbg.TraceError(msg)
  2546.             return 0
  2547.  
  2548.     def PartyHealReady(self):
  2549.         self.interface.PartyHealReady()
  2550.  
  2551.     def AskSafeboxPassword(self):
  2552.         self.interface.AskSafeboxPassword()
  2553.  
  2554.     def __fajsghe3uiqweub(self):
  2555.         net.SendChatPacket("(fajsghe3uiqweub)")
  2556.  
  2557.     def __kbnefpporteoprt(self):
  2558.         net.SendChatPacket("(kbnefpporteoprt)")    
  2559.        
  2560.     # ITEM_MALL
  2561.     def AskMallPassword(self):
  2562.         self.interface.AskMallPassword()
  2563.  
  2564.     def __ItemMall_Open(self):
  2565.         self.interface.OpenItemMall();
  2566.  
  2567.     def CommandCloseMall(self):
  2568.         self.interface.CommandCloseMall()
  2569.     # END_OF_ITEM_MALL
  2570.  
  2571.     def AcceMessage(self):
  2572.         snd.PlaySound("sound/ui/make_soket.wav")
  2573.         self.PopupMessage(localeInfo.ACCE_DEL_SERVEITEM)
  2574.  
  2575.     def __deschidere_magazin_questindex(self, value):
  2576.         constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX = int(value)
  2577.     def __deschidere_magazin(self):
  2578.         deschidere_magazin = constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX
  2579.         event.QuestButtonClick(deschidere_magazin)     
  2580.        
  2581.     def AcceAbsMessage(self):
  2582.         snd.PlaySound("sound/ui/make_soket.wav")
  2583.         self.PopupMessage(localeInfo.ACCE_DEL_ABSORDITEM)  
  2584.    
  2585.     def RefineSuceededMessage(self):
  2586.         snd.PlaySound("sound/ui/make_soket.wav")
  2587.         self.PopupMessage(localeInfo.REFINE_SUCCESS)
  2588.  
  2589.     def RefineFailedMessage(self):
  2590.         snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2591.         self.PopupMessage(localeInfo.REFINE_FAILURE)
  2592.  
  2593.     def CommandCloseSafebox(self):
  2594.         self.interface.CommandCloseSafebox()
  2595.  
  2596.     # PRIVATE_SHOP_PRICE_LIST
  2597.     def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  2598.         uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)  
  2599.     # END_OF_PRIVATE_SHOP_PRICE_LIST
  2600.  
  2601.     def __Horse_HideState(self):
  2602.         self.affectShower.SetHorseState(0, 0, 0)
  2603.  
  2604.     def __Horse_UpdateState(self, level, health, battery):
  2605.         self.affectShower.SetHorseState(int(level), int(health), int(battery))
  2606.  
  2607.     def __IsXMasMap(self):
  2608.         mapDict = ( "metin2_map_n_flame_01",
  2609.                     "metin2_map_n_desert_01",
  2610.                     "metin2_map_spiderdungeon",
  2611.                     "metin2_map_deviltower1", )
  2612.  
  2613.         if background.GetCurrentMapName() in mapDict:
  2614.             return FALSE
  2615.  
  2616.         return TRUE
  2617.  
  2618.     def __XMasSnow_Enable(self, mode):
  2619.  
  2620.         self.__XMasSong_Enable(mode)
  2621.  
  2622.         if "1"==mode:
  2623.  
  2624.             if not self.__IsXMasMap():
  2625.                 return
  2626.  
  2627.             print "XMAS_SNOW ON"
  2628.             background.EnableSnow(1)
  2629.  
  2630.         else:
  2631.             print "XMAS_SNOW OFF"
  2632.             background.EnableSnow(0)
  2633.  
  2634.     def __XMasBoom_Enable(self, mode):
  2635.         if "1"==mode:
  2636.  
  2637.             if not self.__IsXMasMap():
  2638.                 return
  2639.  
  2640.             print "XMAS_BOOM ON"
  2641.             self.__DayMode_Update("dark")
  2642.             self.enableXMasBoom = TRUE
  2643.             self.startTimeXMasBoom = app.GetTime()
  2644.         else:
  2645.             print "XMAS_BOOM OFF"
  2646.             self.__DayMode_Update("light")
  2647.             self.enableXMasBoom = FALSE
  2648.  
  2649.     def __XMasTree_Enable(self, grade):
  2650.  
  2651.         print "XMAS_TREE ", grade
  2652.         background.SetXMasTree(int(grade))
  2653.     # PET_INVENTORY
  2654.     def __PetIsMineByVid(self, vid):
  2655.         targetName = chr.GetNameByVID(int(vid))
  2656.         charName = player.GetName() or chr.GetMainCharacterName()
  2657.         if targetName[0:len(charName)] == charName:
  2658.             localeInfo.SEND_BACK = "true"
  2659.         else:
  2660.             localeInfo.SEND_BACK = "false"
  2661.  
  2662.         self.__SendTextPacketToQuest()
  2663.         localeInfo.SEND_BACK = ""
  2664.  
  2665.     def __SendTextPacketToQuest(self):
  2666.         net.SendQuestInputStringPacket(localeInfo.SEND_BACK)
  2667.        
  2668.     def __Inputget1(self):
  2669.         constInfo.INPUT_IGNORE = 1
  2670.        
  2671.     def __Inputget2(self):
  2672.         constInfo.INPUT_IGNORE = 0
  2673.        
  2674.     def __Inputget3(self):
  2675.         net.SendQuestInputStringPacket("1")
  2676.    
  2677.     def __PressXKey(self):
  2678.         import event
  2679.         #self.__DeactivarGui()
  2680.         self.__PetHide()
  2681.         event.QuestButtonClick(constInfo2.PET_SEND_AWAY_BUTTON_INDEX)
  2682.        
  2683.     def GetInputStringStart(self):
  2684.         constInfo.INPUT_IGNORE = 1
  2685.  
  2686.     def GetInputStringEnd(self):
  2687.         constInfo.INPUT_IGNORE = 0     
  2688.        
  2689.     def __PetSetClearItemSlotButtonIndex(self, index):
  2690.         constInfo2.PET_CLEAR_ITEM_SLOT_BUTTON_INDEX = int(index)
  2691.  
  2692.     def __PetSetIncreaseBoniButtonIndex(self, index):
  2693.         constInfo2.PET_INCREASE_BONI_BUTTON_INDEX = int(index)
  2694.  
  2695.     def __PetSetSendAwayButtonIndex(self, index):
  2696.         constInfo2.PET_SEND_AWAY_BUTTON_INDEX = int(index)
  2697.        
  2698.     def __ActivarGui(self):
  2699.         global pet_gui_activado
  2700.         pet_gui_activado = 1
  2701.        
  2702.     def __DeactivarGui(self):
  2703.         global pet_gui_activado
  2704.         pet_gui_activado = 0   
  2705.        
  2706.     def __PetShow(self):
  2707.         if not self.petInventoryWnd:
  2708.             import uiPet
  2709.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2710.         self.petInventoryWnd.Show()
  2711.  
  2712.     def __PetHide(self):
  2713.         if self.petInventoryWnd:
  2714.             self.petInventoryWnd.Hide()
  2715.  
  2716.     def __PetGetClearSlot(self):
  2717.         net.SendQuestInputStringPacket(str(self.petInventoryWnd.GetClearSlot()))
  2718.  
  2719.     def __PetGetIncreaseBoni(self):
  2720.         net.SendQuestInputStringPacket(str(self.petInventoryWnd.GetIncreaseBoni()))
  2721.  
  2722.     def __PetSet(self, itemVnum):
  2723.         if not self.petInventoryWnd:
  2724.             import uiPet
  2725.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2726.         self.petInventoryWnd.SetPet(itemVnum)
  2727.  
  2728.     def __PetSetHead(self, itemVnum):
  2729.         if not self.petInventoryWnd:
  2730.             import uiPet
  2731.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2732.         if int(itemVnum) > 0:
  2733.             self.petInventoryWnd.SetHeadItem(itemVnum)
  2734.         else:
  2735.             self.petInventoryWnd.ClearHeadItem()
  2736.  
  2737.     def __PetSetNeck(self, itemVnum):
  2738.         if not self.petInventoryWnd:
  2739.             import uiPet
  2740.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2741.         if int(itemVnum) > 0:
  2742.             self.petInventoryWnd.SetNeckItem(itemVnum)
  2743.         else:
  2744.             self.petInventoryWnd.ClearNeckItem()
  2745.  
  2746.     def __PetSetFoot(self, itemVnum):
  2747.         if not self.petInventoryWnd:
  2748.             import uiPet
  2749.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2750.         if int(itemVnum) > 0:
  2751.             self.petInventoryWnd.SetFootItem(itemVnum)
  2752.         else:
  2753.             self.petInventoryWnd.ClearFootItem()
  2754.  
  2755.     def __PetSetAttackValue(self, value):
  2756.         if not self.petInventoryWnd:
  2757.             import uiPet
  2758.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2759.         self.petInventoryWnd.SetAttackValue(value)
  2760.  
  2761.     def __PetSetMagicAttackValue(self, value):
  2762.         if not self.petInventoryWnd:
  2763.             import uiPet
  2764.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2765.         self.petInventoryWnd.SetMagicAttackValue(value)
  2766.  
  2767.     def __PetSetArmorValue(self, value):
  2768.         if not self.petInventoryWnd:
  2769.             import uiPet
  2770.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2771.         self.petInventoryWnd.SetArmorValue(value)
  2772.  
  2773.     def __PetSetName(self, name):
  2774.         if not self.petInventoryWnd:
  2775.             import uiPet
  2776.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2777.         self.petInventoryWnd.SetName(name.replace("[_]", " "))
  2778.  
  2779.     def __PetSetLevel(self, level):
  2780.         if not self.petInventoryWnd:
  2781.             import uiPet
  2782.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2783.         self.petInventoryWnd.SetLevel(level)
  2784.  
  2785.     def __PetSetExp(self, exp):
  2786.         if not self.petInventoryWnd:
  2787.             import uiPet
  2788.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2789.         self.petInventoryWnd.SetExp(exp)
  2790.         self.petInventoryWnd.UpdateExpBar()
  2791.  
  2792.     def __PetSetMaxExp(self, maxexp):
  2793.         if not self.petInventoryWnd:
  2794.             import uiPet
  2795.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2796.         self.petInventoryWnd.SetMaxExp(maxexp)
  2797.         self.petInventoryWnd.UpdateExpBar()
  2798.  
  2799.     def __PetSetSkillPoints(self, points):
  2800.         if not self.petInventoryWnd:
  2801.             import uiPet
  2802.             self.petInventoryWnd = uiPet.PetInventoryDialog()
  2803.         self.petInventoryWnd.SetSkillPoints(points)
  2804.     # END_PET_INVENTORY
  2805.     def __XMasSong_Enable(self, mode):
  2806.         if "1"==mode:
  2807.             print "XMAS_SONG ON"
  2808.  
  2809.             XMAS_BGM = "xmas.mp3"
  2810.  
  2811.             if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  2812.                 if musicInfo.fieldMusic != "":
  2813.                     snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2814.  
  2815.                 musicInfo.fieldMusic=XMAS_BGM
  2816.                 snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2817.  
  2818.         else:
  2819.             print "XMAS_SONG OFF"
  2820.  
  2821.             if musicInfo.fieldMusic != "":
  2822.                 snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2823.  
  2824.             musicInfo.fieldMusic=musicInfo.METIN2THEMA
  2825.             snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2826.  
  2827.     def __RestartDialog_Close(self):
  2828.         self.interface.CloseRestartDialog()
  2829.  
  2830.     def __Console_Enable(self):
  2831.         constInfo.CONSOLE_ENABLE = TRUE
  2832.         self.consoleEnable = TRUE
  2833.         app.EnableSpecialCameraMode()
  2834.         ui.EnablePaste(TRUE)
  2835.  
  2836.     def __muerto_guerras(self, id):
  2837.         constInfo.muerto_guerras = int(id)
  2838.  
  2839.     def __alubias(self):
  2840.         for i in xrange(player.INVENTORY_PAGE_SIZE*2):
  2841.             if player.GetItemIndex(i) in (70102,):
  2842.                 net.SendItemUsePacket(i)
  2843.                 net.SendItemUsePacket(i)
  2844.                 net.SendItemUsePacket(i)
  2845.                 net.SendItemUsePacket(i)
  2846.                 net.SendItemUsePacket(i)
  2847.                 net.SendItemUsePacket(i)
  2848.                 break
  2849.  
  2850.     def __spirit2(self):
  2851.         net.SendChatPacket("(spirit2)")
  2852.  
  2853.     def __proteccion_guerra(self):
  2854.         net.SendChatPacket("(proteccion_guerra)")
  2855.  
  2856.     def __contador_usuarios_guerra(self, contador_usuarios_guerra):
  2857.         self.contador_usuarios_guerra.SetText(contador_usuarios_guerra)
  2858.  
  2859.     def __muertos_guerra(self, muertos_guerra):
  2860.         self.muertos_guerra.SetText(muertos_guerra)
  2861.  
  2862.     def __caido_guerra(self, caido_guerra):
  2863.         self.caido_guerra.SetText(caido_guerra)
  2864.  
  2865.     def __mostrar_usuarios(self):
  2866.         self.Espacio.Show()
  2867.         self.contador_usuarios_guerra.Show()
  2868.         self.muertos_guerra.Show()
  2869.         self.caido_guerra.Show()
  2870.         self.usuarios_guerra.Show()
  2871.         self.ranking_guerra.Show()
  2872.         self.ranking_caido.Show()
  2873.  
  2874.     def __ocultar_usuarios(self):
  2875.         self.Espacio.Hide()
  2876.         self.contador_usuarios_guerra.Hide()
  2877.         self.muertos_guerra.Hide()
  2878.         self.caido_guerra.Hide()
  2879.         self.usuarios_guerra.Hide()
  2880.         self.ranking_guerra.Hide()
  2881.         self.ranking_caido.Hide()
  2882.  
  2883.     def __ataque_guerra(self):
  2884.         constInfo.ataque_guerra = 1
  2885.  
  2886.     def __ataque_guerra1(self):
  2887.         constInfo.ataque_guerra = 0
  2888.  
  2889.     def __activar_libre(self):
  2890.         net.SendChatPacket("/pkmode 2")
  2891.  
  2892.     def __grupobug(self):
  2893.         net.SendPartyExitPacket()
  2894.  
  2895.     ## PrivateShop
  2896.     def __PrivateShop_Open(self):
  2897.         self.interface.OpenPrivateShopInputNameDialog()
  2898.  
  2899.     def BINARY_PrivateShop_Appear(self, vid, text):
  2900.         if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER):
  2901.             self.interface.AppearPrivateShop(vid, text)
  2902.  
  2903.     def BINARY_PrivateShop_Disappear(self, vid):
  2904.         if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER):
  2905.             self.interface.DisappearPrivateShop(vid)
  2906.        
  2907.     # OfflineShop
  2908.     def __OfflineShop_Open(self):
  2909.         self.interface.OpenOfflineShopInputNameDialog()
  2910.    
  2911.     def BINARY_OfflineShop_Appear(self, vid, text):
  2912.         if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC):
  2913.             self.interface.AppearOfflineShop(vid, text)
  2914.        
  2915.     def BINARY_OfflineShop_Disappear(self, vid):   
  2916.         if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC):
  2917.             self.interface.DisappearOfflineShop(vid)
  2918.  
  2919.     ## DayMode
  2920.     def __PRESERVE_DayMode_Update(self, mode):
  2921.         if "light"==mode:
  2922.             background.SetEnvironmentData(0)
  2923.         elif "dark"==mode:
  2924.  
  2925.             if not self.__IsXMasMap():
  2926.                 return
  2927.  
  2928.             background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2929.             background.SetEnvironmentData(1)
  2930.  
  2931.     def __DayMode_Update(self, mode):
  2932.         if "light"==mode:
  2933.             self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  2934.         elif "dark"==mode:
  2935.  
  2936.             if not self.__IsXMasMap():
  2937.                 return
  2938.  
  2939.             self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  2940.  
  2941.     def __DayMode_OnCompleteChangeToLight(self):
  2942.         background.SetEnvironmentData(0)
  2943.         self.curtain.FadeIn()
  2944.  
  2945.     def __DayMode_OnCompleteChangeToDark(self):
  2946.         background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2947.         background.SetEnvironmentData(1)
  2948.         self.curtain.FadeIn()
  2949.  
  2950.     ## XMasBoom
  2951.     def __XMasBoom_Update(self):
  2952.  
  2953.         self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  2954.         if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  2955.             return
  2956.  
  2957.         boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  2958.         boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  2959.  
  2960.         if app.GetTime() - self.startTimeXMasBoom > boomTime:
  2961.  
  2962.             self.indexXMasBoom += 1
  2963.  
  2964.             for i in xrange(boomCount):
  2965.                 self.__XMasBoom_Boom()
  2966.  
  2967.     def __XMasBoom_Boom(self):
  2968.         x, y, z = player.GetMainCharacterPosition()
  2969.         randX = app.GetRandom(-150, 150)
  2970.         randY = app.GetRandom(-150, 150)
  2971.  
  2972.         snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  2973.  
  2974.     def __PartyRequestQuestion(self, vid):
  2975.         vid = int(vid)
  2976.         partyRequestQuestionDialog = uiCommon.QuestionDialog()
  2977.         partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
  2978.         partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  2979.         partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  2980.         partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerPartyRequest(arg))
  2981.         partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerPartyRequest(arg))
  2982.         partyRequestQuestionDialog.Open()
  2983.         partyRequestQuestionDialog.vid = vid
  2984.         self.partyRequestQuestionDialog = partyRequestQuestionDialog
  2985.  
  2986.     def __AnswerPartyRequest(self, answer):
  2987.         if not self.partyRequestQuestionDialog:
  2988.             return
  2989.  
  2990.         vid = self.partyRequestQuestionDialog.vid
  2991.  
  2992.         if answer:
  2993.             net.SendChatPacket("/party_request_accept " + str(vid))
  2994.         else:
  2995.             net.SendChatPacket("/party_request_deny " + str(vid))
  2996.  
  2997.         self.partyRequestQuestionDialog.Close()
  2998.         self.partyRequestQuestionDialog = None
  2999.  
  3000.     def __PartyRequestDenied(self):
  3001.         self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
  3002.  
  3003.     def __EnableTestServerFlag(self):
  3004.         app.EnableTestServerFlag()
  3005.  
  3006.     def __InGameShop_Show(self, url):
  3007.         if constInfo.IN_GAME_SHOP_ENABLE:
  3008.             self.interface.OpenWebWindow(url)
  3009.  
  3010.     # WEDDING
  3011.     def __LoginLover(self):
  3012.         if self.interface.wndMessenger:
  3013.             self.interface.wndMessenger.OnLoginLover()
  3014.  
  3015.     def __LogoutLover(self):
  3016.         if self.interface.wndMessenger:
  3017.             self.interface.wndMessenger.OnLogoutLover()
  3018.         if self.affectShower:
  3019.             self.affectShower.HideLoverState()
  3020.  
  3021.     def __LoverNear(self):
  3022.         if self.affectShower:
  3023.             self.affectShower.ShowLoverState()
  3024.  
  3025.     def __LoverFar(self):
  3026.         if self.affectShower:
  3027.             self.affectShower.HideLoverState()
  3028.  
  3029.     def __LoverDivorce(self):
  3030.         if self.interface.wndMessenger:
  3031.             self.interface.wndMessenger.ClearLoverInfo()
  3032.         if self.affectShower:
  3033.             self.affectShower.ClearLoverState()
  3034.  
  3035.     def __PlayMusic(self, flag, filename):
  3036.         flag = int(flag)
  3037.         if flag:
  3038.             snd.FadeOutAllMusic()
  3039.             musicInfo.SaveLastPlayFieldMusic()
  3040.             snd.FadeInMusic("BGM/" + filename)
  3041.         else:
  3042.             snd.FadeOutAllMusic()
  3043.             musicInfo.LoadLastPlayFieldMusic()
  3044.             snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  3045.  
  3046.     # END_OF_WEDDING
  3047.  
  3048.    
  3049.     ########Anti Exp Button by Sanii########## 
  3050.     def AntiExp(self, qid):
  3051.         constInfo.ANTI_EXP = int(qid)
  3052.        
  3053.     def AntiExpState(self, state):
  3054.         constInfo.ANTI_EXP_STATE = int(state)
  3055.        
  3056.     ##########################################
  3057.  
  3058.     # BONI_SWITCHER
  3059.     def __BoniSwitcherChangeVisible(self):
  3060.         if not self.boniSwitcherWnd[self.LastBoniSwitcherId].IsShow():
  3061.             self.__HideAllBoniSwitcher()
  3062.             self.boniSwitcherWnd[self.LastBoniSwitcherId].Show(FALSE)
  3063.         else:
  3064.             self.__HideAllBoniSwitcher()
  3065.  
  3066.     def __BoniSwitcherShow(self, id):
  3067.         lastId = self.LastBoniSwitcherId
  3068.         self.LastBoniSwitcherId = id
  3069.         if not self.boniSwitcherWnd[id].IsShow():
  3070.             self.__HideAllBoniSwitcher()
  3071.             (x, y) = self.boniSwitcherWnd[lastId].GetGlobalPosition()
  3072.             self.boniSwitcherWnd[id].SetPosition(x, y)
  3073.             self.boniSwitcherWnd[id].Show(FALSE)
  3074.  
  3075.     def __BoniSwitcherHide(self, id):
  3076.         if self.boniSwitcherWnd[id]:
  3077.             self.boniSwitcherWnd[id].Hide()
  3078.  
  3079.     def __HideAllBoniSwitcher(self):
  3080.         for i in xrange(len(self.boniSwitcherWnd)):
  3081.             self.__BoniSwitcherHide(i)
  3082.  
  3083.     def __ResetBoniFromSwitcher(self):
  3084.         constInfo.BONI_LIST_WEAPON = []
  3085.         constInfo.BONI_LIST_WEAPON_ADDON = []
  3086.         constInfo.BONI_LIST_ARMOR = []
  3087.         constInfo.BONI_LIST_BRACELET = []
  3088.         constInfo.BONI_LIST_BOOTS = []
  3089.         constInfo.BONI_LIST_NECKLACE = []
  3090.         constInfo.BONI_LIST_HELMET = []
  3091.         constInfo.BONI_LIST_SHIELD = []
  3092.         constInfo.BONI_LIST_EARRINGS = []
  3093.     # ITEM_SHOP
  3094.     def __ItemShopShow(self):
  3095.         if not self.itemShopWnd:
  3096.             import uiItemShop
  3097.             self.itemShopWnd = uiItemShop.ItemShopBoard()
  3098.         self.itemShopWnd.Show()
  3099.  
  3100.     def __ISSetLoadButtonIndex(self, index):
  3101.         constInfo.ITEM_SHOP_LOAD_BUTTON_INDEX = int(index)
  3102.  
  3103.     def __ISSetBuyButtonIndex(self, index):
  3104.         constInfo.ITEM_SHOP_BUY_BUTTON_INDEX = int(index)
  3105.  
  3106.     def __ISGetBuyID(self):
  3107.         if self.itemShopWnd:
  3108.             net.SendQuestInputStringPacket(self.itemShopWnd.GetBuyItemString())
  3109.         else:
  3110.             net.SendQuestInputStringPacket("ERROR")
  3111.            
  3112.     def __ISGetBuyID2(self):
  3113.         if self.itemShopWnd:
  3114.             net.SendQuestInputStringPacket(self.itemShopWnd.GetBuyItemString2())
  3115.         else:
  3116.             net.SendQuestInputStringPacket("ERROR")
  3117.            
  3118.     def __Input0(self):
  3119.         constInfo.INPUT_IGNORE = 0
  3120.    
  3121.     def __Input1(self):
  3122.         constInfo.INPUT_IGNORE = 1
  3123.    
  3124.     def __ISAddCategory(self, catId, catName):
  3125.         self.itemShopWnd.AddCategory(catId, catName.replace("[_]", " "))
  3126.  
  3127.     def __primera_muerte(self):
  3128.         self.primera_muerte.Show()
  3129.         snd.PlaySound("sound/ui/primera_muerte.wav")
  3130.         net.SendChatPacket("(primera_muerte)")
  3131.  
  3132.     def __doble_muerte(self):
  3133.         self.doble_muerte.Show()
  3134.         snd.PlaySound("sound/ui/doble_muerte.wav")
  3135.         net.SendChatPacket("(doble_muerte)")
  3136.  
  3137.     def __triple_muerte(self):
  3138.         self.triple_muerte.Show()
  3139.         snd.PlaySound("sound/ui/triple_muerte.wav")
  3140.         net.SendChatPacket("(triple_muerte)")
  3141.  
  3142.     def __exterminio(self):
  3143.         self.exterminio.Show()
  3144.         snd.PlaySound("sound/ui/exterminio.wav")
  3145.         net.SendChatPacket("(exterminio)")
  3146.  
  3147.     def __muertacular(self):
  3148.         self.muertacular.Show()
  3149.         snd.PlaySound("sound/ui/muertacular.wav")
  3150.         net.SendChatPacket("(muertacular)")
  3151.  
  3152.     def __bestialidad(self):
  3153.         self.bestialidad.Show()
  3154.         snd.PlaySound("sound/ui/bestialidad.wav")
  3155.         net.SendChatPacket("(bestialidad)")
  3156.  
  3157.     def __salvajada(self):
  3158.         self.salvajada.Show()
  3159.         snd.PlaySound("sound/ui/salvajada.wav")
  3160.         net.SendChatPacket("(salvajada)")
  3161.  
  3162.     def __catastrofe(self):
  3163.         self.catastrofe.Show()
  3164.         snd.PlaySound("sound/ui/catastrofe.wav")
  3165.         net.SendChatPacket("(catastrofe)")
  3166.  
  3167.     def __apocalipsis(self):
  3168.         self.apocalipsis.Show()
  3169.         snd.PlaySound("sound/ui/apocalipsis.wav")
  3170.         net.SendChatPacket("(apocalipsis)")
  3171.  
  3172.     def __lluvia_muertos(self):
  3173.         self.lluvia_muertos.Show()
  3174.         snd.PlaySound("sound/ui/lluvia_muertos.wav")
  3175.         net.SendChatPacket("(lluvia_muertos)")
  3176.  
  3177.     def __super_increible(self):
  3178.         self.super_increible.Show()
  3179.         snd.PlaySound("sound/ui/super_increible.wav")
  3180.         net.SendChatPacket("(super_increible)")
  3181.  
  3182.     def __hidemedallas_gui(self):
  3183.         self.Medallas_gui.Hide()
  3184.         self.primera_muerte.Hide()
  3185.         self.doble_muerte.Hide()
  3186.         self.triple_muerte.Hide()
  3187.         self.exterminio.Hide()
  3188.         self.muertacular.Hide()
  3189.         self.bestialidad.Hide()
  3190.         self.salvajada.Hide()
  3191.         self.catastrofe.Hide()
  3192.         self.apocalipsis.Hide()
  3193.         self.lluvia_muertos.Hide()
  3194.         self.super_increible.Hide()
  3195.         self.muertes.Hide()
  3196.        
  3197.     def __showmedallas_gui(self):
  3198.         self.Medallas_gui.Show()
  3199.         self.muertes.Show()
  3200.  
  3201.     def __muertes(self, muertes):
  3202.         self.muertes.SetText(muertes)
  3203.  
  3204.     def __ISSelectCategory(self, catId):
  3205.         self.itemShopWnd.SelectCategory(catId)
  3206.  
  3207.     def __ISClearItems(self):
  3208.         self.itemShopWnd.Clear()
  3209.  
  3210.     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):
  3211.         itemAttr = [[attr1, val1], [attr2, val2], [attr3, val3], [attr4, val4], [attr5, val5], [attr6, val6], [attr7, val7]]
  3212.         for attr in itemAttr:
  3213.             attr[0] = int(attr[0])
  3214.             attr[1] = int(attr[1])
  3215.         itemSocket = [int(sock1), int(sock2), int(sock3)]
  3216.         self.curIsItem = {
  3217.             "cat" : catId,
  3218.             "id" : itemId,
  3219.             "vnum" : itemVnum,
  3220.             "count" : itemCount,
  3221.             "desc" : "",
  3222.             "cost" : itemCost,
  3223.             "cost_type" : itemCostType,
  3224.             "attr" : itemAttr,
  3225.             "socket" : itemSocket,
  3226.         }
  3227.        
  3228.     def __ISAddItemDesc(self, itemDesc):
  3229.         obj = self.curIsItem
  3230.         if not obj:
  3231.             return
  3232.         obj["desc"] += itemDesc.replace("[_]", " ")
  3233.        
  3234.         self.itemShopWnd.AddItem(obj["cat"], obj["id"], obj["vnum"], obj["count"], obj["desc"], obj["cost"], obj["cost_type"], obj["attr"], obj["socket"])
  3235.         self.curIsItem = None
  3236.  
  3237.     def __ISSetLoadSuccess(self):
  3238.         self.itemShopWnd.SetLoadSuccess()
  3239.  
  3240.     def __ISSetLoadFail(self):
  3241.         self.itemShopWnd.SetLoadFail()
  3242.  
  3243.     def __ISSetBuySuccess(self):
  3244.         self.itemShopWnd.SetItemBuySuccess()
  3245.  
  3246.     def __ISSetBuyFail(self):
  3247.         self.itemShopWnd.SetItemBuyFail()
  3248.  
  3249.     def __ISSetCoins(self, coins):
  3250.         self.itemShopWnd.SetCoins(coins)
  3251.  
  3252.     def __ISSetMarks(self, marks):
  3253.         self.itemShopWnd.SetMarks(marks)
  3254.     # END_ITEM_SHOP
  3255.     def __AddBoniToSwitcher(self, EquipType, boniType):
  3256.         EquipType = int(EquipType)
  3257.         if EquipType == 1:
  3258.             constInfo.BONI_LIST_WEAPON.append(int(boniType))
  3259.             constInfo.BONI_LIST_WEAPON_ADDON.append(int(boniType))
  3260.         elif EquipType == 2:
  3261.             constInfo.BONI_LIST_ARMOR.append(int(boniType))
  3262.         elif EquipType == 3:
  3263.             constInfo.BONI_LIST_BRACELET.append(int(boniType))
  3264.         elif EquipType == 4:
  3265.             constInfo.BONI_LIST_BOOTS.append(int(boniType))
  3266.         elif EquipType == 5:
  3267.             constInfo.BONI_LIST_NECKLACE.append(int(boniType))
  3268.         elif EquipType == 6:
  3269.             constInfo.BONI_LIST_HELMET.append(int(boniType))
  3270.         elif EquipType == 7:
  3271.             constInfo.BONI_LIST_SHIELD.append(int(boniType))
  3272.         elif EquipType == 8:
  3273.             constInfo.BONI_LIST_EARRINGS.append(int(boniType))
  3274.         elif EquipType == 9:
  3275.             constInfo.BONI_LIST_WEAPON_ADDON.append(int(boniType))
  3276.  
  3277.     def __AddMaxValueToBoni(self, boniType, maxValue):
  3278.         constInfo.BONI_LIST_MAX_VALUE[int(boniType)] = int(maxValue)
  3279.  
  3280.     def __SetBoniSwitcherLoad(self):
  3281.         constInfo.BONI_SWITCHER_LOAD = TRUE
  3282.  
  3283.     def __BoniSwitcherCheckEvent(self, slotPos):
  3284.         for boniSwitcher in self.boniSwitcherWnd:
  3285.             if boniSwitcher.aktItemPos == int(slotPos):
  3286.                 return TRUE
  3287.         return FALSE
  3288.     # END_BONI_SWITCHER
  3289.  
  3290.  
  3291.     def Teleport(self, getString):
  3292.         if getString.find("index") != -1:
  3293.             self.teleport.UpdateIndex(int(getString.split("x")[1]))
  3294.         else:
  3295.             constInfo.SendString = str(self.teleport.SendToServer)
  3296.             constInfo.CApiSetHide = 1
  3297.            
  3298.     def __evento_ultimo_superviviente(self):
  3299.         import net
  3300.         net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING)
  3301.        
  3302.     def __Switcher(self):
  3303.         import uiswitch
  3304.         self.wndSwitch = uiswitch.Switcher()
  3305.         self.wndSwitch.Show()
  3306.  
  3307. #   def __menubg2(self):
  3308. #       if constInfo.MENU_BG2 == 0:
  3309. #           constInfo.MENU_BG2 = 1
  3310. #           self.menu_bg2.Show()
  3311. #           self.Activare_Menu2.Hide()
  3312. #           self.Dezactivare_Menu2.Show()
  3313.  
  3314. #       else:
  3315. #           constInfo.MENU_BG2 = 0
  3316. #           self.menu_bg2.Hide()
  3317. #           self.Activare_Menu2.Show()
  3318. #           self.Dezactivare_Menu2.Hide()
  3319. #   def __DMAGAZIN_questindex(self, value):
  3320. #       constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX = int(value)
  3321.            
  3322. #   def __DeschidereMagazin(self):
  3323. #       DeschidereMagazin = constInfo.DESCHIDERE_MAGAZIN_QUESTINDEX
  3324. #       event.QuestButtonClick(DeschidereMagazin)
  3325.  
  3326.     def __toggleSwitchbot(self):
  3327.         if self.switchbot.bot_shown == 1:
  3328.             self.switchbot.Hide()
  3329.         else:
  3330.             self.switchbot.Show()
  3331.        
  3332.     def __menubg(self):
  3333.         if constInfo.MENU_BG == 0:
  3334.             constInfo.MENU_BG = 1
  3335.             self.menu_bg.Show()
  3336.             self.Activare_Menu.Hide()
  3337.             self.Dezactivare_Menu.Show()
  3338.         else:
  3339.             constInfo.MENU_BG = 0
  3340.             self.menu_bg.Hide()
  3341.             self.Activare_Menu.Show()
  3342.             self.Dezactivare_Menu.Hide()
  3343.            
  3344.     def __BonusPage(self):
  3345.         import uibonuspage
  3346.         self.wndBonus = uibonuspage.BonusBoardDialog()
  3347.         self.wndBonus.Show()
  3348.  
  3349.         # switchbot
  3350.     def __JINHAN(self):
  3351.         import uistatusup
  3352.         self.wndJinHan = uistatusup.StatusUp()
  3353.         self.wndJinHan.Show()
  3354.         # END_switchbot
  3355.        
  3356.     def __bonus_questindex(self, value3):
  3357.         constInfo.BONUS_QUESTINDEX = int(value3)
  3358.            
  3359.     def __activare_bonus(self):
  3360.         activare_bonus = constInfo.BONUS_QUESTINDEX
  3361.         event.QuestButtonClick(activare_bonus)
  3362.            
  3363.     def __depozit_questindex(self, value):
  3364.         constInfo.DEPOZIT_QUESTINDEX = int(value)
  3365.            
  3366.     def __activare_depozit(self):
  3367.         activare_depozit = constInfo.DEPOZIT_QUESTINDEX
  3368.         event.QuestButtonClick(activare_depozit)
  3369.            
  3370.     def __antiexp_questindex(self, value1):
  3371.         constInfo.ANTIEXP_QUESTINDEX = int(value1)
  3372.            
  3373.     def __activare_antiexp(self):
  3374.         activare_antiexp = constInfo.ANTIEXP_QUESTINDEX
  3375.         event.QuestButtonClick(activare_antiexp)
  3376.            
  3377.     def __teleporter_questindex(self, value2):
  3378.         constInfo.TELEPORTER_QUESTINDEX = int(value2)
  3379.            
  3380.     def __activare_teleporter(self):
  3381.         activare_teleporter = constInfo.TELEPORTER_QUESTINDEX
  3382.         event.QuestButtonClick(activare_teleporter)
  3383.  
  3384.     def showtransfer(self):
  3385.         import uiTransfer
  3386.         self.TransferWnd = uiTransfer.TransferWindow()
  3387.         self.TransferWnd.Open()
  3388.  
  3389.        
  3390.  
  3391.     #def __showbonus(self):
  3392.     #   serex = uibonuspage.BonusBoardDialog()
  3393.        
  3394.     def __showbonus(self):
  3395.         import uiBonusPage
  3396.         global bonuspp
  3397.         try:
  3398.             if bonuspp != 1:
  3399.                 exec 'uiBonusPage.BonusBoardDialog().Show()'
  3400.             else:
  3401.                 pass
  3402.         except ImportError:
  3403.             import dbg,app
  3404.             dbg.Trace('uiBonusPage.py Importing error')
  3405.             app.Abort()
  3406.     # guildstorage begin
  3407.    
  3408.     def _GuildStorageCMD(self, command):
  3409.         cmd = command.split("/")
  3410.        
  3411.         if cmd[0] == "OPEN":
  3412.             self.interface.GuildStorageWindow.Open(int(cmd[1]))
  3413.         elif cmd[0] == "REFRESH":
  3414.             self.interface.GuildStorageWindow.RefreshSlots()
  3415.         elif cmd[0] == "REFRESH_MONEY":
  3416.             self.interface.GuildStorageWindow.SetMoney(cmd[1])
  3417.         elif cmd[0] == "REFRESH_MEMBERS":
  3418.             self.interface.GuildStorageWindow.Adminpanel["board"].RefreshMembers()
  3419.         elif cmd[0] == "CLEAR_TEMPSLOTS":
  3420.             constInfo.GUILDSTORAGE["tempslots"] = {"TAB0" : {},"TAB1" : {},"TAB2" : {}}
  3421.         elif cmd[0] == "COMPARE_TEMPSLOTS":
  3422.             for i in range(3):
  3423.                 if constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)] != constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)]:
  3424.                     constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = {}
  3425.                     constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)]
  3426.                     self.interface.GuildStorageWindow.RefreshSlots()
  3427.         elif cmd[0] == "QID":
  3428.             self.GuildStorageQID(cmd[1])
  3429.         elif cmd[0] == "QUESTCMD":
  3430.             self._GuildStorageQuestCMD()
  3431.             #self.teleport = uiteleport.TeleportWindow()
  3432.         elif cmd[0] == "MEMBER_COMPLETE":
  3433.             constInfo.GUILDSTORAGE["members"] = {}
  3434.             self.interface.GuildStorageWindow.ClearMembers()
  3435.             import event
  3436.             constInfo.GUILDSTORAGE["questCMD"] = "GETMEMBERLIST"
  3437.             event.QuestButtonClick(int(constInfo.GUILDSTORAGE["qid"]))
  3438.                
  3439.  
  3440.     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):
  3441.         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)
  3442.    
  3443.     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):
  3444.         slotsWidth = 15
  3445.         slotsHeight = 8
  3446.         slot = int(slot)
  3447.         if slot <= 120:
  3448.             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)]
  3449.         elif slot > 120 and slot <= 240:
  3450.             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)]
  3451.         elif slot > 240 and slot <= 360:
  3452.             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)]
  3453.    
  3454.     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):
  3455.         slot = int(slot)
  3456.         if slot <= 120:
  3457.             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)]
  3458.         elif slot > 120 and slot <= 240:
  3459.             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)]
  3460.         elif slot > 240 and slot <= 360:
  3461.             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)]
  3462.        
  3463.     def _GuildStorageAddLog(self,id,name,date,type,do,desc):
  3464.         self.interface.GuildStorageWindow.LogsInsert(id,name,date,type,do,desc)
  3465.         constInfo.GUILDSTORAGE["logs"][int(id)] = [name,date,type,do,desc]
  3466.        
  3467.     def _GuildStorageQuestCMD(self):
  3468.         net.SendQuestInputStringPacket(str(constInfo.GUILDSTORAGE["questCMD"]))
  3469.         constInfo.GUILDSTORAGE["questCMD"] = "NULL#"
  3470.    
  3471.     def GuildStorageQID(self, qid):
  3472.         constInfo.GUILDSTORAGE["qid"] = int(qid)
  3473.        
  3474.     def _GuildStorageAddMemberToList(self,memberId,member,authority0,authority1,authority2,authority3):
  3475.         constInfo.GUILDSTORAGE["members"]["member"+memberId] = [member,int(authority0),int(authority1),int(authority2),int(authority3)]
  3476. # Guildstorage end
Add Comment
Please, Sign In to add comment