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

{Request} The Mutated Pumpkin

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
I was trying to make a 100% real Mutated Pumpkin but I tried to make a script lot of times and only get fail.

Monster will drop: 0-40 Yummy Gummy Worm, Toy Spider, Spiderwebs, Bat Decoration, Skeleton Decoration

When you use Obsidian Knife, you get a ramdom item:
Spiderwebs, a Pumpkin, 50 Candy Canes, a Surprise Bag (Red), a Bat Decoration, a Bar of Chocolate, a Skeleton Decoration, Pumpkinhead or 20 Yummy Gummy Worms, Toy Spider, Surprise Bag (Blue).

My problem: I don't know how to make a script to give a sort item when you use Obsidian Knife on corpse.
 
Last edited:
Skeleton decoration and Mouse Toy.

I want it like Tibia:
Monster will drop: 0-40 Yummy Gummy Worm, Toy Spider, Spiderwebs, Bat Decoration, Skeleton Decoration

When you use Obsidian Knife, you get a ramdom item:
Spiderwebs, a Pumpkin, 50 Candy Canes, a Surprise Bag (Red), a Bat Decoration, a Bar of Chocolate, a Skeleton Decoration, Pumpkinhead or 20 Yummy Gummy Worms, Toy Spider, Surprise Bag (Blue).
 
Last edited:
Skeleton decoration - 6526
Mouse Toy - i dont know

in the scrip, what do you mean: when you use the Obsidian Knife "where"? in the corpose?, it will give you a random item (the items do you put up) isnt it?
 
I want it like Tibia:
Monster will drop: 0-40 Yummy Gummy Worm, Toy Spider, Spiderwebs, Bat Decoration, Skeleton Decoration

When you use Obsidian Knife, you get a ramdom item:
Spiderwebs, a Pumpkin, 50 Candy Canes, a Surprise Bag (Red), a Bat Decoration, a Bar of Chocolate, a Skeleton Decoration, Pumpkinhead or 20 Yummy Gummy Worms, Toy Spider, Surprise Bag (Blue).
 
Try: before last end at data/actions/scripts/tools/obsidian_knife.lua
Lua:
local nanana = {
[1] = 9005,
[2] = 9006,
[3] = 8860,
[4] = 6496,
[5] = 6526, 
[6] = xxxx ----- Mouse toy
}

local o = nanana[math.random(1,10)]
if itemEx.itemid == xxxx then------ ID OF PUMPKIN CORPSE
   if o then
      doPlayerAddItem(cid,o[1],1)
      doTeleportThing(cid, {x=1000, y=1000, z=7})
   else
      doTeleportThing(cid, {x=1000, y=1000, z=7})
   end
return true
end
 
I got lot of errors.
This is my script:
Lua:
function skinMonster(cid,item,skin)
local random = math.random(1,15)
if(random < 4) then
doPlayerAddItem(cid,skin,1)
doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_GREEN)
else
doSendMagicEffect(getThingPos(item.uid), CONST_ME_BLOCKHIT)
end
doTransformItem(item.uid,item.itemid+1)
end
minotaurs = {3090, 2871, 2866, 2876}
lizards = {4259, 4262, 4256}
greendragons = {3104, 2844}
reddragons = {2881}
behemoth = {2931}
bonebeast = {3031}
cube = {7441, 7444, 7445}
cube2 = {7442}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local random = math.random(1,10)
if isInArray(minotaurs, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5878)
elseif isInArray(lizards, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5876)
elseif isInArray(greendragons, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5877)
elseif isInArray(reddragons, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5948)
elseif isInArray(behemoth, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5893)
elseif isInArray(bonebeast, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5925)
elseif isInArray(cube, itemEx.itemid) == TRUE and random < 4 then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
doTransformItem(itemEx.uid, itemEx.itemid + 1)
elseif isInArray(cube2, itemEx.itemid) == TRUE and random < 4 then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
doTransformItem(itemEx.uid, itemEx.itemid + 2)
elseif (isInArray(cube, itemEx.itemid) == TRUE or isInArray(cube2, itemEx.itemid) == TRUE) and random > 4 then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
doRemoveItem(itemEx.uid)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return true
end
 
