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

Spell that remove utamo vita

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,541
Solutions
28
Reaction score
875
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hello, i've been searching for a spell that removes utamo vita, a "dispell".
At the moment i searched and found this Barrier with on/off + if 0 mana = dispell but is not working. I leave the last result of this post:

Code:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)

function onCastspell(cid, var)
    if hasCondition(cid, CONDITION_MANASHIELD) then
        doRemoveCondition(cid, CONDITION_MANASHIELD)
    else
        doAddCondition(cid, shield)
    end
    return true
end

Can someone make this work?
Grettings!!

using OTX 2.1 based on tfs 0_3
 
Last edited:
Solution
Lua:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onCastSpell(cid, var)
    if getCreatureCondition(cid, CONDITION_MANASHIELD) then
        doRemoveCondition(cid, CONDITION_MANASHIELD)
    else
        doAddCondition(cid, shield)
    end
    return true
end

If it's gonna be just a dispel then you can ultimately try something like:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
He has DoAdd so I think 0.4? Found this one idk if its working.,,

Lua:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, 200000)
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
if hasCondition(cid, CONDITION_MANASHIELD) == false then
doAddCondition(cid,shield)
doSendMagicEffect(getThingPos(cid),12)
doCreatureSay(cid, "Mana Shield On!", TALKTYPE_ORANGE_1)
else
doRemoveCondition(cid,CONDITION_MANASHIELD)
doCreatureSay(cid, "Mana Shield Off!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(cid), 12)
end
return true
end
 
What is your tfs version?

using OTX 2.1 based on tfs 0_3

He has DoAdd so I think 0.4? Found this one idk if its working.,,

Lua:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, 200000)
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
if hasCondition(cid, CONDITION_MANASHIELD) == false then
doAddCondition(cid,shield)
doSendMagicEffect(getThingPos(cid),12)
doCreatureSay(cid, "Mana Shield On!", TALKTYPE_ORANGE_1)
else
doRemoveCondition(cid,CONDITION_MANASHIELD)
doCreatureSay(cid, "Mana Shield Off!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(cid), 12)
end
return true
end

no, thats why the first script is not working, i guess my server doesnt have function doAdd and i dont know what function i should use in replacement
 
Hello ralke,

I suggest you to get rid of OTX, I don't think I need to quote any reasons for that to take place.

I don't get exactly what you want because of missing parameters on your question but if I got it right you want to be able to deactivate your mana shield by casting as spell, if that's right then I wrote this really quick to you.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)

function onCastSpell(cid, var)
        return doCombat(cid, combat, var)
end


Kindest Regards,
Okke
 
Last edited:
Lua:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onCastSpell(cid, var)
    if getCreatureCondition(cid, CONDITION_MANASHIELD) then
        doRemoveCondition(cid, CONDITION_MANASHIELD)
    else
        doAddCondition(cid, shield)
    end
    return true
end

If it's gonna be just a dispel then you can ultimately try something like:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Solution
@Okke i have been hosting my 2.1 server for a year thats why i still work 0_3, thanks for helping!!! but that script didn't work

Lua:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onCastSpell(cid, var)
    if getCreatureCondition(cid, CONDITION_MANASHIELD) then
        doRemoveCondition(cid, CONDITION_MANASHIELD)
    else
        doAddCondition(cid, shield)
    end
    return true
end

If it's gonna be just a dispel then you can ultimately try something like:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

@2Rec i tried this one and worked perfectly!! thanks

Code:
local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onCastSpell(cid, var)
    if getCreatureCondition(cid, CONDITION_MANASHIELD) then
        doRemoveCondition(cid, CONDITION_MANASHIELD)
    else
        doAddCondition(cid, shield)
    end
    return true
end

i removed this
Code:
  else
        doAddCondition(cid, shield)

i suppose this line was the missing one:

Code:
if getCreatureCondition(cid, CONDITION_MANASHIELD) then

by the way how i can add CONDITION_EFFECT with no errors to show spell animation?

Greetings!!
 
Last edited:
Back
Top