• 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 Spells Target

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,404
Solutions
17
Reaction score
152
Location
Brazil
Hello everyone,

Im hosting a 7.6 server. I want to create and change spells like "exori vis, mort, etc" to follow monsters, like actual Tibia. Can u guys help me? I want to create a spell for Paladin too, just like "exori con".
 
Here's an example

XML:
<spell name="Ethereal Spear" words="exori con" maglv="0" lvl="23" isprem="0" mana="25" enabled="1"><vocation id="3" /><vocation id="9" /><vocation id="10" /></spell>

Lua:
attackType = ATTACK_PHYSICAL
animationEffect = NM_ANI_INFERNAL_BOLT
   
hitEffect = NM_ME_BLOCKHIT
damageEffect = NM_ME_BLOCKHIT
animationColor = RED
offensive = true
drawblood = true
   
MagicObject = MagicDamageObject(attackType, animationEffect, hitEffect, damageEffect, animationColor, offensive, drawblood, 0, 0)
   
function onCast(cid, creaturePos, level, maglv, tmpstr, var)
    if removeSoul(cid, 1) ~= 1 then
        return false
    end
   
    centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z}
   
    MagicObject.minDmg = (level * LVL_FACTOR + (maglv * MLVL_FACTOR) * 18.5)
    MagicObject.maxDmg = (level * LVL_FACTOR + (maglv * MLVL_FACTOR) * 24)
   
    targetCid = getCreatureTarget(cid)
    if targetCid ~= -1 then
        targetpos = getCreaturePosition (targetCid)
        if targetpos.x ~= nil and targetpos.z ~= nil and targetpos.y ~= nil then
            return doTargetMagic(cid, targetpos, MagicObject:ordered())
        end
    end
   
    return false
end
 
Back
Top