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

Monster Summon heal master and party.

leyendario

kind of scripter
Joined
Aug 1, 2009
Messages
49
Reaction score
14
Location
Venezuela
i have seen many request about this particular monster.. so i made it and this is what it does.
its a summon that heals the master everytime he use a spell. and if he is in party all the party members will be heal too.

xml of the monster
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Healer" nameDescription="Healer" race="blood" experience="0" speed="900" manacost="1000">
    <health now="1900" max="1900"/>
    <look type="35" head="114" body="114" legs="114" feet="114" corpse="5995"/>
    <targetchange interval="4000" chance="50"/>
    <strategy attack="10" defense="90"/>
    <flags>
        <flag summonable="1"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag runonhealth="0"/>
    </flags>

    <script>
        <event name="curar"/>
    </script>

    <attacks>
    </attacks>
    <defenses armor="42" defense="60">
    <defense name="healing" interval="5000" chance="300" min="5000" max="8000">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
    <defense name="invisible" interval="1000" chance="20" duration="2000">
            <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
    </defenses>
    <immunities>
        <immunity physical="0"/>
        <immunity energy="0"/>
        <immunity fire="0"/>
        <immunity poison="0"/>
        <immunity lifedrain="0"/>
        <immunity paralyze="1"/>
        <immunity outfit="1"/>
        <immunity drunk="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="4000" chance="300">
        <voice sentence="can i heal u?" />
        <voice sentence="are you injured?" />
    </voices>
    <loot capacity="1900">
    </loot>
</monster>

go to cresturescripts.xml and add
Code:
    <event type="cast" name="curar" event="script" value="curar.lua"/>

and go to creaturescripts/script create a lua file called curar.lua and paste this inside:
Code:
-- summon heal master v1.1
-- by leyendario.
	local config = {
	heal = 1000,
	mana = 1000, -- put 0 if you dont want him to recover mana.
	condition = "yes", -- put no if you dont want him to remove the conditions (fire, poison, etc).
	}
 
function onCast(cid, target)
 
	local master = getCreatureMaster(cid)
	if master then
		local conditions = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_CURSED}
		local party = getPartyMembers(master)
		local pos = getCreaturePosition(master)
		if not getPlayerParty(master) then
			doCreatureAddHealth(master, config.heal)
			doCreatureAddMana(master, config.mana)
			doSendMagicEffect(pos, 12)
			if (config.condition == "yes") then
				for i, todos in ipairs(conditions) do
					doRemoveCondition(master, todos)
				end
			end
			return true
		end
		for _, miembros in pairs(party) do
			doCreatureAddMana(miembros, config.mana)
			doCreatureAddHealth(miembros, config.heal)
			pos = getCreaturePosition(miembros)
			doSendMagicEffect(pos, 12)
			if (config.contidion == "yes") then
				for i, todos in ipairs(conditions) do
					doRemoveCondition(miembros, todos)
				end
			end
		end
	end
	return true
end

credits: leyendario
 
Last edited:
@leyendario
I've tested and it didn't works.
So many bugs etc... (in tfs 0.4)

BTW I've updated it and now is so great,
I also 've maded a npc :)

Thanks for the "base" haha
 
script updated!.

*heal master and party members.
*recover mana to master and party members.
*remove conditions.
*working also in 0.4.
*small bug solved when the monster had no owner.
 
@leyendario,
can I use, whem player/summon got battle?
And in area 4x4?
 
Last edited:
Back
Top