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

|Request| Utamo Vita tfs 1.0+

yoiker

Member
Joined
Jan 21, 2012
Messages
194
Solutions
1
Reaction score
9
Could help to make this script with tfs 1.0 compliant

local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
if hasCondition(cid, CONDITION_MANASHIELD) == false then
doAddCondition(cid,shield)
doSendMagicEffect(getThingPos(cid),12)
else
doRemoveCondition(cid,CONDITION_MANASHIELD)
end
return true
end
 
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

local condition = Condition(CONDITION_MANASHIELD, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
combat:setCondition(condition)

function onCastSpell(creature, var)
    if not creature:getCondition(CONDITION_MANASHIELD, CONDITIONID_DEFAULT) then
        return combat:execute(creature, var)
    end
    return creature:removeCondition(CONDITION_MANASHIELD, CONDITIONID_DEFAULT)
end
 
Thank you, Onmi!

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

local condition = Condition(CONDITION_MANASHIELD, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
combat:setCondition(condition)

function onCastSpell(creature, var)
    if not creature:getCondition(CONDITION_MANASHIELD, CONDITIONID_DEFAULT) then
        return combat:execute(creature, var)
    end
    return creature:removeCondition(CONDITION_MANASHIELD, CONDITIONID_DEFAULT)
end

Works off and put the magic shield, but does not add the condition it is as if he had the magic shield

You could do with this ?;
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

local condition = Condition(CONDITION_MANASHIELD)
condition:setParameter(CONDITION_PARAM_TICKS, 200000)
combat:setCondition(condition)

function onCastSpell(creature, var)
return combat:execute(creature, var)
end
 
Last edited by a moderator:
Code:
local refresh = 60000

local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

local condition = Condition(CONDITION_MANASHIELD)
condition:setParameter(CONDITION_PARAM_TICKS, refresh)

function applyUtamo(creature)
    local creature = Player(creature)
    if creature:getCondition(CONDITION_MANASHIELD) then
        creature:addCondition(condition)
        addEvent(applyUtamo, refresh-1000, creature.uid)
    end
end

function onCastSpell(creature, var)
    if creature:getCondition(CONDITION_MANASHIELD) then
        creature:removeCondition(CONDITION_MANASHIELD)
    else
        creature:addCondition(condition)
        addEvent(applyUtamo, refresh-1000, creature.uid)       
    end
    return combat:execute(creature, var)   
end
should work, can be made better but im 2 hungover to bother atm
 
Back
Top