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

Action Costume bags and april's fools items

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Reaction score
10
Location
Mexico
I was bored again, so I did the script for the April's Fools items and the costume bags from the Masquerade Day.

First, the costume bags:
There are three bags, the common bag(purple), uncommon bag(gray) and deluxe bag(golden), they have different outfits, wich are configurable. The time is also configurable, the default(used in Real Tibia) is 5 hours.
actions\scripts\costumebags.lua
Code:
local common = {"orc warrior", "pirate cutthroat", "dworc voodoomaster", "dwarf guard", "minotaur mage"}
local uncommon = {"quara hydromancer", "diabolical imp", "banshee", "frost giant", "lich"}
local deluxe = {"serpent spawn", "demon", "juggernaut", "behemoth", "rahemos"}
local duration = 18000 --the time the outfit will last
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 7737 then
		doSetMonsterOutfit(cid,common[math.random(#common)],duration*1000)
	elseif item.itemid == 7738 then
		doSetMonsterOutfit(cid,uncommon[math.random(#uncommon)],duration*1000)
	elseif item.itemid == 7739 then
		doSetMonsterOutfit(cid,deluxe[math.random(#deluxe)],duration*1000)
	end
	doRemoveItem(item.uid,1)
	doSendMagicEffect(fromPosition,CONST_ME_MAGIC_BLUE)
	return TRUE
end

Now, the April's Fools items:
First, we have the explosive present box, it's looks just like a present box, but when you try to open it, it explodes!
It doesn't causes any damage, but you can add damage if you want.
actions\scripts\explosivepresent.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doRemoveItem(item.uid,1)
	doCreatureSay(cid,"KABOOOOOOOOOOM!",TALKTYPE_ORANGE_1)
	doSendMagicEffect(fromPosition,CONST_ME_FIREAREA)
end

Now, the spellwand, you have probably seen it, a wand with a star.
You use it on a player, and it turns him/her into a rat, a chicken or a green frog(configurable) for 45 seconds(configurable too:p). The spellwand may break when using it, summoning a "Mad Sheep"(or you can change it if you want).
actions\scripts\spellwand.lua
Code:
local outfits = {"rat", "green frog", "chicken"} --possible outfits
local duration = 45 --duration of the outfit in seconds
local breakchance = 1 --chance of losing the wand
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if math.random(100) <= breakchance then
		doSummonCreature("Mad Sheep",toPosition)
		doRemoveItem(item.uid,1)
		return TRUE
	end
	if isPlayer(itemEx.uid) == TRUE then
		doSetMonsterOutfit(itemEx.uid,outfits[math.random(#outfits)],duration*1000)
		doSendMagicEffect(toPosition,CONST_ME_MAGIC_BLUE)
		return TRUE
	end
end

Here's the Mad Sheep if you want, it's just a sheep that doesn't give loot, has self-healing and strong haste.
monster\Mad Sheep.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Mad Sheep" nameDescription="a mad sheep" race="blood" experience="0" speed="116" manacost="0">
	<health now="22" max="22"/>
	<look type="14" corpse="2905"/>
	<targetchange interval="5000" chance="8"/>
	<strategy attack="0" defense="100"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
		<flag pushable="1"/>
		<flag canpushitems="0"/>
		<flag staticattack="50"/>
		<flag lightlevel="0"/>
		<flag lightcolor="0"/>
		<flag targetdistance="1"/>
		<flag runonhealth="14"/>
	</flags>
	<attacks/>
	<defenses armor="15" defense="20">
		<defense name="healing" interval="5000" chance="30" min="5" max="15">
			<attribute key="areaEffect" value="hearts"/>
		</defense>
		<defense name="speed" interval="1000" chance="12" speedchange="141" duration="8000">
			<attribute key="areaEffect" value="redshimmer"/>
		</defense>
	</defenses>
	<immunities>
		<immunity physical="0"/>
		<immunity energy="0"/>
		<immunity fire="0"/>
		<immunity poison="0"/>
		<immunity lifedrain="0"/>
		<immunity paralyze="0"/>
		<immunity outfit="0"/>
		<immunity drunk="0"/>
		<immunity invisible="0"/>
	</immunities>
	<voices interval="2000" chance="5">
		<voice sentence="Maeh"/>
		<voice sentence="Groar!"/>
		<voice sentence="Fchhhh!"/>
	</voices>
	<loot>
	</loot>
</monster>

Now the supersoft pillow, it's just a yellow pillow, if a player throws it on the floor, and walks on it, it will make a "Faaart!" sound.
movements\scripts\pillow.lua
Code:
function onStepIn(cid, item, pos)
	doCreatureSay(cid,"Faaart!",TALKTYPE_ORANGE_1)
end

And that's it..

Oh, almost forgot, this goes in actions.xml:
Code:
	<action itemid="7735" script="spellwand.lua" allowfaruse="1"/>
	<action itemid="8110" script="explosivepresent.lua" />
	<action itemid="7737" script="costumebag.lua" />
	<action itemid="7738" script="costumebag.lua" />
	<action itemid="7739" script="costumebag.lua" />
And this in movements.xml
Code:
	<movevent event="StepIn" itemid="8072" script="pillow.lua" />

I tested everything before posting it here but the Mad Sheep.
Hope you like it! and you can show me you like it by adding rep to me ^_^
 
omg... im very impressed!! your skills with scripting is very good man!! :DThanks a lot (maybe i will learn that much... maybe ;( ..)
 
I tried to change the local breakchance = 1 to 99, but the spellwand won't break.
What do I do wrong?
 
Back
Top