Thanks, now I get what your problem is and what you want.
You want so that the part of the area of the spell that doesn't touch something solid(
a wall for example), still gets executed.
Now I also understand why you commented out those lines in the sources, but that was a prime example of a
Duct tape Fix, while solving the issue it also created further complications.
I think there are 2 possible solutions to this, possibly more:
1. Finding a way inside
exori_min.lua to make part of the
area ignore walls.
2. Changing how the
direction="1" variable in spells.lua works with areas (
createCombatArea), either by script or in sources.
Since the way it currently works is that it's checking if something solid is in front of the player and then denies the spell if there is.
You want the walls to continue blocking the way they currently do, so I wouldn't recommend messing with that code anymore.
What you want is for
direction to check if there is any part of the spell that is not blocked close to the player, then make it cast it if that is true.
I made this test script to replicate your problem, maybe someone more enlightened can solve this:
test-exori_min.lua
Lua:
local exori_min = {
{1, 3, 1}
}
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(exori_min))
function onGetFormulaValues(player, skill, attack, factor)
local min = (skill + attack) * 1
local max = (skill + attack) * 2
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
spells.lua
XML:
<instant group="attack" spellid="80" name="Test" words="exori min" magiclevel="0" mana="0" premium="0" needweapon="1" direction="1" blockwalls="1" cooldown="2000" groupcooldown="2000" needlearn="0" script="test/test-exori_min.lua" />
I have no idea how blockwalls="1" works, but as far as I could tell, it didn't solve the problem.
I'm quite positive that the issue is in direction="1" because non directed spells works as you'd want them too, like Berserk for example:
View attachment 42557
I would even say that you might've found yourself a bug in the sources that should be reviewed by the TFS team.
I'll keep trying aswell, but I'm more or less a
script kiddie when it comes to C++.
I guarantee you though that someone on this forum can and most likely will solve your problem.