Jump to content
×
×
  • Create New...

[ Dead Download Link ] [RELEASE] Shop with the new currency [ We Need You ]


.TeodorPL

Recommended Posts

Hi, I want to release shop with the new currency.

Client:

inventorywindow.py (locale/uiscript):

You must replace this:

"y" : SCREEN_HEIGHT - 37 - 565,
"y" : SCREEN_HEIGHT - 37 - 589,

2x replace this:

"height" : 565,
"height" : 589,

And replace this:

                ## Print

                {

                    "name":"Money_Slot",

                    "type":"button",



                    "x":8,

                    "y":28,



                    "horizontal_align":"center",

                    "vertical_align":"bottom",



                    "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

                    "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

                    "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",



                    "children" :

                    (

                        {

                            "name":"Money_Icon",

                            "type":"image",



                            "x":-18,

                            "y":2,



                            "image":"d:/ymir work/ui/game/windows/money_icon.sub",

                        },



                        {

                            "name" : "Money",

                            "type" : "text",



                            "x" : 3,

                            "y" : 3,



                            "horizontal_align" : "right",

                            "text_horizontal_align" : "right",



                            "text" : "123456789",

                        },

                    ),

                },

                ## Print

                {

                    "name":"Money_Slot",

                    "type":"button",



                    "x":8,

                    "y":28+24,



                    "horizontal_align":"center",

                    "vertical_align":"bottom",



                    "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

                    "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

                    "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",



                    "children" :

                    (

                        {

                            "name":"Money_Icon",

                            "type":"image",



                            "x":-18,

                            "y":2,



                            "image":"d:/ymir work/ui/game/windows/money_icon.sub",

                        },



                        {

                            "name" : "Money",

                            "type" : "text",



                            "x" : 3,

                            "y" : 3,



                            "horizontal_align" : "right",

                            "text_horizontal_align" : "right",



                            "text" : "123456789",

                        },

                    ),

                },

                ## Print

                {

                    "name":"Premium_Slot",

                    "type":"button",



                    "x":8,

                    "y":28,



                    "horizontal_align":"center",

                    "vertical_align":"bottom",



                    "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

                    "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

                    "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",



                    "children" :

                    (

                        {

                            "name":"Premium_Icon",

                            "type":"image",



                            "x":-18,

                            "y":2,



                            "image":"d:/ymir work/ui/game/windows/money_icon.sub",

                        },



                        {

                            "name" : "Premium",

                            "type" : "text",



                            "x" : 3,

                            "y" : 3,



                            "horizontal_align" : "right",

                            "text_horizontal_align" : "right",



                            "text" : "123456789",

                        },

                    ),

                },

game.py (root):

In table "servercommandlist" you must add this lines:

 

            "GetInputStart"            : self.GetInputStart,

            "GetInputStop"            : self.GetInputStop,

            "GetInput"                : self.GetInput,

            "SetQuestIndex"            : self.QuestIndexShop,

            "SetIsNpc"                : self.SetIsNpc,

            "SetPrice"                : self.SetIsPrice,

            "NieMamPP"                : self.NieMamPP,

            "setPP"                   : self.__setAchievementPoints,

And add this lines under "servercommandlist" table:

 

    def NieMamPP(self):

        import uiShop

        self.wndShop = uiShop.ShopDialog()

        self.wndShop.NieMamPP()



    def __setAchievementPoints(self, points):

        constInfo.ACHIEVEMENT_POINTS = int(points)

        self.interface.wndInventory.UpdatePremiumInSlot()



    def SetIsPrice(self, value):

        self.interface.dlgShop.SetShopPrice(value)



    def SetIsNpc(self):

        constInfo.IsItemShop = 1



    def QuestIndexShop(self, value):

        constInfo.IS_QUEST = int(value)



    def GetInputStart(self):

        constInfo.INPUT_IGNORE = 1



    def GetInputStop(self):

        constInfo.INPUT_IGNORE = 0



    def GetInput(self):

        net.SendQuestInputStringPacket(str(constInfo.INPUT_DATA))

