Initial commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
magic_casting_effect()
|
||||
magic_casting_fade_effect()
|
||||
|
||||
local qty = math.random(1,10)
|
||||
|
||||
local obj = Obj.new(129,0,0,qty)
|
||||
|
||||
Obj.moveToInv(obj, magic_get_caster())
|
||||
|
||||
print("\nCreate " .. obj.qty .. " food.\n")
|
||||
@@ -0,0 +1,58 @@
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
local magical_tiles = {
|
||||
[0x207] = 1,[0x20F] = 1,[0x216] = 1,[0x22F] = 1,[0x232] = 1,[0x235] = 1,[0x238] = 1,[0x239] = 1,[0x23D] = 1,
|
||||
[0x248] = 1,[0x249] = 1,[0x24A] = 1,[0x24B] = 1,[0x24C] = 1,[0x24D] = 1,[0x24E] = 1,[0x24F] = 1,[0x251] = 1,
|
||||
[0x252] = 1,[0x253] = 1,[0x255] = 1,[0x256] = 1,[0x257] = 1,[0x25A] = 1,[0x25B] = 1,[0x25C] = 1,[0x25D] = 1,
|
||||
[0x25F] = 1,[0x26E] = 1,[0x2B6] = 1,[0x31E] = 1,[0x31F] = 1,[0x326] = 1,[0x368] = 1,[0x369] = 1,[0x36A] = 1,
|
||||
[0x36B] = 1,[0x36C] = 1,[0x36D] = 1,[0x36E] = 1,[0x36F] = 1,[0x37D] = 1,[0x37E] = 1,[0x37F] = 1,[0x3A8] = 1,
|
||||
[0x3A9] = 1,[0x3AA] = 1,[0x3AB] = 1,[0x3AC] = 1,[0x3AD] = 1,[0x3AE] = 1,[0x3AF] = 1,[0x3FD] = 1,[0x3FE] = 1,
|
||||
[0x40C] = 1,[0x40D] = 1,[0x40E] = 1,[0x40F] = 1,[0x41C] = 1,[0x41D] = 1,[0x41E] = 1,[0x41F] = 1,[0x42C] = 1,
|
||||
[0x42D] = 1,[0x42E] = 1,[0x42F] = 1,[0x43C] = 1,[0x43D] = 1,[0x43E] = 1,[0x43F] = 1,[0x484] = 1,[0x485] = 1,
|
||||
[0x48E] = 1,[0x48F] = 1,[0x6D0] = 1,[0x6D1] = 1,[0x6D2] = 1,[0x6D3] = 1}
|
||||
|
||||
local potion_name = {
|
||||
[0] = "an awaken",
|
||||
[1] = "a cure",
|
||||
[2] = "a heal",
|
||||
[3] = "a poison",
|
||||
[4] = "a sleep",
|
||||
[5] = "a protection",
|
||||
[6] = "an invisibility",
|
||||
[7] = "an xray vision",
|
||||
[8] = "an unknown"
|
||||
}
|
||||
|
||||
fade_obj_blue(obj)
|
||||
|
||||
if magical_tiles[obj.tile_num] ~= nil then
|
||||
--magical object.
|
||||
if obj.obj_n == 0x113 then
|
||||
local frame_n = obj.frame_n
|
||||
if frame_n > 8 then
|
||||
frame_n = 8
|
||||
end
|
||||
print("\nIt's " .. potion_name[frame_n] .. " potion.\n")
|
||||
else
|
||||
print("\nIt's magical.\n")
|
||||
end
|
||||
else
|
||||
--not magical
|
||||
local has_charge = false
|
||||
local child
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
if child.obj_n == 0x150 then --charge
|
||||
has_charge = true
|
||||
print("\nIt shows a charge of " .. magic_spell_name(child.quality) .. ".\n")
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if has_charge == false then
|
||||
print("\nIt's not magical.\n")
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
local caster = magic_get_caster()
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
fade_obj_blue(obj)
|
||||
local found = false
|
||||
|
||||
local dice_roll = math.random(1, 0x1e)
|
||||
local actor_int = actor_int_adj(caster)
|
||||
|
||||
if actor_int >= dice_roll then
|
||||
local child
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
if child.obj_n == 337 then --effect
|
||||
found = true
|
||||
print("\nIt's trapped.\n");
|
||||
break
|
||||
end
|
||||
end
|
||||
child = nil
|
||||
end
|
||||
|
||||
if found == false then
|
||||
print("\nNo trap.\n");
|
||||
end
|
||||
|
||||
obj = nil
|
||||
@@ -0,0 +1,9 @@
|
||||
local actor = select_actor_with_projectile(0x17f)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
if magic_remove_actor_enchantments(actor) == true then
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
local obj = select_obj_with_projectile(0x18b)
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
if obj.obj_n == 122 or --candle
|
||||
obj.obj_n == 145 or --candelabra
|
||||
obj.obj_n == 164 or --fireplace
|
||||
obj.obj_n == 90 or --torch
|
||||
(obj.obj_n == 206 and obj.frame_n == 1) then --flaming brazier
|
||||
fade_obj_blue(obj)
|
||||
if obj.frame_n == 1 or obj.frame_n == 3 then
|
||||
if obj.obj_n == 90 then
|
||||
Obj.use(obj) -- we want to use usecode to remove the torch
|
||||
else
|
||||
obj.frame_n = obj.frame_n - 1;
|
||||
end
|
||||
return magic_success()
|
||||
end
|
||||
end
|
||||
|
||||
return magic_no_effect()
|
||||
@@ -0,0 +1,8 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17f, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
if spell_hit_actor(caster, actor, 5) == false then --5 = harm spell number
|
||||
magic_failed()
|
||||
end
|
||||
@@ -0,0 +1,22 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17f, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
fade_actor_blue(actor)
|
||||
|
||||
if actor.alive == true then
|
||||
local hp = actor.hp
|
||||
local max_hp = actor.max_hp
|
||||
|
||||
hp = hp + math.random(1, 0x1e)
|
||||
if hp > max_hp then
|
||||
hp = max_hp
|
||||
end
|
||||
|
||||
actor.hp = hp
|
||||
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
magic_casting_effect()
|
||||
play_sfx(SFX_KAL_LOR, true)
|
||||
if g_armageddon == false then
|
||||
party_resurrect_dead_members()
|
||||
end
|
||||
party_heal()
|
||||
player_move(0x133, 0x160, 0, true)
|
||||
get_LB_to_throne()
|
||||
|
||||
fade_in() --FIXME the original fades from current location. We fade from black.
|
||||
@@ -0,0 +1,25 @@
|
||||
local obj = select_obj_with_projectile(0x18d)
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
if obj.obj_n == 122 or --candle
|
||||
obj.obj_n == 145 or --candelabra
|
||||
obj.obj_n == 164 or --fireplace
|
||||
obj.obj_n == 90 or --torch
|
||||
(obj.obj_n == 206 and obj.frame_n == 0) then --flaming brazier
|
||||
fade_obj_blue(obj)
|
||||
if obj.frame_n == 0 or obj.frame_n == 2 then
|
||||
if obj.obj_n == 90 then
|
||||
Obj.use(obj) -- we want to use usecode to remove the torch
|
||||
else
|
||||
obj.frame_n = obj.frame_n + 1;
|
||||
end
|
||||
|
||||
return magic_success()
|
||||
end
|
||||
elseif obj.obj_n == 0xdf and obj.frame_n == 0 then --unlit keg
|
||||
use_keg(obj)
|
||||
return magic_success()
|
||||
end
|
||||
|
||||
return magic_no_effect()
|
||||
@@ -0,0 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_LIGHT, 0x64)
|
||||
@@ -0,0 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_INFRAVISION, 0x14)
|
||||
@@ -0,0 +1,24 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x236, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
local random = math.random
|
||||
|
||||
if (((actor_dex_adj(actor) / 2) + 0x1e) - actor_int_adj(caster)) / 2 <= random(1, 0x1e) then
|
||||
|
||||
print("\n")
|
||||
|
||||
local dmg = random(1, 0xa)
|
||||
local exp = actor_hit(actor, dmg)
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
actor_hit_msg(actor)
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
|
||||
else
|
||||
magic_failed()
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17c, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
local return_val = spell_poison_actor(caster, actor)
|
||||
|
||||
if return_val == 2 then
|
||||
magic_no_effect()
|
||||
elseif return_val == 1 then
|
||||
magic_failed()
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local loc = select_location_with_prompt("Location: ")
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
if loc == nil or g_vanish_obj.obj_n == 0 then magic_no_effect() return end
|
||||
|
||||
local hit_x, hit_y = map_line_hit_check(caster.x, caster.y, loc.x, loc.y, loc.z)
|
||||
projectile(0x17f, caster.x, caster.y, hit_x, hit_y, 2)
|
||||
|
||||
if hit_x ~= loc.x or hit_y ~= loc.y then magic_blocked() return end
|
||||
|
||||
local obj = Obj.new(g_vanish_obj.obj_n, g_vanish_obj.frame_n)
|
||||
obj.qty = 1
|
||||
obj.status = 0x21 --OK, TEMP
|
||||
if map_can_put_obj(loc) == false then
|
||||
magic_no_effect()
|
||||
else
|
||||
Obj.moveToMap(obj, loc)
|
||||
fade_obj_in(obj)
|
||||
g_vanish_obj.obj_n = 0
|
||||
g_vanish_obj.frame_n = 0
|
||||
magic_success()
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17d, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
local ret = spell_put_actor_to_sleep(caster,actor)
|
||||
|
||||
if ret == 1 then
|
||||
magic_failed()
|
||||
elseif ret == 2 then
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
local caster = magic_get_caster()
|
||||
item = select_actor_or_obj_with_projectile(0x17f)
|
||||
|
||||
if item == nil then return end
|
||||
|
||||
if item.luatype == "obj" then
|
||||
fade_obj_blue(item)
|
||||
if item.obj_n == 0x120 or item.obj_n == 0x10c then --crank, lever
|
||||
Obj.use(item)
|
||||
elseif item.weight >= 0.01 then
|
||||
local dir = get_direction("Direction-")
|
||||
print("`"..direction_string(dir).."\n")
|
||||
local new_x, new_y = direction_get_loc(dir, item.x, item.y)
|
||||
if map_can_put_obj(new_x, new_y, item.z) == true then
|
||||
Obj.moveToMap(item, new_x, new_y, item.z)
|
||||
else
|
||||
print("\nBlocked\n")
|
||||
end
|
||||
else
|
||||
print("\nNot Possible\n")
|
||||
end
|
||||
else
|
||||
magic_no_effect() --do nothing with actors.
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
fade_obj_blue(obj)
|
||||
|
||||
if (obj.obj_n >= 297 and obj.obj_n <= 300) or obj.obj_n == 98 then -- if door or chest
|
||||
|
||||
-- find existing effect in obj container.
|
||||
local found_effect = false
|
||||
local child
|
||||
for child in container_objs(obj) do
|
||||
if child ~= nil and child.obj_n == 337 then
|
||||
found_effect = true
|
||||
end
|
||||
end
|
||||
|
||||
child = nil
|
||||
|
||||
--add effect if no existing effect found in container.
|
||||
if found_effect == false then
|
||||
local effect = Obj.new(337)
|
||||
Obj.moveToCont(effect, obj)
|
||||
effect = nil
|
||||
obj = nil
|
||||
return magic_success()
|
||||
end
|
||||
end
|
||||
|
||||
magic_no_effect()
|
||||
|
||||
obj = nil
|
||||
@@ -0,0 +1,15 @@
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
if obj.obj_n >= 297 and obj.obj_n <= 300 and obj.frame_n >= 13 then --magically locked door
|
||||
obj.frame_n = obj.frame_n - 8
|
||||
return print("\nunlocked!\n");
|
||||
elseif obj.obj_n == 0x62 and obj.frame_n == 3 then --magically locked chest
|
||||
obj.frame_n = 1
|
||||
return print("\nunlocked!\n");
|
||||
end
|
||||
|
||||
magic_no_effect()
|
||||
@@ -0,0 +1,26 @@
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
local found = false
|
||||
|
||||
fade_obj_blue(obj)
|
||||
|
||||
if (obj.obj_n >= 297 and obj.obj_n <= 300) or obj.obj_n == 98 then -- if door or chest
|
||||
local child
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
if child.obj_n == 337 then --effect
|
||||
found = true
|
||||
Obj.removeFromCont(child)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if found == true then
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local obj = select_obj_with_projectile(0x17f, caster)
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
if tile_get_flag(obj.tile_num, 3, 3) == true then
|
||||
g_vanish_obj.obj_n = obj.obj_n
|
||||
g_vanish_obj.frame_n = obj.frame_n
|
||||
|
||||
fade_obj_out(obj)
|
||||
map_remove_obj(obj)
|
||||
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
local actor = select_actor_with_projectile(0x17f)
|
||||
|
||||
if actor == nil then return end
|
||||
if is_god_mode_enabled() and actor.in_party then
|
||||
return
|
||||
end
|
||||
actor.cursed = true
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Dispel Field, An Grav
|
||||
|
||||
-- 317 Fire Field
|
||||
-- 318 Poison Field
|
||||
-- 319 Protection Field
|
||||
-- 320 Sleep Field
|
||||
|
||||
local obj = select_obj_with_projectile(0x17f)
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
|
||||
if obj.obj_n >= 317 and obj.obj_n <= 320 then
|
||||
hit_anim(obj.x, obj.y)
|
||||
map_remove_obj(obj)
|
||||
obj = nil
|
||||
return magic_success()
|
||||
end
|
||||
|
||||
|
||||
obj = nil
|
||||
magic_no_effect()
|
||||
@@ -0,0 +1,6 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17e, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
spell_take_fire_dmg(caster, actor)
|
||||
@@ -0,0 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_LIGHT, 0xff)
|
||||
@@ -0,0 +1,25 @@
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
if obj.obj_n >= 297 and obj.obj_n <= 300 then
|
||||
if obj.frame_n <= 7 then
|
||||
if obj.frame_n <= 3 then
|
||||
print("\nCan't (Un)lock an opened door\n")
|
||||
else
|
||||
--FIXME need to handle a door which is already magically locked.
|
||||
if obj.frame_n >= 5 and obj.frame_n <= 7 then
|
||||
obj.frame_n = obj.frame_n + 8
|
||||
print("\nmagically locked!\n")
|
||||
end
|
||||
end
|
||||
magic_success()
|
||||
end
|
||||
elseif obj.obj_n == 0x62 and (obj.frame_n == 1 or obj.frame_n == 2) then
|
||||
obj.frame_n = 3
|
||||
print("\nmagically locked!\n")
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
local loc = select_location_with_projectile(0x18b)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17f,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
v.asleep = false
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x18b, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17d,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
spell_put_actor_to_sleep(caster, v)
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,2 @@
|
||||
magic_casting_effect()
|
||||
peer_effect()
|
||||
@@ -0,0 +1,6 @@
|
||||
local actor = select_actor_with_projectile(0x17f)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
actor.protected = true
|
||||
magic_success()
|
||||
@@ -0,0 +1,25 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local x = caster.x
|
||||
local y = caster.y
|
||||
local z = caster.z
|
||||
local loc_x = x
|
||||
local loc_y = y
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
for x = x - 5,loc_x + 5 do
|
||||
for y = y - 5,loc_y + 5 do
|
||||
local actor = map_get_actor(x, y, z)
|
||||
|
||||
if actor ~= nil then
|
||||
local actor_type = actor_tbl[actor.obj_n]
|
||||
if actor_type ~= nil and actor_type[14] == 1 and actor_int_check(actor, caster) == false then --14 repel undead flag
|
||||
actor.wt = WT_UNK_13
|
||||
dbg("setting actor["..actor.actor_num.."] to timid worktype.\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,11 @@
|
||||
local obj = select_obj_with_projectile(0x17f)
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
if obj_is_readiable(obj) then
|
||||
actor = Actor.new(obj.obj_n, obj.x, obj.y, obj.z, ALIGNMENT_GOOD, 8)
|
||||
map_remove_obj(obj)
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,42 @@
|
||||
local caster = magic_get_caster()
|
||||
magic_casting_effect()
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
local random = math.random
|
||||
|
||||
local i = random(0, 0xf)
|
||||
|
||||
local obj_n = 0
|
||||
|
||||
if i <= 3 then
|
||||
obj_n = 0x173 --troll
|
||||
elseif i <= 6 then
|
||||
obj_n = 0x156 --giant rat
|
||||
elseif i <= 9 then
|
||||
obj_n = 0x169 --giant spider
|
||||
elseif i <= 0xc then
|
||||
obj_n = 0x158 --giant bat
|
||||
else
|
||||
obj_n = 0x166 --snake
|
||||
end
|
||||
|
||||
local from_x = caster.x
|
||||
local from_y = caster.y
|
||||
local from_z = caster.z
|
||||
|
||||
for i=1,8 do
|
||||
local new_x = random(0, 10) + from_x - 5
|
||||
local new_y = random(0, 10) + from_y - 5
|
||||
if map_can_put(new_x, new_y, from_z) then
|
||||
local actor = Actor.new(obj_n, new_x, new_y, from_z)
|
||||
if actor ~= nil then
|
||||
actor.align = caster.align
|
||||
actor.wt = WT_ASSAULT
|
||||
magic_success()
|
||||
return
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
magic_failed()
|
||||
@@ -0,0 +1,10 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if actor == nil then magic_no_effect() return end
|
||||
|
||||
if spell_hit_actor(caster, actor, 50) == false then -- 50 = disable spell number
|
||||
magic_failed()
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
loc = select_location_with_projectile(0x17e)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
obj = Obj.new(317); --fire field
|
||||
obj.temporary = true
|
||||
obj.x,obj.y,obj.z = loc.x,loc.y,loc.z
|
||||
Obj.moveToMap(obj)
|
||||
fade_obj_in(obj)
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17f, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
fade_actor_blue(actor)
|
||||
|
||||
if actor.alive == true then
|
||||
actor.hp = actor.max_hp
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
local caster = magic_get_caster()
|
||||
magic_casting_fade_effect(caster)
|
||||
magic_casting_effect()
|
||||
local x,y,z = caster.x,caster.y,caster.z
|
||||
x,y = math.floor(x / 8), math.floor(y / 8)
|
||||
local lat,lon
|
||||
if x > 38 then x, lon = x - 38, "E" else x, lon = 38 - x, "W" end
|
||||
if y > 45 then y, lat = y - 45, "S" else y, lat = 45 - y, "N" end
|
||||
print("\n"..y.."{"..lat..", "..x.."{"..lon.."\n");
|
||||
@@ -0,0 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x18b, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17f,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
magic_remove_actor_enchantments(v)
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,14 @@
|
||||
loc = select_location_with_projectile(0x17c)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
obj = Obj.new(318); --poison field
|
||||
obj.temporary = true
|
||||
obj.x,obj.y,obj.z = loc.x,loc.y,loc.z
|
||||
Obj.moveToMap(obj)
|
||||
fade_obj_in(obj)
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
loc = select_location_with_projectile(0x17d)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
obj = Obj.new(320); --sleep field
|
||||
obj.temporary = true
|
||||
obj.x,obj.y,obj.z = loc.x,loc.y,loc.z
|
||||
Obj.moveToMap(obj)
|
||||
fade_obj_in(obj)
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
local dir = get_direction("Direction-")
|
||||
print("`"..direction_string(dir).."\n")
|
||||
|
||||
wind_set_dir(dir)
|
||||
@@ -0,0 +1,14 @@
|
||||
loc = select_location_with_projectile(0x17f)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
obj = Obj.new(319); --protection field
|
||||
obj.temporary = true
|
||||
obj.x,obj.y,obj.z = loc.x,loc.y,loc.z
|
||||
Obj.moveToMap(obj)
|
||||
fade_obj_in(obj)
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x189, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17e, loc.x,loc.y)
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
spell_take_fire_dmg(caster, v)
|
||||
end
|
||||
if g_avatar_died == true then
|
||||
break -- don't keep casting once Avatar is dead
|
||||
end
|
||||
end
|
||||
|
||||
explode_surrounding_objects(loc.x, loc.y, loc.z)
|
||||
@@ -0,0 +1,26 @@
|
||||
magic_casting_effect()
|
||||
|
||||
local random = math.random
|
||||
local loc = caster_get_location()
|
||||
local caster = magic_get_caster()
|
||||
local from_z = loc.z
|
||||
local i, j
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
for i=1,8 do
|
||||
for j=1,8 do
|
||||
local new_x = random(0, 10) + loc.x - 5
|
||||
local new_y = random(0, 10) + loc.y - 5
|
||||
if map_can_put(new_x, new_y, from_z) then
|
||||
actor = Actor.new(0x157, new_x, new_y, from_z) --insect
|
||||
if actor ~= nil then
|
||||
actor.align = caster.align
|
||||
actor.wt = WT_ASSAULT
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,12 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x18b, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
if actor.visible == true and actor_can_turn_invisible(actor.obj_n) == true then
|
||||
fade_actor_blue(actor) --FIXME we should fade out at the same time as fading blue.
|
||||
actor.visible = false
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x188, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
if caster_is_player() then
|
||||
print("\n")
|
||||
end
|
||||
|
||||
local exp = actor_hit(actor, math.random(1, 30))
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
actor_hit_msg(actor)
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
@@ -0,0 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17f, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
if is_god_mode_enabled() and actor.in_party then
|
||||
return
|
||||
end
|
||||
print("\n")
|
||||
|
||||
hit_anim(actor.x, actor.y)
|
||||
actor.paralyzed = true
|
||||
print(actor.name.." is paralyzed.\n")
|
||||
|
||||
if actor.in_party == true then
|
||||
party_update_leader()
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x18b, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
print("Which object:")
|
||||
|
||||
local obj = get_obj_from_inventory(actor)
|
||||
|
||||
if obj ~= nil then
|
||||
print(obj.name.."\n")
|
||||
|
||||
if Actor.can_carry_obj(actor, obj) == false then
|
||||
print("\ncan't carry!\n")
|
||||
return
|
||||
end
|
||||
|
||||
projectile(obj.tile_num, actor.x, actor.y, caster.x, caster.y, 2)
|
||||
Actor.inv_add_obj(caster, obj)
|
||||
player_subtract_karma(5)
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local x = caster.x
|
||||
local y = caster.y
|
||||
local z = caster.z
|
||||
local loc_x = x
|
||||
local loc_y = y
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
for x = x - 5,loc_x + 5 do
|
||||
for y = y - 5,loc_y + 5 do
|
||||
local actor = map_get_actor(x, y, z)
|
||||
|
||||
if actor ~= nil then
|
||||
if actor.visible == false then
|
||||
actor.visible = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,12 @@
|
||||
local obj = select_actor_or_obj()
|
||||
|
||||
local obj_n = obj.obj_n
|
||||
-- dead body ghost dead gargoyle dead cyclops
|
||||
if obj_n == 0x153 or obj_n == 0x160 or obj_n == 0x155 or obj_n == 0x154 then
|
||||
if obj.luatype == "actor" and obj.actor_num == 91 then
|
||||
Actor.set_talk_flag(obj, 7)
|
||||
actor_talk(obj)
|
||||
else
|
||||
Actor.talk(Actor.get(obj.quality))
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
magic_casting_effect()
|
||||
magic_casting_fade_effect()
|
||||
xray_effect(6000)
|
||||
print("\nDone\n")
|
||||
@@ -0,0 +1,8 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17f, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
if spell_charm_actor(caster, actor) == false then
|
||||
magic_failed()
|
||||
end
|
||||
@@ -0,0 +1,33 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17f, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
local from_x = caster.x
|
||||
local from_y = caster.y
|
||||
local from_z = caster.z
|
||||
|
||||
local random = math.random
|
||||
|
||||
for i=1,8 do
|
||||
local new_x = random(0, 10) + from_x - 5
|
||||
local new_y = random(0, 10) + from_y - 5
|
||||
if map_can_put(new_x, new_y, from_z) then
|
||||
local clone_actor = Actor.new(actor.obj_n, new_x, new_y, from_z)
|
||||
if clone_actor ~= nil then
|
||||
clone_actor.frame_n = actor.frame_n
|
||||
clone_actor.align = actor.align
|
||||
if actor.wt > WT_PLAYER then
|
||||
clone_actor.wt = actor.wt
|
||||
else
|
||||
clone_actor.wt = WT_ASSAULT
|
||||
end
|
||||
fade_actor_in(clone_actor)
|
||||
magic_success()
|
||||
return
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
magic_no_effect()
|
||||
@@ -0,0 +1,26 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local x = caster.x
|
||||
local y = caster.y
|
||||
local z = caster.z
|
||||
local loc_x = x
|
||||
local loc_y = y
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
for x = x - 5,loc_x + 5 do
|
||||
for y = y - 5,loc_y + 5 do
|
||||
local actor = map_get_actor(x, y, z)
|
||||
|
||||
if actor ~= nil then
|
||||
if actor.align == ALIGNMENT_EVIL then
|
||||
if actor_int_check(actor, caster) == false then
|
||||
actor.align = ALIGNMENT_GOOD
|
||||
actor.wt = WT_ASSAULT
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1 @@
|
||||
magic_wind_spell(83, 0x18d)
|
||||
@@ -0,0 +1,11 @@
|
||||
local loc = select_location_with_prompt("Location: ")
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if loc == nil then magic_no_effect() return end
|
||||
|
||||
print("\n")
|
||||
|
||||
hail_storm_effect(loc)
|
||||
|
||||
print("\nSuccess\n")
|
||||
@@ -0,0 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x18b, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17f,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
v.protected = true
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_STORM, 0x14)
|
||||
@@ -0,0 +1 @@
|
||||
magic_wind_spell(87, 0x17c)
|
||||
@@ -0,0 +1,35 @@
|
||||
local caster = magic_get_caster()
|
||||
local obj = select_obj_with_projectile(0x17f, caster)
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
if tile_get_flag(obj.tile_num, 3, 3) == true then
|
||||
|
||||
local replicated_obj = Obj.new(obj.obj_n, obj.frame_n)
|
||||
|
||||
replicated_obj.qty = 1
|
||||
replicated_obj.status = 0x21 --OK, TEMP
|
||||
|
||||
local loc = {}, i
|
||||
local random = math.random
|
||||
local caster_x = caster.x
|
||||
local caster_y = caster.y
|
||||
|
||||
loc.z = caster.z
|
||||
|
||||
for i=1,8 do
|
||||
loc.x = caster_x + random(0, 10) - 5
|
||||
loc.y = caster_y + random(0, 10) - 5
|
||||
|
||||
if map_can_put_obj(loc) == true then
|
||||
Obj.moveToMap(replicated_obj, loc)
|
||||
fade_obj_in(replicated_obj)
|
||||
|
||||
return magic_success()
|
||||
end
|
||||
end
|
||||
|
||||
magic_failed()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,38 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local loc = select_location_with_prompt("Location: ")
|
||||
|
||||
print("\n")
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
if loc == nil then magic_no_effect() return end
|
||||
|
||||
local target_x = loc.x
|
||||
local target_y = loc.y
|
||||
local target_z = caster.z
|
||||
|
||||
|
||||
local targets = {}
|
||||
local i,j
|
||||
for i=target_x-1,target_x+1 do
|
||||
for j = target_y-1,target_y+1 do
|
||||
table.insert(targets,{x=i,y=j,z=target_z})
|
||||
end
|
||||
end
|
||||
|
||||
projectile_anim_multi(564, caster.x, caster.y, targets, 2, 0, 0) --564 = web tile num
|
||||
|
||||
local hit_x, hit_y = map_line_hit_check(caster.x, caster.y, loc.x, loc.y, loc.z)
|
||||
|
||||
if hit_x ~= loc.x or hit_y ~= loc.y then magic_blocked() return end
|
||||
|
||||
local k, v
|
||||
for k,v in ipairs(targets) do
|
||||
if map_can_put_obj(v) then
|
||||
local obj = Obj.new(0x35, 0) --web obj
|
||||
Obj.moveToMap(obj, v)
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,66 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x188, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
local random = math.random
|
||||
|
||||
local exp = actor_hit(actor, random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
actor_hit_msg(actor)
|
||||
|
||||
local i,j
|
||||
|
||||
for i=0,6 do
|
||||
if g_avatar_died == true then
|
||||
break -- don't keep casting once Avatar is dead
|
||||
end
|
||||
local var_c = 32769
|
||||
local new_target = nil
|
||||
for j=1,0xff do
|
||||
local tmp_actor = Actor.get(j)
|
||||
|
||||
if tmp_actor.obj_n ~= 0 and tmp_actor.alive == true and tmp_actor.actor_num ~= actor.actor_num and actor_ok_to_attack(actor, tmp_actor) == true then
|
||||
local target_x = tmp_actor.x
|
||||
local target_y = tmp_actor.y
|
||||
|
||||
if tmp_actor.z == caster.z and target_x > caster.x - 5 and target_x < caster.x + 5 and target_y > caster.y - 5 and target_y < caster.y + 5 then
|
||||
|
||||
local val = (target_x - actor.x) * (target_x - actor.x) + (target_y - actor.y) * (target_y - actor.y)
|
||||
dbg("and here val = "..val.."\n")
|
||||
if val > 0 then
|
||||
if val <= var_c then
|
||||
if val == var_c then
|
||||
if random(0, 1) == 0 then
|
||||
new_target = tmp_actor
|
||||
end
|
||||
else
|
||||
var_c = val
|
||||
new_target = tmp_actor
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if new_target == nil then
|
||||
break
|
||||
end
|
||||
|
||||
projectile(0x188, actor.x, actor.y, new_target.x, new_target.y, 2, 0)
|
||||
|
||||
actor = new_target
|
||||
|
||||
local exp = actor_hit(actor, random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
actor_hit_msg(actor)
|
||||
end
|
||||
@@ -0,0 +1,35 @@
|
||||
local caster = magic_get_caster()
|
||||
local obj = select_obj()
|
||||
if obj == nil then return end
|
||||
|
||||
if obj.obj_n ~= 0x4e then --staff
|
||||
magic_no_effect()
|
||||
return
|
||||
end
|
||||
|
||||
print("with: ")
|
||||
local spell_num = select_spell()
|
||||
|
||||
if spell_num ~= nil then
|
||||
if spell_num ~= 0x61 then --0x61 = enchant. Don't allow recursion on enchant spell. ;-)
|
||||
magic_print_invocation_string(spell_num)
|
||||
print("\n")
|
||||
local i = 0
|
||||
for child in container_objs(obj) do
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
if i >= 10 then
|
||||
print("\nIt's full\n")
|
||||
play_sfx(SFX_FAILURE)
|
||||
return
|
||||
end
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
local charge = Obj.new(336,0, spell_num)
|
||||
charge.invisible = true
|
||||
Obj.moveToCont(charge, obj)
|
||||
end
|
||||
else
|
||||
print("none\n\n")
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
magic_wind_spell(98, 0x188)
|
||||
@@ -0,0 +1,28 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local x = caster.x
|
||||
local y = caster.y
|
||||
local z = caster.z
|
||||
local loc_x = x
|
||||
local loc_y = y
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
for x = x - 5,loc_x + 5 do
|
||||
for y = y - 5,loc_y + 5 do
|
||||
local actor = map_get_actor(x, y, z)
|
||||
|
||||
if actor ~= nil then
|
||||
if actor.align ~= ALIGNMENT_GOOD then
|
||||
if actor_int_check(actor, caster) == false then
|
||||
local actor_base = actor_tbl[actor.obj_n]
|
||||
if actor_base == nil or actor_base[20] == 0 then -- if not undead
|
||||
actor.wt = WT_UNK_13
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,15 @@
|
||||
print("To phase ")
|
||||
local phase = input_select_integer(nil,true)
|
||||
|
||||
|
||||
print("\n")
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if phase > 0 and phase < 9 and g_moonstone_loc_tbl[phase].x ~= 0 then
|
||||
--FIXME the original walks the party into an invisible gate to teleport.
|
||||
player_move(g_moonstone_loc_tbl[phase].x, g_moonstone_loc_tbl[phase].y, g_moonstone_loc_tbl[phase].z, true)
|
||||
fade_in()
|
||||
else
|
||||
play_sfx(SFX_FAILURE)
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x18c, caster)
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
local ret = spell_kill_actor(caster, actor)
|
||||
|
||||
if ret == 2 then
|
||||
magic_no_effect()
|
||||
elseif ret == 1 then
|
||||
magic_failed()
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x18b, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17f,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
if is_god_mode_enabled() == false or v.in_party == false then
|
||||
v.cursed = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,19 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x188, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x18a,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
if v.visible == true and actor_can_turn_invisible(v.obj_n) == true then
|
||||
fade_actor_blue(v) --FIXME we should fade out at the same time as fading blue.
|
||||
v.visible = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,33 @@
|
||||
magic_casting_fade_effect()
|
||||
|
||||
local player_loc = player_get_location()
|
||||
|
||||
local player_x = player_loc.x
|
||||
local player_y = player_loc.y
|
||||
local player_z = player_loc.z
|
||||
|
||||
local foes_present = false
|
||||
|
||||
local i
|
||||
for i=1,0xff do
|
||||
local actor = Actor.get(i)
|
||||
|
||||
if actor.obj_n ~= 0 and actor.alive == true and actor.visible == true and alignment_is_evil(actor.align) then
|
||||
|
||||
local target_x = actor.x
|
||||
local target_y = actor.y
|
||||
|
||||
if actor.z == player_z and target_x > player_x - 5 and target_x < player_x + 5 and target_y > player_y - 5 and target_y < player_y + 5 then
|
||||
wing_strike_effect(actor)
|
||||
foes_present = true
|
||||
end
|
||||
if g_avatar_died == true then
|
||||
break -- don't keep casting once Avatar is dead
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if foes_present == false then
|
||||
print("\nNo foes.\n")
|
||||
play_sfx(SFX_FAILURE)
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
magic_casting_effect()
|
||||
magic_casting_fade_effect()
|
||||
|
||||
local loc = caster_get_location()
|
||||
|
||||
wizard_eye_effect(0x28, loc)
|
||||
|
||||
print("\nDone\n")
|
||||
@@ -0,0 +1,9 @@
|
||||
set_g_armageddon(true)
|
||||
magic_casting_effect()
|
||||
local i
|
||||
for i=1,0xff do
|
||||
local actor = Actor.get(i)
|
||||
if i ~= 1 and i ~= 5 and actor ~= nil and actor.alive then --don't kill the Avatar or Lord British.
|
||||
Actor.kill(actor, false) --false = don't create body
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
magic_wind_spell(113, 0x18c)
|
||||
@@ -0,0 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_ECLIPSE, 0x14)
|
||||
@@ -0,0 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x188, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x18a,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
spell_charm_actor(caster, v)
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
@@ -0,0 +1,20 @@
|
||||
local caster = magic_get_caster()
|
||||
local loc = select_location_with_projectile(0x188, caster)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x18c,loc.x,loc.y)
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
spell_kill_actor(caster, v)
|
||||
end
|
||||
if g_avatar_died == true then
|
||||
break -- don't keep casting once Avatar is dead
|
||||
end
|
||||
end
|
||||
|
||||
explode_surrounding_objects(loc.x, loc.y, loc.z)
|
||||
magic_success()
|
||||
@@ -0,0 +1,8 @@
|
||||
local caster = magic_get_caster()
|
||||
if caster.visible == true then
|
||||
fade_actor_blue(caster)
|
||||
caster.visible = false
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
local obj = select_obj()
|
||||
|
||||
magic_casting_fade_effect()
|
||||
|
||||
if obj ~= nil and g_armageddon == false then
|
||||
fade_obj_blue(obj)
|
||||
-- if statement is redundant with ObjManager::is_corpse(Obj *obj) but not really worth adding to the scripting language
|
||||
--dead body, mouse, dead gargoyle, dead cyclops;
|
||||
if (obj.obj_n == 339 or obj.obj_n == 0x162 or obj.obj_n == 0x155 or obj.obj_n == 0x154 or
|
||||
obj.obj_n == 349 or obj.obj_n == 134) then --dog, horse carcass
|
||||
if obj.quality < 203 then --greater than 202 temp actors
|
||||
if obj.quality ~= 0 then
|
||||
local actor = Actor.get(obj.quality)
|
||||
Actor.resurrect(actor, obj.x, obj.y, obj.z, obj)
|
||||
magic_success()
|
||||
else
|
||||
print("\nThe corpse is too old!\n")
|
||||
end
|
||||
end
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
@@ -0,0 +1,38 @@
|
||||
local loc = player_get_location()
|
||||
local caster = magic_get_caster()
|
||||
local x = loc.x - 5
|
||||
local y = loc.y - 5
|
||||
local z = loc.z
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
for x = loc.x - 5,loc.x + 5 do
|
||||
for y = loc.y - 5,loc.y + 5 do
|
||||
local actor = map_get_actor(x, y, z)
|
||||
|
||||
if actor ~= nil then
|
||||
local actor_type = actor_tbl[actor.obj_n]
|
||||
|
||||
if actor.align == ALIGNMENT_EVIL and (actor_type == nil or actor_type[12] == 0) then
|
||||
if actor_int_check(actor, caster) == false then
|
||||
|
||||
local old_tile_num = actor.tile_num
|
||||
actor.base_obj_n = 0x177 --convert actor into slime
|
||||
local new_tile_num = actor.tile_num
|
||||
actor.visible = false
|
||||
--FIXME need to fade all at once.
|
||||
fade_tile(x, y, z, old_tile_num, new_tile_num)
|
||||
actor.visible = true
|
||||
if actor.temp == true then
|
||||
--remove inventory
|
||||
local obj
|
||||
for obj in actor_inventory(actor) do
|
||||
Actor.inv_remove_obj(actor, obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
slime_update_frames()
|
||||
@@ -0,0 +1,3 @@
|
||||
local caster = magic_get_caster()
|
||||
loc = player_get_location()
|
||||
actor = Actor.new(367, loc.x, loc.y-1, loc.z, caster.align, 8)
|
||||
@@ -0,0 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_TIME_STOP, 0xa)
|
||||
@@ -0,0 +1,39 @@
|
||||
local caster = magic_get_caster()
|
||||
|
||||
local x = caster.x
|
||||
local y = caster.y
|
||||
local z = caster.z
|
||||
local loc_x = x
|
||||
local loc_y = y
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
|
||||
play_sfx(SFX_EARTH_QUAKE, false)
|
||||
quake_start(1,1024)
|
||||
|
||||
local random = math.random
|
||||
|
||||
for x = x - 5,loc_x + 5 do
|
||||
for y = y - 5,loc_y + 5 do
|
||||
local actor = map_get_actor(x, y, z)
|
||||
|
||||
if actor ~= nil then
|
||||
if actor.align == ALIGNMENT_EVIL then
|
||||
local actor_base = actor_tbl[actor.obj_n]
|
||||
if actor_base == nil or actor_base[13] == 0 then -- 13 is immune to tremor
|
||||
local exp = actor_hit(actor, random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
actor_hit_msg(actor)
|
||||
if g_avatar_died == true then
|
||||
break -- don't keep casting once Avatar is dead
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print("\nSuccess\n")
|
||||
Reference in New Issue
Block a user