.TeodorPL 22 Posted March 9, 2014 Share Posted March 9, 2014 (edited) 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: Edited August 22, 2022 by Metin2 Dev Core X - External 2 Internal 19 Link to comment Share on other sites More sharing options...
Premium Shogun 4591 Posted March 9, 2014 Premium Share Posted March 9, 2014 Can you explain this a bit more? What do you mean with "the new currency"? Link to comment Share on other sites More sharing options...
.TeodorPL 22 Posted March 9, 2014 Author Share Posted March 9, 2014 (edited) Can you explain this a bit more? What do you mean with "the new currency"? Screen: Edited August 22, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Shogun 4591 Posted March 9, 2014 Premium Share Posted March 9, 2014 Oh so this lets you buy items through Dragon Coins in ingame shops? Link to comment Share on other sites More sharing options...
The Naid 119 Posted March 9, 2014 Share Posted March 9, 2014 Nice. This new shop looks great to ingame ItemShop. Polish Power. 2 Link to comment Share on other sites More sharing options...
.TeodorPL 22 Posted March 9, 2014 Author Share Posted March 9, 2014 Oh so this lets you buy items through Dragon Coins in ingame shops? Nope, the value is retrieved from quest flag. Link to comment Share on other sites More sharing options...
Developer PACI 923 Posted March 9, 2014 Developer Share Posted March 9, 2014 (edited) Kinda of achievement shop I think. I would just replace this: 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 Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Cilindro 14 Posted March 9, 2014 Share Posted March 9, 2014 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 Link to comment Share on other sites More sharing options...
.TeodorPL 22 Posted March 9, 2014 Author Share Posted March 9, 2014 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. Link to comment Share on other sites More sharing options...
Kori 170 Posted March 18, 2014 Share Posted March 18, 2014 Made really nice. I have a question how do I get to the TR? Link to comment Share on other sites More sharing options...
The Naid 119 Posted March 18, 2014 Share Posted March 18, 2014 Made really nice. I have a question how do I get to the TR? It depends on you. Link to comment Share on other sites More sharing options...
Kori 170 Posted March 18, 2014 Share Posted March 18, 2014 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 Link to comment Share on other sites More sharing options...
Life 13 Posted March 22, 2014 Share Posted March 22, 2014 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 More sharing options...
Premium Sanchez 2468 Posted March 22, 2014 Premium Share Posted March 22, 2014 You have just syntax error, upload the files what you modified and I look into it. 1 Link to comment Share on other sites More sharing options...
Life 13 Posted March 22, 2014 Share Posted March 22, 2014 I followed these steps and here are the files i think there is a problem withhttps://mega.co.nz/#!ERBggBoC!krFxnymda7IzWCw8T06nJIU0GGOrFxSyvoA99PHGS6A Appreciate it thanks Link to comment Share on other sites More sharing options...
Premium Sanchez 2468 Posted March 22, 2014 Premium Share Posted March 22, 2014 uishop.py had the syntax error, here it is: This is the hidden content, please Sign In or Sign Up 2 1 Link to comment Share on other sites More sharing options...
Life 13 Posted March 22, 2014 Share Posted March 22, 2014 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! 1 Link to comment Share on other sites More sharing options...
Premium Sanchez 2468 Posted March 22, 2014 Premium Share Posted March 22, 2014 You just forgot one empty line at the end of the file. 1 Link to comment Share on other sites More sharing options...
Premium .Avenue™ 783 Posted March 22, 2014 Premium Share Posted March 22, 2014 (edited) Why I everytime got this window after I bought an Item? Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Sanchez 2468 Posted March 22, 2014 Premium Share Posted March 22, 2014 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 1 Link to comment Share on other sites More sharing options...
Life 13 Posted March 22, 2014 Share Posted March 22, 2014 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 More sharing options...
Phantom 3 Posted March 23, 2014 Share Posted March 23, 2014 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 More sharing options...
Premium Sanchez 2468 Posted March 23, 2014 Premium Share Posted March 23, 2014 Paste here the default def OpenQuestWindow(self, skin, idx): function. Link to comment Share on other sites More sharing options...
Phantom 3 Posted March 23, 2014 Share Posted March 23, 2014 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 More sharing options...
Premium Sanchez 2468 Posted March 23, 2014 Premium Share Posted March 23, 2014 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 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now