• 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 Spell Heal/Damage

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
555
Solutions
1
Reaction score
62
Location
Lo Mochis, Sinaloa
spell that heals the monster and damages players, as if it were life steal from the monster, i am using tfs 1.3
 
Solution
Try this one
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

function onCastSpell(creature, variant)
local player = creature:getPlayer()
    local min = 1000
    local max = 2000
for _, target in ipairs(combat:getTargets(creature, variant)) do
if target:isPlayer() then 
doTargetCombat(0, target, COMBAT_HEALING, -min, -max)
end
if target:isMonster() then
doTargetCombat(0, target, COMBAT_HEALING, min, max)
end
end
return true
end
Weird, Can you add same script as player's script then try using it on monster/players to see if it works? Can you also try some area healing like the normal mass healing Exura gran mas res to see if it works?
 
Weird, Can you add same script as player's script then try using it on monster/players to see if it works? Can you also try some area healing like the normal mass healing Exura gran mas res to see if it works?
If i use exura gran mas res, or exura sio works, but if a player do the custom spell do nothing
 
I edited it, It should work 100% now, If not then I give up.
 
I edited it, It should work 100% now, If not then I give up.
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/monster/nightmare.lua:onCastSpell
data/spells/scripts/monster/nightmare.lua:16: attempt to call global 'doTargetCombat' (a nil value)
stack traceback:
        [C]: in function 'doTargetCombat'
        data/spells/scripts/monster/nightmare.lua:16: in function <data/spells/scripts/monster/nightmare.lua:7>

Jaja no problem man, thank you for your time and your help
 
Jaja no problem man, thank you for your time and your help
Are you sure you are using 1.3? I just tested in-game and the spell works perfect for monsters and players both.
Heals monsters/Damages players.
1602119068878.png
 
I am using otservbr, is based on tfs 1.3 right?
I think its based on 1.3 but I am not sure what's changed on it but I had to test this script in-game and everything works perfect for me on latest 1.3 version.
I had gifs uploaded on my last reply not sure where they are gone lol

mytestdemon.gif
mytestdemon2.gif
 
Last edited:
I think its based on 1.3 but I am not sure what's changed on it but I had to test this script in-game and everything works perfect for me on latest 1.3 version.
I had gifs uploaded on my last reply not sure where they are gone lol

View attachment 50498
View attachment 50499well i see is working, i dont know why is not working for me, but anyways man thanks a lot for your help and your time
Well thank you man for your help and your time, sorry for my waste of time xd
 
Back
Top