srunobantana
Member
- Joined
- Oct 24, 2021
- Messages
- 41
- Reaction score
- 18
Could someone guide me on how to reposition the effect of these weapons? I need it to be 1 down and 1 to the right, but I'm having trouble with it.
I'm using: combat:setParameter(COMBAT_PARAM_EFFECT, 198).
LUA:
área local = createCombatArea( {
{0, 0, 0},
{0, 3, 0},
{0, 0, 0}
})
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 198)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_NONE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
-- combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)
combat:setArea(area)
function onGetFormulaValues(player, skill, attack, factor)
local level = player:getLevel()
local distanceSkill = player:getSkillLevel(SKILL_DISTANCE)
local base = (level * 2) + (distanceSkill * 2) + attack
local min = base + 1000
local max = base + 1500
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(player, variant)
if player:getSkull() == SKULL_BLACK then
return false
end
return combat:execute(player, variant)
end
Post automatically merged:
Solution:
LUA:
local area = createCombatArea({
{0, 0, 0},
{0, 3, 0},
{0, 0, 0}
})
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(area)
function onGetFormulaValues(player, skill, attack, factor)
local level = player:getLevel()
local distanceSkill = player:getSkillLevel(SKILL_DISTANCE)
local base = (level * 2) + (distanceSkill * 2) + attack
local min = base + 1000
local max = base + 1500
return -min, -max
end
function onTargetTile(player, position)
local effectPosition = Position(position.x + 1, position.y + 1, position.z)
effectPosition:sendMagicEffect(198)
return true
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onUseWeapon(player, variant)
if player:getSkull() == SKULL_BLACK then
return false
end
return combat:execute(player, variant)
end
Last edited: