From 726a2d9c8707109d22f20074439d2047915f0d36 Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Sat, 26 Jan 2013 21:03:49 +0100 Subject: Restructuring the quests saved in TMW_Quest: write conversion function. This function moves the content of TMW_Quest into nibbles of other variables. --- world/map/npc/functions/clear_vars.txt | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'world/map/npc/functions') diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index cc6f097d..9faef2be 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -143,6 +143,56 @@ L_Fix_Full: return; } +// The variable TMW_Quest was used to save the progress in several subquests linearly. +// The subquests are moved to different nibbles of other variables +// to make it possible to do some of the quests in parallel. +function|script|ClearVarTMW_Quest|{ + + if (TMW_Quest == 0) goto L_Done; + if (TMW_Quest < 7) goto L_Bernard_Mikhail; + if (TMW_Quest < 9) goto L_Sarah; + if (TMW_Quest < 11) goto L_Vincent; + if (TMW_Quest < 13) goto L_Sandra; + if (TMW_Quest < 41) goto L_Desert; + +L_Bandit: +// move Banditt subquest into Nibble 0 of QUEST_Hurnscald + set @bandit, TMW_Quest - 40; + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_0_MASK) | (@bandit << NIBBLE_0_SHIFT)); + set TMW_Quest, TMW_Quest - @bandit; + set @bandit, 0; +L_Desert: +// move guard and miner subquest into Byte 2 (Nibble 4 and 5) of QUEST_SouthTulimshar + set @miners, TMW_Quest - 12; + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@miners << BYTE_2_SHIFT)); + set TMW_Quest, TMW_Quest - @miners; + set @miners, 0; +L_Sandra: +// move Sandra subquest into Nibble 3 of QUEST_SouthTulimshar + set @sandra, TMW_Quest - 10; + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_3_MASK) | (@sandra << NIBBLE_3_SHIFT)); + set TMW_Quest, TMW_Quest - @sandra; + set @sandra, 0; +L_Vincent: +// move Vincent subquest into Nibble 2 of QUEST_SouthTulimshar + set @vincent, TMW_Quest - 8; + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_2_MASK) | (@vincent << NIBBLE_2_SHIFT)); + set TMW_Quest, TMW_Quest - @vincent; + set @vincent, 0; +L_Sarah: +// move Sarah subquest into Nibble 1 of QUEST_SouthTulimshar + set @sarah, TMW_Quest - 6; + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_1_MASK) | (@sarah << NIBBLE_1_SHIFT)); + set TMW_Quest, TMW_Quest - @sarah; + set @sarah, 0; +L_Bernard_Mikhail: +// move Bernard and Mikhail subquest into Nibble 0 of QUEST_SouthTulimshar + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (TMW_Quest << NIBBLE_0_SHIFT)); + set TMW_Quest, 0; +L_Done: + return; +} + -|script|#ClearGlobalVars|-1,{ OnInit: -- cgit v1.2.3-60-g2f50 From 55b20f23de4c709398b65e6833b29138e4307e7a Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 9 Feb 2013 22:25:06 -0800 Subject: o11c's review of the conversion function --- world/map/npc/functions/clear_vars.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'world/map/npc/functions') diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index 9faef2be..14e9cc5f 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -149,41 +149,41 @@ L_Fix_Full: function|script|ClearVarTMW_Quest|{ if (TMW_Quest == 0) goto L_Done; - if (TMW_Quest < 7) goto L_Bernard_Mikhail; - if (TMW_Quest < 9) goto L_Sarah; - if (TMW_Quest < 11) goto L_Vincent; - if (TMW_Quest < 13) goto L_Sandra; - if (TMW_Quest < 41) goto L_Desert; + if (TMW_Quest <= 6) goto L_Bernard_Mikhail; + if (TMW_Quest <= 8) goto L_Sarah; + if (TMW_Quest <= 10) goto L_Vincent; + if (TMW_Quest <= 12) goto L_Sandra; + if (TMW_Quest <= 40) goto L_Desert; L_Bandit: -// move Banditt subquest into Nibble 0 of QUEST_Hurnscald +// move Bandit subquest into Nibble 0 of QUEST_Hurnscald set @bandit, TMW_Quest - 40; set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_0_MASK) | (@bandit << NIBBLE_0_SHIFT)); - set TMW_Quest, TMW_Quest - @bandit; + set TMW_Quest, 40; set @bandit, 0; L_Desert: // move guard and miner subquest into Byte 2 (Nibble 4 and 5) of QUEST_SouthTulimshar set @miners, TMW_Quest - 12; set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@miners << BYTE_2_SHIFT)); - set TMW_Quest, TMW_Quest - @miners; + set TMW_Quest, 12; set @miners, 0; L_Sandra: // move Sandra subquest into Nibble 3 of QUEST_SouthTulimshar set @sandra, TMW_Quest - 10; set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_3_MASK) | (@sandra << NIBBLE_3_SHIFT)); - set TMW_Quest, TMW_Quest - @sandra; + set TMW_Quest, 10; set @sandra, 0; L_Vincent: // move Vincent subquest into Nibble 2 of QUEST_SouthTulimshar set @vincent, TMW_Quest - 8; set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_2_MASK) | (@vincent << NIBBLE_2_SHIFT)); - set TMW_Quest, TMW_Quest - @vincent; + set TMW_Quest, 8; set @vincent, 0; L_Sarah: // move Sarah subquest into Nibble 1 of QUEST_SouthTulimshar set @sarah, TMW_Quest - 6; set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_1_MASK) | (@sarah << NIBBLE_1_SHIFT)); - set TMW_Quest, TMW_Quest - @sarah; + set TMW_Quest, 6; set @sarah, 0; L_Bernard_Mikhail: // move Bernard and Mikhail subquest into Nibble 0 of QUEST_SouthTulimshar -- cgit v1.2.3-60-g2f50 From 19058b8fc8a2e85562be1564d6fdcd03f1545fe8 Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Sun, 3 Feb 2013 14:37:57 +0100 Subject: Variable restructuring: move Quest_Scythe_state into Nibble 1 of QUEST_Hurnscald. --- world/map/npc/008-1/hinnak.txt | 77 ++++++++++++++++++---------------- world/map/npc/functions/clear_vars.txt | 5 +++ 2 files changed, 45 insertions(+), 37 deletions(-) (limited to 'world/map/npc/functions') diff --git a/world/map/npc/008-1/hinnak.txt b/world/map/npc/008-1/hinnak.txt index 9e2c8cde..c3c4877d 100644 --- a/world/map/npc/008-1/hinnak.txt +++ b/world/map/npc/008-1/hinnak.txt @@ -1,39 +1,36 @@ -//################################################################################# -//# # -//# this script file contains the npc scripts for the quest to obtain a scythe. # -//# # -//# Needed: 10 Pink Antenna # -//# # -//# Reward: Scythe # -//# # -//################################################################################# - -//Farmer +// This script file contains the npc scripts for the quest to obtain a scythe. +// +// Needed: 10 Pink Antenna +// Reward: Scythe +// +// Variables used: Nibble 1 of QUEST_Hurnscald (previously QUEST_Scythe_state) 008-1.gat,101,30,0|script|Hinnak|142,{ + callfunc "ClearVariables"; + if (Inspector == 10) goto L_NohMask; L_No_NohMask: - if (QUEST_Scythe_state == 1) goto L_Exchange; - if (QUEST_Scythe_state == 2) goto L_ThanksAgain; + set @state, ((QUEST_Hurnscald & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT); + + if (@state == 1) goto L_Exchange; + if (@state == 2) goto L_ThanksAgain; if (getequipid(equip_head) == 751) goto L_Intro_Hat; mes "[Farmer Hinnak]"; mes "\"Argh! I hate them! I @#$% hate them! I @#$% hate these @#$% pinkies!\""; next; menu - "You need some anger control therapy.", -, + "You need some anger control therapy.", L_Close, "Why do you hate them?", L_Reason; - close; L_Intro_Hat: mes "The farmer lunges at you with a farming implement."; next; heal -50, 0; menu - "I'm out of here.", -, + "I'm out of here.", L_Close, "Whoa, what are you doing?", L_Intro_Hat_Explain; - close; L_Intro_Hat_Explain: mes "[Farmer Hinnak]"; @@ -48,24 +45,23 @@ L_Reason: next; menu "Want me to help you?", L_Help, - "Well, life ain't fair.", -; - close; + "Well, life ain't fair.", L_Close; L_Help: mes "[Farmer Hinnak]"; mes "\"Yes, you look quite fast. Maybe you can catch some of them. That will pay them a lesson."; mes "Slay some of them and bring me 10 of their antennae.\""; - set QUEST_Scythe_state, 1; + set @state, 1; + callsub S_Update_Mask; next; menu - "Sure, I'm on my way", -, + "Sure, I'm on my way", L_Close, "How much is this worth to you?", L_Reward; - close; L_Reward: mes "[Farmer Hinnak]"; mes "\"Well, I can't offer you much. But I got an old scythe laying around. Maybe you can use it as a weapon.\""; - close; + goto L_Close; L_Exchange: if (getequipid(equip_head) != 751) @@ -78,9 +74,8 @@ L_Exchange_Start: mes "\"Have you got the 10 antennae?\""; next; menu - "Not yet, but I am working on it.", -, + "Not yet, but I am working on it.", L_Close, "Sure, here they are!", L_Exchange_Exchange; - close; L_Exchange_Exchange: if (countitem("PinkAntenna") < 10) @@ -90,20 +85,21 @@ L_Exchange_Exchange: goto L_Exchange_TooMany; delitem "PinkAntenna", 10; getitem "Scythe", 1; - set QUEST_Scythe_state, 2; + set @state, 2; + callsub S_Update_Mask; mes "[Farmer Hinnak]"; mes "\"Thank you very much. I've got something for you. My old scythe. Maybe you can use it as a weapon. It is a bit cumbersome but its strikes are deadly.\""; - close; + goto L_Close; L_Exchange_Notenough: mes "[Farmer Hinnak]"; mes "\"It doesn't look like you do.\""; - close; + goto L_Close; L_Exchange_TooMany: mes "[Farmer Hinnak]"; mes "\"Looks like you don't have room for this. Come back later to receive your reward. Hold on to the antennea until then.\""; - close; + goto L_Close; L_ThanksAgain: if (getequipid(equip_head) == 751) @@ -202,43 +198,50 @@ L_GiveBeer: L_Sagatha_hahaha: mes "[Farmer Hinnak]"; mes "\"Yeah, funny now... But you should've seen that stare! Ah, well, never mind.\""; - close; + goto L_Close; L_Sagatha_scary: mes "[Farmer Hinnak]"; mes "\"Yeah, you could say that...\""; mes "He stares into his empty beer jug, as if wishing it weren't empty yet."; - close; + goto L_Close; L_Sagatha_word: mes "[Farmer Hinnak]"; mes "\"Oh, I can't be sure... but something like '" + getspellinvocation("summon-maggots") + "', I think.\""; - close; + goto L_Close; L_NoBeer: mes "[Farmer Hinnak]"; mes "\"Ah... no beer? Oh well.\""; - close; + goto L_Close; L_Bye: mes "[Farmer Hinnak]"; mes "\"Bye!\""; - close; + goto L_Close; L_NohMask: menu "Did you see anyone in a mask come by here at night?", L_NohMask_Mask, "Did you see anyone with a large satchel come by here at night?", L_NohMask_Satchel, - "Hello", L_No_NohMask; - close; + "Hello.", L_No_NohMask; L_NohMask_Mask: mes "[Farmer Hinnak]"; mes "\"No. It tends to be too dark to see a mask.\""; - close; + goto L_Close; L_NohMask_Satchel: mes "[Farmer Hinnak]"; mes "\"Yes, I saw someone with a large sack on their back go to the mining camp.\""; + goto L_Close; + +L_Close: + set @state, 0; close; + +S_Update_Mask: + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_1_MASK)) | (@state << NIBBLE_1_SHIFT); + return; } diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index 14e9cc5f..ff0bdb02 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -106,6 +106,11 @@ function|script|ClearVariables|{ // quest was turned into a Daily Quest, so the variable isn't needed anymore set CaveSnakeLamp, 0; + // move Scythe quest into bitmasked variable QUEST_Hurnscald + if (QUEST_Scythe_state) + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_1_MASK)) | (QUEST_Scythe_state << NIBBLE_1_SHIFT); + set QUEST_Scythe_state, 0; + //These lines are needed to migrate stuff from variables to flags if (Open_Underground_Palace_Barrier) set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND; -- cgit v1.2.3-60-g2f50 From 3a50328148c111d329322f5930c5332eb0c5dc48 Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Sun, 3 Feb 2013 17:31:07 +0100 Subject: Variable restructuring: move Quest_demon_mines into Nibble 2 of QUEST_Hurnscald. --- world/map/npc/013-3/barrier.txt | 21 +++++++++--- world/map/npc/013-3/mask_chest.txt | 63 ++++++++++++++++++++-------------- world/map/npc/018-3/bookcase.txt | 25 ++++++++++---- world/map/npc/functions/clear_vars.txt | 5 +++ 4 files changed, 79 insertions(+), 35 deletions(-) (limited to 'world/map/npc/functions') diff --git a/world/map/npc/013-3/barrier.txt b/world/map/npc/013-3/barrier.txt index 6de45440..410bc882 100644 --- a/world/map/npc/013-3/barrier.txt +++ b/world/map/npc/013-3/barrier.txt @@ -1,17 +1,30 @@ // 013-3.gat,71,21,0|script|#DemonMineBarrier1#_M|45,1,1,{ - if (QUEST_demon_mines >= 2) close; - if (QUEST_demon_mines == 1 && countitem("JackOSoul") >= 1) goto L_Has_Jack_O_Soul; + callfunc "ClearVariables"; + + set @state, ((QUEST_Hurnscald & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); + + if (@state >= 2) goto L_Close; + if (@state == 1 && countitem("JackOSoul") >= 1) goto L_Has_Jack_O_Soul; mes "A barrier around the opening pushes you back as you approach."; warp "013-3.gat", 71, 25; - close; + goto L_Close; L_Has_Jack_O_Soul: mes "The barrier around the opening allows you passage."; - set QUEST_demon_mines, 2; + set @state, 2; + callsub S_Update_Mask; delitem "JackOSoul", 1; + goto L_Close; + +L_Close: + set @state, 0; close; + +S_Update_Mask: + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (@state << NIBBLE_2_SHIFT); + return; } diff --git a/world/map/npc/013-3/mask_chest.txt b/world/map/npc/013-3/mask_chest.txt index 59aa0819..4a15bc0b 100644 --- a/world/map/npc/013-3/mask_chest.txt +++ b/world/map/npc/013-3/mask_chest.txt @@ -1,8 +1,12 @@ // 013-3.gat,28,27,0|script|Chest#DemonMask|111,{ - if (QUEST_demon_mines < 2) goto L_This_shouldn_t_happen; - if (QUEST_demon_mines == 3) goto L_Finished; + callfunc "ClearVariables"; + + set @state, ((QUEST_Hurnscald & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); + + if (@state < 2) goto L_This_shouldn_t_happen; + if (@state == 3) goto L_Finished; if (countitem("MaggotSlime") == 0) goto L_No_maggot_slime; @@ -112,97 +116,106 @@ mes "You managed to perform the ritual and open the chest."; getitem "DemonMask", 1; mes "You found a demon mask inside."; - set QUEST_demon_mines, 3; - close; + set @state, 3; + callsub S_Update_Mask; + goto L_Close; L_No_maggot_slime: mes "You do not have any maggot slime."; - close; + goto L_Close; L_No_mushroom: mes "You do not have a mushroom, neither big, nor small."; - close; + goto L_Close; L_No_pink_petal: mes "You can't seem to find that pink petal you had."; - close; + goto L_Close; L_No_pearl: mes "You do not have a pearl, let alone one from the sea."; - close; + goto L_Close; L_No_hard_spike: mes "You weren't able to find a hard spike in the stuff you brought."; - close; + goto L_Close; L_No_raw_log: mes "You don't have any wood."; - close; + goto L_Close; L_No_pink_antenna: mes "You aren't carrying any antenna."; - close; + goto L_Close; L_No_tongues: mes "You don't have four different snake tongues."; - close; + goto L_Close; L_No_treasure_key: mes "No treasure chest key, no opening ritual."; - close; + goto L_Close; L_No_ash: mes "You still need a pile of ash."; - close; + goto L_Close; L_No_herbs: mes "Four different herbs are needed to get this thing open."; - close; + goto L_Close; L_No_bug_leg: mes "You do not have part of a bug on you. That is rather odd considering what you went through to get here."; - close; + goto L_Close; L_No_lamp: mes "You do not have a lamp. Yet, somehow, you were able to get this far into this dark cave."; - close; + goto L_Close; L_No_iron_ore: mes "\"Rock and metal, as one.\" You don't seem to have anything that fits the bill."; - close; + goto L_Close; L_No_stingers: mes "Three scorpion deaths are still missing."; - close; + goto L_Close; L_No_silk: mes "You could not find the womb for a butterfly among your stuff."; - close; + goto L_Close; L_No_fur: mes "You wonder how you can carry the \"gentle caress of a creature without blemish.\" But you need it to get this thing open."; - close; + goto L_Close; L_No_dark_crystal: mes "A piece of darkness is missing."; - close; + goto L_Close; L_No_water: mes "Just one bottle of water and you can start the ritual."; - close; + goto L_Close; L_This_shouldn_t_happen: warp "013-3.gat", 71, 25; // You need to go through the barrier to get to the chest, so this shouldn't happen. So just warp them like the barrier does. - close; + goto L_Close; L_Finished: mes "[Chest]"; mes "You already opened this chest."; - close; + goto L_Close; L_TooMany: mes "[Chest]"; mes "You don't have room for what ever is inside. Maybe you should try again later."; + goto L_Close; + +L_Close: + set @state, 0; close; + +S_Update_Mask: + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (@state << NIBBLE_2_SHIFT); + return; } diff --git a/world/map/npc/018-3/bookcase.txt b/world/map/npc/018-3/bookcase.txt index 2e04c06b..38af0d0e 100644 --- a/world/map/npc/018-3/bookcase.txt +++ b/world/map/npc/018-3/bookcase.txt @@ -1,15 +1,18 @@ // 018-3.gat,75,123,0|script|#DemonMineBookcase1|127,{ - if (QUEST_demon_mines == 0) goto L_Search; + callfunc "ClearVariables"; + + set @state, ((QUEST_Hurnscald & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); + + if (@state == 0) goto L_Search; mes "You see nothing different about the bookcase."; mes "Do you want to search it again anyways?"; next; menu - "Yes", L_Search, - "No", -; - close; + "Yes.", L_Search, + "No.", L_Close; L_Search: mes "After searching the bookcase, you were able to find a few passages that you can read."; @@ -50,7 +53,17 @@ L_Search: mes ""; mes "You begin to wonder if you read that list right."; next; - if (QUEST_demon_mines == 0) - set QUEST_demon_mines, 1; + if (@state != 0) + goto L_Close; + set @state, 1; + callsub S_Update_Mask; + goto L_Close; + +L_Close: + set @state, 0; close; + +S_Update_Mask: + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (@state << NIBBLE_2_SHIFT); + return; } diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index ff0bdb02..d0ca5313 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -111,6 +111,11 @@ function|script|ClearVariables|{ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_1_MASK)) | (QUEST_Scythe_state << NIBBLE_1_SHIFT); set QUEST_Scythe_state, 0; + // move Demon Mask quest into bitmasked variable QUEST_Hurnscald + if (QUEST_demon_mines) + set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (QUEST_demon_mines << NIBBLE_2_SHIFT); + set QUEST_demon_mines, 0; + //These lines are needed to migrate stuff from variables to flags if (Open_Underground_Palace_Barrier) set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND; -- cgit v1.2.3-60-g2f50 From c88ef1cbf878acd5439c3aef1cdac2f68436e0b5 Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Sun, 3 Feb 2013 17:44:55 +0100 Subject: Variable restructuring: move information about opening the chest in Hurnscald mines into FLAGS variable. --- world/map/db/const.txt | 1 + world/map/npc/013-3/sword_chest.txt | 9 +++++---- world/map/npc/functions/clear_vars.txt | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'world/map/npc/functions') diff --git a/world/map/db/const.txt b/world/map/db/const.txt index 6e5f4803..dbb821ba 100644 --- a/world/map/db/const.txt +++ b/world/map/db/const.txt @@ -504,6 +504,7 @@ FLAG_ROSSI_COMPLETED 128 // Completed the Rossi Quest FLAG_TUTORIAL_DONE 256 // player completed tutorial (or entered the tutorial area from outside after it was added) FLAG_SNOWMAN 512 // player gave candy to the snowman FLAG_SANTAS_HELPER 1024 // player gave presents to Santa's helper +FLAG_HURNSMINE_CHEST 2048 // player opened the chest with the short sword in Hurnscald mines DOCK_tulimshar 1 DOCK_hurnscald 2 diff --git a/world/map/npc/013-3/sword_chest.txt b/world/map/npc/013-3/sword_chest.txt index bb89e3f3..8c89b52d 100644 --- a/world/map/npc/013-3/sword_chest.txt +++ b/world/map/npc/013-3/sword_chest.txt @@ -1,14 +1,15 @@ // 013-3.gat,177,22,0|script|Chest|111,{ - if( ChestQuest & 2) goto L_Finished; + callfunc "ClearVariables"; + if (FLAGS & FLAG_HURNSMINE_CHEST) goto L_Finished; mes "[Chest]"; mes "Would you try to open it?"; next; menu - "Yes", L_Yes, - "No", -; + "Yes.", L_Yes, + "No.", -; close; L_Yes: @@ -22,7 +23,7 @@ L_Yes: getitem "ShortSword", 1; mes "[Chest]"; mes "You opened it and found a short sword!"; - set ChestQuest, ChestQuest | 2; + set FLAGS, FLAGS | FLAG_HURNSMINE_CHEST; close; L_Not_Enough: diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index d0ca5313..2dbf0d2d 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -133,6 +133,10 @@ function|script|ClearVariables|{ set FLAGS, FLAGS | FLAG_SANTAS_HELPER; set ChristmasQuest2, 0; + if (ChestQuest) + set FLAGS, FLAGS | FLAG_HURNSMINE_CHEST; + set ChestQuest, 0; + if (#BankAccount < 0) goto FixBank; -- cgit v1.2.3-60-g2f50 From e20721649a36c6ad20b851ea5c643364fdb239f6 Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Thu, 7 Feb 2013 16:31:17 +0100 Subject: Add event variables to clear_vars function. --- world/map/npc/functions/clear_vars.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'world/map/npc/functions') diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index 2dbf0d2d..fda2f756 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -94,6 +94,17 @@ function|script|ClearVariables|{ set Xmas2010, 0; set Golbenez_Inn_Cost, 0; + set QUEST_Easter11, 0; + + // contains bad karma information + // set hw2011, 0; + + set xmas11, 0; + + set QUEST_Easter12, 0; + + set xmas2012, 0; + // Tulimshar and Mine Variables which aren't used anymore set Scorp, 0; set Bugleg, 0; -- cgit v1.2.3-60-g2f50 From e0e679a8a695641d1845c28bebe1c7e83c21a39f Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Thu, 7 Feb 2013 16:36:00 +0100 Subject: Add variables to clear_vars that doesn't occur anywhere in the game data, but were found in the save file. --- world/map/npc/functions/clear_vars.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'world/map/npc/functions') diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index fda2f756..48002fa4 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -1,6 +1,8 @@ // Clears old variables function|script|ClearVariables|{ + set EasterQuest, 0; + // Halloween 2006 set HWQUEST1, 0; set HWQUEST2, 0; @@ -46,6 +48,8 @@ function|script|ClearVariables|{ set XMASQUEST19, 0; set XMASQUEST20, 0; + set QUEST_Halloween07_state, 0; + set QUEST_xmas07_state, 0; set QUEST_xmas07_milk, 0; set QUEST_xmas07_cookies, 0; @@ -105,6 +109,8 @@ function|script|ClearVariables|{ set xmas2012, 0; + set QUEST_clothdyer_angus, 0; + // Tulimshar and Mine Variables which aren't used anymore set Scorp, 0; set Bugleg, 0; -- cgit v1.2.3-60-g2f50