Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 30th, 2011  |  syntax: None  |  size: 8.56 KB  |  hits: 1,320  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. waypoint OutsideSoupHouse
  2. {
  3.         67, 17, 0
  4. }
  5.  
  6. waypoint ZombieSpawnLocation
  7. {
  8.         66, 6, 0
  9. }
  10.  
  11. waypoint SafehouseKitchen
  12. {
  13.         42, 22, 0
  14. }
  15.  
  16. waypoint TutorialStovePosition
  17. {
  18.         42, 22, 0
  19. }
  20.  
  21. /* can also be specified in map */
  22. zone TutorialAlarmZombieSpawn
  23. {
  24.         47, 27,                 /* Top left */
  25.         53, 29                  /* Lower right */
  26. }
  27.  
  28. activatable TutorialStove
  29. {
  30.         stove, 39, 21, 0
  31. }
  32.  
  33. container TutorialStoveContainer
  34. {
  35.         stove, 39, 21, 0
  36. }
  37.  
  38. /*
  39. talker TutorialRadio
  40. {
  41.         39, 22, 1,
  42.         255,255,255
  43. }
  44. */
  45.  
  46.  
  47. /*******************************************************************************************
  48. **      Settable script flags...
  49. ********************************************************************************************/
  50.  
  51. /* Flag to determine if we're allowed to drag kate (set when fire breaks out) */
  52. scriptflag CanDragKate
  53. {
  54.         no /* initial value */
  55. }
  56.  
  57. /*******************************************************************************************
  58. **      GameStart trigger for creating fast food / make soup quests.
  59. ********************************************************************************************/
  60. trigger GameStart
  61. {
  62.         call CreateFastFoodQuest,
  63.         call CreateMakeSoupQuest,
  64. }
  65.  
  66. /*******************************************************************************************
  67. **      Custom trigger to start fire once you run downstairs after 'smell burning?'
  68. ********************************************************************************************/
  69. customtrigger CustomStartFire
  70. {
  71.         !Player.IsUpstairs(),
  72.         call SetFire
  73. }
  74.  
  75. /*******************************************************************************************
  76. **      Custom trigger to do alarm beep sound
  77. ********************************************************************************************/
  78. customtrigger CustomDoAlarmSound
  79. {
  80.         CustomDoAlarmSound.TimeSinceLastRan(0.5),       /* Only runs DoAlarmBeep every 0.5 seconds */
  81.         call DoAlarmBeep
  82. }
  83.  
  84. /*******************************************************************************************
  85. **      Custom trigger to emit fire alarm world sound zombies can hear (less frequent than
  86. **      actual beep to avoid confusing zombies and for optimizing)
  87. ********************************************************************************************/
  88. customtrigger CustomDoAlarmWorldSound
  89. {
  90.         CustomDoAlarmWorldSound.TimeSinceLastRan        (8.0),  /* Only runs DoAlarmWorldBeep every 8 seconds */
  91.         call DoAlarmWorldBeep
  92. }
  93.  
  94.  
  95. /*******************************************************************************************
  96. **      Quest conditions for soup quest.
  97. ********************************************************************************************/
  98. questcondition SoupCooking
  99. {
  100.         TutorialStove.IsActivated() && TutorialStoveContainer.HasInventory(PotOfSoup)
  101. }
  102.  
  103. /*******************************************************************************************
  104. **      Making some soup for your lovely wife! Didn't it go well?
  105. ********************************************************************************************/
  106. script CreateMakeSoupQuest
  107. {
  108.         Quest.CreateQuest("MakeSoupQuest", "Soup Kitchen" );
  109.                 Quest.AddFindItemTask( "a", "Get a cooking pot", Pot, 1 );
  110.                         Quest.Unlock();
  111.                         Quest.UnlockNextTasksOnComplete(1);
  112.                 Quest.AddFindItemTask( "b", "Find a tin opener and craft a pot of soup", PotOfSoup, 1 );
  113.                         Quest.UnlockNextTasksOnComplete(1);
  114.                 Quest.AddScriptConditionTask( "c", "Put soup in oven and turn oven on", "SoupCooking" );
  115.                         Quest.RunScriptOnComplete("RadioWorks");
  116.        
  117. }
  118.  
  119. /*******************************************************************************************
  120. **      Fast Food quest - Go next door and battle a zombie, before collecting soup and returning to safehouse.
  121. ********************************************************************************************/
  122. script CreateFastFoodQuest
  123. {
  124.         Quest.CreateQuest("FastFoodQuest", "Fast Food" );
  125.                
  126.                 /*      Invisible task, spotting the zombie is put first, unlocked but hid so once it's completed (by spotting the zombie)
  127.                         it will unlock the 'kill the zombie' quest which will take precedence over getting food.
  128.                         Since it's the first unlocked task which displays.
  129.                 */
  130.                 Quest.AddHardCodedTask( "tutorialaaa", "", "spotzombie" );
  131.                         Quest.UnlockButHide();
  132.                         Quest.UnlockTaskOnComplete( "tutorialCa" );
  133.                 Quest.AddHardCodedTask("tutorialA", "Leave the house", "PlayerOutside" );
  134.                         Quest.Unlock();
  135.                         Quest.UnlockNextTasksOnComplete(1);
  136.                 Quest.AddGotoLocationTask("tutorialB", "Carefully approach house to the east", OutsideSoupHouse );
  137.                         Quest.RunScriptOnComplete("SpawnZombieOnFastFood");
  138.                         Quest.UnlockTaskOnComplete("tutorialC");
  139.                 Quest.AddHardCodedTask( "tutorialCa", "Kill the zombie", "killzombie" );
  140.                 Quest.AddFindItemTask( "tutorialC", "Search the kitchen and collect some food supplies", TinnedSoup, 1 );
  141.                         Quest.UnlockNextTasksOnComplete(1);
  142.                 Quest.AddGotoLocationTask( "tutorialD", "Return to safehouse kitchen", SafehouseKitchen );
  143.                         Quest.RunScriptOnComplete("WeGotSoup");
  144.                
  145. }
  146.  
  147. /*******************************************************************************************
  148. **      Called in opening.txt once you've woke up after a lovely nights sleep with Kate.
  149. ********************************************************************************************/
  150. script WokeUpInTutorialBed
  151. {
  152.         Wait(1.0);
  153.         if(Player.HasInventory(Hammer))
  154.         {
  155.                 Kate.Say("I miss the days when we didn't take a hammer to bed.");              
  156.         }
  157.        
  158.         Player.Say("Time to go out. See what I can see.");
  159.         Quest.UnlockQuest("FastFoodQuest");
  160.        
  161. }
  162.  
  163. /*******************************************************************************************
  164. **      Spawns a zombie in the kitchen. Called when you hit outside of the soup house next door.
  165. ********************************************************************************************/
  166. script SpawnZombieOnFastFood
  167. {
  168.         Player.Say("Spawning zombie.");
  169.         World.SpawnZombie(ZombieSpawnLocation);
  170.         Tutorial.SetZombieLimit(1);
  171. }
  172.  
  173. /*******************************************************************************************
  174. **      Called when Bob returns to safehouse kitchen from next door.
  175. ********************************************************************************************/
  176. script WeGotSoup
  177. {
  178.         Player.Say( "We got soup!");
  179.         Quest.UnlockQuest("MakeSoupQuest");
  180. }
  181.  
  182. /*******************************************************************************************
  183. **      Called after soup is put in oven and oven is turned on.
  184. ********************************************************************************************/
  185. script RadioWorks
  186. {
  187.         Kate.Say("Honey! It's working!");
  188.         Kate.Say("This piece of shit radio picked something up!");
  189.         /*
  190.         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..."); }
  191.         */
  192.  
  193.         TutorialStove.Toggle();
  194.         TutorialStoveContainer.AddInventory(PotOfSoup);
  195.        
  196.         if(TutorialStove.IsActivated() && TutorialStoveContainer.HasInventory(PotOfSoup))
  197.         {
  198.                        
  199.                 Kate.Say("Can you smell burning?");
  200.                 CustomStartFire.ProcessAlways(); /* sets our custom trigger to start processing every frame. */
  201.         }
  202.         else
  203.         {
  204.                 Kate.Say("NO BURN!");
  205.         }      
  206. }
  207.  
  208. /*******************************************************************************************
  209. **      Sets fire on stove...
  210. ********************************************************************************************/
  211. script SetFire
  212. {
  213.         CustomStartFire.ProcessNever(); /* We've processed the trigger now. Disable it so it doesn't call this script and set the fire every frame. */
  214.        
  215.         World.StartFire(TutorialStovePosition, 500000); /* Set the fire at the stove location, give it a whole load of potential energy so it spreads fast. */
  216.        
  217.         /* Start both the timed triggers to do the actual alarm sound effect and NPC hearable world sound. */
  218.         CustomDoAlarmWorldSound.ProcessAlways();
  219.         CustomDoAlarmSound.ProcessAlways();
  220.        
  221.         CanDragKate.Set(yes);   /* Set it so kate is draggable (tested in game code for now) */
  222.        
  223.         World.CreateZombieSwarm( 15, TutorialAlarmZombieSpawn );        /* spawn 15 zombies within zone near front door. */
  224.        
  225.         Player.Say("Oh shit...");
  226.        
  227.         /* Do alarm for 30 seconds... */
  228.         Wait(30.0f);
  229.        
  230.         /* Then stop. */
  231.         CustomDoAlarmWorldSound.ProcessNever();
  232.         CustomDoAlarmSound.ProcessNever();
  233.        
  234. }
  235.  
  236. script DoAlarmBeep
  237. {      
  238.         World.PlaySoundEffect("firealarm", TutorialStovePosition, false, 0.0, 30, 0.6, false); /* Play the fire alarm beep sound effect to the player. */
  239. }
  240.  
  241. script DoAlarmWorldBeep
  242. {      
  243.         World.PlayWorldSound(TutorialStovePosition, 40, 40);    /* Create a sound that can be heard by NPCs / zombies up to 40 tiles away from stove. */
  244. }