示例#1
0
    def __SellItem(self, itemSlotPos):
        if not player.IsEquipmentSlot(itemSlotPos):
            self.sellingSlotNumber = itemSlotPos
            itemIndex = player.GetItemIndex(itemSlotPos)
            itemCount = player.GetItemCount(itemSlotPos)

            item.SelectItem(itemIndex)
            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(
                locale.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
示例#2
0
    def SellAttachedItem(self):

        if shop.IsPrivateShop():
            mouseModule.mouseController.DeattachObject()
            return

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()
        if player.SLOT_TYPE_INVENTORY == attachedSlotType:

            itemIndex = player.GetItemIndex(attachedSlotPos)
            item.SelectItem(itemIndex)

            if item.IsAntiFlag(item.ANTIFLAG_SELL):
                popup = uiCommon.PopupDialog()
                popup.SetText(locale.SHOP_CANNOT_SELL_ITEM)
                popup.SetAcceptEvent(self.__OnClosePopupDialog)
                popup.Open()
                self.popup = popup

            elif player.IsValuableItem(attachedSlotPos):

                itemPrice = item.GetISellItemPrice()

                if item.Is1GoldItem():
                    itemPrice = attachedCount / itemPrice / 5
                else:
                    itemPrice = itemPrice * max(1, attachedCount) / 5

                itemName = item.GetItemName()

                questionDialog = uiCommon.QuestionDialog()
                questionDialog.SetText(
                    locale.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                            itemPrice))

                questionDialog.SetAcceptEvent(
                    lambda arg1=attachedSlotPos, arg2=attachedCount: self.
                    OnSellItem(arg1, arg2))
                questionDialog.SetCancelEvent(
                    ui.__mem_func__(self.OnCloseQuestionDialog))
                questionDialog.Open()
                self.questionDialog = questionDialog

            else:
                self.OnSellItem(attachedSlotPos, attachedCount)

        else:
            snd.PlaySound("sound/ui/loginfail.wav")

        mouseModule.mouseController.DeattachObject()
示例#3
0
    def __SellItem(self, itemSlotPos):
        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)
            ## 안티 플레그 검사 빠져서 추가
            ## 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()

            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)
示例#4
0
    def SellAttachedItem(self):
        import constInfo, chat
        if constInfo.BlockItemsSystem["Block"] == 1:
            chat.AppendChat(1, "Sicherheitssystem Aktiviert.")
            return

        if shop.IsPrivateShop():
            mouseModule.mouseController.DeattachObject()
            return

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()
        if localeInfo.IsBRAZIL() == 0:
            attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex(
            )

        if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_INVENTORY == attachedSlotType or fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:

            if localeInfo.IsBRAZIL():
                itemIndex = fgGHGjjFHJghjfFG1545gGG.GetItemIndex(
                    attachedSlotPos)
                item.SelectItem(itemIndex)
            else:
                item.SelectItem(attachedItemIndex)

            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

            itemtype = fgGHGjjFHJghjfFG1545gGG.INVENTORY

            if localeInfo.IsBRAZIL() == 0:
                if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
                    itemtype = fgGHGjjFHJghjfFG1545gGG.DRAGON_SOUL_INVENTORY

            if fgGHGjjFHJghjfFG1545gGG.IsValuableItem(itemtype,
                                                      attachedSlotPos):

                itemPrice = item.GetISellItemPrice()

                if item.Is1GoldItem():
                    itemPrice = attachedCount / itemPrice / 5
                else:
                    itemPrice = itemPrice * max(1, attachedCount) / 5

                itemName = item.GetItemName()

                questionDialog = uiCommon.QuestionDialog()
                questionDialog.SetText(
                    localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                                itemPrice))

                questionDialog.SetAcceptEvent(
                    lambda arg1=attachedSlotPos, arg2=attachedCount, arg3=
                    itemtype: self.OnSellItem(arg1, arg2, arg3))
                questionDialog.SetCancelEvent(
                    ui.__mem_func__(self.OnCloseQuestionDialog))
                questionDialog.Open()
                self.questionDialog = questionDialog

                constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

            else:
                self.OnSellItem(attachedSlotPos, attachedCount, itemtype)

        else:
            snd.PlaySound("sound/ui/loginfail.wav")

        mouseModule.mouseController.DeattachObject()