• 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 TFS 1.2 Looking for two spells

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
993
Solutions
5
Reaction score
55
Hello im looking for two spells that would work like this
  • Debuff - Removes 12% of your stats for 7 seconds so (Axe Fighting, Sword Fighting, Club Fighting, Distance Fighting, Shielding, Fishing) (Would be great if monsters could use it to not only players)
  • Spell counter - counters all energy damage for 3 seconds so basically it wont get any damage from energy spells for 3 seconds (Would be great if monsters could use it to not only players)
 
Based on monster spell "fury skill reducer":
(you can also use value reduction - just remove percent word from parameter and add "-" before value)
AOE debuffs circular area around player with radius of 3

local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 7000)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELDPERCENT, 88)
condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, 88)
condition:setParameter(CONDITION_PARAM_SKILL_FISHINGPERCENT, 88)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, 88)
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
combat:setCondition(condition)

function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
 
Based on monster spell "fury skill reducer":
(you can also use value reduction - just remove percent word from parameter and add "-" before value)
AOE debuffs circular area around player with radius of 3
So it will remove number not a precent value
condition:setParameter(CONDITION_PARAM_SKILL_SHIELD, -12)
 
Testing the spell won't take more than 3 mins, copy paste save, spells.xml set the spell needtarget=1

yes it works
So how would you make it more advanced like a send a message to player when hes debuffed. And it wont be abused lets say 5 people would cast this spell on one player so it would remove like 60% of skills because 5 people casted it so (5x12) on one player. It should allow to cast this spell only one time if hes already debuffed so it wont be abused.
 
They don't stack. One debuff effect replaces other same type debuff. (like haste spell removes paralyze)
 
They don't stack. One debuff effect replaces other same type debuff. (like haste spell removes paralyze)
So it do work but if you use spell that gives you any stats for example. It wont work
Lua:
local exhaust = {}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 28)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 30000)
condition:setParameter(CONDITION_PARAM_SKILL_SWORD, 40)
condition:setParameter(CONDITION_PARAM_SKILL_AXE, 40)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 40)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 40)
condition:setParameter(CONDITION_PARAM_SKILL_FISHING, 40)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 25)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 10000)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTS, 10000)
condition:setParameter(CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    local cur_time, playerid = os.mtime(), cid:getId()
    if not exhaust[playerid] then
        exhaust[playerid] = 0
    end
    if exhaust[playerid] > cur_time then
        local next_time = (exhaust[playerid] - cur_time) / 1000
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end
    exhaust[playerid] = cur_time + 30000
    combat:execute(cid, var)
    return true
end
 
Last edited:
They don't stack. One debuff effect replaces other same type debuff. (like haste spell removes paralyze)
So it do work but if you use spell that gives you any stats for example. It wont work
Lua:
local exhaust = {}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 28)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 30000)
condition:setParameter(CONDITION_PARAM_SKILL_SWORD, 40)
condition:setParameter(CONDITION_PARAM_SKILL_AXE, 40)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 40)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 40)
condition:setParameter(CONDITION_PARAM_SKILL_FISHING, 40)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 25)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 10000)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTS, 10000)
condition:setParameter(CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    local cur_time, playerid = os.mtime(), cid:getId()
    if not exhaust[playerid] then
        exhaust[playerid] = 0
    end
    if exhaust[playerid] > cur_time then
        local next_time = (exhaust[playerid] - cur_time) / 1000
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end
    exhaust[playerid] = cur_time + 30000
    combat:execute(cid, var)
    return true
end
Yes have this issue
 
So it do work but if you use spell that gives you any stats for example. It wont work
Lua:
local exhaust = {}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 28)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 30000)
condition:setParameter(CONDITION_PARAM_SKILL_SWORD, 40)
condition:setParameter(CONDITION_PARAM_SKILL_AXE, 40)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 40)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 40)
condition:setParameter(CONDITION_PARAM_SKILL_FISHING, 40)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 25)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 10000)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTS, 10000)
condition:setParameter(CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    local cur_time, playerid = os.mtime(), cid:getId()
    if not exhaust[playerid] then
        exhaust[playerid] = 0
    end
    if exhaust[playerid] > cur_time then
        local next_time = (exhaust[playerid] - cur_time) / 1000
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end
    exhaust[playerid] = cur_time + 30000
    combat:execute(cid, var)
    return true
end
Looking for this solution
 
Back
Top