• 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 0.3.6 Actions freeze rune exhaust target use of item id

ares413

New Member
Joined
Apr 1, 2010
Messages
130
Reaction score
3
How would I go about implementing a line in this script below to make your target exhausted from using a specific item id?
rep+





Code:
local freezetime = 6
local cooldown = 15 -- time to use again
local storage = 19002
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, exhaust)
local exhaustt = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaustt, CONDITION_PARAM_SUBID, 2)
setConditionParam(exhaustt, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, exhaustt)
function countDown(number, pos, effect, msgonend, effectonend)
  local n = number
       for i = 1, number do
           addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
           addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )
              n = n -1
       end
      n = number
return true
end
function removed(cid)
    doCreatureSetNoMove(cid, 0)
    doRemoveCondition(cid,CONDITION_EXHAUST,1)
    doRemoveCondition(cid,CONDITION_EXHAUST,2)
end

function slowheal(cid)
    exhaustion.make(cid,EXHAUST_HEAL,freezetime)
    exhaustion.set(cid,EXHAUST_HEAL,freezetime)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.get(cid,storage) then
        return doPlayerSendCancel(cid,"You can't use this yet.")
    end
    if not isPlayer(itemEx.uid) or cid == itemEx.uid then
        return doPlayerSendCancel(cid,"You can only use this on another players.")
    end

       if getTilePzInfo(toPosition) == true then
           return doPlayerSendCancel(cid, "You cannot use this in a protection zone.")
       end
    doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", TEXTCOLOR_BLUE)
       doCreatureSay(cid, "Freez Rune!", TALKTYPE_ORANGE_1)
    exhaustion.set(cid,storage,cooldown)
    doCombat(cid, combat, numberToVariant(itemEx.uid))
    doCreatureSetNoMove(itemEx.uid, 1)
    addEvent(slowheal,freezetime*1000,itemEx.uid)
    countDown(freezetime , toPosition, 0, "melted", 5)
    addEvent(removed,freezetime*1000,itemEx.uid)
    return true
end
 
i dont think it can be done with one line but
ur script look a lot more of a spell or rune and i m sure it can be remake short and beauty IF
you explain what you are trying to do ?
it is a bit odd, and hard undestood,
exp :
* you created an item and want its target to not move ?
* you created an item and want its target to not be able to use an other item ?
* you created an item and want to add a cowdown to its user ?
do see what i mean ?

if not the text u wrote is even hard to cacth.
 
basically, you use the freeze rune on your target, and now your target cannot use a healing rune or mana rune by id
 
Back
Top