Jump to content

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

Share this post


Link to post

Can you explain this a bit more? What do you mean with "the new currency"?

Share this post


Link to post

Can you explain this a bit more? What do you mean with "the new currency"?

 

Screen:

 

09977500848733865551.jpg

Share this post


Link to post

Oh so this lets you buy items through Dragon Coins in ingame shops?

Share this post


Link to post

Nice.

This new shop looks great to ingame ItemShop.

Polish Power. :P

  • Love 2

Share this post


Link to post

Oh so this lets you buy items through Dragon Coins in ingame shops?

 

Nope, the value is retrieved from quest flag.

Share this post


Link to post

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

Share this post


Link to post

on my cliente syserr came this 

 

0309 03:45:37232 :: Unknown Server Command setPP 0 | setPP

 

and in inventory don't swo the TR then i have :( 

Share this post


Link to post

on my cliente syserr came this 

 

0309 03:45:37232 :: Unknown Server Command setPP 0 | setPP

 

and in inventory don't swo the TR then i have :(

 

Add it again. Tutorial has been corrected.

Share this post


Link to post
 
Made really nice. I have a question how do I get to the TR?

 

Share this post


Link to post

 

 
Made really nice. I have a question how do I get to the TR?

 

 

It depends on you.

Share this post


Link to post
 
Can you provide me an example of how one can best implement the TR? Because I do not have much idea of the only clientside things

 

Share this post


Link to post

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

Share this post


Link to post

You have just syntax error, upload the files what you modified and I look into it.

  • Love 1

Share this post


Link to post

Thank you, it worked !

May i ask what was the problem?

Also if anyone else has the same problem, download the uishop.py which is kindly provided by Sanchez!

  • Love 1

Share this post


Link to post

You just forgot one empty line at the end of the file.

  • Love 1

Share this post


Link to post

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

Share this post


Link to post

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 

Share this post


Link to post

 

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))

Share this post


Link to post

Paste here the default def OpenQuestWindow(self, skin, idx): function.

Share this post


Link to post

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((

 

Share this post


Link to post

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

Share this post


Link to post

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

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.