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

Shovel Scarabs

Nightimarez

New Member
Joined
Jul 24, 2008
Messages
287
Reaction score
2
I would like players to dig up ancient scarabs, larvas, and scarabs. Possible pearls too.

Code:
local holes = {468, 481, 483}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(holes, itemEx.itemid) == TRUE then
		doTransformItem(itemEx.uid, itemEx.itemid + 1)
		doDecayItem(itemEx.uid)
	elseif itemEx.itemid == 231 then
		local rand = math.random(1, 100)
		if rand == 1 then
			doCreateItem(2159, 1, toPosition)
		elseif rand > 95 then
			doSummonCreature("Scarab", toPosition)
		end
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	else
		return FALSE
	end
	return TRUE
end

If possible, make this fishing script summon water elementals like the shovel summons scarabs ;P
Code:
local useWorms = FALSE
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(waterIds, itemEx.itemid) == TRUE then
		if itemEx.itemid ~= 405 and getTilePzInfo(getThingPos(cid)) == FALSE then
			if useWorms == FALSE or useWorms == TRUE and doPlayerRemoveItem(cid, ITEM_WORM, 1) == TRUE then
				if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
					doPlayerAddItem(cid, 2667, math.random(1, 5))
				end
				doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
			end
		end
		doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
		return TRUE
	end
	return FALSE
end
 
Last edited:
Code:
local holes = {468, 481, 483}
local stuff = {
	[{85001, 87000}] = 2159,
	[{87001, 88000}] = 2143,
	[{88001, 89000}] = 2144,
	[{89001, 95000}] = 'Larva',
	[{95001, 99000}] = 'Scarab',
	[{99001, 100000}] = 'Ancient Scarab',
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(holes, itemEx.itemid) == TRUE then
		doTransformItem(itemEx.uid, itemEx.itemid + 1)
		doDecayItem(itemEx.uid)
	elseif itemEx.itemid == 231 then
		local rand = math.random(100000)
		for r, v in pairs(stuff) do
			if rand >= r[1] and rand <= r[2] then
				if type(v) == 'number' then
					doCreateItem(v, 1, toPosition)
				else
					doSummonCreature(v, toPosition)
				end
				break
			end
		end
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	else
		return FALSE
	end
	return TRUE
end
 
Back
Top