diff options
Diffstat (limited to 'world/map/npc/029-2')
-rw-r--r-- | world/map/npc/029-2/barrels.txt | 8 | ||||
-rw-r--r-- | world/map/npc/029-2/barrels_config.txt | 31 | ||||
-rw-r--r-- | world/map/npc/029-2/cynric.txt | 1 | ||||
-rw-r--r-- | world/map/npc/029-2/morgan.txt | 41 | ||||
-rw-r--r-- | world/map/npc/029-2/sorfina.txt | 50 | ||||
-rw-r--r-- | world/map/npc/029-2/stat_reset.txt | 3 | ||||
-rw-r--r-- | world/map/npc/029-2/tanisha.txt | 42 |
7 files changed, 53 insertions, 123 deletions
diff --git a/world/map/npc/029-2/barrels.txt b/world/map/npc/029-2/barrels.txt index 4ff3e6de..39bd0ad3 100644 --- a/world/map/npc/029-2/barrels.txt +++ b/world/map/npc/029-2/barrels.txt @@ -2,7 +2,6 @@ // Author: Wushin 029-2,23,86,0|script|Barrel#0|400 { - setarray @npc_loc, 23, 86, 2; set @barrel, 0; callfunc "CheckBarrel"; end; @@ -14,49 +13,42 @@ OnMaggotDeath: } 029-2,28,86,0|script|Barrel#1|400 { - setarray @npc_loc, 28, 86, 2; set @barrel, 1; callfunc "CheckBarrel"; end; } 029-2,31,91,0|script|Barrel#2|400 { - setarray @npc_loc, 31, 91, 2; set @barrel, 2; callfunc "CheckBarrel"; end; } 029-2,36,85,0|script|Barrel#3|400 { - setarray @npc_loc, 36, 85, 2; set @barrel, 3; callfunc "CheckBarrel"; end; } 029-2,40,89,0|script|Barrel#4|400 { - setarray @npc_loc, 40, 89, 2; set @barrel, 4; callfunc "CheckBarrel"; end; } 029-2,38,91,0|script|Barrel#5|400 { - setarray @npc_loc, 38, 91, 2; set @barrel, 5; callfunc "CheckBarrel"; end; } 029-2,29,92,0|script|Barrel#6|400 { - setarray @npc_loc, 29, 92, 2; set @barrel, 6; callfunc "CheckBarrel"; end; } 029-2,24,91,0|script|Barrel#7|400 { - setarray @npc_loc, 24, 91, 2; set @barrel, 7; callfunc "CheckBarrel"; end; diff --git a/world/map/npc/029-2/barrels_config.txt b/world/map/npc/029-2/barrels_config.txt index 665903fb..1d356a08 100644 --- a/world/map/npc/029-2/barrels_config.txt +++ b/world/map/npc/029-2/barrels_config.txt @@ -14,25 +14,13 @@ OnInit: set $@BarrelMax, getarraysize($@BarrelBits); end; } -function|script|SetBarrelMask -{ - set STARTAREA, (STARTAREA & ~(NIBBLE_4_MASK) | (@barrel_tmp << NIBBLE_4_SHIFT)); - set @barrel_tmp, 0; - return; -} -function|script|CheckBarrelQuest -{ - callfunc "CountBarrels"; - set @barrel_quest, ((STARTAREA & NIBBLE_4_MASK) >> NIBBLE_4_SHIFT); - return; -} function|script|CountBarrels { set @barrel_count, 0; set @count_tmp, 0; goto L_Loop; -L_Loop: +L_Loop: if (STARTAREA & $@BarrelBits[@barrel_count]) goto L_AddOne; goto L_LoopAgain; @@ -52,11 +40,9 @@ L_BarrelTally: } function|script|CheckBarrel { + set @npc_distance, 2; callfunc "PCtoNPCRange"; - if (@npc_check) - goto L_Range; - callfunc "CheckBarrelQuest"; - if (!(@barrel_quest == 2)) + if (!(QL_ZEGAS == 2)) goto L_NoI; if (STARTAREA & $@BarrelBits[@barrel]) goto L_Empty; @@ -71,10 +57,6 @@ function|script|CheckBarrel goto L_Spawn; goto L_Reward; -L_Range: - message strcharinfo(0), "You'll need to get closer."; - goto L_Return; - L_NoI: message strcharinfo(0), "Nothing interesting here."; goto L_Return; @@ -86,14 +68,15 @@ L_Empty: L_QuestReward: message strcharinfo(0), "You found the bug bomb."; misceffect 33; - set @barrel_tmp, 3; - callfunc "SetBarrelMask"; + set QL_ZEGAS, 3; killmonster getmap() + "", "Barrel#0::OnMaggotDeath"; goto L_Return; L_Spawn: message strcharinfo(0), "Uck, More Maggots!"; - areamonster getmap() + "", @npc_loc[0], @npc_loc[1], (@npc_loc[0] + 1), (@npc_loc[1] + 1), $@BarrelSpawnName$, $@BarrelSpawnId, $@BarrelSpawnCnt, "Barrel#0::OnMaggotDeath"; + setarray @npc_loc, getnpcx(), getnpcy(); + areamonster getmap(), @npc_loc[0], @npc_loc[1], (@npc_loc[0] + 1), (@npc_loc[1] + 1), $@BarrelSpawnName$, $@BarrelSpawnId, $@BarrelSpawnCnt, "Barrel#0::OnMaggotDeath"; + cleararray @npc_loc, 0, 2; goto L_Return; L_Reward: diff --git a/world/map/npc/029-2/cynric.txt b/world/map/npc/029-2/cynric.txt index d9f46d85..2a133e41 100644 --- a/world/map/npc/029-2/cynric.txt +++ b/world/map/npc/029-2/cynric.txt @@ -2,7 +2,6 @@ 029-2,30,118,0|script|Cynric|161 { - callfunc "ClearVariables"; set @npcname$, "Cynric"; callfunc "Banker"; close; diff --git a/world/map/npc/029-2/morgan.txt b/world/map/npc/029-2/morgan.txt index f6679f67..3f7d3e1e 100644 --- a/world/map/npc/029-2/morgan.txt +++ b/world/map/npc/029-2/morgan.txt @@ -3,18 +3,6 @@ // Gains Access to Magic School // See 024-2 clean that shit up // Morgan, liana -function|script|MorganState -{ - callfunc "ClearVariables"; - set @morgan, ((STARTAREA & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT); - return; -} -function|script|SetMorganMask -{ - set STARTAREA, (STARTAREA & ~(NIBBLE_3_MASK) | (@morgan_tmp << NIBBLE_3_SHIFT)); - set @morgan_tmp, 0; - return; -} 029-2,105,57,0|script|MorganDebug|355 { mes "[Morgan Debug]"; @@ -23,7 +11,7 @@ function|script|SetMorganMask "Yes.", L_Reset, "No.", L_End; L_Reset: - set STARTAREA, (STARTAREA & ~(NIBBLE_3_MASK) | (0 << NIBBLE_3_SHIFT)); + set QL_MORGAN, 0; mes "Reset!"; goto L_End; @@ -37,31 +25,26 @@ OnInit: } 029-2,101,57,0|script|Morgan#_M|355 { - setarray @npc_loc, 101, 57, 4; callfunc "PCtoNPCRange"; - if (@npc_check) - goto L_Close; - callfunc "MorganState"; - if (readparam(bInt) >= 5) + if (Int >= 5) goto L_Learn; goto L_NotMagic; L_Learn: - if (@morgan == 0) + if (QL_MORGAN == 0) goto L_NotSeen; - if (@morgan == 1) + if (QL_MORGAN == 1) goto L_Seen; - if (@morgan == 2) + if (QL_MORGAN == 2) goto L_Started; - if (@morgan == 3) + if (QL_MORGAN == 3) goto L_CastOnce; - if (@morgan == 4) + if (QL_MORGAN == 4) goto L_LearningDone; goto L_Close; L_NotSeen: - set @morgan_tmp, 1; - callfunc "SetMorganMask"; + set QL_MORGAN, 1; mes "[Morgan]"; mes "\"Welcome to the magic school of Candor\""; mes "\"My name is Morgan, I'm Head of Wizardry.\""; @@ -86,8 +69,7 @@ L_NotMagic: goto L_Close; L_Start: - set @morgan_tmp, 2; - callfunc "SetMorganMask"; + set QL_MORGAN, 2; mes "\"Great, lets begin your first lesson.\""; getitem 1171, 1; mes "\"This is a wand, there are many like it but this one is now yours.\""; @@ -115,8 +97,9 @@ L_CastOnce: mes "\"Each time you attack the wand will convert a bit of you mana into a magic bolt.\""; mes "\"After so many attacks, you will need to recast the invocation to stay attuned to the wand.\""; mes "\"(Logging out will also cancel any spell effects currently active in-game.).\""; - set @morgan_tmp, 4; - callfunc "SetMorganMask"; + next; + mes "\"I've taught you all I can for now. You should visit the Mana Seed north west of Hurnscald.\""; + set QL_MORGAN, 4; goto L_Close; L_LearningDone: diff --git a/world/map/npc/029-2/sorfina.txt b/world/map/npc/029-2/sorfina.txt index 8becafd3..984312cf 100644 --- a/world/map/npc/029-2/sorfina.txt +++ b/world/map/npc/029-2/sorfina.txt @@ -2,19 +2,16 @@ // Author: Jenalya 029-2,27,27,0|script|Sorfina|154,0,1 { - setarray @npc_loc, 27, 27, 2; + set @npc_distance, 2; callfunc "PCtoNPCRange"; - if (@npc_check) - goto L_Close; goto L_Main; L_Main: - callfunc "TutorialState"; - if (@tutorial == 10) goto L_Hasan; - if (@tutorial >= 4) goto L_Again; - if (@tutorial == 3) goto L_Clothes; - if (@tutorial == 2) goto L_Dresser; - if (@tutorial == 1) goto L_Carpet; + if (QL_BEGIN == 10) goto L_Hasan; + if (QL_BEGIN >= 4) goto L_Again; + if (QL_BEGIN == 3) goto L_Clothes; + if (QL_BEGIN == 2) goto L_Dresser; + if (QL_BEGIN == 1) goto L_Carpet; goto L_Start; L_Start: @@ -60,8 +57,7 @@ L_Carpet: mes "Press [###keyMoveUp;] to move up, press [###keyMoveDown;] to move down, "; mes "press [###keyMoveLeft;] to move left, press [###keyMoveRight;] to move right "; mes " or click on the place you want to go to.\""; - set @tutorial_tmp, 1; - callfunc "SetTutorialMask"; + set QL_BEGIN, 1; goto L_Close; L_Dresser: @@ -98,8 +94,7 @@ L_Clothes: mes "\"And here is some money for you. Don't spend it all in one place."; mes "Now go help Tanisha downstairs.\""; set Zeny, Zeny + 30; - set @tutorial_tmp, 4; - callfunc "SetTutorialMask"; + set QL_BEGIN, 4; goto L_Close; L_Again: @@ -225,8 +220,7 @@ L_Next: mes "\"If Valon hadn't have come along that moment, Hasan would have died that day.\""; mes "\"However, the scorpions poison caused a bad fever and once Hasan had recovered from that, he was even more malicious than before.\""; mes "She sighs."; - set @tutorial_tmp, 11; - callfunc "SetTutorialMask"; + set QL_BEGIN, 11; goto L_Close; L_SkipTut: @@ -246,16 +240,14 @@ L_Bye: getitem "CottonShirt", 1; getitem "RaggedShorts", 1; set Zeny, Zeny + 35; // tanisha gives 5 zeny - set @tutorial_tmp, 8; - callfunc "SetTutorialMask"; + set QL_BEGIN, 8; goto L_Close; L_Close: close; OnTouch: - callfunc "TutorialState"; - if (@tutorial > 0) + if (QL_BEGIN > 0) end; goto L_Start; } @@ -265,8 +257,7 @@ OnTouch: end; OnTouch: - callfunc "TutorialState"; - if (@tutorial != 1) + if (QL_BEGIN != 1) end; mes "[Sorfina]"; mes "\"You should get dressed now.\""; @@ -274,20 +265,19 @@ OnTouch: mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press N to focus and T to talk/activate.\""; next; mes "\"Now get the clothes out of the dresser.\""; - set @tutorial_tmp, 2; - callfunc "SetTutorialMask"; + set QL_BEGIN, 2; close; } 029-2,29,23,0|script|Dresser#tutorial|400 { - setarray @npc_loc, 29, 23, 2; + set @npc_distance, 2; + set @distance_handler, 1; callfunc "PCtoNPCRange"; if (@npc_check) goto L_CloseDis; - callfunc "TutorialState"; - if (@tutorial > 2) goto L_Empty; - if (@tutorial == 2) goto L_Shirt; + if (QL_BEGIN > 2) goto L_Empty; + if (QL_BEGIN == 2) goto L_Shirt; goto L_Walk; L_Walk: @@ -304,8 +294,7 @@ L_Shirt: mes "\"You can open your inventory by pressing F3 or clicking on the 'Inventory' button in the bar at the upper right corner.\""; next; mes "\"After we finish talking, click on the clothes and press the equip button.\""; - set @tutorial_tmp, 3; - callfunc "SetTutorialMask"; + set QL_BEGIN, 3; close; L_Empty: @@ -322,8 +311,7 @@ L_CloseDis: end; OnTouch: - callfunc "TutorialState"; - if (@tutorial < 4) + if (QL_BEGIN < 4) goto L_Block; warp "029-2", 112, 85; end; diff --git a/world/map/npc/029-2/stat_reset.txt b/world/map/npc/029-2/stat_reset.txt index 896bbf6b..c1dafd7b 100644 --- a/world/map/npc/029-2/stat_reset.txt +++ b/world/map/npc/029-2/stat_reset.txt @@ -2,10 +2,7 @@ 029-2,98,92,0|script|Jessie|159 { - setarray @npc_loc, 98, 91, 4; callfunc "PCtoNPCRange"; - if (@npc_check) - goto L_Close; if (BaseLevel >= 10) goto L_Sorry; diff --git a/world/map/npc/029-2/tanisha.txt b/world/map/npc/029-2/tanisha.txt index 450bc77c..9a7ee081 100644 --- a/world/map/npc/029-2/tanisha.txt +++ b/world/map/npc/029-2/tanisha.txt @@ -4,23 +4,19 @@ 029-2,110,88,0|script|Tanisha|114 { - setarray @npc_loc, 110, 88, 4; callfunc "PCtoNPCRange"; - if (@npc_check) - goto L_Close; if (isin("029-2", 98, 84, 106, 89)) goto L_Fighting; - callfunc "TutorialState"; - if (@tutorial >= 8) goto L_Tut_Done; - if (@tutorial == 7) goto L_Stats; - if (@tutorial == 6) goto L_Fail; - if (@tutorial == 5) goto L_Maggots; + if (QL_BEGIN >= 8) goto L_Tut_Done; + if (QL_BEGIN == 7) goto L_Stats; + if (QL_BEGIN == 6) goto L_Fail; + if (QL_BEGIN == 5) goto L_Maggots; mes "[Tanisha]"; mes "\"Hey! You're up again!\""; - emotion EMOTE_HAPPY; + emotion EMOTE_HAPPY, strcharinfo(0); mes "\"Are you feeling better?\""; menu "Yes, thank you.",L_Next, @@ -30,8 +26,7 @@ L_Next: mes "[Tanisha]"; mes "\"I'm glad you're feeling better. It was really bad luck what happened to you."; mes "Hey, I have an idea.\""; - set @tutorial_tmp, 5; - callfunc "SetTutorialMask"; + set QL_BEGIN, 5; goto L_Maggots; L_Maggots: @@ -67,24 +62,21 @@ L_Fight_Again: next; mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing [###keyPickup;] or clicking on the items with your mouse.\""; close2; - // The getitem must be in the same place as set @tutorial, 2; + // The getitem must be in the same place as set QL_BEGIN, 2; // since it was moved to after L_Fight_Again, add it conditionally - callfunc "TutorialState"; - if (@tutorial == 5) + if (QL_BEGIN == 5) goto L_GetFightItems; goto L_ContinueFight; L_GetFightItems: - set @tutorial_tmp, 6; - callfunc "SetTutorialMask"; + set QL_BEGIN, 6; getitem "Knife", 1; getitem "SlingShot", 1; getitem "SlingBullet", 500; goto L_ContinueFight; L_ContinueFight: - set @tutorial_tmp, 6; - callfunc "SetTutorialMask"; + set QL_BEGIN, 6; set @Maggot_Kills, 0; set @time, 0; if (getareausers("029-2", 98, 84, 106, 89) == 0) @@ -118,8 +110,7 @@ L_StatsRe: mes "\"My Uncle sitting at the counter knows a spell to help the younglings reset their stats.\""; mes "\"He also knows of mages with even more powerful reset spells.\""; next; - callfunc "TutorialState"; - if (@tutorial == 7) + if (QL_BEGIN == 7) goto L_Money; goto L_Advice; @@ -128,8 +119,7 @@ L_Money: mes "[Tanisha]"; mes "\"Hey, you are so smart taking out all that yucky maggots for me."; mes "You can have my pocket money. Here.\""; - set @tutorial_tmp, 8; - callfunc "SetTutorialMask"; + set QL_BEGIN, 8; set Zeny, Zeny + 5; next; goto L_Advice; @@ -137,7 +127,7 @@ L_Money: L_Advice: mes "\"When you go to Hurnscald, you should see Bernard. He can make a delicious soup!"; mes "Good luck!\""; - emotion EMOTE_HAPPY; + emotion EMOTE_HAPPY, strcharinfo(0); goto L_Close; L_Explain: @@ -263,8 +253,7 @@ OnMaggotDeath: goto L_Summon; // else, complete warp "029-2", 110, 88; - set @tutorial_tmp, 7; - callfunc "SetTutorialMask"; + set QL_BEGIN, 7; set @Maggot_Kills, 0; set @time, 0; if (getareausers("029-2", 98, 84, 106, 89) == 0) @@ -284,8 +273,7 @@ OnInit: end; OnTouch: - callfunc "TutorialState"; - if (@tutorial >= 8) + if (QL_BEGIN >= 8) goto L_Warp; goto L_Block; |