import PYTHON_DYNAMIC_MODULE_2019 as pythonApi app = __import__(pythonApi.GetModuleName("app")) chr = __import__(pythonApi.GetModuleName("chr")) chrmgr = __import__(pythonApi.GetModuleName("chrmgr")) player = __import__(pythonApi.GetModuleName("player")) net = __import__(pythonApi.GetModuleName("net")) pack = __import__(pythonApi.GetModuleName("pack")) background = __import__(pythonApi.GetModuleName("background")) chat = __import__(pythonApi.GetModuleName("chat")) textTail = __import__(pythonApi.GetModuleName("textTail")) event = __import__(pythonApi.GetModuleName("event")) effect = __import__(pythonApi.GetModuleName("effect")) systemSetting = __import__(pythonApi.GetModuleName("systemSetting")) quest = __import__(pythonApi.GetModuleName("quest")) guild = __import__(pythonApi.GetModuleName("guild")) skill = __import__(pythonApi.GetModuleName("skill")) messenger = __import__(pythonApi.GetModuleName("messenger")) exchange = __import__(pythonApi.GetModuleName("exchange")) ime = __import__(pythonApi.GetModuleName("ime")) item = __import__(pythonApi.GetModuleName("item")) import uiDungeonInfo import os import dbg import uiaverage_price import locale import datetime import grp import uipetsystem import snd import uicooltime import uicalendarsystem import uimaintenanceinfo import wndMgr import fly import ceviri import hydracooltime import mashroomcooltime import midgardcooltime import constInfo import ui import uiCommon import uiPhaseCurtain import uiMapNameShower import uiAffectShower import uiPlayerGauge import uiCharacter import uiTarget import uiTaskbar import uiPrivateShopBuilder import ui12zi import time import serverInfo import mouseModule import consoleModule import localeInfo import playerSettingModule import interfaceModule #import uibiowindow import uiblood_dungeon import uistone_event import musicInfo import debugInfo import stringCommander from _weakref import proxy SCREENSHOT_CWDSAVE = FALSE SCREENSHOT_DIR = None svsidedia = None svsidedi_cp = "" from svsideoi import SvsideDialog import binascii import uiGuild import uiruhtasi import uisageruhtasi import uibkoku import uibosstracking import uibiyolog if app.ENABLE_HEALTH_BOARD_SYSTEM: import uiNewPlayerGauge import uiWhisperAdmin if app.ENABLE_ADMIN_BAN_MANAGER: import uiadmintool if localeInfo.IsEUROPE(): SCREENSHOT_CWDSAVE = TRUE if localeInfo.IsCIBN10(): SCREENSHOT_CWDSAVE = FALSE SCREENSHOT_DIR = "YT2W" import uiachievement import ogs_takvim cameraDistance = 1550.0 cameraPitch = 27.0 cameraRotation = 0.0 cameraHeight = 100.0 testAlignment = 0 import uisupportshaman import uiautohunt if app.ENABLE_AURA_SYSTEM: import uiAuraSystem if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: import uikeyboardsettings class GameWindow(ui.ScriptWindow): MailBoxOpenT = 0 TestTimerBlanka = 0 TestSayacBlanka = 0 AutoHuntRebornT = 0 def __init__(self, stream): ui.ScriptWindow.__init__(self, "GAME") self.SetWindowName("game") net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self) player.SetGameWindow(self) self.uiNewShopCreate = None self.uiNewShop = None global svsidedia if svsidedia == None: svsidedia = SvsideDialog() svsidedia.Board.Hide() self.wndPopupDialog = None self.wndPopupDialog2 = None self.quickSlotPageIndex = 0 self.lastPKModeSendedTime = 0 self.pressNumber = None self.newquickSlotPageIndex = 0 self.guildWarQuestionDialog = None self.interface = None self.targetBoard = None self.console = None self.mapNameShower = None self.affectShower = None self.playerGauge = None self.uiGuiEventPage = None self.biyoekran = None self.generalInfo = None self.generalInfo2 = None self.Problem_Report = None self.Problem_Report_Wnd = None self.endTime = 0 self.achievement = None if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: self.dlgKeyboardSettings = None self.stream=stream self.interface = interfaceModule.Interface() self.interface.SetStream(self.stream) self.interface.MakeInterface() self.interface.ShowDefaultWindows() self.stream.isAutoSelect = 0 self.curtain = uiPhaseCurtain.PhaseCurtain() self.curtain.speed = 0.03 self.curtain.Hide() self.targetBoard = uiTarget.TargetBoard() self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog)) self.targetBoard.Hide() self.petmain = uipetsystem.PetSystemMain() self.petmini = uipetsystem.PetSystemMini() self.console = consoleModule.ConsoleWindow() self.console.BindGameClass(self) self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200) self.console.Hide() self.support_shaman = uisupportshaman.SupportShamanDialog() self.achievement = uiachievement.AchievementDialog() if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: self.dlgKeyboardSettings = uikeyboardsettings.KeyChangeWindow(self) self.interface.dlgSystem.BindKeyboardWindow(self.dlgKeyboardSettings) self.mapNameShower = uiMapNameShower.MapNameShower() self.affectShower = uiAffectShower.AffectShower() self.autohunt = uiautohunt.AutoHunt() self.autohunt.Hide() self.ruhtasi = uiruhtasi.RuhTasi() self.ruhtasi.Hide() self.sageruhtasi = uisageruhtasi.SageRuhTasi() self.sageruhtasi.Hide() self.average_price = uiaverage_price.AveragePrice() self.average_price.Hide() self.bkoku = uibkoku.BKOku() self.bkoku.Hide() self.bosstracking = uibosstracking.BossTrackingInfoWindow() self.bosstracking.Hide() self.cooltimenew = uicooltime.CoolTimeNew() self.cooltimenew.Hide() self.wndShipImageCoolTime = hydracooltime.ImageCoolTimeTest() self.wndShipImageCoolTime.Close() self.wndMashroomImageCoolTime = mashroomcooltime.ImageCoolTimeTest() self.wndMashroomImageCoolTime.Close() self.wndMidgardImageCoolTime = midgardcooltime.ImageCoolTimeTest() self.wndMidgardImageCoolTime.Close() self.maintenanceinfo = uimaintenanceinfo.InformationWindow() self.maintenanceinfo.Hide() self.biyoekran = uibiyolog.BiyologEkran() self.biyoekran.Hide() self.blood_dungeon = uiblood_dungeon.BloodDungeonSystemWindow() self.blood_dungeon.Hide() self.stone_event = uistone_event.StoneEventWindow() self.stone_event.Hide() self.ui12zi = ui12zi.BeadWindow() self.ui12zi.Hide() self.playerGauge = uiPlayerGauge.PlayerGauge(self) self.playerGauge.Hide() # self.biowindow = uibiowindow.BiologWnd() # self.biowindow.Hide() self.whisperAdmin = uiWhisperAdmin.AdminWhisperManager() self.whisperAdmin.Close() if app.ENABLE_HEALTH_BOARD_SYSTEM: self.newPlayerGauge = uiNewPlayerGauge.NewPlayerGauge(self) self.newPlayerGauge.Hide() if app.ENABLE_ADMIN_BAN_MANAGER: self.wndAdminTool = uiadmintool.AdminTool() #wj 2014.1.2. ESCÅ°¸¦ ´©¸¦ ½Ã ¿ì¼±ÀûÀ¸·Î DropQuestionDialog¸¦ ²ôµµ·Ï ¸¸µé¾ú´Ù. ÇÏÁö¸¸ óÀ½¿¡ itemDropQuestionDialog°¡ ¼±¾ðµÇ¾î ÀÖÁö ¾Ê¾Æ ERROR°¡ ¹ß»ýÇÏ¿© init¿¡¼­ ¼±¾ð°ú µ¿½Ã¿¡ ÃʱâÈ­ ½ÃÅ´. self.itemDropQuestionDialog = None self.SetQuickSlotMode() self.__ServerCommand_Build() self.__ProcessPreservedServerCommand() self.timeLine = None self.timeLine = ui.TextLine() self.timeLine.SetFontName(localeInfo.UI_DEF_FONT) self.timeLine.SetPosition((wndMgr.GetScreenWidth() - 130) / 2, 154+13) self.fpsLine = None self.fpsLine = ui.TextLine() self.fpsLine.SetFontColor(1.0,1.0,1.0) self.fpsLine.SetPosition((wndMgr.GetScreenWidth() - 130) / 2, 195) self.pingLine = None self.pingLine = ui.TextLine() self.pingLine.SetFontName(localeInfo.UI_DEF_FONT_LARGE) self.pingLine.SetFontColor(1.0,1.0,1.0) #self.pingLine.SetPosition((wndMgr.GetScreenWidth() - 325) / 2, 10) self.pingLine.SetPosition((wndMgr.GetScreenWidth() - 130) / 2, 207) constInfo.INTERFACE_MODULE = self.interface event.SetGameWindow(self) def __del__(self): player.SetGameWindow(0) net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self) ui.ScriptWindow.__del__(self) event.SetGameWindow(None) def TestServerModeOn(self): pass # if constInfo.BETA_SERVER_TEXT_MODE == 1: # self.generalInfo = ui.TextLine() # self.generalInfo.SetFontName("Arial:17") # self.generalInfo.SetPosition(0,87) # self.generalInfo.SetWindowHorizontalAlignCenter() # self.generalInfo.SetText("Serverimiz hen? test aþamas?dad?") # self.generalInfo.SetHorizontalAlignCenter() # self.generalInfo.SetFeather() # self.generalInfo.SetOutline() # self.generalInfo.Show() # self.generalInfo2 = ui.TextLine() # self.generalInfo2.SetFontName("Arial:17") # self.generalInfo2.SetPosition(0,102) # self.generalInfo2.SetWindowHorizontalAlignCenter() # self.generalInfo2.SetText("G?d??? sorun ve buglar?adminlere bildiriniz.") # self.generalInfo2.SetHorizontalAlignCenter() # self.generalInfo2.SetFeather() # self.generalInfo2.SetOutline() # self.generalInfo2.Show() # self.comXp = Component() # self.Problem_Report = ui.Button() # self.Problem_Report.SetPosition(0,125) # self.Problem_Report.SetUpVisual('d:/ymir work/ui/public/XLarge_Button_01.sub') # self.Problem_Report.SetOverVisual('d:/ymir work/ui/public/XLarge_Button_02.sub') # self.Problem_Report.SetDownVisual('d:/ymir work/ui/public/XLarge_Button_03.sub') # self.Problem_Report.SetText("Sorun Bildir.") # self.Problem_Report.SetEvent(ui.__mem_func__(self.Problem_Report_Client)) # self.Problem_Report.SetWindowHorizontalAlignCenter() # #self.Problem_Report.SetFeather() # #self.Problem_Report.SetOutline() # self.Problem_Report.Show() def Open(self): app.SetFrameSkip(1) #self.TestServerModeOn() self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) self.newquickSlotPageIndex = 0 import uiNewShop self.uiNewShop = uiNewShop.ShopDialog() self.uiNewShop.Close() self.uiNewShopCreate = uiNewShop.ShopDialogCreate() self.uiNewShopCreate.Hide() self.quickSlotPageIndex = 0 self.PickingCharacterIndex = -1 self.PickingItemIndex = -1 self.consoleEnable = FALSE self.isShowDebugInfo = FALSE self.ShowNameFlag = FALSE self.enableXMasBoom = FALSE self.startTimeXMasBoom = 0.0 self.indexXMasBoom = 0 global cameraDistance, cameraPitch, cameraRotation, cameraHeight app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight) constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE() constInfo.SET_DEFAULT_CHRNAME_COLOR() constInfo.SET_DEFAULT_FOG_LEVEL() constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE() constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS() constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE() # TWO_HANDED_WEAPON_ATTACK_SPEED_UP constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE() # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP event.SetLeftTimeString(localeInfo.UI_LEFT_TIME) textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE) if constInfo.PVPMODE_TEST_ENABLE: self.testPKMode = ui.TextLine() self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT) self.testPKMode.SetPosition(0, 15) self.testPKMode.SetWindowHorizontalAlignCenter() self.testPKMode.SetHorizontalAlignCenter() self.testPKMode.SetFeather() self.testPKMode.SetOutline() self.testPKMode.Show() self.testAlignment = ui.TextLine() self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT) self.testAlignment.SetPosition(0, 35) self.testAlignment.SetWindowHorizontalAlignCenter() self.testAlignment.SetHorizontalAlignCenter() self.testAlignment.SetFeather() self.testAlignment.SetOutline() self.testAlignment.Show() self.__BuildKeyDict() if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: self.dlgKeyboardSettings.BuildKeyDict() self.__BuildDebugInfo() # PRIVATE_SHOP_PRICE_LIST uiPrivateShopBuilder.Clear() # END_OF_PRIVATE_SHOP_PRICE_LIST # UNKNOWN_UPDATE exchange.InitTrading() # END_OF_UNKNOWN_UPDATE ## Sound snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume()) snd.SetSoundVolume(systemSetting.GetSoundVolume()) netFieldMusicFileName = net.GetFieldMusicFileName() if netFieldMusicFileName: snd.FadeInMusic("BGM/" + netFieldMusicFileName) elif musicInfo.fieldMusic != "": snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) self.SetQuickSlotMode() self.SetNewQuickSlotMode() self.SelectQuickPage(self.quickSlotPageIndex) self.SetFocus() self.Show() app.ShowCursor() net.SendEnterGamePacket() # START_GAME_ERROR_EXIT try: self.StartGame() except: import exception exception.Abort("GameWindow.Open") # END_OF_START_GAME_ERROR_EXIT # NPC°¡ Å¥ºê½Ã½ºÅÛÀ¸·Î ¸¸µé ¼ö ÀÖ´Â ¾ÆÀÌÅÛµéÀÇ ¸ñ·ÏÀ» ij½Ì # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ] self.cubeInformation = {} self.currentCubeNPC = 0 if app.ENABLE_FOG_FIX: if systemSetting.IsFogMode(): background.SetEnvironmentFog(True) else: background.SetEnvironmentFog(False) if systemSetting.GetNightMode(): systemSetting.SetNightMode(True) background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) background.SetEnvironmentData(1) else: systemSetting.SetNightMode(False) background.SetEnvironmentData(0) if systemSetting.IsSnowTexturesMode(): if background.GetCurrentMapName(): snow_maps = [ "metin2_map_a1", "metin2_map_b1", "metin2_map_c1" ] snow_maps_textures = { "metin2_map_a1" : "textureset\metin2_a1_snow.txt", "metin2_map_b1" : "textureset\metin2_b1_snow.txt", "metin2_map_c1" : "textureset\metin2_c1_snow.txt", } if str(background.GetCurrentMapName()) in snow_maps: background.TextureChange(snow_maps_textures[str(background.GetCurrentMapName())]) if systemSetting.IsDesertTexturesMode(): if background.GetCurrentMapName(): snow_maps = [ "metin2_map_a1", "metin2_map_b1", "metin2_map_c1" ] snow_maps_textures = { "metin2_map_a1" : "textureset\metin2_a1_desert.txt", "metin2_map_b1" : "textureset\metin2_b1_desert.txt", "metin2_map_c1" : "textureset\metin2_c1_desert.txt", } if str(background.GetCurrentMapName()) in snow_maps: background.TextureChange(snow_maps_textures[str(background.GetCurrentMapName())]) # if os.path.exists(str('BGM/pettopla.cfg')) and len(constInfo.PET_TOPLANANLAR) != 0: # ac = open(str('BGM/pettopla.cfg'), 'r') # oku = ac.readlines() # if len(oku)>0: # for i in xrange(len(oku)): # parcala = oku[i][:-1].split("\t") # constInfo.PET_TOPLANANLAR.append(int(parcala[0])) def Close(self): self.Hide() self.wndShipImageCoolTime.Close() self.wndMashroomImageCoolTime.Close() self.wndMidgardImageCoolTime.Close() global cameraDistance, cameraPitch, cameraRotation, cameraHeight (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera() if musicInfo.fieldMusic != "": snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic) self.onPressKeyDict = None self.onClickKeyDict = None self.uiNewShop.Hide() self.uiNewShopCreate.Hide() uiPrivateShopBuilder.Clear() uiPrivateShopBuilder.ClearBoardDict() chat.Close() snd.StopAllSound() grp.InitScreenEffect() chr.Destroy() textTail.Clear() quest.Clear() background.Destroy() guild.Destroy() messenger.Destroy() skill.ClearSkillData() wndMgr.Unlock() mouseModule.mouseController.DeattachObject() if self.guildWarQuestionDialog: self.guildWarQuestionDialog.Close() self.guildNameBoard = None self.partyRequestQuestionDialog = None self.warPlayerCheckQuestionDialog = None self.partyInviteQuestionDialog = None self.guildInviteQuestionDialog = None self.guildWarQuestionDialog = None self.messengerAddFriendQuestion = None # UNKNOWN_UPDATE self.itemDropQuestionDialog = None # END_OF_UNKNOWN_UPDATE # QUEST_CONFIRM self.confirmDialog = None # END_OF_QUEST_CONFIRM self.PrintCoord = None self.FrameRate = None self.Pitch = None self.Splat = None self.TextureNum = None self.ObjectNum = None self.ViewDistance = None self.PrintMousePos = None self.ClearDictionary() self.support_shaman.Close() self.petmain.Close() self.petmini.Close() self.generalInfo = None self.generalInfo2 = None self.Problem_Report = None self.Problem_Report_Wnd = None self.playerGauge = None if self.whisperAdmin: self.whisperAdmin.Close() self.whisperAdmin = None if app.ENABLE_HEALTH_BOARD_SYSTEM: self.newPlayerGauge = None self.achievement = None self.mapNameShower = None self.affectShower = None #uiPrivateShopBuilder.Clear() if self.console: self.console.BindGameClass(0) self.console.Close() self.console=None # if self.biowindow: # self.biowindow.Destroy() # self.biowindow = None if self.targetBoard: self.targetBoard.Destroy() self.targetBoard = None if self.ruhtasi: self.ruhtasi.Destroy() self.ruhtasi = None if self.sageruhtasi: self.sageruhtasi.Destroy() self.sageruhtasi = None if self.average_price: self.average_price.Destroy() self.average_price = None if self.autohunt: self.autohunt.Destroy() self.autohunt = None if self.bkoku: self.bkoku.Destroy() self.bkoku = None if self.bosstracking: self.bosstracking.Destroy() self.bosstracking = None if self.cooltimenew: self.cooltimenew.Destroy() self.cooltimenew = None if self.maintenanceinfo: self.maintenanceinfo.Destroy() self.maintenanceinfo = None if self.blood_dungeon: self.blood_dungeon.Destroy() self.blood_dungeon = None if self.stone_event: self.stone_event.Destroy() self.stone_event = None if self.ui12zi: self.ui12zi.Destroy() self.ui12zi = None # if self.biowindow: # self.biowindow.Destroy() # self.biowindow = None # if self.biyoekran: # self.biyoekran.Destroy() # self.biyoekran = None if self.interface: self.interface.HideAllWindows() self.interface.Close() self.interface=None if constInfo.FPSMode == 0: self.fpsLine.Hide() self.pingLine.Hide() #self.pingLine = None self.fpsLine = None self.timeLine = None player.ClearSkillDict() player.ResetCameraRotation() self.KillFocus() app.HideCursor() print "---------------------------------------------------------------------------- CLOSE GAME WINDOW" def IsBloodDungeonSystemWindow(self): if str(background.GetCurrentMapName()) == "metin2_map_t1" and not self.blood_dungeon.IsShow(): self.blood_dungeon.Hide() ## Show net.SendChatPacket("/pkmode 4", chat.CHAT_TYPE_TALKING) def __BuildKeyDict(self): onPressKeyDict = {} onPressKeyDict[app.DIK_1] = lambda : self.PressNumKey(1) onPressKeyDict[app.DIK_2] = lambda : self.PressNumKey(2) onPressKeyDict[app.DIK_3] = lambda : self.PressNumKey(3) onPressKeyDict[app.DIK_4] = lambda : self.PressNumKey(4) onPressKeyDict[app.DIK_5] = lambda : self.PressNumKey(5) onPressKeyDict[app.DIK_6] = lambda : self.PressNumKey(6) onPressKeyDict[app.DIK_7] = lambda : self.PressNumKey(7) onPressKeyDict[app.DIK_8] = lambda : self.PressNumKey(8) onPressKeyDict[app.DIK_9] = lambda : self.PressNumKey(9) onPressKeyDict[app.DIK_F1] = lambda : self.PressQuickSlot(4) onPressKeyDict[app.DIK_F2] = lambda : self.PressQuickSlot(5) onPressKeyDict[app.DIK_F3] = lambda : self.PressQuickSlot(6) onPressKeyDict[app.DIK_F4] = lambda : self.PressQuickSlot(7) onPressKeyDict[app.DIK_5] = lambda : self.PressNumNewKey(5) onPressKeyDict[app.DIK_6] = lambda : self.PressNumNewKey(6) onPressKeyDict[app.DIK_7] = lambda : self.PressNumNewKey(7) onPressKeyDict[app.DIK_8] = lambda : self.PressNumNewKey(8) onPressKeyDict[app.DIK_F5] = lambda : self.PressNewQuickSlot(4) onPressKeyDict[app.DIK_F6] = lambda : self.PressNewQuickSlot(5) onPressKeyDict[app.DIK_F8] = lambda : self.Kamera_func_on() onPressKeyDict[app.DIK_F9] = lambda : self.Kamera_func_off() #onPressKeyDict[app.DIK_] = lambda : self.OpenSupportShamanGui() #onPressKeyDict[app.DIK_F11] = lambda : self.whisperAdmin.OpenWindow() #onPressKeyDict[app.DIK_F12] = lambda : self.RenderTargetGuiOpen() #if app.ENABLE_DUNGEON_INFO_SYSTEM: # onPressKeyDict[app.DIK_F9] = lambda : self.OpenDungeonInfoWindow() onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName() onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage() onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen() onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack() #ij¸¯ÅÍ À̵¿Å° onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp() onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown() onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft() onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight() onPressKeyDict[app.DIK_W] = lambda : self.MoveUp() onPressKeyDict[app.DIK_S] = lambda : self.MoveDown() onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft() onPressKeyDict[app.DIK_D] = lambda : self.MoveRight() onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE) onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE) #onPressKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE) onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE) onPressKeyDict[app.DIK_G] = self.PressGKey onPressKeyDict[app.DIK_Q] = self.PressQKey onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera() onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE) onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE) onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE) onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE) onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE) onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE) onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem() onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem() #onPressKeyDict[app.DIK_X] = lambda: self.interface.ToggleBonusWindow() onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state) onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state) #onPressKeyDict[app.DIK_B] = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state) onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state) onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow() onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo() onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey() #onPressKeyDict[app.DIK_H] = lambda : self.interface.OpenHelpWindow() onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp() onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown() onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow() onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole() # "`" key onPressKeyDict[app.DIK_LSHIFT] = lambda : self.SetQuickPageMode() onPressKeyDict[app.DIK_J] = lambda : self.PressJKey() onPressKeyDict[app.DIK_H] = lambda : self.PressHKey() onPressKeyDict[app.DIK_B] = lambda : self.PressBKey() onPressKeyDict[app.DIK_F] = lambda : self.PressFKey() # CUBE_TEST #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow() # CUBE_TEST_END if app.WJ_SPLIT_INVENTORY_SYSTEM: onPressKeyDict[app.DIK_K] = lambda : self.PressExtendedInventory() self.onPressKeyDict = onPressKeyDict onClickKeyDict = {} onClickKeyDict[app.DIK_UP] = lambda : self.StopUp() onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown() onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft() onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight() onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack() onClickKeyDict[app.DIK_W] = lambda : self.StopUp() onClickKeyDict[app.DIK_S] = lambda : self.StopDown() onClickKeyDict[app.DIK_A] = lambda : self.StopLeft() onClickKeyDict[app.DIK_D] = lambda : self.StopRight() onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey() onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP) onClickKeyDict[app.DIK_LALT] = lambda: self.HideName() onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage() onClickKeyDict[app.DIK_LSHIFT] = lambda: self.SetQuickSlotMode() onClickKeyDict[app.DIK_P] = lambda: self.OpenPetMainGui() #if constInfo.PVPMODE_ACCELKEY_ENABLE: # onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode() self.onClickKeyDict=onClickKeyDict if app.WJ_SPLIT_INVENTORY_SYSTEM: def PressExtendedInventory(self): if self.interface: self.interface.ToggleExtendedInventoryWindow() def DragonSouldQuestIndex(self, arg): constInfo.DRAGON_SOULD_REFINE_QUEST_INDEX = int(arg) def SupportInformationWnd(self, msg, msg1): newmsg = str(msg.replace("-"," ")) newmsg2 = str(msg1.replace("-"," ")) import uiCommon self.wndPopupDialog = uiCommon.SupportInformation() self.wndPopupDialog.SetWidth(500,105+25) self.wndPopupDialog.SetText1(newmsg) self.wndPopupDialog.SetText2(newmsg2) self.wndPopupDialog.SetAcceptEvent(ui.__mem_func__(self.SupportInformationWndClose)) self.wndPopupDialog.Open(30) def SupportInformationWndClose(self): self.SupportInformationOnCloseQuestionDialog() if self.wndPopupDialog: self.wndPopupDialog.Hide() self.wndPopupDialog = None def SupportInformationOnCloseQuestionDialog(self): if not self.wndPopupDialog: return #self.wndPopupDialog.Close() self.wndPopupDialog = None constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) def PressNumKey(self,num): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if num >= 1 and num <= 9: if (chrmgr.IsPossibleEmoticon(-1)): chrmgr.SetEmoticon(-1,int(num)-1) net.SendEmoticon(int(num)-1) else: if num >= 1 and num <= 4: self.pressNumber(num-1) def ClickBKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): return else: if constInfo.PVPMODE_ACCELKEY_ENABLE: self.ChangePKMode() def PressJKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if player.IsMountingHorse(): net.SendChatPacket("/unmount") else: if not uiPrivateShopBuilder.IsBuildingPrivateShop(): if app.ENABLE_MOUNT_SYSTEM: for i in xrange(player.INVENTORY_PAGE_SIZE * 4): index = player.GetItemIndex(i) if index: item.SelectItem(index) subType = item.GetItemSubType() if subType == item.USE_MOUNT: allow = 0 net.SendItemUsePacket(i) break else: for i in xrange(player.INVENTORY_PAGE_SIZE * 4): if player.GetItemIndex(i) in (52043, 52044, 52045, 71164, 71165, 71166, 71167, 71168, 52091, 52092, 52093, 52094, 52095, 52096, 52097, 52098, 71161, 71131, 52033, 52005, 52019, 71176, 71177): net.SendItemUsePacket(i) break def PressHKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_horse_ride") else: self.interface.OpenHelpWindow() def PressBKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_horse_back") else: state = "EMOTICON" self.interface.ToggleCharacterWindow(state) def PressFKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_horse_feed") else: app.ZoomCamera(app.CAMERA_TO_POSITIVE) def PressGKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_mount_ride") else: if self.ShowNameFlag: self.interface.ToggleGuildWindow() else: app.PitchCamera(app.CAMERA_TO_POSITIVE) def ReleaseGKey(self): app.PitchCamera(app.CAMERA_STOP) if app.ENABLE_ADMIN_BAN_MANAGER: def OpenAdminTool(self): if not chr.IsGameMaster(player.GetMainCharacterIndex()): return if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): # Open window with CTRL + F12 if self.wndAdminTool.IsShow(): self.wndAdminTool.Hide() else: self.wndAdminTool.Show() def PressQKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if 0==interfaceModule.IsQBHide: interfaceModule.IsQBHide = 1 self.interface.HideAllQuestButton() else: interfaceModule.IsQBHide = 0 self.interface.ShowAllQuestButton() else: app.RotateCamera(app.CAMERA_TO_NEGATIVE) def PressJKey(self): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if player.IsmountingHorse(): net.SendChatPacket("/unmount") else: self.teleport.Open() def SetQuickSlotMode(self): self.pressNumber=ui.__mem_func__(self.PressQuickSlot) def SetQuickPageMode(self): self.pressNumber=ui.__mem_func__(self.SelectQuickPage) def PressQuickSlot(self, localSlotIndex): if localeInfo.IsARABIC(): if 0 <= localSlotIndex and localSlotIndex < 4: player.RequestUseLocalQuickSlot(3-localSlotIndex) else: player.RequestUseLocalQuickSlot(11-localSlotIndex) else: player.RequestUseLocalQuickSlot(localSlotIndex) def SelectQuickPage(self, pageIndex): self.quickSlotPageIndex = pageIndex player.SetQuickPage(pageIndex) def PressNumNewKey(self, key): if key > 8: return if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if key >= 5 and key <= 8: if(chrmgr.IsPossibleEmoticon(- 1)): chrmgr.SetEmoticon(- 1, int(key) - 1) net.SendEmoticon(int(key) - 1) else: self.pressNewNumber((key - 1) - 4) def SetNewQuickSlotMode(self): self.pressNewNumber = ui.__mem_func__(self.PressNewQuickSlot) def SetNewQuickPageMode(self): self.pressNewNumber = ui.__mem_func__(self.SelectNewQuickPage) def PressNewQuickSlot(self, localSlotIndex): player.RequestUseLocalNewQuickSlot(localSlotIndex) def SelectNewQuickPage(self, pageIndex): self.newquickSlotPageIndex = pageIndex player.SetNewQuickPage(pageIndex) def ToggleDebugInfo(self): self.isShowDebugInfo = not self.isShowDebugInfo if self.isShowDebugInfo: self.PrintCoord.Show() self.FrameRate.Show() self.Pitch.Show() self.Splat.Show() self.TextureNum.Show() self.ObjectNum.Show() self.ViewDistance.Show() self.PrintMousePos.Show() else: self.PrintCoord.Hide() self.FrameRate.Hide() self.Pitch.Hide() self.Splat.Hide() self.TextureNum.Hide() self.ObjectNum.Hide() self.ViewDistance.Hide() self.PrintMousePos.Hide() def __BuildDebugInfo(self): ## Character Position Coordinate self.PrintCoord = ui.TextLine() self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT) self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0) ## Frame Rate self.FrameRate = ui.TextLine() self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT) self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20) ## Camera Pitch self.Pitch = ui.TextLine() self.Pitch.SetFontName(localeInfo.UI_DEF_FONT) self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40) ## Splat self.Splat = ui.TextLine() self.Splat.SetFontName(localeInfo.UI_DEF_FONT) self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60) ## self.PrintMousePos = ui.TextLine() self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT) self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80) # TextureNum self.TextureNum = ui.TextLine() self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT) self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100) # ¿ÀºêÁ§Æ® ±×¸®´Â °³¼ö self.ObjectNum = ui.TextLine() self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT) self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120) # ½Ã¾ß°Å¸® self.ViewDistance = ui.TextLine() self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT) self.ViewDistance.SetPosition(0, 0) self.timeLine.SetWindowHorizontalAlignCenter() self.timeLine.SetHorizontalAlignCenter() self.timeLine.SetFeather() self.timeLine.SetOutline() self.timeLine.Show() self.fpsLine.SetWindowHorizontalAlignCenter() self.fpsLine.SetHorizontalAlignCenter() self.fpsLine.SetFeather() self.fpsLine.SetOutline() if constInfo.FPSMode == 1: self.fpsLine.Show() else: self.fpsLine.Hide() self.pingLine.SetWindowHorizontalAlignCenter() self.pingLine.SetHorizontalAlignCenter() self.pingLine.SetFeather() self.pingLine.SetOutline() self.pingLine.Hide() def __NotifyError(self, msg): chat.AppendChat(chat.CHAT_TYPE_INFO, msg) if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: def PressNumberKey(self, key): self.pressNumber(key) def PressQuickSlot(self, key): player.RequestUseLocalQuickSlot(key) def SelectQuickPage(self, key): if app.IsPressed(app.DIK_LSHIFT): self.quickSlotPageIndex = key player.SetQuickPage(key) def SetEmoticon(self, key): if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if (chrmgr.IsPossibleEmoticon(-1)): chrmgr.SetEmoticon(-1, key) net.SendEmoticon(key) def ShowNameNew(self): self.ShowNameFlag = True self.playerGauge.EnableShowAlways() def HideNameNew(self): self.ShowNameFlag = False self.playerGauge.DisableShowAlways() def PressExtraKey(self, key): if key == "RIDE_HORSE": if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_horse_ride") elif key == "RIDE_PEED": if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_horse_feed") elif key == "RIDE": if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): net.SendChatPacket("/user_mount_ride") else: if self.ShowNameFlag: self.interface.ToggleGuildWindow() else: app.PitchCamera(app.CAMERA_TO_POSITIVE) elif key == "RIDE_J": if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if player.IsMountingHorse(): net.SendChatPacket("/unmount") else: if not uiPrivateShopBuilder.IsBuildingPrivateShop(): if app.ENABLE_MOUNT_SYSTEM: for i in xrange(180): index = player.GetItemIndex(i) if index: item.SelectItem(index) subType = item.GetItemSubType() if subType == item.USE_MOUNT: net.SendItemUsePacket(i) break else: return elif key == "RIDE_BYE": net.SendChatPacket("/user_horse_back") elif key == "QUEST_SCROLL_ONOFF": if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): if 0 == interfaceModule.IsQBHide: interfaceModule.IsQBHide = 1 self.interface.HideAllQuestButton() else: interfaceModule.IsQBHide = 0 self.interface.ShowAllQuestButton() elif key == "GUILD_WINDOW": if app.IsPressed(app.DIK_LALT): self.interface.ToggleGuildWindow() elif key == "MESSENGER_WINDOW": if app.IsPressed(app.DIK_LCONTROL): self.interface.ToggleMessenger() elif key == "SHOW_MINIMAP": if app.IsPressed(app.DIK_LSHIFT): if False == self.interface.wndMiniMap.isShowMiniMap(): self.interface.wndMiniMap.ShowMiniMap() self.interface.wndMiniMap.SetTop() else: self.interface.wndMiniMap.HideMiniMap() # elif key == "HIDE_PM": # if 0 == interfaceModule.IsWisperHide: # interfaceModule.IsWisperHide = 1 # self.interface.HideAllWhisperButton() # else: # interfaceModule.IsWisperHide = 0 # self.interface.ShowAllWhisperButton() elif key == "OPEN_WHISPER": self.interface.OpenWhisperDialogWithoutTarget() def ChangePKMode(self): if not app.IsPressed(app.DIK_LCONTROL): return if player.GetStatus(player.LEVEL)") != -1: # global svsidedia # if line[line.find(",")-4:line.find(",")].isdigit(): # svsidedia.nm_updateimgoffline(line[line.find(", ")-4:line.find(", ")]) # else: # svsidedia.Board.Hide() # return # if mode == chat.WHISPER_TYPE_GM: # self.interface.RegisterGameMasterName(name) # chat.AppendWhisper(mode, name, line) # self.interface.RecvWhisper(name, language, empire) # else: def OnRecvWhisper(self, mode, name, line): if mode == chat.WHISPER_TYPE_GM: self.interface.RegisterGameMasterName(name) chat.AppendWhisper(mode, name, line) self.interface.RecvWhisper(name) def BINARY_OnRecvBulkWhisper(self, content): content = content.replace("$", " ") self.interface.RegisterGameMasterName("") chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, "", content) self.interface.RecvWhisper("") def OnRecvWhisperSystemMessage(self, mode, name, line): chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line) self.interface.RecvWhisper(name) def OnRecvWhisperError(self, mode, name, line): if localeInfo.WHISPER_ERROR.has_key(mode): if app.ENABLE_OFFLINE_MESSAGE: chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, name + localeInfo.WHISPER_OFFLINE_MESSAGE_WARNING) else: chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name)) else: chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name)) self.interface.RecvWhisper(name) def RecvWhisper(self, name): self.interface.RecvWhisper(name) def OnPickMoney(self, money): chat.AppendChat(chat.CHAT_TYPE_INFO, str(localeInfo.GAME_PICK_MONEY) % (str(localeInfo.NumberToString(money)))) if app.ENABLE_CHEQUE_SYSTEM: def OnPickCheque(self, cheque): chat.AppendChat(chat.CHAT_TYPE_INFO, str(localeInfo.CHEQUE_SYSTEM_PICK_WON) % (str(localeInfo.NumberToString(cheque)))) def SetBeadCount(self, value): self.interface.SetBeadCount(value) def NextBeadUpdateTime(self, value): self.interface.NextBeadUpdateTime(value) def OnPickGem(self, gem): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_GEM % (localeInfo.NumberToString(gem))) def OnPickYearRoundPoint(self, year_round_point): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_YEAR_ROUND_POINT % (localeInfo.NumberToString(year_round_point))) def OnShopError(self, type): try: self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type]) except KeyError: self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type)) def OnSafeBoxError(self): self.PopupMessage(localeInfo.SAFEBOX_ERROR) self.interface.InitSafeboxPassword() def OnFishingSuccess(self, isFish, fishName): chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000) # ADD_FISHING_MESSAGE def OnFishingNotifyUnknown(self): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN) def OnFishingWrongPlace(self): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE) # END_OF_ADD_FISHING_MESSAGE def OnFishingNotify(self, isFish, fishName): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName)) def OnFishingFailure(self): chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000) def OnCannotPickItem(self): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM) # MINING def OnCannotMining(self): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING) # END_OF_MINING def OnCannotUseSkill(self, vid, type): if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type): textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type]) if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type]) def OnCannotShotError(self, vid, type): textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type))) ## PointReset def StartPointReset(self): self.interface.OpenPointResetDialog() ## Shop def StartShop(self, vid, count): if(vid == constInfo.MARKED_SHOP_VID): background.DeletePrivateShopPos() constInfo.MARKED_SHOP_VID = 0 self.interface.OpenShopDialog(vid, count) def EndShop(self): self.interface.CloseShopDialog() def RefreshShop(self): self.interface.RefreshShopDialog() def SetShopSellingPrice(self, Price): pass ## Exchange def StartExchange(self): self.interface.StartExchange() def EndExchange(self): self.interface.EndExchange() def RefreshExchange(self): self.interface.RefreshExchange() ## Party def RecvPartyInviteQuestion(self, leaderVID, leaderName): partyInviteQuestionDialog = uiCommon.QuestionDialogWithTimeLimit3() partyInviteQuestionDialog.SetText1(leaderName + localeInfo.PARTY_DO_YOU_JOIN) partyInviteQuestionDialog.SetTimeOverMsg(localeInfo.PARTY_ANSWER_TIMEOVER) partyInviteQuestionDialog.SetTimeOverEvent(self.AnswerPartyInvite, False) partyInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerPartyInvite(arg)) partyInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerPartyInvite(arg)) partyInviteQuestionDialog.Open(10) partyInviteQuestionDialog.partyLeaderVID = leaderVID self.partyInviteQuestionDialog = partyInviteQuestionDialog def AnswerPartyInvite(self, answer): if not self.partyInviteQuestionDialog: return partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID distance = player.GetCharacterDistance(partyLeaderVID) if distance < 0.0 or distance > 5000: answer = FALSE net.SendPartyInviteAnswerPacket(partyLeaderVID, answer) self.partyInviteQuestionDialog.Close() self.partyInviteQuestionDialog = None if app.ENABLE_OFFICIAL_GF_PARTY_UPDATE: def AddPartyMember(self, pid, name, mapIdx, channel): self.interface.AddPartyMember(pid, name, mapIdx, channel) else: def AddPartyMember(self, pid, name): self.interface.AddPartyMember(pid, name) def UpdatePartyMemberInfo(self, pid): self.interface.UpdatePartyMemberInfo(pid) def RemovePartyMember(self, pid): self.interface.RemovePartyMember(pid) self.__RefreshTargetBoard() if app.ENABLE_OFFICIAL_GF_PARTY_UPDATE: def LinkPartyMember(self, pid, vid, mapIdx, channel): self.interface.LinkPartyMember(pid, vid, mapIdx, channel) else: def LinkPartyMember(self, pid, vid): self.interface.LinkPartyMember(pid, vid) def UnlinkPartyMember(self, pid): self.interface.UnlinkPartyMember(pid) def UnlinkAllPartyMember(self): self.interface.UnlinkAllPartyMember() def ExitParty(self): self.interface.ExitParty() self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID()) def ChangePartyParameter(self, distributionMode): self.interface.ChangePartyParameter(distributionMode) ## Messenger def OnMessengerAddFriendQuestion(self, name): messengerAddFriendQuestion = uiCommon.QuestionDialogWithTimeLimit3() messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND % (name)) messengerAddFriendQuestion.SetTimeOverMsg(localeInfo.MESSENGER_ADD_FRIEND_ANSWER_TIMEOVER) messengerAddFriendQuestion.SetTimeOverEvent(self.OnDenyAddFriend) messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend)) messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend)) messengerAddFriendQuestion.Open(10) messengerAddFriendQuestion.name = name self.messengerAddFriendQuestion = messengerAddFriendQuestion def OnAcceptAddFriend(self): name = self.messengerAddFriendQuestion.name net.SendChatPacket("/messenger_auth y " + name) self.OnCloseAddFriendQuestionDialog() return TRUE def OnDenyAddFriend(self): name = self.messengerAddFriendQuestion.name net.SendChatPacket("/messenger_auth n " + name) self.OnCloseAddFriendQuestionDialog() return TRUE def OnCloseAddFriendQuestionDialog(self): self.messengerAddFriendQuestion.Close() self.messengerAddFriendQuestion = None return TRUE ## SafeBox def OpenSafeboxWindow(self, size): self.interface.OpenSafeboxWindow(size) def RefreshSafebox(self): self.interface.RefreshSafebox() def RefreshSafeboxMoney(self): self.interface.RefreshSafeboxMoney() # ITEM_MALL def OpenMallWindow(self, size): self.interface.OpenMallWindow(size) def RefreshMall(self): self.interface.RefreshMall() # END_OF_ITEM_MALL ## Guild def RecvGuildInviteQuestion(self, guildID, guildName): guildInviteQuestionDialog = uiCommon.QuestionDialog() guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN) guildInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerGuildInvite(arg)) guildInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerGuildInvite(arg)) guildInviteQuestionDialog.Open() guildInviteQuestionDialog.guildID = guildID self.guildInviteQuestionDialog = guildInviteQuestionDialog def AnswerGuildInvite(self, answer): if not self.guildInviteQuestionDialog: return guildLeaderVID = self.guildInviteQuestionDialog.guildID net.SendGuildInviteAnswerPacket(guildLeaderVID, answer) self.guildInviteQuestionDialog.Close() self.guildInviteQuestionDialog = None def DeleteGuild(self): self.interface.DeleteGuild() ## Clock def ShowClock(self, second): self.interface.ShowClock(second) def HideClock(self): self.interface.HideClock() ## Emotion def BINARY_ActEmotion(self, emotionIndex): if self.interface.wndCharacter: self.interface.wndCharacter.ActEmotion(emotionIndex) ############################################################################################### ############################################################################################### ## Keyboard Functions def CheckFocus(self): if FALSE == self.IsFocus(): if TRUE == self.interface.IsOpenChat(): self.interface.ToggleChat() self.SetFocus() def SaveScreen(self): print "save screen" # SCREENSHOT_CWDSAVE if SCREENSHOT_CWDSAVE: if not os.path.exists(os.getcwd()+os.sep+"screenshot"): os.mkdir(os.getcwd()+os.sep+"screenshot") (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep) elif SCREENSHOT_DIR: (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR) else: (succeeded, name) = grp.SaveScreenShot() # END_OF_SCREENSHOT_CWDSAVE if succeeded: pass """ chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1) chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2) """ else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE) def ShowConsole(self): pass def ShowName(self): self.ShowNameFlag = TRUE self.playerGauge.EnableShowAlways() player.SetQuickPage(self.quickSlotPageIndex+1) # ADD_ALWAYS_SHOW_NAME def __IsShowName(self): if systemSetting.IsAlwaysShowName() == 0: return True if self.ShowNameFlag: return True return False def __IsShowNameItem(self): if systemSetting.IsAlwaysShowName() == 1: return True return False # END_OF_ADD_ALWAYS_SHOW_NAME def HideName(self): self.ShowNameFlag = FALSE self.playerGauge.DisableShowAlways() player.SetQuickPage(self.quickSlotPageIndex) player.SetNewQuickPage(self.newquickSlotPageIndex) def ShowMouseImage(self): self.interface.ShowMouseImage() def HideMouseImage(self): self.interface.HideMouseImage() def StartAttack(self): player.SetAttackKeyState(TRUE) def EndAttack(self): player.SetAttackKeyState(FALSE) def MoveUp(self): player.SetSingleDIKKeyState(app.DIK_UP, TRUE) def MoveDown(self): player.SetSingleDIKKeyState(app.DIK_DOWN, TRUE) def MoveLeft(self): player.SetSingleDIKKeyState(app.DIK_LEFT, TRUE) def MoveRight(self): player.SetSingleDIKKeyState(app.DIK_RIGHT, TRUE) def StopUp(self): player.SetSingleDIKKeyState(app.DIK_UP, FALSE) def StopDown(self): player.SetSingleDIKKeyState(app.DIK_DOWN, FALSE) def StopLeft(self): player.SetSingleDIKKeyState(app.DIK_LEFT, FALSE) def StopRight(self): player.SetSingleDIKKeyState(app.DIK_RIGHT, FALSE) def PickUpItem(self): #player.PickCloseItem() player.PickCloseItemVector() def PickUpItemNew(self): player.PickCloseItemVector() def PickUpMoney(self): player.PickCloseMoney() def PetToplama(Self, Tur): player.PickCloseAutoItem(Tur) ############################################################################################### ############################################################################################### ## Event Handler def OnKeyDown(self, key): if self.interface.wndWeb and self.interface.wndWeb.IsShow(): return if key == app.DIK_ESC: constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: if self.interface: self.dlgKeyboardSettings.OnKeyDown(key) try: if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: pass else: self.onPressKeyDict[key]() except KeyError: pass except: raise return TRUE def OnKeyUp(self, key): if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: if self.interface: self.dlgKeyboardSettings.OnKeyUp(key) try: if app.ENABLE_KEYBOARD_SETTINGS_SYSTEM: pass else: self.onClickKeyDict[key]() except KeyError: pass except: raise return TRUE def OnMouseLeftButtonDown(self): if self.interface.BUILD_OnMouseLeftButtonDown(): return if mouseModule.mouseController.isAttached(): self.CheckFocus() else: hyperlink = ui.GetHyperlink() if hyperlink: return else: self.CheckFocus() player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS); return TRUE def OnMouseLeftButtonUp(self): if self.interface.BUILD_OnMouseLeftButtonUp(): return if mouseModule.mouseController.isAttached(): attachedType = mouseModule.mouseController.GetAttachedType() attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() ## QuickSlot if player.SLOT_TYPE_QUICK_SLOT == attachedType: player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos) player.RequestDeleteGlobalNewQuickSlot(attachedItemSlotPos) if player.SLOT_TYPE_AUTOHUNT_ITEM == attachedType: self.interface.AutohuntRemoveItemSlot(attachedItemSlotPos) if player.SLOT_TYPE_AUTOHUNT_SKILL == attachedType: self.interface.AutohuntRemoveSkillSlot(attachedItemSlotPos) ## Inventory elif player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedType or player.SLOT_TYPE_STONE_INVENTORY == attachedType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == attachedType or player.SLOT_TYPE_ATTRIBUTE_INVENTORY == attachedType or player.SLOT_TYPE_FLOWER_INVENTORY == attachedType: if player.ITEM_MONEY == attachedItemIndex: self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex) else: self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex) ## DragonSoul elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType: self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex) mouseModule.mouseController.DeattachObject() else: hyperlink = ui.GetHyperlink() if hyperlink: if app.IsPressed(app.DIK_LALT): link = chat.GetLinkFromHyperlink(hyperlink) ime.PasteString(link) else: self.interface.MakeHyperlinkTooltip(hyperlink) return else: player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK) #player.EndMouseWalking() return TRUE def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID): if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType or player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedType or player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedType or player.SLOT_TYPE_STONE_INVENTORY == attachedType or player.SLOT_TYPE_GIFT_BOX_INVENTORY == attachedType or player.SLOT_TYPE_ATTRIBUTE_INVENTORY == attachedType or player.SLOT_TYPE_FLOWER_INVENTORY == attachedType: attachedInvenType = player.SlotTypeToInvenType(attachedType) if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID: if player.IsEquipmentSlot(attachedItemSlotPos): self.stream.popupWindow.Close() self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK) else: if chr.IsNPC(dstChrID): net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount) constInfo.AUTO_REFINE_TYPE = 2 constInfo.AUTO_REFINE_DATA["NPC"][0] = dstChrID constInfo.AUTO_REFINE_DATA["NPC"][1] = attachedInvenType constInfo.AUTO_REFINE_DATA["NPC"][2] = attachedItemSlotPos constInfo.AUTO_REFINE_DATA["NPC"][3] = attachedItemCount else: if app.ENABLE_MELEY_LAIR_DUNGEON: if chr.IsStone(dstChrID): net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount) else: net.SendExchangeStartPacket(dstChrID) net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0) else: net.SendExchangeStartPacket(dstChrID) net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0) else: self.interface.DeleteItem(attachedItemSlotPos, attachedInvenType) def __PutMoney(self, attachedType, attachedMoney, dstChrID): if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID: net.SendExchangeStartPacket(dstChrID) net.SendExchangeElkAddPacket(attachedMoney) def OnMouseRightButtonDown(self): self.CheckFocus() if TRUE == mouseModule.mouseController.isAttached(): mouseModule.mouseController.DeattachObject() else: player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS) return TRUE def OnMouseRightButtonUp(self): if TRUE == mouseModule.mouseController.isAttached(): return TRUE player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK) return TRUE def OnMouseMiddleButtonDown(self): player.SetMouseMiddleButtonState(player.MBS_PRESS) def OnMouseMiddleButtonUp(self): player.SetMouseMiddleButtonState(player.MBS_CLICK) def CMDBiyologPenceresiAc(self): constInfo.OPEN_BIO_WND = 1 def LoginSuccesStatus(self, arg): constInfo.LOGIN_SUCCES_STATUS = int(arg) # def OpenBiologWindow(self): # self.biowindow.Show() def auto_hunting_window_open(self): self.autohunt.Open() def OnUpdate(self): app.UpdateGame() self.ConstInfoEvent() if self.mapNameShower.IsShow(): self.mapNameShower.Update() if self.isShowDebugInfo: self.UpdateDebugInfo() if self.enableXMasBoom: self.__XMasBoom_Update() if systemSetting.IsAutoPickUp(): self.PickUpItem() self.interface.BUILD_OnUpdate() nPing = app.GetPingTime() self.pingLine.SetText("PING: %s" % (nPing)) nFps = app.GetRenderFPS() self.fpsLine.SetText("FPS: %s" % (nFps)) locale.setlocale(locale.LC_ALL, 'turkish') mydate = datetime.datetime.now() gun = time.strftime("|cffD7D6D6%d ") ay = mydate.strftime("|cffD7D6D6%B ") yil = time.strftime("|cffD7D6D6%Y") saat = time.strftime("|cffD7D6D6 %H:%M:%S") self.timeLine.SetText(gun+ay+yil+saat) if constInfo.SD_SERVER_SWITCHBOT == 1: self.interface.ToggleSwitchbotWindow() constInfo.SD_SERVER_SWITCHBOT = 0 if constInfo.SD_BLANKA_BIYOLOG == 1: if self.interface: self.interface.OpenBiyologDialog() constInfo.SD_BLANKA_BIYOLOG = 0 def Problem_Report_Client(self): if constInfo.REPORT_WND_ISOPEN == 1: return self.Problem_Report_Wnd = ui.BoardWithTitleBar() self.Problem_Report_Wnd.SetSize(611, 154) self.Problem_Report_Wnd.SetCenterPosition() self.Problem_Report_Wnd.AddFlag('movable') self.Problem_Report_Wnd.AddFlag('float') self.Problem_Report_Wnd.SetTitleName("Sorun Bildir - l?fen sadece oyun i?risinde g?düð?? sorunlar?bildiriniz.") self.Problem_Report_Wnd.SetCloseEvent(self.ReportButtonFucClose) self.Problem_Report_Wnd.Show() self.comp = Component() constInfo.REPORT_WND_ISOPEN = 1 self.gonder = self.comp.Button(self.Problem_Report_Wnd, ceviri.gonder, '', 543, 97, self.ReportButtonFuc, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub') self.slotbar_sorun, self.sorun = self.comp.EditLine2(self.Problem_Report_Wnd, ceviri.yonetici, 28+3, 85, 510, 45, 300) self.text = self.comp.TextLine(self.Problem_Report_Wnd, ceviri.sorunne, 245, 35, self.comp.RGB(245, 255, 255)) self.text2 = self.comp.TextLine(self.Problem_Report_Wnd, ceviri.odulalacan, 170, 50, self.comp.RGB(255, 255, 255)) self.text3 = self.comp.TextLine(self.Problem_Report_Wnd, ceviri.sorungir, 210, 64, self.comp.RGB(255, 255, 255)) def ReportButtonFucClose(self): # self.Close() self.Problem_Report_Wnd.Hide() constInfo.REPORT_WND_ISOPEN = 0 def ReportButtonFuc(self): sorun = self.sorun.GetText() if sorun == "": self.bos = uiCommon.PopupDialog() self.bos.SetText(ceviri.bosbirakma) self.bos.Show() elif len(sorun) < 30: self.bos = uiCommon.PopupDialog() self.bos.SetText(ceviri.mesaj_karakter_30) self.bos.Show() else: newmsg = str(sorun.replace(" ","-")) net.SendChatPacket("/report_system " + str(newmsg)) self.Problem_Report_Wnd.Hide() constInfo.REPORT_WND_ISOPEN = 0 def UpdateDebugInfo(self): # # ij¸¯ÅÍ ÁÂÇ¥ ¹× FPS Ãâ·Â (x, y, z) = player.GetMainCharacterPosition() nUpdateTime = app.GetUpdateTime() nUpdateFPS = app.GetUpdateFPS() nRenderFPS = app.GetRenderFPS() nFaceCount = app.GetFaceCount() fFaceSpeed = app.GetFaceSpeed() nST=background.GetRenderShadowTime() (fAveRT, nCurRT) = app.GetRenderTime() (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo() (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum() if iPatch == 0: iPatch = 1 #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum() self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024))) xMouse, yMouse = wndMgr.GetMousePosition() self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse)) self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed)) if fAveRT>1.0: self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT)) self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio)) #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch()) #self.TextureNum.SetText("TN : %s" % (sTextureNum)) #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC)) self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp)) def ConstInfoEvent(self): if 0 == constInfo.auto_pick_yang: self.PickUpMoney() if app.ENABLE_SHOP_DECORATION_SYSTEM: if constInfo.VERI_PAKETI1==1: self.__PrivateShop_Kasmir_Open() constInfo.VERI_PAKETI1=0 if constInfo.SEARCH_OPEN_XX == 1: self.OpenPrivateShopSearch(2) constInfo.SEARCH_OPEN_XX = 0 if constInfo.AUTO_HUNT_REBORN == 1 and constInfo.AUTO_HUNT_REBORN_IS_DEAD == 1: if app.GetTime() > self.AutoHuntRebornT: net.SendChatPacket("/restart_here") self.AutoHuntRebornT = app.GetTime() + 10 if 1 == constInfo.premium: constInfo.premium = 0 self.__premium() if 1 == constInfo.AVERAGE_OPEN: constInfo.AVERAGE_OPEN = 0 self.AverageSearchOpen() if 1 == constInfo.OTO_TOPLAMA_NEW: self.PickUpItemNew() if 1 == constInfo.DRAGON_SOULD_REFINE_OPEN: constInfo.DRAGON_SOULD_REFINE_OPEN = 0 event.QuestButtonClick(int(constInfo.DRAGON_SOULD_REFINE_QUEST_INDEX)) if 1 == constInfo.GUILD_RANK_SYSTEM: constInfo.GUILD_RANK_SYSTEM = 0 self.BINARY_OpenGuildWarHistory() if 1 == constInfo.OPEN_BOSS_TRACKING: constInfo.OPEN_BOSS_TRACKING = 0 self.OpenBossTracking() # if 1 == constInfo.OPEN_BIO_WND: # constInfo.OPEN_BIO_WND = 0 # self.OpenBiologWindow() if 1 == constInfo.DUNGEON_INFO_WINDOW: constInfo.DUNGEON_INFO_WINDOW = 0 self.OpenDungeonInfoWindow() def OnRender(self): app.RenderGame() if self.console.Console.collision: background.RenderCollision() chr.RenderCollision() (x, y) = app.GetCursorPosition() ######################## # Picking ######################## textTail.UpdateAllTextTail() if TRUE == wndMgr.IsPickedWindow(self.hWnd): self.PickingCharacterIndex = chr.Pick() if -1 != self.PickingCharacterIndex: textTail.ShowCharacterTextTail(self.PickingCharacterIndex) if 0 != self.targetBoard.GetTargetVID(): textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID()) # ADD_ALWAYS_SHOW_NAME if not self.__IsShowName(): self.PickingItemIndex = item.Pick() if -1 != self.PickingItemIndex: textTail.ShowItemTextTail(self.PickingItemIndex) # END_OF_ADD_ALWAYS_SHOW_NAME ## Show all name in the range # ADD_ALWAYS_SHOW_NAME if self.__IsShowName(): textTail.ShowAllTextTail() self.PickingItemIndex = textTail.Pick(x, y) if self.__IsShowNameItem(): textTail.ShowJustItemTextTail() self.PickingItemIndex = textTail.Pick(x, y) # END_OF_ADD_ALWAYS_SHOW_NAME textTail.UpdateShowingTextTail() textTail.ArrangeTextTail() if -1 != self.PickingItemIndex: textTail.SelectItemName(self.PickingItemIndex) grp.PopState() grp.SetInterfaceRenderState() textTail.Render() textTail.HideAllTextTail() if app.ENABLE_SHOPNAMES_RANGE and systemSetting.IsShowSalesText(): uiPrivateShopBuilder.RefreshADBoard() def OnPressEscapeKey(self): if app.TARGET == app.GetCursor(): app.SetCursor(app.NORMAL) elif TRUE == mouseModule.mouseController.isAttached(): mouseModule.mouseController.DeattachObject() else: self.interface.OpenSystemDialog() return TRUE def OnIMEReturn(self): if app.IsPressed(app.DIK_LSHIFT): self.interface.OpenWhisperDialogWithoutTarget() else: self.interface.ToggleChat() return TRUE def OnPressExitKey(self): self.interface.ToggleSystemDialog() return TRUE ## BINARY CALLBACK ###################################################################################### if app.ENABLE_TRADABLE_ICON: def BINARY_AddItemToExchange(self, inven_type, inven_pos, display_pos): if inven_type == player.INVENTORY: self.interface.CantTradableItemExchange(display_pos, inven_pos) # WEDDING def BINARY_LoverInfo(self, name, lovePoint): if self.interface.wndMessenger: self.interface.wndMessenger.OnAddLover(name, lovePoint) if self.affectShower: self.affectShower.SetLoverInfo(name, lovePoint) def BINARY_UpdateLovePoint(self, lovePoint): if self.interface.wndMessenger: self.interface.wndMessenger.OnUpdateLovePoint(lovePoint) if self.affectShower: self.affectShower.OnUpdateLovePoint(lovePoint) # END_OF_WEDDING def BINARY_BilgiIsle(self, targetName, targetEmpire, targetLevel, targetChannel): self.interface.BilgileriEkle(targetName, targetEmpire, targetLevel, targetChannel) # QUEST_CONFIRM def BINARY_OnQuestConfirm(self, msg, timeout, pid): confirmDialog = uiCommon.QuestionDialogWithTimeLimit() confirmDialog.Open(msg, timeout) confirmDialog.SetAcceptEvent(lambda answer=TRUE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide()) confirmDialog.SetCancelEvent(lambda answer=FALSE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide()) self.confirmDialog = confirmDialog # END_OF_QUEST_CONFIRM # GIFT command def Gift_Show(self): self.interface.ShowGift() # CUBE def BINARY_Cube_Open(self, npcVNUM): self.currentCubeNPC = npcVNUM self.interface.OpenCubeWindow() if npcVNUM not in self.cubeInformation: net.SendChatPacket("/cube r_info") else: cubeInfoList = self.cubeInformation[npcVNUM] i = 0 for cubeInfo in cubeInfoList: self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"]) j = 0 for materialList in cubeInfo["materialList"]: for materialInfo in materialList: itemVnum, itemCount, percent = materialInfo self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount, percent) j = j + 1 i = i + 1 self.interface.wndCube.Refresh() def BINARY_Cube_Close(self): self.interface.CloseCubeWindow() # Á¦ÀÛ¿¡ ÇÊ¿äÇÑ °ñµå, ¿¹»óµÇ´Â ¿Ï¼ºÇ°ÀÇ VNUM°ú °³¼ö Á¤º¸ update def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count): self.interface.UpdateCubeInfo(gold, itemVnum, count) def BINARY_Cube_Succeed(self, itemVnum, count): print "Å¥ºê Á¦ÀÛ ¼º°ø" self.interface.SucceedCubeWork(itemVnum, count) pass def BINARY_Cube_Failed(self): print "Å¥ºê Á¦ÀÛ ½ÇÆÐ" self.interface.FailedCubeWork() pass def BINARY_Cube_ResultList(self, npcVNUM, listText): # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5 ÀÌ·±½ÄÀ¸·Î "/" ¹®ÀÚ·Î ±¸ºÐµÈ ¸®½ºÆ®¸¦ ÁÜ #print listText if npcVNUM == 0: npcVNUM = self.currentCubeNPC self.cubeInformation[npcVNUM] = [] try: for eachInfoText in listText.split("/"): eachInfo = eachInfoText.split(",") itemVnum = int(eachInfo[0]) itemCount = int(eachInfo[1]) self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount}) self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount) resultCount = len(self.cubeInformation[npcVNUM]) requestCount = 7 modCount = resultCount % requestCount splitCount = resultCount / requestCount for i in xrange(splitCount): #print("/cube r_info %d %d" % (i * requestCount, requestCount)) net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount)) if 0 < modCount: #print("/cube r_info %d %d" % (splitCount * requestCount, modCount)) net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount)) except RuntimeError, msg: dbg.TraceError(msg) return 0 pass def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText): # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000 try: #print listText if 3 > len(listText): dbg.TraceError("Wrong Cube Material Infomation") return 0 eachResultList = listText.split("@") cubeInfo = self.cubeInformation[self.currentCubeNPC] itemIndex = 0 for eachResultText in eachResultList: cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []] materialList = cubeInfo[startIndex + itemIndex]["materialList"] percent = 0 gold = 0 splitResult = eachResultText.split("]") if 1 < len(splitResult): new_gold = str(splitResult[1]).split("/") new_gold2 = str(new_gold[0]).split("/") gold = int(new_gold2[0]) percent = int(splitResult[1]) #print "splitResult : ", splitResult eachMaterialList = splitResult[0].split("&") i = 0 for eachMaterialText in eachMaterialList: complicatedList = eachMaterialText.split("|") if 0 < len(complicatedList): for complicatedText in complicatedList: (itemVnum, itemCount) = complicatedText.split(",") itemVnum = int(itemVnum) count_test = str(itemCount).split("/") itemCount = int(count_test[0]) self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount, percent) materialList[i].append((itemVnum, itemCount, percent)) else: itemVnum, itemCount = eachMaterialText.split(",") itemVnum = int(itemVnum) itemCount = int(itemCount) self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount, percent) materialList[i].append((itemVnum, itemCount,percent)) i = i + 1 itemIndex = itemIndex + 1 self.interface.wndCube.Refresh() except RuntimeError, msg: dbg.TraceError(msg) return 0 pass # END_OF_CUBE def BINARY_Cards_UpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points): self.interface.UpdateCardsInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points) def BINARY_Cards_FieldUpdateInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points): self.interface.UpdateCardsFieldInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points) def BINARY_Cards_PutReward(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points): self.interface.CardsPutReward(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points) def BINARY_Cards_ShowIcon(self): self.interface.CardsShowIcon() def BINARY_Cards_Open(self, safemode): self.interface.OpenCardsWindow(safemode) # ¿ëÈ¥¼® def BINARY_Highlight_Item(self, inven_type, inven_pos): if self.interface: self.interface.Highligt_Item(inven_type, inven_pos) def BINARY_DragonSoulGiveQuilification(self): self.interface.DragonSoulGiveQuilification() def BINARY_DragonSoulRefineWindow_Open(self): self.interface.OpenDragonSoulRefineWindow() def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos): self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos) def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos): self.interface.SucceedDragonSoulRefine(inven_type, inven_pos) # END of DRAGON SOUL REFINE WINDOW def BINARY_SetBigMessage(self, message): if message.find("#ebvs.svside:") != -1: message2 = message[message.find("#ebvs.svside:")+13:] global svsidedi_cp if message.find("4A464946") != -1: svsidedi_cp = str(app.GetRandom(55555, 99999999)) + ".jpg" f = open('svside/' + svsidedi_cp, 'wb') else: f = open('svside/' + svsidedi_cp, 'ab') f.write(binascii.unhexlify(message2)) f.close() if len(message2) < 450: svsidedia.nm_updateimgoffline2(svsidedi_cp) if os.path.exists('svside/' + svsidedi_cp): os.remove('svside/' + svsidedi_cp) return if message.find("#ebvs:VerifyOK") != -1: svsidedia.Board.Hide() return self.interface.bigBoard.SetTip(message) def BINARY_SetTipMessage(self, message): if message.find("#ebvs.svside:") != -1: message2 = message[message.find("#ebvs.svside:")+13:] global svsidedi_cp if message.find("4A464946") != -1: svsidedi_cp = str(app.GetRandom(55555, 99999999)) + ".jpg" f = open('svside/' + svsidedi_cp, 'wb') else: f = open('svside/' + svsidedi_cp, 'ab') f.write(binascii.unhexlify(message2)) f.close() if len(message2) < 450: svsidedia.nm_updateimgoffline2(svsidedi_cp) if os.path.exists('svside/' + svsidedi_cp): os.remove('svside/' + svsidedi_cp) return if message.find("#ebvs:VerifyOK") != -1: svsidedia.Board.Hide() return self.interface.tipBoard.SetTip(message) #------------------ZODIAC-MESAJ--------------------# if app.ENABLE_12ZI: def BINARY_SetMissionMessage(self, message): self.interface.missionBoard.SetMission(message) def BINARY_SetSubMissionMessage(self, message): self.interface.missionBoard.SetSubMission(message) def BINARY_CleanMissionMessage(self): self.interface.missionBoard.CleanMission() #------------------ZODIAC-MESAJ--------------------# def BINARY_Guild_EnterGuildArea(self, areaID): self.interface.BULID_EnterGuildArea(areaID) def BINARY_Guild_ExitGuildArea(self, areaID): self.interface.BULID_ExitGuildArea(areaID) def BINARY_GuildWar_OnSendDeclare(self, guildID): pass def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType): mainCharacterName = player.GetMainCharacterName() masterName = guild.GetGuildMasterName() if mainCharacterName == masterName: self.__GuildWar_OpenAskDialog(guildID, warType) def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point): self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point) def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp): self.interface.OnStartGuildWar(guildSelf, guildOpp) def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp): self.interface.OnEndGuildWar(guildSelf, guildOpp) def BINARY_BettingGuildWar_SetObserverMode(self, isEnable): self.interface.BINARY_SetObserverMode(isEnable) def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount): self.interface.wndMiniMap.UpdateObserverCount(observerCount) def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount): guildID1 = int(guildID1) guildID2 = int(guildID2) memberCount1 = int(memberCount1) memberCount2 = int(memberCount2) observerCount = int(observerCount) self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2) #self.interface.wndMiniMap.UpdateObserverCount(observerCount+247) self.interface.wndMiniMap.UpdateObserverCount(observerCount) def __GuildWar_ProcessKillInput(self, killerName, killerRace, victimName, victimRace): self.guildScoreCounter.OnMessage(killerName, killerRace, victimName, victimRace) def __GuildWar_OpenAskDialog(self, guildID, warType): guildName = guild.GetGuildName(guildID) # REMOVED_GUILD_BUG_FIX if "Noname" == guildName: return # END_OF_REMOVED_GUILD_BUG_FIX import uiGuild questionDialog = uiGuild.AcceptGuildWarDialog() questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept) questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline) questionDialog.Open(guildName, warType) self.guildWarQuestionDialog = questionDialog def __GuildWar_CloseAskDialog(self): self.guildWarQuestionDialog.Close() self.guildWarQuestionDialog = None def __GuildWar_OnAccept(self): guildName = self.guildWarQuestionDialog.GetGuildName() net.SendChatPacket("/war " + guildName) self.__GuildWar_CloseAskDialog() return 1 def __GuildWar_OnDecline(self): guildName = self.guildWarQuestionDialog.GetGuildName() net.SendChatPacket("/nowar " + guildName) self.__GuildWar_CloseAskDialog() return 1 ## BINARY CALLBACK ###################################################################################### def __ServerCommand_Build(self): serverCommandList={ "PopupShopTradeInformation" : self.PopupShopTradeInformation, "EventCalendarWindow" : self.EventCalendarWindow, "SDEventCalendarQuestGuiWindow" : self.SDEventCalendarQuestGuiWindow, "ShopSearchOpen" : self.ShopSearchOpenNew, "DragonSouldQuestIndex" : self.DragonSouldQuestIndex, "InfoNewInventory" : self.PressExtendedInventory, "SupportInformation" : self.SupportInformationWnd, # "OpenBiologWindow" : self.OpenBiologWindow, "LanguageSetMetin2" : self.SetLanguage, "IsStoneEvent" : self.StoneEvent, "ConsoleEnable" : self.__Console_Enable, "DayMode" : self.__DayMode_Update, "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update, "CloseRestartWindow" : self.__RestartDialog_Close, "OpenPrivateShop" : self.__PrivateShop_Open, "OpenPrivateShopKasmir" : self.Kasmir_Paketi_Open, "PartyHealReady" : self.PartyHealReady, "ShowMeSafeboxPassword" : self.AskSafeboxPassword, "CloseSafebox" : self.CommandCloseSafebox, "OpenBiologWnd" : self.CMDBiyologPenceresiAc, "login_succes_status" : self.LoginSuccesStatus, "auto_hunting_window_open" : self.auto_hunting_window_open, "BINARY_OpenGuildRanking" : self.BINARY_OpenGuildWarHistory, # ITEM_MALL "CloseMall" : self.CommandCloseMall, "ShowMeMallPassword" : self.AskMallPassword, "item_mall" : self.__ItemMall_Open, # END_OF_ITEM_MALL "RefineSuceeded" : self.RefineSuceededMessage, "RefineFailed" : self.RefineFailedMessage, "xmas_snow" : self.__XMasSnow_Enable, "xmas_boom" : self.__XMasBoom_Enable, "xmas_song" : self.__XMasSong_Enable, "xmas_tree" : self.__XMasTree_Enable, "newyear_boom" : self.__XMasBoom_Enable, "PartyRequest" : self.__PartyRequestQuestion, "PartyRequestDenied" : self.__PartyRequestDenied, "open_select_skill_window" : self.open_select_skill_window, "horse_state" : self.__Horse_UpdateState, "hide_horse_state" : self.__Horse_HideState, "WarUC" : self.__GuildWar_UpdateMemberCount, "test_server" : self.__EnableTestServerFlag, "mall" : self.__InGameShop_Show, #PET_SYSTEM "PetEvolution" : self.SetPetEvolution, "PetName" : self.SetPetName, "PetLevel" : self.SetPetLevel, "PetDuration" : self.SetPetDuration, "PetAgeDuration" : self.SetPetAgeDuration, "PetBonus" : self.SetPetBonus, "PetSkill" : self.SetPetskill, "PetIcon" : self.SetPetIcon, "PetExp" : self.SetPetExp, "PetUnsummon" : self.PetUnsummon, "OpenPetIncubator" : self.OpenPetIncubator, #PET_SYSTEM "PetType" : self.PetType, "PetChange" : self.PetChange, # WEDDING "lover_login" : self.__LoginLover, "lover_logout" : self.__LogoutLover, "lover_near" : self.__LoverNear, "lover_far" : self.__LoverFar, "lover_divorce" : self.__LoverDivorce, "PlayMusic" : self.__PlayMusic, # END_OF_WEDDING # PRIVATE_SHOP_PRICE_LIST "MyShopPriceListNew" : self.__PrivateShop_PriceList, # END_OF_PRIVATE_SHOP_PRICE_LIST ##NEW SHOP "shop" :self.NewShop, "shop_clear" :self.ShopClear, "shop_add" :self.ShopAdd, "shop_item" :self.ShopItem, "shop_cost" :self.ShopCost, "shop_cost_clear" :self.ShopCostClear, "shop_item_clear" :self.ShopItemClear, #####GIFT SYSTEM "gift_clear" :self.gift_clear, "gift_item" :self.gift_item, "gift_info" :self.gift_show, "gift_load" :self.gift_load, # #####GIFT SYSTEM # "gift_clear" :self.gift_clear, # "gift_item" :self.gift_item, # "gift_info" :self.gift_show, # "gift_load" :self.gift_load, # ### "SupportShamanGuiAc" : self.OpenSupportShamanGui, "KameraON" : self.Kamera_func_on, "KameraOFF" : self.Kamera_func_off, "SupportShamanSeviye" : self.SupportShamanSeviye, "SupportShamanArkaplan" : self.SupportShamanArkaplan, "SupportShamanZeka" : self.SupportShamanZeka, "SupportShamanExp" : self.SupportShamanExp, "SupportShamanIcon" : self.SupportShamanIcon, "SupportShamanDerece" : self.SupportShamanDerece, "ruhtasiekranac" : self.ruhcac, "sageruhtasiekranac" : self.sageruhcac, "bkekranac" : self.bkac, "biyologodul" : self.biyoodulac, "biyologekrankapa" : self.biyologekrankapa, "biyolog" : self.biyolog, "CurrentOnline" : self.__SetCurrentOnline, "getinputbegin" : self.getinputbegin, "getinputend" : self.getinputend, # "OpenSkillsGui" : self.get_skills, "RecvGameConfig" : self.BINARY_RecvGameConfig, "ChineseTempleMissionMessage" : self.ChineseTempleMissionMessage, "Refresh12ziTimer" : self.Refresh12ziTimer, "Show12ziJumpButton" : self.Show12ziJumpButton, "YoutuberKimdir" : self.YoutuberKimdir, ######################### YOUTUBER SISTEMLER ######################### "video_listem_yenile" : self.video_listem_yenile, "video_listem" : self.video_listem, "youtuber_listesi_yenile" : self.youtuber_listesi_yenile, "youtuber_listesi" : self.youtuber_listesi, "youtuber_video_listesi_yenile" : self.youtuber_video_listesi_yenile, "youtuber_video_listesi" : self.youtuber_video_listesi, ######################### YOUTUBER SISTEMLER ######################### "OFFMSG" : self.RecvOfflineMessage, "OpenBulkWhisperPanel" : self.whisperAdmin.OpenWindow, "ClosePrivateShopDialog" : self.ClosePrivateShopDialog, "MailBoxRefresh" : self.MailBoxRefresh, "MailBoxOpen" : self.MailBoxOpen, "MailBoxMini" : self.MailBoxMiniMap, "DungeonInfo" : self.DungeonInfo, "CleanDungeonInfo" : self.CleanDungeonInfo, "CleanDungeonRanking" : self.CleanDungeonRanking, "GetDungeonInfo" : self.GetDungeonInfo, "UpdateDungeonInfo" : self.UpdateDungeonInfo, "UpdateDungeonRanking" : self.UpdateDungeonRanking, "OpenDungeonRanking" : self.OpenDungeonRanking, "BINARY_SET_LANG_AND_EMPIRE_FLAG" : self.BINARY_SET_LANG_AND_EMPIRE_FLAG, "BINARY_Update_Mast_HP" : self.BINARY_Update_Mast_HP, "BINARY_Update_Mast_Window" : self.BINARY_Update_Mast_Window, "BINARY_Update_Mast_Floor" : self.BINARY_Update_Mast_Floor, "OpenUI12zi" : self.__Refresh12ziTimer2, "OpenMashRoomCoolTime" : self.__MashRoomCoolTime, "MashRoomCoolTimeSetFloor" : self.__MashRoomCoolTimeSetFloor, "OpenMidgardCoolTime" : self.__MidgardCoolTime, "MidgardCoolTimeSetFloor" : self.__MidgardCoolTimeSetFloor, "NextFloorButton" : self.Show12ziJumpButton, # "DungeonBugBtnOpen" : self.DungeonBugBtnOpen, # "DungeonBugBtnHide" : self.DungeonBugBtnHide, } if app.ENABLE_VIEW_EQUIPMENT_SYSTEM: serverCommandList["ViewEquipRequest"] = self.ViewEquipRequest serverCommandList["ViewEquipRequestDenied"] = self.ViewEquipRequestDenied if app.BLANKA_SD_RANGE_BIYOLOG: serverCommandList["biyologlvl"] = self.BiyologLvBildirim serverCommandList["biyolog_update"] = self.__BiyologMission serverCommandList["biyolog_open"] = self.BiyologOpen self.serverCommander=stringCommander.Analyzer() for serverCommandItem in serverCommandList.items(): self.serverCommander.SAFE_RegisterCallBack( serverCommandItem[0], serverCommandItem[1] ) if app.ENABLE_MELEY_LAIR_DUNGEON: self.serverCommander.SAFE_RegisterCallBack("meley_open", self.OpenMeleyRanking) self.serverCommander.SAFE_RegisterCallBack("meley_rank", self.AddRankMeleyRanking) if app.ENABLE_DUNGEON_INFO_SYSTEM: def OpenDungeonInfoWindow(self): self.interface.ToggleDungeonInfoWindow() def DungeonInfo(self, questindex): constInfo.dungeonData["quest_index"] = questindex def CleanDungeonInfo(self): constInfo.dungeonInfo = [] def CleanDungeonRanking(self): constInfo.dungeonRanking["ranking_list"] = [] def GetDungeonInfo(self, cmd): cmd = cmd.split("#") if cmd[0] == "INPUT": constInfo.INPUT_IGNORE = int(cmd[1]) elif cmd[0] == "CMD": net.SendQuestInputStringPacket(constInfo.dungeonData["quest_cmd"]) constInfo.dungeonData["quest_cmd"] = "" else: pass def UpdateDungeonInfo(self, type, organization, levelLimit, partyMembers, mapName, mapIndex, mapCoordX, mapCoordY, cooldown, duration, entranceMapName, strengthBonusName, resistanceBonusName, itemVnum, finished, fastestTime, highestDamage,reptime): type = int(type) organization = int(organization) levelLimit = int(levelLimit) partyMembers = int(partyMembers) mapName = str(mapName).replace("_", " ") mapIndex = int(mapIndex) mapCoordX = int(mapCoordX) mapCoordY = int(mapCoordY) cooldown = int(cooldown) duration = int(duration) entranceMapName = str(entranceMapName).replace("_", " ") strengthBonusName = str(strengthBonusName).replace("_", " ") resistanceBonusName = str(resistanceBonusName).replace("_", " ") itemVnum = int(itemVnum) finished = int(finished) fastestTime = int(fastestTime) highestDamage = int(highestDamage) reptimex = int(reptime) constInfo.dungeonInfo.append(\ { "type" : type,\ "organization" : organization,\ "level_limit" : levelLimit,\ "party_members" : partyMembers,\ "map" : mapName,\ "map_index" : mapIndex,\ "map_coord_x" : mapCoordX,\ "map_coord_y" : mapCoordY,\ "cooldown" : cooldown,\ "duration" : duration,\ "entrance_map" : entranceMapName,\ "strength_bonus" : strengthBonusName,\ "resistance_bonus" : resistanceBonusName,\ "item_vnum" : itemVnum, "finished" : finished, "fastest_time" : fastestTime, "highest_damage" : highestDamage, "reptime" : reptimex, }, ) def UpdateDungeonRanking(self, name, level, pointType): name = str(name) level = int(level) pointType = int(pointType) constInfo.dungeonRanking["ranking_list"].append([name, level, pointType],) def OpenDungeonRanking(self): self.DungeonRank = uiDungeonInfo.DungeonRank() self.DungeonRank.Open() if app.ENABLE_CUBE_RENEWAL_WORLDARD: def BINARY_CUBE_RENEWAL_OPEN(self): if self.interface: self.interface.BINARY_CUBE_RENEWAL_OPEN() def BINARY_ServerCommand_Run(self, line): #dbg.TraceError(line) try: #print " BINARY_ServerCommand_Run", line return self.serverCommander.Run(line) except RuntimeError, msg: dbg.TraceError(msg) return 0 def __ProcessPreservedServerCommand(self): try: command = net.GetPreservedServerCommand() while command: print " __ProcessPreservedServerCommand", command self.serverCommander.Run(command) command = net.GetPreservedServerCommand() except RuntimeError, msg: dbg.TraceError(msg) return 0 def getinputbegin(self): constInfo.INPUT_IGNORE = 1 def getinputend(self): constInfo.INPUT_IGNORE = 0 def PartyHealReady(self): self.interface.PartyHealReady() def AskSafeboxPassword(self): self.interface.AskSafeboxPassword() # ITEM_MALL def AskMallPassword(self): self.interface.AskMallPassword() def __ItemMall_Open(self): self.interface.OpenItemMall(); def CommandCloseMall(self): self.interface.CommandCloseMall() # END_OF_ITEM_MALL def RefineSuceededMessage(self): snd.PlaySound("sound/ui/make_soket.wav") self.PopupMessage(localeInfo.REFINE_SUCCESS) self.interface.CheckRefineDialog(False) def RefineFailedMessage(self): snd.PlaySound("sound/ui/jaeryun_fail.wav") self.PopupMessage(localeInfo.REFINE_FAILURE) self.interface.CheckRefineDialog(True) def CommandCloseSafebox(self): self.interface.CommandCloseSafebox() # PRIVATE_SHOP_PRICE_LIST def __PrivateShop_PriceList(self, itemVNum, itemPrice, itemPrice2): uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice) uiPrivateShopBuilder.SetPrivateShopItemCheque(itemVNum, itemPrice2) # END_OF_PRIVATE_SHOP_PRICE_LIST def SetPetEvolution(self, evo, type): petname = ["Genc", "Vahsi", "Cesur", "Kahraman"] typename = ["Sakar(1)", "Merakl?2)", "Y?ekli(3)", "Cesur(4)", "G??ara(5)", "Efsanevi(6)", "Mitsi(7)", "Prizmatik(8)"] self.petmain.SetEvolveName(petname[int(evo)], "Pet Tipi: "+typename[int(type)-1]) def SetPetName(self, name): if len(name) > 1 and name != "": self.petmini.Show() self.petmain.SetName(name) def SetPetLevel(self, level): self.petmain.SetLevel(level) def SetPetDuration(self, dur, durt): if int(durt) > 0: self.petmini.SetDuration(dur, durt) self.petmain.SetDuration(dur, durt) def SetPetAgeDuration(self, age): if (int(age)) > 0: self.petmain.SetAgeDuration(age) def SetPetBonus(self, hp, dif, sp): self.petmain.SetHp(hp) self.petmain.SetDef(dif) self.petmain.SetSp(sp) def SetPetskill(self, slot, idx, lv): if int(lv) > 0: self.petmini.SetSkill(slot, idx, lv) self.petmain.SetSkill(slot, idx, lv) self.affectShower.BINARY_NEW_AddAffect(5400+int(idx),int(constInfo.LASTAFFECT_POINT)+1,int(constInfo.LASTAFFECT_VALUE)+1, 0) if int(slot)==0: constInfo.SKILL_PET1=5400+int(idx) if int(slot)==1: constInfo.SKILL_PET2=5400+int(idx) if int(slot)==2: constInfo.SKILL_PET3=5400+int(idx) def SetPetIcon(self, vnum): if int(vnum) > 0: self.petmini.SetImageSlot(vnum) self.petmain.SetImageSlot(vnum) def SetPetExp(self, exp, expi, exptot): if int(exptot) > 0: self.petmini.SetExperience(exp, expi, exptot) self.petmain.SetExperience(exp, expi, exptot) def PetUnsummon(self): self.petmini.SetDefaultInfo() self.petmini.Close() self.petmain.SetDefaultInfo() self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET1),0) self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET2),0) self.affectShower.BINARY_NEW_RemoveAffect(int(constInfo.SKILL_PET3),0) constInfo.SKILL_PET1 = 0 constInfo.SKILL_PET2 = 0 constInfo.SKILL_PET3 = 0 def OpenPetMainGui(self): if self.petmain.IsShow() == True: self.petmain.Close() else: self.petmain.Show() self.petmain.SetTop() def PetType(self, type): PetMsg1 = "" PetMsg2 = "" if (int(type) == 1): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE1 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE11 elif (int(type) == 2): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE2 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE22 elif (int(type) == 3): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE3 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE33 elif (int(type) == 4): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE4 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE44 elif (int(type) == 5): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE5 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE55 elif (int(type) == 6): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE6 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE66 elif (int(type) == 7): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE7 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE77 elif (int(type) == 8): PetMsg1 = localeInfo.PET_ATTR_DETERMINE_TYPE8 PetMsg2 = localeInfo.PET_ATTR_DETERMINE_TYPE88 import uiCommon self.wndPopupDialog2 = uiCommon.SupportInformation() self.wndPopupDialog2.SetWidth(500,105+25) self.wndPopupDialog2.SetText1(PetMsg1) self.wndPopupDialog2.SetText2(PetMsg2) self.wndPopupDialog2.SetAcceptEvent(ui.__mem_func__(self.PetWndClose)) self.wndPopupDialog2.Open(60) def PetChange(self): self.petmain.ChangePetResult() def PetWndClose(self): self.PetWndCloseD() if self.wndPopupDialog2: self.wndPopupDialog2.Hide() self.wndPopupDialog2 = None def PetWndCloseD(self): if not self.wndPopupDialog2: return self.wndPopupDialog2 = None constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) def OpenPetIncubator(self, pet_new = 0): import uipetincubatrice self.petinc = uipetincubatrice.PetSystemIncubator(pet_new) self.petinc.Show() self.petinc.SetTop() def OpenPetMini(self): self.petmini.Show() self.petmini.SetTop() def OpenPetFeed(self): self.feedwind = uipetfeed.PetFeedWindow() self.feedwind.Show() self.feedwind.SetTop() def Gift_Show(self): if constInfo.PET_MAIN == 0: self.petmain.Show() constInfo.PET_MAIN =1 self.petmain.SetTop() else: self.petmain.Hide() constInfo.PET_MAIN =0 def __Horse_HideState(self): self.affectShower.SetHorseState(0, 0, 0) def __Horse_UpdateState(self, level, health, battery): self.affectShower.SetHorseState(int(level), int(health), int(battery)) def __IsXMasMap(self): mapDict = ( "metin2_map_n_flame_01", "metin2_map_n_desert_01", "metin2_map_spiderdungeon", "metin2_map_deviltower1", "chamber_of_wisdom_dungeon", ) if background.GetCurrentMapName() in mapDict: return FALSE return TRUE def __XMasSnow_Enable(self, mode): self.__XMasSong_Enable(mode) if "1"==mode: if not self.__IsXMasMap(): return print "XMAS_SNOW ON" background.EnableSnow(1) else: print "XMAS_SNOW OFF" background.EnableSnow(0) def __XMasBoom_Enable(self, mode): if "1"==mode: if not self.__IsXMasMap(): return print "XMAS_BOOM ON" self.__DayMode_Update("dark") self.enableXMasBoom = TRUE self.startTimeXMasBoom = app.GetTime() else: print "XMAS_BOOM OFF" self.__DayMode_Update("light") self.enableXMasBoom = FALSE def __XMasTree_Enable(self, grade): print "XMAS_TREE ", grade background.SetXMasTree(int(grade)) def __XMasSong_Enable(self, mode): if "1"==mode: print "XMAS_SONG ON" XMAS_BGM = "xmas.mp3" if app.IsExistFile("BGM/" + XMAS_BGM)==1: if musicInfo.fieldMusic != "": snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) musicInfo.fieldMusic=XMAS_BGM snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) else: print "XMAS_SONG OFF" if musicInfo.fieldMusic != "": snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) musicInfo.fieldMusic=musicInfo.METIN2THEMA snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) def __RestartDialog_Close(self): self.interface.CloseRestartDialog() def __Console_Enable(self): constInfo.CONSOLE_ENABLE = TRUE self.consoleEnable = TRUE app.EnableSpecialCameraMode() ui.EnablePaste(TRUE) ## PrivateShop def __PrivateShop_Open(self): constInfo.IS_KASMIR = 0 self.uiNewShop.Show(False) if app.ENABLE_SHOP_DECORATION_SYSTEM: def __PrivateShop_Kasmir_Open(self): constInfo.IS_KASMIR = 1 self.uiNewShopCreate.OpenPrivateShopBuilder() if app.ENABLE_SHOP_DECORATION_SYSTEM: ## Kaþmir Paketi def Kasmir_Paketi_Open(self): constInfo.IS_KASMIR = 1 self.uiNewShop.Show(True) def BINARY_PrivateShop_Appear(self, vid, text, baslik): if chr.GetInstanceType(vid) in [chr.INSTANCE_TYPE_PLAYER, chr.INSTANCE_TYPE_NPC]: self.interface.AppearPrivateShop(vid, baslik, text) def BINARY_PrivateShop_Disappear(self, vid): if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER): self.interface.DisappearPrivateShop(vid) if app.ENABLE_AURA_SYSTEM: def AuraPanel(self, Window, AuraLevel, AuraPos, MaterialPos): if Window != 3: self.interface.AuraSystem(Window, AuraLevel, AuraPos, MaterialPos) else: self.interface.AuraSystemBonus(Window, AuraLevel, AuraPos, MaterialPos) def __PRESERVE_DayMode_Update(self, mode): if "light" == mode: if app.ENABLE_12ZI: if not self.__IsXMasMap(): return # background.SetEnvironmentData(background.DAY_MODE_LIGHT) background.SetEnvironmentData(0) else: background.SetEnvironmentData(0) elif "dark" == mode: if not self.__IsXMasMap(): return # if app.ENABLE_12ZI: # background.RegisterEnvironmentData(background.DAY_MODE_DARK, constInfo.ENVIRONMENT_NIGHT) # background.SetEnvironmentData(background.DAY_MODE_DARK) # else: background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) background.SetEnvironmentData(1) def __DayMode_Update(self, mode): if "light" == mode: if app.ENABLE_12ZI: if not self.__IsXMasMap(): return self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight) elif "dark" == mode: if not self.__IsXMasMap(): return self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark) def __DayMode_OnCompleteChangeToLight(self): if app.ENABLE_12ZI: # background.SetEnvironmentData(background.DAY_MODE_LIGHT) background.SetEnvironmentData(0) else: background.SetEnvironmentData(0) self.curtain.FadeIn() def __DayMode_OnCompleteChangeToDark(self): # if app.ENABLE_12ZI: # background.RegisterEnvironmentData(background.DAY_MODE_DARK, constInfo.ENVIRONMENT_NIGHT) # background.SetEnvironmentData(background.DAY_MODE_DARK) # else: background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) background.SetEnvironmentData(1) self.curtain.FadeIn() if app.ENABLE_12ZI: def BINARY_SetEnvironment(self, idx): self.indexEnv = idx self.curtain.SAFE_FadeOut(self.__SetEnvironment) def __SetEnvironment(self): background.SetEnvironmentData(self.indexEnv) self.curtain.FadeIn() ## XMasBoom def __XMasBoom_Update(self): self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) ) if self.indexXMasBoom >= len(self.BOOM_DATA_LIST): return boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0] boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1] if app.GetTime() - self.startTimeXMasBoom > boomTime: self.indexXMasBoom += 1 for i in xrange(boomCount): self.__XMasBoom_Boom() def __XMasBoom_Boom(self): x, y, z = player.GetMainCharacterPosition() randX = app.GetRandom(-150, 150) randY = app.GetRandom(-150, 150) snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3") def __PartyRequestQuestion(self, vid): vid = int(vid) partyRequestQuestionDialog = uiCommon.QuestionDialog() partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT) partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT) partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY) partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerPartyRequest(arg)) partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerPartyRequest(arg)) partyRequestQuestionDialog.Open() partyRequestQuestionDialog.vid = vid self.partyRequestQuestionDialog = partyRequestQuestionDialog def __AnswerPartyRequest(self, answer): if not self.partyRequestQuestionDialog: return vid = self.partyRequestQuestionDialog.vid if answer: net.SendChatPacket("/party_request_accept " + str(vid)) else: net.SendChatPacket("/party_request_deny " + str(vid)) self.partyRequestQuestionDialog.Close() self.partyRequestQuestionDialog = None def __PartyRequestDenied(self): self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED) def __EnableTestServerFlag(self): app.EnableTestServerFlag() def __InGameShop_Show(self, url): if constInfo.IN_GAME_SHOP_ENABLE: self.interface.OpenWebWindow(url) # WEDDING def __LoginLover(self): if self.interface.wndMessenger: self.interface.wndMessenger.OnLoginLover() def __LogoutLover(self): if self.interface.wndMessenger: self.interface.wndMessenger.OnLogoutLover() if self.affectShower: self.affectShower.HideLoverState() def __LoverNear(self): if self.affectShower: self.affectShower.ShowLoverState() def __LoverFar(self): if self.affectShower: self.affectShower.HideLoverState() def __LoverDivorce(self): if self.interface.wndMessenger: self.interface.wndMessenger.ClearLoverInfo() if self.affectShower: self.affectShower.ClearLoverState() def __PlayMusic(self, flag, filename): flag = int(flag) if flag: snd.FadeOutAllMusic() musicInfo.SaveLastPlayFieldMusic() snd.FadeInMusic("BGM/" + filename) else: snd.FadeOutAllMusic() musicInfo.LoadLastPlayFieldMusic() snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) # END_OF_WEDDING if app.ENABLE_DEFENSE_WAVE: def BINARY_Update_Mast_HP(self, hp, max): self.interface.BINARY_Update_Mast_HP(hp, max) def BINARY_Update_Mast_Window(self, i, time): self.interface.BINARY_Update_Mast_Window(int(i)) if int(time) != 0: if self.wndShipImageCoolTime: self.wndShipImageCoolTime.Open() def BINARY_Update_Mast_Floor(self, arg): self.wndShipImageCoolTime.SetFloor(arg) if app.ENABLE_SEND_TARGET_INFO: def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount): if not raceNum in constInfo.MONSTER_INFO_DATA: constInfo.MONSTER_INFO_DATA.update({raceNum : {}}) constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []}) curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"] isUpgradeable = False isMetin = False item.SelectItem(itemVnum) if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR: isUpgradeable = True elif item.GetItemType() == item.ITEM_TYPE_METIN: isMetin = True for curItem in curList: if isUpgradeable: if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10: if not (itemVnum in curItem["vnum_list"]): curItem["vnum_list"].append(itemVnum) return elif isMetin: if curItem.has_key("vnum_list"): baseVnum = curItem["vnum_list"][0] if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000): if not (itemVnum in curItem["vnum_list"]): curItem["vnum_list"].append(itemVnum) return else: if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount: return if isUpgradeable or isMetin: curList.append({"vnum_list":[itemVnum], "count":itemCount}) else: curList.append({"vnum":itemVnum, "count":itemCount}) def BINARY_RefreshTargetMonsterDropInfo(self, raceNum): self.targetBoard.RefreshMonsterInfoBoard() def NewShop(self): if self.uiNewShop: self.uiNewShop.Show(constInfo.IS_KASMIR) def ShopClear(self): if self.uiNewShop: self.uiNewShop.HideAll() constInfo.MyShops=[] def ShopCostClear(self): constInfo.shop_cost=[] def ShopCost(self,id,time,time_val,price): constInfo.shop_cost.append({"id":int(id),"time":int(time),"time_val":int(time_val),"price":int(price)}) def ShopAdd(self,shop_id,shop_vid,szSign,gold,won,count,sold,days,date_close): if self.uiNewShop: shop={ "id":shop_id, "vid":shop_vid, "name":szSign.replace("\\"," ").replace("_","#"), "gold":gold, "won":won, "sold":sold, "items":int(count)-int(sold), "days":days, "time":date_close } self.uiNewShop.Load(shop) constInfo.MyShops.append(shop) def ShopItemClear(self): if self.uiNewShop: self.uiNewShop.ClearItems() def ClosePrivateShopDialog(self): if self.uiNewShopCreate: self.uiNewShopCreate.ClosePrivateShopBuilder() def ShopItem(self,data): d=data.split("#") id=d[0] vnum=d[1] count=d[2] slot=d[3] price=d[4] cheque=d[5] transmutation=d[6] s=d[7] a=d[8] sockets=[] for key in s.split("|"): sockets.append(int(key)) attrs=[] for key in a.split("|"): a=key.split(",") attrs.append([int(a[0]),int(a[1])]) if self.uiNewShop: self.uiNewShop.AddItem(slot,{"id":id,"vnum":vnum,"count":count,"price":price,"cheque":cheque,"transmutation":transmutation,"sockets":sockets,"attrs":attrs}) ####GIFT SYSTEM##### def gift_clear(self): constInfo.gift_items={} self.interface.ClearGift() def gift_item(self, id, vnum, count, pos, date_add, give, reason, transmutation, szSockets, szAttrs): sockets=[] for key in szSockets.split("|"): sockets.append(int(key)) attrs=[] for key in szAttrs.split("|"): a=key.split(",") attrs.append([int(a[0]),int(a[1])]) constInfo.gift_items[int(pos)]={"id":int(id),"vnum":int(vnum),"count":int(count),"pos":int(pos),"date_add":int(date_add),"reason":reason.replace("_"," "),"give":give.replace("_"," "),"transmutation":transmutation,"sockets":sockets,"attrs":attrs} def gift_load(self): self.interface.wndGiftBox.Refresh() def gift_show(self,pages): self.interface.wndGiftBox.pageNum=int(pages) self.interface.OpenGift() # def DungeonBugBtnOpen(self): # self.interface.ShowDungeonBtn() # def DungeonBugBtnHide(self): # self.interface.HideDungeonBtn() def PopupShopTradeInformation(self, price): text = localeInfo.SELL_SHOP_PLAYER_TEXT1 + localeInfo.NumberToMoneyString(int(price)) + localeInfo.SELL_SHOP_PLAYER_TEXT2 self.onlinePopup = uiCommon.OnlinePopup() self.onlinePopup.SetUserName(text, "d:/ymir work/ui/game/windows/money_icon.sub") #self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name) self.onlinePopup.SlideIn() def EventCalendarWindow(self): if self.interface: self.interface.OpenCalendarWin() if app.ENABLE_MELEY_LAIR_DUNGEON: def OpenMeleyRanking(self): if self.interface: self.interface.OpenMeleyRanking() def AddRankMeleyRanking(self, data): if self.interface: line = int(data.split("#")[1]) name = str(data.split("#")[2]) members = int(data.split("#")[3]) seconds = int(data.split("#")[4]) minutes = seconds // 60 seconds %= 60 if seconds > 0: time = localeInfo.TIME_MIN_SEC % (minutes, seconds) else: time = localeInfo.TIME_MIN % (minutes) self.interface.RankMeleyRanking(line, name, members, time) if app.ENABLE_CHANGELOOK_SYSTEM: def ActChangeLook(self, iAct): if self.interface: self.interface.ActChangeLook(iAct) def AlertChangeLook(self): self.PopupMessage(localeInfo.CHANGE_LOOK_DEL_ITEM) if app.ENABLE_SHOP_SEARCH_SYSTEM: def OpenPrivateShopSearch(self, type): if self.interface: self.interface.OpenPrivateShopSearch(type) def ShopSearchOpenNew(self,arg): if int(arg) == 0: import uiCommon self.wndPopupDialog = uiCommon.SupportInformation() self.wndPopupDialog.SetWidth(500,105+25) self.wndPopupDialog.SetText1("Bu sistem sadece belirli haritalarda") self.wndPopupDialog.SetText2("K?m??Mavi,Sar?1. ve 2. k?lerde ?lýþ?") self.wndPopupDialog.SetAcceptEvent(ui.__mem_func__(self.SupportInformationWndClose)) self.wndPopupDialog.Open(10) elif int(arg) == 1: import uiCommon self.wndPopupDialog = uiCommon.SupportInformation() self.wndPopupDialog.SetWidth(500,105+25) self.wndPopupDialog.SetText1("Açýk olan pencerelerin hepsini kapatmal??") self.wndPopupDialog.SetText2("aksi taktirde bu sistemi kullanamazs?!") self.wndPopupDialog.SetAcceptEvent(ui.__mem_func__(self.SupportInformationWndClose)) self.wndPopupDialog.Open(10) elif int(arg) == 3: self.AverageSearchOpen() else: if self.interface: self.interface.OpenPrivateShopSearch(2) def RefreshShopSearch(self): self.interface.RefreshShopSearch() def BuyShopSearch(self): self.interface.RefreshRequest() self.PopupMessage(localeInfo.PRIVATESHOPSEARCH_BUY_SUCCESS) if app.ENABLE_EVENT_INFORMATION_SYSTEM: def OnRecvEventInformation(self): if self.interface: self.interface.RefreshEventWindowDialog() def RenderTargetGuiOpen(self): import targetTest self.Dialo = targetTest.Dialog1() self.Dialo.Show() if app.BLANKA_SD_RANGE_BIYOLOG: def __BiyologMission(self, mission, missionState, givenCount, needCount, remainingTime): if self.interface: self.interface.SetBiyologMission(mission, missionState, givenCount, needCount, remainingTime) def BiyologOpen(self): if self.interface: self.interface.OpenBiyologDialog() def BiyologLvBildirim(self, veri): self.bildirim = uiCommon.Bildirim() self.bildirim.SetUserName(str(veri) + localeInfo.BIYOLOG_BILDIRIM) self.bildirim.SlideIn() def open_select_skill_window(self, job): if self.interface: self.interface.OpenSelectSkillWindow(job) def SDEventCalenderGuiOpen(self): if not self.uiGuiEventPage: self.uiGuiEventPage = ogs_takvim.eventsystemwindow() self.uiGuiEventPage.Show() def SDEventCalendarQuestGuiWindow(self): if self.interface: self.interface.SDOpenEventCalendarQuestGuiWindow() def SDBlankaMenuOpen(self): import uiblankamenu self.Gui = uiblankamenu.BlankaMenuWindow() #self.Gui.Show() if FALSE == self.Gui.IsShow(): self.Gui.Show() else: self.Gui.Close() def OpenSupportShamanGui(self): if constInfo.SUPPORTSHAMAN_GUI == 0: self.support_shaman.Show() self.support_shaman.SetTop() constInfo.SUPPORTSHAMAN_GUI = 1 else: self.support_shaman.Close() constInfo.SUPPORTSHAMAN_GUI = 0 def SupportShamanSeviye(self, level): self.support_shaman.SetSeviye(level) constInfo.YARDIMCILEVEL = int(level) def SupportShamanArkaplan(self): self.support_shaman.ArkaplanBilgi() self.support_shaman.Close() def SupportShamanZeka(self , ints): self.support_shaman.ZekaOrani(ints) def SupportShamanExp(self, exp, exptot): if int(exptot) > 0: self.support_shaman.SetDeneyim(exp, exptot) self.support_shaman.SetDeneyim(exp, exptot) def SupportShamanIcon(self, vnum): if int(vnum) > 0: self.support_shaman.SetYuzukIcon(vnum) self.support_shaman.SetYuzukIcon(vnum) def SupportShamanDerece(self,tasvirderece): self.support_shaman.SetDerece(tasvirderece) if app.ENABLE_SWITCHBOT: def RefreshSwitchbotWindow(self): self.interface.RefreshSwitchbotWindow() def RefreshSwitchbotItem(self, slot): self.interface.RefreshSwitchbotItem(slot) if app.ENABLE_SASH_SYSTEM: def ActSash(self, iAct, bWindow): if self.interface: self.interface.ActSash(iAct, bWindow) def AlertSash(self, bWindow): snd.PlaySound("sound/ui/make_soket.wav") if bWindow: self.PopupMessage(localeInfo.SASH_DEL_SERVEITEM) else: self.PopupMessage(localeInfo.SASH_DEL_ABSORDITEM) def BINARY_Item_Combination_Open(self, npcVNUM): if app.ENABLE_ITEM_COMBINATION_SYSTEM: self.interface.OpenItemCombinationWindow() def BINARY_Item_Combination_Succeed(self): if app.ENABLE_ITEM_COMBINATION_SYSTEM: self.interface.SucceedItemCombinationWork() pass def BINARY_Skill_Book_Combination_Open(self, npcVNUM): return # if app.ENABLE_ITEM_COMBINATION_SYSTEM: # self.interface.OpenSkillBookCombinationWindow() def BINARY_Skill_Book_Combination_Succeed(self): if app.ENABLE_ITEM_COMBINATION_SYSTEM: self.interface.SucceedSkillBookCombinationWork() pass def BINARY_Combination_Close(self): if app.ENABLE_ITEM_COMBINATION_SYSTEM: self.interface.CloseCombinationWindow() def ruhcac(self): self.ruhtasi.Show() def sageruhcac(self): self.sageruhtasi.Show() def AverageSearchOpen(self): self.average_price.Show() def bkac(self): self.bkoku.Show() def biyoodulac(self, gorev, af1, afv1, af2, afv2, af3, afv3): self.biyoekran.Show() self.biyoekran.SetBaslik(str(gorev)) self.biyoekran.SetOdul(af1,afv1,af2,afv2,af3,afv3) def SetLanguage(self, arg): constInfo.LANGUAGE_SELECT_FLAG = str(arg) def StoneEvent(self, arg): if 1 == int(arg): self.stone_event.Show() else: self.stone_event.Hide() def biyologekrankapa(self): self.biyoekran.Close() def biyolog(self, bioitem, verilen, toplam, kalansure): self.interface.SetBiyolog(bioitem, verilen, toplam, kalansure) ## MiniMap Map Name def BINARY_ShowMapNameMiniMap(self, mapName): if self.interface: self.interface.SetMapName(mapName) try: mapNameT = localeInfo.MINIMAP_ZONE_NAME_DICT[mapName] self.interface.wndMiniMap.UpdateMapName(mapNameT, True) except: self.interface.wndMiniMap.UpdateMapName("Bilinmeyen B?ge", True) def BINARY_ReceiveChannel(self, channel): if self.interface: if self.interface.wndMiniMap: self.interface.wndMiniMap.UpdateChannelInfo(channel) constInfo.channel_idx = channel def Kamera_func_on(self): x, y, z = player.GetMainCharacterPosition() app.SetCameraSetting(int(x), int(-y), int(z), 5000, 10, 30) def Kamera_func_off(self): app.SetDefaultCamera() def __SetCurrentOnline(self, count, shop_count): pass # def get_skills(self,job): # if constInfo.SKILL_SELECT_POINTER == 1: # return # import select_warriorskills # import select_assassinskills # import select_suraskills # import select_shamanskills # import select_wolfmanskills # self.select_skill = None # if chr.GetRace() == 0 or chr.GetRace() == 4: # self.select_skill = select_warriorskills.MainWindow() # elif chr.GetRace() == 1 or chr.GetRace() == 5: # self.select_skill = select_assassinskills.MainWindow() # elif chr.GetRace() == 2 or chr.GetRace() == 6: # self.select_skill = select_suraskills.MainWindow() # elif chr.GetRace() == 3 or chr.GetRace() == 7: # self.select_skill = select_shamanskills.MainWindow() # elif chr.GetRace() == 8: # self.select_skill = select_wolfmanskills.MainWindow() # self.select_skill.OpenWindow() # constInfo.SKILL_SELECT_POINTER = 1 # def CloseSkill(self): # self.skillQuestionDialog.Hide() # self.skillQuestionDialog = None # constInfo.SKILL_SELECT_POINTER = 0 def RequestJob(self, answer): if not self.skillQuestionDialog: return if answer: net.SendChatPacket("/skill_select 1") else: net.SendChatPacket("/skill_select 2") chat.AppendChat(chat.CHAT_TYPE_INFO, "Skill grubu se?ldi.") self.skillQuestionDialog.Close() self.skillQuestionDialog = None constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0) def BINARY_Appear_HP(self, vid, hpPercentage): if app.ENABLE_HEALTH_BOARD_SYSTEM: self.newPlayerGauge.RefreshGauge(vid, hpPercentage) def ExInvenItemUseMsg(self, current_stage, need_left, need_count): if app.ENABLE_EXTEND_INVEN_SYSTEM: self.interface.ExInvenItemUseMsg(current_stage, need_left, need_count) def OnRecvExchangeInfo(self, unixTime, isError, info): if app.ENABLE_EXCHANGE_WINDOW_SYSTEM: if isError == 1: error = True else: error = False self.interface.ExchangeInfo(unixTime, info, error) def BINARY_RecvGameConfig(self, health, sash, costume, costume_w, costume_h): constInfo.CONFIG_HIDE_HEALTH_BOARD = int(health) constInfo.CONFIG_HIDE_SASH = int(sash) constInfo.CONFIG_HIDE_COSTUME = int(costume) constInfo.CONFIG_HIDE_COSTUME_W = int(costume_w) constInfo.CONFIG_HIDE_COSTUME_H = int(costume_h) net.SendChatPacket("/costume_config {0}".format(int(costume))) net.SendChatPacket("/costume_w_config {0}".format(int(costume_w))) net.SendChatPacket("/costume_h_config {0}".format(int(costume_h))) ##def OpenUI12zi(self, yellowmark, greenmark, yellowreward, greenreward, goldreward): ## self.interface.OpenUI12zi(yellowmark, greenmark, yellowreward, greenreward, goldreward) # def Refresh12ziTimer(self, currentFloor, jumpCount, limitTime, elapseTime): # self.interface.Refresh12ziTimer(currentFloor, jumpCount, limitTime, elapseTime) # def Show12ziJumpButton(self): # self.interface.Show12ziJumpButton() # def Hide12ziTimer(self): # self.interface.Hide12ziTimer() # def OpenReviveDialog(self, vid, itemcount): # self.targetBoard.OpenReviveDialog(vid, itemcount); # def RefreshShopItemToolTip(self): # self.interface.RefreshShopItemToolTip() def ChineseTempleMissionMessage(self, isClear): if isClear: self.BINARY_CleanMissionMessage() else: self.interface.missionBoard.SetMission("Gelen canavarlari dakika icrisinde yoket!") def WarpTest(self): background.Destroy() background.Initialize() background.WarpTest(4742, 9544); background.RegisterEnvironmentData(0, "d:/ymir work/environment/b3.msenv") background.SetEnvironmentData(0) background.SetShadowLevel(background.SHADOW_ALL) def video_listem_yenile(self): constInfo.fav_listim = [] def youtuber_listesi_yenile(self): constInfo.youtuber_list = [] def youtuber_video_listesi_yenile(self): constInfo.youtuber_video_list = [] def video_listem(self, baslik, link): constInfo.fav_listim.append("#"+baslik+"#"+link) def youtuber_listesi(self, kim): constInfo.youtuber_list.append("#"+kim) def youtuber_video_listesi(self, baslik, link): constInfo.youtuber_video_list.append("#"+baslik+"#"+link) def __video_izle(self): val = int(len(constInfo.LINK_PLUS)) if val < 3: chat.AppendChat(5, localeInfo.YOUTUBER_LINK_LEN_NOT_ENOUGH) return url = "http://siberdizayn.com.tr/" % str(constInfo.LINK_PLUS) self.interface.OpenYoutubeWebWindow(url) def __YoutuberListele(self): import uiYoutubeFavList self.youtuberlistdialog=uiYoutubeFavList.YoutuberListSelectDialog() self.youtuberlistdialog.Open() def YoutuberKimdir(self): pass def RecvOfflineMessage(self, x): txt = str(x) nick = txt.split("_")[0] zamanex = txt.split("_")[1] mesaj = txt.split("_")[2] mesaj = mesaj.replace("$", " ") zaman = datetime.datetime.fromtimestamp(int(zamanex)).strftime('%d-%m-%Y %H:%M:%S') chat.AppendToBox(chat.WHISPER_TYPE_CHAT, nick, "|cffff0000|H|h[OFFMSG-%s]:|h|r %s" % (zaman, mesaj)) self.interface.RecvWhisper(nick) def BINARY_OpenGuildWarHistory(self): self.interface.OpenGuildWarHistory() def BINARY_SIBERDIZAYN_GUILD_RANKED_SYSTEM(self, name, master, win, loss): self.interface.SetGuildRankedData(name, master, win, loss) def OpenBossTracking(self): self.bosstracking.Open() #constInfo.BUFF_VISIBLE = 1: def CloseBossTracking(self): self.bosstracking.__OnClose() def BINARY_SIBERDIZAYN_BOSS_TRACKING(self, kill_time, start_time, channel, mob_vnum, map_index): self.bosstracking.SetData(kill_time, start_time, channel, mob_vnum, map_index) def BINARY_AVERAGE_SYSTEM(self, vnum, price, won): self.average_price.SetData(vnum, price, won) if app.ENABLE_FISH_EVENT_SYSTEM: def MiniGameFishEvent(self, isEnable, lasUseCount): if self.interface: self.interface.SetFishEventStatus(isEnable) self.interface.MiniGameFishCount(lasUseCount) def MiniGameFishUse(self, shape, useCount): self.interface.MiniGameFishUse(shape, useCount) def MiniGameFishAdd(self, pos, shape): self.interface.MiniGameFishAdd(pos, shape) def MiniGameFishReward(self, vnum): self.interface.MiniGameFishReward(vnum) if app.ENABLE_MAILBOX_SYSTEM: def BINARY_RecvMailBox(self, mail_id, sender_name, title, pos, type): if self.interface: self.interface.RecvMailBox(mail_id, sender_name, title, pos, type) def BINARY_RecvMailBoxGold(self, mail_id, gold): if self.interface: self.interface.RecvMailBoxGold(mail_id, gold) def BINARY_RecvMailBoxCheque(self, mail_id, cheque): if self.interface: self.interface.RecvMailBoxCheque(mail_id, cheque) def BINARY_RecvMailBoxItem(self, mail_id, item_vnum, item_count, item_socket0, item_socket1, item_socket2, item_socket3, item_transmutation, item_attrtype0, item_attrvalue0, item_attrtype1, item_attrvalue1, item_attrtype2\ ,item_attrvalue2, item_attrtype3, item_attrvalue3, item_attrtype4, item_attrvalue4, item_attrtype5, item_attrvalue5, item_attrtype6, item_attrvalue6, item_attrtype7, item_attrvalue7, item_attrtype8, item_attrvalue8\ ,item_attrtype9, item_attrvalue9, item_attrtype10, item_attrvalue10, item_attrtype11, item_attrvalue11, item_attrtype12, item_attrvalue12, item_attrtype13, item_attrvalue13, item_attrtype14, item_attrvalue14): if self.interface: self.interface.RecvMailBoxItem(mail_id, item_vnum, item_count, item_socket0, item_socket1, item_socket2, item_socket3, item_transmutation, item_attrtype0, item_attrvalue0, item_attrtype1, item_attrvalue1, item_attrtype2, item_attrvalue2, item_attrtype3, item_attrvalue3, item_attrtype4, item_attrvalue4, item_attrtype5, item_attrvalue5, item_attrtype6, item_attrvalue6, item_attrtype7, item_attrvalue7, item_attrtype8, item_attrvalue8, item_attrtype9, item_attrvalue9, item_attrtype10, item_attrvalue10, item_attrtype11, item_attrvalue11, item_attrtype12, item_attrvalue12, item_attrtype13, item_attrvalue13, item_attrtype14, item_attrvalue14) def MailBoxRefresh(self): if self.interface: self.interface.MailBoxRefresh() def MailBoxOpen(self): if app.GetTime() > self.MailBoxOpenT: if self.interface: self.interface.OpenmMailBox() self.MailBoxOpenT = app.GetTime() + 10 else: NewGetTime = self.MailBoxOpenT - app.GetTime() chat.AppendChat(chat.CHAT_TYPE_INFO, "Tekrar a?bilmek i?n %d saniye beklemelisin." % (NewGetTime)) def MailBoxMiniMap(self, read, unread): self.interface.SetMailBoxMiniMap(read, unread) def AchievementPoint(self, point): if self.achievement: if not self.achievement.IsShow(): self.achievement.Close() def BINARY_OpenKeyboardSettings(self): if self.dlgKeyboardSettings.IsShow(): self.dlgKeyboardSettings.Close() else: self.dlgKeyboardSettings.Open() if app.ENABLE_DAMAGE_TOP: def BINARY_DamageTopOpen(self): if self.interface: self.interface.DamageTopOpen() def BINARY_DamageTopRefresh(self): if self.interface: self.interface.DamageTopRefresh() def BINARY_DamageTopAddMember(self, type, position, name, level, empire, victim, damage): if self.interface: self.interface.DamageTopAddMember(type, position, name, level, empire, victim, damage) #### GuildSafeBox ##def OpenGuildSafeboxWindow(self, size): ## self.interface.OpenGuildSafeboxWindow(size) def RefreshGuildSafebox(self): self.interface.RefreshGuildSafebox() def RefreshGuildSafeboxMoney(self): self.interface.RefreshGuildSafeboxMoney() #def CloseGuildSafeboxWindow(self): # self.interface.wndGuildSafebox.CommandCloseGuildSafebox() def BINARY_SetMissionMessage(self, message): self.interface.missionBoard.SetMission(message) def BINARY_SetSubMissionMessage(self, message): self.interface.missionBoard.SetSubMission(message) def BINARY_CleanMissionMessage(self): self.interface.missionBoard.CleanMission() if app.ENABLE_ATTENDANCE_EVENT: def MiniGameAttendanceEvent(self, isEnable): if self.interface: self.interface.SetAttendanceEventStatus(isEnable) def MiniGameAttendanceSetData(self, type, value): self.interface.MiniGameAttendanceSetData(type, value) def RefreshHitCount(self, vid): if vid == self.targetBoard.GetTargetVID(): self.targetBoard.RefreshHitCount(vid) def __premium(self): if constInfo.premiumgoster == 1: self.affectShower.Show() elif constInfo.premiumgoster == 0: self.affectShower.Hide() if app.ENABLE_BLUE_GEM_SYSTEM: def OpenGemShop(self): if self.interface: self.interface.OpenGemShop() def CloseGemShop(self): if self.interface: self.interface.CloseGemShop() def RefreshGemShop(self): if self.interface: self.interface.RefreshGemShop() if app.ENABLE_RED_GEM_SYSTEM: def OpenRedGemShop(self): if self.interface: self.interface.OpenRedGemShop() def CloseRedGemShop(self): if self.interface: self.interface.CloseRedGemShop() def RefreshRedGemShop(self): if self.interface: self.interface.RefreshRedGemShop() class Component: def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual): button = ui.Button() if parent != None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(UpVisual) button.SetOverVisual(OverVisual) button.SetDownVisual(DownVisual) button.SetText(buttonName) button.SetToolTipText(tooltipText) button.Show() button.SetEvent(func) return button def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual): button = ui.ToggleButton() if parent != None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(UpVisual) button.SetOverVisual(OverVisual) button.SetDownVisual(DownVisual) button.SetText(buttonName) button.SetToolTipText(tooltipText) button.Show() button.SetToggleUpEvent(funcUp) button.SetToggleDownEvent(funcDown) return button def EditLine(self, parent, editlineText, x, y, width, heigh, max): SlotBar = ui.SlotBar() if parent != None: SlotBar.SetParent(parent) SlotBar.SetSize(width, heigh) SlotBar.SetPosition(x, y) SlotBar.Show() Value = ui.EditLine() Value.SetParent(SlotBar) Value.SetSize(width, heigh) Value.SetPosition(1, 1) Value.SetMax(max) Value.SetLimitWidth(width) Value.SetMultiLine() Value.SetText(editlineText) Value.Show() return SlotBar, Value def EditLine2(self, parent, editlineText, x, y, width, heigh, max): SlotBar = ui.SlotBar() if parent != None: SlotBar.SetParent(parent) SlotBar.SetSize(width, heigh) SlotBar.SetPosition(x, y) SlotBar.Show() Value = ui.EditLine() Value.SetParent(SlotBar) Value.SetSize(width, heigh) Value.SetPosition(1, 1) Value.SetMax(120) Value.SetLimitWidth(width) Value.SetMultiLine() Value.SetText(editlineText) Value.Show() return SlotBar, Value def TextLine(self, parent, textlineText, x, y, color): textline = ui.TextLine() if parent != None: textline.SetParent(parent) textline.SetPosition(x, y) if color != None: textline.SetFontColor(color[0], color[1], color[2]) textline.SetText(textlineText) textline.Show() return textline def RGB(self, r, g, b): return (r*255, g*255, b*255) def SliderBar(self, parent, sliderPos, func, x, y): Slider = ui.SliderBar() if parent != None: Slider.SetParent(parent) Slider.SetPosition(x, y) Slider.SetSliderPos(sliderPos / 100) Slider.Show() Slider.SetEvent(func) return Slider def ExpandedImage(self, parent, x, y, img): image = ui.ExpandedImageBox() if parent != None: image.SetParent(parent) image.SetPosition(x, y) image.LoadImage(img) image.Show() return image def ComboBox(self, parent, text, x, y, width): combo = ui.ComboBox() if parent != None: combo.SetParent(parent) combo.SetPosition(x, y) combo.SetSize(width, 15) combo.SetCurrentItem(text) combo.Show() return combo def ThinBoard(self, parent, moveable, x, y, width, heigh, center): thin = ui.ThinBoard() if parent != None: thin.SetParent(parent) if moveable == TRUE: thin.AddFlag('movable') thin.AddFlag('float') thin.SetSize(width, heigh) thin.SetPosition(x, y) if center == TRUE: thin.SetCenterPosition() thin.Show() return thin def Gauge(self, parent, width, color, x, y): gauge = ui.Gauge() if parent != None: gauge.SetParent(parent) gauge.SetPosition(x, y) gauge.MakeGauge(width, color) gauge.Show() return gauge def ListBoxEx(self, parent, x, y, width, heigh): bar = ui.Bar() if parent != None: bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(width, heigh) bar.SetColor(0x77000000) bar.Show() ListBox=ui.ListBoxEx() ListBox.SetParent(bar) ListBox.SetPosition(0, 0) ListBox.SetSize(width, heigh) ListBox.Show() scroll = ui.ScrollBar() scroll.SetParent(ListBox) scroll.SetPosition(width-15, 0) scroll.SetScrollBarSize(heigh) scroll.Show() ListBox.SetScrollBar(scroll) return bar, ListBox