Jump to content

icaroquin

Inactive Member
  • Posts

    23
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by icaroquin

  1. My uishop.py

    import net
    import player
    import item
    import snd
    import shop
    import net
    import wndMgr
    import app
    import chat
    
    import ui
    import uiCommon
    import mouseModule
    import localeInfo
    import constInfo
    
    ###################################################################################################
    ## Shop
    class ShopDialog(ui.ScriptWindow):
    
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    		self.tooltipItem = 0
    		self.xShopStart = 0
    		self.yShopStart = 0
    		self.questionDialog = None
    		self.popup = None
    		self.itemBuyQuestionDialog = None
    		self.shopPrice = [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,0,0,0,0,0,0,0,0]
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    	
    	def __GetRealIndex(self, i):
    		return self.tabIdx * shop.SHOP_SLOT_COUNT + i
    	
    	def Refresh(self):
    		getItemID=shop.GetItemID
    		getItemCount=shop.GetItemCount
    		setItemID=self.itemSlotWindow.SetItemSlot
    		for i in xrange(shop.SHOP_SLOT_COUNT):
    			idx = self.__GetRealIndex(i)
    			itemCount = getItemCount(idx)
    			if itemCount <= 1:
    				itemCount = 0
    			setItemID(i, getItemID(idx), itemCount)
    
    		wndMgr.RefreshSlot(self.itemSlotWindow.GetWindowHandle())
    
    	def SetShopPrice(self, arg):
    		slots = arg.split("|")
    		for i in xrange(40):
    			self.shopPrice[i] = int(slots[i])
    
    	def SetItemData(self, pos, itemID, itemCount, itemPrice):
    		shop.SetItemData(pos, itemID, itemCount, itemPrice)
    
    	def LoadDialog(self):
    		try:
    			PythonScriptLoader = ui.PythonScriptLoader()
    			PythonScriptLoader.LoadScriptFile(self, "UIScript/shopdialog.py")
    		except:
    			import exception
    			exception.Abort("ShopDialog.LoadDialog.LoadObject")
    
    		smallTab1 = None
    		smallTab2 = None
    		smallTab3 = None
    		middleTab1 = None
    		middleTab2 = None
    		
    		try:
    			GetObject = self.GetChild
    			self.itemSlotWindow = GetObject("ItemSlot")
    			self.btnBuy = GetObject("BuyButton")
    			self.btnSell = GetObject("SellButton")
    			self.btnClose = GetObject("CloseButton")
    			self.titleBar = GetObject("TitleBar")
    			middleTab1 = GetObject("MiddleTab1")
    			middleTab2 = GetObject("MiddleTab2")
    			smallTab1 = GetObject("SmallTab1")
    			smallTab2 = GetObject("SmallTab2")
    			smallTab3 = GetObject("SmallTab3")
    		except:
    			import exception
    			exception.Abort("ShopDialog.LoadDialog.BindObject")
    
    		self.itemSlotWindow.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
    		self.itemSlotWindow.SAFE_SetButtonEvent("LEFT", "EMPTY", self.SelectEmptySlot)
    		self.itemSlotWindow.SAFE_SetButtonEvent("LEFT", "EXIST", self.SelectItemSlot)
    		self.itemSlotWindow.SAFE_SetButtonEvent("RIGHT", "EXIST", self.UnselectItemSlot)
    
    		self.itemSlotWindow.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
    		self.itemSlotWindow.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
    
    		self.btnBuy.SetToggleUpEvent(ui.__mem_func__(self.CancelShopping))
    		self.btnBuy.SetToggleDownEvent(ui.__mem_func__(self.OnBuy))
    
    		self.btnSell.SetToggleUpEvent(ui.__mem_func__(self.CancelShopping))
    		self.btnSell.SetToggleDownEvent(ui.__mem_func__(self.OnSell))
    
    		self.btnClose.SetEvent(ui.__mem_func__(self.AskClosePrivateShop))
    
    		self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
    
    		self.smallRadioButtonGroup = ui.RadioButtonGroup.Create([[smallTab1, lambda : self.OnClickTabButton(0), None], [smallTab2, lambda : self.OnClickTabButton(1), None], [smallTab3, lambda : self.OnClickTabButton(2), None]])
    		self.middleRadioButtonGroup = ui.RadioButtonGroup.Create([[middleTab1, lambda : self.OnClickTabButton(0), None], [middleTab2, lambda : self.OnClickTabButton(1), None]])
    
    		self.__HideMiddleTabs()
    		self.__HideSmallTabs()
    		
    		self.tabIdx = 0
    		self.coinType = shop.SHOP_COIN_TYPE_GOLD
    		
    		self.Refresh()
    	
    	def __ShowBuySellButton(self):
    		self.btnBuy.Show()
    		self.btnSell.Show()
    		
    	def __ShowMiddleTabs(self):
    		self.middleRadioButtonGroup.Show()
    	
    	def __ShowSmallTabs(self):
    		self.smallRadioButtonGroup.Show()
    	
    	def __HideBuySellButton(self):
    		self.btnBuy.Hide()
    		self.btnSell.Hide()
    	
    	def __HideMiddleTabs(self):
    		self.middleRadioButtonGroup.Hide()
    	
    	def __HideSmallTabs(self):
    		self.smallRadioButtonGroup.Hide()
    		
    	def __SetTabNames(self):
    		if shop.GetTabCount() == 2:
    			self.middleRadioButtonGroup.SetText(0, shop.GetTabName(0))
    			self.middleRadioButtonGroup.SetText(1, shop.GetTabName(1))
    		elif shop.GetTabCount() == 3:
    			self.smallRadioButtonGroup.SetText(0, shop.GetTabName(0))
    			self.smallRadioButtonGroup.SetText(1, shop.GetTabName(1))
    			self.smallRadioButtonGroup.SetText(2, shop.GetTabName(2))
    
    	def Destroy(self):
    		self.shopPrice = None
    		constInfo.IsItemShop = 0
    		
    		self.Close()
    		self.ClearDictionary()
    
    		self.tooltipItem = 0
    		self.itemSlotWindow = 0
    		self.btnBuy = 0
    		self.btnSell = 0
    		self.btnClose = 0
    		self.titleBar = 0
    		self.questionDialog = None
    		self.popup = None
    
    	def Open(self, vid):
    
    		isPrivateShop = False
    		isMainPlayerPrivateShop = False
    
    		import chr
    		if chr.IsNPC(vid):
    			isPrivateShop = False
    		else:
    			isPrivateShop = True
    
    		if player.IsMainCharacterIndex(vid):
    
    			isMainPlayerPrivateShop = True
    
    			self.btnBuy.Hide()
    			self.btnSell.Hide()
    			self.btnClose.Show()
    
    		else:
    
    			isMainPlayerPrivateShop = False
    
    			self.btnBuy.Show()
    			self.btnSell.Show()
    			self.btnClose.Hide()
    
    		shop.Open(isPrivateShop, isMainPlayerPrivateShop)
    
    		self.tabIdx = 0
    
    		if isPrivateShop:
    			self.__HideMiddleTabs()
    			self.__HideSmallTabs()
    		else:
    			if shop.GetTabCount() == 1:
    				self.__ShowBuySellButton()
    				self.__HideMiddleTabs()
    				self.__HideSmallTabs()
    			elif shop.GetTabCount() == 2:
    				self.__HideBuySellButton()
    				self.__ShowMiddleTabs()
    				self.__HideSmallTabs()
    				self.__SetTabNames()
    				self.middleRadioButtonGroup.OnClick(0)
    			elif shop.GetTabCount() == 3:
    				self.__HideBuySellButton()
    				self.__HideMiddleTabs()
    				self.__ShowSmallTabs()
    				self.__SetTabNames()
    				self.middleRadioButtonGroup.OnClick(1)
    
    		self.Refresh()
    		self.SetTop()
    		
    		self.Show()
    
    		(self.xShopStart, self.yShopStart, z) = player.GetMainCharacterPosition()
    
    	def Close(self):
    		self.shopPrice = [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,0,0,0,0,0,0,0,0]
    		constInfo.IsItemShop = 0
    		if self.itemBuyQuestionDialog:
    			self.itemBuyQuestionDialog.Close()
    			self.itemBuyQuestionDialog = None		
    			constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
    		if self.questionDialog:
    			self.OnCloseQuestionDialog()
    		shop.Close()
    		net.SendShopEndPacket()
    		self.CancelShopping()
    		self.tooltipItem.HideToolTip()
    		self.Hide()
    
    	def GetIndexFromSlotPos(self, slotPos):
    		return self.tabIdx * shop.SHOP_SLOT_COUNT + slotPos
    		
    	def OnClickTabButton(self, idx):
    		self.tabIdx = idx
    		self.Refresh()
    		
    	def AskClosePrivateShop(self):
    		questionDialog = uiCommon.QuestionDialog()
    		questionDialog.SetText(localeInfo.PRIVATE_SHOP_CLOSE_QUESTION)
    		questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnClosePrivateShop))
    		questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
    		questionDialog.Open()
    		self.questionDialog = questionDialog
    
    		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
    
    		return True
    
    	def OnClosePrivateShop(self):
    		net.SendChatPacket("/close_shop")
    		self.OnCloseQuestionDialog()
    		return True
    
    	def OnPressEscapeKey(self):
    		self.Close()
    		return True
    
    	def OnPressExitKey(self):
    		self.Close()
    		return True
    
    	def OnBuy(self):
    		chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
    		app.SetCursor(app.BUY)
    		self.btnSell.SetUp()
    
    	def OnSell(self):
    		chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_SELL_INFO)
    		app.SetCursor(app.SELL)
    		self.btnBuy.SetUp()
    
    	def CancelShopping(self):
    		self.btnBuy.SetUp()
    		self.btnSell.SetUp()
    		app.SetCursor(app.NORMAL)
    
    	def __OnClosePopupDialog(self):
    		self.pop = None
    		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
    
    	## 용혼석 팔리는 기능 추가.
    	def SellAttachedItem(self):
    
    		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 player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
    
    			if localeInfo.IsBRAZIL():
    				itemIndex = player.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 = player.INVENTORY
    
    			if localeInfo.IsBRAZIL() == 0:
    				if player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
    					itemtype = player.DRAGON_SOUL_INVENTORY
    			
    			if player.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()
    
    	def OnSellItem(self, slotPos, count, itemtype):
    		net.SendShopSellPacketNew(slotPos, count, itemtype)
    		snd.PlaySound("sound/ui/money.wav")
    		self.OnCloseQuestionDialog()
    
    	def NieMamPP(self):
    		self.popup = uiCommon.PopupDialog()
    		self.popup.SetText("Voce nao tem AP suficientes.")
    		self.popup.SetAcceptEvent(self.__OnClosePopupDialog)
    		self.popup.Open()
    
    	def OnCloseQuestionDialog(self):
    		if not self.questionDialog:
    			return
    			
    		self.questionDialog.Close()
    		self.questionDialog = None
    		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
    
    	def SelectEmptySlot(self, selectedSlotPos):
    
    		isAttached = mouseModule.mouseController.isAttached()
    		if isAttached:
    			self.SellAttachedItem()
    
    	def UnselectItemSlot(self, selectedSlotPos):
    		if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
    			return
    		if shop.IsPrivateShop():
    			self.AskBuyItem(selectedSlotPos)
    		else:
    			if constInfo.IsItemShop == 1:
    				self.BuyFromIS(selectedSlotPos)
    			else:
    				net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos))
    
    	def SelectItemSlot(self, selectedSlotPos):
    		if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
    			return
    
    		isAttached = mouseModule.mouseController.isAttached()
    		selectedSlotPos = self.__GetRealIndex(selectedSlotPos)
    		if isAttached:
    			self.SellAttachedItem()
    
    		else:
    
    			if True == shop.IsMainPlayerPrivateShop():
    				return
    
    			curCursorNum = app.GetCursor()
    			if app.BUY == curCursorNum:
    				self.AskBuyItem(selectedSlotPos)
    
    			elif app.SELL == curCursorNum:
    				chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_SELL_INFO)
    
    			else:
    				selectedItemID = shop.GetItemID(selectedSlotPos)
    				itemCount = shop.GetItemCount(selectedSlotPos)
    
    				type = player.SLOT_TYPE_SHOP
    				if shop.IsPrivateShop():
    					type = player.SLOT_TYPE_PRIVATE_SHOP
    
    				mouseModule.mouseController.AttachObject(self, type, selectedSlotPos, selectedItemID, itemCount)
    				mouseModule.mouseController.SetCallBack("INVENTORY", ui.__mem_func__(self.DropToInventory))
    				snd.PlaySound("sound/ui/pick.wav")
    
    	def DropToInventory(self):
    		attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
    		self.AskBuyItem(attachedSlotPos, constInfo.IsItemShop)
    
    	def BuyFromIS(self, slotPos, type=0):
    		constInfo.INPUT_DATA = slotPos
    		event.QuestButtonClick(constInfo.IS_QUEST)
    		if type == 1:
    			self.itemBuyQuestionDialog.Close()
    			self.itemBuyQuestionDialog = None
    
    	def AskBuyFromIS(self, slotPos):
    		itemIndex = shop.GetItemID(slotPos)
    		itemPrice = shop.GetItemPrice(slotPos)
    		itemCount = shop.GetItemCount(slotPos)
    
    		item.SelectItem(itemIndex)
    		itemName = item.GetItemName()
    
    		itemBuyQuestionDialog = uiCommon.QuestionDialog()
    		itemBuyQuestionDialog.SetText("Voce quer comprar " + itemName + " com " + (localeInfo.NumberToMoneyString(self.shopPrice[slotPos])[:-5]) + " AP?")
    		itemBuyQuestionDialog.SetAcceptEvent(lambda arg=True: self.BuyFromIS(slotPos, 1))
    		itemBuyQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerBuyItem(arg, type))
    		itemBuyQuestionDialog.Open()
    		itemBuyQuestionDialog.pos = slotPos
    		self.itemBuyQuestionDialog = itemBuyQuestionDialog
    
    	def AskBuyItem(self, slotPos, type=0):
    		if type == 1:
    			self.AskBuyFromIS(slotPos)
    			return
    		slotPos = self.__GetRealIndex(slotPos)
    		
    		itemIndex = shop.GetItemID(slotPos)
    		itemPrice = shop.GetItemPrice(slotPos)
    		itemCount = shop.GetItemCount(slotPos)
    
    		item.SelectItem(itemIndex)
    		itemName = item.GetItemName()
    
    		itemBuyQuestionDialog = uiCommon.QuestionDialog()
    		itemBuyQuestionDialog.SetText(localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, localeInfo.NumberToMoneyString(itemPrice)))
    		itemBuyQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerBuyItem(arg))
    		itemBuyQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerBuyItem(arg))
    		itemBuyQuestionDialog.Open()
    		itemBuyQuestionDialog.pos = slotPos
    		self.itemBuyQuestionDialog = itemBuyQuestionDialog
    		
    		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
    
    	def AnswerBuyItem(self, flag):
    
    		if flag:
    			pos = self.itemBuyQuestionDialog.pos
    			net.SendShopBuyPacket(pos)
    
    		self.itemBuyQuestionDialog.Close()
    		self.itemBuyQuestionDialog = None
    		
    		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
    
    	def SetItemToolTip(self, tooltipItem):
    		self.tooltipItem = tooltipItem
    
    	def OverInItem(self, slotIndex):
    		slotIndex = self.__GetRealIndex(slotIndex)
    		if mouseModule.mouseController.isAttached():
    			return
    
    		if 0 != self.tooltipItem:
    			if constInfo.IsItemShop == 0:
    				self.tooltipItem.SetShopItem(slotIndex, 0, 0)
    			else:
    				self.tooltipItem.SetShopItem(slotIndex, self.shopPrice[slotIndex], 1)
    
    	def OverOutItem(self):
    		if 0 != self.tooltipItem:
    			self.tooltipItem.HideToolTip()
    
    	def OnUpdate(self):
    
    		USE_SHOP_LIMIT_RANGE = 1000
    
    		(x, y, z) = player.GetMainCharacterPosition()
    		if abs(x - self.xShopStart) > USE_SHOP_LIMIT_RANGE or abs(y - self.yShopStart) > USE_SHOP_LIMIT_RANGE:
    			self.Close()
    
    
    class MallPageDialog(ui.ScriptWindow):
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def Destroy(self):
    		self.ClearDictionary()
    
    	def Open(self):
    		scriptLoader = ui.PythonScriptLoader()
    		scriptLoader.LoadScriptFile(self, "uiscript/mallpagedialog.py")
    
    		self.GetChild("titlebar").SetCloseEvent(ui.__mem_func__(self.Close))
    		
    		(x, y)=self.GetGlobalPosition()
    		x+=10
    		y+=30
    		
    		MALL_PAGE_WIDTH = 600
    		MALL_PAGE_HEIGHT = 480
    		
    		app.ShowWebPage(
    			"http://metin2.co.kr/08_mall/game_mall/login_fail.htm", 
    			(x, y, x+MALL_PAGE_WIDTH, y+MALL_PAGE_HEIGHT))
    
    		self.Lock()
    		self.Show()
    		
    	def Close(self):			
    		app.HideWebPage()
    		self.Unlock()
    		self.Hide()
    		
    	def OnPressEscapeKey(self):
    		self.Close()
    		return True
    
    

    syserr:

    1205 01:20:08069 :: Traceback (most recent call last):
    
    1205 01:20:08069 ::   File "game.py", line 2748, in BINARY_ServerCommand_Run
    
    1205 01:20:08069 ::   File "stringCommander.py", line 63, in Run
    
    1205 01:20:08069 ::   File "stringCommander.py", line 31, in __call__
    
    1205 01:20:08069 ::   File "stringCommander.py", line 20, in __call__
    
    1205 01:20:08070 ::   File "game.py", line 2722, in SetIsPrice
    
    1205 01:20:08070 ::   File "uiShop.py", line 53, in SetShopPrice
    
    1205 01:20:08070 :: IndexError
    1205 01:20:08070 :: : 
    1205 01:20:08070 :: list index out of range
    1205 01:20:08070 :: 
    
    1205 01:20:08070 :: Unknown Server Command SetPrice 100|200|200|200|50|300|200|150|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 | SetPrice
    
    
    1205 01:20:13602 :: Traceback (most recent call last):
    
    1205 01:20:13602 ::   File "ui.py", line 1471, in OnUnselectItemSlot
    
    1205 01:20:13602 ::   File "ui.py", line 88, in __call__
    
    1205 01:20:13603 ::   File "ui.py", line 79, in __call__
    
    1205 01:20:13603 ::   File "uiShop.py", line 383, in UnselectItemSlot
    
    1205 01:20:13603 ::   File "uiShop.py", line 426, in BuyFromIS
    
    1205 01:20:13603 :: NameError
    1205 01:20:13603 :: : 
    1205 01:20:13603 :: global name 'event' is not defined
    1205 01:20:13603 :: 
    
     
     
    link the topic

     

    help :D

  2. quests:

    quest pet_system_send_back begin
    	state start begin
    		when login begin cmdchat("SetPetSendAwayButtonIndex "..q.getcurrentquestindex()) end
    		when info or button begin
    			local v, pet_ = pc.getf("pet_system", "pet_spawn_id"), pc.getf("pet_system", "pet_spawn")
    			local effect = pet_info[v][3]
    			local az = "d:ymir workeffectetcappear_dienpc2_appear.mse"
    			if pet_ == nil or v == nil then return end
    			if effect != 0 then pet.spawn_effect (pet_, az) end
    			pet.remove_bonus()
    			pet.unsummon(pet_)
    			pc.setf("pet_system","pet_spawn",0) pc.setf("pet_system","pet_spawn_id",0) 
    			cleartimer("refresh_pet_stats")
    		end
    	end
    end
    
    
    quest pet_system_slots_button begin
    	state start begin
    		when login begin cmdchat("SetPetClearItemSlotButtonIndex "..q.getcurrentquestindex()) end
    		when info or button begin
    			local pet,it = pc.getf("pet_system","pet_spawn"),pc.getqf("type_item")
    			cmdchat("GetInputStringStart")
    			local btype = input(cmdchat("GetPetClearSlot"))
    			cmdchat("GetInputStringEnd")
    			pc.setqf("type_item", btype)
    			local b = {[0]="SetPetHead",[1]="SetPetNeck",[2]="SetPetFoot"}
    			cmdchat(b[it].." 0")
    			local k = pc.getf("pet_system", b[it].."_"..pet)
    			if k != 0 then
    				pc.give_item2(k,1)
    				affect.remove_collect(item_info[k][2], item_info[k][3], 60*60*24*360*60)
    				pc.setf("pet_system", b[it].."_"..pet, 0)
    				pc.setqf("type_item", -1)
    			end
    		end
    	end
    end
    

    ch1 syserr:

    SYSERR: Nov 26 14:46:14 :: RunState: LUA_ERROR: [string "pet_system_send_back"]:2: attempt to index field `?' (a nil value)
    SYSERR: Nov 26 14:46:14 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_send_back.start click
    SYSERR: Nov 26 14:46:18 :: RunState: LUA_ERROR: [string "pet_system_send_back"]:2: attempt to index field `?' (a nil value)
    SYSERR: Nov 26 14:46:18 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_send_back.start click
    SYSERR: Nov 26 14:46:18 :: RunState: LUA_ERROR: [string "pet_system_send_back"]:2: attempt to index field `?' (a nil value)
    SYSERR: Nov 26 14:46:18 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_send_back.start click
    SYSERR: Nov 26 14:46:19 :: RunState: LUA_ERROR: [string "pet_system_send_back"]:2: attempt to index field `?' (a nil value)
    SYSERR: Nov 26 14:46:19 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_send_back.start click
    SYSERR: Nov 26 14:46:19 :: RunState: LUA_ERROR: [string "pet_system_send_back"]:2: attempt to index field `?' (a nil value)
    SYSERR: Nov 26 14:46:19 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_send_back.start click
    SYSERR: Nov 26 14:46:36 :: RunState: LUA_ERROR: [string "pet_system_slots_button"]:7: attempt to concatenate field `?' (a nil value)
    SYSERR: Nov 26 14:46:36 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_slots_button.start click
    SYSERR: Nov 26 14:46:41 :: RunState: LUA_ERROR: [string "pet_system_slots_button"]:7: attempt to concatenate field `?' (a nil value)
    SYSERR: Nov 26 14:46:41 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system_slots_button.start click
    
    • Love 1
  3. Help me please!!!!

    		function insert_item(cell,slot,tab)
    			item.select_cell(cell)
    			local attr = {{item.get_attr_type(0),item.attr_value(0)}, {item.get_attr_type(1),item.attr_value(1)}, {item.get_attr_type(2),item.attr_value(2)}, {item.get_attr_type(3),item.attr_value(3)},{item.get_attr_type(4),item.attr_value(4)},{item.get_attr_type(5),item.attr_value(5)},{item.get_attr_type(6),item.attr_value(6)}}
    			local socket, itemVnum, itemCount = {item.get_socket(0), item.get_socket(1), item.get_socket(2),item.get_socket(3),item.get_socket(4),item.get_socket(5)}, item.get_vnum(), item.get_count()     
    			if not guildstorage.item_can_store(itemVnum) then syschat'Dieses Item kann nicht gelagert werden.' return end
    			guildstorage.add_log(pc.get_name(),'Item','einlagern',item_name(itemVnum)..' ('..itemCount..')')
    			local guildstorage = io.open("/".."Guildstorage/"..pc.get_guild().."/storage.txt", "a+")
    			if not pc.can_warp() then return end
    			item.select(cell)
    			if item.vnum == 0 then return end
    			--if item.rem(item.get_count()) then
    			item.remove()
    			guildstorage:write(itemVnum.."#"..itemCount.."#"..(slot+120*tab).."#"..socket[1].."#"..socket[2].."#"..socket[3].."#"..socket[4].."#"..socket[5].."#"..socket[6].."#"..attr[1][1].."#"..attr[1][2].."#"..attr[2][1].."#"..attr[2][2].."#"..attr[3][1].."#"..attr[3][2].."#"..attr[4][1].."#"..attr[4][2].."#"..attr[5][1].."#"..attr[5][2].."#"..attr[6][1].."#"..attr[6][2].."#"..attr[7][1].."#"..attr[7][2].."n")
    			guildstorage:flush()
    			guildstorage:close()
    			cmdchat('GUILDSTORAGE_ADDITEMSLOT '..slot..' '..tab..' '..itemVnum..' '..itemCount..' '..socket[1]..' '..socket[2]..' '..socket[3]..' '..socket[4]..' '..socket[5]..' '..socket[6]..' '..attr[1][1]..' '..attr[1][2]..' '..attr[2][1]..' '..attr[2][2]..' '..attr[3][1]..' '..attr[3][2]..' '..attr[4][1]..' '..attr[4][2]..' '..attr[5][1]..' '..attr[5][2]..' '..attr[6][1]..' '..attr[6][2]..' '..attr[7][1]..' '..attr[7][2])
    			--else
    				--syschat("Du hast das Item nicht mehr")
    			--end
    		end
    
    

    works, but, he doubles stacked item...

     

    --if item.rem(item.get_count()) then << no works.

    help me '-'

  4. q4muc.jpg

    The quest /

    quest tombola begin
    	state start begin
    		function tablica(vnum, pozycja, pozycja2)
    			local itemy = {
    							{
    								{71001, 1},
    								{71084, 25},
    								{71085, 25},
    								{25040, 3},
    								{27992, 2},
    								{27993, 2},
    								{27994, 2},
    								{27987, 5},
    								{72002, 1},
    								{71027, 5},
    								{71028, 5},
    								{71029, 5},
    								{71030, 5},
    								{71036, 1},
    								{50008, 15},
    								{70021, 3},
    								{71001, 1},
    							},
    							{
    								{25041, 1},
    								{71084, 25},
    								{71085, 25},
    								{25040, 3},
    								{27992, 2},
    								{27993, 2},
    								{27994, 2},
    								{27987, 5},
    								{72002, 1},
    								{71027, 5},
    								{71028, 5},
    								{71029, 5},
    								{71030, 5},
    								{71036, 1},
    								{50008, 15},
    								{70021, 3},
    								{25041, 1},
    							}
    						}
    				return itemy[vnum][pozycja][pozycja2]
    			end
    				
    			
    			
    		when login begin
    			cmdchat("tombola "..q.getcurrentquestindex())
    		end
    		
    		when 9005.chat."Open Tombola" with pc.is_gm() begin
    			local losowo = number(1,2)
    			local str = " "
    			for i = 1,16 do
    				if i == 16 then
    					str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2)
    				else
    					str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2).."|"
    				end
    			end
    			cmdchat("OnPrepare "..str)
    			cmdchat("openTombola")
    			setskin(NOWINDOW)
    		end
    		
    		when info or button begin
    			local losowo = number(1,2)
    			local str = " "
    			for i = 1,16 do
    				if i == 16 then
    					str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2)
    				else
    					str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2).."|"
    				end
    			end
    			cmdchat("OnPrepare "..str)
    			if pc.get_empty_inventory_count() < 3 then
    				syschat("You do not have enough space in your inventory.")
    				return
    			end
    			cmdchat("get_input_start")
    			local czynnosc = input(cmdchat("get_input_value"))
    			cmdchat("get_input_end")
    			if czynnosc == "tombola|begin" then
    				pc.setqf("slot", number(1, 16))
    				cmdchat("OnRun "..number(2,3)*16+pc.getqf("slot").."|5")
    			elseif czynnosc == "tombola|end" then
    				syschat("Congrats! acquired "..tombola.tablica(losowo, pc.getqf("slot")+1, 2).."x "..item_name(tombola.tablica(losowo, pc.getqf("slot")+1, 1)).." as a prize at Tombola!")
    				pc.give_item2(tombola.tablica(losowo, pc.getqf("slot")+1, 1), tombola.tablica(losowo, pc.getqf("slot")+1, 2))
    			end
    		end
    	end
    end
    

    Problem: The wheel does not spin but open, does not receive item.

     

    No have syserr on client.

     

  5. When attack mobs, a mysterious disconnection occurs, do not know why, could anyone help me? There is nothing in syserr.

     

    ch1.

    syslog:

    
    
    Jun 10 21:37:00 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=57752, npc=902)
    Jun 10 21:37:01 :: DISCONNECT: Test (DESC::~DESC)
    Jun 10 21:37:01 :: SAVE: Test 482195x961755
    Jun 10 21:37:01 :: QUEST clear timer 0
    Jun 10 21:37:01 :: SYSTEM: closing socket. DESC #25

    auth

    syslog:

    
    
    Jun 10 21:17:03 :: SetRemainSecs test 0 type 2
    Jun 10 21:17:03 :: BILLING: PUSH test 63 type 2
    Jun 10 21:17:03 :: BILLING: OFF test key 113245294 ptr 0x28d80eb0
    Jun 10 21:17:04 :: FLUSH_USE_TIME: count 1

    db

    syserr:

    SYSERR: Jun 10 21:13:07 :: pid_init: 
    Start of pid: 26993
    
    SYSERR: Jun 10 21:13:07 :: Start: TABLE_POSTFIX not configured use default
    

    syslog:

    Jun 10 21:17:02 :: [     2350] return 0/0/0 async 0/0/2
    Jun 10 21:17:03 :: SetPlay off 113245294 test
    Jun 10 21:17:07 :: [     2400] return 0/0/0 async 0/0/0
    Jun 10 21:17:12 :: [     2450] return 0/0/0 async 0/0/0
    Jun 10 21:17:17 :: [     2500] return 0/0/0 async 0/0/0
    Jun 10 21:17:22 :: [     2550] return 0/0/0 async 0/0/0
    Jun 10 21:17:27 :: [     2600] return 0/0/0 async 0/0/0
    Jun 10 21:17:32 :: [     2650] return 0/0/0 async 0/0/0
    Jun 10 21:17:37 :: [     2700] return 0/0/0 async 0/0/0
    Jun 10 21:17:42 :: [     2750] return 0/0/0 async 0/0/0
    Jun 10 21:17:47 :: [     2800] return 0/0/0 async 0/0/0
    Jun 10 21:17:52 :: [     2850] return 0/0/0 async 0/0/0
    Jun 10 21:17:57 :: [     2900] return 0/0/0 async 0/0/0
    Jun 10 21:18:02 :: [     2950] return 0/0/0 async 0/0/0
    Jun 10 21:18:07 :: [     3000] return 0/0/0 async 0/0/0
    Jun 10 21:18:12 :: [     3050] return 0/0/0 async 0/0/0
    Jun 10 21:18:17 :: [     3100] return 0/0/0 async 0/0/0
    Jun 10 21:18:22 :: [     3150] return 0/0/0 async 0/0/0
    Jun 10 21:18:27 :: [     3200] return 0/0/0 async 0/0/0
    Jun 10 21:18:32 :: [     3250] return 0/0/0 async 0/0/0
    Jun 10 21:18:37 :: [     3300] return 0/0/0 async 0/0/0
    Jun 10 21:18:42 :: [     3350] return 0/0/0 async 0/0/0
    Jun 10 21:18:47 :: [     3400] return 0/0/0 async 0/0/0
    Jun 10 21:18:52 :: [     3450] return 0/0/0 async 0/0/0
    Jun 10 21:18:57 :: [     3500] return 0/0/0 async 0/0/0
    Jun 10 21:19:02 :: [     3550] return 0/0/0 async 0/0/0
    Jun 10 21:19:07 :: [     3600] return 0/0/0 async 0/0/0
    Jun 10 21:19:12 :: [     3650] return 0/0/0 async 0/0/0
    Jun 10 21:19:17 :: [     3700] return 0/0/0 async 0/0/0
    Jun 10 21:19:22 :: [     3750] return 0/0/0 async 0/0/0
    Jun 10 21:19:27 :: [     3800] return 0/0/0 async 0/0/0
    Jun 10 21:19:32 :: [     3850] return 0/0/0 async 0/0/0
    Jun 10 21:19:37 :: [     3900] return 0/0/0 async 0/0/0
    Jun 10 21:19:42 :: [     3950] return 0/0/0 async 0/0/0
    Jun 10 21:19:47 :: [     4000] return 0/0/0 async 0/0/0
    Jun 10 21:19:52 :: [     4050] return 0/0/0 async 0/0/0
    Jun 10 21:19:57 :: [     4100] return 0/0/0 async 0/0/0

    game99

    syslog:

    Jun 10 21:34:52 :: GLOBAL_TIME: Jun 10 21:34:52 time_gap 0
    Jun 10 21:35:52 :: GLOBAL_TIME: Jun 10 21:35:52 time_gap 0
    Jun 10 21:35:58 :: P2P: Login Test
    Jun 10 21:36:52 :: GLOBAL_TIME: Jun 10 21:36:52 time_gap 0
    Jun 10 21:37:01 :: P2P: Logout Test
    Jun 10 21:37:52 :: GLOBAL_TIME: Jun 10 21:37:52 time_gap 0

    sorry my bad english :D

  6.  

    This difference file is created by The Interactive Disassembler

    Max status 90, status points up to level 125 (it's the dif for status 125 reversed)

    game34083, all versions

    000307AC: 3C 83

    000307AD: A1 F8

    000307AE: 90 7C

    000307B0: 86 8E

    0003493F: A2 7D

    00088A70: 7C 59

    00093D7D: 7D 5A

    00093D98: 7D 5A

    00093DC9: 7D 5A

    00093F31: 7D 5A

    00093F4E: 7D 5A

    00093F75: 7D 5A

    00093F92: 7D 5A

    00093FC3: 7D 5A

    have fun :P not created by me.

     

    this dif is fail, this is backdoor dif reverse.

     

     

    000307AC: 3C 83

    000307AD: A1 F8
    000307AE: 90 7C
    000307B0: 86 8E

     

    sorry me bad english 

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