XiolenceOT
New Member
- Joined
- Jun 5, 2023
- Messages
- 42
- Reaction score
- 4
I'm trying to see if anyone can help me figure this out, I'm trying to have the Vocation cast a spell that triggers the summon to cast the spel (exori) for example, but currently it's not doing anything except triggering the monster phrase. I know I must be missing something, I'm trying to do bit of everything learning the onUse functions for quests and ect. Movements.. But I want to have it do that and then the damage be formulated from the players magic level / level. If it's possible, I would really appreciate it, and be able to use the script as reference for the rest of the spells.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)
setCombatArea(combat, createCombatArea(AREA_SQUARE1X1))
function onGetFormulaValues(player, skill, attack, factor)
local min = (player:getLevel() / 5) + (skill * attack * 0.03) + 7
local max = (player:getLevel() / 5) + (skill * attack * 0.05) + 11
return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(player, variant)
local summons = player:getSummons()
if #summons > 0 then
for _, summon in ipairs(summons) do
doCombat(player, combat, variant, summon)
summon:say("Prepare to go berserk!", TALKTYPE_MONSTER_SAY)
end
return true
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have no summons.")
return false
end
end