romegames 1
romegames
Krutzo 1
Krutzo
shrpnl 1
shrpnl
Best Studio 1
Best Studio
D 1
delimuratt
Aliyldrim 1
Aliyldrim
Mt2Hizmet 1
Mt2Hizmet
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

Inventory Management (Arrange & Stacking items)

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!

Paylaşım için teşekkürler hocam, zamanında en çok uğraştığım olaylardan birisi K Envanter birisi de budur. Sıralama esnasında itemleri silip geri çağırmak durumunda kalmak aynı zamanda Dupe riskini de oluşturuyordu. Örnek vermek gerekirse: Toplu Sil Sat sistemi eklediğimde herhangi itemi sattıktan sonra karakter bu sistemi devreye sokup karakter atınca itemler envantere yeniden geliyordu gibi... En son kendime böyle bir çözüm bulmuştum ama bana göre Metin2 piyasasında en riskli görebildiğim 3 sistem varsa; OfflineShop, K Envanter ve bu diyebilirim. Diğerleri riskli çünkü slot ne kadar artarsa paket boyutunu da bir o kadar arttırmak zorunda kalıyorsun. Örnek hazırladığım envanter düzenleme yapısı.
 

Ekli dosyalar

Görüntü yolunu kontrol edin
class InventoryManagementWindow(ui.Window)
def __LoadWindow

oR

Python:
            if app.KD_MANAGE_INV:
                self.wndManageInv = uiInventoryManagement.InventoryManagementWindow()
                self.wndManageInv.SetParent(self.GetChild("board"))
                xPos = 135 if localeInfo.IsARABIC() else 150
                self.wndManageInv.SetPosition(self.GetChild("TitleBar").GetWidth() - xPos, 6)
                self.wndManageInv.Show()
[CODE lang="python" title="uiinventory.py"]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_MOVE_COSTUME_ATTR:
USE_TYPE_TUPLE += ("USE_CHANGE_COSTUME_ATTR", "USE_RESET_COSTUME_ATTR",)

if app.ENABLE_CHANGED_ATTR:
USE_TYPE_TUPLE += ("USE_SELECT_ATTRIBUTE",)

if app.ENABLE_ATTR_6TH_7TH:
USE_TYPE_TUPLE += ("USE_CHANGE_ATTRIBUTE2",)

if app.ENABLE_REFINE_ELEMENT_SYSTEM:
USE_TYPE_TUPLE += ("USE_ELEMENT_UPGRADE", "USE_ELEMENT_DOWNGRADE", "USE_ELEMENT_CHANGE",)

questionDialog = None
tooltipItem = None

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
wndCostume = None
wndBelt = None

dlgPickMoney = None
if app.ENABLE_CHEQUE_SYSTEM:
dlgPickETC = None

sellingSlotNumber = -1
sellingSlotWindow = player.INVENTORY

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
isOpenedCostumeWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 코스츔이 열려있었는지 여부-_-; 네이밍 ㅈㅅ
isOpenedBeltWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 벨트 인벤토리가 열려있었는지 여부-_-; 네이밍 ㅈㅅ

isLoaded = 0
interface = None
pop = None

def __init__(self):
if app.ENABLE_GEM_SYSTEM:
self.wndExpandedMoneyBar = None
self.wndGem = None

if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.wndEquipment = None

ui.ScriptWindow.__init__(self)

self.isOpenedBeltWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 벨트 인벤토리가 열려있었는지 여부-_-; 네이밍 ㅈㅅ

self.__LoadWindow()

self.IsClickBeltInventory = False

def __del__(self):
ui.ScriptWindow.__del__(self)
if app.ENABLE_GEM_SYSTEM:
self.wndExpandedMoneyBar = None
self.wndGem = None

if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.wndEquipment = None

def SetClickBeltInventory(self, isclick):
self.IsClickBeltInventory = isclick

def Show(self):
self.__LoadWindow()

ui.ScriptWindow.Show(self)

self.RefreshItemSlot()
self.RefreshStatus()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
# 인벤토리를 닫을 때 코스츔이 열려있었다면 인벤토리를 열 때 코스츔도 같이 열도록 함.
if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
self.wndCostume.Show()

# 인벤토리를 닫을 때 벨트 인벤토리가 열려있었다면 같이 열도록 함.
if self.wndBelt:
self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)

if app.ENABLE_GEM_SYSTEM:
if self.wndExpandedMoneyBar:
self.wndExpandedMoneyBar.Show()

if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
if self.wndEquipment:
self.wndEquipment.Show()

def BindInterfaceClass(self, interface):
from _weakref import proxy
self.interface = proxy(interface)

def __LoadWindow(self):
if self.isLoaded == 1:
return

self.isLoaded = 1

try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_COMMON_UISCRIPT_PATH + "InventoryWindow.py")
except:
import exception
exception.Abort("InventoryWindow.LoadWindow.LoadObject")

try:
wndItem = self.GetChild("ItemSlot")
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
wndEquip = self.GetChild("EquipmentSlot")
self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
self.wndMoney = self.GetChild("Money")
self.wndMoneySlot = self.GetChild("Money_Slot")
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.mallButton = self.GetChild2("MallButton")
self.DSSButton = self.GetChild2("DSSButton")
self.costumeButton = self.GetChild2("CostumeButton")

if app.ENABLE_CHEQUE_SYSTEM:
self.wndCheque = self.GetChild("Cheque")
self.wndChequeSlot = self.GetChild("Cheque_Slot")

if app.ENABLE_GEM_SYSTEM:
self.wndMoneyIcon = self.GetChild("Money_Icon")
self.wndChequeIcon = self.GetChild("Cheque_Icon")
self.wndMoneyIcon.Hide()
self.wndMoneySlot.Hide()
self.wndChequeIcon.Hide()
self.wndChequeSlot.Hide()

## 높이 조절
height = self.GetHeight()
width = self.GetWidth()
self.SetSize(width, height - 22)
self.GetChild("board").SetSize(width, height - 22)

else:
self.wndMoneyI##n = self.GetChild("Money_Icon")
self.wndChequeIcon = self.GetChild("Cheque_Icon")

self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)

self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)

self.toolTip = uiToolTip.ToolTip()
self.toolTip.ClearToolTip()

self.inventoryTab = []
self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
self.inventoryTab.append(self.GetChild("Inventory_Tab_03"))
self.inventoryTab.append(self.GetChild("Inventory_Tab_04"))

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.equipmentTab = []
self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))

# Belt Inventory Window
self.wndBelt = None
# Sorting
if app.KD_MANAGE_INV:
xPos = 135 if localeInfo.IsARABIC() else 150
self.wndManageInv = uisorting.InventoryManagementWindow()
self.wndManageInv.SetParent(self.GetChild("board"))
self.wndManageInv.SetPosition(self.GetChild("TitleBar").GetWidth() - xPos, 6)
self.wndManageInv.Show()

self.dlgQuestion = uiCommon.QuestionDialog2()
self.dlgQuestion.Close()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.wndBelt = BeltInventoryWindow(self)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
self.listHighlightedAcceSlot = []

if app.ENABLE_CHANGE_LOOK_SYSTEM:
self.listHighlightedChangeLookSlot = []

if app.ENABLE_AURA_COSTUME_SYSTEM:
self.listHighlightedAuraSlot = []

if app.ENABLE_CUBE_RENEWAL:
self.listHighlightedCubeSlot = []

if app.WJ_ENABLE_PICKUP_ITEM_EFFECT:
self.listHighlightedSlot = []

if app.ENABLE_EXTEND_INVEN_SYSTEM:
self.ExInvenQuestionDlg = uiCommon.QuestionDialog()
self.ExInvenQuestionDlg.Close()

if app.ENABLE_AURA_COSTUME_SYSTEM:
self.clear_aura_item_question_dialog = None

if app.ENABLE_GEM_CONVERTER:
self.gem_converter_question_dialog = None
self.gem_converter_item_pos = (-1, -1)
except:
import exception
exception.Abort("InventoryWindow.LoadWindow.BindObject")

## Item
wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot), player.INVENTORY)
wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot), player.INVENTORY)
wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot), player.INVEN##RY)
wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot), player.INVENTORY)
wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem), player.INVENTORY)
wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
## Equipment
wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot), player.EQUIPMENT)
wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot), player.EQUIPMENT)
wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseIte##lot), player.EQUIPMENT)
wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot), player.EQUIPMENT)
wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem), player.EQUIPMENT)
wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

## PickMoneyDialog
dlgPickMoney = uiPickMoney.PickMoneyDialog()
dlgPickMoney.LoadDialog()
dlgPickMoney.Hide()

## PickETCDialog
if app.ENABLE_CHEQUE_SYSTEM:
dlgPickETC = uiPickETC.PickETCDialog()
dlgPickETC.LoadDialog()
## dlgPickETC.Hide()
self.dlgPickETC = dlgPickETC

## RefineDialog
self.refineDialog = uiRefine.RefineDialog()## self.refineDialog.Hide()

## AttachMetinDialog
self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
self.attachMetinDialog.Hide()

## MoneySlot
if app.ENABLE_CHEQUE_S##TEM:
self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog), 0)
self.w##ChequeSlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog), 1)
else:
self.wndMoneySlot.SetEvent(ui.__mem_func_##self.OpenPickMoneyDialog))

for inven_index in range(player.INVENTORY_PAGE_COUNT): ## 0, 1, 2, 3
self.inventoryTab[inven_index].SetEvent(lambda arg = inven_index : self.SetInventoryPage(arg))
self.inventoryTab[0].Down()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.equipmentTab[0].SetEvent(lambda arg = 0: self.SetEquipmentPa##(arg))
self.equipmentTab[1].SetEvent(lambda arg = 1: self.SetEquipmentPage(arg))
self.equipmentTab[0].Down()
self.equipmentTab[0].Hide()
self.equipmentTab[1].Hide()

## MT-436 slot bug fix
wndItem.SetSlotType(player.SLOT_TYPE_INVENTORY)
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
wndEquip.SetSlotType(player.SLOT_TYPE_EQUIPMENT)

self.wndItem = wndItem
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
##self.wndEquip = wndEquip
self.dlgPickMoney = dlgPickMoney

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
# 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_EXTEND_INVEN_SYSTEM:
## Extend Inven Button
self.__CreateExtendInvenButton()

## Refresh
self.SetInventoryPage(0)
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.SetEquipmentPage(0)
self.RefreshItemSlot()
self.RefreshStatus()

def Destroy(##lf):
self.ClearDictionary()

self.dlgPickMoney.Destroy()
## self.dlgPickMoney = 0

if app.ENABLE_CHEQUE_SYSTEM:
self.dlgPickETC.Destroy()
self.dlgPickETC = 0

self.refineDialog.Destroy()
self.refineDialog = 0

self.attachMetinDialog.Destroy()
self.attachMetinDialog = 0

self.tooltipItem = None
self.wndItem = 0
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
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 app.ENABLE_CHEQUE_SYSTEM:
self.wndCheque = 0
self.wndChequeSlot = 0
self.dlgPickETC = 0

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
if self.wndCostume:
self.wndCostume.Destroy()
self.wndCostume = 0

if self.wndBelt:
self.wndBelt.Destroy()
self.wndBelt = None

self.inventoryTab = []
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.equipmentTab = []

if app.ENABLE_EXTEND_INVEN_SYSTEM:
self.ExInvenButton = []

if self.ExInvenQuestionDlg:
self.ExInvenQuestionDlg.Close()

if app.ENABLE_AURA_COSTUME_SYSTEM:
if self.clear_aura_item_question_dialog:
self.clear_aura_item_question_dialog.Close()
self.clear_aura_item_question_dialog = None

if app.ENABLE_GEM_CONVERTER:
if self.gem_converter_question_dialog:
self.gem_converter_question_dialog.Close()
self.gem_converter_question_dialog = None

if self.pop:
self.pop.Destroy()
self.pop = None

if app.ENABLE_GEM_SYSTEM:
self.wndExpandedMoneyBar = None

def Hide(self):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
self.OnCloseQuestionDialog()
return

if None != self.tooltipItem:
self.tooltipItem.HideToolTip()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
if self.wndCostume:
self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow() # 인벤토리 창이 닫힐 때 코스츔이 열려 있었는가?
self.wndCostume.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()

if app.ENABLE_CHEQUE_SYSTEM:
if self.dlgPickETC:
self.dlgPickETC.Close()

if app.ENABLE_GEM_SYSTEM:
if self.wndExpandedMoneyBar:#print self.wndExpandedMoneyBar.Close()

wndMgr.Hide(self.hWnd)

def Close(self):
self.Hide()

if app.ENABLE_GEM_SYSTEM:
def SetExpandedMoneyBar(self, wndBar):
self.wndExpandedMoneyBar = wndBar

if self.wndExpandedMoneyBar:
self.wndMoneySlot = self.wndExpandedMoneyBar.GetMoneySlot()
self.wndMoney = self.wndExpandedMoneyBar.GetMoney()

if app.ENABLE_CHEQUE_SYSTEM:
## 양 관련
self.wndMoneyIcon = self.wndExpandedMoneyBar.GetMoneyIcon()
if self.wndMoneyIcon:
self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
if ##lf.wndMoneySlot:
self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog), 0)

## 2차화폐 관련
self.wndChequeIcon = self.wndExpandedMoneyBar.GetChequeIcon()
if self.wndChequeIcon:
self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
s##f.wndChequeSlot = self.wndExpandedMoneyBar.GetChequeSlot()
if self.wndChequeSlot:
self.wndChequeSlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog), 1)
self.wndCheque = self.wndExpandedMoneyBar.GetCheque()

