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

Programmer CONDITION_INVISIBLE - Make character invisible

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
TFS 1.2
Hi, this spell make player "invisible". It only set player outfit to 0, and player cannot be attacked. But other peoples can see this player, so, he's not invisible.
How can i edit source to make "CONDITION_INVISIBLE " works like '/ghost'?

1) Make CONDITION_INVISIBLE works like '/ghost' (player will not be seen during the spell's time)

How much costs?
 
I haven't tried it but it should work for players:
Lua:
local ghostTime = 1000 * 10 -- 10 seconds

local removeEvents = {}

local function removeGhost(playerId)
    local player = Player(playerId)
    if player then
        player:setGhostMode(false)
    end
end

function onCastSpell(creature, variant, isHotkey)
    local player = creature:getPlayer()
    if not player then return false end
    player:setGhostMode(true)
    local playerId = player:getId()
    stopEvent(removeEvents[playerId])
    removeEvents[playerId] = addEvent(removeGhost, ghostTime, playerId)
    return true
end
 
Back
Top