[TFS 1.3][RevScript] Frost Charm aka Freeze Rune

Levi999x

AoT
Joined
Dec 14, 2017
Messages
1,496
Solutions
21
Reaction score
747
Location
Germany
Preview:

Regirst:

data/scripts/batman.lua

Required:

Lua:
local frostcharm = Action()

local config = {
effect = 44,
distanceEffect = 29
}

local condition = Condition(CONDITION_OUTFIT)
condition:setParameter(CONDITION_PARAM_TICKS, 4000)
condition:setOutfit({lookTypeEx = 7303})

local function freezeTimer(creature,pos,count)
    if count >= 1 and Creature(creature) then
        local spectators = Game.getSpectators(pos, false, false, 13, 13, 7, 7)
        if #spectators > 0 then
            for _,spectator in pairs(spectators) do
                if spectator:isPlayer() then
                    spectator:sendTextMessage(MESSAGE_HEALED, nil, pos, count, TEXTCOLOR_ORANGE)
                end
            end
        end
        addEvent(freezeTimer, 1000, creature, pos, count - 1)
    end
end

local function unfreeze(cid)
    local player = Player(cid)
    local pos = player:getPosition()
    pos:sendDistanceEffect(Position(pos.x+1, pos.y+1, pos.z), config.distanceEffect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y-1, pos.z), config.distanceEffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y-1, pos.z), config.distanceEffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y+1, pos.z), config.distanceEffect)
    player:say("UNFROZEN", TALKTYPE_MONSTER_SAY)
    pos:sendMagicEffect(config.effect)
    player:setMovementBlocked(false)
end

function frostcharm.onUse(player, item, fromPosition, target, toPosition, isHotkey)
      if not target:isPlayer() then
        player:sendCancelMessage('You can just freeze players')
        player:getPosition():sendMagicEffect(3)
        return false
    end
  
    if player:getExhaustion(7212) <= 0 then
        player:setExhaustion(7212, 10)
    else
        player:sendCancelMessage('You\'re exhausted for: '..player:getExhaustion(7212)..' seconds.')
        return true
    end
  
    local pos = target:getPosition()
    Position(pos.x+1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceEffect)
    Position(pos.x+1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceEffect)
    Position(pos.x-1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceEffect)
    Position(pos.x-1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceEffect)
    target:addCondition(condition)
    pos:sendMagicEffect(config.effect)
    target:say("FROZEN", TALKTYPE_MONSTER_SAY)
    target:setMovementBlocked(true)
    addEvent(freezeTimer, 1000, target.uid, target:getPosition(), 3000 / 1000)
    addEvent(unfreeze, 4000, target.uid)
    return true
end

frostcharm:id(2281)
frostcharm:register()
 
Last edited:
OP
Levi999x

Levi999x

AoT
Joined
Dec 14, 2017
Messages
1,496
Solutions
21
Reaction score
747
Location
Germany
Code:
attempt to call method 'setMovementBlocked' (a nil value)

Is this a custom function?

You are not using latest tfs.

Post automatically merged:

i am new, it works on tfs 1.2?
awesome script :)

No
you need this
 

Awesomedudei

Revolutionot.com
Joined
Jan 20, 2010
Messages
414
Solutions
1
Reaction score
171
Location
Sweden
You are not using latest tfs.

Post automatically merged:



No
you need this
Oh im using SaiyansKing/optimized_forgottenserver (https://github.com/SaiyansKing/optimized_forgottenserver)
This fork 👍 I'll add this
 
OP
Levi999x

Levi999x

AoT
Joined
Dec 14, 2017
Messages
1,496
Solutions
21
Reaction score
747
Location
Germany
///////batman.lua:45: attempt to call method 'getExhaustion' (a nil value)


Love it!
You saved me some trouble on the way. Thank you <3

nice man have fun :D
 

willy231

New Member
Joined
May 14, 2016
Messages
12
Reaction score
2
bro, you know how I can do so that when they are frozen they cannot heal or use spells :(
 

walltimer

Member
Joined
Aug 5, 2020
Messages
153
Reaction score
17



nice man have fun :D
i dont get it, how can i make it run? what do i have to change?
 
OP
Levi999x

Levi999x

AoT
Joined
Dec 14, 2017
Messages
1,496
Solutions
21
Reaction score
747
Location
Germany
i dont get it, how can i make it run? what do i have to change?

You must put it in global.lua then it will work :D
Post automatically merged:

i dont get it, how can i make it run? what do i have to change?

I think source edits are required for this or you edit all your spells and healing spells :D
 

Similar threads

Top