## 보석 관련
self.wndGemIcon = self.wndExpandedMoneyBar.GetGemIcon()
if self.wndGemIcon:
self.wndGemIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 2)
self.wndGemIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 2)
self.wndGem = self.wndExpand##MoneyBar.GetGem()

self.toolTip = uiToolTip.ToolTip()
self.toolTip.ClearToolTip()
else:
if self.wndMoneySlot:
self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))

def SetInventoryPage(self, page):
self.inventoryPageIndex = page

for index in range(len(self.inventoryTab)):
if index == page:
continue

self.inventoryTab[index].SetUp()

self.RefreshBagSlotWindow()

if app.ENABLE_EXTEND_INVEN_SYSTEM:
## Extend Inven Button
def __CreateExtendInvenButton(self):
parent = self.GetChild("board")

self.ExInvenButton = []
start_x = 8
start_y = 246
if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
start_y = 55
img_height = 32

for button_index in range(player.EX_INVENTORY_STAGE_MAX): ## 18
## ex_inven_button = ui.Button()

increase_y = img_height * (button_index % (player.EX_INVENTORY_STAGE_MAX / player.EX_INVENTORY_PAGE_COUNT))

ex_inven_button.SetParent(parent)
ex_inven_button.SetPosition(start_x, start_y + increase_y)
ex_inven_button.SetUpVisual(EX_INVEN_COVER_IMG_CLOSE)
ex_in##n_button.SetOverVisual(EX_INVEN_COVER_IMG_CLOSE)
ex_inven_button.SetDownVisual(EX_INVEN_COVER_IMG_CLOSE)
ex_inven_button.SetDisableVisual(EX_INVEN_COVER_IMG_CLOSE)
ex_inven_button.SetEvent(ui.__mem_func__(self.__ClickExtendInvenButton), button_index + 1)
ex_inven_button.Hide()
self.ExInvenButton.append(ex_inven_button)

def __ClickExtendInvenButton(self, index):
net.SendExtendInvenButtonClick(index)

def __HideAllExtendInvenButton(self):
for index in range(len(self.ExInvenButton)):
self.ExInvenButton[index].Hide()

def __ShowExtendInvenButton(self, cur_stage):
## self.inventoryPageIndex 는 0,1,2,3 라서 EX_INVENTORY_PAGE_START -1 을 사용한다.
if self.inventoryPageIndex < player.EX_INVENTORY_PAGE_START - 1:
return

## 한 페이지 당 보여줄 단계수
count = player.EX_INVENTORY_STAGE_MAX / player.EX_INVENTORY_PAGE_COUNT

## 최소, 최대
min_range = (self.inventoryPageIndex - player.EX_INVENTORY_PAGE_START## 1) * count
max_range = min_range + count

for button_index in range(min_range, max_range):
if button_index == cur_stage:
self.ExInvenButton[b##ton_index].SetUpVisual(EX_INVEN_COVER_IMG_OPEN)
self.ExInvenButton[button_index].SetOverVisual(EX_INVEN_COVER_IMG_O##N)
self.ExInvenButton[button_index].SetDownVisual(EX_INVEN_COVER_IMG_OPEN)
self.ExInvenButton[button_index].SetDisableVisual(EX_INVEN_COVER_IMG_OPEN)

if button_index < cur_stage:
self.ExInvenButton[button_index].Hide()
else:
self.ExInvenButton[button_index].Show()

def ExInvenItemUseMsg(self, item_vnum, msg, enough_count):
## 개수 부족
if player.EX_INVEN_FAIL_FALL_SHORT == msg:
self.__OpenExInvenFallShortCountMsgDlg(enough_count)

## 개수가 충분함
elif player.EX_INVEN_SUCCESS == msg:
self.__OpenExInvenQuestionDlg(enough_count)

## 4번페이지 마지막임
elif player.EX_INVEN_FAIL_FOURTH_PAGE_STAGE_MAX == msg:
self.__OpenExInvenMsgDlg(localeInfo.EXINVEN_USE_ITEM_FAIL_FOURT##PAGE_STAGE_MAX)
return

else:
return

def __OpenExInvenMsgDlg(self, msg):
popup = uiComm##.PopupDialog()
popup.SetText(msg)
popup.SetAcceptEvent(self.__OnClosePopupDialog)
w, h = popup.GetTextSize(## popup.SetWidth(w + 40)
line_count = popup.GetTextLineCount()

if line_count > 1:
height = popup.GetLineHeight()
popup.SetLineHeight(height + 3)

popup.Open()

if self.pop:
self.pop.Destroy()

self.pop = popup

def __OpenExInvenFallShortCountMsgDlg(self, enough_count):
popup = uiCommon.PopupDialog()
popup.SetText(localeInfo.EXINVEN_USE_ITEM_FAIL_FALL_SHORT % (enough_count))
popup.SetAcceptEvent(self.__OnClosePopupDialog)
popup.Open()

if self.pop:
self.pop.Destroy()

self.pop = popup

def __OpenExInvenQuestionDlg(self, enough_count):
if self.ExInvenQuestionDlg:
self.ExInvenQuestionDlg.SetText(localeInfo.EXINVEN_USE_ITEM_QUESTION % enough_count)
self.ExInvenQuestionDlg.SetAcceptEvent(ui.__mem_func__(self.__AcceptExInvenItemUse))
self.ExInvenQuestionDlg.SetCancelEvent(ui.__mem_func__(self.__CancelExInvenItemUse))
w, h = self.ExInvenQuestionDlg.GetTextSize()
self.ExInvenQuestionDlg.SetWidth(w + 40)
self.ExInvenQuestionDlg.Open()

def __AcceptExInvenItemUse(self):
net.SendExtendInvenUpgrade()
self.ExInvenQuestionDlg.Close()

def __CancelExInvenItemUse(self):
self.ExInvenQuestionDlg.Close()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
def SetEquipmentPage(self, page):
self.equipmentPageIndex = page
self.equipmentTab[1 - page].SetUp()
self.RefreshEquipSlotWindow()

def ClickMallButton(self):
net.SendCommandPacket("/click_mall")

# DSSButton
def ClickDSSButton(self):
self.interface.ToggleDragonSoulWindow()

def ClickCostumeButton(self):
if self.wndCostume:
if self.wndCostume.IsShow():
self.wndCostume.Hide()
else:
self.wndCostume.Show()
else:
self.wndCostume = CostumeWindow(self)
self.wndCostume.Show()

def ShowCostumeInventory(self):
if self.wndCostume:
if not self.wndCostume.IsShow():
self.wndCostume.Show()
else:
self.wndCostume = CostumeWindow(self)
self.wndCostume.Show()

def OpenPickMoneyDialog(self, focus_idx = 0):
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()
curCheque = player.GetCheque()

if curMoney <= 0 and curCheque <= 0:
return

self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
self.dlgPickMoney.Open(curMoney, curCheque)
self.dlgPickMoney.SetMax(7) # 인벤토리 990000 제한 버그 수정
if app.ENABLE_CHEQUE_SYSTEM:
self.dlgPickMoney.SetFocus(focus_idx)

if app.ENABLE_CHEQUE_SYSTEM:
def OnPickMoney(self, money, cheque):
mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money, cheque)
else:
def OnPickMoney(self, money):
mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)

def OnPickItem(self, count):
if app.ENABLE_CHEQUE_SYSTEM:
itemSlotWindow = self.dlgPickETC.itemGlobalSlotWindow
itemSlotIndex = self.dlgPickETC.itemGlobalSlotIndex
else:
itemSlotWindow = self.dlgPickMoney.itemGlobalSlotWindow
itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex

selectedItemVNum = player.GetItemIndex(itemSlotWindow, itemSlotIndex)
slotType = player.WindowTypeToSlotType(itemSlotWindow)
mouseModule.mouseController.AttachObject(self, slotType, itemSlotIndex, selectedItemVNum, count)

def __InventoryLocalSlotPosToGlobalSlotPos(self, local, window_type = player.INVENTORY):
if player.INVENTORY == window_type:
return self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE + local
else:
return local

def RefreshBagSlotWindow(self):
if not self.wndItem:
return

getItemVNum = player.GetItemIndex
getItemCount = player.GetItemCount
setItemVNum = self.wndItem.SetItemSlot

## 리프레쉬 하기전에 하이라이트 모두 끈다.
for i in xrange(self.wndItem.GetSlotCount()):
self.wndItem.DeactivateSlot(i)

if app.WJ_ENABLE_TRADABLE_ICON or app.ENABLE_MOVE_COSTUME_ATTR or app.ENABLE_MAILBOX:
if self.interface:
onTopWindow = self.interface.GetOnTopWindow()

for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)

itemCount = getItemCount(slotNumber)
## # itemCount == 0이면 소켓을 비운다.
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.WJ_ENABLE_TRADABLE_ICON or app.ENABLE_MOVE_COSTUME_ATTR or app.ENABLE_MAILBOX:
if itemVnum and self.interface and onTopWindow:
if self.interface.MarkUnusableInvenSlotOnTopWnd(onTopWindow, slotNumber):
self.wndItem.SetUnusableSlotOnTopWnd(i)
else:
self.wndItem.SetUsableSlotOnTopWnd(i)
else:
self.wndItem.SetUsableSlotOnTopWnd(i)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if not player.GetChangeLookVnum(player.INVENTORY, slotNumber) == 0:
self.wndItem.SetSlotCoverImage(i, "icon/item/ingame_convert_Mark.tga")
else:
self.wndItem.EnableSlotCoverImage(i, False)

if app.ENABLE_GEM_CONVERTER:
if slotNumber in self.gem_converter_item_pos:
self.wndItem.SetCantMouseEventSlot(i)

if app.ENABLE_SOUL_SYSTEM:
if item.IsSoulItem(itemVnum):
metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
tempSlotNum = slotNumber
if tempSlotNum >= player.INVENTORY_PAGE_SIZE:
tempSlotNum -= (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE)

if 0 != metinSocket[1]:
self.wndItem.ActivateSlot(tempSlotNum)
else:
self.wndItem.DeactivateSlot(tempSlotNum)

## [MT-662] 일반펫 소환표시 마크
if (item.ITEM_TYPE_QUEST == item.GetItemType() and item.QUEST_PET_PAY == item.GetItemSubType()) or\
(item.ITEM_TYPE_PET == item.GetItemType() and item.PET_PAY == item.GetItemSubType()):
metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
tempSlotNum = slotNumber
if tempSlotNum >= player.INVENTORY_PAGE_SIZE:
tempSlotNum -= (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZ##
if 0 != metinSocket[1]:
self.wndItem.ActivateSlot(tempSlotNum)
else:
self.wndItem.DeactivateSlot(tempSlotNum)

self.__HighlightSlot_Refresh()

if app.ENABLE_EXTEND_INVEN_SYSTEM:
self.__RefreshExinvenCoverSlot()
self.__RefreshExinvenSlotState()

self.wndItem.RefreshSlot()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
if self.wndBelt:
self.wndBelt.RefreshSlot()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
def RefreshEquipSlotWindow(self):
getItemVNum = ReprGetItemIndex(player.EQUIPMENT)
getItemCount = ReprGetItemCount(player.EQUIPMENT)
setItemVNum = self.wndEquip.SetItemSlot

for i in xrange(player.WEAR_MAX): ## 32 ( 0 ~ 31 )
itemCount = getItemCount(i)
if itemCount <= 1:
itemCount = 0
setItemVNum(i, getItemVNum(i), itemCount)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if not player.GetChangeLookVnum(player.EQUIPMENT, i) == 0:
self.wndEquip.SetSlotCoverImage(i, "icon/item/ingame_convert_Mark.tga")
else:
self.wndEquip.EnableSlotCoverImage(i,False)

self.wndEquip.RefreshSlot()

if##elf.wndCostume:
self.wndCostume.RefreshCostumeSlot()

def RefreshItemSlot(self):
self.RefreshBagSlotWindow()
if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
self.RefreshEquipSlotWindow()

if app.ENABLE_EXTEND_INVEN_SYSTEM:
def __RefreshExinvenCoverSlot(self):
cur_stage = player.GetExtendInvenStage()

self.__HideAllExtendInvenButton()
self.__ShowExtendInvenButton(cur_stage)

def __RefreshExinvenSlotState(self):
inventory_max = player.GetExtendInvenMax()

for i in xrange(player.INVENTORY_PAGE_SIZE):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)

if slotNumber >= inventory_max:
self.wndItem.LockSlot(i)
else:
self.wndItem.UnlockSlot(i)

def RefreshStatus(self):
money = player.GetElk()
self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))

