- Katılım
- 23 Nis 2022
- Konular
- 30
- Mesajlar
- 172
- Çözüm
- 3
- Online süresi
- 19d 21h
- Reaksiyon Skoru
- 24
- Altın Konu
- 0
- TM Yaşı
- 4 Yıl 1 Ay 12 Gün
- Başarım Puanı
- 76
- MmoLira
- 4,464
- DevLira
- 3
ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!
[CODE title="syser"]0731 00:45:13439 :: CPythonCharacterManager::CreateInstance: VID[9012] - ALREADY EXIST
0731 00:45:18485 :: Hair number 69 is not exist.
0731 00:45:27948 :: Hair number 69 is not exist.
0731 00:45:35457 :: Traceback (most recent call last):
0731 00:45:35457 :: File "ui.py", line 2431, in OnSelectEmptySlot
0731 00:45:35457 :: File "ui.py", line 88, in __call__
0731 00:45:35457 :: File "ui.py", line 79, in __call__
0731 00:45:35457 :: File "uiInventory.py", line 1631, in SelectEmptySlot
0731 00:45:35457 :: AttributeError
0731 00:45:35457 :: :
0731 00:45:35457 :: 'module' object has no attribute 'SLOT_TYPE_SKILL_BOOK_INVENTORY'
0731 00:45:35457 ::
[/CODE]
Depodan itemi alıp envantere koyduğumda bana yukardaki syseri veriyor itemde envantere gelmiyor yardımcı olurmusunuz .
Ekli dosyayı görüntüle 150765
[CODE title="uiinventory.py"]import ui
import player
import mouseModule
import net
import app
import snd
import item
import player
import chat
import grp
import uiScriptLocale
import uiRefine
import uiAttachMetin
import uiPickMoney
import uiCommon
import uiPrivateShopBuilder
import localeInfo
import constInfo
import ime
import wndMgr
import uiToolTip
import uiAkiraMenu
if app.ENABLE_ACCE_COSTUME_SYSTEM:
import acce
if app.__ENABLE_NEW_OFFLINESHOP__:
import offlineshop
import uinewofflineshop
DOSYA_YOLU = "UserData"
ITEM_MALL_BUTTON_ENABLE = True
ITEM_FLAG_APPLICABLE = 1 << 14
class AutoWindow(ui.ScriptWindow):
otoav_sure = app.GetTime()+4
AUTO_COOLTIME_POS_Y = 4
AUTO_COOLTIME_POS_X = 4
AUTO_COOLTIME_MAX = AUTO_COOLTIME_POS_Y * AUTO_COOLTIME_POS_X
AUTO_ONOFF_START = 1
AUTO_ONOFF_ATTACK = 2
AUTO_ONOFF_SKILL = 3
AUTO_ONOFF_POSITION = 4
AUTO_ONOFF_AUTO_RANGE = 5
AUTO_ONOFF_ATTACK_TYPE = 6
def __init__(self, wndInventory):
import exception
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.wndInventory = wndInventory;
self.isloded = 0
self.acikMi = 0
self.tooltipSkill = 0
self.tooltipItem = 0
self.otoAvAcKapa = 0
self.otoAvSlotIndex = {}
self.timeeditlist = {}
self.acKapaButtonlar =[]
self.saveButton = 0
self.otoAvSlot = None
self.AutoSkillClearButton = None
self.AutoPositionClearButton = None
self.AutoAllClearButton = None
self.AutoToolTipButton = None
self.AutoToolTip = None
# self.elMaxHitCount = None
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
self.otoAvSlotIndex = 0
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START,player.OTOMATIK_AV_ITEM_SLOT_END):
self.otoAvSlotIndex = 0
self.AutoSystemToolTipList = [localeInfo.AUTO_TOOLTIP_LINE1,
localeInfo.AUTO_TOOLTIP_LINE2,
localeInfo.AUTO_TOOLTIP_LINE3,
localeInfo.AUTO_TOOLTIP_LINE4,
localeInfo.AUTO_TOOLTIP_LINE5]
self.closegame = False
self.LoadAutoWindow()
self.isFirstReadFile = False
def __del__(self):
ui.ScriptWindow.__del__(self)
self.isloded = 0
self.acikMi = 0
self.tooltipSkill = 0
self.tooltipItem = 0
self.otoAvAcKapa = 0
self.otoAvSlotIndex = {}
self.timeeditlist = {}
self.acKapaButtonlar =[]
self.saveButton = 0
self.otoAvSlot = None
self.AutoSkillClearButton = None
self.AutoPositionClearButton = None
self.AutoAllClearButton = None
self.AutoToolTipButton = None
self.AutoToolTip = None
# self.elMaxHitCount = None
self.closegame = False
self.isFirstReadFile = False
def __LoadWindow(self):
# if app.ENABLE_WINDOW_SLIDE_EFFECT:
# self.EnableSlidingEffect()
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/AutoWindow.py")
self.GetChild("board").SetCloseEvent(ui.__mem_func__(self.Close))
self.imagearka = self.GetChild("image")
self.saveButton = self.GetChild("AutoSaveButton")
self.saveButton.Hide()
self.saveButton.SetEvent(ui.__mem_func__(self.SaveAutoInfo))
self.otogiris_check = ui.CheckBox_AutoHunt()
self.otogiris_check.SetParent(self)
self.otogiris_check.SetPosition(200, 276 - 38 + 26 - 92)
self.otogiris_check.SetEvent(ui.__mem_func__(self.__OnClickEnableAutoLoginOn), "ON_CHECK", True)
self.otogiris_check.SetEvent(ui.__mem_func__(self.__OnClickDisableAutoLoginOf), "ON_UNCKECK", False)
self.otogiris_check.SetTextInfo("")
self.otogiris_check.SetCheckStatus(constInfo.otogiris)
self.otogiris_check.Show()
self.tekvurus_check = ui.CheckBox_AutoHunt()
self.tekvurus_check.SetParent(self)
self.tekvurus_check.SetPosition(200, 276 - 38 + 26 - 92 - 25)
self.tekvurus_check.SetEvent(ui.__mem_func__(self.__OnClickEnableTekVurusOn), "ON_CHECK", True)
self.tekvurus_check.SetEvent(ui.__mem_func__(self.__OnClickDisableTekVurusOf), "ON_UNCKECK", False)
self.tekvurus_check.SetTextInfo("")
self.tekvurus_check.SetCheckStatus(constInfo.otoav_tekvurus)
self.tekvurus_check.Show()
baslatButton = self.GetChild("AutoStartOnButton")
baslatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_START, 0)
self.acKapaButtonlar.append(baslatButton)
durdurButton = self.GetChild("AutoStartOffButton")
durdurButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_START, 1)
durdurButton.Down()
durdurButton.Disable()
self.acKapaButtonlar.append(durdurButton)
saldiriAcButton = self.GetChild("AutoAttackOnButton")
saldiriAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_ATTACK, 2)
self.acKapaButtonlar.append(saldiriAcButton)
#
saldiriKapatButton = self.GetChild("AutoAttackOffButton")
saldiriKapatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_ATTACK, 3)
saldiriKapatButton.Down()
saldiriKapatButton.Disable()
self.acKapaButtonlar.append(saldiriKapatButton)
beceriAcButton = self.GetChild("AutoSkillOnButton")
beceriAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_SKILL, 4)
self.acKapaButtonlar.append(beceriAcButton)
#
beceriKapatButton = self.GetChild("AutoSkillOffButton")
beceriKapatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_SKILL, 5)
beceriKapatButton.Down()
beceriKapatButton.Disable()
self.acKapaButtonlar.append(beceriKapatButton)
iksirAcButton = self.GetChild("AutoPositionlOnButton")
iksirAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_POSITION, 6)
self.acKapaButtonlar.append(iksirAcButton)
#
iksirKapatButton = self.GetChild("AutoPositionlOffButton")
iksirKapatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_POSITION, 7)
iksirKapatButton.Down()
iksirKapatButton.Disable()
self.acKapaButtonlar.append(iksirKapatButton)
odakAcButton = self.GetChild("AutoRangeOnButton")
odakAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_AUTO_RANGE, 8)
self.acKapaButtonlar.append(odakAcButton)
#
odakKapaButton = self.GetChild("AutoRangeOffButton")
odakKapaButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_AUTO_RANGE, 9)
odakKapaButton.Down()
odakKapaButton.Disable()
self.acKapaButtonlar.append(odakKapaButton)
slotOnButton = self.GetChild("AutoSlotOnButton")
slotOnButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_ATTACK_TYPE, 10)
slotOnButton.Down()
slotOnButton.Disable()
self.acKapaButtonlar.append(slotOnButton)
#
metinOnButton = self.GetChild("AutoMetinOnButton")
metinOnButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_ATTACK_TYPE, 11)
self.acKapaButtonlar.append(metinOnButton)
self.AutoSkillClearButton = self.GetChild("AutoSkillClearButton")
self.AutoSkillClearButton.SetEvent(ui.__mem_func__(self.AutoSkillClear))
self.AutoPositionClearButton = self.GetChild("AutoPositionClearButton")
self.AutoPositionClearButton.SetEvent(ui.__mem_func__(self.AutoPositionClear))
self.AutoAllClearButton = self.GetChild("AutoAllClearButton")
self.AutoAllClearButton.SetEvent(ui.__mem_func__(self.AutoAllClear))
self.AutoSkillClearButton.Hide()
self.AutoPositionClearButton.Hide()
self.AutoAllClearButton.Hide()
slotOnButton.Hide()
metinOnButton.Hide()
odakAcButton.Hide()
odakKapaButton.Hide()
iksirAcButton.Hide()
iksirKapatButton.Hide()
beceriAcButton.Hide()
beceriKapatButton.Hide()
saldiriAcButton.Hide()
saldiriKapatButton.Hide()
for x in xrange(self.AUTO_COOLTIME_MAX):
childname = "editline" + str(x)
self.timeeditlist[x] = self.GetChild(childname)
self.timeeditlist[x].SetEscapeEvent(ui.__mem_func__(self.Close))
self.otoAvSlot = self.GetChild("Auto_Active_Skill_Slot_Table")
self.otoAvSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
self.otoAvSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectActiveSkillEmptySlot))
self.otoAvSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectActiveSkillSlot))
self.otoAvSlot.SetOverInItemEvent(ui.__mem_func__(self.OverActiveSkillSlot))
self.otoAvSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverSkillSlotOutItem))
self.otoAvSlot.Hide()
self.AutoToolTipButton = self.GetChild("AutoToolTIpButton")
self.AutoToolTip = self.__CreateGameTypeToolTip(localeInfo.AUTO_TOOLTIP_TITLE,self.AutoSystemToolTipList)
self.AutoToolTip.SetTop()
self.AutoToolTipButton.Hide()
self.AutoToolTipButton.SetToolTipWindow(self.AutoToolTip)
# self.elMaxHitCount = self.GetChild("MaxHitCount")
# self.elMaxHitCount.SetText(str(DEFAULT_MAX_HIT_COUNT))
self.PlayerName = self.GetChild("PlayerName")
self.PlayerLevel = self.GetChild("PlayerLevel")
self.PlayerName.Hide()
self.PlayerLevel.Hide()
wndEquip = self.GetChild("CostumeSlot")
except:
import exception
exception.Abort("AutoWindow.__LoadWindow.UIScript/AutoWindow.py")
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
self.wndEquip = wndEquip
def __CreateGameTypeToolTip(self, title, descList):
toolTip = uiToolTip.ToolTip()
toolTip.SetTitle(title)
toolTip.AppendSpace(5)
for desc in descList:toolTip.AutoAppendTextLine(desc)
toolTip.AlignHorizonalCenter()
toolTip.SetTop()
return toolTip
def AutoSkillClear(self):
if self.GetAutoStartonoff() == False:
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
player.OtoAvSlottanSil(i)
self.otoAvSlotIndex = 0
self.BeceriSlotlariYenile()
def AutoPositionClear(self):
if self.GetAutoStartonoff() == False:
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START,player.OTOMATIK_AV_ITEM_SLOT_END):
player.OtoAvSlottanSil(i)
self.otoAvSlotIndex = 0
self.IksirSlotlariYenile()
def AutoAllClear(self):
if self.GetAutoStartonoff() == False:
self.AutoSkillClear()
self.AutoPositionClear()
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):self.otoAvSlotIndex = 0
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START,player.OTOMATIK_AV_ITEM_SLOT_END):self.otoAvSlotIndex = 0
# self.elMaxHitCount.SetText(str(DEFAULT_MAX_HIT_COUNT))
def IsNumberic(self, text) :
try :
int(text)
return True
except ValueError :
return False
def CheckCooltimeText(self, cooltime):
if cooltime == "":return 0
if not self.IsNumberic(cooltime):return 0
return cooltime
# def get_max_hit_count(self):
# return int(self.elMaxHitCount.GetText())
def AutoOnOff(self, onoff, type, number, command=False):
if not self.isloded: return
if type == self.AUTO_ONOFF_START:
if onoff == 1:
if not player.OtoAvBaslayabilirMi(): return
for i in range(player.OTOMATIK_AV_SKILL_MAX_NUM):
cooltime = self.timeeditlist.GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i, self.otoAvSlotIndex, int(cooltime))
if not cooltime == 0:
player.OtoAvSlotDSAta(i, int(cooltime))
self.timeeditlist.SetText(str(cooltime))
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START, player.OTOMATIK_AV_ITEM_SLOT_END):
cooltime = self.timeeditlist[i-1].GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i, self.otoAvSlotIndex, int(cooltime))
if not cooltime == 0:
player.OtoAvSlotDSAta(i, int(cooltime))
self.timeeditlist[i-1].SetText(str(cooltime))
# if constInfo.otoav_tekvurus == 1:
# player.AutoHuntSetMaxHitCount(1)
# else:
# player.AutoHuntSetMaxHitCount(0)
else:
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START, player.OTOMATIK_AV_ITEM_SLOT_END):
self.SetAutoCooltime(i, 0)
player.OtoAvDurumAta(onoff, command)
self.otoAvAcKapa = onoff
constInf
TOAV = onoff
elif type == self.AUTO_ONOFF_ATTACK:
player.OtoAvSaldiriAta(onoff)
elif type == self.AUTO_ONOFF_SKILL:
player.OtoAvBeceriAta(onoff)
elif type == self.AUTO_ONOFF_POSITION:
player.OtoAvIksirAta(onoff)
elif type == self.AUTO_ONOFF_AUTO_RANGE:
player.OtoAvOdakAta(onoff)
elif type == self.AUTO_ONOFF_ATTACK_TYPE:
player.OtoAvSaldiriTipi(onoff)
if command:
if not onoff:
self.Close()
return
self.acKapaButtonlar[number].Down()
self.acKapaButtonlar[number].Disable()
if onoff == 1:
number += 1
else:
number -= 1
self.acKapaButtonlar[number].SetUp()
self.acKapaButtonlar[number].Enable()
def LoadAutoWindow(self):
if self.isloded == 0:
self.isloded = 1
self.__LoadWindow()
self.SetCenterPosition()
self.AutoOnOff(1, self.AUTO_ONOFF_ATTACK_TYPE, 10)
def Show(self):
if self.isloded == 0:
self.isloded = 1
self.__LoadWindow()
self.SetCenterPosition()
self.SetTop()
self.ReadAutoInfo()
self.IksirSlotlariYenile()
self.BeceriSlotlariYenile()
self.acikMi = 1
ui.ScriptWindow.Show(self)
self.AutoOnOff(0, self.AUTO_ONOFF_ATTACK_TYPE, 11) #met#met#metin self.AutoOnOff(1, self.AUTO_ONOFF_ATTACK, 2) #sal#sal#saldirif OtoLoginSonrasi(self):
if constInfo.otomatik_av_gui_giris_sonrasi == 1 and constInfo.otogiris == 1:
if constInf
TOAV != 1:
constInf
TOAV = 1
self.AutoOnOff(1, self.AUTO_ONOFF_START, 0) #bas#bas#baslat if app.GetTime() > self.otoav_sure:
self.Close()
def OnUpdate(self):
self.OtoLoginSonrasi()
self.PlayerName.SetText("|cffffc21c"+player.GetName())
self.PlayerLevel.SetText("|cffade57d Lv.%d" % (int(player.GetStatus(player.LEVEL))))
getItemVNum=player.GetItemIndex
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_1, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_1), 0)
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_2, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_2), 0)
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_3, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_3), 0)
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_4, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_4), 0)
self.wndEquip.RefreshSlot()
def ReadAutoInfo(self):
import os
if (str)(player.GetName()) == "0": return
dosyaAdi = DOSYA_YOLU + "/" + player.GetName()
if os.path.exists(dosyaAdi): veriTokenler = open(dosyaAdi, "r").read().split()
else: return
satirSayi = len(veriTokenler) / 2
sIndex = 0
if satirSayi > 0:
for xSatir in xrange(satirSayi):
# import chat
slotID = int(str(veriTokenler[sIndex]))
slotCD = int(str(veriTokenler[sIndex+1]))
# chat.AppendChat(1,"xSatir: %s , slotID: %s, cD: %s" % (str(xSatir), str(slotID), str(slotCD)))
if slotID != 0:
if xSatir < player.OTOMATIK_AV_SKILL_MAX_NUM: player.OtoAvSlotaBeceriEkle(xSatir, slotID)
else: player.OtoAvSlotaPotEkle(xSatir, slotID)
player.OtoAvSlotDSAta(xSatir, slotCD)
sIndex += 2
# app.CloseTextFile(handle)
self.isFirstReadFile = True
self.IksirSlotlariYenile()
self.BeceriSlotlariYenile()
def SlotKontrol(self):
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
cooltime = self.timeeditlist.GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i,self.otoAvSlotIndex,int(cooltime))
import dbg
if self.otoAvSlotIndex == 0:self.timeeditlist.SetText("")
if not cooltime == 0:
player.OtoAvSlotDSAta(i,int(cooltime))
self.timeeditlist.SetText(str(cooltime))
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START+1, player.OTOMATIK_AV_ITEM_SLOT_END):
cooltime = self.timeeditlist[i-1].GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i,self.otoAvSlotIndex,int(cooltime))
if not cooltime == 0:
player.OtoAvSlotDSAta(i,int(cooltime))
self.timeeditlist[i-1].SetText(str(cooltime))
def SaveAutoInfo(self):
if (str)(chr.GetName()) == "0":return
self.SlotKontrol()
import os
if os.path.exists(DOSYA_YOLU) is False
s.makedirs(DOSYA_YOLU)
otoAvDosya = open(DOSYA_YOLU + "/" + chr.GetName(), 'w')
for slotIdx in xrange(player.OTOMATIK_AV_ITEM_SLOT_END):
iPos = player.OtoAvSlotAl(slotIdx)
if iPos != 0:
strLine = str(iPos) + '\n'
otoAvDosya.write(strLine)
dSure = player.OtoAvSlotDolumSuresiAl(slotIdx)
if dSure != 0:
strLine = str(dSure) + '\n'
otoAvDosya.write(strLine)
else:
otoAvDosya.write('0\n')
otoAvDosya.write('0\n')
otoAvDosya.close()
def Close(self):
self.Hide()
self.acikMi = 0
if constInfo.otomatik_av_gui_giris_sonrasi == 1:
constInfo.otomatik_av_gui_giris_sonrasi = 0
self.EditLineKillFocus()
def EditLineKillFocus(self):
for x in xrange(self.AUTO_COOLTIME_MAX):self.timeeditlist[x].KillFocus()
def Destroy(self):
self.isloded = 0
self.Hide()
if 0 != self.tooltipSkill:self.tooltipSkill.HideToolTip()
self.otogiris_check = []
def __OnClickEnableAutoLoginOn(self):
constInfo.otogiris = 1
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Otomatik giris aktif.")
def __OnClickDisableAutoLoginOf(self):
constInfo.otogiris = 0
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Otomatik giris pasif.")
def __OnClickEnableTekVurusOn(self):
constInfo.otoav_tekvurus = 1
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Tek Vurus aktif.")
def __OnClickDisableTekVurusOf(self):
constInfo.otoav_tekvurus = 0
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Tek Vurus pasif.")
def OnActivateSkill(self):
if self.acikMi:self.BeceriSlotlariYenile()
def OnDeactivateSkill(self, slotindex):
if self.acikMi:
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
(Position) = player.OtoAvSlotAl(i)
if slotindex == Position:self.otoAvSlot.DeactivateSlot(i)
def OnUseSkill(self, slotindex, coolTime):
if self.acikMi:self.BeceriSlotlariYenile()
def SetSkillToolTip(self, tooltip):
self.tooltipSkill = tooltip
def SetItemToolTip(self, tooltip):
self.tooltipItem = tooltip
def SetAutoCooltime(self, slotindex, cooltime):
self.otoAvSlot.SetSlotCoolTime(slotindex, cooltime, 0)
def SetCloseGame(self):
self.closegame = True
def GetAutoStartonoff(self):
return self.otoAvAcKapa
def IksirSlotlariYenile(self):
for slotindex in range(player.OTOMATIK_AV_ITEM_SLOT_START + 1,player.OTOMATIK_AV_ITEM_SLOT_END):
iPos = player.OtoAvSlotAl(slotindex)
if iPos == 0:
self.otoAvSlot.ClearSlot(slotindex)
self.timeeditlist[slotindex-1].SetText("")
self.otoAvSlotIndex[slotindex] = 0
continue
itemIndex = player.GetItemIndex(iPos)
itemCount = player.GetItemCount(iPos)
if itemCount <= 1:itemCount = 0
self.otoAvSlot.SetItemSlot(slotindex, itemIndex, itemCount)
self.otoAvSlotIndex[slotindex] = iPos
coolTime = player.OtoAvSlotDolumSuresiAl(slotindex)
if self.timeeditlist[slotindex-1].GetText() == "":self.timeeditlist[slotindex-1].SetText(str(coolTime))
if itemIndex == 0:
self.otoAvSlot.ClearSlot(slotindex)
self.timeeditlist[slotindex-1].SetText("")
player.OtoAvSlottanSil(slotindex)
self.otoAvSlot.RefreshSlot()
def BeceriSlotlariYenile(self):
for slotindex in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
sPos = player.OtoAvSlotAl(slotindex)
if sPos == 0:
self.otoAvSlot.ClearSlot(slotindex)
self.timeeditlist[slotindex].SetText("")
self.otoAvSlotIndex[slotindex] = 0
continue
skillIndex = player.GetSkillIndex(sPos)
if 0 == skillIndex:self.otoAvSlot.ClearSlot(slotindex)
skillType = skill.GetSkillType(skillIndex)
if skill.SKILL_TYPE_GUILD == skillType:
import guild
skillGrade = 0
skillLevel = guild.GetSkillLevel(sPos)
else:
skillGrade = player.GetSkillGrade(sPos)
skillLevel = player.GetSkillLevel(sPos)
self.otoAvSlot.SetSkillSlotNew(slotindex, skillIndex, skillGrade, skillLevel)
self.otoAvSlot.SetSlotCountNew(slotindex, skillGrade, skillLevel)
self.otoAvSlot.SetCoverButton(slotindex)
if player.IsSkillCoolTime(sPos):
(coolTime, elapsedTime) = player.GetSkillCoolTime(sPos)
self.otoAvSlot.SetSlotCoolTime(slotindex, coolTime, elapsedTime)
if player.IsSkillActive(sPos):self.otoAvSlot.ActivateSlot(slotindex)
self.otoAvSlotIndex[slotindex] = sPos
coolTime = player.OtoAvSlotDolumSuresiAl(slotindex)
if self.timeeditlist[slotindex].GetText() == "":
self.timeeditlist[slotindex].SetText(str(coolTime))
self.otoAvSlot.RefreshSlot()
def AddAutoSlot(self, slotindex):
AttachedSlotType = mouseModule.mouseController.GetAttachedType()
AttachedSlotNumber = mouseModule.mouseController.GetAttachedSlotNumber()
AttachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
if slotindex <= player.OTOMATIK_AV_SKILL_MAX_NUM:
if player.SLOT_TYPE_SKILL == AttachedSlotType:
player.OtoAvSlotaBeceriEkle(slotindex,AttachedSlotNumber)
self.BeceriSlotlariYenile()
elif player.SLOT_TYPE_OTOMATIK_AV == AttachedSlotType:
if slotindex == AttachedSlotNumber:return
if AttachedSlotNumber >= player.OTOMATIK_AV_SKILL_MAX_NUM:return
player.OtoAvSlotaBeceriEkle(slotindex,AttachedItemIndex)
self.BeceriSlotlariYenile()
else:
if player.SLOT_TYPE_INVENTORY == AttachedSlotType:
itemIndex = player.GetItemIndex(AttachedSlotNumber)
item.SelectItem(itemIndex)
ItemType = item.GetItemType()
ItemSubType = item.GetItemSubType()
itemRemaintime = 0
if not ItemType == item.ITEM_TYPE_USE:return;
if ItemSubType == item.USE_ABILITY_UP:itemRemaintime = item.GetValue(1)
elif ItemSubType == item.USE_AFFECT:itemRemaintime = item.GetValue(3)
if ItemSubType == item.USE_POTION \
or ItemSubType == item.USE_ABILITY_UP \
or ItemSubType == item.USE_POTION_NODELAY \
or ItemSubType == item.USE_AFFECT:
if itemRemaintime < 9999:
player.OtoAvSlotaPotEkle(slotindex,AttachedSlotNumber)
self.IksirSlotlariYenile()
elif player.SLOT_TYPE_OTOMATIK_AV == AttachedSlotType:
if slotindex == AttachedSlotNumber:return
if AttachedSlotNumber <= player.OTOMATIK_AV_SKILL_MAX_NUM:return
player.OtoAvSlotaPotEkle(slotindex,AttachedItemIndex)
self.IksirSlotlariYenile()
mouseModule.mouseController.DeattachObject()
def SelectActiveSkillEmptySlot(self, slotindex):
if self.otoAvAcKapa:return
if True == mouseModule.mouseController.isAttached():self.AddAutoSlot(slotindex)
def SelectActiveSkillSlot(self,slotindex):
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_OTOMATIK_AV, slotindex, self.otoAvSlotIndex[slotindex])
def OverActiveSkillSlot(self,slotindex):
if mouseModule.mouseController.isAttached():return
if slotindex <= player.OTOMATIK_AV_SKILL_MAX_NUM:
sPos = player.OtoAvSlotAl(slotindex)
if sPos == 0:return
skillIndex = player.GetSkillIndex(sPos)
skillType = skill.GetSkillType(skillIndex)
if skill.SKILL_TYPE_GUILD == skillType:
import guild
skillGrade = 0
skillLevel = guild.GetSkillLevel(sPos)
else:
skillGrade = player.GetSkillGrade(sPos)
skillLevel = player.GetSkillLevel(sPos)
self.tooltipSkill.SetSkillNew(sPos, skillIndex, skillGrade, skillLevel)
else:
sPos_ = player.OtoAvSlotAl(slotindex)
self.tooltipItem.SetInventoryItem(sPos_)
self.tooltipSkill.HideToolTip()
def OverSkillSlotOutItem(self):
if 0 != self.tooltipSkill:self.tooltipSkill.HideToolTip()
if 0 != self.tooltipItem:self.tooltipItem.HideToolTip()
def OnPressEscapeKey(self):
self.Close()
return True
class CostumeWindow(ui.ScriptWindow):
def __init__(self, wndInventory):
import exception
if not app.ENABLE_COSTUME_SYSTEM:
exception.Abort("What do you do?")
return
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.isLoaded = 0
self.wndInventory = wndInventory;
if app.ENABLE_HIDE_COSTUME_SYSTEM:
self.visibleButtonList = []
self.__LoadWindow()
if app.ENABLE_WINDOW_ANIMATION:
self.SetWindowAnimation()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
self.__LoadWindow()
self.RefreshCostumeSlot()
ui.ScriptWindow.Show(self)
def Close(self):
self.Hide()
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/CostumeWindow.py")
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.LoadObject")
try:
wndEquip = self.GetChild("CostumeSlot")
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
if app.ENABLE_HIDE_COSTUME_SYSTEM:
self.visibleButtonList.append(self.GetChild("BodyToolTipButton"))
self.visibleButtonList.append(self.GetChild("HairToolTipButton"))
self.visibleButtonList.append(self.GetChild("AcceToolTipButton"))
self.visibleButtonList.append(self.GetChild("WeaponToolTipButton"))
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.BindObject")
## E##ipment
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
self.wndEquip = wndEquip
if app.ENABLE_HIDE_COSTUME_SYSTEM:
self.visibleButtonList[0].SetToggleUpEvent(lambda: self.VisibleCostume(1, 0))
self.visibleButtonList[1].SetToggleUpEvent(lambda: self.VisibleCostume(2, 0))
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.visibleButtonList[2].SetToggleUpEvent(lambda: self.VisibleCostume(3, 0))
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
self.visibleButtonList[3].SetToggleUpEvent(lambda: self.VisibleCostume(4, 0))
self.visibleButtonList[0].SetToggleDownEvent(lambda: self.VisibleCostume(1, 1))
self.visibleButtonList[1].SetToggleDownEvent(lambda: self.VisibleCostume(2, 1))
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.visibleButtonList[2].SetToggleDownEvent(lambda: self.VisibleCostume(3, 1))
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
self.visibleButtonList[3].SetToggleDownEvent(lambda: self.VisibleCostume(4, 1))
def RefreshCostumeSlot(self):
getItemVNum=player.GetItemIndex
for i in xrange(item.COSTUME_SLOT_COUNT):
slotNumber = item.COSTUME_SLOT_START + i
self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
self.wndEquip.SetItemSlot(item.COSTUME_SLOT_WEAPON, getItemVNum(item.COSTUME_SLOT_WEAPON), 0)
self.wndEquip.RefreshSlot()
if app.ENABLE_HIDE_COSTUME_SYSTEM:
def RefreshVisibleCostume(self):
body = constInfo.HIDDEN_BODY_COSTUME
hair = constInfo.HIDDEN_HAIR_COSTUME
if app.ENABLE_ACCE_COSTUME_SYSTEM:
acce = constInfo.HIDDEN_ACCE_COSTUME
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
weapon = constInfo.HIDDEN_WEAPON_COSTUME
if body == 1:
self.visibleButtonList[0].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[0].Down()
else:
self.visibleButtonList[0].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[0].SetUp()
if hair == 1:
self.visibleButtonList[1].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[1].Down()
else:
self.visibleButtonList[1].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[1].SetUp()
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if acce == 1:
self.visibleButtonList[2].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[2].Down()
else:
self.visibleButtonList[2].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[2].SetUp()
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
if weapon == 1:
self.visibleButtonList[3].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[3].Down()
else:
self.visibleButtonList[3].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[3].SetUp()
def VisibleCostume(self, part, hidden):
net.SendChatPacket("/hide_costume %d %d" % (part, hidden))
class MenuWindow(ui.ScriptWindow):
EFSUN_BOTU = 0
BUTON_SANIYE = 1
OFF_SHOP = 2
ARAMA_CAM = 3
RUTBE_RUTBE = 4
SIL_SAT = 5
MENU_BUTTONS = [
["EfsunBotu", EFSUN_BOTU],
["OfflineShop", OFF_SHOP],
["AramaCam", ARAMA_CAM],
["Rutbe", RUTBE_RUTBE],
["SilSat", SIL_SAT],
]
def __init__(self, wndInventory):
import exception
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.isLoaded = 0
self.sonbasma = 0
self.buttons = []
self.wndInventory = wndInventory;
self.__LoadWindow()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
ui.ScriptWindow.Show(self)
self.__LoadWindow()
self.AdjustPositionAndSize()
# self.EkraniAc()
def Close(self):
self.Hide()
def EkraniAc(self):
self.Show()
self.AdjustPositionAndSize()
def GetBasePosition(self):
x, y = self.wndInventory.GetGlobalPosition()
return x - 148 + 90-2+4 +20, y + 241 -30+15-7-20
def AdjustPositionAndSize(self):
bx, by = self.GetBasePosition()
byEK=37+150+6
if self.IsShow():
self.SetPosition(bx-17+15, by+6-byEK)
self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
else:
self.SetPosition(bx + 138 - 90, by+6-byEK);
self.SetSize(10, self.GetHeight())
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/MenuWindow.py")
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.LoadObject")
try:
self.ORIGINAL_WIDTH = self.GetWidth()
# self.Efsun = self.GetChild("Efsun")
# funclist = [
# ui.__mem_func__(self.wndInventory.interface.ToggleSwitchbotWindow),
# ]
idx = 0
for i in self.MENU_BUTTONS:
self.buttons.append(self.GetChild(i[0]))
self.buttons[idx].SetEvent(ui.__mem_func__(self.IslemSec), i[1])
idx += 1
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.BindObject")
def IslemSec(self, gelen):
if self.sonbasma > app.GetTime():
v = self.sonbasma - app.GetTime()
chat.AppendChat(chat.CHAT_TYPE_NOTICE, "%d saniye sonra tekrar deneyin" % (v))
return
if gelen == self.EFSUN_BOTU:
self.wndInventory.interface.ToggleSwitchbotWindow()
if gelen == self.OFF_SHOP:
self.wndInventory.interface.ShowMeOfflineShop()
if gelen == self.ARAMA_CAM:
self.wndInventory.interface.OpenSearchShop()
if gelen == self.RUTBE_RUTBE:
self.wndInventory.interface.ToggleAutoWindow()
if gelen == self.SIL_SAT:
self.wndInventory.interface.OpenDeleteItem()
self.sonbasma = app.GetTime() + self.BUTON_SANIYE
class BeltInventoryWindow(ui.ScriptWindow):
def __init__(self, wndInventory):
import exception
if not app.ENABLE_NEW_EQUIPMENT_SYSTEM:
exception.Abort("What do you do?")
return
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.isLoaded = 0
self.wndInventory = wndInventory;
self.wndBeltInventoryLayer = None
self.wndBeltInventorySlot = None
self.expandBtn = None
self.minBtn = None
self.__LoadWindow()
if app.ENABLE_WINDOW_ANIMATION:
self.SetWindowAnimation()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self, openBeltSlot = False):
self.__LoadWindow()
self.RefreshSlot()
ui.ScriptWindow.Show(self)
if openBeltSlot:
self.OpenInventory()
else:
self.CloseInventory()
def Close(self):
self.Hide()
def IsOpeningInventory(self):
return self.wndBeltInventoryLayer.IsShow()
def OpenInventory(self):
self.wndBeltInventoryLayer.Show()
self.expandBtn.Hide()
if localeInfo.IsARABIC() == 0:
self.AdjustPositionAndSize()
def CloseInventory(self):
self.wndBeltInventoryLayer.Hide()
self.expandBtn.Show()
if localeInfo.IsARABIC() == 0:
self.AdjustPositionAndSize()
def GetBasePosition(self):
x, y = self.wndInventory.GetGlobalPosition()
return x - 148, y + 241
def AdjustPositionAndSize(self):
bx, by = self.GetBasePosition()
if self.IsOpeningInventory():
self.SetPosition(bx, by)
self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
else:
self.SetPosition(bx + 138, by);
self.SetSize(10, self.GetHeight())
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/BeltInventoryWindow.py")
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.LoadObject")
try:
self.ORIGINAL_WIDTH = self.GetWidth()
wndBeltInventorySlot = self.GetChild("BeltInventorySlot")
self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
self.expandBtn = self.GetChild("ExpandBtn")
self.minBtn = self.GetChild("MinimizeBtn")
self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
if localeInfo.IsARABIC() :
self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15)
self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0)
self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15)
for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
slotNumber = item.BELT_INVENTORY_SLOT_START + i
wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\
"d:/ymir work/ui/game/quest/slot_button_01.sub",\
"d:/ymir work/ui/game/quest/slot_button_01.sub",\
"d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False)
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.BindObject")
## E##ipment
wndBeltInventorySlot.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
wndBeltInventorySlot.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
wndBeltInventorySlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndBeltInventorySlot.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndBeltInventorySlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
wndBeltInventorySlot.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
self.wndBeltInventorySlot = wndBeltInventorySlot
def RefreshSlot(self):
getItemVNum=player.GetItemIndex
for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
slotNumber = item.BELT_INVENTORY_SLOT_START + i
self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber))
self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, True)
avail = "0"
if player.IsAvailableBeltInventoryCell(slotNumber):
self.wndBeltInventorySlot.EnableCoverButton(slotNumber)
else:
self.wndBeltInventorySlot.DisableCoverButton(slotNumber)
self.wndBeltInventorySlot.RefreshSlot()
class InventoryWindow(ui.ScriptWindow):
USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET")
if app.ENABLE_USE_COSTUME_ATTR:
USE_TYPE_TUPLE = tuple(list(USE_TYPE_TUPLE) + ["USE_CHANGE_COSTUME_ATTR", "USE_RESET_COSTUME_ATTR"])
questionDialog = None
tooltipItem = None
wndCostume = None
wndBelt = None
dlgPickMoney = None
if app.ENABLE_ITEM_DELETE_SYSTEM:
wndItemDelete = None
wndMenu = None
sellingSlotNumber = -1
isLoaded = 0
isOpenedCostumeWindowWhenClosingInventory = 0
isOpenedBeltWindowWhenClosingInventory = 0
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
liHighlightedItems = []
def __init__(self):
ui.ScriptWindow.__init__(self)
self.isOpenedBeltWindowWhenClosingInventory = 0
self.inventoryPageIndex = 0
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.wndAcceCombine = None
self.wndAcceAbsorption = None
self.__LoadWindow()
if app.ENABLE_WINDOW_ANIMATION:
self.SetWindowAnimation()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
self.__LoadWindow()
ui.ScriptWindow.Show(self)
if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
self.wndCostume.Show()
if self.wndBelt:
self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
if self.wndMenu:
self.wndMenu.Show()
def BindInterfaceClass(self, interface):
self.interface = interface
if app.TITLE_SYSTEM:
def OpenTitle(self):
self.interface.OpenTitle()
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
if app.ENABLE_EXTEND_INVEN_SYSTEM:
pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindowEx.py")
else:
if ITEM_MALL_BUTTON_ENABLE:
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py")
else:
pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py")
except:
import exception
exception.Abort("InventoryWindow.LoadWindow.LoadObject")
try:
wndItem = self.GetChild("ItemSlot")
wndEquip = self.GetChild("EquipmentSlot")
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
self.wndMoney = self.GetChild("Money")
self.wndMoneySlot = self.GetChild("Money_Slot")
self.mallButton = self.GetChild2("MallButton")
self.DSSButton = self.GetChild2("DSSButton")
self.costumeButton = self.GetChild2("CostumeButton")
self.inventoryTab = []
for i in xrange(player.INVENTORY_PAGE_COUNT):
self.inventoryTab.append(self.GetChild("Inventory_Tab_%02d" % (i+1)))
self.equipmentTab = []
self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))
if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM:
self.costumeButton.Hide()
self.costumeButton.Destroy()
self.costumeButton = 0
# Belt Inventory Window
self.wndBelt = None
self.wndBelt = uiAkiraMenu.AkiraMenu(self)
if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
self.wndBelt = BeltInventoryWindow(self)
self.wndMenu = MenuWindow(self)
except:
import exception
exception.Abort("InventoryWindow.LoadWindow.BindObject")
## I##m
wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
## E##ipment
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
## P##kMoneyDialog
dlgPickMoney = uiPickMoney.PickMoneyDialog()
dlgPickMoney.LoadDialog()
dlgPickMoney.Hide()
## R##ineDialog
self.refineDialog = uiRefine.RefineDialog()
self.refineDialog.Hide()
## A##achMetinDialog
self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
self.attachMetinDialog.Hide()
## M##eySlot
self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
for i in xrange(player.INVENTORY_PAGE_COUNT):
self.inventoryTab.SetEvent(lambda arg=i: self.SetInventoryPage(arg))
self.inventoryTab[0].Down()
self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg))
self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg))
self.equipmentTab[0].Down()
self.equipmentTab[0].Hide()
self.equipmentTab[1].Hide()
self.wndItem = wndItem
self.wndEquip = wndEquip
self.dlgPickMoney = dlgPickMoney
# MallButton
if self.mallButton:
self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
if self.DSSButton:
self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton))
# Costume Button
if self.costumeButton:
self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton))
self.wndCostume = None
####### if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.listAttachedAcces = []
## R##resh
self.SetInventoryPage(0)
self.SetEquipmentPage(0)
self.RefreshItemSlot()
self.RefreshStatus()
def Destroy(self):
self.ClearDictionary()
self.dlgPickMoney.Destroy()
self.dlgPickMoney = 0
self.refineDialog.Destroy()
self.refineDialog = 0
self.attachMetinDialog.Destroy()
self.attachMetinDialog = 0
self.tooltipItem = None
self.wndItem = 0
self.wndEquip = 0
self.dlgPickMoney = 0
self.wndMoney = 0
self.wndMoneySlot = 0
self.questionDialog = None
self.mallButton = None
self.DSSButton = None
self.interface = None
if self.wndMenu:
self.wndMenu.Destroy()
self.wndMenu = None
if self.wndCostume:
self.wndCostume.Destroy()
self.wndCostume = 0
if self.wndBelt:
self.wndBelt.Destroy()
self.wndBelt = None
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.wndAcceCombine = None
self.wndAcceAbsorption = None
self.inventoryTab = []
self.equipmentTab = []
def Hide(self):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
self.OnCloseQuestionDialog()
return
if None != self.tooltipItem:
self.tooltipItem.HideToolTip()
if self.wndCostume:
self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow()
self.wndCostume.Close()
if self.wndMenu:
self.wndMenu.Close()
if self.wndBelt:
self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory()
print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory
self.wndBelt.Close()
if self.dlgPickMoney:
self.dlgPickMoney.Close()
wndMgr.Hide(self.hWnd)
def Close(self):
self.Hide()
def SetInventoryPage(self, page):
self.inventoryPageIndex = page
for index in range(len(self.inventoryTab)):
self.inventoryTab[index].SetUp()
self.inventoryTab[page].Down()
self.RefreshBagSlotWindow()
def SetEquipmentPage(self, page):
self.equipmentPageIndex = page
self.equipmentTab[1-page].SetUp()
self.RefreshEquipSlotWindow()
def ClickMallButton(self):
print "click_mall_button"
net.SendChatPacket("/click_mall")
def ClickMallButton(self):
print "click_safebox_button"
net.SendChatPacket("/click_safebox")
# DSSButton
def ClickDSSButton(self):
print "click_dss_button"
self.interface.ToggleDragonSoulWindow()
def ClickCostumeButton(self):
print "Click Costume Button"
if self.wndCostume:
if self.wndCostume.IsShow():
self.wndCostume.Hide()
else:
self.wndCostume.Show()
else:
self.wndCostume = CostumeWindow(self)
self.wndCostume.Show()
def OpenPickMoneyDialog(self):
if mouseModule.mouseController.isAttached():
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType():
if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
snd.PlaySound("sound/ui/money.wav")
mouseModule.mouseController.DeattachObject()
else:
curMoney = player.GetElk()
if curMoney <= 0:
return
self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
self.dlgPickMoney.Open(curMoney)
self.dlgPickMoney.SetMax(9)
def OnPickMoney(self, money):
mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
def OnPickItem(self, count):
itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.INVENTORY, itemSlotIndex):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
selectedItemVNum = player.GetItemIndex(itemSlotIndex)
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)
def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)):
return local
return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local
def RefreshBagSlotWindow(self):
getItemVNum=player.GetItemIndex
getItemCount=player.GetItemCount
setItemVNum=self.wndItem.SetItemSlot
for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
itemCount = getItemCount(slotNumber)
if 0 == itemCount:
self.wndItem.ClearSlot(i)
continue
elif 1 == itemCount:
itemCount = 0
itemVnum = getItemVNum(slotNumber)
setItemVNum(i, itemVnum, itemCount)
if constInfo.IS_AUTO_POTION(itemVnum):
metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
isActivated = 0 != metinSocket[0]
if isActivated:
self.wndItem.ActivateSlot(i)
potionType = 0
if constInfo.IS_AUTO_POTION_HP(itemVnum):
potionType = player.AUTO_POTION_TYPE_HP
elif constInfo.IS_AUTO_POTION_SP(itemVnum):
potionType = player.AUTO_POTION_TYPE_SP
usedAmount = int(metinSocket[1])
totalAmount = int(metinSocket[2])
player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
else:
self.wndItem.DeactivateSlot(i)
if app.ENABLE_ACCE_COSTUME_SYSTEM:
slotNumberChecked = 0
if not constInfo.IS_AUTO_POTION(itemVnum):
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
if not slotNumber in self.liHighlightedItems:
self.wndItem.DeactivateSlot(i)
else:
self.wndItem.DeactivateSlot(i)
for j in xrange(acce.WINDOW_MAX_MATERIALS):
(isHere, iCell) = acce.GetAttachedItem(j)
if isHere:
if iCell == slotNumber:
self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
if not slotNumber in self.listAttachedAcces:
self.listAttachedAcces.append(slotNumber)
slotNumberChecked = 1
else:
if slotNumber in self.listAttachedAcces and not slotNumberChecked:
self.wndItem.DeactivateSlot(i)
self.listAttachedAcces.remove(slotNumber)
elif app.ENABLE_HIGHLIGHT_NEW_ITEM and not constInfo.IS_AUTO_POTION(itemVnum):
if not slotNumber in self.liHighlightedItems:
self.wndItem.DeactivateSlot(i)
self.wndItem.RefreshSlot()
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
self.__RefreshHighlights()
if self.wndBelt:
self.wndBelt.RefreshSlot()
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
def HighlightSlot(self, slot):
if not slot in self.liHighlightedItems:
self.liHighlightedItems.append(slot)
def __RefreshHighlights(self):
for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
if slotNumber in self.liHighlightedItems:
self.wndItem.ActivateSlot(i)
def RefreshEquipSlotWindow(self):
getItemVNum=player.GetItemIndex
getItemCount=player.GetItemCount
setItemVNum=self.wndEquip.SetItemSlot
for i in xrange(player.EQUIPMENT_PAGE_COUNT):
slotNumber = player.EQUIPMENT_SLOT_START + i
itemCount = getItemCount(slotNumber)
if itemCount <= 1:
itemCount = 0
setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT):
slotNumber = player.NEW_EQUIPMENT_SLOT_START + i
itemCount = getItemCount(slotNumber)
if itemCount <= 1:
itemCount = 0
setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
print "ENABLE_NEW_EQUIPMENT_SYSTEM", slotNumber, itemCount, getItemVNum(slotNumber)
self.wndEquip.RefreshSlot()
if self.wndCostume:
self.wndCostume.RefreshCostumeSlot()
def RefreshItemSlot(self):
self.RefreshBagSlotWindow()
self.RefreshEquipSlotWindow()
def RefreshStatus(self):
if app.RENEWAL_REFRESH:
self.GetChild("Money").SetText(player.GetElk())
# if app.ENABLE_GEM_SYSTEM:
# self.GetChild("Gem").SetText(player.GetGem())
# else:
# self.GetChild("Money").SetText(localeInfo.NumberToMoneyString(player.GetElk()))
# if app.ENABLE_GEM_SYSTEM:
# self.GetChild("Gem").SetText(localeInfo.NumberToMoneyGem(player.GetGem()))
if app.RENEWAL_REFRESH:
def OnUpdate(self):
try:
self.GetChild("Money").OnUpdateCool()
# if app.ENABLE_GEM_SYSTEM:
# self.GetChild("Gem").OnUpdateCool()
except KeyError:
print("Key error: Money")
def SetItemToolTip(self, tooltipItem):
self.tooltipItem = tooltipItem
def SellItem(self):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.INVENTORY, self.sellingSlotNumber):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
snd.PlaySound("sound/ui/money.wav")
self.OnCloseQuestionDialog()
def OnDetachMetinFromItem(self):
if None == self.questionDialog:
return
#net#net.SendItemUseToItemPacket(self.questionDialog.sourcePoslf.questionDialog.targetPos)
self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
self.OnCloseQuestionDialog()
def OnCloseQuestionDialog(self):
if not self.questionDialog:
return
self.questionDialog.Close()
self.questionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
## S##t Event
def SelectEmptySlot(self, selectedSlotPos):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
return
selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)
if mouseModule.mouseController.isAttached():
attachedSlotType = mouseModule.mouseController.GetAttachedType()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.SlotTypeToInvenType(attachedSlotType),attachedSlotPos):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
#@fi#@fi#@fixme011INock ds equip)
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
mouseModule.mouseController.DeattachObject()
return
#@fi#@fi#@fixme011 itemCount = player.GetItemCount(attachedSlotPos)
attachedCount = mouseModule.mouseController.GetAttachedItemCount()
self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
if item.IsRefineScroll(attachedItemIndex):
self.wndItem.SetUseMode(False)
elif player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AKIRA_TEXT_2)
elif player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AKIRA_TEXT_3)
elif player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AKIRA_TEXT_0)
elif app.ENABLE_SWITCHBOT and player.SLOT_TYPE_SWITCHBOT == attachedSlotType:
attachedCount = mouseModule.mouseController.GetAttachedItemCount()
net.SendItemMovePacket(player.SWITCHBOT, attachedSlotPos, player.INVENTORY, selectedSlotPos, attachedCount)
elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
mouseModule.mouseController.RunCallBack("INVENTORY")
elif player.SLOT_TYPE_SHOP == attachedSlotType:
net.SendShopBuyPacket(attachedSlotPos)
elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
chat.AppendChat(1, localeInfo.AKIRA_TEXT_1)
if player.ITEM_MONEY == attachedItemIndex:
net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
snd.PlaySound("sound/ui/money.wav")
else:
net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
elif player.SLOT_TYPE_MALL == attachedSlotType:
net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
mouseModule.mouseController.DeattachObject()
def SelectItemSlot(self, itemSlotIndex):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
return
itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
if mouseModule.mouseController.isAttached():
attachedSlotType = mouseModule.mouseController.GetAttachedType()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
if app.ENABLE_SPECIAL_STORAGE:
if player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType:
#@fi#@fi#@fixme011INock ds equip)
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
mouseModule.mouseController.DeattachObject()
return
#@fi#@fi#@fixme011 self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
else:
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
#@fi#@fi#@fixme011INock ds equip)
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
mouseModule.mouseController.DeattachObject()
return
#@fi#@fi#@fixme011 self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
mouseModule.mouseController.DeattachObject()
else:
curCursorNum = app.GetCursor()
if app.SELL == curCursorNum:
self.__SellItem(itemSlotIndex)
elif app.BUY == curCursorNum:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
elif app.IsPressed(app.DIK_LALT):
link = player.GetItemLink(itemSlotIndex)
ime.PasteString(link)
elif app.IsPressed(app.DIK_LSHIFT):
itemCount = player.GetItemCount(itemSlotIndex)
if itemCount > 1:
self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE)
self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
self.dlgPickMoney.Open(itemCount)
self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
#els#els#else #sel#sel#selectedItemVNumlayer.GetItemIndex(itemSlotIndex #mou#mou#mouseModule.mouseController.AttachObject(selfayer.SLOT_TYPE_INVENTORYemSlotIndex, selectedItemVNum)
elif app.IsPressed(app.DIK_LCONTROL):
itemIndex = player.GetItemIndex(itemSlotIndex)
if True == item.CanAddToQuickSlotItem(itemIndex):
player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
else:
selectedItemVNum = player.GetItemIndex(itemSlotIndex)
itemCount = player.GetItemCount(itemSlotIndex)
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):
self.wndItem.SetUseMode(True)
else:
self.wndItem.SetUseMode(False)
snd.PlaySound("sound/ui/pick.wav")
def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):
if app.ENABLE_SPECIAL_STORAGE:
if srcItemSlotPos == dstItemSlotPos and not item.IsMetin(srcItemVID):
return
else:
if srcItemSlotPos == dstItemSlotPos:
return
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and (uinewofflineshop.IsSaleSlot(player.INVENTORY, srcItemSlotPos) or uinewofflineshop.IsSaleSlot(player.INVENTORY , dstItemSlotPos)):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
# cyh itemseal 2013 11 08
if app.ENABLE_SOULBIND_SYSTEM and item.IsSealScroll(srcItemVID):
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
elif item.IsRefineScroll(srcItemVID):
self.RefineItem(srcItemSlotPos, dstItemSlotPos)
self.wndItem.SetUseMode(False)
elif item.IsMetin(srcItemVID):
self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)
elif item.IsDetachScroll(srcItemVID):
self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos)
elif item.IsKey(srcItemVID):
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE:
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
else:
#snd#snd#snd.PlaySound(nddrop.wav")
if player.IsEquipmentSlot(dstItemSlotPos):
if item.IsEquipmentVID(srcItemVID):
self.__UseItem(srcItemSlotPos)
else:
self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
#net#net#net.SendItemMovePacket(srcItemSlotPostItemSlotPos
def __SellItem(self, itemSlotPos):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
if not player.IsEquipmentSlot(itemSlotPos):
self.sellingSlotNumber = itemSlotPos
itemIndex = player.GetItemIndex(itemSlotPos)
itemCount = player.GetItemCount(itemSlotPos)
self.sellingSlotitemIndex = itemIndex
self.sellingSlotitemCount = itemCount
item.SelectItem(itemIndex)
## 2##40220
if item.IsAntiFlag(item.ANTIFLAG_SELL):
popup = uiCommon.PopupDialog()
popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
popup.SetAcceptEvent(self.__OnClosePopupDialog)
popup.Open()
self.popup = popup
return
itemPrice = item.GetISellItemPrice()
if item.Is1GoldItem():
itemPrice = itemCount / itemPrice / 5
else:
itemPrice = itemPrice * itemCount / 5
item.GetItemName(itemIndex)
itemName = item.GetItemName()
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice))
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
self.questionDialog.Open()
self.questionDialog.count = itemCount
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
def __OnClosePopupDialog(self):
self.pop = None
def RefineItem(self, scrollSlotPos, targetSlotPos):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
scrollIndex = player.GetItemIndex(scrollSlotPos)
targetIndex = player.GetItemIndex(targetSlotPos)
if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotPos):
return
###########################################################
self.__SendUseItemToItemPacket(scrollSlotPos, targetSlotPos)
#net#net#net.SendItemUseToItemPacket(scrollSlotPosrgetSlotPos return
###########################################################
###########################################################
#net#net#net.SendRequestRefineInfoPacket(targetSlotPos #ret#ret#return ###########################################################
result = player.CanRefine(scrollIndex, targetSlotPos)
if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_MORE_SOCKET)
elif player.REFINE_NEED_MORE_GOOD_SCROLL == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NEED_BETTER_SCROLL)
elif player.REFINE_CANT_MAKE_SOCKET_ITEM == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_SOCKET_DISABLE_ITEM)
elif player.REFINE_NOT_NEXT_GRADE_ITEM == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM)
elif player.REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
if player.REFINE_OK != result:
return
self.refineDialog.Open(scrollSlotPos, targetSlotPos)
def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
scrollIndex = player.GetItemIndex(scrollSlotPos)
targetIndex = player.GetItemIndex(targetSlotPos)
if not player.CanDetach(scrollIndex, targetSlotPos):
if app.ENABLE_ACCE_COSTUME_SYSTEM:
item.SelectItem(scrollIndex)
if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_FAILURE_CLEAN)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
return
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
if app.ENABLE_ACCE_COSTUME_SYSTEM:
item.SelectItem(targetIndex)
if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
item.SelectItem(scrollIndex)
if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
self.questionDialog.SetText(localeInfo.ACCE_DO_YOU_CLEAN)
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
self.questionDialog.Open()
self.questionDialog.sourcePos = scrollSlotPos
self.questionDialog.targetPos = targetSlotPos
def AttachMetinToItem(self, metinSlotPos, targetSlotPos):
if app.ENABLE_SPECIAL_STORAGE:
metinIndex = player.GetItemIndex(player.STONE_INVENTORY, metinSlotPos)
else:
metinIndex = player.GetItemIndex(metinSlotPos)
targetIndex = player.GetItemIndex(targetSlotPos)
item.SelectItem(metinIndex)
itemName = item.GetItemName()
result = player.CanAttachMetin(metinIndex, targetSlotPos)
if player.ATTACH_METIN_NOT_MATCHABLE_ITEM == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_CAN_NOT_ATTACH(itemName))
if player.ATTACH_METIN_NO_MATCHABLE_SOCKET == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_SOCKET(itemName))
elif player.ATTACH_METIN_NOT_EXIST_GOLD_SOCKET == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_GOLD_SOCKET(itemName))
elif player.ATTACH_METIN_CANT_ATTACH_TO_EQUIPMENT == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
if player.ATTACH_METIN_OK != result:
return
self.attachMetinDialog.Open(metinSlotPos, targetSlotPos)
def OverOutItem(self):
self.wndItem.SetUsableItem(False)
if None != self.tooltipItem:
self.tooltipItem.HideToolTip()
def OverInItem(self, overSlotPos):
overSlotPosGlobal = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
self.wndItem.SetUsableItem(False)
if app.ENABLE_HIGHLIGHT_NEW_ITEM and overSlotPosGlobal in self.liHighlightedItems:
self.liHighlightedItems.remove(overSlotPosGlobal)
self.wndItem.DeactivateSlot(overSlotPos)
if mouseModule.mouseController.isAttached():
attachedItemType = mouseModule.mouseController.GetAttachedType()
if app.ENABLE_SPECIAL_STORAGE:
if player.SLOT_TYPE_INVENTORY == attachedItemType or player.SLOT_TYPE_STONE_INVENTORY == attachedItemType:
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
if attachedItemVNum==player.ITEM_MONEY: # @fixme005
pass
elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPosGlobal):
self.wndItem.SetUsableItem(True)
self.wndItem.SetUseMode(True)
self.ShowToolTip(overSlotPosGlobal)
return
else:
if player.SLOT_TYPE_INVENTORY == attachedItemType:
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
if attachedItemVNum==player.ITEM_MONEY: # @fixme005
pass
elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPosGlobal):
self.wndItem.SetUsableItem(True)
self.ShowToolTip(overSlotPosGlobal)
return
self.ShowToolTip(overSlotPosGlobal)
def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos):
"다른 아이템에 사용할 수 있는 아이템인가?"
if item.IsRefineScroll(srcItemVNum):
return True
elif item.IsMetin(srcItemVNum):
return True
elif item.IsDetachScroll(srcItemVNum):
return True
elif item.IsKey(srcItemVNum):
return True
elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
return True
else:
if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE:
return True
return False
def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):
if app.ENABLE_SPECIAL_STORAGE:
if srcSlotPos == dstSlotPos and not item.IsMetin(srcItemVNum):
return False
else:
if srcSlotPos == dstSlotPos:
return False
if item.IsRefineScroll(srcItemVNum):
if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos):
return True
elif item.IsMetin(srcItemVNum):
if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos):
return True
elif item.IsDetachScroll(srcItemVNum):
if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos):
return True
elif item.IsKey(srcItemVNum):
if player.CanUnlock(srcItemVNum, dstSlotPos):
return True
elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
return True
else:
useType=item.GetUseType(srcItemVNum)
if "USE_CLEAN_SOCKET" == useType:
if self.__CanCleanBrokenMetinStone(dstSlotPos):
return True
elif "USE_CHANGE_ATTRIBUTE" == useType:
if self.__CanChangeItemAttrList(dstSlotPos):
return True
elif "USE_ADD_ATTRIBUTE" == useType:
if self.__CanAddItemAttr(dstSlotPos):
return True
elif "USE_ADD_ATTRIBUTE2" == useType:
if self.__CanAddItemAttr(dstSlotPos):
return True
elif "USE_ADD_ACCESSORY_SOCKET" == useType:
if self.__CanAddAccessorySocket(dstSlotPos):
return True
elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
return True;
elif "USE_PUT_INTO_BELT_SOCKET" == useType:
dstItemVNum = player.GetItemIndex(dstSlotPos)
print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum
item.SelectItem(dstItemVNum)
if item.ITEM_TYPE_BELT == item.GetItemType():
return True
elif app.ENABLE_USE_COSTUME_ATTR and "USE_CHANGE_COSTUME_ATTR" == useType:
if self.__CanChangeCostumeAttrList(dstSlotPos):
return True
elif app.ENABLE_USE_COSTUME_ATTR and "USE_RESET_COSTUME_ATTR" == useType:
if self.__CanResetCostumeAttr(dstSlotPos):
return True
return False
def __CanCleanBrokenMetinStone(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.ITEM_TYPE_WEAPON != item.GetItemType():
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
return True
return False
def __CanChangeItemAttrList(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
return True
return False
if app.ENABLE_USE_COSTUME_ATTR:
def __CanChangeCostumeAttrList(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_COSTUME:
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
return True
return False
def __CanResetCostumeAttr(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_COSTUME:
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
return True
return False
def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_ARMOR:
return False
if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
return False
curCount = player.GetItemMetinSocket(dstSlotPos, 0)
maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
return False
if curCount>=maxCount:
return False
return True
def __CanAddAccessorySocket(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_ARMOR:
return False
if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
return False
curCount = player.GetItemMetinSocket(dstSlotPos, 0)
maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
ACCESSORY_SOCKET_MAX_SIZE = 3
if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
return False
return True
def __CanAddItemAttr(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False
attrCount = 0
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
attrCount += 1
if attrCount<4:
return True
return False
def ShowToolTip(self, slotIndex):
if None != self.tooltipItem:
self.tooltipItem.SetInventoryItem(slotIndex)
# if app.ENABLE_RENDER_TARGET:
# self.tooltipItem.AppendRenderingTooltip(itemVnum)
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() or uinewofflineshop.IsBuildingAuction():
self.__AddTooltipSaleMode(slotIndex)
if app.__ENABLE_NEW_OFFLINESHOP__:
def __AddTooltipSaleMode(self, slot):
if player.IsEquipmentSlot(slot):
return
itemIndex = player.GetItemIndex(slot)
if itemIndex !=0:
item.SelectItem(itemIndex)
if item.IsAntiFlag(item.ANTIFLAG_MYSHOP) or item.IsAntiFlag(item.ANTIFLAG_GIVE):
return
self.tooltipItem.AddRightClickForSale()
def OnTop(self):
if None != self.tooltipItem:
self.tooltipItem.SetTop()
def OnPressEscapeKey(self):
self.Close()
return True
def UseItemSlot(self, slotIndex):
curCursorNum = app.GetCursor()
if app.SELL == curCursorNum:
return
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
return
slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop():
globalSlot = slotIndex
itemIndex = player.GetItemIndex(globalSlot)
item.SelectItem(itemIndex)
if not item.IsAntiFlag(item.ANTIFLAG_GIVE) and not item.IsAntiFlag(item.ANTIFLAG_MYSHOP):
offlineshop.ShopBuilding_AddInventoryItem(globalSlot)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
elif uinewofflineshop.IsBuildingAuction():
globalSlot = slotIndex
itemIndex = player.GetItemIndex(globalSlot)
item.SelectItem(itemIndex)
if not item.IsAntiFlag(item.ANTIFLAG_GIVE) and not item.IsAntiFlag(item.ANTIFLAG_MYSHOP):
offlineshop.AuctionBuilding_AddInventoryItem(globalSlot)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
if app.ENABLE_DRAGON_SOUL_SYSTEM:
if self.wndDragonSoulRefine.IsShow():
self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1)
return
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if self.isShowAcceWindow():
acce.Add(player.INVENTORY, slotIndex, 255)
return
if app.ENABLE_ITEM_DELETE_SYSTEM:
if self.isShowDeleteItemDlg():
self.wndItemDelete.AddItemWithoutMouse(player.INVENTORY, slotIndex)
return
self.__UseItem(slotIndex)
mouseModule.mouseController.DeattachObject()
self.OverOutItem()
def __UseItem(self, slotIndex):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.INVENTORY, slotIndex):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
ItemVNum = player.GetItemIndex(slotIndex)
item.SelectItem(ItemVNum)
if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
self.questionDialog.Open()
self.questionDialog.slotIndex = slotIndex
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
# elif app.ENABLE_RENDER_TARGET and app.IsPressed(app.DIK_LSHIFT):
# self.tooltipItem.ModelPreviewFull(ItemVNum, slotIndex)
else:
self.__SendUseItemPacket(slotIndex)
#net.SendItemUsePacket(slotIndex)
#net.SendItemUsePacket(slotIndexCloseQuestionDialog()
def __UseItemQuestionDialog_OnAccept(self):
self.__SendUseItemPacket(self.questionDialog.slotIndex)
self.OnCloseQuestionDialog()
def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemUseToItemPacket(srcSlotPos, dstSlotPos)
def __SendUseItemPacket(self, slotPos):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemUsePacket(slotPos)
def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
return
if app.ENABLE_SPECIAL_STORAGE:
if mouseModule.mouseController.isAttached():
attachedSlotType = mouseModule.mouseController.GetAttachedType()
if attachedSlotType == player.UPGRADE_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Y?seltme envanterine normal envanterinden item aktaramazs?!")
return
if attachedSlotType == player.BOOK_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Kitap envanterine normal envanterinden item aktaramazs?!")
return
if attachedSlotType == player.STONE_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Ta envanterine normal envanterinden item aktaramazs?!")
return
if attachedSlotType == player.CHEST_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Sand? envanterine normal envanterinden item aktaramazs?!")
return
net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
def SetDragonSoulRefineWindow(self, wndDragonSoulRefine):
if app.ENABLE_DRAGON_SOUL_SYSTEM:
self.wndDragonSoulRefine = wndDragonSoulRefine
if app.ENABLE_HIDE_COSTUME_SYSTEM:
def RefreshVisibleCostume(self):
if self.wndCostume:
self.wndCostume.RefreshVisibleCostume()
else:
self.wndCostume = CostumeWindow(self)
self.wndCostume.RefreshVisibleCostume()
def OnMoveWindow(self, x, y):
# print "Inventory Global Pos : ", self.GetGlobalPosition()
if self.wndBelt:
# print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
self.wndBelt.AdjustPositionAndSize()
if self.wndMenu:
# print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
self.wndMenu.AdjustPositionAndSize()
if app.ENABLE_ACCE_COSTUME_SYSTEM:
def SetAcceWindow(self, wndAcceCombine, wndAcceAbsorption):
self.wndAcceCombine = wndAcceCombine
self.wndAcceAbsorption = wndAcceAbsorption
def isShowAcceWindow(self):
if self.wndAcceCombine:
if self.wndAcceCombine.IsShow():
return 1
if self.wndAcceAbsorption:
if self.wndAcceAbsorption.IsShow():
return 1
return 0
if app.ENABLE_WHEEL_MOUSE:
def OnRunMouseWheel(self, nLen):
if nLen > 0:
if self.inventoryPageIndex < 4:
self.SetInventoryPage(self.inventoryPageIndex + 1)
else:
if self.inventoryPageIndex > 0:
self.SetInventoryPage(self.inventoryPageIndex - 1)
if app.ENABLE_DROP_DIALOG_EXTENDED_SYSTEM:
def DeleteItem(self, slotPos, invenType):
itemIndex = player.GetItemIndex(invenType, slotPos)
item.SelectItem(itemIndex)
itemQuestionDialog2 = uiCommon.ItemQuestionDialog2()
itemQuestionDialog2.SetText('[%s] nesnesine ne yapmak istiyorsun?' % item.GetItemName())
itemQuestionDialog2.SetText2('(Fiyat: %s)' % localeInfo.NumberToMoneyString(item.GetISellItemPrice() * player.GetItemCount(invenType, slotPos) * 100 / 100))
itemQuestionDialog2.SetDeleteAcceptEvent(lambda arg = 0: self.__AnswerDeleteItem(arg))
itemQuestionDialog2.SetSellAcceptEvent(lambda arg = 1: self.__AnswerDeleteItem(arg))
itemQuestionDialog2.SetCancelEvent(lambda arg = 2: self.__AnswerDeleteItem(arg))
itemQuestionDialog2.Open()
itemQuestionDialog2.slotPos = slotPos
itemQuestionDialog2.invenType = invenType
self.itemQuestionDialog2 = itemQuestionDialog2
def __AnswerDeleteItem(self, answer):
if not self.itemQuestionDialog2:
return
else:
if answer == 0:
net.SendItemDeletePacket(self.itemQuestionDialog2.slotPos, self.itemQuestionDialog2.invenType)
snd.PlaySound('sound/ui/drop.wav')
elif answer == 1:
net.SendItemSellPacket(self.itemQuestionDialog2.slotPos, self.itemQuestionDialog2.invenType)
snd.PlaySound('sound/ui/money.wav')
self.itemQuestionDialog2.Close()
self.itemQuestionDialog2 = None
return
if app.ENABLE_ITEM_DELETE_SYSTEM:
def SetDeleteItemDlg(self, wndItemDelete):
self.wndItemDelete = wndItemDelete
def isShowDeleteItemDlg(self):
if self.wndItemDelete:
if self.wndItemDelete.IsShow():
return 1
return 0[/CODE]
[CODE title="constinfo.py"]# EXTRA BEGIN
# loads 5 (B,M,G,P,F) skills .mse
ENABLE_NEW_LEVELSKILL_SYSTEM = 0
# don't set a random channel when you open the client
ENABLE_RANDOM_CHANNEL_SEL = 0
# don't remove id&pass if the login attempt fails
ENABLE_CLEAN_DATA_IF_FAIL_LOGIN = 0
# ctrl+v will now work
ENABLE_PASTE_FEATURE = 0
# display all the bonuses added by a stone instead of the first one
ENABLE_FULLSTONE_DETAILS = 1
# enable successfulness % in the refine dialog
ENABLE_REFINE_PCT = 0
# extra ui features
EXTRA_UI_FEATURE = 1
#
# LOGİN CACHE DATA
LoadData = 0
# LOGİN CACHE DATA
NEW_678TH_SKILL_ENABLE = 1
# EXTRA END
#DEPO
depolar = 1
#DEPO END
import app
if #DEPONABLE_OFFICAL#DEPOACTER_SCREEN:
W#DEPONABLE_OFFICALD" # ENABLED/DISABLED
WOLF_WOMEN = "DISABLED" # ENABLED/DISABLED
# enable save account
ENABLE_SAVE_ACCOUNT = True
if ENABLE_SAVE_ACCOUNT:
class SAB:
ST_CACHE, ST_FILE, ST_REGISTRY = xrange(3)
slotCount = 5
storeType = ST_REGISTRY # 0 cache, 1 file, 2 registry
btnName = {
"Save": "SaveAccountButton_Save_%02d",
"Access": "SaveAccountButton_Access_%02d",
"Remove": "SaveAccountButton_Remove_%02d",
}
accData = {}
regPath = r"SOFTWARE\Metin2"
regName = "slot%02d_%s"
regValueId = "id"
regValuePwd = "pwd"
fileExt = ".do.not.share.it.txt"
import app
if app.AUTO_SHOUT:
auto_shout_status = 0
auto_shout_text = ""
CHAT_TELEPORT_NEW = 0
if app.LORENZO_RENKLI_SOHBET:
chat_color_page_open = 0
chat_color = ""
if app.ENABLE_CHANNEL_INFO_UPDATE:
SERVER_TYPE = 0
if app.ENABLE_SEND_TARGET_INFO:
MONSTER_INFO_DATA = {}
if app.ENABLE_RENDER_TARGET:
ENABLE_MODEL_PREVIEW = 1
if app.ENABLE_KILL_STATISTICS:
KILL_STATISTICS_DATA = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]
if app.ENABLE_HIDE_COSTUME_SYSTEM:
HIDDEN_BODY_COSTUME = 0
HIDDEN_HAIR_COSTUME = 0
# HIDE_COSTUME = 0
if app.ENABLE_ACCE_COSTUME_SYSTEM:
HIDDEN_ACCE_COSTUME = 0
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
HIDDEN_WEAPON_COSTUME = 0
if app.ENABLE_ITEM_DELETE_SYSTEM:
silme = 0
ITEM_DELETE_LIST = {}
if app.BOSS_ARENA:
bossarena = []
MONSTER_INFO_DATA_VNUM = {}
secilenBoss = 0
if app.FT_GAME_MENU:
SPEED_BUTTON=0
MENU_RUTBE = 0
MENU_MARKET = 0
MENU_OTO = 0
MENU_ZINDAN = 0
MENU_CUBE = 0
if app.TITLE_SYSTEM:
title_status = {
0 : ["0"],
1 : ["0"],
2 : ["0"],
3 : ["0"],
4 : ["0"],
5 : ["0"]
}
TitleUpgradeItems = [
# Boş Title --Dokunma--
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Canavar Avcısı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Metin Avcısı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Patron Avcısı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Avcı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Katil
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
]
]
TitleBonus = [
# Boş Title --Dokunma--
[
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
# Canavar Avcısı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",1,2,5],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
# Metin Avcısı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",5,7,10],
["Metinlere Karþý Gü笼",5,7,10],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
# Patron Avcısı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",10,15,20],
["Metinlere Karþý Gü笼",10,15,20],
["Yarý ݮsanlara Karþý Gü笼",10,15,20],
[0,0,0,0],
[0,0,0,0]
],
# Avcı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",20,25,30],
["Metinlere Karþý Gü笼",20,25,30],
["Yarý ݮsanlara Karþý Gü笼",20,25,30],
["Ortalama Zarar",1,3,5],
[0,0,0,0]
],
# Katil
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",30,40,50],
["Metinlere Karþý Gü笼",30,40,50],
["Yarý ݮsanlara Karþý Gü笼",30,40,50],
["Ortalama Zarar",7,9,10],
["Beceri Hasarý",5,10,15]
]
]
def CreateSABDataFolder(filePath):
import os
folderPath = os.path.split(filePath)[0]
if not os.path.exists(folderPath):
os.makedirs(folderPath)
def IsExistSABDataFile(filePath):
import os
return os.path.exists(filePath)
def GetSABDataFile(idx):
import os
filePath = "%s\\Metin2\\" % os.getenv('appdata')
filePath += SAB.regName % (idx, SAB.regValueId)
filePath += SAB.fileExt
return filePath
def DelJsonSABData(idx):
import os
filePath = GetSABDataFile(idx)
if IsExistSABDataFile(filePath):
os.remove(filePath)
def GetJsonSABData(idx):
(id, pwd) = ("", "")
filePath = GetSABDataFile(idx)
if not IsExistSABDataFile(filePath):
return (id, pwd)
with old_open(filePath) as data_file:
try:
import json
(id, pwd) = json.load(data_file)
id = str(id) # unicode to ascii
pwd = str(pwd) # unicode to ascii
except ValueError:
pass
return (id, pwd)
def SetJsonSABData(idx, slotData):
filePath = GetSABDataFile(idx)
CreateSABDataFolder(filePath)
with old_open(filePath, "w") as data_file:
import json
json.dump(slotData, data_file)
def DelWinRegKeyValue(keyPath, keyName):
try:
import _winreg
_winreg.CreateKey(_winreg.HKEY_CURRENT_USER, keyPath)
_tmpKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, keyPath, 0, _winreg.KEY_WRITE)
_winreg.DeleteValue(_tmpKey, keyName)
_winreg.CloseKey(_tmpKey)
return True
except WindowsError:
return False
def GetWinRegKeyValue(keyPath, keyName):
try:
import _winreg
_tmpKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, keyPath, 0, _winreg.KEY_READ)
keyValue, keyType = _winreg.QueryValueEx(_tmpKey, keyName)
_winreg.CloseKey(_tmpKey)
return str(keyValue) # unicode to ascii
except WindowsError:
return None
def SetWinRegKeyValue(keyPath, keyName, keyValue):
try:
import _winreg
_winreg.CreateKey(_winreg.HKEY_CURRENT_USER, keyPath)
_tmpKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, keyPath, 0, _winreg.KEY_WRITE)
_winreg.SetValueEx(_tmpKey, keyName, 0, _winreg.REG_SZ, keyValue)
_winreg.CloseKey(_tmpKey)
return True
except WindowsError:
return False
# classic minmax def
def minmax(tmin, tmid, tmax):
if tmid < tmin:
return tmin
elif tmid > tmax:
return tmax
return tmid
# EXTRA END
# eğer yoksa müsait bir yere ekle
_interface_instance = None
def GetInterfaceInstance():
global _interface_instance
return _interface_instance
def SetInterfaceInstance(instance):
global _interface_instance
if _interface_instance:
del _interface_instance
_interface_instance = instance
akiraefsun = None
AkiraMenu = {0:0,1:0,2:0,3:0,4:0,5:1}
CApiSetHide = 0
INPUT_IGNORE = 0
# option
IN_GAME_SHOP_ENABLE = 1
CONSOLE_ENABLE = 0
PVPMODE_ENABLE = 1
PVPMODE_TEST_ENABLE = 0
PVPMODE_ACCELKEY_ENABLE = 1
PVPMODE_ACCELKEY_DELAY = 0.5
PVPMODE_PROTECTED_LEVEL = 15
FOG_LEVEL0 = 999999.0
FOG_LEVEL1 = 999999.0
FOG_LEVEL2 = 999999.0
FOG_LEVEL = FOG_LEVEL0
FOG_LEVEL_LIST=[FOG_LEVEL0, FOG_LEVEL1, FOG_LEVEL2]
CAMERA_MAX_DISTANCE_SHORT = 2500.0
CAMERA_MAX_DISTANCE_LONG = 3500.0
CAMERA_MAX_DISTANCE_LIST=[CAMERA_MAX_DISTANCE_SHORT, CAMERA_MAX_DISTANCE_LONG]
CAMERA_MAX_DISTANCE = CAMERA_MAX_DISTANCE_SHORT
CHRNAME_COLOR_INDEX = 0
ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"
#Lorenzo Systems
BATTLE_PASS = 0
CHEST_DROP_INFO_DATA = {}
OPPORTUNITY_DATA = []
OPEN_DEAL_OR_NO_DEAL = 0
ITEM_DATA = {}
ITEM_S#LorenzoTA = []
NEW_INGAME_SHOP=1
#Lorenzo Systems
avdam = 0
ADIM = ""
SOYADIM = ""
OCUM = ""
ANAN = 0
OTOAV = False
OTOAVSALDIR = False
OTOAVODAK = False
oto#Lorenzorus = 0
GUILD_BOARD_KEY = 0
BossArenaCheck = 1
YENI_ZAMAN = 0
DAKIKA = "%s dakika"
SAATVEDAKIKA = "%s saat %s dakika"
GUNSAAT = "%s gün %s saat"
## OTO LOGIN ##
otogiris = 0
otomatik_av_gui = 0
otomatik_av_gui_giris_sonrasi = 0
otologin_sure = 0
OTOAV = 0
TekVurus = 0
OTO##_HIT_COUNT ##99
girilecekkarakter = 0
otogiris_id = ""
otogiris_pw = ""
otogiris_pin = ""
## OTO LOGIN ##
# constant
HIGH_PRICE = 500000
##99LE_PRICE = 50000
ERROR_METIN_STONE = 28960
SUB2_LOADING_ENABLE = 1
EXPANDED_##MBO_ENABLE ##1
CONVERT_EMPIRE_LANGUAGE_ENABLE = 0
USE_ITEM_WEAPON_TABLE_ATTACK_BONUS = 0
ADD_DEF_BONUS_ENABLE = 0
LOGIN_COUNT_LIMIT_ENABLE ##1
USE_SKILL_EFFECT_UPGRADE_ENABLE = 1
VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD = 1
GUILD_MONEY_PER_GSP = 100
GUILD_WAR_TYPE_SELECT_ENABLE = 1
TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE = 10
HAIR_COLOR_ENABLE = 1
ARMOR_SPECULAR_ENABLE = 1
WEAPON_SPECULAR_ENABLE = 1
SEQUENCE_PACKET_ENABLE = 1
KEEP_ACCOUNT_CONNETION_ENABLE = 1
MINIMAP_POSITIONINFO_ENABLE = 1
isItemQuestionDialog = 0
def GET_ITEM_QUESTION_DIALOG_STATUS():
global isItemQuestionDialog
return isItemQuestionDialog
def SET_ITEM_QUESTION_DIALOG_STATUS(flag):
global isItemQuestionDialog
isItemQuestionDialog = flag
import app
import net
########################
def SET_DEFAULT_FOG_LEVEL():
global FOG_LEVEL
app.SetMinFog(FOG_LEVEL)
def SET_FOG_LEVEL_INDE###ndex):
global FOG_LEVEL
global FOG_LEVEL_LIST
try:
FOG_LEVEL=FOG_LEVEL_LIST[index]
except IndexError:
FOG_LEVEL=FOG_LEVEL_LIST[0]
app.SetMinFog(FOG_LEVEL)
def GET_FOG_LEVEL_INDEX():
global FOG_LEVEL
global FOG_LEVEL_LIST
return FOG_LEVEL_LIST.index(FOG_LEVEL)
########################
def SET_DEFAULT_CAMERA_MAX_DISTANCE():
global CAMERA_MAX_DISTANCE
app.SetCameraMaxDistance(CAM###_MAX_DISTANCE)
def SET_CAMERA_MAX_DISTANCE_INDEX(index):
global CAMERA_MAX_DISTANCE
global CAMERA_MAX_DISTANCE_LIST
try:
CAMERA_MAX_DISTANCE=CAMERA_MAX_DISTANCE_LIST[index]
except:
CAMERA_MAX_DISTANCE=CAMERA_MAX_DISTANCE_LIST[0]
app.SetCameraMaxDistance(CAMERA_MAX_DISTANCE)
def GET_CAMERA_MAX_DISTANCE_INDEX():
global CAMERA_MAX_DISTANCE
global CAMERA_MAX_DISTANCE_LIST
return CAMERA_MAX_DISTANCE_LIST.index(CAMERA_MAX_DISTANCE)
########################
import chrmgr
import player
import app
def SET_DEFAULT_CHRNAME_COLOR():
global CHRNAME_COLOR_INDE### chrmgr.SetEmpireNameMode(CHRNAME_COLOR_INDEX)
def SET_CHRNAME_COLOR_INDEX(index):
global CHRNAME_COLOR_INDEX
CHRNAME_COLOR_INDEX=index
chrmgr.SetEmpireNameMode(index)
def GET_CHRNAME_COLOR_INDEX():
global CHRNAME_COLOR_INDEX
return CHRNAME_COLOR_INDEX
def SET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(index):
global VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD = index
def GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
global VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
return VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
def SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE():
global CONVERT_EMPIRE_LANGUAGE_ENABLE
net.SetEmpireLanguageMode(CONVERT_EMPIRE_LANGUAGE_ENABLE)
def SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS():
global USE_ITEM_WEAPON_TABLE_ATTACK_BONUS
player.SetWeaponAttackBonusFlag(USE_ITEM_WEAPON_TABLE_ATTACK_BONUS)
def SET_DEFAULT_USE_SKILL_EFFECT_ENABLE():
global USE_SKILL_EFFECT_UPGRADE_ENABLE
app.SetSkillEffectUpgradeEnable(USE_SKILL_EFFECT_UPGRADE_ENABLE)
def SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE():
global TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE
app.SetTwoHandedWeaponAttSpeedDecreaseValue(TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE)
########################
import item
ACCESSORY_MATERIAL_LIST = [50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, ###32, 50633, 50634, 50635, 50636, 50637, 50638, 50639]
JewelAccessoryInfos = [
# jewel wrist neck ear
###32 50634, 14420, 16220, 17220 ],
[ 50635, 14500, 16500, 17500 ],
[ 50636, 14520, 16520, 17520 ],
[ 50637, 14540, 16540, 17540 ],
[ 50638, 14560, 16560, 17560 ],
[ 50639, 14570, 16570, 17570 ],
]
def GET_ACCESSORY_MATERIAL_VNUM(vnum, subType):
ret = vnum
item_base = (vnum / 10) * 10
for info in JewelAccessoryInfos:
if item.ARMOR_WRIST == subType:
if info[1] == item_base:
return info[0]
elif item.ARMOR_NECK == subType:
if info[2] == item_base:
return info[0]
elif item.ARMOR_EAR == subType:
if info[3] == item_base:
return info[0]
if vnum >= 16210 and vnum <= 16219:
return 50625
if item.ARMOR_WRIST == subType:
WRIST_ITEM_VNUM_BASE = 14000
ret -= WRIST_ITEM_VNUM_BASE
elif item.ARMOR_NECK == subType:
NECK_ITEM_VNUM_BASE = 16000
ret -= NECK_ITEM_VNUM_BASE
elif item.ARMOR_EAR == subType:
EAR_ITEM_VNUM_BASE = 17000
ret -= EAR_ITEM_VNUM_BASE
type = ret/20
if type<0 or type>=len(ACCESSORY_MATERIAL_LIST):
type = (ret-170) / 20
if type<0 or type>=len(ACCESSORY_MATERIAL_LIST):
return 0
return ACCESSORY_MATERIAL_LIST[type]
##################################################################
def GET_BELT_MATERIAL_VNUM(vnum, subType = 0):
return 18###
##################################################################
def IS_AUTO_POTION(itemVnum):
return IS_AUTO_POTION_HP(i###Vnum) or IS_AUTO_POTION_SP(itemVnum)
def IS_AUTO_POTION_HP(itemVnum):
if 72723 <= itemVnum and 72726 >= itemVnum:
return 1
elif itemVnum >= 76021 and itemVnum <= 76022:
return 1
elif itemVnum == 79012:
return 1
return 0
def IS_AUTO_POTION_SP(itemVnum):
if 72727 <= itemVnum and 72730 >= itemVnum:
return 1
elif itemVnum >= 76004 and itemVnum <= 76005:
return 1
elif itemVnum == 79013:
return 1
return 0
[/CODE]
0731 00:45:18485 :: Hair number 69 is not exist.
0731 00:45:27948 :: Hair number 69 is not exist.
0731 00:45:35457 :: Traceback (most recent call last):
0731 00:45:35457 :: File "ui.py", line 2431, in OnSelectEmptySlot
0731 00:45:35457 :: File "ui.py", line 88, in __call__
0731 00:45:35457 :: File "ui.py", line 79, in __call__
0731 00:45:35457 :: File "uiInventory.py", line 1631, in SelectEmptySlot
0731 00:45:35457 :: AttributeError
0731 00:45:35457 :: :
0731 00:45:35457 :: 'module' object has no attribute 'SLOT_TYPE_SKILL_BOOK_INVENTORY'
0731 00:45:35457 ::
[/CODE]
Depodan itemi alıp envantere koyduğumda bana yukardaki syseri veriyor itemde envantere gelmiyor yardımcı olurmusunuz .
Ekli dosyayı görüntüle 150765
[CODE title="uiinventory.py"]import ui
import player
import mouseModule
import net
import app
import snd
import item
import player
import chat
import grp
import uiScriptLocale
import uiRefine
import uiAttachMetin
import uiPickMoney
import uiCommon
import uiPrivateShopBuilder
import localeInfo
import constInfo
import ime
import wndMgr
import uiToolTip
import uiAkiraMenu
if app.ENABLE_ACCE_COSTUME_SYSTEM:
import acce
if app.__ENABLE_NEW_OFFLINESHOP__:
import offlineshop
import uinewofflineshop
DOSYA_YOLU = "UserData"
ITEM_MALL_BUTTON_ENABLE = True
ITEM_FLAG_APPLICABLE = 1 << 14
class AutoWindow(ui.ScriptWindow):
otoav_sure = app.GetTime()+4
AUTO_COOLTIME_POS_Y = 4
AUTO_COOLTIME_POS_X = 4
AUTO_COOLTIME_MAX = AUTO_COOLTIME_POS_Y * AUTO_COOLTIME_POS_X
AUTO_ONOFF_START = 1
AUTO_ONOFF_ATTACK = 2
AUTO_ONOFF_SKILL = 3
AUTO_ONOFF_POSITION = 4
AUTO_ONOFF_AUTO_RANGE = 5
AUTO_ONOFF_ATTACK_TYPE = 6
def __init__(self, wndInventory):
import exception
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.wndInventory = wndInventory;
self.isloded = 0
self.acikMi = 0
self.tooltipSkill = 0
self.tooltipItem = 0
self.otoAvAcKapa = 0
self.otoAvSlotIndex = {}
self.timeeditlist = {}
self.acKapaButtonlar =[]
self.saveButton = 0
self.otoAvSlot = None
self.AutoSkillClearButton = None
self.AutoPositionClearButton = None
self.AutoAllClearButton = None
self.AutoToolTipButton = None
self.AutoToolTip = None
# self.elMaxHitCount = None
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
self.otoAvSlotIndex = 0
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START,player.OTOMATIK_AV_ITEM_SLOT_END):
self.otoAvSlotIndex = 0
self.AutoSystemToolTipList = [localeInfo.AUTO_TOOLTIP_LINE1,
localeInfo.AUTO_TOOLTIP_LINE2,
localeInfo.AUTO_TOOLTIP_LINE3,
localeInfo.AUTO_TOOLTIP_LINE4,
localeInfo.AUTO_TOOLTIP_LINE5]
self.closegame = False
self.LoadAutoWindow()
self.isFirstReadFile = False
def __del__(self):
ui.ScriptWindow.__del__(self)
self.isloded = 0
self.acikMi = 0
self.tooltipSkill = 0
self.tooltipItem = 0
self.otoAvAcKapa = 0
self.otoAvSlotIndex = {}
self.timeeditlist = {}
self.acKapaButtonlar =[]
self.saveButton = 0
self.otoAvSlot = None
self.AutoSkillClearButton = None
self.AutoPositionClearButton = None
self.AutoAllClearButton = None
self.AutoToolTipButton = None
self.AutoToolTip = None
# self.elMaxHitCount = None
self.closegame = False
self.isFirstReadFile = False
def __LoadWindow(self):
# if app.ENABLE_WINDOW_SLIDE_EFFECT:
# self.EnableSlidingEffect()
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/AutoWindow.py")
self.GetChild("board").SetCloseEvent(ui.__mem_func__(self.Close))
self.imagearka = self.GetChild("image")
self.saveButton = self.GetChild("AutoSaveButton")
self.saveButton.Hide()
self.saveButton.SetEvent(ui.__mem_func__(self.SaveAutoInfo))
self.otogiris_check = ui.CheckBox_AutoHunt()
self.otogiris_check.SetParent(self)
self.otogiris_check.SetPosition(200, 276 - 38 + 26 - 92)
self.otogiris_check.SetEvent(ui.__mem_func__(self.__OnClickEnableAutoLoginOn), "ON_CHECK", True)
self.otogiris_check.SetEvent(ui.__mem_func__(self.__OnClickDisableAutoLoginOf), "ON_UNCKECK", False)
self.otogiris_check.SetTextInfo("")
self.otogiris_check.SetCheckStatus(constInfo.otogiris)
self.otogiris_check.Show()
self.tekvurus_check = ui.CheckBox_AutoHunt()
self.tekvurus_check.SetParent(self)
self.tekvurus_check.SetPosition(200, 276 - 38 + 26 - 92 - 25)
self.tekvurus_check.SetEvent(ui.__mem_func__(self.__OnClickEnableTekVurusOn), "ON_CHECK", True)
self.tekvurus_check.SetEvent(ui.__mem_func__(self.__OnClickDisableTekVurusOf), "ON_UNCKECK", False)
self.tekvurus_check.SetTextInfo("")
self.tekvurus_check.SetCheckStatus(constInfo.otoav_tekvurus)
self.tekvurus_check.Show()
baslatButton = self.GetChild("AutoStartOnButton")
baslatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_START, 0)
self.acKapaButtonlar.append(baslatButton)
durdurButton = self.GetChild("AutoStartOffButton")
durdurButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_START, 1)
durdurButton.Down()
durdurButton.Disable()
self.acKapaButtonlar.append(durdurButton)
saldiriAcButton = self.GetChild("AutoAttackOnButton")
saldiriAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_ATTACK, 2)
self.acKapaButtonlar.append(saldiriAcButton)
#
saldiriKapatButton = self.GetChild("AutoAttackOffButton")
saldiriKapatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_ATTACK, 3)
saldiriKapatButton.Down()
saldiriKapatButton.Disable()
self.acKapaButtonlar.append(saldiriKapatButton)
beceriAcButton = self.GetChild("AutoSkillOnButton")
beceriAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_SKILL, 4)
self.acKapaButtonlar.append(beceriAcButton)
#
beceriKapatButton = self.GetChild("AutoSkillOffButton")
beceriKapatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_SKILL, 5)
beceriKapatButton.Down()
beceriKapatButton.Disable()
self.acKapaButtonlar.append(beceriKapatButton)
iksirAcButton = self.GetChild("AutoPositionlOnButton")
iksirAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_POSITION, 6)
self.acKapaButtonlar.append(iksirAcButton)
#
iksirKapatButton = self.GetChild("AutoPositionlOffButton")
iksirKapatButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_POSITION, 7)
iksirKapatButton.Down()
iksirKapatButton.Disable()
self.acKapaButtonlar.append(iksirKapatButton)
odakAcButton = self.GetChild("AutoRangeOnButton")
odakAcButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_AUTO_RANGE, 8)
self.acKapaButtonlar.append(odakAcButton)
#
odakKapaButton = self.GetChild("AutoRangeOffButton")
odakKapaButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_AUTO_RANGE, 9)
odakKapaButton.Down()
odakKapaButton.Disable()
self.acKapaButtonlar.append(odakKapaButton)
slotOnButton = self.GetChild("AutoSlotOnButton")
slotOnButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 1, self.AUTO_ONOFF_ATTACK_TYPE, 10)
slotOnButton.Down()
slotOnButton.Disable()
self.acKapaButtonlar.append(slotOnButton)
#
metinOnButton = self.GetChild("AutoMetinOnButton")
metinOnButton.SetEvent(ui.__mem_func__(self.AutoOnOff), 0, self.AUTO_ONOFF_ATTACK_TYPE, 11)
self.acKapaButtonlar.append(metinOnButton)
self.AutoSkillClearButton = self.GetChild("AutoSkillClearButton")
self.AutoSkillClearButton.SetEvent(ui.__mem_func__(self.AutoSkillClear))
self.AutoPositionClearButton = self.GetChild("AutoPositionClearButton")
self.AutoPositionClearButton.SetEvent(ui.__mem_func__(self.AutoPositionClear))
self.AutoAllClearButton = self.GetChild("AutoAllClearButton")
self.AutoAllClearButton.SetEvent(ui.__mem_func__(self.AutoAllClear))
self.AutoSkillClearButton.Hide()
self.AutoPositionClearButton.Hide()
self.AutoAllClearButton.Hide()
slotOnButton.Hide()
metinOnButton.Hide()
odakAcButton.Hide()
odakKapaButton.Hide()
iksirAcButton.Hide()
iksirKapatButton.Hide()
beceriAcButton.Hide()
beceriKapatButton.Hide()
saldiriAcButton.Hide()
saldiriKapatButton.Hide()
for x in xrange(self.AUTO_COOLTIME_MAX):
childname = "editline" + str(x)
self.timeeditlist[x] = self.GetChild(childname)
self.timeeditlist[x].SetEscapeEvent(ui.__mem_func__(self.Close))
self.otoAvSlot = self.GetChild("Auto_Active_Skill_Slot_Table")
self.otoAvSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
self.otoAvSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectActiveSkillEmptySlot))
self.otoAvSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectActiveSkillSlot))
self.otoAvSlot.SetOverInItemEvent(ui.__mem_func__(self.OverActiveSkillSlot))
self.otoAvSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverSkillSlotOutItem))
self.otoAvSlot.Hide()
self.AutoToolTipButton = self.GetChild("AutoToolTIpButton")
self.AutoToolTip = self.__CreateGameTypeToolTip(localeInfo.AUTO_TOOLTIP_TITLE,self.AutoSystemToolTipList)
self.AutoToolTip.SetTop()
self.AutoToolTipButton.Hide()
self.AutoToolTipButton.SetToolTipWindow(self.AutoToolTip)
# self.elMaxHitCount = self.GetChild("MaxHitCount")
# self.elMaxHitCount.SetText(str(DEFAULT_MAX_HIT_COUNT))
self.PlayerName = self.GetChild("PlayerName")
self.PlayerLevel = self.GetChild("PlayerLevel")
self.PlayerName.Hide()
self.PlayerLevel.Hide()
wndEquip = self.GetChild("CostumeSlot")
except:
import exception
exception.Abort("AutoWindow.__LoadWindow.UIScript/AutoWindow.py")
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
self.wndEquip = wndEquip
def __CreateGameTypeToolTip(self, title, descList):
toolTip = uiToolTip.ToolTip()
toolTip.SetTitle(title)
toolTip.AppendSpace(5)
for desc in descList:toolTip.AutoAppendTextLine(desc)
toolTip.AlignHorizonalCenter()
toolTip.SetTop()
return toolTip
def AutoSkillClear(self):
if self.GetAutoStartonoff() == False:
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
player.OtoAvSlottanSil(i)
self.otoAvSlotIndex = 0
self.BeceriSlotlariYenile()
def AutoPositionClear(self):
if self.GetAutoStartonoff() == False:
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START,player.OTOMATIK_AV_ITEM_SLOT_END):
player.OtoAvSlottanSil(i)
self.otoAvSlotIndex = 0
self.IksirSlotlariYenile()
def AutoAllClear(self):
if self.GetAutoStartonoff() == False:
self.AutoSkillClear()
self.AutoPositionClear()
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):self.otoAvSlotIndex = 0
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START,player.OTOMATIK_AV_ITEM_SLOT_END):self.otoAvSlotIndex = 0
# self.elMaxHitCount.SetText(str(DEFAULT_MAX_HIT_COUNT))
def IsNumberic(self, text) :
try :
int(text)
return True
except ValueError :
return False
def CheckCooltimeText(self, cooltime):
if cooltime == "":return 0
if not self.IsNumberic(cooltime):return 0
return cooltime
# def get_max_hit_count(self):
# return int(self.elMaxHitCount.GetText())
def AutoOnOff(self, onoff, type, number, command=False):
if not self.isloded: return
if type == self.AUTO_ONOFF_START:
if onoff == 1:
if not player.OtoAvBaslayabilirMi(): return
for i in range(player.OTOMATIK_AV_SKILL_MAX_NUM):
cooltime = self.timeeditlist.GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i, self.otoAvSlotIndex, int(cooltime))
if not cooltime == 0:
player.OtoAvSlotDSAta(i, int(cooltime))
self.timeeditlist.SetText(str(cooltime))
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START, player.OTOMATIK_AV_ITEM_SLOT_END):
cooltime = self.timeeditlist[i-1].GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i, self.otoAvSlotIndex, int(cooltime))
if not cooltime == 0:
player.OtoAvSlotDSAta(i, int(cooltime))
self.timeeditlist[i-1].SetText(str(cooltime))
# if constInfo.otoav_tekvurus == 1:
# player.AutoHuntSetMaxHitCount(1)
# else:
# player.AutoHuntSetMaxHitCount(0)
else:
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START, player.OTOMATIK_AV_ITEM_SLOT_END):
self.SetAutoCooltime(i, 0)
player.OtoAvDurumAta(onoff, command)
self.otoAvAcKapa = onoff
constInf
TOAV = onoffelif type == self.AUTO_ONOFF_ATTACK:
player.OtoAvSaldiriAta(onoff)
elif type == self.AUTO_ONOFF_SKILL:
player.OtoAvBeceriAta(onoff)
elif type == self.AUTO_ONOFF_POSITION:
player.OtoAvIksirAta(onoff)
elif type == self.AUTO_ONOFF_AUTO_RANGE:
player.OtoAvOdakAta(onoff)
elif type == self.AUTO_ONOFF_ATTACK_TYPE:
player.OtoAvSaldiriTipi(onoff)
if command:
if not onoff:
self.Close()
return
self.acKapaButtonlar[number].Down()
self.acKapaButtonlar[number].Disable()
if onoff == 1:
number += 1
else:
number -= 1
self.acKapaButtonlar[number].SetUp()
self.acKapaButtonlar[number].Enable()
def LoadAutoWindow(self):
if self.isloded == 0:
self.isloded = 1
self.__LoadWindow()
self.SetCenterPosition()
self.AutoOnOff(1, self.AUTO_ONOFF_ATTACK_TYPE, 10)
def Show(self):
if self.isloded == 0:
self.isloded = 1
self.__LoadWindow()
self.SetCenterPosition()
self.SetTop()
self.ReadAutoInfo()
self.IksirSlotlariYenile()
self.BeceriSlotlariYenile()
self.acikMi = 1
ui.ScriptWindow.Show(self)
self.AutoOnOff(0, self.AUTO_ONOFF_ATTACK_TYPE, 11) #met#met#metin self.AutoOnOff(1, self.AUTO_ONOFF_ATTACK, 2) #sal#sal#saldirif OtoLoginSonrasi(self):
if constInfo.otomatik_av_gui_giris_sonrasi == 1 and constInfo.otogiris == 1:
if constInf
TOAV != 1:constInf
TOAV = 1self.AutoOnOff(1, self.AUTO_ONOFF_START, 0) #bas#bas#baslat if app.GetTime() > self.otoav_sure:
self.Close()
def OnUpdate(self):
self.OtoLoginSonrasi()
self.PlayerName.SetText("|cffffc21c"+player.GetName())
self.PlayerLevel.SetText("|cffade57d Lv.%d" % (int(player.GetStatus(player.LEVEL))))
getItemVNum=player.GetItemIndex
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_1, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_1), 0)
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_2, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_2), 0)
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_3, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_3), 0)
# self.wndEquip.SetItemSlot(item.EQUIPMENT_AUTO_HUNT_ITEM_4, getItemVNum(item.EQUIPMENT_AUTO_HUNT_ITEM_4), 0)
self.wndEquip.RefreshSlot()
def ReadAutoInfo(self):
import os
if (str)(player.GetName()) == "0": return
dosyaAdi = DOSYA_YOLU + "/" + player.GetName()
if os.path.exists(dosyaAdi): veriTokenler = open(dosyaAdi, "r").read().split()
else: return
satirSayi = len(veriTokenler) / 2
sIndex = 0
if satirSayi > 0:
for xSatir in xrange(satirSayi):
# import chat
slotID = int(str(veriTokenler[sIndex]))
slotCD = int(str(veriTokenler[sIndex+1]))
# chat.AppendChat(1,"xSatir: %s , slotID: %s, cD: %s" % (str(xSatir), str(slotID), str(slotCD)))
if slotID != 0:
if xSatir < player.OTOMATIK_AV_SKILL_MAX_NUM: player.OtoAvSlotaBeceriEkle(xSatir, slotID)
else: player.OtoAvSlotaPotEkle(xSatir, slotID)
player.OtoAvSlotDSAta(xSatir, slotCD)
sIndex += 2
# app.CloseTextFile(handle)
self.isFirstReadFile = True
self.IksirSlotlariYenile()
self.BeceriSlotlariYenile()
def SlotKontrol(self):
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
cooltime = self.timeeditlist.GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i,self.otoAvSlotIndex,int(cooltime))
import dbg
if self.otoAvSlotIndex == 0:self.timeeditlist.SetText("")
if not cooltime == 0:
player.OtoAvSlotDSAta(i,int(cooltime))
self.timeeditlist.SetText(str(cooltime))
for i in range(player.OTOMATIK_AV_ITEM_SLOT_START+1, player.OTOMATIK_AV_ITEM_SLOT_END):
cooltime = self.timeeditlist[i-1].GetText()
cooltime = self.CheckCooltimeText(cooltime)
cooltime = player.SlotDolumSuresiKontrol(i,self.otoAvSlotIndex,int(cooltime))
if not cooltime == 0:
player.OtoAvSlotDSAta(i,int(cooltime))
self.timeeditlist[i-1].SetText(str(cooltime))
def SaveAutoInfo(self):
if (str)(chr.GetName()) == "0":return
self.SlotKontrol()
import os
if os.path.exists(DOSYA_YOLU) is False
s.makedirs(DOSYA_YOLU)otoAvDosya = open(DOSYA_YOLU + "/" + chr.GetName(), 'w')
for slotIdx in xrange(player.OTOMATIK_AV_ITEM_SLOT_END):
iPos = player.OtoAvSlotAl(slotIdx)
if iPos != 0:
strLine = str(iPos) + '\n'
otoAvDosya.write(strLine)
dSure = player.OtoAvSlotDolumSuresiAl(slotIdx)
if dSure != 0:
strLine = str(dSure) + '\n'
otoAvDosya.write(strLine)
else:
otoAvDosya.write('0\n')
otoAvDosya.write('0\n')
otoAvDosya.close()
def Close(self):
self.Hide()
self.acikMi = 0
if constInfo.otomatik_av_gui_giris_sonrasi == 1:
constInfo.otomatik_av_gui_giris_sonrasi = 0
self.EditLineKillFocus()
def EditLineKillFocus(self):
for x in xrange(self.AUTO_COOLTIME_MAX):self.timeeditlist[x].KillFocus()
def Destroy(self):
self.isloded = 0
self.Hide()
if 0 != self.tooltipSkill:self.tooltipSkill.HideToolTip()
self.otogiris_check = []
def __OnClickEnableAutoLoginOn(self):
constInfo.otogiris = 1
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Otomatik giris aktif.")
def __OnClickDisableAutoLoginOf(self):
constInfo.otogiris = 0
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Otomatik giris pasif.")
def __OnClickEnableTekVurusOn(self):
constInfo.otoav_tekvurus = 1
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Tek Vurus aktif.")
def __OnClickDisableTekVurusOf(self):
constInfo.otoav_tekvurus = 0
chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Tek Vurus pasif.")
def OnActivateSkill(self):
if self.acikMi:self.BeceriSlotlariYenile()
def OnDeactivateSkill(self, slotindex):
if self.acikMi:
for i in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
(Position) = player.OtoAvSlotAl(i)
if slotindex == Position:self.otoAvSlot.DeactivateSlot(i)
def OnUseSkill(self, slotindex, coolTime):
if self.acikMi:self.BeceriSlotlariYenile()
def SetSkillToolTip(self, tooltip):
self.tooltipSkill = tooltip
def SetItemToolTip(self, tooltip):
self.tooltipItem = tooltip
def SetAutoCooltime(self, slotindex, cooltime):
self.otoAvSlot.SetSlotCoolTime(slotindex, cooltime, 0)
def SetCloseGame(self):
self.closegame = True
def GetAutoStartonoff(self):
return self.otoAvAcKapa
def IksirSlotlariYenile(self):
for slotindex in range(player.OTOMATIK_AV_ITEM_SLOT_START + 1,player.OTOMATIK_AV_ITEM_SLOT_END):
iPos = player.OtoAvSlotAl(slotindex)
if iPos == 0:
self.otoAvSlot.ClearSlot(slotindex)
self.timeeditlist[slotindex-1].SetText("")
self.otoAvSlotIndex[slotindex] = 0
continue
itemIndex = player.GetItemIndex(iPos)
itemCount = player.GetItemCount(iPos)
if itemCount <= 1:itemCount = 0
self.otoAvSlot.SetItemSlot(slotindex, itemIndex, itemCount)
self.otoAvSlotIndex[slotindex] = iPos
coolTime = player.OtoAvSlotDolumSuresiAl(slotindex)
if self.timeeditlist[slotindex-1].GetText() == "":self.timeeditlist[slotindex-1].SetText(str(coolTime))
if itemIndex == 0:
self.otoAvSlot.ClearSlot(slotindex)
self.timeeditlist[slotindex-1].SetText("")
player.OtoAvSlottanSil(slotindex)
self.otoAvSlot.RefreshSlot()
def BeceriSlotlariYenile(self):
for slotindex in xrange(player.OTOMATIK_AV_SKILL_MAX_NUM):
sPos = player.OtoAvSlotAl(slotindex)
if sPos == 0:
self.otoAvSlot.ClearSlot(slotindex)
self.timeeditlist[slotindex].SetText("")
self.otoAvSlotIndex[slotindex] = 0
continue
skillIndex = player.GetSkillIndex(sPos)
if 0 == skillIndex:self.otoAvSlot.ClearSlot(slotindex)
skillType = skill.GetSkillType(skillIndex)
if skill.SKILL_TYPE_GUILD == skillType:
import guild
skillGrade = 0
skillLevel = guild.GetSkillLevel(sPos)
else:
skillGrade = player.GetSkillGrade(sPos)
skillLevel = player.GetSkillLevel(sPos)
self.otoAvSlot.SetSkillSlotNew(slotindex, skillIndex, skillGrade, skillLevel)
self.otoAvSlot.SetSlotCountNew(slotindex, skillGrade, skillLevel)
self.otoAvSlot.SetCoverButton(slotindex)
if player.IsSkillCoolTime(sPos):
(coolTime, elapsedTime) = player.GetSkillCoolTime(sPos)
self.otoAvSlot.SetSlotCoolTime(slotindex, coolTime, elapsedTime)
if player.IsSkillActive(sPos):self.otoAvSlot.ActivateSlot(slotindex)
self.otoAvSlotIndex[slotindex] = sPos
coolTime = player.OtoAvSlotDolumSuresiAl(slotindex)
if self.timeeditlist[slotindex].GetText() == "":
self.timeeditlist[slotindex].SetText(str(coolTime))
self.otoAvSlot.RefreshSlot()
def AddAutoSlot(self, slotindex):
AttachedSlotType = mouseModule.mouseController.GetAttachedType()
AttachedSlotNumber = mouseModule.mouseController.GetAttachedSlotNumber()
AttachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
if slotindex <= player.OTOMATIK_AV_SKILL_MAX_NUM:
if player.SLOT_TYPE_SKILL == AttachedSlotType:
player.OtoAvSlotaBeceriEkle(slotindex,AttachedSlotNumber)
self.BeceriSlotlariYenile()
elif player.SLOT_TYPE_OTOMATIK_AV == AttachedSlotType:
if slotindex == AttachedSlotNumber:return
if AttachedSlotNumber >= player.OTOMATIK_AV_SKILL_MAX_NUM:return
player.OtoAvSlotaBeceriEkle(slotindex,AttachedItemIndex)
self.BeceriSlotlariYenile()
else:
if player.SLOT_TYPE_INVENTORY == AttachedSlotType:
itemIndex = player.GetItemIndex(AttachedSlotNumber)
item.SelectItem(itemIndex)
ItemType = item.GetItemType()
ItemSubType = item.GetItemSubType()
itemRemaintime = 0
if not ItemType == item.ITEM_TYPE_USE:return;
if ItemSubType == item.USE_ABILITY_UP:itemRemaintime = item.GetValue(1)
elif ItemSubType == item.USE_AFFECT:itemRemaintime = item.GetValue(3)
if ItemSubType == item.USE_POTION \
or ItemSubType == item.USE_ABILITY_UP \
or ItemSubType == item.USE_POTION_NODELAY \
or ItemSubType == item.USE_AFFECT:
if itemRemaintime < 9999:
player.OtoAvSlotaPotEkle(slotindex,AttachedSlotNumber)
self.IksirSlotlariYenile()
elif player.SLOT_TYPE_OTOMATIK_AV == AttachedSlotType:
if slotindex == AttachedSlotNumber:return
if AttachedSlotNumber <= player.OTOMATIK_AV_SKILL_MAX_NUM:return
player.OtoAvSlotaPotEkle(slotindex,AttachedItemIndex)
self.IksirSlotlariYenile()
mouseModule.mouseController.DeattachObject()
def SelectActiveSkillEmptySlot(self, slotindex):
if self.otoAvAcKapa:return
if True == mouseModule.mouseController.isAttached():self.AddAutoSlot(slotindex)
def SelectActiveSkillSlot(self,slotindex):
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_OTOMATIK_AV, slotindex, self.otoAvSlotIndex[slotindex])
def OverActiveSkillSlot(self,slotindex):
if mouseModule.mouseController.isAttached():return
if slotindex <= player.OTOMATIK_AV_SKILL_MAX_NUM:
sPos = player.OtoAvSlotAl(slotindex)
if sPos == 0:return
skillIndex = player.GetSkillIndex(sPos)
skillType = skill.GetSkillType(skillIndex)
if skill.SKILL_TYPE_GUILD == skillType:
import guild
skillGrade = 0
skillLevel = guild.GetSkillLevel(sPos)
else:
skillGrade = player.GetSkillGrade(sPos)
skillLevel = player.GetSkillLevel(sPos)
self.tooltipSkill.SetSkillNew(sPos, skillIndex, skillGrade, skillLevel)
else:
sPos_ = player.OtoAvSlotAl(slotindex)
self.tooltipItem.SetInventoryItem(sPos_)
self.tooltipSkill.HideToolTip()
def OverSkillSlotOutItem(self):
if 0 != self.tooltipSkill:self.tooltipSkill.HideToolTip()
if 0 != self.tooltipItem:self.tooltipItem.HideToolTip()
def OnPressEscapeKey(self):
self.Close()
return True
class CostumeWindow(ui.ScriptWindow):
def __init__(self, wndInventory):
import exception
if not app.ENABLE_COSTUME_SYSTEM:
exception.Abort("What do you do?")
return
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.isLoaded = 0
self.wndInventory = wndInventory;
if app.ENABLE_HIDE_COSTUME_SYSTEM:
self.visibleButtonList = []
self.__LoadWindow()
if app.ENABLE_WINDOW_ANIMATION:
self.SetWindowAnimation()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
self.__LoadWindow()
self.RefreshCostumeSlot()
ui.ScriptWindow.Show(self)
def Close(self):
self.Hide()
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/CostumeWindow.py")
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.LoadObject")
try:
wndEquip = self.GetChild("CostumeSlot")
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
if app.ENABLE_HIDE_COSTUME_SYSTEM:
self.visibleButtonList.append(self.GetChild("BodyToolTipButton"))
self.visibleButtonList.append(self.GetChild("HairToolTipButton"))
self.visibleButtonList.append(self.GetChild("AcceToolTipButton"))
self.visibleButtonList.append(self.GetChild("WeaponToolTipButton"))
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.BindObject")
## E##ipment
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
self.wndEquip = wndEquip
if app.ENABLE_HIDE_COSTUME_SYSTEM:
self.visibleButtonList[0].SetToggleUpEvent(lambda: self.VisibleCostume(1, 0))
self.visibleButtonList[1].SetToggleUpEvent(lambda: self.VisibleCostume(2, 0))
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.visibleButtonList[2].SetToggleUpEvent(lambda: self.VisibleCostume(3, 0))
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
self.visibleButtonList[3].SetToggleUpEvent(lambda: self.VisibleCostume(4, 0))
self.visibleButtonList[0].SetToggleDownEvent(lambda: self.VisibleCostume(1, 1))
self.visibleButtonList[1].SetToggleDownEvent(lambda: self.VisibleCostume(2, 1))
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.visibleButtonList[2].SetToggleDownEvent(lambda: self.VisibleCostume(3, 1))
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
self.visibleButtonList[3].SetToggleDownEvent(lambda: self.VisibleCostume(4, 1))
def RefreshCostumeSlot(self):
getItemVNum=player.GetItemIndex
for i in xrange(item.COSTUME_SLOT_COUNT):
slotNumber = item.COSTUME_SLOT_START + i
self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
self.wndEquip.SetItemSlot(item.COSTUME_SLOT_WEAPON, getItemVNum(item.COSTUME_SLOT_WEAPON), 0)
self.wndEquip.RefreshSlot()
if app.ENABLE_HIDE_COSTUME_SYSTEM:
def RefreshVisibleCostume(self):
body = constInfo.HIDDEN_BODY_COSTUME
hair = constInfo.HIDDEN_HAIR_COSTUME
if app.ENABLE_ACCE_COSTUME_SYSTEM:
acce = constInfo.HIDDEN_ACCE_COSTUME
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
weapon = constInfo.HIDDEN_WEAPON_COSTUME
if body == 1:
self.visibleButtonList[0].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[0].Down()
else:
self.visibleButtonList[0].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[0].SetUp()
if hair == 1:
self.visibleButtonList[1].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[1].Down()
else:
self.visibleButtonList[1].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[1].SetUp()
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if acce == 1:
self.visibleButtonList[2].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[2].Down()
else:
self.visibleButtonList[2].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[2].SetUp()
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
if weapon == 1:
self.visibleButtonList[3].SetToolTipText(localeInfo.SHOW_COSTUME)
self.visibleButtonList[3].Down()
else:
self.visibleButtonList[3].SetToolTipText(localeInfo.HIDE_COSTUME)
self.visibleButtonList[3].SetUp()
def VisibleCostume(self, part, hidden):
net.SendChatPacket("/hide_costume %d %d" % (part, hidden))
class MenuWindow(ui.ScriptWindow):
EFSUN_BOTU = 0
BUTON_SANIYE = 1
OFF_SHOP = 2
ARAMA_CAM = 3
RUTBE_RUTBE = 4
SIL_SAT = 5
MENU_BUTTONS = [
["EfsunBotu", EFSUN_BOTU],
["OfflineShop", OFF_SHOP],
["AramaCam", ARAMA_CAM],
["Rutbe", RUTBE_RUTBE],
["SilSat", SIL_SAT],
]
def __init__(self, wndInventory):
import exception
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.isLoaded = 0
self.sonbasma = 0
self.buttons = []
self.wndInventory = wndInventory;
self.__LoadWindow()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
ui.ScriptWindow.Show(self)
self.__LoadWindow()
self.AdjustPositionAndSize()
# self.EkraniAc()
def Close(self):
self.Hide()
def EkraniAc(self):
self.Show()
self.AdjustPositionAndSize()
def GetBasePosition(self):
x, y = self.wndInventory.GetGlobalPosition()
return x - 148 + 90-2+4 +20, y + 241 -30+15-7-20
def AdjustPositionAndSize(self):
bx, by = self.GetBasePosition()
byEK=37+150+6
if self.IsShow():
self.SetPosition(bx-17+15, by+6-byEK)
self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
else:
self.SetPosition(bx + 138 - 90, by+6-byEK);
self.SetSize(10, self.GetHeight())
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/MenuWindow.py")
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.LoadObject")
try:
self.ORIGINAL_WIDTH = self.GetWidth()
# self.Efsun = self.GetChild("Efsun")
# funclist = [
# ui.__mem_func__(self.wndInventory.interface.ToggleSwitchbotWindow),
# ]
idx = 0
for i in self.MENU_BUTTONS:
self.buttons.append(self.GetChild(i[0]))
self.buttons[idx].SetEvent(ui.__mem_func__(self.IslemSec), i[1])
idx += 1
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.BindObject")
def IslemSec(self, gelen):
if self.sonbasma > app.GetTime():
v = self.sonbasma - app.GetTime()
chat.AppendChat(chat.CHAT_TYPE_NOTICE, "%d saniye sonra tekrar deneyin" % (v))
return
if gelen == self.EFSUN_BOTU:
self.wndInventory.interface.ToggleSwitchbotWindow()
if gelen == self.OFF_SHOP:
self.wndInventory.interface.ShowMeOfflineShop()
if gelen == self.ARAMA_CAM:
self.wndInventory.interface.OpenSearchShop()
if gelen == self.RUTBE_RUTBE:
self.wndInventory.interface.ToggleAutoWindow()
if gelen == self.SIL_SAT:
self.wndInventory.interface.OpenDeleteItem()
self.sonbasma = app.GetTime() + self.BUTON_SANIYE
class BeltInventoryWindow(ui.ScriptWindow):
def __init__(self, wndInventory):
import exception
if not app.ENABLE_NEW_EQUIPMENT_SYSTEM:
exception.Abort("What do you do?")
return
if not wndInventory:
exception.Abort("wndInventory parameter must be set to InventoryWindow")
return
ui.ScriptWindow.__init__(self)
self.isLoaded = 0
self.wndInventory = wndInventory;
self.wndBeltInventoryLayer = None
self.wndBeltInventorySlot = None
self.expandBtn = None
self.minBtn = None
self.__LoadWindow()
if app.ENABLE_WINDOW_ANIMATION:
self.SetWindowAnimation()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self, openBeltSlot = False):
self.__LoadWindow()
self.RefreshSlot()
ui.ScriptWindow.Show(self)
if openBeltSlot:
self.OpenInventory()
else:
self.CloseInventory()
def Close(self):
self.Hide()
def IsOpeningInventory(self):
return self.wndBeltInventoryLayer.IsShow()
def OpenInventory(self):
self.wndBeltInventoryLayer.Show()
self.expandBtn.Hide()
if localeInfo.IsARABIC() == 0:
self.AdjustPositionAndSize()
def CloseInventory(self):
self.wndBeltInventoryLayer.Hide()
self.expandBtn.Show()
if localeInfo.IsARABIC() == 0:
self.AdjustPositionAndSize()
def GetBasePosition(self):
x, y = self.wndInventory.GetGlobalPosition()
return x - 148, y + 241
def AdjustPositionAndSize(self):
bx, by = self.GetBasePosition()
if self.IsOpeningInventory():
self.SetPosition(bx, by)
self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
else:
self.SetPosition(bx + 138, by);
self.SetSize(10, self.GetHeight())
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/BeltInventoryWindow.py")
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.LoadObject")
try:
self.ORIGINAL_WIDTH = self.GetWidth()
wndBeltInventorySlot = self.GetChild("BeltInventorySlot")
self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
self.expandBtn = self.GetChild("ExpandBtn")
self.minBtn = self.GetChild("MinimizeBtn")
self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
if localeInfo.IsARABIC() :
self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15)
self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0)
self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15)
for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
slotNumber = item.BELT_INVENTORY_SLOT_START + i
wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\
"d:/ymir work/ui/game/quest/slot_button_01.sub",\
"d:/ymir work/ui/game/quest/slot_button_01.sub",\
"d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False)
except:
import exception
exception.Abort("CostumeWindow.LoadWindow.BindObject")
## E##ipment
wndBeltInventorySlot.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
wndBeltInventorySlot.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
wndBeltInventorySlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndBeltInventorySlot.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
wndBeltInventorySlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
wndBeltInventorySlot.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
self.wndBeltInventorySlot = wndBeltInventorySlot
def RefreshSlot(self):
getItemVNum=player.GetItemIndex
for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
slotNumber = item.BELT_INVENTORY_SLOT_START + i
self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber))
self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, True)
avail = "0"
if player.IsAvailableBeltInventoryCell(slotNumber):
self.wndBeltInventorySlot.EnableCoverButton(slotNumber)
else:
self.wndBeltInventorySlot.DisableCoverButton(slotNumber)
self.wndBeltInventorySlot.RefreshSlot()
class InventoryWindow(ui.ScriptWindow):
USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET")
if app.ENABLE_USE_COSTUME_ATTR:
USE_TYPE_TUPLE = tuple(list(USE_TYPE_TUPLE) + ["USE_CHANGE_COSTUME_ATTR", "USE_RESET_COSTUME_ATTR"])
questionDialog = None
tooltipItem = None
wndCostume = None
wndBelt = None
dlgPickMoney = None
if app.ENABLE_ITEM_DELETE_SYSTEM:
wndItemDelete = None
wndMenu = None
sellingSlotNumber = -1
isLoaded = 0
isOpenedCostumeWindowWhenClosingInventory = 0
isOpenedBeltWindowWhenClosingInventory = 0
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
liHighlightedItems = []
def __init__(self):
ui.ScriptWindow.__init__(self)
self.isOpenedBeltWindowWhenClosingInventory = 0
self.inventoryPageIndex = 0
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.wndAcceCombine = None
self.wndAcceAbsorption = None
self.__LoadWindow()
if app.ENABLE_WINDOW_ANIMATION:
self.SetWindowAnimation()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
self.__LoadWindow()
ui.ScriptWindow.Show(self)
if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
self.wndCostume.Show()
if self.wndBelt:
self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
if self.wndMenu:
self.wndMenu.Show()
def BindInterfaceClass(self, interface):
self.interface = interface
if app.TITLE_SYSTEM:
def OpenTitle(self):
self.interface.OpenTitle()
def __LoadWindow(self):
if self.isLoaded == 1:
return
self.isLoaded = 1
try:
pyScrLoader = ui.PythonScriptLoader()
if app.ENABLE_EXTEND_INVEN_SYSTEM:
pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindowEx.py")
else:
if ITEM_MALL_BUTTON_ENABLE:
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py")
else:
pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py")
except:
import exception
exception.Abort("InventoryWindow.LoadWindow.LoadObject")
try:
wndItem = self.GetChild("ItemSlot")
wndEquip = self.GetChild("EquipmentSlot")
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
self.wndMoney = self.GetChild("Money")
self.wndMoneySlot = self.GetChild("Money_Slot")
self.mallButton = self.GetChild2("MallButton")
self.DSSButton = self.GetChild2("DSSButton")
self.costumeButton = self.GetChild2("CostumeButton")
self.inventoryTab = []
for i in xrange(player.INVENTORY_PAGE_COUNT):
self.inventoryTab.append(self.GetChild("Inventory_Tab_%02d" % (i+1)))
self.equipmentTab = []
self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))
if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM:
self.costumeButton.Hide()
self.costumeButton.Destroy()
self.costumeButton = 0
# Belt Inventory Window
self.wndBelt = None
self.wndBelt = uiAkiraMenu.AkiraMenu(self)
if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
self.wndBelt = BeltInventoryWindow(self)
self.wndMenu = MenuWindow(self)
except:
import exception
exception.Abort("InventoryWindow.LoadWindow.BindObject")
## I##m
wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
## E##ipment
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
## P##kMoneyDialog
dlgPickMoney = uiPickMoney.PickMoneyDialog()
dlgPickMoney.LoadDialog()
dlgPickMoney.Hide()
## R##ineDialog
self.refineDialog = uiRefine.RefineDialog()
self.refineDialog.Hide()
## A##achMetinDialog
self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
self.attachMetinDialog.Hide()
## M##eySlot
self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
for i in xrange(player.INVENTORY_PAGE_COUNT):
self.inventoryTab.SetEvent(lambda arg=i: self.SetInventoryPage(arg))
self.inventoryTab[0].Down()
self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg))
self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg))
self.equipmentTab[0].Down()
self.equipmentTab[0].Hide()
self.equipmentTab[1].Hide()
self.wndItem = wndItem
self.wndEquip = wndEquip
self.dlgPickMoney = dlgPickMoney
# MallButton
if self.mallButton:
self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
if self.DSSButton:
self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton))
# Costume Button
if self.costumeButton:
self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton))
self.wndCostume = None
####### if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.listAttachedAcces = []
## R##resh
self.SetInventoryPage(0)
self.SetEquipmentPage(0)
self.RefreshItemSlot()
self.RefreshStatus()
def Destroy(self):
self.ClearDictionary()
self.dlgPickMoney.Destroy()
self.dlgPickMoney = 0
self.refineDialog.Destroy()
self.refineDialog = 0
self.attachMetinDialog.Destroy()
self.attachMetinDialog = 0
self.tooltipItem = None
self.wndItem = 0
self.wndEquip = 0
self.dlgPickMoney = 0
self.wndMoney = 0
self.wndMoneySlot = 0
self.questionDialog = None
self.mallButton = None
self.DSSButton = None
self.interface = None
if self.wndMenu:
self.wndMenu.Destroy()
self.wndMenu = None
if self.wndCostume:
self.wndCostume.Destroy()
self.wndCostume = 0
if self.wndBelt:
self.wndBelt.Destroy()
self.wndBelt = None
if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.wndAcceCombine = None
self.wndAcceAbsorption = None
self.inventoryTab = []
self.equipmentTab = []
def Hide(self):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
self.OnCloseQuestionDialog()
return
if None != self.tooltipItem:
self.tooltipItem.HideToolTip()
if self.wndCostume:
self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow()
self.wndCostume.Close()
if self.wndMenu:
self.wndMenu.Close()
if self.wndBelt:
self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory()
print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory
self.wndBelt.Close()
if self.dlgPickMoney:
self.dlgPickMoney.Close()
wndMgr.Hide(self.hWnd)
def Close(self):
self.Hide()
def SetInventoryPage(self, page):
self.inventoryPageIndex = page
for index in range(len(self.inventoryTab)):
self.inventoryTab[index].SetUp()
self.inventoryTab[page].Down()
self.RefreshBagSlotWindow()
def SetEquipmentPage(self, page):
self.equipmentPageIndex = page
self.equipmentTab[1-page].SetUp()
self.RefreshEquipSlotWindow()
def ClickMallButton(self):
print "click_mall_button"
net.SendChatPacket("/click_mall")
def ClickMallButton(self):
print "click_safebox_button"
net.SendChatPacket("/click_safebox")
# DSSButton
def ClickDSSButton(self):
print "click_dss_button"
self.interface.ToggleDragonSoulWindow()
def ClickCostumeButton(self):
print "Click Costume Button"
if self.wndCostume:
if self.wndCostume.IsShow():
self.wndCostume.Hide()
else:
self.wndCostume.Show()
else:
self.wndCostume = CostumeWindow(self)
self.wndCostume.Show()
def OpenPickMoneyDialog(self):
if mouseModule.mouseController.isAttached():
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType():
if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
snd.PlaySound("sound/ui/money.wav")
mouseModule.mouseController.DeattachObject()
else:
curMoney = player.GetElk()
if curMoney <= 0:
return
self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
self.dlgPickMoney.Open(curMoney)
self.dlgPickMoney.SetMax(9)
def OnPickMoney(self, money):
mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
def OnPickItem(self, count):
itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.INVENTORY, itemSlotIndex):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
selectedItemVNum = player.GetItemIndex(itemSlotIndex)
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)
def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)):
return local
return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local
def RefreshBagSlotWindow(self):
getItemVNum=player.GetItemIndex
getItemCount=player.GetItemCount
setItemVNum=self.wndItem.SetItemSlot
for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
itemCount = getItemCount(slotNumber)
if 0 == itemCount:
self.wndItem.ClearSlot(i)
continue
elif 1 == itemCount:
itemCount = 0
itemVnum = getItemVNum(slotNumber)
setItemVNum(i, itemVnum, itemCount)
if constInfo.IS_AUTO_POTION(itemVnum):
metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
isActivated = 0 != metinSocket[0]
if isActivated:
self.wndItem.ActivateSlot(i)
potionType = 0
if constInfo.IS_AUTO_POTION_HP(itemVnum):
potionType = player.AUTO_POTION_TYPE_HP
elif constInfo.IS_AUTO_POTION_SP(itemVnum):
potionType = player.AUTO_POTION_TYPE_SP
usedAmount = int(metinSocket[1])
totalAmount = int(metinSocket[2])
player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
else:
self.wndItem.DeactivateSlot(i)
if app.ENABLE_ACCE_COSTUME_SYSTEM:
slotNumberChecked = 0
if not constInfo.IS_AUTO_POTION(itemVnum):
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
if not slotNumber in self.liHighlightedItems:
self.wndItem.DeactivateSlot(i)
else:
self.wndItem.DeactivateSlot(i)
for j in xrange(acce.WINDOW_MAX_MATERIALS):
(isHere, iCell) = acce.GetAttachedItem(j)
if isHere:
if iCell == slotNumber:
self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
if not slotNumber in self.listAttachedAcces:
self.listAttachedAcces.append(slotNumber)
slotNumberChecked = 1
else:
if slotNumber in self.listAttachedAcces and not slotNumberChecked:
self.wndItem.DeactivateSlot(i)
self.listAttachedAcces.remove(slotNumber)
elif app.ENABLE_HIGHLIGHT_NEW_ITEM and not constInfo.IS_AUTO_POTION(itemVnum):
if not slotNumber in self.liHighlightedItems:
self.wndItem.DeactivateSlot(i)
self.wndItem.RefreshSlot()
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
self.__RefreshHighlights()
if self.wndBelt:
self.wndBelt.RefreshSlot()
if app.ENABLE_HIGHLIGHT_NEW_ITEM:
def HighlightSlot(self, slot):
if not slot in self.liHighlightedItems:
self.liHighlightedItems.append(slot)
def __RefreshHighlights(self):
for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
if slotNumber in self.liHighlightedItems:
self.wndItem.ActivateSlot(i)
def RefreshEquipSlotWindow(self):
getItemVNum=player.GetItemIndex
getItemCount=player.GetItemCount
setItemVNum=self.wndEquip.SetItemSlot
for i in xrange(player.EQUIPMENT_PAGE_COUNT):
slotNumber = player.EQUIPMENT_SLOT_START + i
itemCount = getItemCount(slotNumber)
if itemCount <= 1:
itemCount = 0
setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT):
slotNumber = player.NEW_EQUIPMENT_SLOT_START + i
itemCount = getItemCount(slotNumber)
if itemCount <= 1:
itemCount = 0
setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
print "ENABLE_NEW_EQUIPMENT_SYSTEM", slotNumber, itemCount, getItemVNum(slotNumber)
self.wndEquip.RefreshSlot()
if self.wndCostume:
self.wndCostume.RefreshCostumeSlot()
def RefreshItemSlot(self):
self.RefreshBagSlotWindow()
self.RefreshEquipSlotWindow()
def RefreshStatus(self):
if app.RENEWAL_REFRESH:
self.GetChild("Money").SetText(player.GetElk())
# if app.ENABLE_GEM_SYSTEM:
# self.GetChild("Gem").SetText(player.GetGem())
# else:
# self.GetChild("Money").SetText(localeInfo.NumberToMoneyString(player.GetElk()))
# if app.ENABLE_GEM_SYSTEM:
# self.GetChild("Gem").SetText(localeInfo.NumberToMoneyGem(player.GetGem()))
if app.RENEWAL_REFRESH:
def OnUpdate(self):
try:
self.GetChild("Money").OnUpdateCool()
# if app.ENABLE_GEM_SYSTEM:
# self.GetChild("Gem").OnUpdateCool()
except KeyError:
print("Key error: Money")
def SetItemToolTip(self, tooltipItem):
self.tooltipItem = tooltipItem
def SellItem(self):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.INVENTORY, self.sellingSlotNumber):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
snd.PlaySound("sound/ui/money.wav")
self.OnCloseQuestionDialog()
def OnDetachMetinFromItem(self):
if None == self.questionDialog:
return
#net#net.SendItemUseToItemPacket(self.questionDialog.sourcePoslf.questionDialog.targetPos)
self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
self.OnCloseQuestionDialog()
def OnCloseQuestionDialog(self):
if not self.questionDialog:
return
self.questionDialog.Close()
self.questionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
## S##t Event
def SelectEmptySlot(self, selectedSlotPos):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
return
selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)
if mouseModule.mouseController.isAttached():
attachedSlotType = mouseModule.mouseController.GetAttachedType()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.SlotTypeToInvenType(attachedSlotType),attachedSlotPos):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
#@fi#@fi#@fixme011INock ds equip)
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
mouseModule.mouseController.DeattachObject()
return
#@fi#@fi#@fixme011 itemCount = player.GetItemCount(attachedSlotPos)
attachedCount = mouseModule.mouseController.GetAttachedItemCount()
self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
if item.IsRefineScroll(attachedItemIndex):
self.wndItem.SetUseMode(False)
elif player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AKIRA_TEXT_2)
elif player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AKIRA_TEXT_3)
elif player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AKIRA_TEXT_0)
elif app.ENABLE_SWITCHBOT and player.SLOT_TYPE_SWITCHBOT == attachedSlotType:
attachedCount = mouseModule.mouseController.GetAttachedItemCount()
net.SendItemMovePacket(player.SWITCHBOT, attachedSlotPos, player.INVENTORY, selectedSlotPos, attachedCount)
elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
mouseModule.mouseController.RunCallBack("INVENTORY")
elif player.SLOT_TYPE_SHOP == attachedSlotType:
net.SendShopBuyPacket(attachedSlotPos)
elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
chat.AppendChat(1, localeInfo.AKIRA_TEXT_1)
if player.ITEM_MONEY == attachedItemIndex:
net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
snd.PlaySound("sound/ui/money.wav")
else:
net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
elif player.SLOT_TYPE_MALL == attachedSlotType:
net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
mouseModule.mouseController.DeattachObject()
def SelectItemSlot(self, itemSlotIndex):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
return
itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
if mouseModule.mouseController.isAttached():
attachedSlotType = mouseModule.mouseController.GetAttachedType()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
if app.ENABLE_SPECIAL_STORAGE:
if player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType:
#@fi#@fi#@fixme011INock ds equip)
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
mouseModule.mouseController.DeattachObject()
return
#@fi#@fi#@fixme011 self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
else:
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
#@fi#@fi#@fixme011INock ds equip)
attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
mouseModule.mouseController.DeattachObject()
return
#@fi#@fi#@fixme011 self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
mouseModule.mouseController.DeattachObject()
else:
curCursorNum = app.GetCursor()
if app.SELL == curCursorNum:
self.__SellItem(itemSlotIndex)
elif app.BUY == curCursorNum:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
elif app.IsPressed(app.DIK_LALT):
link = player.GetItemLink(itemSlotIndex)
ime.PasteString(link)
elif app.IsPressed(app.DIK_LSHIFT):
itemCount = player.GetItemCount(itemSlotIndex)
if itemCount > 1:
self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE)
self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
self.dlgPickMoney.Open(itemCount)
self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
#els#els#else #sel#sel#selectedItemVNumlayer.GetItemIndex(itemSlotIndex #mou#mou#mouseModule.mouseController.AttachObject(selfayer.SLOT_TYPE_INVENTORYemSlotIndex, selectedItemVNum)
elif app.IsPressed(app.DIK_LCONTROL):
itemIndex = player.GetItemIndex(itemSlotIndex)
if True == item.CanAddToQuickSlotItem(itemIndex):
player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
else:
selectedItemVNum = player.GetItemIndex(itemSlotIndex)
itemCount = player.GetItemCount(itemSlotIndex)
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):
self.wndItem.SetUseMode(True)
else:
self.wndItem.SetUseMode(False)
snd.PlaySound("sound/ui/pick.wav")
def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):
if app.ENABLE_SPECIAL_STORAGE:
if srcItemSlotPos == dstItemSlotPos and not item.IsMetin(srcItemVID):
return
else:
if srcItemSlotPos == dstItemSlotPos:
return
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and (uinewofflineshop.IsSaleSlot(player.INVENTORY, srcItemSlotPos) or uinewofflineshop.IsSaleSlot(player.INVENTORY , dstItemSlotPos)):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
# cyh itemseal 2013 11 08
if app.ENABLE_SOULBIND_SYSTEM and item.IsSealScroll(srcItemVID):
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
elif item.IsRefineScroll(srcItemVID):
self.RefineItem(srcItemSlotPos, dstItemSlotPos)
self.wndItem.SetUseMode(False)
elif item.IsMetin(srcItemVID):
self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)
elif item.IsDetachScroll(srcItemVID):
self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos)
elif item.IsKey(srcItemVID):
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE:
self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
else:
#snd#snd#snd.PlaySound(nddrop.wav")
if player.IsEquipmentSlot(dstItemSlotPos):
if item.IsEquipmentVID(srcItemVID):
self.__UseItem(srcItemSlotPos)
else:
self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
#net#net#net.SendItemMovePacket(srcItemSlotPostItemSlotPos
def __SellItem(self, itemSlotPos):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
if not player.IsEquipmentSlot(itemSlotPos):
self.sellingSlotNumber = itemSlotPos
itemIndex = player.GetItemIndex(itemSlotPos)
itemCount = player.GetItemCount(itemSlotPos)
self.sellingSlotitemIndex = itemIndex
self.sellingSlotitemCount = itemCount
item.SelectItem(itemIndex)
## 2##40220
if item.IsAntiFlag(item.ANTIFLAG_SELL):
popup = uiCommon.PopupDialog()
popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
popup.SetAcceptEvent(self.__OnClosePopupDialog)
popup.Open()
self.popup = popup
return
itemPrice = item.GetISellItemPrice()
if item.Is1GoldItem():
itemPrice = itemCount / itemPrice / 5
else:
itemPrice = itemPrice * itemCount / 5
item.GetItemName(itemIndex)
itemName = item.GetItemName()
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice))
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
self.questionDialog.Open()
self.questionDialog.count = itemCount
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
def __OnClosePopupDialog(self):
self.pop = None
def RefineItem(self, scrollSlotPos, targetSlotPos):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
scrollIndex = player.GetItemIndex(scrollSlotPos)
targetIndex = player.GetItemIndex(targetSlotPos)
if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotPos):
return
###########################################################
self.__SendUseItemToItemPacket(scrollSlotPos, targetSlotPos)
#net#net#net.SendItemUseToItemPacket(scrollSlotPosrgetSlotPos return
###########################################################
###########################################################
#net#net#net.SendRequestRefineInfoPacket(targetSlotPos #ret#ret#return ###########################################################
result = player.CanRefine(scrollIndex, targetSlotPos)
if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_MORE_SOCKET)
elif player.REFINE_NEED_MORE_GOOD_SCROLL == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NEED_BETTER_SCROLL)
elif player.REFINE_CANT_MAKE_SOCKET_ITEM == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_SOCKET_DISABLE_ITEM)
elif player.REFINE_NOT_NEXT_GRADE_ITEM == result:
#snd#snd#snd.PlaySound(ndjaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM)
elif player.REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
if player.REFINE_OK != result:
return
self.refineDialog.Open(scrollSlotPos, targetSlotPos)
def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
scrollIndex = player.GetItemIndex(scrollSlotPos)
targetIndex = player.GetItemIndex(targetSlotPos)
if not player.CanDetach(scrollIndex, targetSlotPos):
if app.ENABLE_ACCE_COSTUME_SYSTEM:
item.SelectItem(scrollIndex)
if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_FAILURE_CLEAN)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
return
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
if app.ENABLE_ACCE_COSTUME_SYSTEM:
item.SelectItem(targetIndex)
if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
item.SelectItem(scrollIndex)
if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
self.questionDialog.SetText(localeInfo.ACCE_DO_YOU_CLEAN)
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
self.questionDialog.Open()
self.questionDialog.sourcePos = scrollSlotPos
self.questionDialog.targetPos = targetSlotPos
def AttachMetinToItem(self, metinSlotPos, targetSlotPos):
if app.ENABLE_SPECIAL_STORAGE:
metinIndex = player.GetItemIndex(player.STONE_INVENTORY, metinSlotPos)
else:
metinIndex = player.GetItemIndex(metinSlotPos)
targetIndex = player.GetItemIndex(targetSlotPos)
item.SelectItem(metinIndex)
itemName = item.GetItemName()
result = player.CanAttachMetin(metinIndex, targetSlotPos)
if player.ATTACH_METIN_NOT_MATCHABLE_ITEM == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_CAN_NOT_ATTACH(itemName))
if player.ATTACH_METIN_NO_MATCHABLE_SOCKET == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_SOCKET(itemName))
elif player.ATTACH_METIN_NOT_EXIST_GOLD_SOCKET == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_GOLD_SOCKET(itemName))
elif player.ATTACH_METIN_CANT_ATTACH_TO_EQUIPMENT == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
if player.ATTACH_METIN_OK != result:
return
self.attachMetinDialog.Open(metinSlotPos, targetSlotPos)
def OverOutItem(self):
self.wndItem.SetUsableItem(False)
if None != self.tooltipItem:
self.tooltipItem.HideToolTip()
def OverInItem(self, overSlotPos):
overSlotPosGlobal = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
self.wndItem.SetUsableItem(False)
if app.ENABLE_HIGHLIGHT_NEW_ITEM and overSlotPosGlobal in self.liHighlightedItems:
self.liHighlightedItems.remove(overSlotPosGlobal)
self.wndItem.DeactivateSlot(overSlotPos)
if mouseModule.mouseController.isAttached():
attachedItemType = mouseModule.mouseController.GetAttachedType()
if app.ENABLE_SPECIAL_STORAGE:
if player.SLOT_TYPE_INVENTORY == attachedItemType or player.SLOT_TYPE_STONE_INVENTORY == attachedItemType:
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
if attachedItemVNum==player.ITEM_MONEY: # @fixme005
pass
elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPosGlobal):
self.wndItem.SetUsableItem(True)
self.wndItem.SetUseMode(True)
self.ShowToolTip(overSlotPosGlobal)
return
else:
if player.SLOT_TYPE_INVENTORY == attachedItemType:
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
if attachedItemVNum==player.ITEM_MONEY: # @fixme005
pass
elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPosGlobal):
self.wndItem.SetUsableItem(True)
self.ShowToolTip(overSlotPosGlobal)
return
self.ShowToolTip(overSlotPosGlobal)
def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos):
"다른 아이템에 사용할 수 있는 아이템인가?"
if item.IsRefineScroll(srcItemVNum):
return True
elif item.IsMetin(srcItemVNum):
return True
elif item.IsDetachScroll(srcItemVNum):
return True
elif item.IsKey(srcItemVNum):
return True
elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
return True
else:
if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE:
return True
return False
def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):
if app.ENABLE_SPECIAL_STORAGE:
if srcSlotPos == dstSlotPos and not item.IsMetin(srcItemVNum):
return False
else:
if srcSlotPos == dstSlotPos:
return False
if item.IsRefineScroll(srcItemVNum):
if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos):
return True
elif item.IsMetin(srcItemVNum):
if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos):
return True
elif item.IsDetachScroll(srcItemVNum):
if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos):
return True
elif item.IsKey(srcItemVNum):
if player.CanUnlock(srcItemVNum, dstSlotPos):
return True
elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
return True
else:
useType=item.GetUseType(srcItemVNum)
if "USE_CLEAN_SOCKET" == useType:
if self.__CanCleanBrokenMetinStone(dstSlotPos):
return True
elif "USE_CHANGE_ATTRIBUTE" == useType:
if self.__CanChangeItemAttrList(dstSlotPos):
return True
elif "USE_ADD_ATTRIBUTE" == useType:
if self.__CanAddItemAttr(dstSlotPos):
return True
elif "USE_ADD_ATTRIBUTE2" == useType:
if self.__CanAddItemAttr(dstSlotPos):
return True
elif "USE_ADD_ACCESSORY_SOCKET" == useType:
if self.__CanAddAccessorySocket(dstSlotPos):
return True
elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
return True;
elif "USE_PUT_INTO_BELT_SOCKET" == useType:
dstItemVNum = player.GetItemIndex(dstSlotPos)
print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum
item.SelectItem(dstItemVNum)
if item.ITEM_TYPE_BELT == item.GetItemType():
return True
elif app.ENABLE_USE_COSTUME_ATTR and "USE_CHANGE_COSTUME_ATTR" == useType:
if self.__CanChangeCostumeAttrList(dstSlotPos):
return True
elif app.ENABLE_USE_COSTUME_ATTR and "USE_RESET_COSTUME_ATTR" == useType:
if self.__CanResetCostumeAttr(dstSlotPos):
return True
return False
def __CanCleanBrokenMetinStone(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.ITEM_TYPE_WEAPON != item.GetItemType():
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
return True
return False
def __CanChangeItemAttrList(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
return True
return False
if app.ENABLE_USE_COSTUME_ATTR:
def __CanChangeCostumeAttrList(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_COSTUME:
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
return True
return False
def __CanResetCostumeAttr(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_COSTUME:
return False
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
return True
return False
def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_ARMOR:
return False
if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
return False
curCount = player.GetItemMetinSocket(dstSlotPos, 0)
maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
return False
if curCount>=maxCount:
return False
return True
def __CanAddAccessorySocket(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if item.GetItemType() != item.ITEM_TYPE_ARMOR:
return False
if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
return False
curCount = player.GetItemMetinSocket(dstSlotPos, 0)
maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
ACCESSORY_SOCKET_MAX_SIZE = 3
if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
return False
return True
def __CanAddItemAttr(self, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotPos)
if dstItemVNum == 0:
return False
item.SelectItem(dstItemVNum)
if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False
attrCount = 0
for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemAttribute(dstSlotPos, i)[0] != 0:
attrCount += 1
if attrCount<4:
return True
return False
def ShowToolTip(self, slotIndex):
if None != self.tooltipItem:
self.tooltipItem.SetInventoryItem(slotIndex)
# if app.ENABLE_RENDER_TARGET:
# self.tooltipItem.AppendRenderingTooltip(itemVnum)
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() or uinewofflineshop.IsBuildingAuction():
self.__AddTooltipSaleMode(slotIndex)
if app.__ENABLE_NEW_OFFLINESHOP__:
def __AddTooltipSaleMode(self, slot):
if player.IsEquipmentSlot(slot):
return
itemIndex = player.GetItemIndex(slot)
if itemIndex !=0:
item.SelectItem(itemIndex)
if item.IsAntiFlag(item.ANTIFLAG_MYSHOP) or item.IsAntiFlag(item.ANTIFLAG_GIVE):
return
self.tooltipItem.AddRightClickForSale()
def OnTop(self):
if None != self.tooltipItem:
self.tooltipItem.SetTop()
def OnPressEscapeKey(self):
self.Close()
return True
def UseItemSlot(self, slotIndex):
curCursorNum = app.GetCursor()
if app.SELL == curCursorNum:
return
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
return
slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop():
globalSlot = slotIndex
itemIndex = player.GetItemIndex(globalSlot)
item.SelectItem(itemIndex)
if not item.IsAntiFlag(item.ANTIFLAG_GIVE) and not item.IsAntiFlag(item.ANTIFLAG_MYSHOP):
offlineshop.ShopBuilding_AddInventoryItem(globalSlot)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
elif uinewofflineshop.IsBuildingAuction():
globalSlot = slotIndex
itemIndex = player.GetItemIndex(globalSlot)
item.SelectItem(itemIndex)
if not item.IsAntiFlag(item.ANTIFLAG_GIVE) and not item.IsAntiFlag(item.ANTIFLAG_MYSHOP):
offlineshop.AuctionBuilding_AddInventoryItem(globalSlot)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
if app.ENABLE_DRAGON_SOUL_SYSTEM:
if self.wndDragonSoulRefine.IsShow():
self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1)
return
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if self.isShowAcceWindow():
acce.Add(player.INVENTORY, slotIndex, 255)
return
if app.ENABLE_ITEM_DELETE_SYSTEM:
if self.isShowDeleteItemDlg():
self.wndItemDelete.AddItemWithoutMouse(player.INVENTORY, slotIndex)
return
self.__UseItem(slotIndex)
mouseModule.mouseController.DeattachObject()
self.OverOutItem()
def __UseItem(self, slotIndex):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uinewofflineshop.IsBuildingShop() and uinewofflineshop.IsSaleSlot(player.INVENTORY, slotIndex):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInf
FFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)return
ItemVNum = player.GetItemIndex(slotIndex)
item.SelectItem(ItemVNum)
if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
self.questionDialog.Open()
self.questionDialog.slotIndex = slotIndex
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
# elif app.ENABLE_RENDER_TARGET and app.IsPressed(app.DIK_LSHIFT):
# self.tooltipItem.ModelPreviewFull(ItemVNum, slotIndex)
else:
self.__SendUseItemPacket(slotIndex)
#net.SendItemUsePacket(slotIndex)
#net.SendItemUsePacket(slotIndexCloseQuestionDialog()
def __UseItemQuestionDialog_OnAccept(self):
self.__SendUseItemPacket(self.questionDialog.slotIndex)
self.OnCloseQuestionDialog()
def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemUseToItemPacket(srcSlotPos, dstSlotPos)
def __SendUseItemPacket(self, slotPos):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemUsePacket(slotPos)
def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
return
if app.ENABLE_SPECIAL_STORAGE:
if mouseModule.mouseController.isAttached():
attachedSlotType = mouseModule.mouseController.GetAttachedType()
if attachedSlotType == player.UPGRADE_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Y?seltme envanterine normal envanterinden item aktaramazs?!")
return
if attachedSlotType == player.BOOK_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Kitap envanterine normal envanterinden item aktaramazs?!")
return
if attachedSlotType == player.STONE_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Ta envanterine normal envanterinden item aktaramazs?!")
return
if attachedSlotType == player.CHEST_INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Sand? envanterine normal envanterinden item aktaramazs?!")
return
net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
def SetDragonSoulRefineWindow(self, wndDragonSoulRefine):
if app.ENABLE_DRAGON_SOUL_SYSTEM:
self.wndDragonSoulRefine = wndDragonSoulRefine
if app.ENABLE_HIDE_COSTUME_SYSTEM:
def RefreshVisibleCostume(self):
if self.wndCostume:
self.wndCostume.RefreshVisibleCostume()
else:
self.wndCostume = CostumeWindow(self)
self.wndCostume.RefreshVisibleCostume()
def OnMoveWindow(self, x, y):
# print "Inventory Global Pos : ", self.GetGlobalPosition()
if self.wndBelt:
# print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
self.wndBelt.AdjustPositionAndSize()
if self.wndMenu:
# print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
self.wndMenu.AdjustPositionAndSize()
if app.ENABLE_ACCE_COSTUME_SYSTEM:
def SetAcceWindow(self, wndAcceCombine, wndAcceAbsorption):
self.wndAcceCombine = wndAcceCombine
self.wndAcceAbsorption = wndAcceAbsorption
def isShowAcceWindow(self):
if self.wndAcceCombine:
if self.wndAcceCombine.IsShow():
return 1
if self.wndAcceAbsorption:
if self.wndAcceAbsorption.IsShow():
return 1
return 0
if app.ENABLE_WHEEL_MOUSE:
def OnRunMouseWheel(self, nLen):
if nLen > 0:
if self.inventoryPageIndex < 4:
self.SetInventoryPage(self.inventoryPageIndex + 1)
else:
if self.inventoryPageIndex > 0:
self.SetInventoryPage(self.inventoryPageIndex - 1)
if app.ENABLE_DROP_DIALOG_EXTENDED_SYSTEM:
def DeleteItem(self, slotPos, invenType):
itemIndex = player.GetItemIndex(invenType, slotPos)
item.SelectItem(itemIndex)
itemQuestionDialog2 = uiCommon.ItemQuestionDialog2()
itemQuestionDialog2.SetText('[%s] nesnesine ne yapmak istiyorsun?' % item.GetItemName())
itemQuestionDialog2.SetText2('(Fiyat: %s)' % localeInfo.NumberToMoneyString(item.GetISellItemPrice() * player.GetItemCount(invenType, slotPos) * 100 / 100))
itemQuestionDialog2.SetDeleteAcceptEvent(lambda arg = 0: self.__AnswerDeleteItem(arg))
itemQuestionDialog2.SetSellAcceptEvent(lambda arg = 1: self.__AnswerDeleteItem(arg))
itemQuestionDialog2.SetCancelEvent(lambda arg = 2: self.__AnswerDeleteItem(arg))
itemQuestionDialog2.Open()
itemQuestionDialog2.slotPos = slotPos
itemQuestionDialog2.invenType = invenType
self.itemQuestionDialog2 = itemQuestionDialog2
def __AnswerDeleteItem(self, answer):
if not self.itemQuestionDialog2:
return
else:
if answer == 0:
net.SendItemDeletePacket(self.itemQuestionDialog2.slotPos, self.itemQuestionDialog2.invenType)
snd.PlaySound('sound/ui/drop.wav')
elif answer == 1:
net.SendItemSellPacket(self.itemQuestionDialog2.slotPos, self.itemQuestionDialog2.invenType)
snd.PlaySound('sound/ui/money.wav')
self.itemQuestionDialog2.Close()
self.itemQuestionDialog2 = None
return
if app.ENABLE_ITEM_DELETE_SYSTEM:
def SetDeleteItemDlg(self, wndItemDelete):
self.wndItemDelete = wndItemDelete
def isShowDeleteItemDlg(self):
if self.wndItemDelete:
if self.wndItemDelete.IsShow():
return 1
return 0[/CODE]
[CODE title="constinfo.py"]# EXTRA BEGIN
# loads 5 (B,M,G,P,F) skills .mse
ENABLE_NEW_LEVELSKILL_SYSTEM = 0
# don't set a random channel when you open the client
ENABLE_RANDOM_CHANNEL_SEL = 0
# don't remove id&pass if the login attempt fails
ENABLE_CLEAN_DATA_IF_FAIL_LOGIN = 0
# ctrl+v will now work
ENABLE_PASTE_FEATURE = 0
# display all the bonuses added by a stone instead of the first one
ENABLE_FULLSTONE_DETAILS = 1
# enable successfulness % in the refine dialog
ENABLE_REFINE_PCT = 0
# extra ui features
EXTRA_UI_FEATURE = 1
#
# LOGİN CACHE DATA
LoadData = 0
# LOGİN CACHE DATA
NEW_678TH_SKILL_ENABLE = 1
# EXTRA END
#DEPO
depolar = 1
#DEPO END
import app
if #DEPONABLE_OFFICAL#DEPOACTER_SCREEN:
W#DEPONABLE_OFFICALD" # ENABLED/DISABLED
WOLF_WOMEN = "DISABLED" # ENABLED/DISABLED
# enable save account
ENABLE_SAVE_ACCOUNT = True
if ENABLE_SAVE_ACCOUNT:
class SAB:
ST_CACHE, ST_FILE, ST_REGISTRY = xrange(3)
slotCount = 5
storeType = ST_REGISTRY # 0 cache, 1 file, 2 registry
btnName = {
"Save": "SaveAccountButton_Save_%02d",
"Access": "SaveAccountButton_Access_%02d",
"Remove": "SaveAccountButton_Remove_%02d",
}
accData = {}
regPath = r"SOFTWARE\Metin2"
regName = "slot%02d_%s"
regValueId = "id"
regValuePwd = "pwd"
fileExt = ".do.not.share.it.txt"
import app
if app.AUTO_SHOUT:
auto_shout_status = 0
auto_shout_text = ""
CHAT_TELEPORT_NEW = 0
if app.LORENZO_RENKLI_SOHBET:
chat_color_page_open = 0
chat_color = ""
if app.ENABLE_CHANNEL_INFO_UPDATE:
SERVER_TYPE = 0
if app.ENABLE_SEND_TARGET_INFO:
MONSTER_INFO_DATA = {}
if app.ENABLE_RENDER_TARGET:
ENABLE_MODEL_PREVIEW = 1
if app.ENABLE_KILL_STATISTICS:
KILL_STATISTICS_DATA = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]
if app.ENABLE_HIDE_COSTUME_SYSTEM:
HIDDEN_BODY_COSTUME = 0
HIDDEN_HAIR_COSTUME = 0
# HIDE_COSTUME = 0
if app.ENABLE_ACCE_COSTUME_SYSTEM:
HIDDEN_ACCE_COSTUME = 0
if app.ENABLE_WEAPON_COSTUME_SYSTEM:
HIDDEN_WEAPON_COSTUME = 0
if app.ENABLE_ITEM_DELETE_SYSTEM:
silme = 0
ITEM_DELETE_LIST = {}
if app.BOSS_ARENA:
bossarena = []
MONSTER_INFO_DATA_VNUM = {}
secilenBoss = 0
if app.FT_GAME_MENU:
SPEED_BUTTON=0
MENU_RUTBE = 0
MENU_MARKET = 0
MENU_OTO = 0
MENU_ZINDAN = 0
MENU_CUBE = 0
if app.TITLE_SYSTEM:
title_status = {
0 : ["0"],
1 : ["0"],
2 : ["0"],
3 : ["0"],
4 : ["0"],
5 : ["0"]
}
TitleUpgradeItems = [
# Boş Title --Dokunma--
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Canavar Avcısı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Metin Avcısı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Patron Avcısı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Avcı
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
# Katil
[
# [item1-item1adet-item2-item2adet......],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[20066,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
]
]
TitleBonus = [
# Boş Title --Dokunma--
[
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
# Canavar Avcısı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",1,2,5],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
# Metin Avcısı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",5,7,10],
["Metinlere Karþý Gü笼",5,7,10],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
# Patron Avcısı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",10,15,20],
["Metinlere Karþý Gü笼",10,15,20],
["Yarý ݮsanlara Karþý Gü笼",10,15,20],
[0,0,0,0],
[0,0,0,0]
],
# Avcı
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",20,25,30],
["Metinlere Karþý Gü笼",20,25,30],
["Yarý ݮsanlara Karþý Gü笼",20,25,30],
["Ortalama Zarar",1,3,5],
[0,0,0,0]
],
# Katil
[
# [bonuskodu,seviye1 bonus,seviye2 bonus,seviye3 bonus],
["Canavarlara Karþý Gü笼",30,40,50],
["Metinlere Karþý Gü笼",30,40,50],
["Yarý ݮsanlara Karþý Gü笼",30,40,50],
["Ortalama Zarar",7,9,10],
["Beceri Hasarý",5,10,15]
]
]
def CreateSABDataFolder(filePath):
import os
folderPath = os.path.split(filePath)[0]
if not os.path.exists(folderPath):
os.makedirs(folderPath)
def IsExistSABDataFile(filePath):
import os
return os.path.exists(filePath)
def GetSABDataFile(idx):
import os
filePath = "%s\\Metin2\\" % os.getenv('appdata')
filePath += SAB.regName % (idx, SAB.regValueId)
filePath += SAB.fileExt
return filePath
def DelJsonSABData(idx):
import os
filePath = GetSABDataFile(idx)
if IsExistSABDataFile(filePath):
os.remove(filePath)
def GetJsonSABData(idx):
(id, pwd) = ("", "")
filePath = GetSABDataFile(idx)
if not IsExistSABDataFile(filePath):
return (id, pwd)
with old_open(filePath) as data_file:
try:
import json
(id, pwd) = json.load(data_file)
id = str(id) # unicode to ascii
pwd = str(pwd) # unicode to ascii
except ValueError:
pass
return (id, pwd)
def SetJsonSABData(idx, slotData):
filePath = GetSABDataFile(idx)
CreateSABDataFolder(filePath)
with old_open(filePath, "w") as data_file:
import json
json.dump(slotData, data_file)
def DelWinRegKeyValue(keyPath, keyName):
try:
import _winreg
_winreg.CreateKey(_winreg.HKEY_CURRENT_USER, keyPath)
_tmpKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, keyPath, 0, _winreg.KEY_WRITE)
_winreg.DeleteValue(_tmpKey, keyName)
_winreg.CloseKey(_tmpKey)
return True
except WindowsError:
return False
def GetWinRegKeyValue(keyPath, keyName):
try:
import _winreg
_tmpKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, keyPath, 0, _winreg.KEY_READ)
keyValue, keyType = _winreg.QueryValueEx(_tmpKey, keyName)
_winreg.CloseKey(_tmpKey)
return str(keyValue) # unicode to ascii
except WindowsError:
return None
def SetWinRegKeyValue(keyPath, keyName, keyValue):
try:
import _winreg
_winreg.CreateKey(_winreg.HKEY_CURRENT_USER, keyPath)
_tmpKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, keyPath, 0, _winreg.KEY_WRITE)
_winreg.SetValueEx(_tmpKey, keyName, 0, _winreg.REG_SZ, keyValue)
_winreg.CloseKey(_tmpKey)
return True
except WindowsError:
return False
# classic minmax def
def minmax(tmin, tmid, tmax):
if tmid < tmin:
return tmin
elif tmid > tmax:
return tmax
return tmid
# EXTRA END
# eğer yoksa müsait bir yere ekle
_interface_instance = None
def GetInterfaceInstance():
global _interface_instance
return _interface_instance
def SetInterfaceInstance(instance):
global _interface_instance
if _interface_instance:
del _interface_instance
_interface_instance = instance
akiraefsun = None
AkiraMenu = {0:0,1:0,2:0,3:0,4:0,5:1}
CApiSetHide = 0
INPUT_IGNORE = 0
# option
IN_GAME_SHOP_ENABLE = 1
CONSOLE_ENABLE = 0
PVPMODE_ENABLE = 1
PVPMODE_TEST_ENABLE = 0
PVPMODE_ACCELKEY_ENABLE = 1
PVPMODE_ACCELKEY_DELAY = 0.5
PVPMODE_PROTECTED_LEVEL = 15
FOG_LEVEL0 = 999999.0
FOG_LEVEL1 = 999999.0
FOG_LEVEL2 = 999999.0
FOG_LEVEL = FOG_LEVEL0
FOG_LEVEL_LIST=[FOG_LEVEL0, FOG_LEVEL1, FOG_LEVEL2]
CAMERA_MAX_DISTANCE_SHORT = 2500.0
CAMERA_MAX_DISTANCE_LONG = 3500.0
CAMERA_MAX_DISTANCE_LIST=[CAMERA_MAX_DISTANCE_SHORT, CAMERA_MAX_DISTANCE_LONG]
CAMERA_MAX_DISTANCE = CAMERA_MAX_DISTANCE_SHORT
CHRNAME_COLOR_INDEX = 0
ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"
#Lorenzo Systems
BATTLE_PASS = 0
CHEST_DROP_INFO_DATA = {}
OPPORTUNITY_DATA = []
OPEN_DEAL_OR_NO_DEAL = 0
ITEM_DATA = {}
ITEM_S#LorenzoTA = []
NEW_INGAME_SHOP=1
#Lorenzo Systems
avdam = 0
ADIM = ""
SOYADIM = ""
OCUM = ""
ANAN = 0
OTOAV = False
OTOAVSALDIR = False
OTOAVODAK = False
oto#Lorenzorus = 0
GUILD_BOARD_KEY = 0
BossArenaCheck = 1
YENI_ZAMAN = 0
DAKIKA = "%s dakika"
SAATVEDAKIKA = "%s saat %s dakika"
GUNSAAT = "%s gün %s saat"
## OTO LOGIN ##
otogiris = 0
otomatik_av_gui = 0
otomatik_av_gui_giris_sonrasi = 0
otologin_sure = 0
OTOAV = 0
TekVurus = 0
OTO##_HIT_COUNT ##99
girilecekkarakter = 0
otogiris_id = ""
otogiris_pw = ""
otogiris_pin = ""
## OTO LOGIN ##
# constant
HIGH_PRICE = 500000
##99LE_PRICE = 50000
ERROR_METIN_STONE = 28960
SUB2_LOADING_ENABLE = 1
EXPANDED_##MBO_ENABLE ##1
CONVERT_EMPIRE_LANGUAGE_ENABLE = 0
USE_ITEM_WEAPON_TABLE_ATTACK_BONUS = 0
ADD_DEF_BONUS_ENABLE = 0
LOGIN_COUNT_LIMIT_ENABLE ##1
USE_SKILL_EFFECT_UPGRADE_ENABLE = 1
VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD = 1
GUILD_MONEY_PER_GSP = 100
GUILD_WAR_TYPE_SELECT_ENABLE = 1
TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE = 10
HAIR_COLOR_ENABLE = 1
ARMOR_SPECULAR_ENABLE = 1
WEAPON_SPECULAR_ENABLE = 1
SEQUENCE_PACKET_ENABLE = 1
KEEP_ACCOUNT_CONNETION_ENABLE = 1
MINIMAP_POSITIONINFO_ENABLE = 1
isItemQuestionDialog = 0
def GET_ITEM_QUESTION_DIALOG_STATUS():
global isItemQuestionDialog
return isItemQuestionDialog
def SET_ITEM_QUESTION_DIALOG_STATUS(flag):
global isItemQuestionDialog
isItemQuestionDialog = flag
import app
import net
########################
def SET_DEFAULT_FOG_LEVEL():
global FOG_LEVEL
app.SetMinFog(FOG_LEVEL)
def SET_FOG_LEVEL_INDE###ndex):
global FOG_LEVEL
global FOG_LEVEL_LIST
try:
FOG_LEVEL=FOG_LEVEL_LIST[index]
except IndexError:
FOG_LEVEL=FOG_LEVEL_LIST[0]
app.SetMinFog(FOG_LEVEL)
def GET_FOG_LEVEL_INDEX():
global FOG_LEVEL
global FOG_LEVEL_LIST
return FOG_LEVEL_LIST.index(FOG_LEVEL)
########################
def SET_DEFAULT_CAMERA_MAX_DISTANCE():
global CAMERA_MAX_DISTANCE
app.SetCameraMaxDistance(CAM###_MAX_DISTANCE)
def SET_CAMERA_MAX_DISTANCE_INDEX(index):
global CAMERA_MAX_DISTANCE
global CAMERA_MAX_DISTANCE_LIST
try:
CAMERA_MAX_DISTANCE=CAMERA_MAX_DISTANCE_LIST[index]
except:
CAMERA_MAX_DISTANCE=CAMERA_MAX_DISTANCE_LIST[0]
app.SetCameraMaxDistance(CAMERA_MAX_DISTANCE)
def GET_CAMERA_MAX_DISTANCE_INDEX():
global CAMERA_MAX_DISTANCE
global CAMERA_MAX_DISTANCE_LIST
return CAMERA_MAX_DISTANCE_LIST.index(CAMERA_MAX_DISTANCE)
########################
import chrmgr
import player
import app
def SET_DEFAULT_CHRNAME_COLOR():
global CHRNAME_COLOR_INDE### chrmgr.SetEmpireNameMode(CHRNAME_COLOR_INDEX)
def SET_CHRNAME_COLOR_INDEX(index):
global CHRNAME_COLOR_INDEX
CHRNAME_COLOR_INDEX=index
chrmgr.SetEmpireNameMode(index)
def GET_CHRNAME_COLOR_INDEX():
global CHRNAME_COLOR_INDEX
return CHRNAME_COLOR_INDEX
def SET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(index):
global VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD = index
def GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
global VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
return VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD
def SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE():
global CONVERT_EMPIRE_LANGUAGE_ENABLE
net.SetEmpireLanguageMode(CONVERT_EMPIRE_LANGUAGE_ENABLE)
def SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS():
global USE_ITEM_WEAPON_TABLE_ATTACK_BONUS
player.SetWeaponAttackBonusFlag(USE_ITEM_WEAPON_TABLE_ATTACK_BONUS)
def SET_DEFAULT_USE_SKILL_EFFECT_ENABLE():
global USE_SKILL_EFFECT_UPGRADE_ENABLE
app.SetSkillEffectUpgradeEnable(USE_SKILL_EFFECT_UPGRADE_ENABLE)
def SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE():
global TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE
app.SetTwoHandedWeaponAttSpeedDecreaseValue(TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE)
########################
import item
ACCESSORY_MATERIAL_LIST = [50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, ###32, 50633, 50634, 50635, 50636, 50637, 50638, 50639]
JewelAccessoryInfos = [
# jewel wrist neck ear
###32 50634, 14420, 16220, 17220 ],
[ 50635, 14500, 16500, 17500 ],
[ 50636, 14520, 16520, 17520 ],
[ 50637, 14540, 16540, 17540 ],
[ 50638, 14560, 16560, 17560 ],
[ 50639, 14570, 16570, 17570 ],
]
def GET_ACCESSORY_MATERIAL_VNUM(vnum, subType):
ret = vnum
item_base = (vnum / 10) * 10
for info in JewelAccessoryInfos:
if item.ARMOR_WRIST == subType:
if info[1] == item_base:
return info[0]
elif item.ARMOR_NECK == subType:
if info[2] == item_base:
return info[0]
elif item.ARMOR_EAR == subType:
if info[3] == item_base:
return info[0]
if vnum >= 16210 and vnum <= 16219:
return 50625
if item.ARMOR_WRIST == subType:
WRIST_ITEM_VNUM_BASE = 14000
ret -= WRIST_ITEM_VNUM_BASE
elif item.ARMOR_NECK == subType:
NECK_ITEM_VNUM_BASE = 16000
ret -= NECK_ITEM_VNUM_BASE
elif item.ARMOR_EAR == subType:
EAR_ITEM_VNUM_BASE = 17000
ret -= EAR_ITEM_VNUM_BASE
type = ret/20
if type<0 or type>=len(ACCESSORY_MATERIAL_LIST):
type = (ret-170) / 20
if type<0 or type>=len(ACCESSORY_MATERIAL_LIST):
return 0
return ACCESSORY_MATERIAL_LIST[type]
##################################################################
def GET_BELT_MATERIAL_VNUM(vnum, subType = 0):
return 18###
##################################################################
def IS_AUTO_POTION(itemVnum):
return IS_AUTO_POTION_HP(i###Vnum) or IS_AUTO_POTION_SP(itemVnum)
def IS_AUTO_POTION_HP(itemVnum):
if 72723 <= itemVnum and 72726 >= itemVnum:
return 1
elif itemVnum >= 76021 and itemVnum <= 76022:
return 1
elif itemVnum == 79012:
return 1
return 0
def IS_AUTO_POTION_SP(itemVnum):
if 72727 <= itemVnum and 72730 >= itemVnum:
return 1
elif itemVnum >= 76004 and itemVnum <= 76005:
return 1
elif itemVnum == 79013:
return 1
return 0
[/CODE]
Ekli dosyalar
Son düzenleme:




