jondropss
New Member
- Joined
- Jul 19, 2020
- Messages
- 41
- Reaction score
- 2
hi, i have this script for my wand, and i was trying to change the hit color from physical damg, how i can do this?
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 = 0}, -- 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 = 422, sh = 106, dmg = COMBAT_DEATHDAMAGE, posx = 1, posy = 1},
[4] = {ef = 214, sh = 48, dmg = COMBAT_PHYSICALDAMAGE, posx = 1, posy = 1},
[5] = {ef = 81, sh = 105, 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.
doSendMagicEffect(pos, wx.ef)
doTargetCombatHealth(cid, target, wx.dmg, -min,-max, 4)
end
return true
end