Jump to content

Recommended Posts

Hi so I put a sistem of Shang to delet your items in inventory and after delet the item I see a window in game here a gif.

Sysser server : Input: no quest running for pc, cannot process input : 57787

Sysser client : No error

b3eec48fd46881d8257561816374df4d.gif

Tutorial

### ConstInfo.py

BorrarItems = {
	"QID" : 0,
	"BORRAR" : "",
}

### Game.py

En el __ServerCommand_Build, pegar esto:

			"BORRAR"				: self.ManagerBorrar,

Al final del game.py pegar esto:

	def ManagerBorrar(self, cmd):
		cmd = cmd.split("|")
		if cmd[0] == "QID":
			constInfo.BorrarItems["QID"] = int(cmd[1])
		elif cmd[0] == "SEND":
			net.SendQuestInputStringPacket(str(constInfo.BorrarItems["BORRAR"]))
			constInfo.BorrarItems["BORRAR"] = ""
		elif cmd[0] == "INPUT":
			constInfo.INPUT_IGNORE = int(cmd[1])
			
### uiInventory.py
import event
Debajo de 

			wndEquip = self.GetChild("EquipmentSlot")

Pegar esto:

			wndBorrar = self.GetChild("BorrarSlot")
			
Debajo de:

			self.costumeButton = self.GetChild2("CostumeButton")

Pegar:

			self.borrar_items = self.GetChild2("BorrarItems")
			
Debajo de:

		self.attachMetinDialog.Hide()

Pegar esto:

		self.drag = ui.Bar()
		self.drag.SetPosition(13+50,538)
		self.drag.SetParent(self)
		self.drag.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.0))
		self.drag.SetSize(32,32)
		self.drag.OnMouseLeftButtonUp = lambda: self.Add_Item()
		self.drag.Show()

		wndBorrar.SetOverInItemEvent(ui.__mem_func__(self.OverBorrarIn))
		wndBorrar.SetOverOutItemEvent(ui.__mem_func__(self.OverBorrarOut))
		
		self.RemoveQuestion = uiCommon.QuestionDialog()
		self.RemoveQuestion.SetAcceptEvent(lambda arg = TRUE: self.Borrar_Item(arg))
		self.RemoveQuestion.SetCancelEvent(lambda arg = FALSE: self.Borrar_Item(arg))
		self.RemoveQuestion.Close()
		
Debajo del def Close(self):

Pegar esto:

	def OverBorrarIn(self):
		self.ShowToolTip(0)
		
	def OverBorrarOut(self):
		self.tooltipItem.HideToolTip()
		
	def Add_Item(self):
		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedSlotVnum = mouseModule.mouseController.GetAttachedItemIndex()
				
			# item.SelectItem(attachedSlotVnum)
			if player.SLOT_TYPE_INVENTORY == attachedSlotType:
				item.SelectItem(attachedSlotVnum)
				self.RemoveQuestion.SetText("¿Seguro que quieres borrar "+str(item.GetItemName())+"?")
				self.RemoveQuestion.Open()
				constInfo.BorrarItems["BORRAR"] = ""
				constInfo.BorrarItems["BORRAR"] = "BORRAR|"+str(attachedSlotPos)+"|"+str(attachedSlotVnum)
				#chat.AppendChat(1, constInfo.BorrarItems["BORRAR"])
				
			mouseModule.mouseController.DeattachObject()
		
	def Borrar_Item(self, arg):
		if arg:
			event.QuestButtonClick(constInfo.BorrarItems["QID"])
			
		self.RemoveQuestion.Close()

### locale/inventorywindow.py

Debajo de:

				## Item Slot
				{
					"name" : "ItemSlot",
					"type" : "grid_table",

					"x" : 8,
					"y" : 246,

					"start_index" : 0,
					"x_count" : 5,
					"y_count" : 9,
					"x_step" : 32,
					"y_step" : 32,

					"image" : "d:/ymir work/ui/public/Slot_Base.sub"
				},
				
Pegar esto:

				## Borar Items Slot
				{
					"name" : "BorrarItems",
					"type" : "image",

					"x" : 13,
					"y" : 538,

					"image" : "locale/es/ui/inventario/borrar_items.tga",

					"children" :
					(
						{
							"name" : "BorrarSlot",
							"type" : "slot",

							"x" : 0,
							"y" : 0,

							"width" : 32,
							"height" : 32,

							"slot" : (
										{"index":0, "x":0, "y":0, "width":32, "height":32},
									),
						},
					),
				},

Quest

quest borrar_items begin
	state start begin
		
		when login begin
			cmdchat("BORRAR QID|"..q.getcurrentquestindex())
		end
		
		when button or info begin
			cmdchat("BORRAR INPUT|1")
			local shang = split(input(cmdchat("BORRAR SEND|")), "|")
			cmdchat("BORRAR INPUT|0")
			
			if shang[1] == "BORRAR" then
				borrar_items.Borrar(tonumber(shang[2]), tonumber(shang[3]))
			end
		end
		
		function Borrar(slot, vnum)
			item.select_cell(slot)
			local item_vnum, item_count, item_id = item.get_vnum(), item.get_count(), item.get_id()
			item.remove_stack()
		end
	end
end

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Hi so I put a sistem of Shang to delet your items in inventory and after delet the item I see a window in game here a gif.

Sysser server : Input: no quest running for pc, cannot process input : 57787

Sysser client : No error

b3eec48fd46881d8257561816374df4d.gif

Tutorial

 

Hidden Content

Quest

 

Hidden Content

open root/game.py

 

def BINARY_ServerCommand_Run(self, line):

Add on:

 

	def ItemRemoveGetInputOff(self):
		constInfo.INPUT_IGNORE = 0


Search:

 

"MyShopPriceList"        : self.__PrivateShop_PriceList,

 

Add on

 
"InputStringEnd" : self.ItemRemoveGetInputOff,






New quest :

 

quest borrar_items begin
	state start begin
		
		when login begin
			cmdchat("BORRAR QID|"..q.getcurrentquestindex())
		end
		
		when button or info begin
			cmdchat("BORRAR INPUT|1")
			local shang = split(input(cmdchat("BORRAR SEND|")), "|")
			cmdchat("BORRAR INPUT|0")
			
			if shang[1] == "BORRAR" then
				borrar_items.Borrar(tonumber(shang[2]), tonumber(shang[3]))
			end
		end
		
		function Borrar(slot, vnum)
			item.select_cell(slot)
			local item_vnum, item_count, item_id = item.get_vnum(), item.get_count(), item.get_id()
			item.remove_stack()
			cmdchat("InputStringEnd")
		end
	end
end

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

I still have the same problem whit the new window, and I put the new quest :)

 

game.py

    def OpenQuestWindow(self, skin, idx):

Function all change:

 

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		elif constInfo.INPUT == 1:
			return
		else:
			self.interface.OpenQuestWindow(skin, idx)

 

  • Love 1
Link to comment
Share on other sites

RIDEAS I have a big problem I put the last function

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		elif constInfo.INPUT == 1:
			return
		else:
			self.interface.OpenQuestWindow(skin, idx)

And now Ignore all the quest I intent to open for example the change kingndom and dont open me quest..

1002 20:38:38193 :: AttributeError
1002 20:38:38193 :: : 
1002 20:38:38193 :: 'module' object has no attribute 'INPUT_IGNORE'
1002 20:38:38194 :: 

1002 20:38:44487 :: Traceback (most recent call last):

1002 20:38:44488 ::   File "game.py", line 717, in OpenQuestWindow

Link to comment
Share on other sites

  • 3 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.