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

Windows Spell working perfectly but does no damage

juansanchez

Intermediate OT User
Joined
Apr 2, 2015
Messages
217
Reaction score
130
Hello Otland, i'm having a small problem with my server. I'm trying to change my server version to Tibia 10.90, and of course, some of my old scripts from my TFS 0.3.6 are not working on the TFS 1.2.

I have this spell from a custom vocation on my server, the spell worked fine on the old tfs, then i tried bringing it to the new one, and as the titlle says, the spell does no damage. The sprite works perfectly.
I was wondering if anyone could help me out with it.

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, true)

arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

function spellCallback(param)
local form = 3.5

if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_MORTAREA)
doAreaCombatHealth(param.cid, COMBAT_DEATHDAMAGE, param.pos, 0, -(((form*getPlayerLevel(param.cid)/2)*getPlayerMagLevel(param.cid))/20)/2, -(((form*getPlayerLevel(param.cid)/2)*getPlayerMagLevel(param.cid))/20), CONST_ME_EXPLOSIONHIT)
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 3000), param)
end
end

function onCastSpell(cid, var)
doPlayerSetPzLocked(cid)
return doCombat(cid, combat, var)
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
doSetCreatureOutfit(cid,{lookType = 290, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}, 18 * 1000)
return doCombat(cid, combat, var)
end

This is the spell script. If anyone can help me fix it i would be very grateful.

I'm using TFS 1.2, Tibia version 10.90 (not sure if the version matters)
 
change the numbers
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
 
change the numbers
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},

Thanks for the Help Sirspray, but i'm pretty sure i am retarded, because i tried the spell today and it is doing damage. The first time i tried it didn't, now it does... Somehow it fixed itself.
 
Back
Top