• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

New shopwindow

Syntax

Developer
Joined
Oct 10, 2007
Messages
2,890
Reaction score
458
Location
Texas
hm i'm trying to add free items to shop window but it does not register cost values below 1...any ideas?
 
Its actually cant by changed, becouse if you send something to client, which have buyPrice < 1 or sellPrice < 1 then its just not showed :<

But we can make new solution : )
Eq. If you will set price to 666 - item will be free.

You can change it in data/npc/lib/npcsystem/modules.lua
in function:
Code:
function ShopModule:callbackOnBuy(cid, itemid, subType, amount)

Change:
Code:
		if(getPlayerMoney(cid) < amount*self.npcHandler.shopItems[itemid].buyPrice) then
			local msg = self.npcHandler:getMessage(MESSAGE_NEEDMOREMONEY)
			msg = self.npcHandler:parseMessage(msg, parseInfo)
			selfSay(msg, cid)
			return false
		end

To:
Code:
		if(self.npcHandler.shopItems[itemid].buyPrice ~= 666) then		
			if(getPlayerMoney(cid) < amount*self.npcHandler.shopItems[itemid].buyPrice) then
				local msg = self.npcHandler:getMessage(MESSAGE_NEEDMOREMONEY)
				msg = self.npcHandler:parseMessage(msg, parseInfo)
				selfSay(msg, cid)
				return false
			end
		end

Change:
Code:
		if(i > 0) then
			doPlayerRemoveMoney(cid, i*self.npcHandler.shopItems[itemid].buyPrice)
			return true
		end
To:
Code:
			if(i > 0) then
				if(self.npcHandler.shopItems[itemid].buyPrice ~= 666) then
					doPlayerRemoveMoney(cid, i*self.npcHandler.shopItems[itemid].buyPrice)
				end
				return true
			end

And,:
Code:
		doPlayerRemoveMoney(cid, amount*self.npcHandler.shopItems[itemid].buyPrice)
			self.npcHandler.talkStart[cid] = os.time()
		return true
To:
Code:
			if(self.npcHandler.shopItems[itemid].buyPrice ~= 666) then
				doPlayerRemoveMoney(cid, amount*self.npcHandler.shopItems[itemid].buyPrice)
			end
				self.npcHandler.talkStart[cid] = os.time()

As price you'll set 666. You can change of course this value if you need it for something else :)

Example: (Free money from NPC :D)
Code:
shopModule:addBuyableItem({'crystal coin'},           2160,   666,  1, 'crystal coin')
 
very good idea. rep++ and this will help alot. i really wonder why i didnt think of that. oh and if you want, you can be first to test the beta form of my new server. im sending a pm to everyone that helps me on it.

EDIT : btw, erm how about making containers of items show up in the shopwindow?
 
very good idea. rep++ and this will help alot. i really wonder why i didnt think of that. oh and if you want, you can be first to test the beta form of my new server. im sending a pm to everyone that helps me on it.

EDIT : btw, erm how about making containers of items show up in the shopwindow?

Containers of items in shopwindow?
Talaturen said that was impossible.
 
i just made it so you can buy items that once you click on them it gives you the bp of items, ghetto but efficient
 
Back
Top