• 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 Mammoth Sculpture

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,018
Solutions
1
Reaction score
1,035
Location
United States
I tried searching for a mammoth sculpting script because I needed one, but I couldn't find any, so why not make one? Basically you just use an knife (since the obsidian knife is already used) on an ice cube and it changes into four different stages before becoming a full mammoth sculpture.

Use the knife (2566)
Kitchen_Knife.gif

\/
Ice Cube (7441)
Ice_Cube.gif

\/
Another stage (7442)
\/
Another stage (7444)
\/
Another stage (7445)
\/
Ice Mammoth (7446)
Ice_Mammoth.gif



In data/actions/scripts/tools/icemammoth.lua:
Code:
function onUse(cid, item, frompos, item2, topos)
local chance1 = math.random(1,2) -- 50%
local chance2 = math.random(1,4) -- 25%
local chance3 = math.random(1,6) -- 17%
local chance4 = math.random(1,8) -- 13%
local chance5 = math.random(1,10) -- 10%
local effect = 3

	if item2.itemid == 7441 then
		if chance1 == 1 then
			doSendMagicEffect(topos,effect)
			doTransformItem(item2.uid,7442)
		else
			doSendMagicEffect(topos,effect)
			doRemoveItem(item2.uid,1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You broke the ice cube.')
		end
	elseif item2.itemid == 7442 then
		if chance2 == 1 then
			doSendMagicEffect(topos,effect)
			doTransformItem(item2.uid,7444)
		else
			doSendMagicEffect(topos,effect)
			doRemoveItem(item2.uid,1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You broke the ice cube.')
		end
	elseif item2.itemid == 7444 then
		if chance3 == 1 then
			doSendMagicEffect(topos,effect)
			doTransformItem(item2.uid,7445)
		else
			doSendMagicEffect(topos,effect)
			doRemoveItem(item2.uid,1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You broke the ice cube.')
		end
	elseif item2.itemid == 7445 then
		if chance4 == 1 then
			doSendMagicEffect(topos,effect)
			doTransformItem(item2.uid,7446)
		else
			doSendMagicEffect(topos,effect)
			doRemoveItem(item2.uid,1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You broke the ice cube.')
		end
		else
			doSendMagicEffect(getPlayerPosition(cid),2)
	end
end

In actions.xml:
Code:
<action itemid="2566" event="script" value="tools/icemammoth.lua" />

The break chances may be very high, but I'm doing it according to TibiaWiki (Ice Mammoth - TibiaWiki - Quests, Items, Spells, and more)


If you find this very helpful, I don't mind receiving a reputation from you.

Bored scripter,
Lostboy
 
Last edited:
theres just one problem, you cant add 2 lines with same item id into the actions.xml, Simple edit ur obsidian knife ;)
 
For now, I changed it to a normal knife (2566). I'm too tired to add it in the obsidian knife script.
 
Last edited:
Add this in obsidianknife.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.")
return TRUE
end
end
 
Back
Top