if app.ENABLE_CHEQUE_SYSTEM:
cheque = player.GetCheque()
self.wndCheque.SetText(str(cheque))

if app.ENABLE_GEM_SYSTEM:
if self.wndGem:
gem = player.GetGem()
self.wndGem.SetText(localeInfo.NumberToMoneyString(gem))

def SetItemToolTip(self, tooltipItemvalue):
from _weakref import proxy
self.tooltipItem = proxy(tooltipItemvalue)

def SellItem(self):
if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotWindow, self.sellingSlotNumber):
if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotWindow, self.sellingSlotNumber):
## 용혼석도 팔리게 하는 기능 추가하면서 인자 type 추가
net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, self.sellingSlotWindow)
snd.PlaySound("sound/ui/money.wav")
self.OnCloseQuestionDialog()

def OnDetachMetinFromItem(self):
if None == self.questionDialog:
return

self.__SendUseItemToItemPacket(self.questionDialog.sourceWindow, self.questionDialog.sourcePos, self.questionDialog.targetWindow, self.questionDialog.targetPos)
self.OnCloseQuestionDialog()

def OnCloseQue##ionDialog(self):
if not self.questionDialog:
return

self.questionDialog.Close()
self.questionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)

## Slot Event
def SelectEmptySlot(self, selectedSlotPos, selectedSlotWindow):
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
return

## 악세서리 창이 열려있으면
## 아이템 이동 금지.
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if player.GetAcceRefineWindowOpen():
return

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if player.GetChangeLookWindowOpen():
return

if app.ENABLE_AURA_COSTUME_SYSTEM:
if player.IsAuraWindowOpen():
return

if app.ENABLE_ATTR_6TH_7TH:
if sel##interface.wndAttr67Add.IsShow():
return

selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos, selectedSlotWindow)

## if mouseModule.mouseController.isAttached()## attachedSlotType = mouseModule.mouseController.GetAttachedType()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()

if player.SLOT_TYPE_INVENTORY == attachedSlotType:
if attachedSlotPos >= player.ITEM_SLOT_COUNT:
mouseModule.mouseController.DeattachObject()
return

self.__SendMoveItemPacket(player.INVENTORY, attachedSlotPos, selectedSlotWindow, selectedSlotPos, attachedItemCount)

if item.IsRefineScroll(attachedItemIndex):
self.interface.SetUseItemMode(False)

elif player.SLOT_TYPE_EQUIPMENT == attachedSlotType:
if attachedSlotPos >= player.WEAR_MAX:
mouseModule.mouseController.DeattachObject()
return

self.__SendMoveItemPacket(player.EQUIPMENT, attachedSlotPos, selectedSlotWindow, selectedSlotPos, attachedItemCount)

elif player.SLOT_TYPE_BELT_INVENTORY == attachedSlotType:
if attachedSlotPos >= item.BELT_INVENTORY_SLOT_COUNT:
mouseModule.mouseController.DeattachObject()
return

self.__SendMoveItemPacket(player.BELT_INVENTORY, attachedSlotPos, selectedSlotWindow, selectedSlotPos, attachedItemCount)

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:
if player.ITEM_MONEY == attachedItemIndex:
net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
snd.PlaySound("sound/ui/money.wav")
else:
net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotWindow, selectedSlotPos)

elif player.SLOT_TYPE_MALL == attachedSlotType:
net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotWindow, selectedSlotPos)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
if player.SLOT_TYPE_ACCE == attachedSlotType:
#net.SendAcceRefineCheckOut(attachedSlotPos)
pass

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if player.SLOT_TYPE_CHANGE_LOOK == attachedSlotType:
#net.SendChangeLookCheckOut(attachedSlotPos)
pass

if app.ENABLE_AURA_COSTUME_SYSTEM:
if player.SLOT_TYPE_AURA == attachedSlotType:
#net.SendAuraRefineCheckOut(attachedSlotPos)
pass

mouseModule.mouseController.DeattachObject()

def SelectItemSlot(self, itemSlotIndex, window_type):
if constInfo.GET_ITEM_QUESTION_DIALOG_S#net.SendAcceRefineCheckOut(attachedSlotPostemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex, window_type)

if mouseModule.mouseController.isAttached():
attachedSl#net.SendChangeLookCheckOut(attachedSlotPosachedType()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVID = mouseModule.mouseController.GetAt#net.SendAuraRefineCheckOut(attachedSlotPosOT_TYPE_INVENTORY == attachedSlotType or\
player.SLOT_TYPE_BELT_INVENTORY == attachedSlotType:
if attachedSlotPos >= player.ITEM_SLOT_COUNT:
mouseModule.mouseController.DeattachObject()
return

attachedWindow = player.SlotTypeToInvenType(attachedSlotType)
self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedWindow, attachedSlotPos, window_type, itemSlotIndex)

mouseModule.mouseController.DeattachObject()
else:
curCursorNum = app.GetCursor()
if app.SELL == curCursorNum:
self.__SellItem(window_type, itemSlotIndex)

elif app.BUY == curCursorNum:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)

elif app.IsPressed(app.DIK_LALT):
link = player.GetItemLink(window_type, itemSlotIndex)
ime.PasteString(link)

elif app.IsPressed(app.DIK_LSHIFT):
itemCount = player.GetItemCount(window_type, itemSlotIndex)

if itemCount > 1:
if app.ENABLE_CHEQUE_SYSTEM:
self.dlgPickETC.SetTitleName(localeInfo.PICK_ITEM_TITLE)
self.dlgPickETC.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
self.dlgPickETC.Open(itemCount)
self.dlgPickETC.itemGlobalSlotIndex = itemSlotIndex
self.dlgPickETC.itemGlobalSlotWindow = window_type
else:
self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE)
self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
self.dlgPickMoney.Open(itemCount)
self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
self.dlgPickMoney.itemGlobalSlotWindow = window_type

elif app.IsPressed(app.DIK_LCONTROL):
itemIndex = player.GetItemIndex(window_type, itemSlotIndex)

if True == item.CanAddToQuickSlotItem(itemIndex):
if window_type == player.INVENTORY:
player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
elif window_type == player.BELT_INVENTORY:
player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_BELT_INVENTORY, itemSlotIndex)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)

else:
selectedItemVNum = player.GetItemIndex(window_type, itemSlotIndex)
itemCount = player.GetItemCount(window_type, itemSlotIndex)
attachSlotType = player.WindowTypeToSlotType(window_type)

mouseModule.mouseController.AttachObject(self, attachSlotType, itemSlotIndex, selectedItemVNum, itemCount)

if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):
self.interface.SetUseItemMode(True)
else:
self.interface.SetUseItemMode(False)

snd.PlaySound("sound/ui/pick.wav")

def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos):
if srcItemSlotWindow == dstItemSlotWindow:
if srcItemSlotPos == dstItemSlotPos:
return

## 악세서리 창이 열려있으면
## 아이템 이동 금지.
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if player.GetAcceRefineWindowOpen():
return

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if player.GetChangeLookWindowOpen():
return

if app.ENABLE_AURA_COSTUME_SYSTEM:
if player.IsAuraWindowOpen():
return

if app.ENABLE_ATTR_6TH_7TH:
if self.interface.wndAttr67Add.IsShow():
return

## [MT-462]
if player.GetItemIndex(srcItemSlotWindow, srcItemSlotPos) == player.GetItemIndex(dstItemSlotWindow, dstItemSlotPos) \
## and (player.GetItemFlags(srcItemSlotW##dow, srcItemSlotPos) & item.ITEM_FLAG_STACKABLE) \
and player.IsEquipmentSlot(dstItemSlotWindow, dstItemSlotPos) == False:
self.__SendMoveItemPacket(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos, 0)
return

if app.ENABLE_SOULBIND_SYSTEM:
# cyh itemseal 2013 11 08
if item.IsSealScroll(srcItemVID):
if player.CanSealItem(srcItemVID, dstItemSlotWindow, dstItemSlotPos):
## self.__OpenQuestionDialog(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)

useType = item.GetUseType(srcItemVID)

if item.IsRefineScroll(srcItemVID):
self.RefineItem(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)
self.interface.SetUseItemMode(False)

elif item.IsMetin(srcItemVID):
self.AttachMetinToItem(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)

elif item.IsDetachScroll(srcItemVID):
self.DetachMetinFromItem(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)

elif item.IsKey(srcItemVID):
self.__SendUseItemToItemPacket(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)

elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
self.__SendUseItemToItemPacket(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)

elif useType in self.USE_TYPE_TUPLE:
if app.ENABLE_REFINE_ELEMENT_SYSTEM:
if "USE_ELEMENT_UPGRADE" == useType:
if not uiRefine.RefineElementDialog.CanRefineElementUpgrade(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos, True, False):
return

elif "USE_ELEMENT_DOWNGRADE" == useType:
if not uiRefine.RefineElementDialog.CanRefineElementDowngrade(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos, True, False):
return

