• 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!

Banshee Quest Reward problem!

Kaywin

Lord of War WoW/Tibia 2D
Joined
Oct 24, 2008
Messages
541
Reaction score
6
Location
SwedeN
Hey OTland members I got a easy problem for many, but a very difficult one for myself. When I enter the Banshee Quest room and click on the chest, I don't get any reward, and no text appears you can just click nothing is happening, I found a script and I post it here maybe someone can help me with it?

[Rep will be giving as always!]

100x platinum coins!

Code:
function onUse(cid, item, frompos, item2, topos)


	if item.uid == 60068 then
		if getPlayerStorageValue(cid,60068) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found 100 Platinum Coins.")
			doPlayerAddItem(cid,2152,100)
			setPlayerStorageValue(cid,60068,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

Boots of haste!

Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == 60063 then
		if getPlayerStorageValue(cid,60063) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a pair of boots of haste.")
			doPlayerAddItem(cid,2195,1)
			setPlayerStorageValue(cid,60063,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

Giant Sword!

Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == 60064 then
		if getPlayerStorageValue(cid,60064) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a giant sword.")
			doPlayerAddItem(cid,2393,1)
			setPlayerStorageValue(cid,60064,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

Stealth Ring!

Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == 60066 then
		if getPlayerStorageValue(cid,60066) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a stealth ring.")
			doPlayerAddItem(cid,2165,1)
			setPlayerStorageValue(cid,60066,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

Stone Skin Amulet!

Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == 60067 then
		if getPlayerStorageValue(cid,60067) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a stone skin amulet.")
			doPlayerAddItem(cid,2197,1)
			setPlayerStorageValue(cid,60067,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

Tower Shield!

Code:
function onUse(cid, item, frompos, item2, topos)


	if item.uid == 60065 then
		if getPlayerStorageValue(cid,60065) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a tower shield.")
			doPlayerAddItem(cid,2528,1)
			setPlayerStorageValue(cid,60065,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end
 
There isint script problem mayby you forgot to wrote in actions.xml :"D



I don't think so check this out,

Actions!

Code:
 <action uniqueid="50000" event="script" value="banshee/boh.lua"/> -- Boots of Haste
		<action uniqueid="50001" event="script" value="banshee/giant sword.lua"/> -- Giant Sword
		<action uniqueid="50002" event="script" value="banshee/tower shield.lua"/> -- Tower Shield
		<action uniqueid="50003" event="script" value="banshee/stealth ring.lua"/> -- stealth ring
		<action uniqueid="50004" event="script" value="banshee/stone skin amulet.lua"/> -- stone skin amulet
		<action uniqueid="50005" event="script" value="banshee/100 Platinum Coins.lua"/> -- 100 Platinum Coins
 
On the Platinum Coins reward:

XML file:
Code:
<action uniqueid="50005" event="script" value="banshee/100 Platinum Coins.lua"/> -- 100 Platinum Coins


Lua file:
Code:
if item.uid == 60068 then

This part indicates that the script will only fully execute if the item used has the uniqueID 60068.

In your actions.xml you've specified that the script will be executed when the user "uses" an item with the uniqueID 50005.

So in essence your server does the following:

1. User clicks item with uniqueID 50005.
2. Server goes "Oh wait this uniqueID is specified in the actions.xml!".
3. Server executes the script 100 Platinum Coins.lua
4. Lua script checks if the items Unique ID is 60068.
5. The script notices that the items Unique ID is NOT 60068, but rather 50005.
6. The script skips right to the end: "return TRUE".
7. Nothing more happens until the player clicks the chest (or whatever has Unique ID 50005) again.
 
Easy solution: Remove red lines in every file
Code:
function onUse(cid, item, frompos, item2, topos)


[COLOR="Red"]	if item.uid == 60068 then[/COLOR]
		if getPlayerStorageValue(cid,60068) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found 100 Platinum Coins.")
			doPlayerAddItem(cid,2152,100)
			setPlayerStorageValue(cid,60068,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
[COLOR="Red"]	end[/COLOR]
	return TRUE
end
 
Change all files so that they are like this.

boh.lua
Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == [COLOR="DarkGreen"][B]50000[/B][/COLOR] then
		if getPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50000[/B][/COLOR]) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a pair of boots of haste.")
			doPlayerAddItem(cid,2195,1)
			setPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50000[/B][/COLOR],1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

giant sword.lua
Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == [COLOR="DarkGreen"][B]50001[/B][/COLOR] then
		if getPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50001[/B][/COLOR]) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a giant sword.")
			doPlayerAddItem(cid,2393,1)
			setPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50001[/B][/COLOR],1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

tower shield.lua
Code:
function onUse(cid, item, frompos, item2, topos)


	if item.uid == [COLOR="DarkGreen"][B]50002[/B][/COLOR] then
		if getPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50002[/B][/COLOR]) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a tower shield.")
			doPlayerAddItem(cid,2528,1)
			setPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50002[/B][/COLOR],1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

stealth ring.lua
Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == [COLOR="DarkGreen"][B]50003[/B][/COLOR] then
		if getPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50003[/B][/COLOR]) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a stealth ring.")
			doPlayerAddItem(cid,2165,1)
			setPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50003[/B][/COLOR],1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

stone skin amulet.lua
Code:
 function onUse(cid, item, frompos, item2, topos)


	if item.uid == [COLOR="DarkGreen"][B]50004[/B][/COLOR] then
		if getPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50004[/B][/COLOR]) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a stone skin amulet.")
			doPlayerAddItem(cid,2197,1)
			setPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50004[/B][/COLOR],1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

100 Platinum Coins.lua
Code:
function onUse(cid, item, frompos, item2, topos)


	if item.uid == [COLOR="DarkGreen"][B]50005[/B][/COLOR] then
		if getPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50005[/B][/COLOR]) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found 100 Platinum Coins.")
			doPlayerAddItem(cid,2152,100)
			setPlayerStorageValue(cid,[COLOR="DarkGreen"][B]50005[/B][/COLOR],1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

Now the storage ID+unique id works fine, just copy and paste these into each file ;)
 
Easy solution: Remove red lines in every file
Code:
function onUse(cid, item, frompos, item2, topos)


[COLOR="Red"]	if item.uid == 60068 then[/COLOR]
		if getPlayerStorageValue(cid,60068) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found 100 Platinum Coins.")
			doPlayerAddItem(cid,2152,100)
			setPlayerStorageValue(cid,60068,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
[COLOR="Red"]	end[/COLOR]
	return TRUE
end

Thank you bro! You get my rep!
 
Back
Top