Edit: or did you mean that the L key isn't working? If not, then it's a bug in LoG.
I get it, you meant that before you knew that you have to press the "rest key" there was no way to continue...
better go to sleep.

Code: Select all
-- Common hook for all items if food category
fw.addHooks('items_food','insectoids_dont_eat_food',{
onUseItem = function(self,champion)
if champion:getRace() == 'Insectoid' then
hudPrint("Yarrrgghh! I dont't "..self:getUIName().." you fool!")
return false
end
end
})
Code: Select all
illusion_walls.activeWalls[wall.id] = wall
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
-- returns an iterator which iterates all entities at level filtered by names-list.
-- If level is not defined, entites at party.level are iterated
-- Examples:
-- for entity in help.iEntitiesByName('snail',1) do
-- print(entity.id)
-- end
--
-- for entity in help.iEntitiesByName({'snail','crowern'}) do ...
function iEntitiesByName (names,level)
if type(names) == 'string' then names = {names} end
level = level or party.level
local allEntsIt = allEntities(level)
names = help.tableToSet(names)
local iter = function()
local nextEnt = allEntsIt()
while nextEnt do
if names[nextEnt.name] then
return nextEnt
end
nextEnt = allEntsIt()
end
end
return iter
end
Code: Select all
createSpell(
{
name = "hold_monster",
uiName = "Hold monster",
skill = "spellcraft",
level = 0,
runes = "AC",
manaCost = 15,
}
)
createSpell(
{
name = "magic_missile",
uiName = "Magic missile",
skill = "fire_magic",
level = 0,
runes = "AD",
manaCost = 15,
}
)
Code: Select all
activeSpells = {}
immunityList = {}
immunityList.hold_monster = {
skeleton_archer=true,
skeleton_warrior=true
}
function activate()
addSpell('hold_monster',holdMonster)
addSpell('magic_missile',magicMissile)
end
function addSpell(spellName,hookFunction)
fw.addHooks(spellName,'fw_spells',{
onCast = hookFunction
}
)
end
function magicMissile(champ, x, y, direction, skill)
local dx,dy = getForward(party.facing)
playSoundAt("fireball_launch",party.level,party.x,party.y)
shootProjectile('magic_missile', party.level, party.x+dx, party.y+dy, direction, 14, 0, 0, 0, 0, 0, skill*5, nil, true)
end
function shootSpell(fx,dir,speed)
local timer = spawn('timer',party.level,0,0,0)
end
function holdMonster(champ, x, y, direction, skill)
local holdMonster = function() return false end
local monster = help.nextEntityAheadOf(party,3,'monster')
if not monster then return false end
if immunityList.hold_monster[monster.name] then return false end
local timerId = createSpellTimer(monster,10+skill,'holdMonsterDestructor')
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
function holdMonsterDestructor(timer)
fw.removeHooks(activeSpells[timer.id],timer.id)
fw.debugPrint(activeSpells[timer.id]..' unheld')
timer:deactivate()
timer:destroy()
end
-- creates a spell timer
-- entity = affected entity,
-- time = how many seconds spells effect lasts
-- destructorName = name of the function which is called when the effect of the spell is worn out.
-- returns id of timer
function createSpellTimer(entity,time,destructorName)
local timer = spawn('timer',party.level,0,0,0)
timer:setTimerInterval(time)
-- store entity.id to table indexed by timer.id so we can access it in spell-destructor
activeSpells[timer.id] = entity.id
timer:addConnector('activate','fw_spells',destructorName)
timer:activate()
return timer.id
end
Code: Select all
defineObject{
name = "magic_missile",
class = "Item",
uiName = "Magic missile",
model = "assets/models/items/quarrel.fbx", --assets/models/items/arrow.fbx
--ammoType = "arrow",
gfxIndex = 109,
attackPower = 1,
impactSound = "fireball_hit",
particleEffect = "magic_missile",
stackable = false,
sharpProjectile = false,
projectileRotationY = 90,
weight = 0.1,
}
defineParticleSystem{
name = "magic_missile",
emitters = {
-- flames
{
emissionRate = 50,
emissionTime = 0,
maxParticles = 50,
boxMin = {-0.0, -0.0, 0.0},
boxMax = { 0.0, 0.0, -0.0},
sprayAngle = {0,360},
velocity = {0.3, 0.3},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 64,
frameCount = 16,
lifetime = {0.8, 0.8},
colorAnimation = true,
color0 = {1, 1, 1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.125, 0.25},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 1,
blendMode = "Additive",
objectSpace = true,
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.8, 0.8},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
}
}
}