elif "USE_ELEMENT_CHANGE" == useType:
if not uiRefine.RefineElementChangeDialog.CanRefineElementChange(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos, True, False):
return

self.__SendUseItemToItemPacket(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)

else:
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if item.IsAcceScroll(srcItemVID):
if player.CanAcceClearItem(srcItemVID, dstItemSlotWindow, dstItemSlotPos):
self.__OpenQuestionDialog(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)
return

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if item.IsChangeLookClearScroll(srcItemVID):
if dstItemSlotWindow != player.INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHANGE_LOOK_DO_NOT_EQUIP_ITEM)
return

if player.CanChangeLookClearItem(srcItemVID, dstItemSlotWindow, dstItemSlotPos):
self.__OpenQuestionDialog(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)
return

if app.ENABLE_AURA_COSTUME_SYSTEM:
if srcItemVID == item.ITEM_VNUM_AURA_CLEAR:
if player.CanAuraClearItem(srcItemVID, dstItemSlotWindow, dstItemSlotPos):
self.__UseAuraClearItem(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)
return

if app.ENABLE_SET_ITEM:
if item.IsSetClearScroll(srcItemVID):
if player.CanSetItemClear(srcItemVID, dstItemSlotWindow, dstItemSlotPos):
self.__OpenSetClearItemQuestionDialog(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)
return

if app.ENABLE_GEM_CONVERTER:
if srcItemVID == item.ITEM_VNUM_GEM_CONVERTER:
if self.__CanUseGemConverter(srcItemVID, srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos):
self.__UseGemConverter(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos)
return

## 이동시킨 곳이 장착 슬롯일 경우 아이템을 사용해서 장착 시킨다 - [levites]
if player.IsEquipmentSlot(dstItemSlotWindow, dstItemSlotPos):
## 들고 있는 아이템이 장비일때만
if item.IsEquipmentVID(srcItemVID):
self.__UseItem(srcItemSlotPos, srcItemSlotWindow)
else:
self.__SendMoveItemPacket(srcItemSlotWindow, srcItemSlotPos, dstItemSlotWindow, dstItemSlotPos, 0)

def __OpenQuestionDialog(self, srcItemWindow, srcItemPos, dstItemWindow, dstItemPos):
if self.interface.IsShowDlgQuestionWindow():
self.interface.CloseDlgQuestionWindow()

getItemVNum = player.GetItemIndex
self.srcItemPo##= srcItemPos
self.dstItemPos = dstItemPos

self.srcItemWindow = srcItemWindow
self.dstItemWindow = dstItemWindow

self.dlgQuestion.SetAcceptEvent(ui.__mem_fun##_(self.__Accept))
self.dlgQuestion.SetCancelEvent(ui.__mem_func__(self.__Cancel))

self.dlgQuestion.SetText1("%s" % item.GetItemName(getItemVNum(srcItemPos)) )
self.dlgQuestion.SetText2(localeInfo.INVENTORY_REALLY_USE_ITEM)

self.dlgQuestion.Open()

constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

def __Accept(self):
self.dlgQuestion.Close()
self.__SendUseItemToItemPacket(self.srcItemWindow, self.srcItemPos, self.dstItemWindow, self.dstItemPos)
self.srcItemPos = (0, 0)
self.dstItemPos = (0, 0)

self.srcItemWindow = None
self.dstItemWindow = None

constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)

def __Cancel(self):
self.srcItemPos = (0, 0)
self.dstItemPos = (0, 0)
self.dlgQuestion.Close()

self.srcItemWindow = None
self.dstItemWindow = None

constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)

if app.ENABLE_SET_ITEM:
def __OpenSetClearItemQuestionDialog(self, srcItemWindow, srcItemPos, dstItemWindow, dstItemPos):
if self.interface.IsShowDlgQuestionWindow():
self.interface.CloseDlgQuestionWindow()

getItemVNum = player.GetItemIndex
self.srcItemPos = srcItemPos
self.dstItemPos = dstItemPos

self.srcItemWindow = srcItemWindow
self.dstItemWindow = dstItemWindow

self.dlgQuestion.SetAcceptEvent(ui.__mem_func__(self.__SetClearItemAccept))
self.dlgQuestion.SetCancelEvent(ui.__mem_func__(self.__SetClearItemCancel))

self.dlgQuestion.SetText1(localeInfo.SET_ITEM_CLEAR_CONFIRM_QUESTION)
self.dlgQuestion.SetText2(localeInfo.SET_ITEM_CLEAR_CONFIRM_QUESTION_2)
self.dlgQuestion.Open()

constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

def __SetClearItemAccept(self):
self.__Accept()

def __SetClearItemCancel(self):
self.__Cancel()

def __SellItem(self, window_type, itemSlotPos):
if not player.IsEquipmentSlot(window_type, itemSlotPos):
itemIndex = player.GetItemIndex(window_type, itemSlotPos)
itemCount = player.GetItemCount(window_type, itemSlotPos)

self.sellingSlotWindow = window_type
self.sellingSlotNumber = itemSlotPos
self.sellingSlotitemIndex = itemIndex
self.sellingSlotitemCount = itemCount

item.SelectItem(itemIndex)
## 안티 플레그 검사 빠져서 추가
## 20140220
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()
if app.ENABLE_SET_ITEM:
itemName = item.GetItemNameBySetValue(player.GetI##mSetValue(window_type, itemSlotPos))

self##uestionDialog = 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, scrollSlotWindow, scrollSlotPos, targetSlotWindow, targetSlotPos):
scrollIndex = player.GetItemIndex(scrollSlotWindow, scrollSlotPos)
targetIndex = player.GetItemIndex(targetSlotWindow, targetSlotPos)

if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotWindow, targetSlotPos):
return

###########################################################
self.__SendUseItemToItemPacket(scrollSlotWindow, scrollSlotPos, targetSlotWindow, targetSlotPos)
#net.SendItemUseToItemPacket(scrollSlotPos, targetSlotPos)
return
###########################################################

###########################################################
#net.SendRequestRefineInfoPacket(targetSlotPos)
#return
###########################################################

result = player.CanRefine(scrollIndex, targetSlotPos)

if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result:
#snd.PlaySound("sound/ui/jaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILUR###O_MORE_SOCKET)

elif player.REFINE_NEED_MORE_GOOD_SCROLL == result:
#snd.PlaySound("sound/ui/jaeryun_fail.wav")
chat.AppendChat(chat.CHAT_#net.SendItemUseToItemPacket(scrollSlotPosBETTER_SCROLL)

elif player.REFI###CANT_MAKE_SOCKET_ITEM == result:
#snd.PlaySound("sound###/jaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_IN#net.SendRequestRefineInfoPacket(targetSlotPosTEM)

#returnf player.###INE_NOT_NEXT_GRADE_ITEM == result:
#snd.PlaySound("sound/ui/jaeryun_fail.wav")
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM)

#snd.PlaySound(REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)

if player.REFINE_OK != result:
retur#snd.PlaySound(.refineDialog.Open(scrollSlotPos, targetSlotPos)

def DetachMetinFromItem(self, scrollSlotWindow, scrollSlotPos, targetSlotWindow, targetSlotPos):
scrollIndex = player.GetItemIndex(scro#snd.PlaySound(crollSlotPos)
targetIndex = player.GetItemIndex(targetSlotWindow, targetSlotPos)

if not player.CanDetach(scrollIndex, targetSlotWindow, targetSlotPos):
if app.ENABLE_A#snd.PlaySound(TEM and item.IsAcceScroll(scrollIndex):
return

chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
return

self.questionDialog = uiCommon.QuestionDialog()
if (app.ENABLE_ACCE_COSTUME_SYSTEM or app.ENABLE_AURA_COSTUME_SYSTEM) and item.IsAcceScroll(scrollIndex):
self.questionDialog.SetText(localeInfo.AURA_CLEAR_QUESTION_WHEN_USE)
elif app.ENABLE_CHANGE_LOOK_SYSTEM and item.IsChangeLookClearScroll(scrollIndex):
self.questionDialog.SetText(localeInfo.CHANGE_LOOK_CHANGE_ITEM)
else:
self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
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

self.questionDialog.sourceWindow = scrollSlotWindow
self.questionDialog.targetWindow = targetSlotWindow

def AttachMetinToItem(self, metinSlotWindow, metinSlotPos, targetSlotWindow, targetSlotPos):
metinIndex = player.GetItemIndex(metinSlotWindow, metinSlotPos)
targetIndex = player.GetItemIndex(targetSlotWindow, targetSlotPos)

item.SelectItem(metinIndex)
itemName = item.GetItemName()
if app.ENABLE_SET_ITEM:
itemName = item.GetItemNameBySetValue(player.GetItemSetValue(metinSlotWindow, metinSlotPos))

result = player.CanAttachMetin(metinIndex, targetSlotWindow, 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(metinSlotWindow, metinSlotPos, targetSlotWindow, targetSlotPos)

def OverOutItem(self):
self.wndItem.SetUsableItem(False)
if None != self.tooltipItem:
self.tooltipItem.HideToolTip()

def OverInItem(self, overSlotPos, window_type):
overInvenSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos, window_type)
self.wndItem.SetUsableItem(False)

getItemVNum = ReprGetItemIndex(window_type)
itemVnum = getItemVNum(overInvenSlotPos)

if app.WJ_ENABLE_PICKUP_ITEM_EFFECT:
if window_type == player.INVENTORY:
self.DelHighlightSlot(overInvenSlotPos)

if mouseModule.mouseController.isAttached():
attachedItemType = mouseModule.mouseController.GetAttachedType()

if player.SLOT_TYPE_INVENTORY == attachedItemType:
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()

if self.__CanUseSrcItemToDstItem(attachedItemVNum, player.INVENTORY, attachedSlotPos, window_type, overInvenSlotPos):
self.wndItem.SetUsableItem(True)
self.ShowToolTip(overInvenSlotPos, window_type)
return

self.ShowToolTip(overInvenSlotPos, window_type)

def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos):
"다른 아이템에 사용할 수 있는 아이템인가?"

if item.IsRefineScroll(srcItemVNum):
return True
elif app.ENABLE_SOULBIND_SYSTEM and item.IsSealScroll(srcItemVNum):
return True
elif item.IsMetin(srcItemVNum):
return True
elif item.IsDetachScroll(srcItemVNum):
return True
elif item.IsKey(srcItemVNum):
return True
elif item.IsItemUsedForDragonSoul(srcItemVNum):
return True
elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
return True
else:
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if item.IsAcceScroll(srcItemVNum):
return True

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if item.IsChangeLookClearScroll(srcItemVNum):
return True

if app.ENABLE_AURA_COSTUME_SYSTEM:
if item.ITEM_VNUM_AURA_CLEAR == srcItemVNum:
return True

if app.ENABLE_SET_ITEM:
if item.IsSetClearScroll(srcItemVNum):
return True

if app.ENABLE_GEM_CONVERTER:
if srcItemVNum == item.ITEM_VNUM_GEM_CONVERTER:
return True

if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE:
return True

return False

def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
## 대상 아이템에 사용할 수 있는가?
if srcSlotWindow == dstSlotWindow:
if srcSlotPos == dstSlotPos:
return False

## [MT-462]: Stackable UseMode 이고..
#if srcItemVNum == player.GetItemIndex(dstSlotWindow, dstSlotPos) and \
# (player.GetItemFlags(dstSlotWindow, dstSlotPos) & item.ITEM_FLAG_STACKABLE):
# return True

if item.IsRefineScroll(srcItemVNum):
if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

