Hashirama479
World of Ninja
- Joined
- Dec 19, 2016
- Messages
- 536
- Solutions
- 6
- Reaction score
- 74
as the title says the spell is kinda buged its working as supposed but theres a small bug, the damage is based on rebirths etc but there are 3 ues but just one of these 3 does damage you know? ( if you dont understand I can explain better xDD ) so can someone please fix it? im using tfs 0.4 rev3777
Code:
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 36)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 36)
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 36)
function onGetFormulaValues(cid, level, maglevel)
local rebirths = getPlayerStorageValue(cid,85987)
local min = (math.floor(level / 4) + level * 2.8 + 50) * rebirths
local max = (math.floor(level / 4) + level * 3.8 + 50) * rebirths
return -min, -max
end
setCombatCallback(combat1, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
setCombatCallback(combat3, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
local arr1 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
}
local arr2 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
}
local arr3 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end
function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end
function onTargetTile3(cid, pos)
doCombat(cid,combat3,positionToVariant(pos))
end
setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")
local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end
local function onCastSpell3(parameters)
doCombat(parameters.cid, acombat3, parameters.var)
end
function onCastSpell(cid, var)
local parameters = {cid = cid, var = var}
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 200, parameters)
addEvent(onCastSpell3, 400, parameters)
return true
end