- waypoint OutsideSoupHouse
- {
- 67, 17, 0
- }
- waypoint ZombieSpawnLocation
- {
- 66, 6, 0
- }
- waypoint SafehouseKitchen
- {
- 42, 22, 0
- }
- waypoint TutorialStovePosition
- {
- 42, 22, 0
- }
- /* can also be specified in map */
- zone TutorialAlarmZombieSpawn
- {
- 47, 27, /* Top left */
- 53, 29 /* Lower right */
- }
- activatable TutorialStove
- {
- stove, 39, 21, 0
- }
- container TutorialStoveContainer
- {
- stove, 39, 21, 0
- }
- /*
- talker TutorialRadio
- {
- 39, 22, 1,
- 255,255,255
- }
- */
- /*******************************************************************************************
- ** Settable script flags...
- ********************************************************************************************/
- /* Flag to determine if we're allowed to drag kate (set when fire breaks out) */
- scriptflag CanDragKate
- {
- no /* initial value */
- }
- /*******************************************************************************************
- ** GameStart trigger for creating fast food / make soup quests.
- ********************************************************************************************/
- trigger GameStart
- {
- call CreateFastFoodQuest,
- call CreateMakeSoupQuest,
- }
- /*******************************************************************************************
- ** Custom trigger to start fire once you run downstairs after 'smell burning?'
- ********************************************************************************************/
- customtrigger CustomStartFire
- {
- !Player.IsUpstairs(),
- call SetFire
- }
- /*******************************************************************************************
- ** Custom trigger to do alarm beep sound
- ********************************************************************************************/
- customtrigger CustomDoAlarmSound
- {
- CustomDoAlarmSound.TimeSinceLastRan(0.5), /* Only runs DoAlarmBeep every 0.5 seconds */
- call DoAlarmBeep
- }
- /*******************************************************************************************
- ** Custom trigger to emit fire alarm world sound zombies can hear (less frequent than
- ** actual beep to avoid confusing zombies and for optimizing)
- ********************************************************************************************/
- customtrigger CustomDoAlarmWorldSound
- {
- CustomDoAlarmWorldSound.TimeSinceLastRan (8.0), /* Only runs DoAlarmWorldBeep every 8 seconds */
- call DoAlarmWorldBeep
- }
- /*******************************************************************************************
- ** Quest conditions for soup quest.
- ********************************************************************************************/
- questcondition SoupCooking
- {
- TutorialStove.IsActivated() && TutorialStoveContainer.HasInventory(PotOfSoup)
- }
- /*******************************************************************************************
- ** Making some soup for your lovely wife! Didn't it go well?
- ********************************************************************************************/
- script CreateMakeSoupQuest
- {
- Quest.CreateQuest("MakeSoupQuest", "Soup Kitchen" );
- Quest.AddFindItemTask( "a", "Get a cooking pot", Pot, 1 );
- Quest.Unlock();
- Quest.UnlockNextTasksOnComplete(1);
- Quest.AddFindItemTask( "b", "Find a tin opener and craft a pot of soup", PotOfSoup, 1 );
- Quest.UnlockNextTasksOnComplete(1);
- Quest.AddScriptConditionTask( "c", "Put soup in oven and turn oven on", "SoupCooking" );
- Quest.RunScriptOnComplete("RadioWorks");
- }
- /*******************************************************************************************
- ** Fast Food quest - Go next door and battle a zombie, before collecting soup and returning to safehouse.
- ********************************************************************************************/
- script CreateFastFoodQuest
- {
- Quest.CreateQuest("FastFoodQuest", "Fast Food" );
- /* Invisible task, spotting the zombie is put first, unlocked but hid so once it's completed (by spotting the zombie)
- it will unlock the 'kill the zombie' quest which will take precedence over getting food.
- Since it's the first unlocked task which displays.
- */
- Quest.AddHardCodedTask( "tutorialaaa", "", "spotzombie" );
- Quest.UnlockButHide();
- Quest.UnlockTaskOnComplete( "tutorialCa" );
- Quest.AddHardCodedTask("tutorialA", "Leave the house", "PlayerOutside" );
- Quest.Unlock();
- Quest.UnlockNextTasksOnComplete(1);
- Quest.AddGotoLocationTask("tutorialB", "Carefully approach house to the east", OutsideSoupHouse );
- Quest.RunScriptOnComplete("SpawnZombieOnFastFood");
- Quest.UnlockTaskOnComplete("tutorialC");
- Quest.AddHardCodedTask( "tutorialCa", "Kill the zombie", "killzombie" );
- Quest.AddFindItemTask( "tutorialC", "Search the kitchen and collect some food supplies", TinnedSoup, 1 );
- Quest.UnlockNextTasksOnComplete(1);
- Quest.AddGotoLocationTask( "tutorialD", "Return to safehouse kitchen", SafehouseKitchen );
- Quest.RunScriptOnComplete("WeGotSoup");
- }
- /*******************************************************************************************
- ** Called in opening.txt once you've woke up after a lovely nights sleep with Kate.
- ********************************************************************************************/
- script WokeUpInTutorialBed
- {
- Wait(1.0);
- if(Player.HasInventory(Hammer))
- {
- Kate.Say("I miss the days when we didn't take a hammer to bed.");
- }
- Player.Say("Time to go out. See what I can see.");
- Quest.UnlockQuest("FastFoodQuest");
- }
- /*******************************************************************************************
- ** Spawns a zombie in the kitchen. Called when you hit outside of the soup house next door.
- ********************************************************************************************/
- script SpawnZombieOnFastFood
- {
- Player.Say("Spawning zombie.");
- World.SpawnZombie(ZombieSpawnLocation);
- Tutorial.SetZombieLimit(1);
- }
- /*******************************************************************************************
- ** Called when Bob returns to safehouse kitchen from next door.
- ********************************************************************************************/
- script WeGotSoup
- {
- Player.Say( "We got soup!");
- Quest.UnlockQuest("MakeSoupQuest");
- }
- /*******************************************************************************************
- ** Called after soup is put in oven and oven is turned on.
- ********************************************************************************************/
- script RadioWorks
- {
- Kate.Say("Honey! It's working!");
- Kate.Say("This piece of shit radio picked something up!");
- /*
- if(Player.IsUpstairs()) { TutorialRadio.Say("Day six of the Knox County event and the army has warned camps..."); } else { TutorialRadio.Say("Day six........Knox County..............army...........camps..."); }
- */
- TutorialStove.Toggle();
- TutorialStoveContainer.AddInventory(PotOfSoup);
- if(TutorialStove.IsActivated() && TutorialStoveContainer.HasInventory(PotOfSoup))
- {
- Kate.Say("Can you smell burning?");
- CustomStartFire.ProcessAlways(); /* sets our custom trigger to start processing every frame. */
- }
- else
- {
- Kate.Say("NO BURN!");
- }
- }
- /*******************************************************************************************
- ** Sets fire on stove...
- ********************************************************************************************/
- script SetFire
- {
- CustomStartFire.ProcessNever(); /* We've processed the trigger now. Disable it so it doesn't call this script and set the fire every frame. */
- World.StartFire(TutorialStovePosition, 500000); /* Set the fire at the stove location, give it a whole load of potential energy so it spreads fast. */
- /* Start both the timed triggers to do the actual alarm sound effect and NPC hearable world sound. */
- CustomDoAlarmWorldSound.ProcessAlways();
- CustomDoAlarmSound.ProcessAlways();
- CanDragKate.Set(yes); /* Set it so kate is draggable (tested in game code for now) */
- World.CreateZombieSwarm( 15, TutorialAlarmZombieSpawn ); /* spawn 15 zombies within zone near front door. */
- Player.Say("Oh shit...");
- /* Do alarm for 30 seconds... */
- Wait(30.0f);
- /* Then stop. */
- CustomDoAlarmWorldSound.ProcessNever();
- CustomDoAlarmSound.ProcessNever();
- }
- script DoAlarmBeep
- {
- World.PlaySoundEffect("firealarm", TutorialStovePosition, false, 0.0, 30, 0.6, false); /* Play the fire alarm beep sound effect to the player. */
- }
- script DoAlarmWorldBeep
- {
- World.PlayWorldSound(TutorialStovePosition, 40, 40); /* Create a sound that can be heard by NPCs / zombies up to 40 tiles away from stove. */
- }