• 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.4] StopTime magic bugs if player dies with it!

boxxer321

Active Member
Joined
Nov 5, 2011
Messages
109
Reaction score
34
Hey, guys!

So, I have a spell on my server called "Stop Time" basically when a player uses it, the opposing player can't use anything for a certain amount of time, he gets "silenced".

It works perfectly if the player doesn't die with the effect of this magic, if he doesn't die "silenced", however, if the player still dies with the effect, he goes back to the temple infinitely silenced, time passes and he still can't use magic , HU and etc...

I wonder if any of you would know what's wrong with this magic.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)

setCombatParam(combat, COMBAT_PARAM_EFFECT, 19)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, true)
setCombatParam(combat, COMBAT_PARAM_TARGETPLAYERSORSUMMONS, true)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
local condition = createConditionObject(CONDITION_DRUNK)
setConditionParam(condition, CONDITION_PARAM_TICKS, 15000)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -300)
setCombatCondition(combat, condition)

local cooldown = 10
function mastime(cid)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exevo Gran Mas Time.")
end

function onCastSpell(cid, var)
         local function spell(cid)
               addEvent(spell, 1 * 750, cid)
               return doCombat(cid, combat, var)
         end
if getPlayerStorageValue(cid, 10569) == 1 then
doSendAnimatedText((getCreaturePosition(cid)), "Socorro!", 255)
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return false
end
local mags = {}
local pos = getCreaturePosition(cid)
local pos5 = getSpectators(pos, 1, 1)
pos.x = pos.x - 2
local pos1 = getSpectators(pos, 1, 1)
pos.x = pos.x + 4
local pos2 = getSpectators(pos, 1, 1)
pos.x = pos.x - 2
pos.y = pos.y - 2
local pos3 = getSpectators(pos, 1, 1)
pos.y = pos.y + 4
local pos4 = getSpectators(pos, 1, 1)
pos.y = pos.y - 3
pos.x = pos.x - 1
local pos6 = getSpectators(pos, 1, 1)
pos.x = pos.x + 2
local pos7 = getSpectators(pos, 1, 1)
pos.y = pos.y + 2
local pos8 =  getSpectators(pos, 1, 1)
pos.x = pos.x - 2
local pos9 = getSpectators(pos, 1, 1)
if pos1 ~= nil then
for r=1, #pos1 do
table.insert(mags, pos1[r])
end
end
if pos2 ~= nil then
for r=1, #pos2 do
table.insert(mags, pos2[r])
end
end
if pos3 ~= nil then
for r=1, #pos3 do
table.insert(mags, pos3[r])
end
end
if pos4 ~= nil then
for r=1, #pos4 do
table.insert(mags, pos4[r])
end
end
if pos5 ~= nil then
for r=1, #pos5 do
table.insert(mags, pos5[r])
end
end
if pos6 ~= nil then
for r=1, #pos6 do
table.insert(mags, pos6[r])
end
end
if pos7 ~= nil then
for r=1, #pos7 do
table.insert(mags, pos7[r])
end
end
if pos8 ~= nil then
for r=1, #pos8 do
table.insert(mags, pos8[r])
end
end
if pos9 ~= nil then
for r=1, #pos9 do
table.insert(mags, pos9[r])
end
end
for i,v in ipairs(mags) do
if v == cid then
table.remove(mags, i)
end
if getTilePzInfo(getCreaturePosition(v)) then
table.remove(mags, i)
end
end
for t=1, #mags do
if mags[t] ~= cid and doCombat(cid, combat, var) then
doSendMagicEffect((getCreaturePosition(mags[t])), 19)
doSendAnimatedText((getCreaturePosition(mags[t])), "Socorro!", 255)
doPlayerSetStorageValue(mags[t], 10569, 1)
local zxzx = mags[t]
function back(zxzx)
doPlayerSetStorageValue(zxzx, 10569, -1)
end
addEvent(back, 5000, zxzx)
end
end
if exhaustion.check(cid, 23006) == false then
exhaustion.set(cid, 23006, cooldown)
addEvent(mastime, cooldown*1000, cid)
return doCombat(cid, combat, var)

else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "Golpe em cooldown por " ..exhaustion.get(cid, 23006).." segundos")
return false
end
    return doCombat(cid, combat, var)
end
 
Back
Top