elif app.ENABLE_SOULBIND_SYSTEM and item.IsSealScroll(srcItemVNum):
if player.CanSealItem(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

elif item.IsMetin(srcItemVNum):
if player.ATTACH_METIN_OK == player.C##AttachMetin(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

elif item.IsDetachScroll(srcItemVNum):
if player.DETACH_METIN_OK =##player.CanDetach(srcItemVNum, dstSlotWindow, d#iflotPos):
return True

elif item.IsKey(srcItemVNum):
if player.CanUnlock(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

elif (player.GetItemFlags(srcSlotWindow, srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
return True

else:
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if item.IsAcceScroll(srcItemVNum):
if player.CanAcceClearItem(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if item.IsChangeLookClearScroll(srcItemVNum):
if player.CanChangeLookClearItem(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

if app.ENABLE_AURA_COSTUME_SYSTEM:
if item.ITEM_VNUM_AURA_CLEAR == srcItemVNum:
if player.CanAuraClearItem(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

if app.ENABLE_SET_ITEM:
if item.IsSetClearScroll(srcItemVNum):
if player.CanSetItemClear(srcItemVNum, dstSlotWindow, dstSlotPos):
return True

if app.ENABLE_GEM_CONVERTER:
if srcItemVNum == item.ITEM_VNUM_GEM_CONVERTER:
if self.__CanUseGemConverter(srcItemVNum, dstSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
return True

useType = item.GetUseType(srcItemVNum)

if app.ENABLE_ATTR_6TH_7TH:
if "USE_CHANGE_ATTRIBUTE2" == useType:
if self.__CanChangeItemAttr67List(player.INVENTORY, dstSlotPos):
return True

if "USE_CLEAN_SOCKET" == useType:
if self.__CanCleanBrokenMetinStone(dstSlotWindow, dstSlotPos):
return True

elif "USE_CHANGE_ATTRIBUTE" == useType:
if self.__CanChangeItemAttrList(dstSlotWindow, dstSlotPos):
return True

elif "USE_ADD_ATTRIBUTE" == useType:
if self.__CanAddItemAttr(dstSlotWindow, dstSlotPos):
return True

elif "USE_ADD_ATTRIBUTE2" == useType:
if self.__CanAddItemAttr2(dstSlotWindow, dstSlotPos):
return True

elif "USE_ADD_ACCESSORY_SOCKET" == useType:
if self.__CanAddAccessorySocket(dstSlotWindow, dstSlotPos):
return True

elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
if self.__CanPutAccessorySocket(dstSlotWindow, dstSlotPos, srcItemVNum):
return True

elif "USE_PUT_INTO_BELT_SOCKET" == useType:
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
item.SelectItem(dstItemVNum)
if item.ITEM_TYPE_BELT == item.GetItemType():
return True

elif app.ENABLE_MOVE_COSTUME_ATTR and "USE_CHANGE_COSTUME_ATTR" == useType:
if self.__CanChangeCostumeAttrList(dstSlotWindow, dstSlotPos):
return True

elif app.ENABLE_MOVE_COSTUME_ATTR and "USE_RESET_COSTUME_ATTR" == useType:
if self.__CanResetCostumeAttr(dstSlotWindow, dstSlotPos):
return True

else:
if app.ENABLE_CHANGED_ATTR and "USE_SELECT_ATTRIBUTE" == useType:
if self.__CanChangeItemAttrList(dstSlotWindow, dstSlotPos):
return True

if app.ENABLE_REFINE_ELEMENT_SYSTEM:
if "USE_ELEMENT_UPGRADE" == useType:
if uiRefine.RefineElementDialog.CanRefineElementUpgrade(srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos, False, False):
return True

if "USE_ELEMENT_DOWNGRADE" == useType:
if uiRefine.RefineElementDialog.CanRefineElementDowngrade(srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos, False, False):
return True

if "USE_ELEMENT_CHANGE" == useType:
if uiRefine.RefineElementChangeDialog.CanRefineElementChange(srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos, False, False):
return True

return False

def __CanCleanBrokenMetinStone(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if item.ITEM_TYPE_WEAPON != item.GetItemType() and item.ITEM_TYPE_ARMOR != item.GetItemType():
return False

for i in xrange(player.METIN_SOCKET_MAX_NUM):
if player.GetItemMetinSocket(dstSlotWindow, dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
return True

return False

def __CanChangeItemAttrList(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False

# 재경비서
if app.ENABLE_NEW_USER_CARE:
if item.IsAntiFlag(item.ITEM_ANTIFLAG_ENCHANT):
return False

if app.ENABLE_SOULBIND_SYSTEM:
if player.GetItemSealDate(dstSlotWindow, dstSlotPos) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
return False

for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type, value = player.GetItemAttribute(dstSlotWindow, dstSlotPos, i)
if type != 0:
return True

return False

def __CanPutAccessorySocket(self, dstSlotWindow, dstSlotPos, mtrlVnum):
dstItemVNum = player.GetItemIndex(dstSlotWindow, 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(dstSlotWindow, dstSlotPos, 0)
maxCount = player.GetItemMetinSocket(dstSlotWindow, dstSlotPos, 1)

if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
return False

if curCount >= maxCount:
return False

return True

def __CanAddAccessorySocket(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if not item.GetItemType() in (item.ITEM_TYPE_ARMOR, item.ITEM_TYPE_BELT):
return False

if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR) and not item.GetItemType() == item.ITEM_TYPE_BELT:
return False

curCount = player.GetItemMetinSocket(dstSlotWindow, dstSlotPos, 0)
maxCount = player.GetItemMetinSocket(dstSlotWindow, dstSlotPos, 1)

ACCESSORY_SOCKET_MAX_SIZE = 3
if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
return False

return True

if app.ENABLE_ATTR_6TH_7TH:
def __CanChangeItemAttr67List(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False

if app.ENABLE_QUIVER_SYSTEM:
if (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() in (item.WEAPON_ARROW, item.WEAPON_QUIVER)):
return False
else:
if (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() == item.WEAPON_ARROW):
return False

# 재경비서
if app.ENABLE_NEW_USER_CARE:
if item.IsAntiFlag(item.ITEM_ANTIFLAG_ENCHANT):
return False

if app.ENABLE_SOULBIND_SYSTEM:
if player.GetItemSealDate(dstSlotWindow, dstSlotPos) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
return False

attrCount = 0
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type, value = player.GetItemAttribute(dstSlotWindow, dstSlotPos, i)
if type != 0:
attrCount += 1

if attrCount > player.ATTRIBUTE_SLOT_MAX_NUM - 2 and attrCount <= player.ATTRIBUTE_SLOT_MAX_NUM:
return True

return False

def __CanAddItemAttr(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False

# 재가비서
if app.ENABLE_NEW_USER_CARE:
if item.IsAntiFlag(item.ITEM_ANTIFLAG_REINFORCE):
return False

if app.ENABLE_SOULBIND_SYSTEM:
if player.GetItemSealDate(dstSlotWindow, dstSlotPos) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
return False

attrCount = 0
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type, value = player.GetItemAttribute(dstSlotWindow, dstSlotPos, i)
if type != 0:
attrCount += 1

if attrCount < 4:
return True

return False

def __CanAddItemAttr2(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
return False

# 재가비서
if app.ENABLE_NEW_USER_CARE:
if item.IsAntiFlag(item.ITEM_ANTIFLAG_REINFORCE):
return False

if app.ENABLE_SOULBIND_SYSTEM:
if player.GetItemSealDate(dstSlotWindow, dstSlotPos) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
return False

attrCount = 0
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type, value = player.GetItemAttribute(dstSlotWindow, dstSlotPos, i)
if type != 0:
attrCount += 1

if attrCount == 4:
return True

return False

if app.ENABLE_MOVE_COSTUME_ATTR:
def __CanChangeCostumeAttrList(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if item.GetItemType() != item.ITEM_TYPE_COSTUME:
return False

if app.ENABLE_MOUNT_COSTUME_SYSTEM:
if item.GetItemSubType() == item.COSTUME_TYPE_MOUNT:
return False

if app.ENABLE_ACCE_COSTUME_SYSTEM:
if item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
return False

if app.ENABLE_AURA_COSTUME_SYSTEM:
if item.GetItemSubType() == item.COSTUME_TYPE_AURA:
return False

for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type, value = player.GetItemAttribute(dstSlotWindow, dstSlotPos, i)
if type != 0:
return True

return False

def __CanResetCostumeAttr(self, dstSlotWindow, dstSlotPos):
dstItemVNum = player.GetItemIndex(dstSlotWindow, dstSlotPos)
if dstItemVNum == 0:
return False

item.SelectItem(dstItemVNum)

if item.GetItemType() != item.ITEM_TYPE_COSTUME:
return False

if app.ENABLE_MOUNT_COSTUME_SYSTEM:
if item.GetItemSubType() == item.COSTUME_TYPE_MOUNT:
return False

if app.ENABLE_ACCE_COSTUME_SYSTEM:
if item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
return False

if app.ENABLE_AURA_COSTUME_SYSTEM:
if item.GetItemSubType() == item.COSTUME_TYPE_AURA:
return False

for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type, value = player.GetItemAttribute(dstSlotWindow, dstSlotPos, i)
if type != 0:
return True

return False

def ShowToolTip(self, slotIndex, window_type):
if None != self.tooltipItem:
self.tooltipItem.SetInventoryItem(slotIndex, window_type)

def OnTop(self):
if None != self.tooltipItem:
self.tooltipItem.SetTop()

if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
if self.wndBelt:
if self.IsClickBeltInventory == False:
self.wndBelt.SetTop()
else:
self.IsClickBeltInventory = False

if self.wndCostume:
self.wndCostume.SetTop()

def OnPressEscapeKey(self):
self.Close()
return True

def UseItemSlot(self, slotIndex, window):
curCursorNum = app.GetCursor()
if app.SELL == curCursorNum:
return

if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
return

slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex, window)

if app.ENABLE_DRAGON_SOUL_SYSTEM:
if self.wndDragonSoulRefine.IsShow():
self.wndDragonSoulRefine.AutoSetItem((window, slotIndex), 1)
return

self.__UseItem(slotIndex, window)
mouseModule.mouseController.DeattachObject()
self.OverOutItem()

def __UseItem(self, slotIndex, slotWindow):
ItemVNum = player.GetItemIndex(slotWindow, slotIndex)
item.SelectItem(ItemVNum)

## 악세서리 창이 열려있으면
## 악세서리 아이템, 무기, 갑옷 외엔 아무 사용 안됨.
if app.ENABLE_ACCE_COSTUME_SYSTEM:
if player.GetAcceRefineWindowOpen():
self.__UseItemAcce(slotIndex, slotWindow)
return

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if player.GetChangeLookWindowOpen():
return

if app.ENABLE_AURA_COSTUME_SYSTEM:
if player.IsAuraWindowOpen():
self.__UseItemAura(slotIndex, slotWindow)
return

if app.WJ_ENABLE_TRADABLE_ICON or app.ENABLE_MOVE_COSTUME_ATTR:
if self.interface.AttachInvenItemToOtherWindowSlot(slotIndex, slotWindow):
return

if app.ENABLE_FLOWER_EVENT:
if 25121 == ItemVNum or 25122 == ItemVNum or 25123 == ItemVNum or 25124 == ItemVNum or 25125 == ItemVNum:
value1 ##item.GetValue(0)
value2 = ite##GetValue(1)
value3 = item.GetApplyPoint(value2)

if item.CheckAffect(value1, value3):
pass
else:
if item.CheckAffect(value1, 0):
self.questionDialog = uiCommon.QuestionDialog2()
self.questionDialog.SetText1(localeInfo.FLOWER_EVENT_USE_ITEM_TEXT1)
self.questionDialog.SetText2(localeInfo.FLOWER_EVENT_USE_ITEM_TEXT2)
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
self.questionDialog.slotWindow = slotWindow
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
return

if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM2)
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)
else:
self.__SendUseItemPacket(slotIndex, slotWindow)

def SetCanMouseEventSlot(self, inven_slot_index):
if inven_slot_index >= player.INVENTORY_PAGE_SIZE:
page = self.GetInventoryPageIndex() # range 0, 1, 2, 3
inven_slot_index -= (page * player.INVENTORY_PAGE_SIZE)
self.wndItem.SetCanMouseEventSlot(inven_slot_index)

def SetCantMouseEventSlot(self, inven_slot_index):
if inven_slot_index >= player.INVENTORY_PAGE_SIZE:
page = self.GetInventoryPageIndex() # range 0, 1, 2, 3
inven_slot_index -= (page * player.INVENTORY_PAGE_SIZE)
self.wndItem.SetCantMouseEventSlot(inven_slot_index)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
def __UseItemAcce(self, slotIndex, slotWindow):
AcceSlot = player.FindMoveAcceItemSlot()

if slotWindow != player.INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_NOT_USINGITEM)
return

UsingAcceSlot = player.FindActivatedAcceSlot(slotWindow, slotIndex)

if app.ENABLE_SOULBIND_SYSTEM:
## 봉인아이템 걸러냄
if player.GetItemSealDate(player.INVENTORY, slotIndex) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_NOT_SEALITEM)
return

## 조합창
if player.GetAcceRefineWindowType() == player.ACCE_SLOT_TYPE_COMBINE:
if item.GetItemType() == item.ITEM_TYPE_COSTUME:
if item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
if app.ENABLE_ACCE_SECOND_COSTUME_SYSTEM:
## 전설등급 최고 흡수율 25%
socketInDrainValue = player.GetItemMetinSocket(slotIndex, 1)
if socketInDrainValue >= player.ACCE_MAX_DRAINRATE:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_MAX_DRAINRATE)
return
else:
## if item.GetRefinedVnum() == 0: ## 전선등급 아이템은 걸러냄.
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_MAXGRADE)
return

if UsingAcceSlot == player.ACCE_SLOT_##X:
if AcceSlot != player.ACCE_SLOT_MAX:
if not player.FindUsingAcceSlot(AcceSlot) == player.NPOS():
return

if player.FindUsingAcceSlot(player.ACCE_SLOT_LEFT) == player.NPOS():
## if AcceSlot == player.ACCE_SLOT_RIGHT:
return

player.SetAcceActivatedItemSlot(AcceSlot, slotIndex)
net.SendAcceRefineCheckIn(player.INVENTORY, slotIndex, AcceSlot, player.GetAcceRefineWindowType())
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_POSSIBLE_ACCE)
## return
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_POSSIBLE_ACCE)
return

## 흡수창
elif player.GetAcceRefineWindowType() == player.ACCE_SLOT_TYPE_ABSORB:
isAbsorbItem = False
if item.GetItemType() == item.ITEM_TYPE_COSTUME:
if item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
if not player.GetItemMetinSocket(slotIndex, 0) == 0:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_NOTABSORBITEM)
return

if UsingAcceSlot == player.ACCE_SLOT_MAX:
if not AcceSlot == player.ACCE_SLOT_LEFT: ## 악세서리아이템은 왼쪽 슬롯에만
return

player.SetAcceActivatedItemSlot(AcceSlot, slotIndex)
net.SendAcceRefineCheckIn(player.INVENTORY, slotIndex, AcceSlot, player.GetAcceRefineWindowType())
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_POSSIBLE_ACCEITE##
return

elif item.GetItemType() == item.ITEM_TYPE_WEAPON: ## 무기류.
isAbsorbItem = True

elif item.GetItemType() == item.ITEM_TYPE_ARMOR: ## 갑옷류
if item.GetItemSubType() == item.ARMOR_BODY:
isAbsorbItem = True
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_POSSIBLE_ACCEITEM)
return
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_POSSIBLE_ACCEITEM)
## return

if localeInfo.IsBRAZIL():
## 브라질에서 아래 나열된 아이템은 능력치가 상당히 강해서 흡수 안되게 해달라고 조름.
## 어쩔수 없이 하드코딩함.
itemvnum = item.GetVnum()
if itemvnum == 11979 or itemvnum == 11980 or itemvnum == 11981 or itemvnum == 11982 or itemvnum == 11971 or itemvnum == 11972 or itemvnum == 11973 or itemvnum == 11974:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_DONOT_ABSORDITEM)
re##rn

if app.ENABLE_ACCE_SECOND_COSTUME_SYSTEM:
itemvnum = item.GetVnum()
## if item.IsWeddingItem(itemvnum) == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_POSSIBLE_ACCEITEM)
return

if isAbsorbItem:
if UsingAcceSlot == player.ACCE_SLOT_MAX:
if not AcceSlot == player.ACCE_SLOT_RIGHT: ## 흡수될 아이템은 오른쪽 슬롯에만
if player.FindUsingAcceSlot(player.ACCE_SLOT_RIGHT) == player.NPOS():
## AcceSlot = player.ACCE_SLOT_RIGHT
else:
return

##popup = uiCommon.QuestionDialog()
popup.SetText(localeInfo.ACCE_DEL_ABSORDITEM)
popup.SetAcceptEvent(lambda arg1 = slotIndex, arg2 = AcceSlot: self.OnAcceAcceptEvent(arg1, arg2))
popup.SetCancelEvent(self.OnAcceCloseEvent)
popup.Open()
self.pop = popup

## 경고 메시지 띄우기.
if not player.FindUsingAcceSlot(player.ACCE_SLOT_RIGHT) == player.NPOS() and not player.FindUsingAcceSlot(player.ACCE_SLOT_LEFT) == player.NPOS():
if AcceSlot != player.ACCE_SLOT_MAX:
popup = uiCommon.PopupDialog()
if player.GetAcceRefineWindowType() == player.ACCE_SLOT_TYPE_COMBINE:

if app.ENABLE_ACCE_SECOND_COSTUME_SYSTEM:
##cketInDrainValue = player.GetAcceItemMetinSocket(0, 1)
socketInDrainValue2 = player.GetAcceItemMetinSocket(1, 1)
socketInDrainValue3 = player.GetItemMetinSocket(slotIndex, 1)
## 메인 서버 중. 등록된 아이템이 전설일때 경고 메시지 변경.
if socketInDrainValue > 0 or socketInDrainValue2 > 0 or socketInDrainValue3 > 0:
popup.SetText(localeInfo.ACCE_DEL_SERVEITEM2)
else:
popup.SetText(localeInfo.ACCE_DEL_SERVEITEM)
else:
popup.SetText(localeInfo.ACCE_DEL_SERVEITEM##
popup.SetAcceptEvent(self.__OnClosePopupDialog)
popup.Open()
self.pop = popup

## 아이템 흡수시 흡수될 아이템 할지 안할지 선택 팝업
def OnAcceAcceptEvent(self, slotIndex, AcceSlot):
self.pop.Close()
self.pop = None

player.SetAcceActivatedItemSlot(AcceSlot, slotIndex)
net.SendAcceRefineCheckIn(player.INVENTORY, slotIndex, AcceSlot, player.GetAcceRefineWindowType())

def OnAcceCloseEvent(self):
self.pop.Close()
self.pop = None

if app.ENABLE_AURA_COSTUME_SYSTEM:
def __UseItemAura(self, slotIndex, slotWindow):
AuraSlot = player.FindMoveAuraItemSlot()

##if slotWindow != player.INVENTORY:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_NOT_USINGITEM)
return

UsingAuraSlot = player.FindActivatedAuraSlot(player.INVENTORY, slotIndex)

if player.GetAuraCurrentItemSlotCount() >= player.AURA_SLOT_MAX <= UsingAuraSlot:
return

if app.ENABLE_SOULBIND_SYSTEM:
## 봉인아이템 걸러냄
if player.GetItemSealDate(player.INVENTORY, slotIndex) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_SEALITEM)
##return

if player.GetAuraWindowType() == player.AURA_WINDOW_TYPE_ABSORB:
isAbsorbItem = False
if item.GetItemType() == item.ITEM_TYPE_COSTUME:
if item.GetItemSubType() == item.COSTUME_TYPE_AURA:
if not player.GetItemMetinSocket(slotIndex, item.ITEM_SOCKET_AURA_DRAIN_ITEM_VNUM) == 0:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_ABSORBITEM)
return

if UsingAuraSlot == player.AURA_SLOT_MAX:
if AuraSlot != player.AURA_SLOT_MAIN:
return

net.SendAuraRefineCheckIn(player.INVENTORY, slotIndex, AuraSlot, player.GetAuraWindowType())
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_REFINEITEM)
return

elif item.GetItemType() == item.ITEM_TYPE_ARMOR:## if item.GetItemSubType() in [item.ARMOR_SHIELD, item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR]:
if player.FindUsingAuraSlot(player.AURA_SLOT_MAIN) == player.NPOS():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_POSSIBLE_REGISTER_AURAITEM)
return

