• 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 Dragon doll/Stuffed dragon. Exact Same as real tibia.

Serp

/* No comment */
Joined
Mar 23, 2008
Messages
249
Reaction score
1
Just a little something someone asked for so i'm giving it out here
incase anyone else wants it.

its the exact same phrases as real tibia
and the Orange text appears ABOVE THE DOLL when its not
in your bag. and above the players head when in the bag

Enjoy :)

add this to Actions.xml
PHP:
action itemid="5791" script="dragon doll.lua"  />
Make this file in your action scripts folder Dragon doll.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if fromPosition.x ~= CONTAINER_POSITION then
		if math.random(1, 5) == 1 then
			doCreatureSayWithDistance(cid, fromPosition, "Fchhhhhh!", TALKTYPE_ORANGE_1)
		elseif math.random(1, 5) == 2 then
			doCreatureSayWithDistance(cid, fromPosition, "Zchhhhhh!", TALKTYPE_ORANGE_1)
		elseif math.random(1,5) == 3 then
			doCreatureSayWithDistance(cid, fromPosition, "Grooaaaaar *cough*", TALKTYPE_ORANGE_1)
		elseif math.random(1, 5) == 4 then
			doCreatureSayWithDistance(cid, fromPosition, "Aaa... CHOO!", TALKTYPE_ORANGE_1)
		elseif math.random(1, 5) == 5 then
			doCreatureSayWithDistance(cid, fromPosition, "You... will.... burn!!", TALKTYPE_ORANGE_1)
		end
	else
		if math.random(1, 5) == 1 then
			doCreatureSay(cid, "Fchhhhhh!", TALKTYPE_ORANGE_1)
		elseif math.random(1, 5) == 2 then
			doCreatureSay(cid, "Zchhhhhh!", TALKTYPE_ORANGE_1)
		elseif math.random(1,5) == 3 then
			doCreatureSay(cid, "Grooaaaaar *cough*", TALKTYPE_ORANGE_1)
		elseif math.random(1, 5) == 4 then
			doCreatureSay(cid, "Aaa... CHOO!", TALKTYPE_ORANGE_1)
		elseif math.random(1, 5) == 5 then
			doCreatureSay(cid, "You... will.... burn!!", TALKTYPE_ORANGE_1)
		end
	end
return TRUE
end


Add this to Global.lua
PHP:
function doCreatureSayWithDistance(cid, position, text, type)
	oldPosX = setPlayerStorageValue(cid, 10000, getCreaturePosition(cid).x)
	oldPosY = setPlayerStorageValue(cid, 10001, getCreaturePosition(cid).y)
	oldPosZ = setPlayerStorageValue(cid, 10002, getCreaturePosition(cid).z)
	oldPos = { x = getPlayerStorageValue(cid, 10000), y = getPlayerStorageValue(cid, 10001), z = getPlayerStorageValue(cid, 10002) }
	doTeleportThing(cid, position, 0)
	doCreatureSay(cid, text, type)
	return doTeleportThing(cid, oldPos, 0)
end
 
Uhh.... I think you went through ALOT of extra trouble!

Why not just use:
Code:
doSendAnimatedText(getThingPos(item.uid), text, color)
or a variant of that?

Also, You might want to do:
Code:
randomamount = math.random(1,5)
instead of executing it over and over and over.

Just my opinion~
 
Yeh im not used to using math.random first time using it. i'll have ago with that part you gave later ty :p
and theres already a doSendAnimatedText one. the person spacificly asked for CreatureSay. like
Real tibia

p.s
Uhh.... I think you went through ALOT of extra trouble!
No extra trouble if i learn something along the way ;)
like how to make it shorter as you suggested :p
 
The best way to tackle that situation then would be to write a new function (in source) called doShowText(pos,text,type)... But then again its kind of out of the way...
 
:0! How can you hate doSendAnimatedText! I shall smite you!
 
I optimized the script, here goes:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
countSound = math.random(1,5)
    if fromPosition.x then
        if countSound == 1 then
            doCreatureSayWithDistance(cid, fromPosition, "Fchhhhhh!", TALKTYPE_ORANGE_1)
        elseif countSound == 2 then
            doCreatureSayWithDistance(cid, fromPosition, "Zchhhhhh!", TALKTYPE_ORANGE_1)
        elseif countSound == 3 then
            doCreatureSayWithDistance(cid, fromPosition, "Grooaaaaar *cough*", TALKTYPE_ORANGE_1)
        elseif countSound == 4 then
            doCreatureSayWithDistance(cid, fromPosition, "Aaa... CHOO!", TALKTYPE_ORANGE_1)
        elseif countSound == 5 then
            doCreatureSayWithDistance(cid, fromPosition, "You... will.... burn!!", TALKTYPE_ORANGE_1)
        end
    end
return TRUE
end
 
Thanks for doing that Ozo, i havn't got any time lately x.x so i havn't had
chance to change it >.>
 
Forgot to add exhaust of 2 seconds? ;)
without appear "you are exhausted" :O

Just suggest
:thumbup:
 
kool now ima make my teddys make cool thigns to say D:
but don't use code like this in your script:
PHP:
        if math.random(1, 5) == 1 then
            doCreatureSayWithDistance(cid, fromPosition, "Fchhhhhh!", TALKTYPE_ORANGE_1)
        elseif math.random(1, 5) == 2 then
            doCreatureSayWithDistance(cid, fromPosition, "Zchhhhhh!", TALKTYPE_ORANGE_1)
        elseif math.random(1,5) == 3 then
            doCreatureSayWithDistance(cid, fromPosition, "Grooaaaaar *cough*", TALKTYPE_ORANGE_1)
        elseif math.random(1, 5) == 4 then
            doCreatureSayWithDistance(cid, fromPosition, "Aaa... CHOO!", TALKTYPE_ORANGE_1)
        elseif math.random(1, 5) == 5 then
            doCreatureSayWithDistance(cid, fromPosition, "You... will.... burn!!", TALKTYPE_ORANGE_1)
        end
random(1 - 5) [3] == 1 - false
random(1 - 5) [1] == 2 - false
random(1 - 5) [5] == 3 - false
random(1 - 5) [5] == 4 - false
random(1 - 5) [2] == 5 - false
This script can do nothing :(
 
The first draggy is 5791, the second is 6566, to make you 'exausted' just add:
Code:
		doTransformItem(item.uid,6566)
		doDecayItem(item.uid)
And make 6566 decay back to 5791 in items.xml
Now you can't use it for X seconds. (Tibia is 3 seconds)

Btw, it it possible to add docreaturesaywithdistance in other distros, or is it a TFS-only?
 
Back
Top