constinfo.py (root):

You must add this lines in the middle of the file:

 

ACHIEVEMENT_POINTS = 0

IS_QUEST = 0

IsItemShop = 0

INPUT_IGNORE = 0

INPUT_DATA = ""

uitooltip.py (root):

You must replace this function:

 

    def SetShopItem(self, slotIndex):

        itemVnum = shop.GetItemID(slotIndex)



        if 0 == itemVnum:

            return



        price = shop.GetItemPrice(slotIndex)

        self.ClearToolTip()

        self.isShopItem = TRUE



        item.SelectItem(itemVnum)



        metinSlot = []

        for i in xrange(player.METIN_SOCKET_MAX_NUM):

            metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))

        attrSlot = []

        for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):

            attrSlot.append(shop.GetItemAttribute(slotIndex, i))



        self.AddItemData(itemVnum, metinSlot, attrSlot)



        self.AppendPrice(price)

    def SetShopItem(self, slotIndex, addprice = 0, waltype = 0):

        itemVnum = shop.GetItemID(slotIndex)



        if 0 == itemVnum:

            return



        price = shop.GetItemPrice(slotIndex)

        self.ClearToolTip()

        self.isShopItem = TRUE



        item.SelectItem(itemVnum)



        metinSlot = []

        for i in xrange(player.METIN_SOCKET_MAX_NUM):

            metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))

        attrSlot = []

        for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):

            attrSlot.append(shop.GetItemAttribute(slotIndex, i))



        self.AddItemData(itemVnum, metinSlot, attrSlot)



        if waltype == 0:

            self.AppendPrice(price)

        else:

            self.AppendSpace(5)

            self.AppendTextLine("Cena: %s TR" % (locale.NumberToMoneyString(addprice)[:-5]), self.SPECIAL_TITLE_COLOR)

uiinventory.py (root):

Under:

 

    def RefreshStatus(self):

        money = player.GetElk()

        self.wndMoney.SetText(locale.NumberToMoneyString(money))

Add:

 

    def UpdatePremiumInSlot(self):

        import constInfo

        value = str(constInfo.ACHIEVEMENT_POINTS)

        self.wndPremium.SetText(locale.NumberToMoneyString(value)[:-5] + " TR")

Under:

 

        self.wndMoneySlot = 0

Add:

 

        self.wndPremium = 0

        self.wndPremiumSlot = 0

Under:

 

            self.wndMoneySlot = self.GetChild("Money_Slot")

Add:

 

            self.wndPremium = self.GetChild("Premium")

            self.wndPremiumSlot = self.GetChild("Premium_Slot")

And replace this function:

 

    def SelectEmptySlot(self, selectedSlotPos):

        if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:

            return



        selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)



        if mouseModule.mouseController.isAttached():



            attachedSlotType = mouseModule.mouseController.GetAttachedType()

            attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()

            attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()

            attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()



            if player.SLOT_TYPE_INVENTORY == attachedSlotType:

                itemCount = player.GetItemCount(attachedSlotPos)

                attachedCount = mouseModule.mouseController.GetAttachedItemCount()

                self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)



                if item.IsRefineScroll(attachedItemIndex):

                    self.wndItem.SetUseMode(FALSE)



            elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:

                mouseModule.mouseController.RunCallBack("INVENTORY")



            elif player.SLOT_TYPE_SHOP == attachedSlotType:

                if constInfo.IsItemShop == 0:

                    net.SendShopBuyPacket(attachedSlotPos)

                else:

                    import uiShop

                    self.wndShop = uiShop.ShopDialog()

                    self.wndShop.BuyFromIS(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, selectedSlotPos)



            elif player.SLOT_TYPE_MALL == attachedSlotType:

                net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)



            mouseModule.mouseController.DeattachObject()

uishop.py (root):

This file is too much editing, I give you the finished file.

 

http://wklej.to/YR452

Server:

Add shop, and then add items in this shop.

In my system, a standard shop has id 15.

Remember not to give the shop directly at NPC!

Quest:

 

http://wklej.to/T5Ild

