Moderator: EUO Moderators
Monster * spawn_near_id(int code, int id, bool no_fov_update=false);
Monster * spawn_at(int code, int x, int y, int z, bool no_fov_update=false);
Monster * spawn_near(int code, int x, int y, int z, bool no_fov_update=false);
function dk_boss(m)
m.heartbeat_func="dk_boss_actions"
end
function dk_boss_actions(m)
if m.code == 0x4220357 then return end -- we can skip the rest if the last boss stage is reached
hp = m:get_hp_max()
if m.code == 0x220 then
if m.hp < hp * 0.75 then
m.code = 0x4220219 -- Balron/Daemon
local radius = 4
local angle = 45
for i=0,360-angle,angle do
local xx = math.ceil((radius*math.cos(math.rad(i)))-0.5) + m.x
local yy = math.ceil((radius*math.sin(math.rad(i)))-0.5) + m.y
mc = spawn_at(0x219, xx, yy, m.map_level, false) -- Daemons
end
update_everyones_fov(m)
end
elseif m.code == 0x4220219 then
if m.hp < hp * 0.5 then
m.code = 0x4219357 --Daemon/Shadow
local radius = 4
local angle = 45
for i=0,360-angle,angle do
local xx = math.ceil((radius*math.cos(math.rad(i)))-0.5) + m.x
local yy = math.ceil((radius*math.sin(math.rad(i)))-0.5) + m.y
mc = spawn_at(0x259, xx, yy, m.map_level, false) -- shadow warrior
end
update_everyones_fov(m)
end
elseif m.code == 0x4219357 then
if m.hp < hp * 0.25 then
m.code = 0x4220357 -- Balron/Shadow
local radius = 4
local angle = 45
for i=0,360-angle,angle do
local xx = math.ceil((radius*math.cos(math.rad(i)))-0.5) + m.x
local yy = math.ceil((radius*math.sin(math.rad(i)))-0.5) + m.y
mc = spawn_at(0x258, xx, yy, m.map_level, false)
end
update_everyones_fov(m)
end
end
end
function cc_traps(id,x,y,z)
map = get_map_ptr(z)
local val=map:get_feat_val(x, y)
if val == 0 then return end
tspawn = {0x220,0x230,0x234,0x23a,0x258,0x259,0x278,0x348,0x349,0x34a,0x34c,0x34f,0x350,0x355,0x357}
--p = get_sent_ptr(id)
--trp = p:get_skill(SK_SECURITY) -- does not work
--if trp < 50 then
m = spawn_near(get_random_element(tspawn), x, y, z, false)
simple_send_event(m.id,EVENT_MAGIC,0x12,m.x,m.y)
--else
--local_msg(p, string.format("You disabled a trap!"))
--end
map:set_feat_val(x,y,0)
end
scaleCreature(m, 3, 4)
scaleCreature(m, 5, 6)
Users browsing this forum: No registered users and 3 guests