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

Lua Monster transforming in another

lordazzi

New Member
Joined
Apr 6, 2012
Messages
24
Reaction score
1
Heya!
I'm trying to make a monster that transform in another,
not in the vampire style, that changes only the outfit to a bat,
but change all monster config of how the monster must behave,

I belive that is possible to do that with some funcions in lua that changes helth, maxhelth, mana, attacks, speed, etc... Make an giant script, but if is to do by this way, I can do it by myself, what I want to know is if there is any function in Tibia Lua for to do something like this :)
 
Lua:
local t = {
	["dog"] = "cat",
	["cat"] = "bear"
}
 
function onKill(cid, target, flags)
	local k = t[string.lower(getCreatureName(target))]
	if(k and (bit.band(flags, 1) == 1) and isMonster(target)) then
		local master = getCreatureMaster(target)
		if master and master ~= target then return true end
	
		if isMonster(target) then
			for _, v in ipairs(t) do
				doSummonCreature(v, getCreaturePosition(target))
			end
		end
	end

	return true
end
 
It is not when it die, is like an spell that the monster uses in the battle,
Thank you J.Dre!
I'll try adapt this to become an spell :D
 
Back
Top