isAbsorbItem = True
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_REFINEITEM)
return
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_REFINEITEM)
return

if isAbsorbItem:
if UsingAuraSlot == player.AURA_SLOT_MAX:
if AuraSlot != player.AURA_SLOT_SUB:
if player.FindUsingAuraSlot(player.AURA_SLOT_SUB) == player.NPOS():
AuraSlot = player.AURA_SLOT_SUB
else:
return

popup = uiCommon.QuestionDialog()
popup.SetText(localeInfo.AURA_NOTICE_DEL_ABSORDITEM)
popup.SetAcceptEvent(lambda arg1 = slotIndex, arg2 = AuraSlot: self.OnAuraAcceptEvent(arg1, arg2))
popup.SetCancelEvent(self.OnAuraCloseEvent)
popup.Open()
self.pop = popup

elif player.GetAuraWindowType() == player.AURA_WINDOW_TYPE_GROWTH:
if UsingAuraSlot == player.AURA_SLOT_MAX:
if AuraSlot == player.AURA_SLOT_MAIN:
if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_AURA:
socketLevelValue = player.GetItemMetinSocket(slotIndex, item.ITEM_SOCKET_AURA_LEVEL_VALUE)
curLevel = (socketLevelValue / 100000) - 1000
curExp = socketLevelValue % 100000;
if curLevel >= player.AURA_MAX_LEVEL:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_MAX_LEVEL)
return

#if curExp >= player.GetAuraRefineInfo(curLevel, item.AURA_REFINE_INFO_NEED_EXP):
# chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_GROWTHITEM)
# return

net.SendAuraRefineCheckIn(player.INVENTORY, slotIndex, AuraSlot, player.GetAuraWindowType())
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_POSSIBLE_AURAITEM)
return

elif AuraSlot == player.AURA_SLOT_SUB:
if player.FindUsingAuraSlot(player.AURA_SLOT_MAIN) != player.NPOS():
if item.GetItemType() == item.ITEM_TYPE_RESOURCE and item.GetItemSubType() == item.RESOURCE_AURA:
if UsingAuraSlot == player.AURA_SLOT_MAX:
if AuraSlot != player.AURA_SLOT_SUB:
return

net.SendAuraRefineCheckIn(player.INVENTORY, slotIndex, AuraSlot, player.GetAuraWindowType())
#else:
# chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_POSSIBLE_AURARESOURCE)
#if # return
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_POSSIBLE_REGISTER_AURAITEM)
return

