jondropss
New Member
- Joined
- Jul 19, 2020
- Messages
- 41
- Reaction score
- 2
Hello otland friends. I am using a script to centralize the spell sprites on my narutibia server. Version 8.6 Tfs 0.4
However ... when using this script, the weapon stops damaging ... only the centralized effects sprites are showing, but without damage.
Could someone help me?
---> SCRIPT I'M USING NOW:
However ... when using this script, the weapon stops damaging ... only the centralized effects sprites are showing, but without damage.
Could someone help me?
---> SCRIPT I'M USING NOW:
Lua:
local min, max = 1700,1900 --Ataque mínino e ataque máximo
local w = {
[1] = {ef = 173, sh = 41, dmg = COMBAT_FIREDAMAGE, posx = 1, posy = 1}, -- Isto seria a aplicação dentro da tabela, bastaria replicar em cada linha adicionada.
[2] = {ef = 117, sh = 101, dmg = COMBAT_ICEDAMAGE, posx = 1, posy = 1},
[3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE, posx = 1, posy = 1},
[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE, posx = 1, posy = 1},
[5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE, posx = 1, posy = 1},
[6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE, posx = 1, posy = 1},
[7] = {ef = 81, sh = 104, dmg = COMBAT_HOLYDAMAGE, posx = 1, posy = 1}
}
function onUseWeapon(cid, var)
local effect = getPlayerStorageValue(cid, 4561)
local target = getCreatureTarget(cid)
if target ~= 0 then
local wx = w[effect] or w[math.random(#w)]
doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
local pos = {x = getThingPos(target).x + (wx.posx), y = getThingPos(target).y + (wx.posy), z = getThingPos(target).z} -- Aqui vai trabalhar em cima das posições definidas la na tabela.
addEvent(doAreaCombatHealth, 100, cid, wx.dmg, pos, 0, -min, -max, wx.ef) -- E aqui vai aplicar o efeito na posição final.
end
return true
end