• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[8.54][TFS 0.3.6pl1]Monster animation.

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
807
Solutions
18
Reaction score
355
Hello,

I want to know how to make monster with 2 animations.
What I mean?
I mean when monster isn't attacked it have normal graphic (without animation), but when we attack him, he have some animation.

I am looking for your help.
Best regards,
margoh.
 
Just do two monsters and two transformation spells.
What it exactly means: spell will execute every 1000ms - when you attack monsterX, spell will check for diffrence of max health and actual health, if that diffrence is bigger then 0 - monster will transform to animated one.

LUA:
if getCreatureMaxHealth(cid) > getCreatureHealth(cid) then
	doRemoveCreature(cid)
	doCreateMonster(pos, "Rat")
end

Now, add passive healing to 2nd monster and spell what will transform him back when he have full health.


There is aslo another option with:
LUA:
local attackers = getSpectators(pos, 6, 8, false)
if #attackers > 0 then
	for i = 1, #attackers do
		local getTarget = getCreatureTarget(attackers[i])
		if getTarget = cid then
			doRemoveCreature(cid)
			doCreateMonster(pos, "Rat")
			break

...blablabla...

Exactly the same spells are on servers where monsters turn aggresive when you attack them.
 
I don't really get it how to do it D:

Can you give all code of spell? And how to include it to monstername.xml, beacuse I have tried today with other spell that i have made, and.... have bugs in console.

Also, how to make this spell to heal in the same time of getting dmg? For example: monster gets: 2000 dmg and it also heal of same amount.
 
Last edited:
Back
Top