

Code: Select all
if (e.name == 'dungeon_illusion_wall' or e.name == 'eob_sewers_illusion_wall' or e.name == 'eob_sewers_illusion_wall_rune')...
Code: Select all
if not findEntity(wall.id.."_fake") then
spawn(wall.name.."_fake", wall.level, wall.x, wall.y, wall.facing, wall.id.."_fake")
end
Code: Select all
createSpell{
name = "burning_hands",
uiName = "Burning hands",
skill = "fire_magic",
level = 0,
runes = "B",
manaCost = 10,
}
createSpell{
name = "shield",
uiName = "Shield",
skill = "fire_magic",
level = 0,
runes = "D",
manaCost = 10,
}
Code: Select all
settings = {}
settings.useCasterLevelAsModifier = false
settings.hold_monster = {}
settings.hold_monster.duration = 5 --seconds + (skill/2)
settings.hold_monster.immune= {
skeleton_archer=true,
skeleton_warrior=true
}
settings.magic_missile = {}
settings.magic_missile.damage = 5 -- damage * (skill / 2)
settings.shield = {}
settings.shield.duration = 5 --seconds + (skill/2)
settings.shield.missiles = 6 -- how many damagepoints are subtracted (max value)
settings.shield.throwing = 8 -- how many damagepoints are subtracted (max value)
settings.burning_hands = {}
settings.burning_hands.damage = 3 -- damage+skill*2
function activate()
fw_magic.addSpell('hold_monster',holdMonster)
fw_magic.addSpell('magic_missile',magicMissile)
fw_magic.addSpell('burning_hands',burningHands)
fw_magic.addSpell('shield',shield)
end
-- BURNING HANDS --
function burningHands(caster, x, y, direction, skill)
if (useCasterLevelAsModifier) then skill = caster:getLevel() end
local dx,dy = getForward(direction)
playSoundAt("fireburst",party.level,x,y)
damageTile(party.level, x+dx, y+dy, direction, 0, 'fire', settings.burning_hands.damage+skill*2)
end
-- SHIELD --
function shield(caster, x, y, direction, skill)
if (useCasterLevelAsModifier and caster.getLevel) then skill = caster:getLevel() end
local timerId = fw_magic.createSpellTimer(caster,settings.shield.duration+skill/2,{'eob_spells','shieldDestructor'})
playSoundAt("fireball_launch",party.level,x,y)
fw.addHooks(fw.getId(caster),timerId,{
onProjectileHit = function(champion,projectile,damage,damageType)
if projectile.name == 'magic_missile' then
hudPrint('Magic missile deflected')
return false
end
if help.isEntityType(projectile,'item_missileweapon') then
champion:damage(damage - math.random(settings.shield.missiles), damageType)
hudPrint('Shield spell deflected some damage')
champion:playDamageSound()
return false
end
if help.isEntityType(projectile,'item_throwingweapon') then
champion:damage(damage - math.random(settings.shield.throwing), damageType)
hudPrint('Shield spell deflected some damage')
champion:playDamageSound()
return false
end
end
}
)
end
function shieldDestructor(timer)
fw_magic.spellTimerDestructor(timer)
hudPrint('Effect of shield spell worn out.')
end
-- MAGIC MISSILE --
function magicMissile(caster, x, y, direction, skill)
if (useCasterLevelAsModifier) then skill = champ:getLevel() end
if caster and caster.getOrdinal then caster = party end
playSoundAt("fireball_launch",party.level,x,y)
shootProjectile('magic_missile', party.level, x, y, direction, 14, 0, 0, 0, 0, 0,
settings.magic_missile.damage * (skill / 2), caster, true)
end
-- HOLD MONSTER --
function holdMonster(champ, x, y, direction, skill)
if (useCasterLevelAsModifier) then skill = champ:getLevel() end
local holdMonster = function() return false end
local monster = help.nextEntityAheadOf(party,3,'monster')
if not monster then return false end
if settings.hold_monster.immune[monster.name] then return false end
local timerId = fw_magic.createSpellTimer(monster,settings.hold_monster.duration+(skill/2))
playSoundAt("frostbolt_launch",party.level,party.x,party.y)
fw.debugPrint(monster.id..' held')
--dynamically add hooks which prevents monster to attack or move
-- use spellId as hook-id so the hook can be removed on destructor
fw.addHooks(monster.id,timerId,{
onMove = holdMonster,
onAttack = holdMonster,
onRangedAttack = holdMonster,
onTurn = holdMonster
},
1)
return true
end
Terrific! The most clever idea I ever heard.So when you cast armor (rune F) a target selector (magic orb) is spawned as a mouse item, then when you left click a champion (or place selector on champions hand) the armor spell is casted on selected champion and selector is destroyed. I'm pretty proud of this one
Good point, I have to test that. But I think that even if it doesn't work I can fix it by removing one item from inventory temporarily when spell is cast and put it back to inventory after the selector is destroyed.SinusPi wrote:Just a thought... Does the shield selector work when the target's inventory is full..? Since it's a fake item and all...
But, you don't know which character is going to be the target - and if you just remove items temporarily, and then the player runs around with the "healing sphere" on their mouse cursor, and happens to pick up dropped ammo... Mayhem will ensue.I can fix it by removing one item from inventory temporarily