| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
import adonthell |
| 18 |
|
| 19 |
class intro(object): |
| 20 |
|
| 21 |
def __init__ (self, mapcharacterinstance): |
| 22 |
self.myself = mapcharacterinstance |
| 23 |
self.myself.set_callback (self.goal_reached) |
| 24 |
adonthell.gamedata_get_quest ("demo").set_val ("intro_on", 1) |
| 25 |
|
| 26 |
|
| 27 |
def talk_to_talan (self): |
| 28 |
talan = adonthell.gamedata_get_character ("Talan Wendth") |
| 29 |
talan.launch_action (self.myself) |
| 30 |
|
| 31 |
|
| 32 |
def enter_inn (self): |
| 33 |
|
| 34 |
adonthell.audio_load_background (0, "audio/at-demo-5.ogg") |
| 35 |
adonthell.audio_play_background (0) |
| 36 |
adonthell.audio_set_schedule ("in_game") |
| 37 |
adonthell.audio_set_schedule_active (True) |
| 38 |
|
| 39 |
self.open_gate () |
| 40 |
|
| 41 |
adonthell.gamedata_get_quest ("demo").set_val ("intro_on", 0) |
| 42 |
self.myself.set_goal (10, 18, adonthell.STAND_EAST) |
| 43 |
|
| 44 |
|
| 45 |
def goal_reached (self): |
| 46 |
talan = adonthell.gamedata_get_character ("Talan Wendth") |
| 47 |
talan.time_callback_string ("3t", "walk") |
| 48 |
|
| 49 |
self.myself.set_callback (None) |
| 50 |
self.myself.set_schedule ("keyboard_control") |
| 51 |
self.myself.set_schedule_active (True) |
| 52 |
self.close_gate () |
| 53 |
self.myself.go_east () |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
def open_gate (self): |
| 58 |
|
| 59 |
gate_fore = adonthell.gamedata_engine ().get_landmap ().get_mapobject (90) |
| 60 |
gate_back = adonthell.gamedata_engine ().get_landmap ().get_mapobject (89) |
| 61 |
|
| 62 |
|
| 63 |
if (gate_fore.get_animation (0).currentframe () == 0): |
| 64 |
|
| 65 |
gate_back.get_animation (0).next_frame () |
| 66 |
|
| 67 |
gate_fore.get_animation (0).next_frame () |
| 68 |
|
| 69 |
|
| 70 |
sm = adonthell.gamedata_engine ().get_landmap ().get_submap (0) |
| 71 |
sm.get_square (6, 17).set_walkable_south (False) |
| 72 |
sm.get_square (7, 17).set_walkable_south (False) |
| 73 |
sm.get_square (6, 18).set_walkable_west (True) |
| 74 |
sm.get_square (6, 19).set_walkable_west (True) |
| 75 |
|
| 76 |
|
| 77 |
def close_gate (self): |
| 78 |
|
| 79 |
gate_fore = adonthell.gamedata_engine ().get_landmap ().get_mapobject (90) |
| 80 |
gate_back = adonthell.gamedata_engine ().get_landmap ().get_mapobject (89) |
| 81 |
|
| 82 |
|
| 83 |
if (gate_fore.get_animation (0).currentframe () == 4): |
| 84 |
|
| 85 |
gate_back.get_animation (0).next_frame () |
| 86 |
|
| 87 |
gate_fore.get_animation (0).next_frame () |
| 88 |
|
| 89 |
|
| 90 |
sm = adonthell.gamedata_engine ().get_landmap ().get_submap (0) |
| 91 |
sm.get_square (6, 17).set_walkable (False) |
| 92 |
sm.get_square (7, 17).set_walkable_south (True) |
| 93 |
sm.get_square (6, 18).set_walkable_west (False) |
| 94 |
sm.get_square (6, 19).set_walkable_west (False) |
| 95 |
sm.get_square (6, 20).set_walkable_west (False) |