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

Freeze rune

alectrona94

Member
Joined
Aug 10, 2019
Messages
143
Reaction score
7
Location
Egypt
I need help to add freeze rune to my ot, ive searched but nothing works, i use TFS 0.4 so if anyone has the script please give me a little hand of help
 
Solution
Add this to your data\actions\scripts\freeze.lua
Lua:
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...
Have you tried this one?
 
spells.xml
Lua:
<rune name="Freeze" id="" allowfaruse="1" charges="1" lvl="8" maglv="4" exhaustion="2000" mana="1400" needtarget="1" blocktype="solid" event="script" value="support/freeze rune.lua">
    </rune>
support/freeze rune.lua
Lua:
local freezetime = 3   
 
local cooldown = 10 -- 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 onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.get(cid,storage) then
        return doPlayerSendCancel(cid,"You can't use this yet.")
    end
 
        if getTilePzInfo(toPosition) == true then
                   return doPlayerSendCancel(cid, "You cant use in pz.")
        end

    if not isPlayer(itemEx.uid) or cid == itemEx.uid then
        return doPlayerSendCancel(cid,"You can only use this on another players.")
    end
 
    doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", TEXTCOLOR_BLUE)
    exhaustion.set(cid,storage,cooldown)
    doCombat(cid, combat, numberToVariant(itemEx.uid))
    doCreatureSetNoMove(itemEx.uid, 1)
    countDown(freezetime , toPosition, 0, "melted", 5)
    addEvent(removed,freezetime*1000,itemEx.uid)
    return true
end
 
Add this to your data\actions\scripts\freeze.lua
Lua:
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 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 PZ!.")
      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)
    countDown(freezetime , toPosition, 0, "melted", 5)
    addEvent(removed,freezetime*1000,itemEx.uid)
    return true
end
Then add to your actions.xml
XML:
<action itemid="yourruneid" event="script" value="scriptname.lua"/>
 
Solution
i know it has been solved, but is it possible to remove its charges? because in my ot runes doesnt have charge is it possible to make it removable for this rune only?
 
This one should remove charges.
Lua:
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 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 PZ!.")
      end
    doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", TEXTCOLOR_BLUE)
    doRemoveItem(item.uid, 1)
      doCreatureSay(cid, "Freez Rune!", TALKTYPE_ORANGE_1)
    exhaustion.set(cid,storage,cooldown)
    doCombat(cid, combat, numberToVariant(itemEx.uid))
    doCreatureSetNoMove(itemEx.uid, 1)
    countDown(freezetime , toPosition, 0, "melted", 5)
    addEvent(removed,freezetime*1000,itemEx.uid)
    return true
end
 
Back
Top