1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
|
-- cave3a - "First part of cave on way to Oracle's tower"
--
function autoexec()
local x1, y1 = marker("exit")
local x2, y2 = marker("uldoor1")
local herox, heroy = get_ent_tile(200)
if (herox == x1 and heroy == y1) then
set_warp(1, 264, 57)
elseif (herox == x2 and heroy == y2) then
set_warp(1, 264, 60)
end
if (get_progress(111) > 0) then
local a
for a = 0, 4, 1 do
set_ent_active(a, 0)
end
end
if (get_progress(112) == 1) then
set_progress(112, 0)
else
set_desc(0)
end
set_progress(105, 0)
refresh()
end
function entity_handler(en)
if (en == 0) then
bubble(en, "You cannot stop us! Begone!")
elseif (en == 1) then
bubble(en, "This statue is ours! You cannot have it!")
elseif (en == 2) then
bubble(200, "This is the other broken half of the stolen Oracle Statue!")
elseif (en == 3) then
bubble(en, "We will die before we give you the statue!")
elseif (en == 4) then
bubble(en, "A curse be upon you... a curse upon you all!")
end
end
function postexec()
return
end
function refresh()
showch("treasure1", 17)
showch("treasure2", 18)
showch("treasure3", 19)
if (get_progress(39) > 0) then
local x, y = marker("dldoor1")
set_ftile(x, y - 1, 119) -- set_ftile(13, 49, 119)
set_obs(x, y - 1, 0) -- set_obs(13, 49, 0)
end
TOC_switch_layers()
end
-- Show the status of a chest
function showch(which_marker, which_chest)
-- Set tiles if -1 passed in as 'which_chest' or if chest already opened
if (which_chest < 0 or get_treasure(which_chest) == 1) then
set_mtile(which_marker, 41)
set_zone(which_marker, 0)
end
end
function zone_handler(zn)
if (zn == 0) then
combat(8)
elseif (zn == 1) then
change_map("main", "cave3", 0, 2)
elseif (zn == 2) then
warp("halldoor", 8)
elseif (zn == 3) then
warp("dldoor2", 8)
elseif (zn == 4) then
change_map("cave3b", "entrance")
elseif (zn == 5) then
warp("uldoor3", 8)
elseif (zn == 6) then
chest(18, 104, 1)
refresh()
elseif (zn == 7) then
chest(17, 116, 1)
refresh()
elseif (zn == 8) then
chest(19, 99, 1)
refresh()
elseif (zn == 9) then
warp("uldoor2", 8)
elseif (zn == 10) then
if (get_progress(39) == 0) then
msg("The door creaks open noisily.", 255, 0)
set_progress(39, 1)
refresh()
else
warp("mrdoor1", 8)
if (get_progress(111) == 0) then
LOC_monsters_statue()
end
end
-- zn == 11 is a no-combat zone
elseif (zn == 12) then
warp("dldoor1", 8)
elseif (zn == 13) then
if (get_progress(39) < 3) then
set_progress(111, 3)
change_map("town4", "bad_portal")
else
set_progress(112, 1)
change_map("town7", "travelpoint")
end
elseif (zn == 14) then
warp("usportal1", 8)
elseif (zn == 15) then
change_map("cave3b", "exit")
elseif (zn == 16) then
warp("urstairs1", 8)
elseif (zn == 17) then
warp("drstairs1", 8)
elseif (zn == 18) then
change_map("main", "cave3", 0, -1)
elseif (zn == 19) then
if (get_progress(111) == 1) then
local or1, or2
if (get_numchrs() == 1) then
or1 = "I"
or2 = "I"
else
or1 = "We"
or2 = "we"
end
bubble(200, "No, really. "..or1.." need to tell the Oracle about this before "..or2.." go through this TravelPoint!")
end
elseif (zn == 20) then
local cancombat = 0
-- 25% chance of battle by looking into the empty chests
cancombat = pick({pr=25, value = 1}, {pr=75, value = 0}).value
if (cancombat == 0) then
bubble(200, "Looks like it's empty.")
else
msg("Something from inside grabs you!", 255, 0)
combat(60)
end
elseif (zn == 21) then
warp("dsportal1", 8)
elseif (zn == 22) then
bubble(200, "What a strange, glowing portal we have here...")
elseif (zn == 23) then
set_progress(105, 0)
refresh()
elseif (zn == 24) then
set_progress(105, 1)
refresh()
elseif (zn == 25) then
local x, y = marker("dsportal1")
bubble(200, "This wall looks funny...")
msg("You push at the wall. Something shifts.", 255, 0)
set_zone(x + 16, y + 2, 0)
set_zone(x + 17, y + 2, 0)
set_obs(x + 16, y + 2, 0)
set_obs(x + 17, y + 2, 0)
end
end
function LOC_monsters_statue()
local a
set_progress(111, 1)
set_ent_script(0, "R5K")
set_ent_script(1, "R6K")
set_ent_script(2, "R7K")
set_ent_script(3, "R8K")
set_ent_script(4, "U1R8K")
bubble(200, "Hey, who's that?!")
if (get_numchrs() == 1) then
set_ent_script(200, "U2")
wait_for_entity(200, 200)
else
set_ent_script(200, "U2")
set_ent_script(201, "U1")
wait_for_entity(200, 201)
orient_heroes()
end
wait_for_entity(0, 4)
for a = 0, 4, 1 do
set_ent_movemode(a, 2)
end
if (get_progress(55) == 0) then
bubble(200, "That looked like the missing statue Tsorin was talking about!")
bubble(200, "And those were Malkaron's men!")
else
bubble(200, "That looked like Malkaron's men with the Denorian's statue!")
end
if (get_numchrs() == 1) then
bubble(200, "I've got to report this to the Oracle!")
else
bubble(200, "We've got to report this to the Oracle!")
end
end
function TOC_switch_layers()
local x1, y1 = marker("monster_portal")
local a
if (get_progress(105) == 0) then
set_obs(x1 - 2, y1 - 1, 4)
set_obs(x1 + 2, y1 - 1, 4)
set_ftile(x1 - 2, y1 - 1, 45)
set_ftile(x1 + 2, y1 - 1, 47)
set_mtile(x1 - 2, y1 - 1, 0)
set_mtile(x1 + 2, y1 - 1, 0)
for a = x1 - 1, x1 + 1, 1 do
set_obs(a, y1 - 1, 4)
set_ftile(a, y1 - 1, 46)
set_mtile(a, y1 - 1, 0)
end
else
set_obs(x1 - 2, y1 - 1, 1)
set_obs(x1 + 2, y1 - 1, 1)
set_ftile(x1 - 2, y1 - 1, 0)
set_ftile(x1 + 2, y1 - 1, 0)
set_mtile(x1 - 2, y1 - 1, 45)
set_mtile(x1 + 2, y1 - 1, 47)
for a = x1 - 1, x1 + 1, 1 do
set_obs(a, y1 - 1, 2)
set_ftile(a, y1 - 1, 0)
set_mtile(a, y1 - 1, 46)
end
end
end
|