elif player.GetAuraWindowType() == player.AURA_WINDOW_TYPE_EVOLVE:
if UsingAuraSlot == player.AURA_SLOT_MAX:
if AuraSlot == player.AURA_SLOT_MAIN:
if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_AURA:
socketLevelValue = player.GetItemMetinSocket(slotIndex, item.ITEM_SOCKET_AURA_LEVEL_VALUE)
curLevel = (socketLevelValue / 100000) - 1000
curExp = socketLevelValue % 100000;
if curLevel >= player.AURA_MAX_LEVEL:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_MAX_LEVEL)
return

if curLevel != player.GetAuraRefineInfo(curLevel, item.AURA_REFINE_INFO_LEVEL_MAX) or curExp < player.GetAuraRefineInfo(curLevel, item.AURA_RE#elseINFO_NEED_EXP):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_EVOLUTION_ITEM)
return

if player.FindUsingAuraSlot(AuraSlot) != player.NPOS():
return

net.SendAuraRefineCheckIn(player.INVENTORY, slotIndex, AuraSlot, player.GetAuraWindowType())
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_POSSIBLE_AURAITEM)
return

elif AuraSlot == player.AURA_SLOT_SUB:
Cell = player.FindUsingAuraSlot(player.AURA_SLOT_MAIN)
if Cell == player.NPOS():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_POSSIBLE_REGISTER_AURAITEM)
return

socketLevelValue = player.GetItemMetinSocket(*(Cell + (item.ITEM_SOCKET_AURA_LEVEL_VALUE,)))
curLevel = (socketLevelValue / 100000) - 1000
curExp = socketLevelValue % 100000;
if curLevel >= player.AURA_MAX_LEVEL:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_MAX_LEVEL)
return

if curExp < player.GetAuraRefineInfo(curLevel, item.AURA_REFINE_INFO_NEED_EXP):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_EVOLUTION_ITEM)
return

if player.GetItemIndex(slotIndex) != player.GetAuraRefineInfo(curLevel, item.AURA_REFINE_INFO_MATERIAL_VNUM):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_EVOLUTION_ITEM)
return

if player.GetItemCount(slotIndex) < player.GetAuraRefineInfo(curLevel, item.AURA_REFINE_INFO_MATERIAL_COUNT):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_IMPOSSIBLE_EVOLUTION_ITEMCOUNT)
return

if UsingAuraSlot == player.AURA_SLOT_MAX:
if AuraSlot != player.AURA_SLOT_MAX:
if player.FindUsingAuraSlot(AuraSlot) != player.NPOS():
return

net.SendAuraRefineCheckIn(player.INVENTORY, slotIndex, AuraSlot, player.GetAuraWindowType())

def OnAuraAcceptEvent(self, slotIndex, AuraSlot):
self.OnAuraCloseEvent()
net.SendAuraRefineCheckIn(player.INVENTORY, slotIndex, AuraSlot, player.GetAuraWindowType())

def OnAuraCloseEvent(self):
self.pop.Close()
self.pop = None

def __UseAuraClearItem(self, src_item_window, src_item_pos, dst_item_window, dst_item_pos):
if self.clear_aura_item_question_dialog:
return

if app.ENABLE_SOULBIND_SYSTEM:
if player.GetItemSealDate(dst_item_window, dst_item_pos) != item.E_SEAL_DATE_DEFAULT_TIMESTAMP:
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.AURA_CLEAR_CANNOT_USE_SEALED_ITEM)
return

question_dialog = uiCommon.QuestionDialog()
question_dialog.SetText(localeInfo.AURA_CLEAR_QUESTION_WHEN_USE)
question_dialog.SetAcceptEvent(ui.__mem_func__(self.__AuraClearItemAccept))
question_dialog.SetCancelEvent(ui.__mem_func__(self.__AuraClearItemCancel))
question_dialog.Open()
question_dialog.srcItemWindow = src_item_window
question_dialog.srcItemPos = src_item_pos
question_dialog.dstItemWindow = dst_item_window
question_dialog.dstItemPos = dst_item_pos
self.clear_aura_item_question_dialog = question_dialog
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

def __AuraClearItemAccept(self):
if self.clear_aura_item_question_dialog:
self.__SendUseItemToItemPacket(\
self.clear_aura_item_question_dialog.srcItemWindow,\
self.clear_aura_item_question_dialog.srcItemPos,\
self.clear_aura_item_question_dialog.dstItemWindow,\
self.clear_aura_item_question_dialog.dstItemPos)

self.__AuraClearQuestionDialogClose()

def __AuraClearItemCancel(self):
self.__AuraClearQuestionDialogClose()

def __AuraClearQuestionDialogClose(self):
if self.clear_aura_item_question_dialog:
self.clear_aura_item_question_dialog.Close()
self.clear_aura_item_question_dialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)

if app.ENABLE_GEM_CONVERTER:
def __CanUseGemConverter(self, src_item_vnum, src_item_window, src_item_pos, dst_item_window, dst_item_pos):
if src_item_window == dst_item_window and src_item_pos == dst_item_pos:
return False

if src_item_vnum != item.ITEM_VNUM_GEM_CONVERTER:
return False

item.SelectItem(src_item_vnum)

gem_conv_count = player.GetItemCount(src_item_window, src_item_pos)
gem_stone_vnum = player.GetItemIndex(dst_item_window, dst_item_pos)
gem_stone_count = player.GetItemCount(dst_item_window, dst_item_pos)

need_gem_stone_count = gem_conv_count * item.GetValue(0)

if gem_stone_vnum != item.ITEM_VNUM_GEM_STONE:
return False

if gem_stone_count < need_gem_stone_count:
return False

return True

def __UseGemConverter(self, src_item_window, src_item_pos, dst_item_window, dst_item_pos):
if self.gem_converter_question_dialog:
return

self.gem_converter_item_pos = (src_item_pos, dst_item_pos)

self.SetCantMouseEventSlot(src_item_pos)
self.SetCantMouseEventSlot(dst_item_pos)

question_dialog = uiCommon.QuestionDialog()
question_dialog.SetText(localeInfo.GEM_CONVERTER_MESSAGE_USE_CONVERTER_QUESTION)
question_dialog.SetAcceptEvent(ui.__mem_func__(self.__AcceptGemConverterUse))
question_dialog.SetCancelEvent(ui.__mem_func__(self.__CancelGemConverterUse))
question_dialog.Open()
question_dialog.srcItemWindow = src_item_window
question_dialog.srcItemPos = src_item_pos
question_dialog.dstItemWindow = dst_item_window
question_dialog.dstItemPos = dst_item_pos
self.gem_converter_question_dialog = question_dialog
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

def __AcceptGemConverterUse(self):
if not self.gem_converter_question_dialog:
return

gem_conv_vnum = player.GetItemIndex(self.gem_converter_question_dialog.srcItemWindow, self.gem_converter_question_dialog.srcItemPos)
gem_conv_count = player.GetItemCount(self.gem_converter_question_dialog.srcItemWindow, self.gem_converter_question_dialog.srcItemPos)
gem_stone_count = player.GetItemCount(self.gem_converter_question_dialog.dstItemWindow, self.gem_converter_question_dialog.dstItemPos)

item.SelectItem(gem_conv_vnum)
need_gem_stone_count = gem_conv_count * item.GetValue(0)
conv_to_gem = need_gem_stone_count / item.GetValue(0)
conv_cost = gem_conv_count * item.GetValue(1)

if gem_stone_count < need_gem_stone_count:
self.__CancelGemConverterUse()
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GEM_CONVERTER_MESSAGE_NOT_ENOUGH_GEMSTONE % localeInfo.NumberToMoneyString(need_gem_stone_count))
return

if player.GetElk() < conv_cost:
self.__CancelGemConverterUse()
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GEM_CONVERTER_MESSAGE_NOT_ENOUGH_GOLD)
return

if player.GetGem() + conv_to_gem >= player.GEM_MAX:
self.__CancelGemConverterUse()
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GEM_CONVERTER_MESSAGE_GEM_MAX)
return

chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GEM_CONVERTER_MESSAGE_CONVERT_SUCCESS_GEM_STONE % gem_conv_count)
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GEM_CONVERTER_MESSAGE_CONVERT_SUCCESS_CONVERTER % need_gem_stone_count)

self.__SendUseItemToItemPacket(\
self.gem_converter_question_dialog.srcItemWindow,\
self.gem_converter_question_dialog.srcItemPos,\
self.gem_converter_question_dialog.dstItemWindow,\
self.gem_converter_question_dialog.dstItemPos)

self.__CancelGemConverterUse()

def __CancelGemConverterUse(self):
for i in self.gem_converter_item_pos:
self.SetCanMouseEventSlot(i)
self.gem_converter_item_pos = [-1, -1]

self.__CloseGemConverterUseQuestionDialog()

def __CloseGemConverterUseQuestionDialog(self):
if self.gem_converter_question_dialog:
self.gem_converter_question_dialog.Close()
self.gem_converter_question_dialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)

def __UseItemQuestionDialog_OnCancel(self):
self.OnCloseQuestionDialog()

def __UseItemQuestionDialog_OnAccept(self):
self.__SendUseItemPacket(self.questionDialog.slotIndex)
self.OnCloseQuestionDialog()

def __SendUseItemToItemPacket(self, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos):
# 개인상점 열고 있는 동안 아이템 사용 방지
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
return

#if self.interface.IsShowDlgQuestionWindow():
# chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DONT_USE_ITEM_WHEN_SHOW_CONFIRM)
# return

net.SendItemUseToItemPacket(srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos)

def __SendUseItemPacket(self, slotPos, slotWindow = player.INVENTORY):
# 개인상점 열고 있는 동안 아이템 사용 방지
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
return

#if self.interface.IsShowDlgQuestionWindow():
# chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DONT_USE_ITEM_WHEN_SHOW_CONFIRM)
# return

net.SendItemUsePacket(slotWindow, slotPos)

def __SendMoveItemPacket(self, srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos, srcItemCount):
# 개인상점 열고 있는 동안 아이템 사용 방지
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
return

#if self.interface.IsShowDlgQuestionWindow():
# chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DONT_USE_ITEM_WHEN_SHOW_CONFIRM)
# return