The price we give here:

 

cmdchat("SetPrice 200|50|100|200|150|250|100|100|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0")

Slots are separated by "|".

The items we give here:

 

            local items = {

                [1]={71124, 1, 200},

                [2]={71125, 1, 200},

                [3]={71126, 1, 200},

                [4]={71127, 1, 200},

                [5]={71128, 1, 200},

            }

                [slot_id]={item_id, item_count, item_price},

This guide and information contained in it things are by Teodor.

Sorry for my english, I come from Polish.

Greetings!

 

Screen:

09977500848733865551.jpg

  • Love 19
Link to comment
Share on other sites

Kinda of achievement shop I think.

I would just replace this:

7obrc.png

With this:

if pc.getqf("points") >= items[slot][3] then
	if not pc.enough_inventory(items[slot][1]) then
		syschat("You don't have enough space on your inventory.")
		return
	end
	pc.setqf("points", pc.getqf("points")-items[slot][3])
	cmdchat("setPP "..pc.getqf("points"))
	pc.give_item2(items[slot][1], items[slot][2])
else
	...
end
  • Love 1

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

  • 2 weeks later...

I have no idea why but this is my ssyer after adding this
 

networkModule.py(line:201) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:23) ?
system.py(line:130) __pack_import
 
networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 429)
 
0322 14:32:19920 :: ============================================================================================================
0322 14:32:19920 :: Abort!!!!

Thanks
Link to comment
Share on other sites

  • Premium

It looks a problem with the INPUT_IGNORE. Open interfacemodule.py and search for def OpenQuestWindow(self, skin, idx):

 

Replace the entire function with this:

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 0:
			wnds = ()
			q = uiQuest.QuestDialog(skin, idx)
			q.SetWindowName("QuestWindow" + str(idx))
			q.Show()
			if skin:
				q.Lock()
				wnds = self.__HideWindows()
				q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
			if skin:
				q.AddOnCloseEvent(q.Unlock)
			q.AddOnCloseEvent(lambda s = self, qw = q: s.__dict__.__getitem__("wndQuestWindow").remove(qw))
			self.wndQuestWindow.append(q)
		else:
			pass
  • Love 1
Link to comment
Share on other sites

I would test it if i got to the stage to add the TR to my account hehe, what is the line of command in quest that adds numbers depending on the box they open

So if they open 10 TR box, they should get 10 TR, what is the function so it updates 

Link to comment
Share on other sites

 

It looks a problem with the INPUT_IGNORE. Open interfacemodule.py and search for def OpenQuestWindow(self, skin, idx):

 

Replace the entire function with this:

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 0:
			wnds = ()
			q = uiQuest.QuestDialog(skin, idx)
			q.SetWindowName("QuestWindow" + str(idx))
			q.Show()
			if skin:
				q.Lock()
				wnds = self.__HideWindows()
				q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
			if skin:
				q.AddOnCloseEvent(q.Unlock)
			q.AddOnCloseEvent(lambda s = self, qw = q: s.__dict__.__getitem__("wndQuestWindow").remove(qw))
			self.wndQuestWindow.append(q)
		else:
			pass

0323 22:27:38012 ::   File "game.py", line 674, in OpenQuestWindow

0323 22:27:38013 ::   File "interfaceModule.py", line 609, in OpenQuestWindow

0323 22:27:38013 :: AttributeError

0323 22:27:38013 :: :

0323 22:27:38013 :: 'QuestDialog' object has no attribute 'AddOnDoneEvent'

0323 22:27:38013 ::

____________________________________

i change "q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))" on q.SetOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args)) and normal))

Link to comment
Share on other sites

i change "q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))" on "q.SetOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
" and function ,its good?))
A have ask,how do I add achievement points?
sry for my englisg((

 

Link to comment
Share on other sites

  • Premium

I don't understand you, but if you have problems with the code what I copied here then send me your default interfacemodule.py and I fix it for you. You can add achievement points from quest:

		when login begin
			cmdchat("setPP 10") -- give 10 point to the player
		end
  • Love 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.