• 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 Training monks that heals

okurde

New Member
Joined
Jan 28, 2009
Messages
134
Reaction score
1
Hello, how can be solved problem that training monks kill people? They should heal sometimes... but how should it be done?
 
Do you want the players to be healed? You could add a global script to heal players in that area..
 
Yea.. Oh but it is very big arena, so script can lagg server :<
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-frame

If your unable to script it, I'll post a script when I get home in 12 hours or so.
 
Last edited:
In the xml file of the Training Monk, search for something like this:
Code:
<attack name="melee" interval="2000" attack="1" skill="60"/>
And change it for this:
Code:
<attack name="melee" interval="2000" min="100000" max="110000"/>
 
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.
 
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.
There is many reasons why people like to do things, some ways are simpler then others, and some are to learn.
We can only make suggestions and let them decide which is best.
:oops:
Great! I'm looking forward to your release! :)
Here you are. :D :p

data/globalevents/globalevents.xml

Code:
<globalevent name="Healing_Sparkles" interval="60000" event="script" value="healing_sparkles.lua"/>
data/globalevents/scripts/healing_sparkles.lua
Code:
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 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.
 
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.
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.
Unless I'm mistaken. :(
 
Back
Top