quickdload
New Member
- Joined
- Mar 24, 2024
- Messages
- 5
- Reaction score
- 1
Hi,
Here is my "heal friend" spell .lua and the entry in .xml.
I've basically built it to heal the caster and any summons he currently has. I achieved this by modifying the mass healing spell to target the whole screen then altered the effects so that they only appeared on squares that you and your summons are currently standing on.
Anyway, it works well aside from one small aesthetic problem which is that whenever the caster uses this spell they get a black "targeting" square around them (the same square you get around a monster when it attacks you).
I wonder if anyway knows how this could be removed? Thank you.
Here is my "heal friend" spell .lua and the entry in .xml.
I've basically built it to heal the caster and any summons he currently has. I achieved this by modifying the mass healing spell to target the whole screen then altered the effects so that they only appeared on squares that you and your summons are currently standing on.
Anyway, it works well aside from one small aesthetic problem which is that whenever the caster uses this spell they get a black "targeting" square around them (the same square you get around a monster when it attacks you).
I wonder if anyway knows how this could be removed? Thank you.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setArea(createCombatArea(AREA_FULLSCREEN))
local healMonsters = false
function onTargetCreature(creature, target)
if not healMonsters then
local master = target:getMaster()
if target:isMonster() and not master or master and master:isMonster() then
return true
end
end
local player = creature:getPlayer()
local base = 200
local variation = 40
local value = math.random(-variation, variation) + base
local formula = 3 * player:getMagicLevel() + (2 * player:getLevel())
if formula <= 101 then
formula = 100
end
local total = formula * value / 100
doTargetCombatHealth(0, target, COMBAT_HEALING, total, total, CONST_ME_MAGIC_BLUE)
return true
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
Code:
<instant name="Heal Friend" words="exura sio" lvl="18" mana="70" prem="1" aggressive="0" blockwalls="1" needlearn="1" script="spells/heal friend.lua">
<vocation name="Druid" />
<vocation name="Elder Druid" />
</instant>