net.SendItemMovePacket(srcSlotWindow, srcSlotPos, dstSlotWindow, dstSlotPos, src#ifmCount)

def SetDragonSoulRefineWindow(self, DragonSoulRefine):
from _weakref import proxy
self.wndDragonSoulRefine = proxy(DragonSoulRefine)

def OnMoveWindow(self, x, y):
if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
pass
else:
if self.wndBelt:
self.wndBelt.AdjustPosition()

# 악세서리 슬롯 테두리 추가, 제거.
## HilightSlot Change
def DeactivateSlot(self, slotindex, type):
if type == wndMgr.HILIGHTSLOT_MAX:
return

if app.ENABLE_ACCE_COSTUME_SYSTEM:
#iff type == wndMgr.HILIGHTSLOT_ACCE:
self.__DelHighlightSlotAcce(slotindex)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if type == wndMgr.HILIGHTSLOT_CHANGE_LOOK:
self.__DelHighlightSlotChangeLook(slotindex)

if app.ENABLE_AURA_COSTUME_SYSTEM:
if type == wndMgr.HILIGHTSLOT_AURA:
self.__DelHighlightSlotAura(slotindex)

if app.ENABLE_CUBE_RENEWAL:
if type == wndMgr.HILIGHTSLOT_CUBE:
self.__DelHighlightSlotCube(slotindex)

## HilightSlot Cha#if
def ActivateSlot(self, slotindex, type):
if type == wndMgr.HILIGHTSLOT_MAX:
return

#if app.WJ_ENABLE_PICKUP_ITEM_EFFECT:
# self.DelHighlightSlot(slotindex)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
if type == wndMgr.HILIGHTSLOT_ACCE:
self.__AddHighlightSlotAcce(slotindex)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if type == wndMgr.HILIGHTSLOT_CHANGE_LOOK:
self.__AddHighlightSlotChangeLook(slotindex)

if app.ENABLE_AURA_COSTUME_SYSTEM:
if type == wndMgr.HILIGHTSLOT_AURA:
self.__AddHighlightSlotAura(slotindex)

## if app.ENABLE_CUBE_RENEWAL:
if type == wndMgr.HILIGHTSLOT_CUBE:
self.__AddHighlightSlotCube(slotindex)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
## 악세서리 용 하이라이트 list 추가.
def __AddHighlightSlotAcce(self, slotIndex):
if not slotIndex in self.listHighlightedAcceSlot:
self.listHighlightedAcceSlot.append(slotIndex)

## 악세서리 용 하이라이트 list 삭제.
def __DelHighlightSlotAcce(self, slotIndex):
if slotIndex in self.listHighlightedAcceSlot:
if slotIndex >= player.INVENTORY_PAGE_SIZE:
self.wndItem.DeactivateSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
s##f.wndItem.SetCanMouseEventSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
else:
#if self.wndItem.DeactivateSlot(slotIndex)
self.wndItem.SetCanMouseEventSlot(slotIndex)

self.listHighlightedAcceSlot.remove(slotIndex)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
def __AddHighlightSlotChangeLook(self, slotIndex):
if not slotIndex in self.listHighlightedChangeLookSlot:
self.listHighlightedChangeLookSlot.append(slotIndex)

def __DelHighlightSlotChangeLook(self, slotIndex):
if slotIndex in self.listHighlightedChangeLookSlot:
if slotIndex >= player.INVENTORY_PAGE_SIZE:
self.wndItem.DeactivateSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
## self.wndItem.SetCanMouseEventSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
else:
self.wndItem.DeactivateSlot(slotIndex)
self.wndItem.SetCanMouseEventS##t(slotIndex)
self.listHighlightedChangeLookSlot.remove(slotIndex)

if app.ENABLE_CUBE_RENEWAL:
def __AddHighlightSlotCube(self, slotIndex):
if not slotIndex in self.listHighlightedCubeSlot:
self.listHighlightedCubeSlot.append(slotIndex)

def __DelHighlightSlotCube(self, slotIndex):
if slotIndex in self.listHighlightedCubeSlot:
if slotIndex >= player.INVENTORY_PAGE_SIZE:
self.wndItem.DeactivateSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
else:
self.wndItem.DeactivateSlot(slotIndex)
self.listHighlightedCubeSlot.remove(slotIndex)

if app.ENABLE_AURA_COSTUME_SYSTEM:
def __AddHighlightSlotAura(self, slotIndex):
if not slotIndex in self.listHighlightedAuraSlot:
self.listHighlightedAuraSlot.append(slotIndex)

def __DelHighlightSlotAura(self, slotIndex):
if slotIndex in self.listHighlightedAuraSlot:
if slotIndex >= player.INVENTORY_PAGE_SIZE:
self.wndItem.DeactivateSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
self.wndItem.SetCanMouseEventSlot(slotIndex - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
else:
self.wndItem.DeactivateSlot(slotIndex)
self.wndItem.SetCanMouseEventSlot(slotIndex)
self.listHighlightedAuraSlot.remove(slotIndex)

## 하이라이트 리프레쉬.
def __HighlightSlot_Refresh(self):
## 악세서리.
for i in xrange(self.wndItem.GetSlotCount()):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
if slotNumber in self.listHighlightedAcceSlot:
self.wndItem.ActivateSlot(i)
self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_GREEN)
self.wndItem.SetCantMouseEventSlot(i)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if slotNumber in self.listHighlightedChangeLookSlot:
self.wndItem.ActivateSlot(i)
self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_RED)
self.wndItem.SetCantMouseEventSlot(i)

if app.ENABLE_AURA_COSTUME_SYSTEM:
if slotNumber in self.listHighlightedAuraSlot:
self.wndItem.ActivateSlot(i)
self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_GREEN)
self.wndItem.SetCantMouseEventSlot(i)

if app.ENABLE_CUBE_RENEWAL:
if slotNumber in self.listHighlightedCubeSlot:
self.wndItem.ActivateSlot(i)
self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_RED)

## HilightSlot Change
if app.WJ_ENABLE_PICKUP_ITEM_EFFECT:
if slotNumber in self.listH##hlightedSlot:
self.wndItem.ActivateSlot(i)
## self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_MAX)

## 악세서리 용 하이라이트 list 클리어.
def __HighlightSlot_Clear(self):
## 악세서리
for i in xrange(self.wndItem.GetSlotCount()):
slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)

if app.ENABLE_ACCE_COSTUME_SYSTEM:
if slotNumber in self.listHighlightedAcceSlot:
self.wndItem.DeactivateSlot(i)
self.wndItem.SetCanMouseEventSlot(i)
self.listHighlightedAcceSlot.remove(slotNumber)

if app.ENABLE_CHANGE_LOOK_SYSTEM:
if slotNumber in self.listHighlightedChangeLookSlot:
self.wndItem.DeactivateSlot(i)
self.wndItem.SetCanMouseEventSlot(i)
self.listHighlightedChangeLookSlot.remove(slotNumber)

if app.ENABLE_AURA_COSTUME_SYSTEM:
if slotNumber in self.listHighlightedAuraSlot:
self.wndItem.DeactivateSlot(i)
self.wndItem.SetCanMouseEventSlot(i)
self.listHighlightedAuraSlot.remove(slotNumber)

if app.ENABLE_CUBE_RENEWAL:
if slotNumber in self.listHighlightedCubeSlot:
self.wndItem.Deact##ateSlot(i)
self.listHighlightedCubeSlot.remove(slotNumber)

## HilightSlot Change
if app.WJ_ENABLE_PICKUP_ITEM_EFFECT:
if slotNumber in self.listHighlightedSlot:
self.wndItem.Deacti##teSlot(i)
self.listHighlightedSlot.remove(slotNumber)

if app.WJ_ENABLE##ICKUP_ITEM_EFFECT:
# 슬롯 highlight 관련
## 추가
def HighlightSlot(self, slot):
#slot값에 대한 예외처리.
if slot > player.INVENTORY_PAGE_SIZE * player.INVENTORY_PAGE_COUNT:
return

if not slot in self.listHighlightedSlot:
self.listHighlightedSlot.append(slot)

## 삭제
def DelHighlightSlot(self, inventorylocalslot):
if inventorylocalslot in self.listHighlightedSlot:
if inventorylocalslot >= player.INVENTORY_PAGE_SIZE:
self.wndItem.DeactivateSlot(inventorylocalslot - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE))
else:
self.wndItem.DeactivateSlot(inventorylocalslot)

self.listHighlightedSlot.remove(inventorylocalslot)

# 슬롯 highlight 관련 끝

# wj.2014.12.2. 인벤토리와 DS인벤 간의 상태를 확인 및 설정하기 위한 함수.
def IsDlgQuestionShow(self):
if self.dlgQuestion.IsShow():
return True
else:
return False

def CancelDlgQuestion(self):
self.__Cancel()

def SetUseItemMode(self, bUse):
self.wndItem.SetUseMode(bUse)

if app.ENABLE_MOVE_COSTUME_ATTR or app.ENABLE_CHEQUE_SYSTEM or app##NABLE_ATTR_6TH_7TH:
def GetInventoryPageIndex(self):
## 0 or 1
return self.inventoryPageIndex

if app.ENABLE_CHEQUE_SYSTEM:
def OverInToolTip(self, arg) :
arglen = len(str(arg))
pos_x, pos_y = wndMgr.GetMousePosition()

self.toolTip.ClearToolTip()## self.toolTip.SetThinBoardSize(11 * arglen)
#slot값에.toolTip.SetToolTipPosition(pos_x + 5, pos_y - 5)
self.toolTip.AppendTextLine(arg, 0xffffff00)
self.toolTip.Show()

def OverOutToolTip(self) :
self.toolTip.Hide()

def EventProgress(self, ev##t_type, idx):
if "mouse_over_in" == str(event_type):
if idx == 0:
self.OverInToolTip(localeInfo.CHEQUE_SYSTEM_UNIT_YANG)
elif idx == 1:
self.OverInToolTip(localeInfo.CHEQUE_SYSTEM_UNIT_WON)
elif app.ENABLE_GEM_SYSTEM and idx == 2:
self.OverInToolTip(localeInfo.GEM_SYSTEM_NAME)
else:
return
elif "mouse_over_out" == str(event_type):
self.OverOutToolTip()
else:
return

if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
def BindEquipmentWindow(self, equipment_window):
self.wndEquipment = equipment_window

def UseInventoryItemInQuickSlot(self, global_slot_index):
self.__UseItem(global_slot_index, player.INVENTORY)

if app.ENABLE_HIDE_COSTUME_SYSTEM:
def SetHiddenCostumePart(self, part, hidden):
if app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
if self.wndEquip##nt:
self.wndEquipment.SetHiddenCostumePart(part, hidden)
else:
if self.wndCostume:
self.wndCostume.SetHiddenCostumePart(part, hidden)
[/CODE]
 
here is the bug

Python:
            if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
                self.equipmentTab = []
                self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
                self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))

                # Belt Inventory Window
                self.wndBelt = None
                # Sorting
                if app.KD_MANAGE_INV:
                    xPos = 135 if localeInfo.IsARABIC() else 150
                    self.wndManageInv = uisorting.InventoryManagementWindow()
                    self.wndManageInv.SetParent(self.GetChild("board"))
                    self.wndManageInv.SetPosition(self.GetChild("TitleBar").GetWidth() - xPos, 6)
                    self.wndManageInv.Show()


you add if app.KD_MANAGE_INV: with if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
so u enable ENABLE_ADDITIONAL_EQUIPMENT_PAGE so KD_MANAGE_INV dont enable

change like it

Python:
            if not app.ENABLE_ADDITIONAL_EQUIPMENT_PAGE:
                self.equipmentTab = []
                self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
                self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))

                # Belt Inventory Window
                self.wndBelt = None

            # Sorting
            if app.KD_MANAGE_INV:
                    xPos = 135 if localeInfo.IsARABIC() else 150
                    self.wndManageInv = uisorting.InventoryManagementWindow()
                    self.wndManageInv.SetParent(self.GetChild("board"))
                    self.wndManageInv.SetPosition(self.GetChild("TitleBar").GetWidth() - xPos, 6)
                    self.wndManageInv.Show()


Hayaletdev

 
Paylaşım için teşekkürler hocam, zamanında en çok uğraştığım olaylardan birisi K Envanter birisi de budur. Sıralama esnasında itemleri silip geri çağırmak durumunda kalmak aynı zamanda Dupe riskini de oluşturuyordu. Örnek vermek gerekirse: Toplu Sil Sat sistemi eklediğimde herhangi itemi sattıktan sonra karakter bu sistemi devreye sokup karakter atınca itemler envantere yeniden geliyordu gibi... En son kendime böyle bir çözüm bulmuştum ama bana göre Metin2 piyasasında en riskli görebildiğim 3 sistem varsa; OfflineShop, K Envanter ve bu diyebilirim. Diğerleri riskli çünkü slot ne kadar artarsa paket boyutunu da bir o kadar arttırmak zorunda kalıyorsun. Örnek hazırladığım envanter düzenleme yapısı.
You can use the same logic with the addition of a window type.
For me, it's better than relying on the number of slot.
But what you did wasn't bad.
 
You can use the same logic with the addition of a window type.
For me, it's better than relying on the number of slot.
But what you did wasn't bad.
Bilgilendirme için teşekkürler 🌹
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst