• 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 resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Banshee chests 0.2.5

Erikas Kontenis

Board Moderator
Staff member
Board Moderator
Joined
Jul 3, 2009
Messages
1,893
Reaction score
618
Location
Lithuania
Hello ;) I Release mine banshee quest script... the point is im just learning lua and etc :D and giving everything what creat for us :) Banshee Chests... its should by usefull for lazy guys :P

LUA:
-- banshee chests Scripted By Apsivaflines

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

   	if item.uid == 3567 then
   		queststatus = getPlayerStorageValue(cid,6112)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Boots Of Haste.")
   			doPlayerAddItem(cid,2195,1)
   			setPlayerStorageValue(cid,6112,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7895 then
   		queststatus = getPlayerStorageValue(cid,6212)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Giant Sword.")
   			doPlayerAddItem(cid,2393,1)
   			setPlayerStorageValue(cid,6212,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
         elseif item.uid == 4168 then
   		queststatus = getPlayerStorageValue(cid,6312)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Tower Shield.")
   			doPlayerAddItem(cid,2528,1)
   			setPlayerStorageValue(cid,6312,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
         elseif item.uid == 6145 then
   		queststatus = getPlayerStorageValue(cid,6412)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Stealth Ring.")
   			doPlayerAddItem(cid,2165,1)
   			setPlayerStorageValue(cid,6412,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 4673 then
   		queststatus = getPlayerStorageValue(cid,6512)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Stone Skin Amulet.")
   			doPlayerAddItem(cid,2179,1)
   			setPlayerStorageValue(cid,6512,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 4691 then
   		queststatus = getPlayerStorageValue(cid,6612)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found 100 Platinum Coins.")
   			doPlayerAddItem(cid,2152,100)
   			setPlayerStorageValue(cid,6612,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

And Xml Code.

Code:
<!-- Banshee -->
	<action uniqueid="3567" script="reward.lua" />
	<action uniqueid="7895" script="reward.lua" />
	<action uniqueid="4168" script="reward.lua" />
	<action uniqueid="6145" script="reward.lua" />
	<action uniqueid="4673" script="reward.lua" />
	<action uniqueid="4691" script="reward.lua" />

if wanna you can rep me ;)
 
I would still prefer the quest system that comes on TFS 0.3.5...
But you are just starting, so good one :)

Try to read tutorials and improve your ideas.
 
I would still prefer the quest system that comes on TFS 0.3.5...
But you are just starting, so good one :)

Try to read tutorials and improve your ideas.

0.3.5 In That Distro Only Crashes I pure saying for everyone to start with 0.2~ Its Very Stable Servers... but less feutures... so ur choose of getting crashes or having less feutres but stable server...
 
You can make this with loop "for" :)
It would work better with array, no need for using for.

Just made this:
Code:
local array = {
	[3567] = {6112, 2195},
	[7895] = {6212, 2393},
	[4168] = {6312, 2528},
	[6145] = {6412, 2165},
	[4673] = {6512, 2179, 5},
	[4691] = {6612, 2152, 100}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if array[item.uid] then
		if getPlayerStorageValue(cid, array[item.uid][1]) < 1 then
			local _item = doCreateItemEx(array[item.uid][2], array[item.uid][3] or 1)
			if doPlayerAddItemEx(cid, _item, FALSE) ~= RETURNVALUE_NOERROR then
				local article = getItemDescriptions(array[item.uid][2]).article
				local a_ret = ((isStackable(array[item.uid][2]) == TRUE and array[item.uid][3]) and array[item.uid][3] or (article ~= "" and article .. " " or ""))
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerFreeCap(cid) < getItemWeight(_item) and "You have found " .. a_ret .. "" .. ((not(isStackable(array[item.uid][2]) == TRUE and array[item.uid][3])) and getItemDescriptions(array[item.uid][2]).plural or getItemName(array[item.uid][2])) .. ". Weighing " .. getItemWeight(array[item.uid][2]) .. " " .. (array[item.uid][3] > 1 and "they are" or "it is") .. " too heavy." or "You have found " .. a_ret .. "" .. ((not(isStackable(array[item.uid][2]) == TRUE and array[item.uid][3])) and getItemDescriptions(array[item.uid][2]).plural or getItemName(array[item.uid][2])) .. ", but you have no room to take " .. (array[item.uid][3] > 1 and "them" or "it") .. ".")
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. a_ret .. "" .. ((not(isStackable(array[item.uid][2]) == TRUE and array[item.uid][3])) and getItemDescriptions(array[item.uid][2]).plural or getItemName(array[item.uid][2])) .. ".")
				setPlayerStorageValue(cid, array[item.uid][1], 1)
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The " .. getItemName(item.itemid) .. " is empty.")
		end
		return TRUE
	end
	return FALSE
end
 
Last edited:
Back
Top