Hello, how can be solved problem that training monks kill people? They should heal sometimes... but how should it be done?
No it wouldn't. Just make it cast every 1 minute or so. I doubt your monks with 1 dmg 1 skill would be able to kill anyone in that time-frameYea.. Oh but it is very big arena, so script can lagg server :<
<attack name="melee" interval="2000" attack="1" skill="60"/>
<attack name="melee" interval="2000" min="100000" max="110000"/>
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Training Monk" nameDescription="a training monk" race="blood" experience="0" speed="400" manacost="0">
<health now="99999999" max="99999999"/>
<look type="57" corpse="3130"/>
<targetchange interval="60000" chance="0"/>
<strategy attack="100" defense="1000"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag staticattack="50"/>
<flag lightlevel="0"/>
<flag lightcolor="0"/>
<flag targetdistance="1"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="1000" min="0" max="-1"/>
</attacks>
<defenses armor="0" defense="0">
<defense name="healing" interval="50" chance="10" min="960000" max="960000"/>
</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="1"/>
</immunities>
<loot>
<item id="2148" countmax="1" chance="100000"/><!-- gold coin -->
<item id="1949" chance="10000"/><!-- scroll -->
<item id="2467" chance="10000"/><!-- leather armor -->
<item id="2642" chance="66666666"/><!-- sandals -->
</item>
</loot>
</monster>
There is many reasons why people like to do things, some ways are simpler then others, and some are to learn.This is just what I used..
Code:<?xml version="1.0" encoding="UTF-8"?> <monster name="Training Monk" nameDescription="a training monk" race="blood" experience="0" speed="400" manacost="0"> <health now="99999999" max="99999999"/> <look type="57" corpse="3130"/> <targetchange interval="60000" chance="0"/> <strategy attack="100" defense="1000"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="1000" min="0" max="-1"/> </attacks> <defenses armor="0" defense="0"> <defense name="healing" interval="50" chance="10" min="960000" max="960000"/> </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="1"/> </immunities> <loot> <item id="2148" countmax="1" chance="100000"/><!-- gold coin --> <item id="1949" chance="10000"/><!-- scroll --> <item id="2467" chance="10000"/><!-- leather armor --> <item id="2642" chance="66666666"/><!-- sandals --> </item> </loot> </monster>
Shielding will level up fine, Don't understand why you want to make a script.
Here you are.Great! I'm looking forward to your release!
<globalevent name="Healing_Sparkles" interval="60000" event="script" value="healing_sparkles.lua"/>
function onThink(interval, lastExecution, thinkInterval)
local tiles = {
[1] = { x = 1557, y = 1571, z = 7},
[2] = { x = 1615, y = 2608, z = 7},
[3] = { x = 1616, y = 2608, z = 7} ---- Change these for the correct coordinates of your tiles, and ensure the last line does not contain a ,,,,
}
for i = 1, #tiles do
local thing = getThingFromPos({x = tiles[i].x, y = tiles[i].y, z = tiles[i].z, stackpos = 253})
if isPlayer(thing.uid) then
doSendMagicEffect(tiles[i], CONST_ME_HEARTS)
doCreatureAddHealth(thing.uid, (getCreatureMaxHealth(cid) - getCreatureHealth(cid)))
end
end
return true
end
You'd also have to add in a login script to remove the storage value, otherwise if they exit client, or server reset, and they are teleported to temple because someone is using trainers, they would be healed outside of trainers.You can also resolve this with a storage value when the players steps on or off a tile, doesn't have to have an action id or anything, just a specific tile that is used at trainers, then give the player a storage value and then use on think to check for that storage value.