diff --git a/scripts_src/klamath/kcdunton.ssl b/scripts_src/klamath/kcdunton.ssl index d41ec4ec80..6d852a8ca9 100644 --- a/scripts_src/klamath/kcdunton.ssl +++ b/scripts_src/klamath/kcdunton.ssl @@ -214,7 +214,6 @@ variable needtomove:=0; variable tile; variable new_tile; variable lock_out_events:=0; -//variable active:=0; variable rustle_triggered:=0; //use this variable rather than checking five globals variable dest; variable item; @@ -229,20 +228,18 @@ end default from the prototype, and needs to be set in scripts. */ procedure map_enter_p_proc begin -//the Duntons behave different if on GRAZE map... -//they will be there if the player has triggered the -//rustling incident..otherwise they will be invisible -//On the downtown map they have a schedule between -//working and drinking in the bar...they always -//beat the player back to town. + //the Duntons behave different if on GRAZE map... + //they will be there if the player has triggered the + //rustling incident..otherwise they will be invisible + //On the downtown map they have a schedule between + //working and drinking in the bar...they always + //beat the player back to town. Only_Once:=0; - //critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_DUNTONS); set_self_ai(AI_DUNTON); if (cur_map_index == MAP_KLAMATH_1) then begin set_self_team(TEAM_KLAMATH_CROOKS); set_local_var(LVAR_THEX, 0); - //active:=1; end else if (cur_map_index == MAP_KLAMATH_GRAZE) then begin set_self_team(TEAM_DUNTONS); @@ -250,10 +247,10 @@ procedure map_enter_p_proc begin call should_i_be_here; end - //added by killap - expansion (remove Duntons when accused of rustling) + // added by killap - expansion (remove Duntons when accused of rustling) if (global_var(GVAR_KLAMATH_FIND_RUSTLERS) == FIND_RUSTLERS_SUCCESS) then destroy_object(self_obj); - //end + // end end @@ -268,24 +265,22 @@ procedure rustle_status begin rustle_triggered := 0; if (global_var(GVAR_RUSTLE_FAIL) == 1) then rustle_triggered := 0; - if (global_var(GVAR_TORR_DEAD) == 1) then //cant rustle from Torr if Torr is dead + if (global_var(GVAR_TORR_DEAD) == 1) then // cant rustle from Torr if Torr is dead rustle_triggered := 0; if (global_var(GVAR_DUNTON_DEAD) == 1) then rustle_triggered := 0; - if (global_var(GVAR_RUSTLE_OVER) == 1) then //to prevent rustle from happening more than once + if (global_var(GVAR_RUSTLE_OVER) == 1) then // to prevent rustle from happening more than once rustle_triggered := 0; end procedure should_i_be_here begin if rustle_triggered then begin - //they are here + // they are here set_self_visible; - //active:=1; //enable all p_procs end else begin - //they are gone + // they are gone set_self_invisible; - //active:=0; //disable all p_procs end end @@ -300,27 +295,24 @@ end procedure combat begin ndebug("COMBAT"); set_global_var(GVAR_ENEMY_DUNTON,1); - //set_local_var(LVAR_Hostile,2); end procedure timed_event_p_proc begin - //if active then begin - if (fixed_param == 0) then begin - lock_out_events:=0;//can allow another timed event now that this one is over - new_tile := tile_num_in_direction(self_tile, random(0,5), random(1,3)); - call checktile; - if (tile != UNKNOWN) then //don't move to an unknown tile...prevents walking outside - self_walk_to_tile(new_tile); - end - else if (fixed_param == 1) then begin - call scamper; - end - //end + if (fixed_param == 0) then begin + lock_out_events:=0; //can allow another timed event now that this one is over + new_tile := tile_num_in_direction(self_tile, random(0,5), random(1,3)); + call checktile; + if (tile != UNKNOWN) then // don't move to an unknown tile...prevents walking outside + self_walk_to_tile(new_tile); + end + else if (fixed_param == 1) then begin + call scamper; + end end procedure scamper begin -//this should only be called on a failure -//will turn off duntons on this map + // this should only be called on a failure + // will turn off duntons on this map if (map_var(MVAR_Duntons_Off_Map) == 0) then begin call rustle_status; gfade_out(900); @@ -346,30 +338,24 @@ procedure critter_p_proc begin actions need to be taken by the critter based on previous combat, the critter will remember this as well. */ -//if active then begin - if ( (global_var(GVAR_ENEMY_DUNTON) == 1) and (self_can_see_dude)) then begin - //set_local_var(LVAR_Hostile,1); //changing ENEMY DUNTON here could allow Duntons to forgive attack(dude_obj); end else if (cur_map_index == MAP_KLAMATH_1) then begin call checkarea; - //if the dude is stealing from the Duntons then they get angry + // if the dude is stealing from the Duntons then they get angry if ( (area == 2) and (map_var(MVAR_Stealing) > 0) and (self_can_see_dude) ) then begin set_map_var(MVAR_Stealing,0); floater(600); set_global_var(GVAR_ENEMY_DUNTON,1); - //set_local_var(LVAR_Hostile,2); attack(dude_obj); end else begin //dude not stealing - needtomove:=0;//don't need to move unless gettarget sets needtomove + needtomove:=0; // don't need to move unless gettarget sets needtomove call gettarget; if (needtomove == 1) then begin - if (local_var(LVAR_THEX) > 0) then begin //don't move unless you have a target hex - //ndebug("target_hex= "+local_var(LVAR_THEX)); - //ndebug("\n"); + if (local_var(LVAR_THEX) > 0) then begin // don't move unless you have a target hex self_walk_to_tile(local_var(LVAR_THEX)); end end @@ -380,11 +366,11 @@ procedure critter_p_proc begin end end - end //dude not stealing - end //if downtown + end // dude not stealing + end // if downtown else begin //we are active on pasture map - //did dude just kill Brahmin, Torr, or fail in some way? - //added if dude kills all scorps + // did dude just kill Brahmin, Torr, or fail in some way? + // added if dude kills all scorps if ( (global_var(GVAR_RUSTLE_FAIL) == 1) or (global_var(GVAR_RUSTLE_FAIL_VIOLENT) == 1) or ( KILLED_ALL_SCORPS and (global_var(GVAR_RUSTLE_SUCCESS) != 1) ) ) then begin //added rustle success check - killap @@ -399,124 +385,81 @@ procedure critter_p_proc begin end end -//end //if active - end procedure checktile begin -//need to check what map they are on also + // need to check what map they are on also here:=new_tile; tile:=UNKNOWN; - if (tile_distance(here,17926) < 5) then tile:=GOLDENGECKO;//these distances should be small - else if (tile_distance(here,18100) < 4) then tile:=SHOP;//so the duntons wont block doorways + if (tile_distance(here,17926) < 5) then tile:=GOLDENGECKO; // these distances should be small + else if (tile_distance(here,18100) < 4) then tile:=SHOP; // so the duntons wont block doorways end procedure checkarea begin -//need to check what map they are on also + // need to check what map they are on also here:=self_tile; area:=UNKNOWN; if (cur_map_index == MAP_KLAMATH_GRAZE) then area:=PASTURE; - else if (tile_distance(here,17926) < 5) then area:=GOLDENGECKO;//these distances should be small - else if (tile_distance(here,18100) < 4) then area:=SHOP;//so the duntons wont block doorways - //else if (tile_distance(here,18093) < 2) then area:=HOME; -/* - if (area == UNKNOWN) then - ndebug("i am at UNKNOWN\n"); - else if (area == SHOP) then - ndebug("i am at SHOP\n"); - //else if (area == HOME) then - // ndebug("i am at HOME\n"); - else if (area == GOLDENGECKO) then - ndebug("i am at GOLDENGECKO\n"); -*/ + else if (tile_distance(here,17926) < 5) then area:=GOLDENGECKO; // these distances should be small + else if (tile_distance(here,18100) < 4) then area:=SHOP; // so the duntons wont block doorways end procedure gettarget begin -//The Duntons move between their shop and the golden gecko. -//They move to a random tile near the center..this was done -//to reduce the times that they try to move to the same hex -//in which case they stand one behind the other and it looks -//odd. + //The Duntons move between their shop and the golden gecko. + //They move to a random tile near the center..this was done + //to reduce the times that they try to move to the same hex + //in which case they stand one behind the other and it looks + //odd. if ( (game_time_hour < 1601) and (area != SHOP) ) then begin - //need to move shop - new_tile := tile_num_in_direction(18100, random(0,5), random(1,2));//gives 18 destinations + // need to move shop + new_tile := tile_num_in_direction(18100, random(0,5), random(1,2)); // gives 18 destinations set_local_var(LVAR_THEX,new_tile);//was 18100 needtomove:=1; end else if ( (game_time_hour > 1600) and (area != GOLDENGECKO) ) then begin - //need to move to goldengecko - new_tile := tile_num_in_direction(17926, random(0,5), random(1,2));//gives 18 destinations + // need to move to goldengecko + new_tile := tile_num_in_direction(17926, random(0,5), random(1,2)); // gives 18 destinations set_local_var(LVAR_THEX,new_tile); needtomove:=1; end - //else if ( ((game_time_hour > 800) and (game_time_hour < 1601)) and (area != SHOP) ) then begin - //set_local_var(LVAR_THEX,18100); - //needtomove:=1; - //need to move to shop - //end end procedure duntonbarter begin gdialog_mod_barter(0); set_local_var(LVAR_attempted_barter,1); - //NMessage("");//replace with KCSLIM call Node013; end /* Whenever the critter takes damage of any type, this procedure will be called. Things like setting ENEMY_ and LVAR_Personal_Enemy can be set here. */ procedure damage_p_proc begin - -//if active then begin - /* If the player causes damage to this critter, then he will instantly consider the player his personal enemy. In Critter_Proc or through dialog, actions will be taken against the player for his evil acts. */ if (source_obj == dude_obj) then begin set_global_var(GVAR_ENEMY_DUNTON,1); - //set_global_var(GVAR_ENEMY_KLAMATH,1); end - -//end //if active - end /* Any time that the player is caught stealing from this critter, Pickup_proc will be called. In here, various things can happen. The most common response is instant hostility which will be remembered. */ procedure pickup_p_proc begin - -//if active then begin - if (source_obj == dude_obj) then begin set_global_var(GVAR_ENEMY_DUNTON,1); - //set_local_var(LVAR_Hostile,2); end - -//end //if active - end /* The dialog system is setup and prepares the player to talk to this NPC. Where To Go written by designers are placed in here. Additionally, Reactions are generated and stored which affects player interactions. */ procedure talk_p_proc begin - -//if active then begin - script_overrides; GetReaction; - //commented out and moved below - //if (cur_map_index == MAP_KLAMATH_1) then - // move_obj_inven_to_obj(klam_dunton_box_obj,self_obj); - - call checkarea; //find out where the Duntons are - //if (who_am_i == 0) then who_am_i := 1 + random(0,1); - //ndebug("i am #"+who_am_i); //move and edited by killap if (area == SHOP) then @@ -546,9 +489,6 @@ procedure talk_p_proc begin else if (area == PASTURE) then begin start_gdialog(NAME,self_obj,4,-1,-1); gSay_Start; - //Duntons should run away on violent failure so this will never happen - //if (global_var(GVAR_RUSTLE_FAIL_VIOLENT) == 1) then - // call Node004; if (global_var(GVAR_RUSTLE_FAIL) == 1) then call Node007; else if (global_var(GVAR_RUSTLE_SUCCESS) == 1) then @@ -563,14 +503,6 @@ procedure talk_p_proc begin end_dialogue; end - /*else if (global_var(GVAR_DUNTONS_ANGRY) == 1) then begin -- never run; GVAR_DUNTONS_ANGRY now used for Torr's brahmin - start_gdialog(NAME,self_obj,4,-1,-1); - gSay_Start; - call Node001; - gSay_End; - end_dialogue; - end*/ - else if (global_var(GVAR_RUSTLE_FAIL_VIOLENT) == 1) then begin start_gdialog(NAME,self_obj,4,-1,-1); gSay_Start; @@ -638,36 +570,13 @@ procedure talk_p_proc begin gSay_End; end_dialogue; end -/* - else if ( (area == PASTURE) and (global_var(GVAR_RUSTLE_ACCEPT) == 1) ) then begin - start_gdialog(NAME,self_obj,4,-1,-1); - gSay_Start; - call Node025; - gSay_End; - end_dialogue; - end - - else if (area == PASTURE) then begin - start_gdialog(NAME,self_obj,4,-1,-1); - gSay_Start; - call Node024; - gSay_End; - end_dialogue; - end -*/ else call Node036; - end//(1) + end - //edits by killap - //if (cur_map_index == MAP_KLAMATH_1) then - // move_obj_inven_to_obj(self_obj,klam_dunton_box_obj); if (area == SHOP) then move_obj_inven_to_obj(self_obj,klam_dunton_box_obj); - -//end //if active - end /* This procedure gets called only on the death of this NPC. Special things like @@ -675,50 +584,30 @@ end in here. */ procedure destroy_p_proc begin -//if active then begin //this moves all inventory to the dunton killed //shouldn't be a problem since the other one will //be too mad to barter if (cur_map_index == MAP_KLAMATH_1) then move_obj_inven_to_obj(klam_dunton_box_obj,self_obj); -/* Increment the aligned critter counter*/ + /* Increment the aligned critter counter*/ inc_evil_critter set_global_var(GVAR_DUNTON_DEAD,1); - //if a Dunton dies then we cannot do the rustle - // and should perhaps remove them from downtown - //map - -//end //if active - -/* Set global_variable for Enemy status*/ end /* Look_at_p_proc gets called any time that the player passes the cursor over any object. This should only hold the most cursory of glances for the player. */ procedure look_at_p_proc begin - -//if active then begin - script_overrides; display_msg(mstr(100)); - -//end //if active - end /* The player will see more indepth descriptions from this procedure. They are actively looking at the critter and want more information. Things like names can be added here if the critter is known to the player. */ procedure description_p_proc begin - -//if active then begin - script_overrides; display_msg(mstr(101)); - -//end //if active - end @@ -732,15 +621,13 @@ procedure use_skill_on_p_proc begin end procedure Node910 begin -//if player money < 5 goto 8 -//else subtract 5 coins and goto 7 + // if player money < 5 goto 8 + // else subtract 5 coins and goto 7 if (dude_caps > 4) then begin - dude_caps_adjust(-5); //subtract 5 coins - //set_local_var(LVAR_Give, 1); + dude_caps_adjust(-5); // subtract 5 coins call Node007; end else begin - //set_local_var(LVAR_Nogive,1); call Node008; end end @@ -770,7 +657,6 @@ procedure Node923 begin end procedure Node924 begin - //UpReactMajor; DownReactMajor; //changed from up to down - killap call Node031; end @@ -778,42 +664,41 @@ end procedure Node930 begin DownReactMinor; call Node003; -//Reaction -10,goto3 end procedure Node931 begin DownReactModerate; call Node003; -//Reaction -20,goto3 + //Reaction -20,goto3 end procedure Node932 begin DownReactMajor; call Node003; -//Reaction -30,goto3 + //Reaction -30,goto3 end procedure Node934 begin DownReactHuge; -//Reaction -50 + //Reaction -50 end procedure Node935 begin UpReactMinor; call Node003; -//Reaction +10,goto3 + //Reaction +10,goto3 end procedure Node936 begin UpReactModerate; call Node003; -//Reaction +20,goto3 + //Reaction +20,goto3 end procedure Node937 begin set_local_var(LVAR_attempted_barter,1); call duntonbarter; -//Barter,goto13 + //Barter,goto13 end procedure Node938 begin //wrestle success @@ -826,19 +711,6 @@ procedure Node939 begin //wrestle failure NOption(520,Node017,001); end -/* -procedure Node930 begin - UpReactModerate; - call Node003; -//Reaction +20,goto3 -end - -procedure Node931 begin - DownReactModerate; - call Node003; -//Reaction -20,goto3 -end -*/ procedure Node940 begin DownReactMinor; //Reaction -10,end @@ -854,13 +726,6 @@ procedure Node942 begin //Reaction -30,end end -/* -procedure Node940 begin - DownReactMajor; - call Node003; -//Reaction -30,goto3 -end -*/ procedure Node944 begin if (dude_stat_win(STAT_st,0)) then begin set_map_var(MVAR_Arm_Wrestle_Success,1); @@ -903,7 +768,7 @@ end procedure Node950 begin DownReactHuge; call Node002; -//Reaction -50,goto2 + //Reaction -50,goto2 end procedure Node951 begin @@ -915,23 +780,23 @@ procedure Node952 begin UpReactTiny; set_local_var(LVAR_attempted_barter,1); call duntonbarter; -//barter..goto013 + //barter..goto013 end procedure Node955 begin UpReactMinor; call Node003; -//Reaction +10,goto3 + //Reaction +10,goto3 end procedure Node960 begin UpReactMinor; -//Reaction +10,end + //Reaction +10,end end procedure Node961 begin UpReactModerate; -//Reaction +20,end + //Reaction +20,end end procedure Node962 begin @@ -952,7 +817,7 @@ end procedure Node965 begin DownReactMajor; call Node003; -//Reaction -30,goto3 + //Reaction -30,goto3 end procedure Node966 begin @@ -961,14 +826,14 @@ procedure Node966 begin end procedure Node967 begin -//add a beer to inventory + //add a beer to inventory UpReactModerate; call Node003; end procedure Node970 begin DownReactHuge; -//Reaction -50,end + //Reaction -50,end end procedure Node971 begin @@ -984,11 +849,11 @@ end procedure Node973 begin set_global_var(GVAR_QUEST_RUSTLE_CATTLE, RUSTLE_ACCEPT); set_global_var(GVAR_RUSTLE_ACCEPT,1); -//Set Rustle_Accept Flag -//Set Brahmin Rustling quest in log -//if b4 6pm set Torr_left to be set at 7am -//goto3 -//goto12 + //Set Rustle_Accept Flag + //Set Brahmin Rustling quest in log + //if b4 6pm set Torr_left to be set at 7am + //goto3 + //goto12 call Node003; end @@ -1001,15 +866,15 @@ procedure Node975 begin load_map(MAP_KLAMATH_GRAZE, 13); //signal map script to set up things end -//Set Rustle_Accept Flag -//Set Brahmin Rustling quest in log -//if b4 6pm set Torr_left to be set at 7am + //Set Rustle_Accept Flag + //Set Brahmin Rustling quest in log + //if b4 6pm set Torr_left to be set at 7am end procedure Node980 begin DownReactModerate; call Node002; -//Reaction -20,goto2 + //Reaction -20,goto2 end procedure Node981 begin @@ -1020,13 +885,13 @@ end procedure Node983 begin DownReactMinor; call Node003; -//Reaction +15,goto3 + //Reaction +15,goto3 end procedure Node985 begin UpReactMinor; call Node009; -//Reaction +10,goto9 + //Reaction +10,goto9 end procedure Node988 begin @@ -1035,7 +900,7 @@ procedure Node988 begin display_msg(mstr(700)); set_global_var(GVAR_RUSTLE_REWARD, 1); //end added -//Reaction -30,end + //Reaction -30,end end procedure Node989 begin @@ -1052,25 +917,17 @@ procedure Node990 begin end procedure Node991 begin -//earlier than 6pm - //Reply(mstr(198) + mstr(200)); + //earlier than 6pm Reply(198); - //GOption(mstr(202) + mstr(206),Node973,004); - GOption(202,Node975,004); - BOption(204,Node993,004);//if from_14 set Rustle_Refuse flag else reaction-10 - //if (from_14) then - //GOption(mstr(199) + mstr(202) + mstr(207),Node999,004); + GOption(202,Node975,004); + BOption(204,Node993,004); // if from_14 set Rustle_Refuse flag else reaction-10 end procedure Node992 begin -//later than 6pm - //Reply(mstr(198) + mstr(201)); + //later than 6pm Reply(mstr(198) + mstr(601)); - //GOption(mstr(203) + mstr(206),Node973,004); - GOption(202,Node975,004); - BOption(204,Node993,004);//if from_14 set Rustle_Refuse flag else reaction-10 - //if (from_14) then - //GOption(mstr(199) + mstr(203) + mstr(207),Node999,004); + GOption(202,Node975,004); + BOption(204,Node993,004); // if from_14 set Rustle_Refuse flag else reaction-10 end procedure Node993 begin @@ -1083,13 +940,12 @@ procedure Node993 begin end procedure Node994 begin -//send duntons home -//delete brahmin Rustling quest from log -//+10 Karma -//+25EP + //send duntons home + //delete brahmin Rustling quest from log + //+10 Karma + //+25EP set_global_var(GVAR_RUSTLE_FAIL, 1); set_global_var(GVAR_QUEST_RUSTLE_CATTLE, RUSTLE_FAIL); - // set_global_var(GVAR_TORR_GUARD_STATUS, TORR_GUARD_SUCCESS); - comment out by killap inc_general_rep(REP_BONUS_KC_GUARD_SUCCESS); give_xp(EXP_KC_GUARD_SUCCESS); //killap's fix: changed to give_xp end @@ -1120,7 +976,6 @@ end he was once hostile towards the player.*/ procedure Node998 begin set_global_var(GVAR_ENEMY_DUNTON,1); - //set_local_var(LVAR_Hostile,2); end /* Anytime that there is a need for an ending to dialog, this node is to be called. It will just @@ -1269,25 +1124,25 @@ procedure Node008 begin end procedure Node009 begin -//add 5 sticks of dunton drymeat to inventory -item:=create_object(PID_MEAT_JERKY,0,0); -add_obj_to_inven(dude_obj,item); -item:=create_object(PID_MEAT_JERKY,0,0); -add_obj_to_inven(dude_obj,item); -item:=create_object(PID_MEAT_JERKY,0,0); -add_obj_to_inven(dude_obj,item); -item:=create_object(PID_MEAT_JERKY,0,0); -add_obj_to_inven(dude_obj,item); -item:=create_object(PID_MEAT_JERKY,0,0); -add_obj_to_inven(dude_obj,item); -dude_caps_adjust(50);//and $50 -set_global_var(GVAR_RUSTLE_REWARD, 1); -//check off Brahmin Rustlin in quest log -display_msg(mstr(700)); -give_xp(EXP_KC_RUSTLE_BRAHMIN); -inc_general_rep(REP_BONUS_KC_RUSTLE_BRAHMIN); -//+100EP -set_global_var(GVAR_TORR_GUARD_STATUS,3); //added by killap (guard brahmin is never crossed off if you rustle them instead - 3 is for "fail" as 2 is for success) + //add 5 sticks of dunton drymeat to inventory + item:=create_object(PID_MEAT_JERKY,0,0); + add_obj_to_inven(dude_obj,item); + item:=create_object(PID_MEAT_JERKY,0,0); + add_obj_to_inven(dude_obj,item); + item:=create_object(PID_MEAT_JERKY,0,0); + add_obj_to_inven(dude_obj,item); + item:=create_object(PID_MEAT_JERKY,0,0); + add_obj_to_inven(dude_obj,item); + item:=create_object(PID_MEAT_JERKY,0,0); + add_obj_to_inven(dude_obj,item); + dude_caps_adjust(50);//and $50 + set_global_var(GVAR_RUSTLE_REWARD, 1); + //check off Brahmin Rustlin in quest log + display_msg(mstr(700)); + give_xp(EXP_KC_RUSTLE_BRAHMIN); + inc_general_rep(REP_BONUS_KC_RUSTLE_BRAHMIN); + //+100EP + set_global_var(GVAR_TORR_GUARD_STATUS,3); //added by killap (guard brahmin is never crossed off if you rustle them instead - 3 is for "fail" as 2 is for success) Reply(190); if (area != PASTURE) then NOption(191,Node003,004); @@ -1296,12 +1151,6 @@ end procedure Node010 begin from_10 := 1; -/* - if ( (game_time_hour > 600) and (game_time_hour < 1800) ) then - call Node991; - else - call Node992; -*/ if (area == PASTURE) then call Node991; else @@ -1309,7 +1158,7 @@ procedure Node010 begin end procedure Node011 begin -//randomize these replies + //randomize these replies if (who_am_i == 1) then begin k := random(1,5); if (k == 1) then Reply(208); @@ -1401,7 +1250,7 @@ procedure Node015 begin end procedure Node016 begin -//arm wrestle success (need to give player a beer) + //arm wrestle success (need to give player a beer) Reply(280); GOption(281,Node967,004); @@ -1411,7 +1260,7 @@ procedure Node016 begin end procedure Node017 begin -//arm wrestle failure + //arm wrestle failure if (map_var(MVAR_11_before) == 1) then Reply(291); else begin