import os import app import dbg import grp import item import background import chr import chrmgr import uibkoku import uiruhtasi import ticket if app.ENABLE_ADMIN_BAN_MANAGER: import uiadmintool import uiticket import uiloncaskor import uievent import uibiyolog import player import guildwarkillcounter import snd import uiimp import chat import uinpcekran import textTail import snd import net import effect import wndMgr import fly import systemSetting import quest import guild import skill import messenger import localeInfo import constInfo import exchange import ime import translate import ui import uiCommon import uiPhaseCurtain import uiMapNameShower import uiAffectShower import uiPlayerGauge import uiCharacter import uiTarget import time import savbec import surabec import ninjabec import samanbec import lycanbec # PRIVATE_SHOP_PRICE_LIST import uiPrivateShopBuilder import uiOfflineShopBuilder import uiOfflineShop # END_OF_PRIVATE_SHOP_PRICE_LIST import mouseModule import consoleModule import localeInfo import playerSettingModule import interfaceModule import musicInfo import debugInfo import uipetsystem import stringCommander import BKTrade import event import uilocalization from _weakref import proxy kisi = "" oyunagirdi = 0 oyunagirdibeklemesuresi = 2 oyunagirdiglobaltimesuresi = app.GetTime() - 2 # SCREENSHOT_CWDSAVE SCREENSHOT_CWDSAVE = FALSE SCREENSHOT_DIR = None if localeInfo.IsEUROPE(): SCREENSHOT_CWDSAVE = TRUE if localeInfo.IsCIBN10(): SCREENSHOT_CWDSAVE = FALSE SCREENSHOT_DIR = "YT2W" cameraDistance = 1550.0 cameraPitch = 27.0 cameraRotation = 0.0 cameraHeight = 100.0 testAlignment = 0 BPisLodaded = 0 class GameWindow(ui.ScriptWindow): def __init__(self, stream): ui.ScriptWindow.__init__(self, "GAME") self.SetWindowName("game") net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self) player.SetGameWindow(self) self.quickSlotPageIndex = 0 self.lastPKModeSendedTime = 0 self.menusuresi = 0 self.endTime = 0 self.YavasBasTime = 0 self.pressNumber = None self.loncaskorr = uiloncaskor.LoncaSkor() self.loncaskorr.Hide() self.guildWarQuestionDialog = None self.interface = None self.targetBoard = None self.console = None self.mapNameShower = None self.affectShower = None self.playerGauge = None self.stream=stream self.interface = interfaceModule.Interface() self.interface.SetStream(self.stream) self.interface.MakeInterface() self.interface.ShowDefaultWindows() self.impekran = uiimp.impDialog() self.stream.isAutoSelect = 0 self.curtain = uiPhaseCurtain.PhaseCurtain() self.curtain.speed = 0.03 self.curtain.Hide() self.BKTradeSys = BKTrade.BKTrade() self.BKTradeSys.Close() self.targetBoard = uiTarget.TargetBoard() self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog)) self.targetBoard.Hide() self.EventButton = uievent.EventButton() self.EventButton.LoadWindow() self.EventButton.Hide() self.petmain = uipetsystem.PetSystemMain() self.petmini = uipetsystem.PetSystemMini() self.biyoekran = uibiyolog.BiyologEkran() self.biyoekran.Hide() import uiexchange self.ticaret = uiexchange.ExchangeDialog() self.ticaret.Hide() import uiticket self.wndTicket = uiticket.TicketBoard() self.wndTicketStaff = uiticket.TicketBoardAdmin() self.wndTicketReply = uiticket.TicketBoardInformationsID() self.console = consoleModule.ConsoleWindow() self.console.BindGameClass(self) self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200) self.console.Hide() self.mapNameShower = uiMapNameShower.MapNameShower() self.affectShower = uiAffectShower.AffectShower() if app.ENABLE_ADMIN_BAN_MANAGER: self.wndAdminTool = uiadmintool.AdminTool() self.playerGauge = uiPlayerGauge.PlayerGauge(self) self.playerGauge.Hide() self.wndPlayerLocalization = uilocalization.Initializate() self.guildScoreCounter = guildwarkillcounter.MessageQueue() #wj 2014.1.2. ESC?? ?? ? ????? DropQuestionDialog? ??? ????. ??? ??? itemDropQuestionDialog? ???? ?? ?? ERROR? ???? init?? ??? ??? ??? ??. self.itemDropQuestionDialog = None self.bkoku = uibkoku.BKOku() self.bkoku.Hide() self.ruhtasi = uiruhtasi.RuhTasi() self.ruhtasi.Hide() self.npcekran = uinpcekran.NPCEkran() self.npcekran.Hide() self.titletimer = 0 self.__SetQuickSlotMode() self.__ServerCommand_Build() self.__ProcessPreservedServerCommand() def __del__(self): player.SetGameWindow(0) net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self) ui.ScriptWindow.__del__(self) def Open(self): app.SetFrameSkip(1) self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) 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 self.interface.ToggleMessenger() self.interface.ToggleMessenger() self.GirdiButton = ui.Button() self.GirdiButton.SetParent(self) self.GirdiButton.SetUpVisual("onlineboard.tga") self.GirdiButton.SetOverVisual("onlineboard.tga") self.GirdiButton.SetDownVisual("onlineboard.tga") self.GirdiButton.SetPosition(wndMgr.GetScreenWidth() - 150 - 50 + 30, wndMgr.GetScreenHeight() - 360) self.TextLines = ui.TextLine() self.TextLines.SetParent(self.GirdiButton) self.TextLines.SetPosition(35,5) self.TextLines.SetText("") self.TextLines.Show() 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 import event 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() self.__BuildDebugInfo() # PRIVATE_SHOP_PRICE_LIST uiPrivateShopBuilder.Clear() # END_OF_PRIVATE_SHOP_PRICE_LIST uiOfflineShopBuilder.Clear() # UNKNOWN_UPDATE exchange.InitTrading() # END_OF_UNKNOWN_UPDATE if debugInfo.IsDebugMode(): self.ToggleDebugInfo() self.kill_gui = 0 self.kill_gui_board = ui.ThinBoard() self.kill_gui_board.SetParent(self) # self.kill_gui_board.SetSize(255,110) self.kill_gui_board.SetSize(255,90) self.kill_gui_board.SetPosition(100, wndMgr.GetScreenHeight() - 200) self.kill_gui_board.Hide() self.kill_gui_board.x_counter = 450 self.red_img = ui.ExpandedImageBox() self.red_img.SetParent(self.kill_gui_board) self.red_img.LoadImage("news/kirmizi2.tga") self.red_img.SetPosition(10, 10) self.red_img.Show() self.yellow_img = ui.ExpandedImageBox() self.yellow_img.SetParent(self.kill_gui_board) self.yellow_img.LoadImage("news/sari2.tga") self.yellow_img.SetPosition(90, 10) self.yellow_img.Show() self.blue_img = ui.ExpandedImageBox() self.blue_img.SetParent(self.kill_gui_board) self.blue_img.LoadImage("news/mavi2.tga") self.blue_img.SetPosition(170, 10) self.blue_img.Show() self.red_kill_count_text = ui.TextLine() self.red_kill_count_text.SetParent(self.kill_gui_board) self.red_kill_count_text.SetPosition(30,50) self.red_kill_count_text.SetText("Skor : "+str(constInfo.imp_savasi["kirmiziskor"])) self.red_kill_count_text.Show() self.yellow_kill_count_text = ui.TextLine() self.yellow_kill_count_text.SetParent(self.kill_gui_board) self.yellow_kill_count_text.SetPosition(105,50) self.yellow_kill_count_text.SetText("Skor : "+str(constInfo.imp_savasi["sariskor"])) self.yellow_kill_count_text.Show() self.blue_kill_count_text = ui.TextLine() self.blue_kill_count_text.SetParent(self.kill_gui_board) self.blue_kill_count_text.SetPosition(180,50) self.blue_kill_count_text.SetText("Skor : "+str(constInfo.imp_savasi["maviskor"])) self.blue_kill_count_text.Show() self.red_kill_count_textt = ui.TextLine() self.red_kill_count_textt.SetParent(self.kill_gui_board) self.red_kill_count_textt.SetPosition(30,60) self.red_kill_count_textt.SetText("Katılımcı : "+str(constInfo.imp_savasi["kirmizikatilimci"])) self.red_kill_count_textt.Show() self.yellow_kill_count_textt = ui.TextLine() self.yellow_kill_count_textt.SetParent(self.kill_gui_board) self.yellow_kill_count_textt.SetPosition(105,60) self.yellow_kill_count_textt.SetText("Katılımcı : "+str(constInfo.imp_savasi["sarikatilimci"])) self.yellow_kill_count_textt.Show() self.blue_kill_count_textt = ui.TextLine() self.blue_kill_count_textt.SetParent(self.kill_gui_board) self.blue_kill_count_textt.SetPosition(180,60) self.blue_kill_count_textt.SetText("Katılımcı : "+str(constInfo.imp_savasi["mavikatilimci"])) self.blue_kill_count_textt.Show() ## 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.__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? ??????? ?? ? ?? ????? ??? ?? # 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) def Close(self): self.Hide() 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.EventButton.Hide() chat.Close() snd.StopAllSound() grp.InitScreenEffect() chr.Destroy() textTail.Clear() quest.Clear() background.Destroy() guild.Destroy() messenger.Destroy() skill.ClearSkillData() wndMgr.Unlock() self.impekran.Close() mouseModule.mouseController.DeattachObject() if self.guildWarQuestionDialog: self.guildWarQuestionDialog.Close() self.guildNameBoard = None self.partyRequestQuestionDialog = None self.partyInviteQuestionDialog = None self.warPlayerCheckQuestionDialog = 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 if app.TOURNAMENT_PVP_SYSTEM: constInfo.TOURNAMENT_WINDOW_IS_SHOWED = 0 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.petmain.Close() self.petmini.Close() self.interface.EndExchange() self.playerGauge = None self.mapNameShower = None self.affectShower = None if self.ruhtasi: self.ruhtasi.Destroy() self.ruhtasi = None if self.bkoku: self.bkoku.Destroy() self.bkoku = None if self.wndTicket: self.wndTicket.Hide() if self.wndTicketReply: self.wndTicketReply.Hide() if self.wndTicketStaff: self.wndTicketStaff.Hide() if self.console: self.console.BindGameClass(0) self.console.Close() self.console=None if self.targetBoard: self.targetBoard.Destroy() self.targetBoard = None if app.ENABLE_ADMIN_BAN_MANAGER: if self.wndAdminTool: self.wndAdminTool.Hide() if self.wndPlayerLocalization: self.wndPlayerLocalization.Close() if self.interface: self.interface.HideAllWindows() self.interface.Close() self.interface=None player.ClearSkillDict() player.ResetCameraRotation() self.KillFocus() app.HideCursor() print "---------------------------------------------------------------------------- CLOSE GAME WINDOW" def imp_savasi_q(self,qid): constInfo.imp_savasi["index"] = int(qid) def imp_savasi(self): import constInfo net.SendQuestInputStringPacket(str(constInfo.imp_savasi["CMD"])) def imp_savasi_ekran(self): self.impekran.Show() def gmyimben(self, durum): constInfo.imp_savasi["gmyim"] = int(durum) def imp_savasi_gui(self, kirmizikatilimci, kirmiziskor, sarikatilimci, sariskor, mavikatilimci, maviskor, durum): constInfo.imp_savasi["kirmizikatilimci"] = int(kirmizikatilimci) constInfo.imp_savasi["kirmiziskor"] = int(kirmiziskor) constInfo.imp_savasi["sarikatilimci"] = int(sarikatilimci) constInfo.imp_savasi["sariskor"] = int(sariskor) constInfo.imp_savasi["mavikatilimci"] = int(mavikatilimci) constInfo.imp_savasi["maviskor"] = int(maviskor) constInfo.imp_savasi["durum"] = int(durum) def imp_savasi_gui_ac(self): self.kill_gui = 1 self.kill_gui_board.Show() def imp_savasi_gui_kapa(self): self.kill_gui = 0 self.kill_gui_board.Hide() 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 biyologekrankapa(self): self.biyoekran.Close() def biyolog(self, bioitem, verilen, toplam, kalansure): self.interface.SetBiyolog(bioitem, verilen, toplam, kalansure) def __BuildKeyDict(self): onPressKeyDict = {} ##PressKey ? ??? ?? ?? ?? ???? ???. ## ?? ??? ???? ????.(?? ???? ? ??? ??) ## F12 ? ?? ???? ???? ?? ?? ? ??. 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_F5] = lambda : self.__YardimciMenu() #onPressKeyDict[app.DIK_F6] = lambda : self.__Potlar() if app.ENABLE_ADMIN_BAN_MANAGER: onPressKeyDict[app.DIK_F6] = lambda : self.OpenAdminTool() 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() #??? ??? 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_P] = self.__PressPKey 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.PickUpMoney() #onPressKeyDict[app.DIK_X] = boş 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() if app.ENABLE_DRAGON_SOUL_SYSTEM: 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() #onPressKeyDict[app.DIK_T] = lambda : self.__PressTeleport() onPressKeyDict[app.DIK_K] = lambda : self.interface.ToggleSpecialStorageWindow() # CUBE_TEST #onPressKeyDict[app.DIK_K] = lambda : self.interface.OpenCubeWindow() # CUBE_TEST_END 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.ENABLE_ADMIN_BAN_MANAGER: def OpenAdminTool(self): import ayarlar ben = player.GetMainCharacterName() if ben == ayarlar.YETKILI_1 or ben == ayarlar.YETKILI_2 or ben == ayarlar.YETKILI_3: if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): # Open window with CTRL + F5 if self.wndAdminTool.IsShow(): self.wndAdminTool.Hide() else: self.wndAdminTool.Show() def __YardimciMenu(self): if self.interface: self.interface.ToggleExpandedButton() def __Potlar(self): if app.GetTime() < self.YavasBasTime: if not str(self.YavasBasTime+1 - app.GetTime())[:2].isdigit(): chat.AppendChat(chat.CHAT_TYPE_INFO, "Bu özelliği ard arda kullanamazsınız. Kullanmak için beklemeniz gereken süre: " + str(self.YavasBasTime+1 - app.GetTime())[:1] + " saniye") else: chat.AppendChat(chat.CHAT_TYPE_INFO, "Bu özelliği ard arda kullanamazsınız. Kullanmak için beklemeniz gereken süre: " + str(self.YavasBasTime+1 - app.GetTime())[:2] + " saniye") return self.YavasBasTime = app.GetTime() + 10 for i in xrange(180): a = player.GetItemIndex(i) if a == 71027 or a == 71028 or a == 71029 or a == 71030 or a== 71044 or a== 71045 or a== 50821 or a== 50822 or a== 50823 or a== 50824 or a== 50825 or a== 50826: net.SendItemUsePacket(i) chat.AppendChat(1, "|cffFDD017|H|hEjderha Tanrı İksirler ve Şebnemler başarıyla kullanıldı.") 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: #net.SendChatPacket("/user_horse_ride") if not uiPrivateShopBuilder.IsBuildingPrivateShop() or not uiOfflineShopBuilder.IsBuildingOfflineShop(): for i in xrange(player.INVENTORY_PAGE_SIZE): if player.GetItemIndex(i) in (71114, 71116, 71118, 71120): 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("/ride") else: if self.ShowNameFlag: self.interface.ToggleGuildWindow() else: app.PitchCamera(app.CAMERA_TO_POSITIVE) def __ReleaseGKey(self): app.PitchCamera(app.CAMERA_STOP) def __PressQKey(self): if (app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL)): if (interfaceModule.IsQBHide == 0): interfaceModule.IsQBHide = 1 self.interface.HideAllQuestButton() else: interfaceModule.IsQBHide = 0 self.interface.ShowAllQuestButton() else: app.RotateCamera(app.CAMERA_TO_NEGATIVE) def __PressPKey(self): if (app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL)): if (interfaceModule.IsWhisperHide == 0): interfaceModule.IsWhisperHide = 1 self.interface.HideAllWhisperButton() else: interfaceModule.IsWhisperHide = 0 self.interface.ShowAllWhisperButton() 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 __PressTeleport(self): if self.interface: self.interface.ToggleTeleportWindow() def __SelectQuickPage(self, pageIndex): self.quickSlotPageIndex = pageIndex player.SetQuickPage(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) def __NotifyError(self, msg): chat.AppendChat(chat.CHAT_TYPE_INFO, msg) def ChangePKMode(self): if not app.IsPressed(app.DIK_LCONTROL): return if player.GetStatus(player.LEVEL) 5000: answer = FALSE net.SendPartyInviteAnswerPacket(partyLeaderVID, answer) self.partyInviteQuestionDialog.Close() self.partyInviteQuestionDialog = None 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() 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.QuestionDialogWithTimeLimit() 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): if debugInfo.IsDebugMode() or TRUE == self.consoleEnable: player.EndKeyWalkingImmediately() self.console.OpenWindow() def ShowName(self): self.ShowNameFlag = TRUE self.playerGauge.EnableShowAlways() player.SetQuickPage(self.quickSlotPageIndex+1) # ADD_ALWAYS_SHOW_NAME def __IsShowName(self): if systemSetting.IsAlwaysShowName(): return TRUE if self.ShowNameFlag: return TRUE return FALSE # END_OF_ADD_ALWAYS_SHOW_NAME def HideName(self): self.ShowNameFlag = FALSE self.playerGauge.DisableShowAlways() player.SetQuickPage(self.quickSlotPageIndex) 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() def PickUpMoney(self): player.PickCloseMoney() ############################################################################################### ############################################################################################### ## Event Handler def OnKeyDown(self, key): if self.interface.wndWeb and self.interface.wndWeb.IsShow(): return if key == app.DIK_ESC: self.RequestDropItem(FALSE) constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) try: self.onPressKeyDict[key]() except KeyError: pass except: raise return TRUE def OnKeyUp(self, key): try: 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) elif player.SLOT_TYPE_INVENTORY == attachedType: if player.ITEM_MONEY == attachedItemIndex: self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex) elif player.ITEM_CHEQUE == attachedItemIndex: self.__PutCheque(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) elif player.SLOT_TYPE_UPGRADE_INVENTORY == attachedType or\ player.SLOT_TYPE_BOOK_INVENTORY == attachedType or\ player.SLOT_TYPE_STONE_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_UPGRADE_INVENTORY == attachedType or\ player.SLOT_TYPE_BOOK_INVENTORY == attachedType or\ player.SLOT_TYPE_STONE_INVENTORY == attachedType: attachedInvenType = player.SlotTypeToInvenType(attachedType) if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID: if player.IsEquipmentSlot(attachedItemSlotPos) and\ player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedType and\ player.SLOT_TYPE_UPGRADE_INVENTORY != attachedType and\ player.SLOT_TYPE_BOOK_INVENTORY != attachedType and\ player.SLOT_TYPE_STONE_INVENTORY != attachedType: self.stream.popupWindow.Close() self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK) else: if chr.IsNPC(dstChrID): 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 net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, 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.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount) def __PutMoney(self, attachedType, attachedMoney, dstChrID): if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID: net.SendExchangeStartPacket(dstChrID) net.SendExchangeElkAddPacket(attachedMoney) else: self.__DropMoney(attachedType, attachedMoney) def __DropMoney(self, attachedType, attachedMoney): # PRIVATESHOP_DISABLE_ITEM_DROP - ???? ?? ?? ?? ??? ?? ?? if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP if (uiOfflineShopBuilder.IsBuildingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if (uiOfflineShop.IsEditingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if attachedMoney>=0: self.stream.popupWindow.Close() self.stream.popupWindow.Open("Yere yang bırakamazsınız.", 0, localeInfo.UI_OK) return itemDropQuestionDialog = uiCommon.QuestionDialog() itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney)) itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropCount = attachedMoney itemDropQuestionDialog.dropNumber = player.ITEM_MONEY self.itemDropQuestionDialog = itemDropQuestionDialog def __PutCheque(self, attachedType, attachedCheque, dstChrID): if True == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID: net.SendExchangeStartPacket(dstChrID) net.SendExchangePsgAddPacket(attachedCheque) else: self.__DropCheque(attachedType, attachedCheque) def __DropCheque(self, attachedType, attachedCheque): if attachedCheque>=100: self.stream.popupWindow.Close() self.stream.popupWindow.Open(localeInfo.DROP_CHEQUE_FAILURE_100_OVER, 0, localeInfo.UI_OK) return itemDropQuestionDialog = uiCommon.QuestionDialog() itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_CHEQUE % (attachedCheque)) itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropCount = attachedCheque itemDropQuestionDialog.dropNumber = player.ITEM_CHEQUE self.itemDropQuestionDialog = itemDropQuestionDialog def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount): # PRIVATESHOP_DISABLE_ITEM_DROP - ???? ?? ?? ?? ??? ?? ?? if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP if (uiOfflineShopBuilder.IsBuildingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if (uiOfflineShop.IsEditingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos): self.stream.popupWindow.Close() self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK) else: if player.SLOT_TYPE_INVENTORY == attachedType: dropItemIndex = player.GetItemIndex(attachedItemSlotPos) item.SelectItem(dropItemIndex) dropItemName = item.GetItemName() ## Question Text questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount) ## Dialog itemDropQuestionDialog = uiCommon.QuestionDialog() itemDropQuestionDialog.SetText(questionText) itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) #itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem(arg)) #itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropNumber = attachedItemSlotPos itemDropQuestionDialog.dropCount = attachedItemCount self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType: dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos) item.SelectItem(dropItemIndex) dropItemName = item.GetItemName() ## Question Text questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount) ## Dialog itemDropQuestionDialog = uiCommon.QuestionDialog() itemDropQuestionDialog.SetText(questionText) itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) #itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem(arg)) #itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropNumber = attachedItemSlotPos itemDropQuestionDialog.dropCount = attachedItemCount self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) elif player.SLOT_TYPE_UPGRADE_INVENTORY == attachedType or\ player.SLOT_TYPE_BOOK_INVENTORY == attachedType or\ player.SLOT_TYPE_STONE_INVENTORY == attachedType: dropItemIndex = player.GetItemIndex(player.SlotTypeToInvenType(attachedType), attachedItemSlotPos) item.SelectItem(dropItemIndex) dropItemName = item.GetItemName() ## Question Text questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount) ## Dialog itemDropQuestionDialog = uiCommon.QuestionDialog() itemDropQuestionDialog.SetText(questionText) itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropNumber = attachedItemSlotPos itemDropQuestionDialog.dropCount = attachedItemCount self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1) def RequestDropItem(self, answer): if not self.itemDropQuestionDialog: return if answer: dropType = self.itemDropQuestionDialog.dropType dropCount = self.itemDropQuestionDialog.dropCount dropNumber = self.itemDropQuestionDialog.dropNumber if player.SLOT_TYPE_INVENTORY == dropType: if dropNumber == player.ITEM_MONEY: net.SendGoldDropPacketNew(dropCount) snd.PlaySound("sound/ui/money.wav") elif dropNumber == player.ITEM_CHEQUE: net.SendChequeDropPacketNew(dropCount) snd.PlaySound("sound/ui/money.wav") else: # PRIVATESHOP_DISABLE_ITEM_DROP self.__SendDropItemPacket(dropNumber, dropCount) # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType: # PRIVATESHOP_DISABLE_ITEM_DROP self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY) # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP elif player.SLOT_TYPE_UPGRADE_INVENTORY == dropType or player.SLOT_TYPE_BOOK_INVENTORY == dropType or player.SLOT_TYPE_STONE_INVENTORY == dropType: self.__SendDropItemPacket(dropNumber, dropCount, player.SlotTypeToInvenType(dropType)) self.itemDropQuestionDialog.Close() self.itemDropQuestionDialog = None constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) # PRIVATESHOP_DISABLE_ITEM_DROP def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY): if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return if (uiOfflineShopBuilder.IsBuildingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if (uiOfflineShop.IsEditingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount) # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY): if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return if (uiOfflineShopBuilder.IsBuildingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if (uiOfflineShop.IsEditingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return net.SendItemDestroyPacket(itemVNum) def __SendSellItemPacket(self, itemVNum, itemInvenTyoe = player.INVENTORY): if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return if (uiOfflineShopBuilder.IsBuildingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return if (uiOfflineShop.IsEditingOfflineShop()): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_OFFLINE_SHOP) return net.SendItemSellPacket(itemVNum) 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 OnUpdate(self): app.UpdateGame() self.red_kill_count_text.SetText("Skor : "+str(constInfo.imp_savasi["kirmiziskor"])) self.yellow_kill_count_text.SetText("Skor : "+str(constInfo.imp_savasi["sariskor"])) self.blue_kill_count_text.SetText("Skor : "+str(constInfo.imp_savasi["maviskor"])) self.red_kill_count_textt.SetText("Katılımcı : "+str(constInfo.imp_savasi["kirmizikatilimci"])) self.yellow_kill_count_textt.SetText("Katılımcı : "+str(constInfo.imp_savasi["sarikatilimci"])) self.blue_kill_count_textt.SetText("Katılımcı : "+str(constInfo.imp_savasi["mavikatilimci"])) global oyunagirdibeklemesuresi global oyunagirdiglobaltimesuresi global oyunagirdi if oyunagirdi == 1: if app.GetTime() < self.Bekle + 5: pass else: self.GirdiButton.Hide() oyunagirdi = 0 else: pass if int(translate.panelisle) == 1: self.interface.ToggleOfflineShopAdminPanelWindow() translate.panelisle=0 if self.mapNameShower.IsShow(): self.mapNameShower.Update() if self.isShowDebugInfo: self.UpdateDebugInfo() if self.enableXMasBoom: self.__XMasBoom_Update() if 0 == constInfo.auto_pick_item: self.PickUpItem() if 0 == constInfo.auto_pick_yang: self.PickUpMoney() lastTime = max(0, self.endTime - time.clock()) if 0 == lastTime: self.__ShowKLImage() curTime = time.clock() self.endTime = curTime + 4 self.interface.BUILD_OnUpdate() def __ShowKLImage(self): KLName = player.GetGuildName() if KLName[:4] == "[KL]": net.SendChatPacket("(kralicon)") elif player.GetName().find("[KRAL]") != -1: net.SendChatPacket("(klicon)") def UpdateDebugInfo(self): # # ??? ?? ? 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 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) # 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() 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 ###################################################################################### # EXCHANGE if app.WJ_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) # END_OF_EXCHANGE # 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 # QUEST_CONFIRM def BINARY_OnQuestConfirm(self, msg, timeout, pid): confirmDialog = uiCommon.QuestionDialogWithTimeLimit() confirmDialog.SetText1(msg) confirmDialog.Open(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() if app.ENABLE_MAINTENANCE_SYSTEM: def BINARY_Maintenance(self, sec, dur): sec = int(sec) dur = int(dur) self.interface.StartMaintenance(sec,dur) # 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 = materialInfo self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount) 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"] gold = 0 splitResult = eachResultText.split("/") if 1 < len(splitResult): gold = 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) itemCount = int(itemCount) self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount) materialList[i].append((itemVnum, itemCount)) else: itemVnum, itemCount = eachMaterialText.split(",") itemVnum = int(itemVnum) itemCount = int(itemCount) self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount) materialList[i].append((itemVnum, itemCount)) i = i + 1 itemIndex = itemIndex + 1 self.interface.wndCube.Refresh() except RuntimeError, msg: dbg.TraceError(msg) return 0 pass # END_OF_CUBE def BINARY_AttrTransfer_Open(self): self.interface.OpenAttrTransferWindow() def BINARY_AttrTransfer_Close(self): self.interface.CloseAttrTransferWindow() def BINARY_AttrTransfer_Success(self): self.interface.AttrTransferSuccess() # ??? def BINARY_Highlight_Item(self, inven_type, inven_pos): if self.interface: self.interface.Highlight_Item(inven_type, inven_pos) 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_DragonSoulGiveQuilification(self): self.interface.DragonSoulGiveQuilification() def __Chest_Search(self,vnums,counts): self.interface.ItemsChest(vnums,counts) def __Chest_Search_Refresh(self): self.interface.ItemsChestRefresh() def __Chest_Search_Refresh_Open(self): self.interface.ItemsChestRefreshOpen() def __PrivateSearch_ItemSearch(self,item_vnum): self.interface.PrivateSearchItems(item_vnum) def __PrivateSearch_RefreshItems(self): self.interface.PrivateSearchRefresh() 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): self.interface.bigBoard.SetTip(message) def BINARY_SetTipMessage(self, message): self.interface.tipBoard.SetTip(message) def BINARY_AppendNotifyMessage(self, type): if not type in localeInfo.NOTIFY_MESSAGE: return chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type]) 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) 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={ "ConsoleEnable" : self.__Console_Enable, "DayMode" : self.__DayMode_Update, "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update, "CloseRestartWindow" : self.__RestartDialog_Close, "OpenPrivateShop" : self.__PrivateShop_Open, "OpenOfflineShop" : self.__OfflineShop_Open, "PartyHealReady" : self.PartyHealReady, "ShowMeSafeboxPassword" : self.AskSafeboxPassword, "CloseSafebox" : self.CommandCloseSafebox, "ruhtasiekranac" : self.ruhcac, "bkekranac" : self.bkac, "OpenGuiGaya" : self.OpenGuiGaya, "GayaCheck" : self.GayaCheck, "OpenGuiGayaMarket" :self.OpenGuiGayaMarket, "GayaMarketSlotsDesblock" : self.GayaMarketSlotsDesblock, "GayaMarketItems" : self.GayaMarketItems, "GayaMarketClear" : self.GayaMarketClear, "GayaMarketTime" : self.GayaTimeMarket, "imp_savasi_q" : self.imp_savasi_q, "imp_savasi" : self.imp_savasi, "imp_savasi_ekran" : self.imp_savasi_ekran, "gmyimben" : self.gmyimben, "imp_savasi_gui" : self.imp_savasi_gui, "imp_savasi_gui_ac" : self.imp_savasi_gui_ac, "imp_savasi_gui_kapa" : self.imp_savasi_gui_kapa, "OtomatikAvWindow" : self.__otomatikavstart, "ticaretteklifi" : self.uzaktan_tic, "refreshinven" : self.Update_inventory_ref, "update_envanter_lazim" : self.Update_inventory_lazim, "loncatoplantisi" : self.loncatoplantisi, "lonca_lider_q" : self.lonca_lider_q, "lider_ekle" : self.lider_ekle, "lider_sifirla" : self.lider_sifirla, "LONCASKOR" : self.LoncaSkorSistem, "skor_sec_q" : self.skor_sec_q, "savas_ekle" : self.savas_ekle, "savas_sifirla" : self.savas_sifirla, "lonca_ad_ver" : self.lonca_ad_ver, "savas_no_ver" : self.savas_no_ver, "gecmis_q" : self.lonca_gecmis_q, "lonca_gecmis_ekle" : self.lonca_gecmis_ekle, "gecmistemizle" : self.gecmistemizle, "isim_ver" : self.isim_ver, "RefreshDragonCoin" : self.__Mds, "PrivateSearch_ItemsSearch" :self.__PrivateSearch_ItemSearch, "PrivateSearch_RefreshItems" :self.__PrivateSearch_RefreshItems, "search_cofre_ids": self.__Chest_Search, "search_cofre_refresh": self.__Chest_Search_Refresh, "search_cofre_refresh_open": self.__Chest_Search_Refresh_Open, # ITEM_MALL "CloseMall" : self.CommandCloseMall, "ShowMeMallPassword" : self.AskMallPassword, "item_mall" : self.__ItemMall_Open, "OpenDecoration" :self.__OpenDecoration, "oxengel" :self.oxengel, "karakter_kilit" : self.karakter_kilit, "biyologodul" : self.biyoodulac, "biyologekrankapa" : self.biyologekrankapa, "biyolog" : self.biyolog, "bonusgormekistiyor" : self.bonusgormekistiyor, "bonuslarimigor" : self.bonuslarimigor, # 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, "horse_state" : self.__Horse_UpdateState, "hide_horse_state" : self.__Horse_HideState, "WarUC" : self.__GuildWar_UpdateMemberCount, "test_server" : self.__EnableTestServerFlag, "mall" : self.__InGameShop_Show, "GW_Kill_Update" : self.__GuildWar_ProcessKillInput, "BINARY_Update_Coins" :self.BINARY_Update_Coins, "BINARY_Update_Coins2" :self.BINARY_Update_Coins2, "PetEvolution" : self.SetPetEvolution, "PetName" : self.SetPetName, "PetLevel" : self.SetPetLevel, "PetDuration" : self.SetPetDuration, ##Pet Yas Bugu Fixi## "PetDurationYas" : self.SetPetDurationYas, ##Pet Yas Bugu Fixi## "PetBonus" : self.SetPetBonus, "PetSkill" : self.SetPetskill, "PetIcon" : self.SetPetIcon, "PetExp" : self.SetPetExp, "PetUnsummon" : self.PetUnsummon, "OpenPetIncubator" : self.OpenPetIncubator, # WEDDING "lover_login" : self.__LoginLover, "lover_logout" : self.__LogoutLover, "lover_near" : self.__LoverNear, "lover_far" : self.__LoverFar, "lover_divorce" : self.__LoverDivorce, "PlayMusic" : self.__PlayMusic, "BINARY_Localization_Append" : self.BINARY_Localization_Append, "EventSys" : self.__EventDataAppend, # END_OF_WEDDING # 5Lv Oto Bec Sistemi # Savasci Beceri "OpenBec1Gui" : self.__BecSystem1, "zihinsel_oto_bec" : self.zihinsel_oto_bec, "bedensel_oto_bec" : self.bedensel_oto_bec, # Sura Beceri "OpenBec3Gui" : self.__BecSystem2, "karabuyu_oto_bec" : self.karabuyu_oto_bec, "buyulusilah_oto_bec" : self.buyulusilah_oto_bec, # Ninja Becerileri "OpenBec2Gui" : self.__BecSystem3, "yakin_oto_bec" : self.yakin_oto_bec, "uzak_oto_bec" : self.uzak_oto_bec, # Saman Becerileri "OpenBec4Gui" : self.__BecSystem4, "ejderha_oto_bec" : self.ejderha_oto_bec, "iyilestirme_oto_bec" : self.iyilestirme_oto_bec, #Lycan Becerileri "OpenBec5Gui" : self.__BecSystem5, "lycany_oto_bec" : self.lycany_oto_bec, "AttrTransferMessage" : self.AttrTransferMessage, "bk_trade_sys" : self.__BKTradeSys, "dragonlair_ranking_open" : self.OpenDragonLairRanking, "dragonlair_rank" : self.AddDragonLairRanking, # PRIVATE_SHOP_PRICE_LIST "MyShopPriceList" : self.__PrivateShop_PriceList, # END_OF_PRIVATE_SHOP_PRICE_LIST "MakeVisibleOX" : self.__SetAllPlayersVisible, "RemoveTitleOX" : self.__ClearPlayersTitle, "exit" : self.__exit, "WarPlayerCheckReq" : self.__Do_Check_War_Player, "getinputbegin" : self.__Inputget1, "getinputend" : self.__Inputget2, } self.serverCommander=stringCommander.Analyzer() serverCommandList.update({"teleport_q" : self.__teleport_q }) serverCommandList.update({"teleportidx" : self.teleportidx }) if app.ENABLE_MELEY_LAIR_DUNGEON: self.serverCommander.SAFE_RegisterCallBack("meley_open", self.OpenMeleyRanking) self.serverCommander.SAFE_RegisterCallBack("meley_rank", self.AddRankMeleyRanking) for serverCommandItem in serverCommandList.items(): self.serverCommander.SAFE_RegisterCallBack( serverCommandItem[0], serverCommandItem[1] ) def __exit(self): app.Exit() def oxengel(self,engel): if engel.find("true") != -1: constInfo.engel_ox = 0 elif engel.find("false") != -1: constInfo.engel_ox = 1 def __SetAllPlayersVisible(self): chrmgr.ShowAllPlayers() def Toplananlar(self, cmd): liste = cmd.split(":") if liste and len(liste): self.petmain.PetItemListesi(liste) def __ClearPlayersTitle(self): chrmgr.RemoveAllPlayersTitle() def LoncaSkorSistem(self, info): CMD = info.split("/") if CMD[0]=="index": constInfo.LONCA_SKOR["index"] = int(CMD[1]) elif CMD[0]=="input": net.SendQuestInputStringPacket(str(constInfo.LONCA_SKOR["CMD"])) elif CMD[0]=="newlist": constInfo.LONCA_SKOR["Liste"] = [] elif CMD[0]=="liste": constInfo.LONCA_SKOR["Liste"].append(CMD[1].split("|")) elif CMD[0]=="blok": self.loncaskorr.LoadPage(CMD[1]) # constInfo.load_page = CMD[1] elif CMD[0]=="sayfa": self.loncaskorr.SetSeite(CMD[1]) def isim_ver(self): import constInfo net.SendQuestInputStringPacket(str(constInfo.lonca_gecmis_isim)) def lonca_gecmis_q(self, id): constInfo.lonca_gecmis_q = int(id) def OpenGuiGaya(self): self.interface.OpenGuiGaya() def GayaCheck(self): self.interface.GayaCheck() def OpenGuiGayaMarket(self): self.interface.OpenGuiGayaMarket() def GayaMarketItems(self,vnums,gaya,count): self.interface.GayaMarketItems(vnums,gaya,count) def GayaMarketSlotsDesblock(self,slot0,slot1,slot2,slot3,slot4,slot5): self.interface.GayaMarketSlotsDesblock(slot0,slot1,slot2,slot3,slot4,slot5) def GayaMarketClear(self): self.interface.GayaMarketClear() def GayaTimeMarket(self, time): self.interface.GayaTime(time) def uzaktan_tic(self, isim, level): uzktntic_krc425 = uiCommon.QuestionDialog() uzktntic_krc425.SetText(str(isim) + translate.uzaktanticsoru) uzktntic_krc425.SetAcceptEvent(lambda arg=True: self.kabul_et(isim)) uzktntic_krc425.SetCancelEvent(lambda arg=False: self.reddet(isim)) uzktntic_krc425.Open() self.uzktntic_krc425 = uzktntic_krc425 return def kabul_et(self, isim): net.SendChatPacket("/uzaktan_ticaret_kabul " + str(isim)) self.uzktntic_krc425.Close() def reddet(self, isim): net.SendChatPacket("/uzaktan_ticaret_hayir " + str(isim)) self.uzktntic_krc425.Close() def lonca_gecmis_ekle(self, isim): import constInfo constInfo.lonca_gecmis_list.append(isim) def gecmistemizle(self): import constInfo constInfo.lonca_gecmis_list = [] def skor_sec_q(self,qid): constInfo.skor_sec_q = int(qid) def savas_ekle(self, isim, lonca, tarih, savas_id): import constInfo constInfo.skor_list.append("#"+lonca+"#"+isim+"#"+tarih+"#"+savas_id) def savas_sifirla(self): import constInfo constInfo.skor_list = [] def lonca_ad_ver(self): import constInfo net.SendQuestInputStringPacket(str(constInfo.lonca_skor_ekran_title)) def savas_no_ver(self): import constInfo net.SendQuestInputStringPacket(str(constInfo.savas_no_ver)) def lonca_lider_q(self,qid): constInfo.lonca_lider_q = int(qid) def lider_ekle(self, isim, lonca): import constInfo constInfo.lider_list.append("#"+isim+"#"+lonca) def lider_sifirla(self): import constInfo constInfo.lider_list = [] def __EventDataAppend(self,event_data): self.EventButton.Open(event_data) 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 __EventDataAppend(self,event_data): self.EventButton.Open(event_data) 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 loncatoplantisi(self): import uiCommon import constInfo questionDialogtoplanti=uiCommon.QuestionDialog() questionDialogtoplanti.SetText("Lonca toplantı bölgesine ışınlan?") questionDialogtoplanti.SetAcceptEvent(lambda arg=TRUE: self.loncatoplantievet()) questionDialogtoplanti.SetCancelEvent(lambda arg=FALSE: self.loncatoplantihayir()) questionDialogtoplanti.Open() self.questionDialogtoplanti=questionDialogtoplanti return def loncatoplantievet(self): net.SendChatPacket("/loncatoplantievet") self.questionDialogtoplanti.Close() def loncatoplantihayir(self): self.questionDialogtoplanti.Close() def __teleport_q(self, q): constInfo.TELEPORT_Q_INDEX = int(q) def teleportidx(self): if self.interface: self.interface.ToggleTeleportWindow() net.SendQuestInputStringPacket(constInfo.TELEPORT_SEND_INDEX) def __Inputget1(self): constInfo.INPUT_IGNORE = 1 def __Inputget2(self): constInfo.INPUT_IGNORE = 0 def __BKTradeSys(self, arg1, arg2): if str(arg1) == "qid": constInfo.BK_TRADE_SYSTEM["qid"] = arg2 if str(arg1) == "get": net.SendQuestInputStringPacket(str(constInfo.BK_TRADE_SYSTEM["ItemList"])) if str(arg1) == "open": self.BKTradeSys.Show() if str(arg1) == "block": constInfo.INPUT_IGNORE = 1 if str(arg1) == "break": 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 AttrTransferMessage(self): snd.PlaySound("sound/ui/make_soket.wav") self.PopupMessage(localeInfo.COMB_ALERT) def RefineSuceededMessage(self): snd.PlaySound("sound/ui/make_soket.wav") net.SendChatPacket("(test_basarili)") self.interface.CheckRefineDialog(False) def RefineFailedMessage(self): snd.PlaySound("sound/ui/jaeryun_fail.wav") net.SendChatPacket("(test_basarisiz)") self.interface.CheckRefineDialog(True) def CommandCloseSafebox(self): self.interface.CommandCloseSafebox() # PRIVATE_SHOP_PRICE_LIST if app.ENABLE_CHEQUE_SYSTEM: def __PrivateShop_PriceList(self, itemVNum, itemPrice, itemPriceCheque): uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice, itemPriceCheque) # chat.AppendChat(chat.CHAT_TYPE_INFO, 'Teste: '+str(itemVNum)+" "+str(getItemVNum(itemPrice))+" "+str(itemPriceCheque)) else: def __PrivateShop_PriceList(self, itemVNum, itemPrice): uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice) # END_OF_PRIVATE_SHOP_PRICE_LIST def __Do_Check_War_Player(self, targetName, killCount, deadCount): warPlayerCheckQuestionDialog = uiCommon.QuestionDialog3() warPlayerCheckQuestionDialog.SetText1("%s isimli oyuncu ajan olabilir." % (targetName)) warPlayerCheckQuestionDialog.SetText2("Ölme: %s Öldürme: %s" % (str(deadCount), str(killCount))) warPlayerCheckQuestionDialog.SetText3("Savaştan atılsın mı?") warPlayerCheckQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT) warPlayerCheckQuestionDialog.SetCancelText(localeInfo.UI_DENY) warPlayerCheckQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerWarCheckRequest(arg)) warPlayerCheckQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerWarCheckRequest(arg)) warPlayerCheckQuestionDialog.Open() warPlayerCheckQuestionDialog.name = targetName self.warPlayerCheckQuestionDialog = warPlayerCheckQuestionDialog def __AnswerWarCheckRequest(self, answer): if not self.warPlayerCheckQuestionDialog: return targetName = self.warPlayerCheckQuestionDialog.name if answer: net.SendChatPacket("/ajaniat %s" % (str(targetName))) self.warPlayerCheckQuestionDialog.Close() self.warPlayerCheckQuestionDialog = None def SetPetEvolution(self, evo): petname = [localeInfo.PET_SYSTEM_EVO1, localeInfo.PET_SYSTEM_EVO2, localeInfo.PET_SYSTEM_EVO3, localeInfo.PET_SYSTEM_EVO4] self.petmain.SetEvolveName(petname[int(evo)]) 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) ##Pet Ya? Bugu Fixi## def SetPetDurationYas(self, dur_yas): if int(dur_yas) > 0: self.petmain.SetDurationYas(dur_yas) ##Pet Ya? Bugu Fixi## def SetPetBonus(self, hp, dif, sp): self.petmain.SetHp(hp) self.petmain.SetDef(dif) self.petmain.SetSp(sp) def SetPetskill(self, slot, idx, lv): 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(): self.petmain.Close() else: self.petmain.Show() self.petmain.SetTop() 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", ) 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 __otomatikavstart(self): constInfo.Start = 1 def __Console_Enable(self): constInfo.CONSOLE_ENABLE = TRUE self.consoleEnable = TRUE app.EnableSpecialCameraMode() ui.EnablePaste(TRUE) ## PrivateShop def __PrivateShop_Open(self): self.interface.OpenPrivateShopInputNameDialog() def BINARY_PrivateShop_Appear(self, vid, text): if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER): self.interface.AppearPrivateShop(vid, text) def BINARY_PrivateShop_Disappear(self, vid): if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER): self.interface.DisappearPrivateShop(vid) # OfflineShop def __OfflineShop_Open(self): self.interface.OpenOfflineShopInputNameDialog() def __OpenDecoration(self): self.interface.OpenOfflineShopDecoration() def BINARY_OfflineShop_Appear(self, vid, text): if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC): self.interface.AppearOfflineShop(vid, text) def BINARY_OfflineShop_Disappear(self, vid): if (chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_NPC): self.interface.DisappearOfflineShop(vid) ## DayMode def __PRESERVE_DayMode_Update(self, mode): if "light"==mode: background.SetEnvironmentData(0) elif "dark"==mode: if not self.__IsXMasMap(): return background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) background.SetEnvironmentData(1) def __DayMode_Update(self, mode): if "light"==mode: 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): background.SetEnvironmentData(0) self.curtain.FadeIn() def __DayMode_OnCompleteChangeToDark(self): background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) background.SetEnvironmentData(1) 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) if app.TOURNAMENT_PVP_SYSTEM: def BINARY_Tournament_OnRecvData(self, leftTime, membersOnline_A, membersOnline_B, membersDead_A, membersDead_B, memberLives): self.interface.AddTournamentResultWindow(leftTime, membersOnline_A, membersOnline_B, membersDead_A, membersDead_B, memberLives) 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 BINARY_Localization_Append(self, register_callback, idx1, idx2, idx3, idx4, idx5, idx6, idx7, idx8, idx9, idx10, idx11, idx12, idx13, idx14): self.wndPlayerLocalization.Append([int(register_callback), int(idx1), int(idx2), int(idx3), int(idx4), int(idx5), int(idx6), int(idx7), int(idx8), int(idx9), int(idx10), int(idx11), int(idx12), int(idx13), int(idx14)]) def BINARY_Ticket_Sort_Admin(self, token, val): if token == "r": if self.wndTicket.IsShow(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.TICKET_BTN_ERROR_OPEN) return else: self.wndTicketStaff.Append() elif token == "o": constInfo.ObjectD["rmdir"][0] = int(val) self.wndTicket.Append() def BINARY_Ticket_Logs_Team(self, index, ticked_id, char_name, title, content, priority, create_date, status): self.wndTicket.AppendLogsTeam(index, ticked_id, char_name, title, content, priority, create_date, status) def BINARY_Ticket_Logs_General(self): self.wndTicket.AppendLogs() def BINARY_Ticket_Logs_Reply(self): self.wndTicketReply.AppendLogs() def __ClickTicketButton(self): ticket.SendTicketPacketOpen(1, 0, "") 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) def OpenDragonLairRanking(self): if self.interface: self.interface.OpenDragonLairRanking() def AddDragonLairRanking(self, data): if self.interface: line = int(data.split("#")[1]) name = str(data.split("#")[2]) empire = int(data.split("#")[3]) killcount = int(data.split("#")[4]) self.interface.AddDragonLairRanking(line, name, empire, killcount) 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_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) 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) # END_OF_WEDDING 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 BINARY_Update_Coins(self, coins): constInfo.ep =(int(coins)) def BINARY_Update_Coins2(self, cheque): constInfo.won =(int(cheque)) # Gui Sistemleri def __BecSystem1(self): self.black = savbec.BlackIsinlanma() self.black.OpenWindow() def __BecSystem2(self): self.black = surabec.BlackIsinlanma() self.black.OpenWindow() def __BecSystem3(self): self.black = ninjabec.BlackIsinlanma() self.black.OpenWindow() def __BecSystem4(self): self.black = samanbec.BlackIsinlanma() self.black.OpenWindow() def __BecSystem5(self): self.black = lycanbec.BlackIsinlanma() self.black.OpenWindow() def bkac(self): self.bkoku.Show() def ruhcac(self): self.ruhtasi.Show() # Beceri Sistemleri # Sava?cı Becerileri def zihinsel_oto_bec(self,qid): constInfo.zihinsel_oto_bec = int(qid) def bedensel_oto_bec(self,qid): constInfo.bedensel_oto_bec = int(qid) # Sura Becerileri def karabuyu_oto_bec(self,qid): constInfo.karabuyu_oto_bec = int(qid) def buyulusilah_oto_bec(self,qid): constInfo.buyulusilah_oto_bec = int(qid) # Ninja Becerileri def yakin_oto_bec(self,qid): constInfo.yakin_oto_bec = int(qid) def uzak_oto_bec(self,qid): constInfo.uzak_oto_bec = int(qid) # ?aman Becerileri def ejderha_oto_bec(self,qid): constInfo.ejderha_oto_bec = int(qid) def iyilestirme_oto_bec(self,qid): constInfo.iyilestirme_oto_bec = int(qid) # lycan Becerileri def lycany_oto_bec(self,qid): constInfo.lycany_oto_bec = int(qid) def bonusgormekistiyor(self,isim,level): import uiCommon import constInfo questionDialogbonus=uiCommon.QuestionDialog() questionDialogbonus.SetText(str(isim)+"(Lv."+str(level)+")"+" Bonuslarını görmek istiyor.") questionDialogbonus.SetAcceptEvent(lambda arg=TRUE: self.bonusgormeevet(isim)) questionDialogbonus.SetCancelEvent(lambda arg=FALSE: self.bonusgormehayir(isim)) questionDialogbonus.Open() self.questionDialogbonus=questionDialogbonus return def bonusgormeevet(self,isim): net.SendChatPacket("/bonusumu_gorebilirsin " + str(isim)) self.questionDialogbonus.Close() def bonusgormehayir(self,isim): net.SendChatPacket("/bonusumu_goremezsin " + str(isim)) self.questionDialogbonus.Close() def __Mds(self, coins): import constInfo constInfo.ep = int(coins) def bonuslarimigor(self,name,deliciefsun,kritikefsun,yariinsanefsun,kilicsavunmasiefsun,ciftelsavunmasiefsun,bicaksavunmasiefsun,yelpazesavunmasiefsun,cansavunmasiefsun,oksavunmasiefsun,pencesavunmasiefsun,buyusavunmasiefsun): import chat import constInfo constInfo.efsungorname = "Character Name" constInfo.kritik = 0 constInfo.delici = 0 constInfo.yariinsan = 0 constInfo.kilic = 0 constInfo.ciftel = 0 constInfo.bicak = 0 constInfo.ok = 0 constInfo.yelpaze = 0 constInfo.can = 0 constInfo.pence = 0 constInfo.buyu = 0 constInfo.efsungorname = str(name) constInfo.kritik = int(kritikefsun) constInfo.delici = int(deliciefsun) constInfo.yariinsan = int(yariinsanefsun) constInfo.kilic = int(kilicsavunmasiefsun) constInfo.ciftel = int(ciftelsavunmasiefsun) constInfo.bicak = int(bicaksavunmasiefsun) constInfo.ok = int(oksavunmasiefsun) constInfo.yelpaze = int(yelpazesavunmasiefsun) constInfo.can = int(cansavunmasiefsun) constInfo.pence = int(pencesavunmasiefsun) constInfo.buyu = int(buyusavunmasiefsun) import uiefsungor self.efsungor = uiefsungor.EfsunGor() self.efsungor.Show() def Update_inventory_ref(self): if self.interface: self.interface.SetInventoryPageKilit() def Update_inventory_lazim(self, lazim): self.wndPopupDialog = uiCommon.PopupDialog() self.wndPopupDialog.SetText(lazim + " " + localeInfo.ENVANTER_ANAH_LAZIM) self.wndPopupDialog.Open() def karakter_kilit(self,qid): constInfo.karakter_kilit = int(qid) # HIZLI EKIPMAN def __HizliEkipman(self): import uifastequip if 0==interfaceModule.hizliekipman: interfaceModule.hizliekipman = 1 self.uuifastequipDlg = uifastequip.changeequip() self.uuifastequipDlg.Show() else: interfaceModule.hizliekipman = 0 self.uuifastequipDlg = uifastequip.changeequip() self.uuifastequipDlg.Hide() # HIZLI EKIPMAN