/* Include Files */
#include "..\headers\define.h"
#define NAME SCRIPT_DCREMAX
#include "..\headers\command.h"
/* Standard Script Procedures */
procedure start;
procedure timed_event_p_proc;
procedure critter_p_proc;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;
/*****************************************************************
Local Variables which are saved. All Local Variables need to be
prepended by LVAR_
*****************************************************************/
#define LVAR_Herebefore (4)
//#define LVAR_Hostile (5)
//#define LVAR_Personal_Enemy (6)
#define LVAR_Home_Tile (1)
#define LVAR_maxjob_accepted (7)
/*******************************************************************
Imported variables from the Map scripts. These should only be
pointers and variables that need not be saved. If a variable
Needs to be saved, make it a map variable (MVAR_)
*******************************************************************/
/*******************************************************************
Local variables which do not need to be saved between map changes.
*******************************************************************/
/*******************************************************************
******* PROCEDURES *******
*******************************************************************/
procedure Node001;
procedure Node002a;
procedure Node002b;
procedure Node002c;
procedure Node003;
procedure Node004a;
procedure Node004b;
procedure Node004c;
procedure Node005;
procedure Node006a;
procedure Node006b;
procedure Node006c;
procedure Walktofight;
procedure Node998;
procedure Node999;
variable maxweapon;
/*******************************************************************
The start procedure is the first procedure called when the map is
first entered. Any initial information that needs to be set up
should be placed in here.
*******************************************************************/
procedure start
begin
end
procedure timed_event_p_proc
begin
if (fixed_param == 10) then //Magic hand anim
begin
reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_animate(self_obj,ANIM_magic_hands_middle,-1 );
reg_anim_end();
add_timer_event(Self_obj,30,20); // call after 3 seconds
end
if (fixed_param == 20) then
begin
reg_anim_clear(self_obj);
reg_anim_begin();
animate_move_to_tile(14884);
reg_anim_end();
add_timer_event(Self_obj,50,30); // call after 5 seconds (walk time)
end
if (fixed_param == 30) then
begin
reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_animate(self_obj, ANIM_fire_burst, -1);
reg_anim_end();
end
end
/********************************************************************
********************************************************************/
procedure use_p_proc
begin
end
/***************************************************************************
This is cursory glance description that the player will receive should
he just pass the Action Cursor over. Examines which give more information
need to be in the description_p_proc procedure.
***************************************************************************/
procedure look_at_p_proc
begin
script_overrides;
if (local_var(LVAR_Herebefore) == 0) then
display_msg(mstr(100));
else
display_msg(mstr(101));
end
procedure description_p_proc
begin
script_overrides;
display_msg(mstr(102));
end
procedure use_skill_on_p_proc
begin
end
procedure use_obj_on_p_proc
begin
end
/******************************************************************************************
IF it gets damaged
******************************************************************************************/
procedure damage_p_proc
begin
end
/***************************************************************************************
Whenever the map is first entered, this procedure will be called.
***************************************************************************************/
procedure map_enter_p_proc
begin
//if (map_first_run) then
//set_local_var(LVAR_Home_Tile, self_tile);
//end
end
/**************************************************************************************
This procedure gets called roughly every 30 seconds of real time.
**************************************************************************************/
procedure map_update_p_proc
begin
end
/**************************************************************************************
This is used for any dialogue that may need to occur with the player.
**************************************************************************************/
procedure talk_p_proc
begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_start;
call Node001;
gSay_end;
end_dialogue;
end
procedure Node001
begin
Reply(200);
GOption(201,Node002a,004);
BOption(202,Node002b,004);
NOption(203,Node999,004);
BOption(204,Node003,004);
end
procedure Node002a
begin
Reply(400);
GOption(401,Node999,004);
end
procedure Node002b
begin
Reply(300);
BOption(301,Node002c,004);
NOption(302,Node999,004);
end
procedure Node002c
begin
Reply(303);
BOption(304,Node998,004);
end
procedure Node003
begin
Reply(500);
NOption(501,Node004a,004);
BOption(502,Node002c,004);
end
procedure Node004a
begin
Reply(503);
NOption(504,Node004b,004);
end
procedure Node004b
begin
Reply(505);
GOption(506,Node005,004);
NOption(507,Node004c,004);
BOption(508,Node002c,004);
end
procedure Node004c
begin
Reply(509);
NOption(510,Node004b,004);
end
procedure Node005
begin
Reply(511);
GOption(512,Node006a,004);
NOption(513,Node006b,004);
NOption(514,Node006c,004);
end
procedure Node006a
begin
set_local_var(LVAR_maxjob_accepted,8) ;
Reply(515);
NOption(516,Node999,004);
end
procedure Node006b
begin
Reply(519);
NOption(520,Node999,004);
end
procedure Node006c
begin
Reply(517);
NOption(518,Node999,004);
end
procedure Node998
begin
end
procedure Node999
begin
end
procedure Walktofight
begin
maxweapon := create_object(PID_COMBAT_SHOTGUN,0,0);
add_obj_to_inven(self_obj, maxweapon);
wield_obj_critter(self_obj, maxweapon);
add_timer_event(Self_obj,30,10); // call timed_event_p_proc after 3 seconds
end
procedure critter_p_proc
begin
if (local_var(LVAR_maxjob_accepted) ==8) then
begin
set_local_var(LVAR_maxjob_accepted, 7);
call Walktofight;
end
end