Try using this one...

obsidian_knife.lua:
Lua:
local config = {
	level = 2
}

local SKINS = {
	-- Minotaurs
	[2830] = {25000, 5878},
	[2871] = {25000, 5878},
	[2866] = {25000, 5878},
	[2876] = {25000, 5878},
	[3090] = {25000, 5878},

	-- Lizards
	[4259] = {25000, 5876},
	[4262] = {25000, 5876},
	[4256] = {25000, 5876},

	-- Dragons
	[3104] = {25000, 5877},
	[2844] = {25000, 5877},

	-- Dragon Lords
	[2881] = {25000, 5948},

	-- Behemoths
	[2931] = {25000, 5893},

	-- Bone Beasts
	[3031] = {25000, 5925},

	-- Mutated Pumpkin
	[8960] = {25000, 2096, 25000, 2683, 25000, 2688, 25000, 6492, 25000, 6526, 25000, 6570, 25000, 6571, 25000, 6574, 25000, 8860, 25000, 9005, 25000, 9006}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerLevel(cid) < config.level) then
		doPlayerSendCancel(cid, "You have to be at least Level " .. config.level .. " to use this tool.")
		return true
	end

	local skin = SKINS[itemEx.itemid]
	if(not skin) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end

	local random, effect = math.random(1, 100000), CONST_ME_GROUNDSHAKER
	if(random <= skin[1]) then
		doPlayerAddItem(cid, skin[2], 1)
	elseif(skin[3] and random >= skin[3]) then
		doPlayerAddItem(cid, skin[4], 1)
	elseif(skin[5] and random >= skin[5]) then
		doPlayerAddItem(cid, skin[6], 50)
	elseif(skin[7] and random >= skin[7]) then
		doPlayerAddItem(cid, skin[8], 1)
	elseif(skin[9] and random >= skin[9]) then
		doPlayerAddItem(cid, skin[10], 1)
	elseif(skin[11] and random >= skin[11]) then
		doPlayerAddItem(cid, skin[12], 1)
	elseif(skin[13] and random >= skin[13]) then
		doPlayerAddItem(cid, skin[14], 1)
	elseif(skin[15] and random >= skin[15]) then
		doPlayerAddItem(cid, skin[16], 1)
	elseif(skin[17] and random >= skin[17]) then
		doPlayerAddItem(cid, skin[18], 1)
	elseif(skin[19] and random >= skin[19]) then
		doPlayerAddItem(cid, skin[20], 20)
	elseif(skin[21] and random >= skin[21]) then
		doPlayerAddItem(cid, skin[22], 1)
	else
		effect = CONST_ME_POFF
	end

	doSendMagicEffect(toPosition, effect)
	doTransformItem(itemEx.uid, itemEx.itemid + 1)
	return true
end

In actions.xml:
XML:
	<action itemid="5908" event="script" value="tools/obsidian_knife.lua"/>
 
Last edited:
Your script do not do that:

When you use Obsidian Knife in The Mutated Pumpkin, you get a ramdom item:
Spiderwebs, a Pumpkin, 50 Candy Canes, a Surprise Bag (Red), a Bat Decoration, a Bar of Chocolate, a Skeleton Decoration, Pumpkinhead or 20 Yummy Gummy Worms, Toy Spider, Surprise Bag (Blue).
 
Nubs. I made this ages ago.
Lua:
local MINOTAUR_LEATHER, LIZARD_LEATHER, GREEN_DRAGON_LEATHER, RED_DRAGON_LEATHER, HARDENED_BONE, BEHEMOTH_FANG = 5878, 5876, 5877, 5948, 5925, 5893

