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

Sarcophagus' Give random loot or summon mummy

iBlue

Banned User
Joined
Feb 23, 2010
Messages
1,557
Reaction score
33
Location
Missouri
I don't need it, but it would be a nice script xD

Like you open it and if script generates a few cloths, few gp, gems, like 5% chance, or a mummy comes out.
 
did you want it do be like a quest box? with playerStorageValues?

EDIT: Well I made this one for you,

LUA:
local sarcophagus = {1417,1418,1419,1420}
local chance = 5 -- % of 100
local bag = 1987

local items = {
	{id=5909, minCount=2, maxCount=8}, -- white peice of cloth
	{id=5914, minCount=2, maxCount=8}, -- yellow peice of cloth
	{id=5913, minCount=2, maxCount=8}, -- brown peice of cloth
	{id=2148, minCount=20, maxCount=100}, -- gold coin
	{id=2145, minCount=1, maxCount=5}, -- small diamond
	{id=2149, minCount=1, maxCount=10} -- small emerald
}

local creatureName = "Mummy"
local creaturePosition = {x=896,y=366,z=7}
local summonEffect = CONST_ME_YELLOWENERGY
local storageValue = 1002

function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerStorage, randomValue, reward, count = 0, 0, 0, 0
	if item.uid == 15580 and isInArray(sarcophagus, item.itemid) then
		playerStorage = getPlayerStorageValue(cid,storageValue)
		randomValue = math.random(1,100)
		if (playerStorage == -1) or (playerStorage == 0) then
			if (randomValue <= chance) or (playerStorage == 0) then
				rewardContainer = doCreateItemEx(bag,1)
				for i=1,#items do
					doAddContainerItem(rewardContainer, items[i].id, math.random(items[i].minCount,items[i].maxCount))
				end
				local addItems = doPlayerAddItemEx(cid, rewardContainer, 0)
				if addItems == RETURNVALUE_NOERROR then
					doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You recieve a bag.")
					setPlayerStorageValue(cid, storageValue, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Not enough capacity.")
					setPlayerStorageValue(cid, storageValue, 0)
				end
			else
				doSummonCreature(creatureName,creaturePosition)
				doSendMagicEffect(creaturePosition, summonEffect)
				setPlayerStorageValue(cid, storageValue, 1)
			end
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
		end
	end
	  return true
end

(If the player doesn't have enough cap when he clicks it to hold the bag then when he makes enough cap and clicks again he will get the items without having the 5% chance)

It uses storage values so the player can only do it once. If you want it to be different you can change it. I tested it and it works fine :D Hope thats what you are looking for.

Mav
 
Last edited:
Oh yesh menz repped you but nvr posted...thanks for it and it's more advanced than I thought (the person who would make the script) would do
 
Back
Top