Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

// basicnpc.txt// A very simple, naive text.

Creature attacks anything it hates


nearby.// Once it has won, it returns to its home.// Memory Cells: // Cell 0 - If
0, default behavior. If 1, it doesn�t fidget.// Cell 1,2 - Stuff done flag. If
both 0, nothing. Otherwise when this is killed, set to 1.// Cell 3 - Number of
state when talked to. Plays default text if 0.begincreaturescript; variables; short
i,target; short mode = 0; // 0 - basic for most of game// 1 - start, pre-mission// 2
- confront// 3 - post msision more info convo// 4 - more info convo 2body;
beginstate INIT_STATE; if (gf(5,18) == 0) mode = 1; if ((char_ok(56)
== FALSE) && (gf(100,0) >= 20) && (gf(9,18) > 0) && (gf(100,3) < 3) && (gf(11,18)
== 0) && (gf(1,63) == 0)) { mode = 2; spawn_creature(56);
} if ((gf(1,63) == 0) && (gf(9,18) > 0) && (gf(11,18) == 0)) mode =
2; if ((gf(1,64) == 0) && (gf(100,3) > 2)) mode = 3; if ((gf(100,0) >=
70) && (gf(1,64) > 0) && (gf(1,65) == 0) && (gf(100,3) > 2)) mode = 4;
if (gf(100,3) == 2) erase_char(ME); break; beginstate DEAD_STATE;
break; beginstate START_STATE; if (mode == 1) { if (get_ran(1,0,100) <
10) give_char_text_bubble(ME,"So much to ponder."); if
(get_ran(1,0,100) < 10) give_char_text_bubble(ME,"I have my sworn
duty."); if (get_ran(1,0,100) < 10)
give_char_text_bubble(ME,"It is good to see you."); } if (mode ==
0) { if (get_ran(1,0,100) < 10)
give_char_text_bubble(ME,"Greetings, [N]."); if (get_ran(1,0,100) <
10) give_char_text_bubble(ME,"Curse these walls."); if
(get_ran(1,0,100) < 10) give_char_text_bubble(ME,"Come, my servant.");
} // if I have a target for some reason, go attack it if
(target_ok()) { if (dist_to_char(get_target()) <= 16)
set_state(3); else set_foe_target(ME,-1); }
if (get_foe_target(ME,8,0)) { do_attack(); set_state(3);
} if (who_shot_me() >= 0) { set_foe_target(ME,who_shot_me());
do_attack(); set_state(3); } if ((mode ==
2) && (gf(1,63) > 0)) mode = 0; if ((mode == 2) && (dist_to_party() <=
3)) { mode = 0; talk_no_exit(473); } if
(am_i_doing_action() == FALSE) end_combat_turn(); break; beginstate 3; //
attacking if (target_ok() == FALSE) set_state(START_STATE); do_attack();
break; beginstate TALKING_STATE; if (mode == 4) { mode = 0;
talk_no_exit(475); } if (mode == 3) { mode = 0;
talk_no_exit(474); } if (mode == 2) { mode = 0;
talk_no_exit(473); } if (mode == 0)
begin_talk_mode(472); if (mode == 1) { if (gf(0,53) == 0)
begin_talk_mode(470); else begin_talk_mode(471);
}break;

You might also like