local config = {
	[2830] = {10, MINOTAUR_LEATHER},
	[2866] = {10, MINOTAUR_LEATHER},
	[2871] = {10, MINOTAUR_LEATHER},
	[2876] = {10, MINOTAUR_LEATHER},
	[2844] = {10, GREEN_DRAGON_LEATHER},
	[2881] = {10, RED_DRAGON_LEATHER},
	[2931] = {10, BEHEMOTH_FANG},
	[4256] = {10, LIZARD_LEATHER},
	[4259] = {10, LIZARD_LEATHER},
	[4262] = {10, LIZARD_LEATHER},
	[3031] = {10, HARDENED_BONE}
}

local pumpkin_items = {
	[1] = {2683},
	[2] = {2688, 50},
	[3] = {6571},
	[4] = {6492},
	[5] = {6574},
	[6] = {6526},
	[7] = {2096},
	[8] = {9005, 20}
}

local sculpting = {
	[7441] = {randsize = 4, newid = 7442},
	[7442] = {randsize = 5, newid = 7444},
	[7444] = {randsize = 6, newid = 7445},
	[7445] = {randsize = 7, newid = 7446},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 8961 then
		if getPlayerStorageValue(cid, 65048) <= 0 then
			doCreatureSay(cid, "Happy Halloween!", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
			setPlayerStorageValue(cid, 65048, 1)
			local v = pumpkin_items[math.random(#pumpkin_items)]
			doPlayerAddItem(cid, v[1], v[2] or 1)
		else
			doCreatureSay(cid, "You already used your knife on the corpse.", TALKTYPE_ORANGE_1, false, cid)
		end
		return true
	end

	-- Sculpting
	local v = sculpting[itemEx.itemid]
	if v then
		if(math.random(v.randsize) == 1) then
			doTransformItem(itemEx.uid, v.newid)
		else
			doRemoveItem(itemEx.uid)
			doCreatureSay(cid, "The attempt at sculpting failed miserably.", TALKTYPE_ORANGE_1)
		end
		doSendMagicEffect(toPosition, CONST_ME_HITAREA)
		return true
	end

	-- Skinning
	v = config[itemEx.itemid]
	if not v then
		return false
	elseif math.random(100) <= v[2] then
		doPlayerAddItem(cid, v[2], 1)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
	else
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
	end
	doTransformItem(itemEx.uid, itemEx.itemid + 1)
	doDecayItem(itemEx.uid)
	return true
end
 
Try changing the chance values (I left them all with '25000')

[8960] = {25000, 2096, 25000, 2683, 25000, 2688, 25000, 6492, 25000, 6526, 25000, 6570, 25000, 6571, 25000, 6574, 25000, 8860, 25000, 9005, 25000, 9006}

The random is 'math.random(1, 100000)' so currently every item has a 25% chance to be obtained.
 
I got lot of errors.
This is my script:
function skinMonster(cid,item,skin)
local random = math.random(1,15)
if(random < 4) then
doPlayerAddItem(cid,skin,1)
doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_GREEN)
else
doSendMagicEffect(getThingPos(item.uid), CONST_ME_BLOCKHIT)
end
doTransformItem(item.uid,item.itemid+1)
end
minotaurs = {3090, 2871, 2866, 2876}
lizards = {4259, 4262, 4256}
greendragons = {3104, 2844}
reddragons = {2881}
behemoth = {2931}
bonebeast = {3031}
cube = {7441, 7444, 7445}
cube2 = {7442}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local random = math.random(1,10)
if isInArray(minotaurs, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5878)
elseif isInArray(lizards, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5876)
elseif isInArray(greendragons, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5877)
elseif isInArray(reddragons, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5948)
elseif isInArray(behemoth, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5893)
elseif isInArray(bonebeast, itemEx.itemid) == TRUE then
skinMonster(cid, itemEx, 5925)
elseif isInArray(cube, itemEx.itemid) == TRUE and random < 4 then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
doTransformItem(itemEx.uid, itemEx.itemid + 1)
elseif isInArray(cube2, itemEx.itemid) == TRUE and random < 4 then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
doTransformItem(itemEx.uid, itemEx.itemid + 2)
elseif (isInArray(cube, itemEx.itemid) == TRUE or isInArray(cube2, itemEx.itemid) == TRUE) and random > 4 then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
doRemoveItem(itemEx.uid)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return true
end



does this exist? o_O xD
 
@UP: Custom functions made by newfags like cyko ^_^

There...ice cube carving included...

obsidian_knife:
Lua:
local config = {
	level = 2
}
 
local SKINS = {
	-- Minotaurs
	[2830] = {25000, 5878},
	[2871] = {25000, 5878},
	[2866] = {25000, 5878},
	[2876] = {25000, 5878},
	[3090] = {25000, 5878},
 
	-- Lizards
	[4259] = {25000, 5876},
	[4262] = {25000, 5876},
	[4256] = {25000, 5876},
 
	-- Dragons
	[3104] = {25000, 5877},
	[2844] = {25000, 5877},
 
	-- Dragon Lords
	[2881] = {25000, 5948},
 
	-- Behemoths
	[2931] = {25000, 5893},
 
	-- Bone Beasts
	[3031] = {25000, 5925},
 
	-- Mutated Pumpkin
	[8960] = {25000, 2096, 25000, 2683, 25000, 2688, 25000, 6492, 25000, 6526, 25000, 6570, 25000, 6571, 25000, 6574, 25000, 8860, 25000, 9005, 25000, 9006}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerLevel(cid) < config.level) then
		doPlayerSendCancel(cid, "You have to be at least Level " .. config.level .. " to use this tool.")
		return true
	end
 
	local skin = SKINS[itemEx.itemid]
	if(not skin) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end
 
	local random, effect = math.random(1, 100000), CONST_ME_GROUNDSHAKER
	if(random <= skin[1]) then
		doPlayerAddItem(cid, skin[2], 1)
	elseif(skin[3] and random >= skin[3]) then
		doPlayerAddItem(cid, skin[4], 1)
	elseif(skin[5] and random >= skin[5]) then
		doPlayerAddItem(cid, skin[6], 50)
	elseif(skin[7] and random >= skin[7]) then
		doPlayerAddItem(cid, skin[8], 1)
	elseif(skin[9] and random >= skin[9]) then
		doPlayerAddItem(cid, skin[10], 1)
	elseif(skin[11] and random >= skin[11]) then
		doPlayerAddItem(cid, skin[12], 1)
	elseif(skin[13] and random >= skin[13]) then
		doPlayerAddItem(cid, skin[14], 1)
	elseif(skin[15] and random >= skin[15]) then
		doPlayerAddItem(cid, skin[16], 1)
	elseif(skin[17] and random >= skin[17]) then
		doPlayerAddItem(cid, skin[18], 1)
	elseif(skin[19] and random >= skin[19]) then
		doPlayerAddItem(cid, skin[20], 20)
	elseif(skin[21] and random >= skin[21]) then
		doPlayerAddItem(cid, skin[22], 1)
	else
		effect = CONST_ME_POFF
	end

	local random = math.random(1, 100)
	if(itemEx.itemid == 7441) then
		if(random <= 30) then
			doTransformItem(itemEx.uid, 7442)
		else
			effect = CONST_ME_POFF
			doRemoveItem(itemEx.uid, 1)
		end
	elseif(itemEx.itemid == 7442) then
		if(random <= 20) then
			doTransformItem(itemEx.uid, 7444)
		else
			effect = CONST_ME_POFF
			doRemoveItem(itemEx.uid, 1)
		end
	elseif(itemEx.itemid == 7444) then
		if(random <= 10) then
			doTransformItem(itemEx.uid, 7445)
		else
			effect = CONST_ME_POFF
			doRemoveItem(itemEx.uid, 1)
		end
	elseif(itemEx.itemid == 7445) then
		if(random <= 5) then
			doTransformItem(itemEx.uid, 7446)
		else
			effect = CONST_ME_POFF
			doRemoveItem(itemEx.uid, 1)
		end
	end

	doSendMagicEffect(toPosition, effect)
	doTransformItem(itemEx.uid, itemEx.itemid + 1)
	return true
end
 
Last edited:
Back
Top Bottom