diff options
Diffstat (limited to 'world')
50 files changed, 1377 insertions, 302 deletions
diff --git a/world/map/conf/magic-quickdebug.sex b/world/map/conf/magic-quickdebug.sex index 8b6e5939..63ff5ada 100644 --- a/world/map/conf/magic-quickdebug.sex +++ b/world/map/conf/magic-quickdebug.sex @@ -1,3 +1,6 @@ "--------------------------------------------------------------------------------" "Quickdebug Spells" "--------------------------------------------------------------------------------" +(SPELL (NONMAGIC SILENT) debug0 "#debug" () + (EFFECT + (SCRIPT "{if(!debug)end;callfunc \"Debug\";}"))) diff --git a/world/map/data/001-1.wlk b/world/map/data/001-1.wlk Binary files differindex 9050ad38..05f949c1 100644 --- a/world/map/data/001-1.wlk +++ b/world/map/data/001-1.wlk diff --git a/world/map/data/021-1.wlk b/world/map/data/021-1.wlk Binary files differindex e7afe900..af614879 100644 --- a/world/map/data/021-1.wlk +++ b/world/map/data/021-1.wlk diff --git a/world/map/data/022-1.wlk b/world/map/data/022-1.wlk Binary files differindex f84df1d7..ae5f314d 100644 --- a/world/map/data/022-1.wlk +++ b/world/map/data/022-1.wlk diff --git a/world/map/data/024-1.wlk b/world/map/data/024-1.wlk Binary files differindex 26d6e3fc..c15f1d51 100644 --- a/world/map/data/024-1.wlk +++ b/world/map/data/024-1.wlk diff --git a/world/map/data/042-1.wlk b/world/map/data/042-1.wlk Binary files differindex ccd506c8..da320f7e 100644 --- a/world/map/data/042-1.wlk +++ b/world/map/data/042-1.wlk diff --git a/world/map/db/chest_item_db.txt b/world/map/db/chest_item_db.txt index 06d25276..de94086c 100644 --- a/world/map/db/chest_item_db.txt +++ b/world/map/db/chest_item_db.txt @@ -28,13 +28,7 @@ 798, SorcererRobeRed, Sorcerer Robe Red, 5, 8000, 4000, 5, 0, 5, 0, 20, 0, 2, 512, 0, 0, 0, {}, {bonus bAgi, 1;} 870, FineDress, Fine Dress, 5, 10000, 5000, 35, 0, 8, 0, 3, 0, 2, 512, 0, 0, 0, {}, {} 880, LazuriteRobe, Lazurite Robe, 5, 92000, 52000, 30, 0, 7, 0, 60, 0, 2, 512, 0, 90, 0, {}, {set @bStat, bInt;set @minbStatVal, 70;callfunc "RequireStat"; set @bStat, bVit;set @minbStatVal, 40;callfunc "RequireStat"; bonus bSpeedAddRate, -15; bonus bDef2Rate, -40; bonus bMdef, 60; bonus bVit, -1; bonus bInt, 7; bonus bLuk, -1; bonus bDex, -1; bonus bStr, -1;} -1176, LightBlueContributor, Light Blue Contributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} -1177, BrownContributor, Brown Contributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} -1178, WhiteContributor, WhiteContributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} -1179, GreenContributor, GreenContributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} -1180, PurpleContributor, PurpleContributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} -1181, YellowContributor, YellowContributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} -1182, RedContributor, RedContributor, 5, 8000, 4000, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +1178, ContributorShirt, ContributorShirt, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} 1183, AmberChristmasSweater, Amber Christmas Sweater, 5, 2000, 1000, 35, 0, 6, 0, -12, 0, 2, 512, 0, 0, 0, {}, {} 1184, FunkyChristmasSweater, Funky Christmas Sweater, 5, 2000, 1000, 35, 0, 6, 0, -12, 0, 2, 512, 0, 0, 0, {}, {} 1185, PinkChristmasSweater, Pink Christmas Sweater, 5, 8000, 4000, 30, 0, 5, 0, 0, 0, 2, 512, 0, 0, 0, {}, {} @@ -238,3 +232,14 @@ 5107, PurpleSorcererRobeWhite, Purple Sorcerer Robe Wh, 5, 8000, 4000, 30, 0, 5, 0, 20, 0, 2, 512, 0, 0, 0, {}, {bonus bAgi, 1;} 5108, DarkGreenSorcererRobeWh, Dark Green Sorcerer Rob, 5, 8000, 4000, 30, 0, 5, 0, 20, 0, 2, 512, 0, 0, 0, {}, {bonus bAgi, 1;} 5109, SorcererRobeWhite, Sorcerer Robe White, 5, 8000, 4000, 30, 0, 5, 0, 20, 0, 2, 512, 0, 0, 0, {}, {bonus bAgi, 1;} +//ID, Name___________________, Label__________________, Type, Price, Sell, Weight, ATK, DEF, Range, Mbonus, Slot, Gender, Loc, wLV, eLV, View, {UseScript}, {EquipScript} +5131, RedContributor, Red Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5132, GreenContributor, Green Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5133, DarkBlueContributor, Dark Blue Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5134, YellowContributor, Yellow Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5135, LightBlueContributor, Light Blue Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5136, PinkContributor, Pink Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5137, BlackContributor, Black Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5138, OrangeContributor, Orange Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5139, PurpleContributor, Purple Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} +5140, DarkGreenContributor, Dark Green Contributor, 5, 0, 0, 20, 0, 5, 0, 5, 0, 2, 512, 0, 0, 0, {}, {} diff --git a/world/map/db/const.txt b/world/map/db/const.txt index 52752c1d..90118b47 100644 --- a/world/map/db/const.txt +++ b/world/map/db/const.txt @@ -17,7 +17,7 @@ MaxSp 8 1 //StatusPoint 9 1 BaseLevel 11 1 //SkillPoint 12 1 -//Class 19 1 +Class 19 1 Zeny 20 1 Sex 21 1 //NextBaseExp 22 1 diff --git a/world/map/db/generic_item_db.txt b/world/map/db/generic_item_db.txt index 5b17fa3e..efae1569 100644 --- a/world/map/db/generic_item_db.txt +++ b/world/map/db/generic_item_db.txt @@ -186,14 +186,9 @@ 2258, PurpleCottonCloth, Purple Cotton Cloth, 3, 400, 100, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 2259, DarkGreenCottonCloth, Dark Green Cotton Cloth, 3, 400, 100, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 3000, JackOLantern, Jack-o-Lantern, 3, 200, 100, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} -3001, RubberBat, Rubber Bat, 3, 200, 100, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 3002, RealisticBrain, Realistic Brain, 3, 200, 100, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 3003, JarofBlood, Jar of Blood, 3, 200, 100, 375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 3004, Tongue, Tongue, 3, 5, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} -3006, TonoriDelight, Tonori Delight, 3, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {}, {} -3007, Marshmallow, Marshmallow, 3, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {}, {} -3009, JellySkull, Jelly Skull, 3, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {}, {} -3010, CandyPumpkin, Candy Pumpkin, 3, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {}, {} 3011, PumpkinSeeds, Pumpkin Seeds, 3, 5, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 4000, AngryScorpionStinger, Angry Scorpion Stinger, 3, 50, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 4001, Coal, Coal, 3, 250, 100, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} diff --git a/world/map/db/use_item_db.txt b/world/map/db/use_item_db.txt index fa8283d9..0e5f3bde 100644 --- a/world/map/db/use_item_db.txt +++ b/world/map/db/use_item_db.txt @@ -54,17 +54,17 @@ 788, BeetleJuice, Beetle Juice, 0, 80, 30, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 50, 0;}, {} 789, GutBuster, Gut Buster Ale, 0, 100, 30, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 60, 0;}, {} 790, BloodWine, Blood Wine, 0, 150, 50, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 100, 0;}, {} -808, HitchhikersTowel, Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "HitchhikersTowel"; callfunc "WarpTowel";}, {} -809, WhiteHitchhikersTowel, White Hitchhiker's Towe, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "WhiteHitchhikersTowel"; callfunc "WarpTowel";}, {} -810, RedHitchhikersTowel, Red Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "RedHitchhikersTowel"; callfunc "WarpTowel";}, {} -811, GreenHitchhikersTowel, Green Hitchhiker's Towe, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "GreenHitchhikersTowel"; callfunc "WarpTowel";}, {} -812, BlueHitchhikersTowel, Blue Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "BlueHitchhikersTowel"; callfunc "WarpTowel";}, {} -813, YellowHitchhikersTowel, Yellow Hitchhiker's Tow, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "YellowHitchhikersTowel"; callfunc "WarpTowel";}, {} -814, PurpleHitchhikersTowel, Purple Hitchhiker's Tow, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "PurpleHitchhikersTowel"; callfunc "WarpTowel";}, {} -815, OrangeHitchhikersTowel, Orange Hitchhiker's Tow, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "OrangeHitchhikersTowel"; callfunc "WarpTowel";}, {} -816, PinkHitchhikersTowel, Pink Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "PinkHitchhikersTowel"; callfunc "WarpTowel";}, {} -817, TealHitchhikersTowel, Teal Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "TealHitchhikersTowel"; callfunc "WarpTowel";}, {} -818, LimeHitchhikersTowel, Lime Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "LimeHitchhikersTowel"; callfunc "WarpTowel";}, {} +808, HitchhikersTowel, Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "HitchhikersTowel"; callfunc "WarpTowel";}, {} +809, WhiteHitchhikersTowel, White Hitchhiker's Towe, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "WhiteHitchhikersTowel"; callfunc "WarpTowel";}, {} +810, RedHitchhikersTowel, Red Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "RedHitchhikersTowel"; callfunc "WarpTowel";}, {} +811, GreenHitchhikersTowel, Green Hitchhiker's Towe, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "GreenHitchhikersTowel"; callfunc "WarpTowel";}, {} +812, BlueHitchhikersTowel, Blue Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "BlueHitchhikersTowel"; callfunc "WarpTowel";}, {} +813, YellowHitchhikersTowel, Yellow Hitchhiker's Tow, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "YellowHitchhikersTowel"; callfunc "WarpTowel";}, {} +814, PurpleHitchhikersTowel, Purple Hitchhiker's Tow, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "PurpleHitchhikersTowel"; callfunc "WarpTowel";}, {} +815, OrangeHitchhikersTowel, Orange Hitchhiker's Tow, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "OrangeHitchhikersTowel"; callfunc "WarpTowel";}, {} +816, PinkHitchhikersTowel, Pink Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "PinkHitchhikersTowel"; callfunc "WarpTowel";}, {} +817, TealHitchhikersTowel, Teal Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "TealHitchhikersTowel"; callfunc "WarpTowel";}, {} +818, LimeHitchhikersTowel, Lime Hitchhiker's Towel, 0, 0, 0, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {set @warpTowelName$, "LimeHitchhikersTowel"; callfunc "WarpTowel";}, {} 825, TinyManaElixir, Tiny Mana Elixir, 0, 100, 10, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 0, 25;}, {} 826, SmallManaElixir, Small Mana Elixir, 0, 200, 20, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 0, 50;}, {} 827, MediumManaElixir, Medium Mana Elixir, 0, 400, 40, 15, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 0, 100;}, {} @@ -85,7 +85,12 @@ 1258, Honey, Honey, 0, 100, 80, 20, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 45, 0;}, {} 1280, Scissors, Scissors, 0, 1000, 500, 120, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {callfunc "useScissors";}, {} 1281, ShockSweet, Shock Sweet, 0, 1000, 500, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {callfunc "useShockSweet";}, {} +3001, RubberBat, Rubber Bat, 0, 200, 100, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {misceffect 403;getitem 3001,1;}, {} +3006, TonoriDelight, Tonori Delight, 0, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 10, 0;}, {} +3007, Marshmallow, Marshmallow, 0, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 10, 0;}, {} +3009, JellySkull, Jelly Skull, 0, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 10, 0;}, {} +3010, CandyPumpkin, Candy Pumpkin, 0, 5, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 10, 0;}, {} 4035, PickledBeets, Pickled Beets, 0, 100, 50, 150, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 50, 0; setlook LOOK_HAIR_COLOR, HC_PURPLE;}, {} 4036, RoastedAcorn, Roasted Acorn, 0, 100, 50, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {itemheal 15, 0;}, {} -5126, MTJarofOwnBlood, MTJar of Own Blood, 0, 200, 100, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {itemheal -250, 0;getitem 5127, 1;}, {} +5126, MTJarofOwnBlood, MTJar of Own Blood, 0, 200, 100, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {itemheal -250, 0;getitem 5127, 1;}, {} //ID, Name___________________, Label__________________, Type, Price, Sell, Weight, ATK, DEF, Range, Mbonus, Slot, Gender, Loc, wLV, eLV, View, {UseScript}, {EquipScript} diff --git a/world/map/news.d/40-v2014.10.20.txt b/world/map/news.d/40-v2014.10.20.txt new file mode 100644 index 00000000..c0726a4d --- /dev/null +++ b/world/map/news.d/40-v2014.10.20.txt @@ -0,0 +1,20 @@ +{title:Happy Halloween!} +{date:2014-10-20} + +Halloween is now active and annual. +Trick or Treat will happen every year. +Munro returns as well. He has a special +Treat for those who are seen participating +in Trick or Treating, but he does not give +out his reward until later in the holiday. + +Two new Hats: Bucket & Autumn Mask added +for Halloween. + +{ul} +{li}Map Fixes on 021-2 & 027-2{/li} +{li}Spelling Corrections in Museum{/li} +{li}Fixed Contributor Shirt Colors{/li} +{/ul} + +{author:TMW Development Team} diff --git a/world/map/npc/001-1/_warps.txt b/world/map/npc/001-1/_warps.txt index a15050cf..d113ba85 100644 --- a/world/map/npc/001-1/_warps.txt +++ b/world/map/npc/001-1/_warps.txt @@ -4,5 +4,5 @@ 001-1.gat,44,87|warp|To Sandstorm Desert|3,-1,002-1.gat,58,14 001-1.gat,44,20|warp|To North Tulimshar|3,-1,021-1.gat,55,145 001-1.gat,125,21|warp|To North Tulimshar|0,-1,021-1.gat,136,146 -001-1.gat,32,71|warp|To Tulimshar Indoor|-1,-1,001-2.gat,25,34 -001-1.gat,75,41|warp|To Tulimshar Indoor|-1,-1,001-2.gat,71,72 +001-1.gat,32,70|warp|To Tulimshar Indoor|-1,-1,001-2.gat,25,34 +001-1.gat,75,40|warp|To Tulimshar Indoor|-1,-1,001-2.gat,71,72 diff --git a/world/map/npc/001-1/bleacher.txt b/world/map/npc/001-1/bleacher.txt index e6fada9c..baed6f2e 100644 --- a/world/map/npc/001-1/bleacher.txt +++ b/world/map/npc/001-1/bleacher.txt @@ -22,6 +22,7 @@ L_bleach_menu: menu "Cotton shirt.", L_cottonshirt, + "Contributor shirt.", L_contributor, "V-Neck sweater.", L_vneck, "Turtleneck sweater.", L_tneck, "Cotton shorts.", L_shorts, @@ -44,6 +45,11 @@ L_bleach_menu: "Cotton cloth.", L_cotton_cloth, "Nevermind.", L_Close; +L_contributor: + set @normal, 1178; + set @dyeBase, 5131; + goto L_choose_color; + L_cottonshirt: set @normal, 1202; set @dyeBase, 2050; diff --git a/world/map/npc/001-1/vincent.txt b/world/map/npc/001-1/vincent.txt index 46d67e48..7f46ac44 100644 --- a/world/map/npc/001-1/vincent.txt +++ b/world/map/npc/001-1/vincent.txt @@ -4,6 +4,8 @@ { // This NPC previously used the variable TMW_Quest callfunc "ClearVarTMW_Quest"; + set @halloween_npc_id, $@halloween_npc_vincent; + callfunc "TrickOrTreat"; set @state, ((QUEST_SouthTulimshar & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); diff --git a/world/map/npc/006-1/pachua.txt b/world/map/npc/006-1/pachua.txt index d2f193dd..b97b0c96 100644 --- a/world/map/npc/006-1/pachua.txt +++ b/world/map/npc/006-1/pachua.txt @@ -5,6 +5,9 @@ if (@npc_check) goto L_Close; + set @halloween_npc_id, $@halloween_npc_pachua; + callfunc "TrickOrTreat"; + set @LEATHER_PATCH_PRICE, 300; set @wants_leather_patch, QUEST_Forestbow_state & NIBBLE_4_MASK; diff --git a/world/map/npc/008-1/george.txt b/world/map/npc/008-1/george.txt index 92215420..df89f52c 100644 --- a/world/map/npc/008-1/george.txt +++ b/world/map/npc/008-1/george.txt @@ -2,6 +2,9 @@ 008-1.gat,136,36,0|script|George#pirate|138, { + set @halloween_npc_id, $@halloween_npc_george; + callfunc "TrickOrTreat"; + if (getequipid(equip_head) == 617) goto L_Pirate; if (getequipid(equip_head) == 622) goto L_Bandana; if (getequipid(equip_head) == 621) goto L_EyePatch; diff --git a/world/map/npc/009-2/kfahr.txt b/world/map/npc/009-2/kfahr.txt index 400e1cb3..9c772452 100644 --- a/world/map/npc/009-2/kfahr.txt +++ b/world/map/npc/009-2/kfahr.txt @@ -15,6 +15,9 @@ 009-2.gat,67,57,0|script|Kfahr|125, { + set @halloween_npc_id, $@halloween_npc_kfahr; + callfunc "TrickOrTreat"; + set @QS_NEWBIE, 0; set @QS_MET_KFAHR, 1; set @QS_KNOWS_KFAHR, 2; diff --git a/world/map/npc/009-2/nurse.txt b/world/map/npc/009-2/nurse.txt index 63ae6a67..44605134 100644 --- a/world/map/npc/009-2/nurse.txt +++ b/world/map/npc/009-2/nurse.txt @@ -25,6 +25,8 @@ 009-2.gat,147,65,0|script|Nurse|119, { callfunc "ClearVariables"; + set @halloween_npc_id, $@halloween_npc_nurse; + callfunc "TrickOrTreat"; set @SNAKET_AMOUNT, 5; set @BSCORPIONST_AMOUNT, 10; diff --git a/world/map/npc/009-2/selim.txt b/world/map/npc/009-2/selim.txt index cf18d30c..81531749 100644 --- a/world/map/npc/009-2/selim.txt +++ b/world/map/npc/009-2/selim.txt @@ -38,9 +38,16 @@ L_clothes_choice: "Sorcerer robe.", L_sorcererrobe, "Bowler hat (brown).", L_bowlerhatbrown, "Fine dress.", L_finedress, + "Contributor Shirt.", L_contributor, "About these sorcerer robes...", L_asksorcererrobe, "I'm fine for now, thanks.", L_Close; +L_contributor: + set @del, 1178; + set @new, 5131; + set @name$, "contributor shirt"; + goto L_picked_item; + L_cottonshirt: set @del, 1202; set @new, 2050; diff --git a/world/map/npc/009-4/barriers.txt b/world/map/npc/009-4/barriers.txt index f3f2e085..ae960d97 100644 --- a/world/map/npc/009-4/barriers.txt +++ b/world/map/npc/009-4/barriers.txt @@ -1,8 +1,13 @@ //# see detailed description at orum.txt function|script|GetBarrierColor|, { - if (@Barrier < 0 || @Barrier > 2) goto L_Error; + if (@Barrier < 0 || @Barrier > 2) + goto L_Error; + if (@BarrierColor <= 0 || @BarrierColor > 12) + goto L_Error2; + goto L_GetBarrierColor; +L_GetBarrierColor: set @Mask, 15; set @Shift, 4 * @Barrier; set @BarrierColor, (OrumQuestBarrier >> @Shift) & @Mask; @@ -11,6 +16,10 @@ function|script|GetBarrierColor|, L_Error: mes "Barrier number is out of range."; close; + +L_Error2: + callfunc "SetUpOrumQuest"; + goto L_GetBarrierColor; } function|script|SetBarrierColor|, diff --git a/world/map/npc/009-4/orum.txt b/world/map/npc/009-4/orum.txt index 2b222255..c547af05 100644 --- a/world/map/npc/009-4/orum.txt +++ b/world/map/npc/009-4/orum.txt @@ -18,6 +18,37 @@ //# OrumQuestBarrier nibble (0,1,2) stores the color of the barriers # //################################################################################# +009-4.gat,35,115,0|script|OrumDebug|158, +{ + mes "[Orum Debug]"; + menu + "Set Quest State", L_SetQuest, + "Reset Quest", L_ResetQuest, + "Display Quest", L_Display; + +L_SetQuest: + input @quest_state; + set OrumQuest, @quest_state; + goto L_Close; + +L_ResetQuest: + set OrumQuest, 0; + set OrumQuestBarrier, 0; + set OrumQuestTorch, 0; + goto L_Close; + +L_Display: + mes OrumQuest; + goto L_Close; + +L_Close: + end; + +OnInit: + if (!debug) + disablenpc "OrumDebug"; + end; +} 009-4.gat,37,115,0|script|Orum#barrier|158, { // needed to pass the very first barrier @@ -221,38 +252,7 @@ L_Missing_Materials: L_Setup_Lair: set OrumQuest, 2; - - // Second Barrier - set @BarrierColor, 1 + rand(3) * 4; - set @Barrier, 0; - callfunc "SetBarrierColor"; - - set @TorchIntensity, 0; - - set @Torch, 0; - set @TorchColor, rand(1, 12); - callfunc "SetTorchColor"; - callfunc "SetTorchIntensity"; - - // Third Barrier - set @BarrierColor, 3 + rand(3) * 4; - set @Barrier, 1; - callfunc "SetBarrierColor"; - - set @Torch, 1; - set @TorchColor, rand(1, 12); - callfunc "SetTorchColor"; - callfunc "SetTorchIntensity"; - - // End Barrier - set @BarrierColor, 2 + rand(6) * 2; - set @Barrier, 2; - callfunc "SetBarrierColor"; - - set @Torch, 2; - set @TorchColor, rand(1, 12); - callfunc "SetTorchColor"; - callfunc "SetTorchIntensity"; + callfunc "SetUpOrumQuest"; goto L_Close; L_Use_First_Barrier: @@ -592,3 +592,38 @@ L_Close: set @TorchColor, 0; close; } +function|script|SetUpOrumQuest|, +{ + // Second Barrier + set @BarrierColor, 1 + rand(3) * 4; + set @Barrier, 0; + callfunc "SetBarrierColor"; + + set @TorchIntensity, 0; + + set @Torch, 0; + set @TorchColor, rand(1, 12); + callfunc "SetTorchColor"; + callfunc "SetTorchIntensity"; + + // Third Barrier + set @BarrierColor, 3 + rand(3) * 4; + set @Barrier, 1; + callfunc "SetBarrierColor"; + + set @Torch, 1; + set @TorchColor, rand(1, 12); + callfunc "SetTorchColor"; + callfunc "SetTorchIntensity"; + + // End Barrier + set @BarrierColor, 2 + rand(6) * 2; + set @Barrier, 2; + callfunc "SetBarrierColor"; + + set @Torch, 2; + set @TorchColor, rand(1, 12); + callfunc "SetTorchColor"; + callfunc "SetTorchIntensity"; + return; +} diff --git a/world/map/npc/009-4/torches.txt b/world/map/npc/009-4/torches.txt index f093bc10..e9d8ff3e 100644 --- a/world/map/npc/009-4/torches.txt +++ b/world/map/npc/009-4/torches.txt @@ -1,5 +1,4 @@ //# see detailed description at orum.txt -//# see detailed description at orum.txt function|script|GetTorchColor|, { if (@Torch < 0 || @Torch > 2) goto L_Error; diff --git a/world/map/npc/010-2/workers.txt b/world/map/npc/010-2/workers.txt index 2f7da8aa..17109491 100644 --- a/world/map/npc/010-2/workers.txt +++ b/world/map/npc/010-2/workers.txt @@ -9,6 +9,9 @@ 010-2.gat,39,75,0|script|Zack|155, { + set @halloween_npc_id, $@halloween_npc_zack; + callfunc "TrickOrTreat"; + mes "[Zack]"; mes "\"My brother and I are fixing the cellar pass.\""; close; diff --git a/world/map/npc/013-2/notes.txt b/world/map/npc/013-2/notes.txt index 9b9f46dc..c8b386bd 100644 --- a/world/map/npc/013-2/notes.txt +++ b/world/map/npc/013-2/notes.txt @@ -27,10 +27,8 @@ next; mes "Your looks suddenly change..."; next; - set @style, rand(20); - set @color, rand(12); - setlook LOOK_HAIR_STYLE, @style; - setlook LOOK_HAIR_COLOR, @color + 1; + set @fixedMirror, 1; + callfunc "useMirror"; close; } diff --git a/world/map/npc/021-1/_warps.txt b/world/map/npc/021-1/_warps.txt index 429a522f..daa1a89d 100644 --- a/world/map/npc/021-1/_warps.txt +++ b/world/map/npc/021-1/_warps.txt @@ -8,18 +8,18 @@ 021-1.gat,135,119|warp|To Tulimshar Musuem|-1,-1,021-2.gat,90,177 021-1.gat,55,146|warp|To South Tulimshar|3,-1,001-1.gat,44,21 021-1.gat,136,147|warp|To South Tulimshar|0,-1,001-1.gat,125,22 -021-1.gat,53,134|warp|To Government Building|-1,-1,021-2.gat,27,29 -021-1.gat,55,134|warp|To Government Building|-1,-1,021-2.gat,33,29 -021-1.gat,57,134|warp|To Government Building|-1,-1,021-2.gat,39,29 -021-1.gat,103,100|warp|To Tulimshar Bakery|-1,-1,021-2.gat,91,27 +021-1.gat,53,133|warp|To Government Building|-1,-1,021-2.gat,27,29 +021-1.gat,55,133|warp|To Government Building|-1,-1,021-2.gat,33,29 +021-1.gat,57,133|warp|To Government Building|-1,-1,021-2.gat,39,29 +021-1.gat,103,99|warp|To Tulimshar Bakery|-1,-1,021-2.gat,91,27 021-1.gat,103,96|warp|To Bakery|-1,-1,021-2.gat,122,23 021-1.gat,49,64|warp|To Tulimshar Canyon|3,-1,024-1.gat,86,73 -021-1.gat,53,99|warp|To Wizard's Rest|-1,-1,021-2.gat,25,66 +021-1.gat,53,98|warp|To Wizard's Rest|-1,-1,021-2.gat,25,66 021-1.gat,52,95|warp|To Wizard's Rest|-1,-1,021-2.gat,70,63 021-1.gat,73,22|warp|To Tulimshar Port|3,-1,022-1.gat,73,109 021-1.gat,113,22|warp|To Tulimshar Port|3,-1,022-1.gat,113,109 -021-1.gat,132,31|warp|To Tulimshar Forge|-1,-1,021-2.gat,79,138 +021-1.gat,132,30|warp|To Tulimshar Forge|-1,-1,021-2.gat,79,138 021-1.gat,133,24|warp|To Tulimshar Forge|-1,-1,021-2.gat,75,92 021-1.gat,125,27|warp|To Tulimshar Forge|-1,-1,021-2.gat,124,68 -021-1.gat,125,31|warp|To Tulimshar Forge|-1,-1,021-2.gat,72,138 -021-1.gat,43,110|warp|To Store|-1,-1,021-2.gat,28,129 +021-1.gat,125,30|warp|To Tulimshar Forge|-1,-1,021-2.gat,72,138 +021-1.gat,43,109|warp|To Store|-1,-1,021-2.gat,28,129 diff --git a/world/map/npc/021-1/eurni.txt b/world/map/npc/021-1/eurni.txt index 8f9e1b5d..ca514740 100644 --- a/world/map/npc/021-1/eurni.txt +++ b/world/map/npc/021-1/eurni.txt @@ -2,6 +2,9 @@ 021-1.gat,141,113,0|script|Eurni|136, { + set @halloween_npc_id, $@halloween_npc_eurni; + callfunc "TrickOrTreat"; + if (BaseLevel < 10) goto L_TooYoung; if (Zeny < 10000) goto L_NoMoney; diff --git a/world/map/npc/021-1/inac.txt b/world/map/npc/021-1/inac.txt index 75cd0451..5903e34b 100644 --- a/world/map/npc/021-1/inac.txt +++ b/world/map/npc/021-1/inac.txt @@ -2,6 +2,9 @@ 021-1.gat,53,103,0|script|Inac|156, { + set @halloween_npc_id, $@halloween_npc_inac; + callfunc "TrickOrTreat"; + mes "[Inac]"; mes "\"This cities water system is amazing. It was built centuries ago after the cataclysm that turned Tonori into this desert.\""; next; diff --git a/world/map/npc/021-1/weellos.txt b/world/map/npc/021-1/weellos.txt index 3e6236ea..2607b0fc 100644 --- a/world/map/npc/021-1/weellos.txt +++ b/world/map/npc/021-1/weellos.txt @@ -3,6 +3,9 @@ 021-1.gat,130,125,0|script|Weellos|103, { + set @halloween_npc_id, $@halloween_npc_weellos; + callfunc "TrickOrTreat"; + set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@knowWeellosNT; set @kylian, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT); diff --git a/world/map/npc/021-2/government_building.txt b/world/map/npc/021-2/government_building.txt index abf01ccb..89abee80 100644 --- a/world/map/npc/021-2/government_building.txt +++ b/world/map/npc/021-2/government_building.txt @@ -141,6 +141,9 @@ S_give_rings: mes "\"Hello what Can I do for you?\""; next; + set @halloween_npc_id, $@halloween_npc_tathin; + callfunc "TrickOrTreat"; + if (getskilllv(SKILL_PARTY) == 2 ) goto L_Base_Menu; if (BaseLevel >= 15 diff --git a/world/map/npc/021-2/manakins.txt b/world/map/npc/021-2/manakins.txt index a17603b7..2df6f6dc 100644 --- a/world/map/npc/021-2/manakins.txt +++ b/world/map/npc/021-2/manakins.txt @@ -3,13 +3,13 @@ // Forge 021-2.gat,76,131,0|script|Terranite Armor#Female|401, { - mes "Terranite Armor Complete Set, made to order, inquire with Heathin"; + mes "Terranite Armor complete set, made to order, inquire with Heathin"; close; } 021-2.gat,81,131,0|script|Terranite Armor#Male|402, { - mes "Terranite Armor Complete Set, made to order, inquire with Heathin"; + mes "Terranite Armor complete set, made to order, inquire with Heathin"; close; } @@ -19,29 +19,29 @@ close; } -// Muesuem +// Museum -021-2.gat,71,161,0|script|Taplapian#Female|404, +021-2.gat,71,161,0|script|Talponian#Female|404, { - mes "A Female Talapian."; + mes "A Female Talponian."; close; } -021-2.gat,77,161,0|script|Taplapian#Male|405, +021-2.gat,77,161,0|script|Talponian#Male|405, { - mes "A Male Talapian."; + mes "A Male Talponian."; close; } -021-2.gat,83,161,0|script|Gispian#Female|406, +021-2.gat,83,161,0|script|Gispaan#Female|406, { - mes "A Female Gispian."; + mes "A Female Gispaan."; close; } -021-2.gat,89,161,0|script|Gispian#Male|407, +021-2.gat,89,161,0|script|Gispaan#Male|407, { - mes "A Male Gispian."; + mes "A Male Gispaan."; close; } diff --git a/world/map/npc/026-1/_import.txt b/world/map/npc/026-1/_import.txt index f618ee0a..7f84af41 100644 --- a/world/map/npc/026-1/_import.txt +++ b/world/map/npc/026-1/_import.txt @@ -4,5 +4,4 @@ map: 026-1.gat npc: npc/026-1/_mobs.txt npc: npc/026-1/_warps.txt npc: npc/026-1/mapflags.txt -npc: npc/026-1/munro.txt npc: npc/026-1/sign.txt diff --git a/world/map/npc/026-1/munro.txt b/world/map/npc/026-1/munro.txt deleted file mode 100644 index 02fdccb6..00000000 --- a/world/map/npc/026-1/munro.txt +++ /dev/null @@ -1,93 +0,0 @@ -026-1.gat,24,37,0|script|Munro|183, -{ - mes "[Munro]"; - mes "\"Whoh dude...\""; - next; - mes "[Munro]"; - mes "\"Man.. I don't know how I got here.. freaky..\""; - next; - mes "[Munro]"; - mes "\"Hey dude, what's that on your face? It's creeping me out!\""; - menu - "There is nothing on my face..", L_Nothing, - "What, This skin?",L_ThisSkin; - -L_ThisSkin: - mes "[Munro]"; - mes "\"Skin? Whoh far-out man.. This must be that weirdo place my brother Parua told me about..\""; - next; - mes "Munro stares at you vacantly for a moment"; - next; - mes "Munro's eye-holes suddenly seem more aware"; - next; - mes "[Munro]"; - mes "\"WHOH! SKIN? d.....dude! How can you stand having that stuff all over you? That's gotta suck!\""; - next; - mes "[Munro]"; - mes "\"Here dude.. Take this. It won't get rid of that groady skin but it'll at least make you LOOK normal..\""; - getitem "SkeletonCharm",1; - next; - mes "[Munro]"; - mes "\"I have a lot of these man.. a LOT. Take all you want man.. Just remember they only work when I'm around to power them. Freaky-deaky skull power you know?\""; - goto L_Exit; - -L_Nothing: - mes "[Munro]"; - mes "\"Oh.. ok dude! Whatever you say!\""; - goto L_Exit; - -L_Exit: - close; -} - -026-1.gat,25,37,0|script|#AnnualHalloween|-1, -{ - end; - -OnInit: - if (debug >= 2) end; - initnpctimer; - end; - -OnTimer1000: - set $@isHalloween, 0; - if ((gettime(6) == 10 && gettime(5) >= 27) || (gettime(6) == 11 && gettime(5) <= 5)) - set $@isHalloween, 1; - - if (gettime(6) == 12 && gettime(5) >= 23 && gettime(5) <= 26) - set $@isHalloween, 1; - - if ($@isHalloween) - goto L_enablemunro; - - goto L_disablemunro; - - -L_enablemunro: - enablenpc "Munro"; - goto L_End; - -L_disablemunro: - disablenpc "Munro"; - goto L_End; - -L_End: - setnpctimer 0; - end; -} - - -function|script|CheckMunro|, -{ - if ((gettime(6) == 10 && gettime(5) >= 27) || (gettime(6) == 11 && gettime(5) <= 5)) - goto L_Return; - - if (gettime(6) == 12 && gettime(5) >= 23 && gettime(5) <= 26) - goto L_Return; - - callfunc "UnequipLater"; - goto L_Return; - -L_Return: - return; -} diff --git a/world/map/npc/027-2/caretaker.txt b/world/map/npc/027-2/caretaker.txt index 593a91a8..c10db6fe 100644 --- a/world/map/npc/027-2/caretaker.txt +++ b/world/map/npc/027-2/caretaker.txt @@ -4,6 +4,9 @@ 027-2.gat,24,25,0|script|Caretaker|159, { + set @halloween_npc_id, $@halloween_npc_caretaker; + callfunc "TrickOrTreat"; + if (QUEST_Graveyard_Caretaker == 1) goto L_Return_Dialog; if (QUEST_Graveyard_Caretaker == 2) goto L_Has_Letter; if (QUEST_Graveyard_Caretaker == 3) goto L_Delivered_Letter; diff --git a/world/map/npc/030-2/storage_helper.txt b/world/map/npc/030-2/storage_helper.txt index ff6fa242..092d9a7d 100644 --- a/world/map/npc/030-2/storage_helper.txt +++ b/world/map/npc/030-2/storage_helper.txt @@ -3,6 +3,8 @@ 030-2.gat,25,35,0|script|Vellamo|328, { + set @halloween_npc_id, $@halloween_npc_vellamo; + callfunc "TrickOrTreat"; callfunc "XmasStates"; if($@xmas_time) diff --git a/world/map/npc/033-1/kimarr.txt b/world/map/npc/033-1/kimarr.txt index 26993614..a5a066bd 100644 --- a/world/map/npc/033-1/kimarr.txt +++ b/world/map/npc/033-1/kimarr.txt @@ -34,6 +34,9 @@ 033-1.gat,74,32,0|script|Kimarr|218, { + set @halloween_npc_id, $@halloween_npc_kimarr; + callfunc "TrickOrTreat"; + if ($@Fluffy_FighterID == getcharid(3)) goto L_Attention; diff --git a/world/map/npc/042-1/_warps.txt b/world/map/npc/042-1/_warps.txt index 8c1043ea..b8e20944 100644 --- a/world/map/npc/042-1/_warps.txt +++ b/world/map/npc/042-1/_warps.txt @@ -3,12 +3,12 @@ 042-1.gat,97,41|warp|To Tulismhar Docks|-1,2,022-1.gat,21,37 042-1.gat,65,20|warp|To Lighthouse Beach|0,-1,023-1.gat,64,143 -042-1.gat,91,73|warp|To Store House|-1,-1,042-2.gat,22,92 -042-1.gat,104,73|warp|To Store House|-1,-1,042-2.gat,44,92 -042-1.gat,65,75|warp|To Tulimshar Suburbs House|-1,-1,042-2.gat,29,61 +042-1.gat,91,72|warp|To Store House|-1,-1,042-2.gat,22,92 +042-1.gat,104,72|warp|To Store House|-1,-1,042-2.gat,44,92 +042-1.gat,65,74|warp|To Tulimshar Suburbs House|-1,-1,042-2.gat,29,61 042-1.gat,62,42|warp|To Sorfina's Dinner|-1,-1,042-2.gat,112,85 042-1.gat,51,43|warp|To Sorfina's House|-1,-1,042-2.gat,44,30 -042-1.gat,117,102|warp|To Magic School Research|-1,-1,042-2.gat,103,62 +042-1.gat,117,101|warp|To Magic School Research|-1,-1,042-2.gat,103,62 042-1.gat,112,95|warp|To Magic School Research|-1,-1,042-2.gat,94,54 042-1.gat,120,95|warp|To Magic School Research|-1,-1,042-2.gat,112,54 042-1.gat,117,85|warp|To Tulismhar Docks|-1,-1,022-1.gat,49,82 diff --git a/world/map/npc/048-2/sageNikolai.txt b/world/map/npc/048-2/sageNikolai.txt index 9ce3e719..5aa1b659 100644 --- a/world/map/npc/048-2/sageNikolai.txt +++ b/world/map/npc/048-2/sageNikolai.txt @@ -5,6 +5,9 @@ 048-2.gat,98,106,0|script|Nikolai|362, { + set @halloween_npc_id, $@halloween_npc_nikolai; + callfunc "TrickOrTreat"; + set @investigate, ((QUEST_BlueSage & $@Q_BlueSageInvestigate_MASK) >> $@Q_BlueSageInvestigate_SHIFT); set @bookpages, ((QUEST_BlueSage & $@Q_BlueSageBookPages_MASK) >> $@Q_BlueSageBookPages_SHIFT); set @slimes, ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT); diff --git a/world/map/npc/annuals/fathertime.txt b/world/map/npc/annuals/fathertime.txt index 40af55ff..4d3cdf68 100644 --- a/world/map/npc/annuals/fathertime.txt +++ b/world/map/npc/annuals/fathertime.txt @@ -1,6 +1,5 @@ // Annual Timer // One timer to check to enable all holiday events - 017-9.gat,26,28,0|script|#HolidayConfig|-1, { end; @@ -16,6 +15,27 @@ L_StartTimer: OnTimer20000: setnpctimer 0; cmdothernpc "#XmasConfig", "RestartQuest"; + cmdothernpc "#HalloweenConfig", "RestartQuest"; initnpctimer; end; } +017-9.gat,31,24,0|script|HolidayDebug#1|105, +{ + if(getgmlevel() < 40) + goto L_End; + + menu + "Xmas.", L_XmasDebug, + "Halloween.", L_HalloweenDebug; + +L_XmasDebug: + callfunc "XmasDebug"; + goto L_End; + +L_HalloweenDebug: + callfunc "HalloweenDebug"; + goto L_End; + +L_End: + end; +} diff --git a/world/map/npc/annuals/halloween/config.txt b/world/map/npc/annuals/halloween/config.txt new file mode 100644 index 00000000..d3d0f616 --- /dev/null +++ b/world/map/npc/annuals/halloween/config.txt @@ -0,0 +1,372 @@ +// Halloween Annual +// Authors: alastrim, enchilado, o11c, wushin +// This file initializes global constants, which includes dialog. + +// Event Configuration: +// Generic stuff +// $@halloween_start_day = the first day in October the quest can be done +// $@halloween_year = the year this quest is activated, for event necromancers +// $@halloween_memory_count = Number of masks each NPC remembers +// $@halloween_min_level = Minimum level to go trick-or-treating + +// Global stuff +// $@halloween_big_reward = The main reward randomly given, usually after the counter has reached 7-10 +// $@halloween_sweets = Array with all the sweets to be given as treats +// $@halloween_sweets_num = Size of that array +// $@halloween_mask_IDs = Array with the IDs of all the masks that cover your face + The Scary Axehat +// $@halloween_scare_factors = Array with the basic scare factor of each mask +// 678 Noh Mask 2 +// 679 Demon Mask 4 +// 1221 Skull Mask 4 +// 634 Face Mask 4 +// 615 Pumpkin Helmet 2 +// 639 Crusade Helmet 3 +// 769 Guy Fawkes Mask 2 +// 801 Pinkie Helmet 2 +// 1218 Paper Bag 1 +// 1276 Opera Mask 3 +// 1277 Jester Mask 2 +// 1279 Goblin Mask 4 +// 4027 Yeti Mask 4 +// 616 Axe Hat 4 + +// Per-NPC stuff +// $@halloween_npc_<name> = constants for @halloween_npc_id, the index into the array +// $@halloween_npc_names$ = Array with all NPC names inside brackets, to be used in the function +// $@halloween_greetings$ = Array with all the NPC initial greetings when you "trick or treat" them +// $@halloween_trick_notscary$ = Array with the less scary menu options +// $@halloween_react_notscary$ = Array with all the reactions to the less scary menu options +// $@halloween_trick_scary$ = Array with scary menu options +// $@halloween_react_scary$ = Array with all the reactions to the scary menu options +// $@halloween_trick_veryscary$ = Array with the most scary menu options +// $@halloween_react_veryscary$ = Array with all the reactions to the very scary menu options + +// In the appropriate NPCs, do something like: +//+ if ($@halloween_time) +//+ goto L_Halloween; +//+ goto L_Main; +//+ +//+L_Halloween: +//+ set @halloween_npc_id, $@halloween_npc_eurni; +//+ callfunc "TrickOrTreat"; +//+ goto L_Main; +//+ +//+L_Main: + +// Variables: +// $@halloween_maskmemory = Sliced Array containing the record of the last masks used to trick or treat each NPC. +// @halloween_npc_id = NPC id, this variable is set when calling this function by an NPC +// HALLOWEENTIME = Permanent variable used to control your progress in the quest. +// The high bits are used to keep track of the NPCs you already tricked while showing your face. +// The low bits are used to keep track of how many times you've gotten treats. +// Currently, the vague plan is 16 for each, but we may need to use this variable for the second part of the quest. +// HALLOWEENYEAR = Keys the player to the year so the annual can be redone. + +// !!! IMPORTANT NOTE: a maximum of 14 NPCs can be used for this quest !!! +// HALLOWEENTIME +// Byte 0 + 1: Karma (65535) +// BIT 16: Big Reward +// BIT 17: Charm Reward +// BIT 18: NPC #13 +// BIT 19: NPC #12 +// BIT 20: NPC #11 +// BIT 21: NPC #10 +// BIT 22: NPC #9 +// BIT 23: NPC #8 +// BIT 24: NPC #7 +// BIT 25: NPC #6 +// BIT 26: NPC #5 +// BIT 27: NPC #4 +// BIT 28: NPC #3 +// BIT 29: NPC #2 +// BIT 30: NPC #1 +// BIT 31: NPC #0 + +-|script|#HalloweenConfig|-1, +{ + end; + +OnCommandRestartQuest: + goto L_Main; + +OnInit: + goto L_Main; + +L_Main: + // Halloween Key Identifier Set through Botcheck Debug + if(!($HALLOWEEN_TIME_KEY) || (getarraysize($HALLOWEEN_TIME_KEY) != 6)) + setarray $HALLOWEEN_TIME_KEY, 10,10,11,24,2,gettime(7); + if(($HALLOWEEN_TIME_KEY[0] == 0) || ($HALLOWEEN_TIME_KEY[0] > 12)) + goto L_HalloweenError; + if(($HALLOWEEN_TIME_KEY[1] == 0) || ($HALLOWEEN_TIME_KEY[1] > 12)) + goto L_HalloweenError; + if(($HALLOWEEN_TIME_KEY[2] == 0) || ($HALLOWEEN_TIME_KEY[2] > 12)) + goto L_HalloweenError; + if(($HALLOWEEN_TIME_KEY[3] == 0) || ($HALLOWEEN_TIME_KEY[3] > 31)) + goto L_HalloweenError; + if(($HALLOWEEN_TIME_KEY[4] == 0) || ($HALLOWEEN_TIME_KEY[4] > 31)) + goto L_HalloweenError; + if($HALLOWEEN_TIME_KEY[5] == 0) + goto L_HalloweenError; + + // Event Runs until Reward Period. + // Month Start/End + set $@halloween_start_month, $HALLOWEEN_TIME_KEY[0]; + set $@halloween_reward_start_month, $HALLOWEEN_TIME_KEY[1]; + set $@halloween_end_month, $HALLOWEEN_TIME_KEY[2]; + + // Reward Day Start/End + set $@halloween_reward_start_day, $HALLOWEEN_TIME_KEY[3]; + set $@halloween_reward_end_day, $HALLOWEEN_TIME_KEY[4]; + + // Time Settings + set $@halloween_no_event_time, 0; + set $@halloween_event_time, 1; + set $@halloween_reward_time, 2; + + // How many, maximum is 8 + set $@halloween_memory_count, 5; + // Level to go trick-or-treating + set $@halloween_min_level, 10; + // Age to go trick-or-treating + set $@halloween_min_age, (7*86400); + + // Number of trick and treats completed to get charm. + set $@halloween_charm_count, 10; + set $@halloween_got_charm_reward, (1 << 17); + setarray $@halloween_big_reward, 905, 1175; + set $@halloween_got_big_reward, (1 << 16); + setarray $@halloween_sweets, + 534, // OrangeCupcake + 737, // ChocolateCake + 510, // Candy + 513, // Cake + 509, // ChocolateBar + 519, // CherryCake + 736, // WhiteCake + 738, // OrangeCake + 739, // AppleCake + 3006, // TonoriDelight + 3007, // Marshmallow + 3009, // JellySkull + 3010, // CandyPumpkin + 838, // CranberryLollipop + 839, // GrapeLollipop + 840; // OrangeLollipop + set $@halloween_sweets_num, getarraysize($@halloween_sweets); + + setarray $@halloween_mask_IDs, 678, 679, 1221, 634, 615, 639, 769, 801, 1218, 1276, 1277, 1279, 4027, 616; + setarray $@halloween_scare_factors, 2, 4, 4, 4, 2, 3, 2, 2, 1, 3, 2, 4, 4, 4; + + if (getarraysize($@halloween_mask_IDs) != getarraysize($@halloween_scare_factors)) + goto L_HalloweenError; + // temporary counter + set $@n, 0; + + set $@halloween_npc_caretaker, $@n; + set $@halloween_npc_names$[$@n], "[Caretaker]"; + set $@halloween_greetings$[$@n], "\"Alright, come on then. Show me your trick.\""; + set $@halloween_trick_notscary$[$@n], "Trick? You must have misheard me. I've come because the Government needs to build a road through your house."; + set $@halloween_react_notscary$[$@n], "\"And?\""; + set $@halloween_trick_scary$[$@n], "You look pretty deceased to me, old man. Undead must die! Yaah!"; + set $@halloween_react_scary$[$@n], "\"Now listen here, I'm as alive as you - oh. Say, that was a good trick!\""; + set $@halloween_trick_veryscary$[$@n], "Your wife... she's - she's - she's DEAD!"; + set $@halloween_react_veryscary$[$@n], "\"But... I live here! My wife l... is dead here. You can't - oh. I DIDN'T mishear you. You really had me fooled!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_eurni, $@n; + set $@halloween_npc_names$[$@n], "[Eurni the Surgeon]"; + set $@halloween_greetings$[$@n], "\"Oh, right.\""; + set $@halloween_trick_notscary$[$@n], "I paid good money for your services, and when I get home I find that now I'm not a man OR a woman..."; + set $@halloween_react_notscary$[$@n], "\"Heheh, sucks, buddy. But there's always a risk.\""; + set $@halloween_trick_scary$[$@n], "Look out! A scorpion!"; + set $@halloween_react_scary$[$@n], "\"Where? Darn things, I think they're what keep scaring away my customers.\""; + set $@halloween_trick_veryscary$[$@n], "I know about your hobby of performing numerous sex changes on yourself."; + set $@halloween_react_veryscary$[$@n], "\"Shut up! Look, will you hold your tongue if I give you more treats...?\""; + + set $@n, $@n + 1; + + set $@halloween_npc_george, $@n; + set $@halloween_npc_names$[$@n], "[George the Pirate]"; + set $@halloween_greetings$[$@n], "\"Shiver me timbers! What do ye mean?\""; + set $@halloween_trick_notscary$[$@n], "Well... I do a trick, and then... you give me a treat..."; + set $@halloween_react_notscary$[$@n], "\"Arrrrh, I knew what ye meant, to be sure! I were just kidding with ye, pretending to be a crazy old pirate! Arrrrh!\""; + set $@halloween_trick_scary$[$@n], "Your eyepatch is on the wrong eye!"; + set $@halloween_react_scary$[$@n], "\"Arrrrh, so it is! Ta for pointing it out, mate - wait, no it isn't! Harhar, what a good trick!\""; + set $@halloween_trick_veryscary$[$@n], "By the powers, ye're a daft landlubber to be sure, ye barnacle-ridden swab!"; + set $@halloween_react_veryscary$[$@n], "\"Arrrrh, ye scurvy dog! I'm sure my first mate will return with the ship eventually.\""; + + set $@n, $@n + 1; + + set $@halloween_npc_inac, $@n; + set $@halloween_npc_names$[$@n], "[Inac]"; + set $@halloween_greetings$[$@n], "\"Oh, yes?\""; + set $@halloween_trick_notscary$[$@n], "Yes, we monsters moved into the tunnels... and now we're coming out... for revenge!"; + set $@halloween_react_notscary$[$@n], "\"Haha! That's the worse trick I've seen today.\""; + set $@halloween_trick_scary$[$@n], "One of those monsters you mentioned is crawling out of the well!"; + set $@halloween_react_scary$[$@n], "\"He IS? Where!? Aah! Oh. You were just tricking, right? Hahaha, that was good, I really believed you.\""; + set $@halloween_trick_veryscary$[$@n], "Yeah, but it's all fossil water. One day it's gonna dry up!"; + set $@halloween_react_veryscary$[$@n], "\"Fossil water? You mean it's turned to STONE? But you can't drink - oh... you were just tricking, right? You WEREN'T? Aaaah!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_kfahr, $@n; + set $@halloween_npc_names$[$@n], "[Kfahr the Warrior]"; + set $@halloween_greetings$[$@n], "\"Ah, yes!\" He rubs his hands. \"Trick away, then!\""; + set $@halloween_trick_notscary$[$@n], "Meh... I'm only trick-or-treating you to avoid listening to your BORING stories."; + set $@halloween_react_notscary$[$@n], "\"Boring?\" He grins. \"You must be mistaking me for someone else.\""; + set $@halloween_trick_scary$[$@n], "Did you hear the bad news already? They made up a law prohibiting to serve alcoholic drinks! That means no more beer!"; + set $@halloween_react_scary$[$@n], "\"What? But- but- why do they- oh, you tricked me. I was about to really get worried for a moment.\""; + set $@halloween_trick_veryscary$[$@n], "Have you heard? Tulimshar was destroyed by a giant Desert Worm!"; + set $@halloween_react_veryscary$[$@n], "\"What!?\" Kfahr stares. \"And no one called for me? This is appalling! But - what? That was your trick? Hm, nice one. You almost had me fooled!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_nurse, $@n; + set $@halloween_npc_names$[$@n], "[Nurse]"; + set $@halloween_greetings$[$@n], "\"I don't know why I let the Mayor trick me into this... well, go on then.\""; + set $@halloween_trick_notscary$[$@n], "I ate too much Hallowe'en candy, now I'm sick!"; + set $@halloween_react_notscary$[$@n], "\"Well, no one's to blame but yourself, you know. Just make sure you don't eat any more.\""; + set $@halloween_trick_scary$[$@n], "Hurnscald has been struck by plague! You must come and tend to the dying!"; + set $@halloween_react_scary$[$@n], "\"But I don't know how to deal with plague! Oh no! You must get the Doctor! Unless... you were just tricking me! Whew, that's a relief!\""; + set $@halloween_trick_veryscary$[$@n], "The Doctor asked me to tell you that he doesn't want to see you any more."; + set $@halloween_react_veryscary$[$@n], "\"What? But we were getting it on so well. I mean, getting on so well! Oh... that was your trick! Dear me, I believed you!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_pachua, $@n; + set $@halloween_npc_names$[$@n], "[Chief Pachua]"; + set $@halloween_greetings$[$@n], "\"Ah, the strange custom the Government man told me about.\""; + set $@halloween_trick_notscary$[$@n], "Look out! A scorpion!"; + set $@halloween_react_notscary$[$@n], "\"Don't mind him, he won't hurt you. Er... so I give you sweets now, or what?\""; + set $@halloween_trick_scary$[$@n], "Yes, the ritual giving of treats... LOTS of treats... or else!"; + set $@halloween_react_scary$[$@n], "\"Alright, here you go.\""; + set $@halloween_trick_veryscary$[$@n], "Yes, the ritual giving of treats followed by the sacrifice of the treat-giver..."; + set $@halloween_react_veryscary$[$@n], "\"I do like a good sacrifice, but less so if it's me! I'll give you extra sweets if you forget the sacrifice.\""; + + set $@n, $@n + 1; + + set $@halloween_npc_tathin, $@n; + set $@halloween_npc_names$[$@n], "[Tathin]"; + set $@halloween_greetings$[$@n], "\"I am employed by the Tonori Government, make sure you abide the regulations we wrote down for Trick-or-Treaters this year...\""; + set $@halloween_trick_notscary$[$@n], "Of course I will... not!"; + set $@halloween_react_notscary$[$@n], "\"Hm!\""; + set $@halloween_trick_scary$[$@n], "Regulations, smegulations. The Tonori Government can go suck a lollipop for all I care!"; + set $@halloween_react_scary$[$@n], "\"!? How dare you - oh, that was your trick! You did have me worried for a moment...\""; + set $@halloween_trick_veryscary$[$@n], "What regulations?"; + set $@halloween_react_veryscary$[$@n], "\"You mean you haven't even READ - I don't believe - this is ghastly - I - oh... that was your trick... gosh, I believed you for a minute! I thought you really hadn't read them!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_vincent, $@n; + set $@halloween_npc_names$[$@n], "[Vincent]"; + set $@halloween_greetings$[$@n], "\"Ooh, okay! Trick away!\""; + set $@halloween_trick_notscary$[$@n], "Look out! A scorpion!"; + set $@halloween_react_notscary$[$@n], "\"They're everywhere in this desert! Don't worry about them.\""; + set $@halloween_trick_scary$[$@n], "Hey, that action figure you're building just CAME TO LIFE!"; + set $@halloween_react_scary$[$@n], "\"Really? Cool! Where? What? You were tricking me? WAAAH!\""; + set $@halloween_trick_veryscary$[$@n], "Wow, this is a neat action figure! Haha, check out its moves! Oops! Never mind, I'm sure it'll glue back on."; + set $@halloween_react_veryscary$[$@n], "\"My Bug Leg action figure! You broke it!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_weellos, $@n; + set $@halloween_npc_names$[$@n], "[Weellos]"; + set $@halloween_greetings$[$@n], "\"Trick me, then!\""; + set $@halloween_trick_notscary$[$@n], "Look out! A scorpion!"; + set $@halloween_react_notscary$[$@n], "\"Pesky things, I know, but they're everywhere around here...\""; + set $@halloween_trick_scary$[$@n], "Actually, it's a fake. It was built just ten years ago."; + set $@halloween_react_scary$[$@n], "\"No! But I've read all the accounts... oh, haha! Very funny!\""; + set $@halloween_trick_veryscary$[$@n], "They say the earthquake ruined the foundations of this building, and that it's going to fall down."; + set $@halloween_react_veryscary$[$@n], "\"B-but it's one of the oldest buildings around! And... wait, I just remembered that it was designed to be earthquake-proof. You were tricking me!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_zack, $@n; + set $@halloween_npc_names$[$@n], "[Zack]"; + set $@halloween_greetings$[$@n], "\"I thought no one would find me down here, but I'm glad I was wrong! Let's see your trick, then.\""; + set $@halloween_trick_notscary$[$@n], "You think this is something to do with Hallowe'en? Hands up!"; + set $@halloween_react_notscary$[$@n], "\"Heh... That was ok.\""; + set $@halloween_trick_scary$[$@n], "And now that I've found you, you die!"; + set $@halloween_react_scary$[$@n], "\"Aah! What did I do? Oh - wait - I see! That was a good one!\""; + set $@halloween_trick_veryscary$[$@n], "Yes, I have found you. After all these years."; + set $@halloween_react_veryscary$[$@n], "\"Uncle Henry? But how, I covered my tracks so well! I never told anyone that - wait... that was your trick! You had me worried for a minute!\""; + + set $@n, $@n + 1; + + set $@halloween_npc_kimarr, $@n; + set $@halloween_npc_names$[$@n], "[Kimarr]"; + set $@halloween_greetings$[$@n], "\"Many have tried to scare me, all have failed. Try your best, but the frozen wastes contain all manner of horrors.\""; + set $@halloween_trick_notscary$[$@n], "Look out Yetis!"; + set $@halloween_react_notscary$[$@n], "\"You will have to do better then that.\""; + set $@halloween_trick_scary$[$@n], "Hrmm Is that your wife calling you?"; + set $@halloween_react_scary$[$@n], "\"What? You haven't se... wait a second. Ok that was good.\""; + set $@halloween_trick_veryscary$[$@n], "The Kaizeian government declared fluffies an endangered species."; + set $@halloween_react_veryscary$[$@n], "\"NOooOOOooo!!! The Hunt!!! ... wait a second, you city folk are slick.\""; + + set $@n, $@n + 1; + + set $@halloween_npc_nikolai, $@n; + set $@halloween_npc_names$[$@n], "[Nikolai]"; + set $@halloween_greetings$[$@n], "\"Let us see if you are scarier then Kfahr's Fairy Tales.\""; + set $@halloween_trick_notscary$[$@n], "Your going over their to the store."; + set $@halloween_react_notscary$[$@n], "\"*You're* *there* Ugh, thats more annoying then scary.\""; + set $@halloween_trick_scary$[$@n], "Whats White, Blue and slimey? I don't know either but it's right behind you."; + set $@halloween_react_scary$[$@n], "\"More Slimes, Oh no the books again. O you tricked me, good one.\""; + set $@halloween_trick_veryscary$[$@n], "I hope you don't mind I used some of this kindling you have on the shelves to start a fire."; + set $@halloween_react_veryscary$[$@n], "\"AHHHHH!!!! You burned our books!!! *GAH* ... *Eye Twitch*\""; + + set $@n, $@n + 1; + + set $@halloween_npc_vellamo, $@n; + set $@halloween_npc_names$[$@n], "[Vellamo]"; + set $@halloween_greetings$[$@n], "\"Ahh yes, more candy related ritual.\""; + set $@halloween_trick_notscary$[$@n], "Candy? No, I want Parsley."; + set $@halloween_react_notscary$[$@n], "\"Parsley? is this some kind of monster? I'm not getting this scare at all\""; + set $@halloween_trick_scary$[$@n], "Chief Warrick says he needs the candy inventory by end of day."; + set $@halloween_react_scary$[$@n], "\"Ahh, no! I forgot to put a cover sheet on my Candy Production and Storage report.\""; + set $@halloween_trick_veryscary$[$@n], "I'm sorry, but your doctor says your diabetic."; + set $@halloween_react_veryscary$[$@n], "\"Darkest day of my life, blacker then the darkest chocolate.\""; + + set $@halloween_num_npcs, $@n + 1; + set $@halloween_all_npc_bits, -1 << (32 - $@halloween_num_npcs); + + set $@n, 0; + + if((gettime(6) == $@halloween_reward_start_month && gettime(5) >= $@halloween_reward_start_day + && (gettime(5) <= $@halloween_reward_end_day && $@halloween_reward_start_month == $@halloween_end_month + || !($@halloween_reward_start_month == $@halloween_end_month))) + || (gettime(6) == $@halloween_end_month && gettime(5) <= $@halloween_reward_end_day + && (gettime(5) >= $@halloween_reward_start_day && $@halloween_reward_start_month == $@halloween_end_month + || !($@halloween_reward_start_month == $@halloween_end_month))) + || (gettime(6) < $@halloween_end_month && gettime(6) > $@halloween_reward_start_month)) + goto L_RewardTime; + if((gettime(6) >= $@halloween_start_month) || (gettime(6) <= $@halloween_end_month && gettime(5) <= $@halloween_reward_start_day)) + goto L_EventTime; + goto L_NoEventTime; + +L_NoEventTime: + if($HALLOWEEN_TIME_KEY[5] < gettime(7)) + setarray $HALLOWEEN_TIME_KEY, $HALLOWEEN_TIME_KEY[0],$HALLOWEEN_TIME_KEY[1],$HALLOWEEN_TIME_KEY[2],$HALLOWEEN_TIME_KEY[3],$HALLOWEEN_TIME_KEY[4],gettime(7); + set $@halloween_time, $@halloween_no_event_time; + goto L_Return; + +L_EventTime: + set $@halloween_time, $@halloween_event_time; + goto L_Return; + +L_RewardTime: + set $@halloween_time, $@halloween_reward_time; + goto L_Return; + +L_Return: + callfunc "SpawnMunro"; + callfunc "ReplaceTrees"; + end; + +L_HalloweenError: + debugmes "Halloween is Dead Jim."; + gmcommand "@mapexit"; + end; +} diff --git a/world/map/npc/annuals/halloween/debug.txt b/world/map/npc/annuals/halloween/debug.txt new file mode 100644 index 00000000..0da5e361 --- /dev/null +++ b/world/map/npc/annuals/halloween/debug.txt @@ -0,0 +1,180 @@ +// Halloween Debug +// Author: Wushin + +function|script|HalloweenDebug|, +{ + if(debug) + goto L_Debug; + goto L_Live; + +L_Live: + menu + "Debug Time", L_DebugTime, + "Set Old Event Flag.", L_LastReset, + "Halloween Time Key Change.", L_HalloweenTimeKey, + "Reset NPC's mask memory", L_ResetMask, + "Nothing.", L_Close; + +L_Debug: + menu + "Debug Time", L_DebugTime, + "Set Old Event Flag.", L_LastReset, + "Halloween Time Key Change.", L_HalloweenTimeKey, + "Quest State", L_QuestState, + "Set NPC trick or treat flag", L_SetTrickOrTreats, + "Reset my quest state", L_ResetMe, + "Reset NPC's mask memory", L_ResetMask, + "Nothing.", L_Close; + +L_DebugTime: + mes "--Sever--"; + mes "Event State: " + $@halloween_time; + mes "Event Start" + $HALLOWEEN_TIME_KEY[0] + "/1"; + mes "Reward Start: " + $HALLOWEEN_TIME_KEY[1] + "/" + $HALLOWEEN_TIME_KEY[3]; + mes "Event End: " + $HALLOWEEN_TIME_KEY[2] + "/" + $HALLOWEEN_TIME_KEY[4]; + mes "Event Time Key (year (CCYY)): " + $HALLOWEEN_TIME_KEY[5]; + next; + goto L_Debug; + +L_LastReset: + set HALLOWEENTIME, 255; + set HALLOWEENYEAR, 2012; + goto L_Debug; + +L_HalloweenTimeKey: + if (getgmlevel() < 20) goto L_Close; + mes "Halloween Time Key Change."; + mes "Start Month?"; + input @halloween_time_key_smonth; + if((@halloween_time_key_smonth == 0) || (@halloween_time_key_smonth > 12)) + goto L_HalloweenError; + mes "Reward Start Month?"; + input @halloween_time_key_srmonth; + if((@halloween_time_key_srmonth == 0) || (@halloween_time_key_srmonth > 12)) + goto L_HalloweenError; + mes "End Month?"; + input @halloween_time_key_emonth; + if((@halloween_time_key_emonth == 0) || (@halloween_time_key_emonth > 12)) + goto L_HalloweenError; + mes "Reward Start Day?"; + input @halloween_time_key_rsday; + if((@halloween_time_key_rsday == 0) || (@halloween_time_key_rsday > 31)) + goto L_HalloweenError; + mes "Reward End Day?"; + input @halloween_time_key_reday; + if((@halloween_time_key_reday == 0) || (@halloween_time_key_reday > 31)) + goto L_HalloweenError; + mes "Time Key (CCYY) "; + input @halloween_time_key_year; + goto L_SetNewKey; + +L_HalloweenError: + mes "Incorrect Entry. Try again."; + next; + goto L_Debug; + +L_SetNewKey: + setarray $HALLOWEEN_TIME_KEY, @halloween_time_key_smonth, @halloween_time_key_srmonth, @halloween_time_key_emonth, @halloween_time_key_rsday, @halloween_time_key_reday, @halloween_time_key_year; + cmdothernpc "#HalloweenConfig", "RestartQuest"; + goto L_Debug; + +L_QuestState: + mes "Karma: " + (HALLOWEENTIME & 65535); + set @big_reward_status$, " No."; + if (HALLOWEENTIME & $@halloween_got_big_reward) + set @big_reward_status$, " Yes."; + mes "Big Reward: " + @big_reward_status$; + set @charm_reward_status$, " No."; + if (HALLOWEENTIME & $@halloween_got_charm_reward) + set @charm_reward_status$, " Yes."; + mes "Charm Reward:" + @charm_reward_status$; + set @npc_check_loop, 0; + goto L_NpcCheckLoop; + +L_NpcCheckLoop: + set @display_mes$, "NPC ID " + @npc_check_loop + ":" + $@halloween_npc_names$[@npc_check_loop]; + set @npc_status$, " Needed"; + if (HALLOWEENTIME & (1 << (31 - @npc_check_loop))) + set @npc_status$, " Complete"; + set @display_mes$, @display_mes$ + @npc_status$; + mes @display_mes$; + set @display_mes$, ""; + goto L_NpcCheckInc; + +L_NpcCheckInc: + set @npc_check_loop, (@npc_check_loop + 1); + if (@npc_check_loop >= getarraysize($@halloween_npc_names$)) + goto L_TrickOrTreatCount; + goto L_NpcCheckLoop; + +L_TrickOrTreatCount: + callfunc "TrickOrTreatTally"; + mes @npc_tally + " out of 14"; + next; + goto L_Debug; + +L_SetTrickOrTreats: + mes "Enter NPC to set"; + input @halloween_npc_id; + set HALLOWEENTIME, HALLOWEENTIME | (1 << (31 - @halloween_npc_id)); + goto L_Debug; + +L_ResetMe: + set HALLOWEENTIME, 0; + set HALLOWEENYEAR, $HALLOWEEN_TIME_KEY[5]; + goto L_Debug; + +L_ResetMask: + mes "Enter NPC to reset:"; + input @halloween_npc_id; + set $@halloween_maskmemory[8 * @halloween_npc_id], 0; + goto L_Debug; + +L_Close: + set @tmp, 0; + set @mask, 0; + set @karma, 0; + set @loop, 0; + set @menu, 0; + set @halloween_npc_id, 0; + close; +} +009-1.gat,51,38,0|script|HalloweenDebug#1|409, +{ + callfunc "HalloweenDebug"; + goto L_End; + +OnInit: + if(!debug) + disablenpc "HalloweenDebug#1"; + goto L_End; + +L_End: + end; +} +001-1.gat,38,26,0|script|HalloweenDebug#2|409, +{ + callfunc "HalloweenDebug"; + goto L_End; + +OnInit: + if(!debug) + disablenpc "HalloweenDebug#2"; + goto L_End; + +L_End: + end; +} +026-1.gat,23,37,0|script|HalloweenDebug#3|409, +{ + callfunc "HalloweenDebug"; + goto L_End; + +OnInit: + if(!debug) + disablenpc "HalloweenDebug#3"; + goto L_End; + +L_End: + end; +} diff --git a/world/map/npc/annuals/halloween/munro.txt b/world/map/npc/annuals/halloween/munro.txt new file mode 100644 index 00000000..c3ff6367 --- /dev/null +++ b/world/map/npc/annuals/halloween/munro.txt @@ -0,0 +1,60 @@ +// Part of Annual halloween +026-1.gat,24,37,0|script|Munro|183, +{ + callfunc "HalloweenCheckOld"; + callfunc "TrickOrTreatTally"; + if (($@halloween_time == $@halloween_reward_time) && (@npc_tally >= $@halloween_charm_count) && !(HALLOWEENTIME & $@halloween_got_charm_reward)) + goto L_Halloween; + goto L_NoReward; + +L_NoReward: + mes "[Munro]"; + mes "\"Greetings mortal.\""; + next; + mes "\"Once again we come to that time of year when the veil is thin\""; + next; + mes "\"All those who have passed on can part the veil to return.\""; + next; + mes "\"A time to celebrate our ancestors and chase evil away.\""; + next; + mes "\"Celebrate the holiday with me and I will reward you later.\""; + goto L_Exit; + +L_Halloween: + mes "[Munro]"; + mes "\"You have shown to have the Halloween spirit. Take this charm.\""; + set HALLOWEENTIME, HALLOWEENTIME | $@halloween_got_charm_reward; + getitem "SkeletonCharm",1; + goto L_Exit; + +L_Exit: + close; +} +function|script|SpawnMunro|, +{ + if ($@halloween_time) + goto L_EnableMunro; + goto L_DisableMunro; + +L_EnableMunro: + enablenpc "Munro"; + goto L_Return; + +L_DisableMunro: + disablenpc "Munro"; + goto L_Return; + +L_Return: + return; +} +function|script|CheckMunro|, +{ + if (($@halloween_time) || ($@xmas_time)) + goto L_Return; + + callfunc "UnequipLater"; + goto L_Return; + +L_Return: + return; +} diff --git a/world/map/npc/annuals/halloween/trick_or_treat.txt b/world/map/npc/annuals/halloween/trick_or_treat.txt new file mode 100644 index 00000000..c94977ab --- /dev/null +++ b/world/map/npc/annuals/halloween/trick_or_treat.txt @@ -0,0 +1,329 @@ +// Halloween Annual +// Authors: alastrim, enchilado, o11c, wushin +// See config +function|script|TrickOrTreat|, +{ + callfunc "HalloweenCheckOld"; + if ($@halloween_time) + goto L_Halloween; + goto L_QuickReturn; + +L_Halloween: + if ((gettimetick(2)-TUT_var < $@halloween_min_age) || (BaseLevel < $@halloween_min_level)) //player must be created at least 1 weeks ago + goto L_QuickReturn; + menu + "Trick or Treat", L_HWQuest, + "[Go to normal NPC dialog]", L_QuickReturn; + +L_HWQuest: + set @mask, getequipid(equip_head); + goto L_Begin; + +L_Begin: + set @karma, (HALLOWEENTIME & 65535); + if (@mask > 0) + goto L_WearingMask; + goto L_NoMask; + +L_WearingMask: + // set the scare factor of the equipped mask + set @mask_index, 0; + set @scare_factor, 1; + goto L_MaskLoop; + +L_MaskLoop: + if ($@halloween_mask_IDs[@mask_index] == @mask) + goto L_FoundMask; + set @mask_index, @mask_index + 1; + if ($@halloween_mask_IDs[@mask_index]) + goto L_MaskLoop; + // not a mask in the list + set @mask, 0; + goto L_MaskDone; + +L_FoundMask: + set @scare_factor, $@halloween_scare_factors[@mask_index]; + if (@mask != 616) + goto L_MaskDone; + mes "\"Aaargh... Gross! This is sick! I can't even look at your face...\""; + goto L_MaskDone; + +L_MaskDone: + set @mask_index, 0; + // check if the mask is in the memory + set @loop, 0; + // Note: we don't handle remembered faces until they get their candy + if (!@mask) + goto L_MaskMemoryNo; + // check if the mask is remembered + goto L_MaskMemoryCheck; + +L_MaskMemoryCheck: + set @tmp, $@halloween_maskmemory[8 * @halloween_npc_id + @loop]; + if (!@tmp) + goto L_MaskMemoryNo; + if (@tmp == @mask) + goto L_MaskMemoryYes; + set @loop, @loop + 1; + if (@loop != $@halloween_memory_count) + goto L_MaskMemoryCheck; + goto L_MaskMemoryNo; + +L_MaskMemoryYes: + // not necessarily true + mes "\"I remember you, " + getequipname(equip_head) + " person. No more treats for you!\""; + goto L_Close; + +L_MaskMemoryNo: + // player will probably get treats + set @loop, 0; + set @sweets_types, 0; + goto L_Count_Sweets; + +L_Count_Sweets: + if ($@halloween_sweets[@loop] == 0) + goto L_Check_Inventory; + if (countitem($@halloween_sweets[@loop])) + set @sweets_types, @sweets_types + 1; + set @loop, @loop + 1; + goto L_Count_Sweets; + +L_Check_Inventory: + getinventorylist; + if (@inventorylist_count + (@loop - @halloween_invy) > 100) + goto L_Full_Inventory; + if (@mask) + goto L_Check_Karma; + // check if the player's face is remembered + if (HALLOWEENTIME & (1 << (31 - @halloween_npc_id))) + goto L_Remember_Face; + goto L_Tricking_Trick_or_Treat; + +L_Check_Karma: + // Please don't change this, you'll break stuff. + if (rand($@halloween_num_npcs, 65535) <= @karma) + goto L_Cheater; + // this is a cheap, limited form of ilog2 + if ((@karma >= 16) && !(rand( 4 - (@karma >= 64) + (@karma >= 256) + (@karma >= 1024) ))) + goto L_Cheater; + if (HALLOWEENTIME & $@halloween_got_big_reward) + goto L_Tricking_Trick_or_Treat; + // assert: @karma < $@halloween_num_npcs + if (rand($@halloween_num_npcs - @karma)) + goto L_Tricking_Trick_or_Treat; + mes "\"All this candy isn't healthy, here take this to have a break from it.\""; + getitem $@halloween_big_reward[rand(getarraysize($@halloween_big_reward))], 1; + set HALLOWEENTIME, HALLOWEENTIME | $@halloween_got_big_reward; + // you get the big reward first, then the main treats + // otherwise it would be too complicated, and/or possibly unfair + goto L_Tricking_Trick_or_Treat; + +L_Cheater: + mes "\"I recognize you despite your mask, you have been taking sweets you do not deserve.\""; + if (@karma != 65535) + set HALLOWEENTIME, HALLOWEENTIME + 1; + goto L_Close; + +L_Remember_Face: + // mes "You've been here before; I remember your face"; + mes "\"I remember your face, " + strcharinfo(0) + ". No more treats for you!\""; + goto L_Close; + +L_Tricking_Trick_or_Treat: + // moved above + mes $@halloween_npc_names$[@halloween_npc_id]; + mes $@halloween_greetings$[@halloween_npc_id]; + next; + // TODO: should we randomize these? (in a subsequent commit) + menu + $@halloween_trick_notscary$[@halloween_npc_id], L_Tricking_Notscary, + $@halloween_trick_scary$[@halloween_npc_id], L_Tricking_Scary, + $@halloween_trick_veryscary$[@halloween_npc_id], L_Tricking_Veryscary; + +L_Tricking_Notscary: + mes $@halloween_npc_names$[@halloween_npc_id]; + mes $@halloween_react_notscary$[@halloween_npc_id]; + goto L_Tricking_Reward; + +L_Tricking_Scary: + mes $@halloween_npc_names$[@halloween_npc_id]; + mes $@halloween_react_scary$[@halloween_npc_id]; + set @scare_factor, @scare_factor * 2; + goto L_Tricking_Reward; + +L_Tricking_Veryscary: + mes $@halloween_npc_names$[@halloween_npc_id]; + mes $@halloween_react_veryscary$[@halloween_npc_id]; + set @scare_factor, @scare_factor * 3; + goto L_Tricking_Reward; + +L_Tricking_Reward: + next; + if (@karma >= 16) + set @scare_factor, rand(@scare_factor / 2, @scare_factor); + if (@karma >= 256) + set @scare_factor, rand(@scare_factor / 2, @scare_factor); + if (@karma >= 4096) + set @scare_factor, rand(@scare_factor / 2, @scare_factor); + if (@scare_factor < 1) + set @scare_factor, 1; + goto L_Tricking_Reward_Loop; + +L_Tricking_Reward_Loop: + set @random, rand($@halloween_sweets_num); + setarray @getitem_ids, $@halloween_sweets[@random]; + setarray @getitem_counts, 1; + callfunc "CheckInventory"; + if (@check_fail) + set @scare_factor, 0; + if (!@scare_factor) + goto L_Tricking_End; + // NOTE: it gives out one piece at a time, but can loop several times + getitem $@halloween_sweets[@random], 1; + set @scare_factor, @scare_factor - 1; + goto L_Tricking_Reward_Loop; + +L_SetRememberFace: + set HALLOWEENTIME, HALLOWEENTIME | (1 << (31 - @halloween_npc_id)); + goto L_Close; + +L_Tricking_End: + mes $@halloween_npc_names$[@halloween_npc_id]; + mes "\"That should be enough sweets for you. Thanks for participating!\""; + if (!@mask) + goto L_SetRememberFace; + // add the player's mask to the list + set @loop, 7; + goto L_SetRememberMask; + +L_SetRememberMask: + set $@halloween_maskmemory[8 * @halloween_npc_id + @loop], $@halloween_maskmemory[8 * @halloween_npc_id + @loop - 1]; + set @loop, @loop - 1; + if (@loop) + goto L_SetRememberMask; + set $@halloween_maskmemory[8 * @halloween_npc_id], @mask; + set HALLOWEENTIME, HALLOWEENTIME + 1; + goto L_Close; + +L_Full_Inventory: + mes $@halloween_npc_names$[@halloween_npc_id]; + mes "\"You are trying to collect candy but you have no space to carry all the kinds of stuff that I have to offer! Please, save room for more stuff and come back.\""; + goto L_Close; + +L_NoMask: + mes $@halloween_npc_names$[@halloween_npc_id]; + mes "\"Hey " + strcharinfo(0) + ", are you trying to scare me with your face? Interesting! hahaha...\""; + goto L_Close; + +L_Close: + set @tmp, 0; + set @mask, 0; + set @karma, 0; + set @loop, 0; + set @menu, 0; + set @halloween_npc_id, 0; + return; + +L_QuickReturn: + set @halloween_npc_id, 0; + return; +} +function|script|TrickOrTreatTally|, +{ + set @npc_loop, 0; + set @npc_tally, 0; + goto L_LoopCheck; + +L_LoopCheck: + if (HALLOWEENTIME & (1 << (31 - @npc_loop))) + set @npc_tally, (@npc_tally + 1); + goto L_IncLoop; + +L_IncLoop: + set @npc_loop, (@npc_loop + 1); + if (@npc_loop >= 15) + goto L_Return; + goto L_LoopCheck; + +L_Return: + return; +} +// Checks for an expired event key +// Each new annual event needs a new key +// or it will allow completion from last year +function|script|HalloweenCheckOld|, +{ + if(HALLOWEENYEAR == $HALLOWEEN_TIME_KEY[5]) + goto L_Return; + goto L_OldMatch; + +L_OldMatch: + set HALLOWEENTIME, 0; + set HALLOWEENYEAR, $HALLOWEEN_TIME_KEY[5]; + goto L_Return; + +L_Return: + return; +} +function|script|HalloweenTree|, +{ + mes "[Confused Tree]"; + mes "\"I love halloween, wearing masks and going trick or treating is so much fun.\""; + goto L_StartMenu; + +L_StartMenu: + menu + "Whats Halloween?", L_Explain, + "Me too!", L_CheckDressed, + "Meh, I like Christmas Better.", L_XmasBetter; + +L_Explain: + mes "\"I've convinced some people throughout the world to help with trick or treating.\""; + next; + set @npc_check_loop, 0; + goto L_NpcCheckLoop; + +L_NpcCheckLoop: + mes $@halloween_npc_names$[@npc_check_loop]; + next; + goto L_NpcCheckInc; + +L_NpcCheckInc: + set @npc_check_loop, (@npc_check_loop + 1); + if (@npc_check_loop >= getarraysize($@halloween_npc_names$)) + goto L_ContinueExplain; + goto L_NpcCheckLoop; + +L_ContinueExplain: + mes "\"Find each person and put on a mask then try to scare them.\""; + next; + mes "\"The scarier you are, the more treats you will be awarded.\""; + next; + mes "\"If you are really scary you could get a rare reward.\""; + next; + goto L_StartMenu; + +L_CheckDressed: + set @head, getequipid(equip_head); + set @chest, getequipid(equip_torso); + set @leg, getequipid(equip_legs); + set @random_mes$, "\" I like your costume.\""; + if ((@head <= 0) && (@chest <= 0) && (@leg <= 0)) + set @random_mes$, "\"Birthday Suit, always a classic.\""; + if ((@head == 615) && (@chest == 870)) + set @random_mes$, "\"How embrassing... we are wearing the same costume.\""; + if ((@head == 617) || (@head == 622) || (@head == 621)) + set @random_mes$, "\"Yar, matey I see that.\""; + if ((@head == 633) || (@head == 1205) || (@chest == 1183) || (@chest == 1184) || (@chest == 1185) || (@chest == 1186) || (@chest == 1187)) + set @random_mes$, "\"Your sense of humor offends me, it's way to early for that.\""; + mes @random_mes$; + goto L_Return; + +L_XmasBetter: + mes "\"Bah, Humbug, Show your Halloween spirit! OOooooOooo\""; + misceffect 302, strcharinfo(0); + goto L_Return; + +L_Return: + return; +} diff --git a/world/map/npc/annuals/xmas/tree_beard.txt b/world/map/npc/annuals/tree_beard.txt index d7e8b183..5923637f 100644 --- a/world/map/npc/annuals/xmas/tree_beard.txt +++ b/world/map/npc/annuals/tree_beard.txt @@ -1,4 +1,10 @@ -// Annual Xmas Environment changes +// Annual Environment changes +020-1.gat,90,78,0|script|#GhostTreeOne|133, +{ + callfunc "HalloweenTree"; + close; +} + 020-1.gat,90,78,0|script|#Tree|380, { end; @@ -16,6 +22,12 @@ close; } +009-1.gat,54,38,0|script|#GhostTreeTwo|133, +{ + callfunc "HalloweenTree"; + close; +} + 009-1.gat,54,38,0|script|#TreeNoSnow|394, { end; @@ -33,6 +45,12 @@ close; } +001-1.gat,41,45,0|script|#GhostTreeThree|133, +{ + callfunc "HalloweenTree"; + close; +} + 001-1.gat,41,45,0|script|#PalmTree|384, { end; @@ -80,25 +98,37 @@ L_Return: function|script|ReplaceTrees|, { - if($@xmas_time) + disablenpc "#Tree"; + disablenpc "#TreeNoSnow"; + disablenpc "#PalmTree"; + disablenpc "#GhostTreeOne"; + disablenpc "#GhostTreeTwo"; + disablenpc "#GhostTreeThree"; + disablenpc "#XmasTree"; + disablenpc "#XmasTreeNoSnow"; + disablenpc "#XmasPalmTree"; + + if ($@xmas_time) goto L_XmasTree; + if ($@halloween_time) + goto L_HalloweenLive; goto L_Tree; L_XmasTree: - disablenpc "#Tree"; enablenpc "#XmasTree"; - disablenpc "#TreeNoSnow"; enablenpc "#XmasTreeNoSnow"; - disablenpc "#PalmTree"; enablenpc "#XmasPalmTree"; goto L_Return; +L_HalloweenLive: + enablenpc "#GhostTreeOne"; + enablenpc "#GhostTreeTwo"; + enablenpc "#GhostTreeThree"; + goto L_Return; + L_Tree: - disablenpc "#XmasTree"; enablenpc "#Tree"; - disablenpc "#XmasTreeNoSnow"; enablenpc "#TreeNoSnow"; - disablenpc "#XmasPalmTree"; enablenpc "#PalmTree"; goto L_Return; diff --git a/world/map/npc/annuals/xmas/config.txt b/world/map/npc/annuals/xmas/config.txt index e63c07e2..e8ac5cc2 100644 --- a/world/map/npc/annuals/xmas/config.txt +++ b/world/map/npc/annuals/xmas/config.txt @@ -80,9 +80,6 @@ L_Main: set $@xmas_event_time, 1; set $@xmas_reward_time, 2; - // Xmas debug (sets time) - set $@xmas_debug, 0; - // Main Quest Settings // Bit used to Set Which one of the 2 quests you are on set $@xmas_side_bit, (1 << 31); @@ -265,11 +262,6 @@ L_Main: set $@xmas_spawn_y2, 89; set $@xmas_respawn_count, 9; - if($@xmas_debug == $@xmas_event_time) - goto L_EventTime; - if($@xmas_debug == $@xmas_reward_time) - goto L_RewardTime; - if((gettime(6) == $@xmas_reward_start_month && gettime(5) >= $@xmas_reward_start_day && (gettime(5) <= $@xmas_reward_end_day && $@xmas_reward_start_month == $@xmas_end_month || !($@xmas_reward_start_month == $@xmas_end_month))) @@ -297,9 +289,9 @@ L_RewardTime: goto L_Return; L_Return: - callfunc "ReplaceTrees"; callfunc "SpawnMobs"; callfunc "PresentHandler"; + callfunc "ReplaceTrees"; end; L_XmasError: diff --git a/world/map/npc/annuals/xmas/debug.txt b/world/map/npc/annuals/xmas/debug.txt index 38bbdf15..a26565b6 100644 --- a/world/map/npc/annuals/xmas/debug.txt +++ b/world/map/npc/annuals/xmas/debug.txt @@ -227,27 +227,14 @@ L_End: end; } - -017-9.gat,31,24,0|script|XmasDebug#5|105, -{ - if(getgmlevel() < 40) - goto L_End; - - callfunc "XmasDebug"; - goto L_End; - -L_End: - end; -} - -020-1.gat,86,76,0|script|XmasDebug#6|105, +020-1.gat,86,76,0|script|XmasDebug#5|105, { callfunc "XmasDebug"; goto L_End; OnInit: if(!(debug)) - disablenpc "XmasDebug#6"; + disablenpc "XmasDebug#5"; goto L_End; L_End: diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt index 76b06dd7..0f9b4ffb 100644 --- a/world/map/npc/functions/barber.txt +++ b/world/map/npc/functions/barber.txt @@ -11,100 +11,124 @@ function|script|Barber|, { + callfunc "getHeadStyles"; + goto L_Main; + +L_Main: set @style, getlook(LOOK_HAIR_STYLE); set @color, getlook(LOOK_HAIR_COLOR); - set @style$, "Unknown"; set @color$, "Unknown"; if (@style >= 0 && @style < 20) - set @style$, $@HairStyles$[@style]; - if (@color >= 0 && @color < 20) - set @color$, $@HairColors$[@color]; + set @style$, @HairStyles$[@style]; + if (@color >= 0 && @color < 120) + set @color$, @HairColors$[@color]; if (@color == 127) set @color$, "Shocked White"; - mes "Your current style is " + @style$ + " and your current color is " + @color$ + "."; set @style$, ""; set @color$, ""; - goto L_Main; - -L_Main: menu "Change my style", L_Style, "Change my color", L_Color, "Nah, I'm fine", L_Done; L_Style: + if(!@hairOpts) set @HairStyles$[getarraysize(@HairStyles$)], "Surprise me"; + if(!@hairOpts) set @HairStyles$[getarraysize(@HairStyles$)], "Nah, I'm fine"; + if(!@hairOpts) set @hairOpts, 1; menu - "Bald", L_MenuItems, - "Flat ponytail", L_MenuItems, - "Bowl cut", L_MenuItems, - "Combed back", L_MenuItems, - "Emo", L_MenuItems, - "Mohawk", L_MenuItems, - "Pompadour", L_MenuItems, - "Center parting/Short and slick", L_MenuItems, - "Long and slick", L_MenuItems, - "Short and curly", L_MenuItems, - "Pigtails", L_MenuItems, - "Long and curly", L_MenuItems, - "Parted", L_MenuItems, - "Perky ponytail", L_MenuItems, - "Wave", L_MenuItems, - "Mane", L_MenuItems, - "Bun", L_MenuItems, - "Shoulder Length Flick", L_MenuItems, - "Fizzy", L_MenuItems, - "Long and Clipped", L_MenuItems, - "Surprise me", L_RandomStyle, - "Nah, I'm fine", L_Done; + @HairStyles$[0], L_MenuItems, + @HairStyles$[1], L_MenuItems, + @HairStyles$[2], L_MenuItems, + @HairStyles$[3], L_MenuItems, + @HairStyles$[4], L_MenuItems, + @HairStyles$[5], L_MenuItems, + @HairStyles$[6], L_MenuItems, + @HairStyles$[7], L_MenuItems, + @HairStyles$[8], L_MenuItems, + @HairStyles$[9], L_MenuItems, + @HairStyles$[10], L_MenuItems, + @HairStyles$[11], L_MenuItems, + @HairStyles$[12], L_MenuItems, + @HairStyles$[13], L_MenuItems, + @HairStyles$[14], L_MenuItems, + @HairStyles$[15], L_MenuItems, + @HairStyles$[16], L_MenuItems, + @HairStyles$[17], L_MenuItems, + @HairStyles$[18], L_MenuItems, + @HairStyles$[19], L_MenuItems, + @HairStyles$[20], L_MenuItems, + @HairStyles$[21], L_MenuItems, + @HairStyles$[22], L_MenuItems, + @HairStyles$[23], L_MenuItems, + @HairStyles$[24], L_MenuItems, + @HairStyles$[25], L_MenuItems; L_MenuItems: if (@menu - 1 == @style) goto L_SameStyle; - + if(@menu == (getarraysize(@HairStyles$) - 1)) goto L_RandomStyle; + if(@menu == getarraysize(@HairStyles$)) goto L_Done; setlook LOOK_HAIR_STYLE, @menu - 1; - goto L_Done; + goto L_Main; L_RandomStyle: - setlook LOOK_HAIR_STYLE, rand(20); - goto L_Done; + set @randomStyle, rand(0, (getarraysize(@HairStyles$) -4)); + if(@randomStyle == @style) goto L_RandomStyle; + setlook LOOK_HAIR_STYLE, @randomStyle; + menu + "Surprise me once again", L_RandomStyle, + "Go back", L_Main, + "Goodbye", L_Done; L_SameStyle: mes "Your hair already has that style."; goto L_Main; L_Color: + if(@style == Class) goto L_SameColor; // first headstyle of any class is bald + if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Surprise me"; + if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Nah, I'm fine"; + if(!@colorOpts) set @colorOpts, 1; menu - "Brunette", L_MenuItems1, - "Green", L_MenuItems1, - "Dark red", L_MenuItems1, - "Light purple", L_MenuItems1, - "Gray", L_MenuItems1, - "Blonde", L_MenuItems1, - "Teal", L_MenuItems1, - "Light red", L_MenuItems1, - "Blue", L_MenuItems1, - "Dark purple", L_MenuItems1, - "Black", L_MenuItems1, - "Pink", L_MenuItems1, - "Brown", L_MenuItems1, - "Surprise me", L_RandomColor, - "Nah, I'm fine", L_Done; + @HairColors$[0], L_MenuItems1, + @HairColors$[1], L_MenuItems1, + @HairColors$[2], L_MenuItems1, + @HairColors$[3], L_MenuItems1, + @HairColors$[4], L_MenuItems1, + @HairColors$[5], L_MenuItems1, + @HairColors$[6], L_MenuItems1, + @HairColors$[7], L_MenuItems1, + @HairColors$[8], L_MenuItems1, + @HairColors$[9], L_MenuItems1, + @HairColors$[10], L_MenuItems1, + @HairColors$[11], L_MenuItems1, + @HairColors$[12], L_MenuItems1, + @HairColors$[13], L_MenuItems1, + @HairColors$[14], L_MenuItems1, + @HairColors$[15], L_MenuItems1, + @HairColors$[16], L_MenuItems1; L_MenuItems1: if (@menu - 1 == @color) goto L_SameColor; - - setlook LOOK_HAIR_COLOR, @menu - 1; - goto L_Done; + if(@menu == (getarraysize(@HairColors$) - 1)) goto L_RandomColor; + if(@menu == getarraysize(@HairColors$)) goto L_Done; + setlook LOOK_HAIR_COLOR, ((@menu - 1) + (15 * Class)); + goto L_Main; L_RandomColor: - setlook LOOK_HAIR_COLOR, rand(13); - goto L_Done; + set @randomColor, rand((15 * Class), ((getarraysize(@HairColors$) -4) + (15 * Class))); + if(@randomColor == @color) goto L_RandomColor; + setlook LOOK_HAIR_COLOR, @randomColor; + menu + "Surprise me once again", L_RandomColor, + "Go back", L_Main, + "Goodbye", L_Done; L_SameColor: - mes "Your hair is already that color."; + mes "You are either bald or your hair is already that color."; goto L_Main; L_Done: @@ -112,23 +136,9 @@ L_Done: set @menu, 0; set @style, 0; set @color, 0; + cleararray @HairStyles$, "", getarraysize(@HairStyles$); + cleararray @HairColors$, "", getarraysize(@HairColors$); + set @hairOpts, 0; + set @colorOpts, 0; return; } - --|script|#BarberConfig|-1, -{ - end; - -OnInit: - setarray $@HairStyles$, - "Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk", - "Pompadour", "Center parting/Short and slick", "Long and slick", - "Short and curly", "Pigtails", "Long and curly", "Parted", - "Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick", - "Fizzy", "Long and Clipped"; - setarray $@HairColors$, - "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde", - "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink", - "Brown"; - end; -} diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt index b4a66314..a41633fc 100755 --- a/world/map/npc/functions/debug.txt +++ b/world/map/npc/functions/debug.txt @@ -916,62 +916,62 @@ L_Close: } -042-2.gat,30,26,0|script|Debug0|154, +042-2.gat,30,26,0|script|Debug#0|154, { callfunc "Debug"; end; OnInit: if (!debug) - disablenpc "Debug0"; + disablenpc "Debug#0"; end; } -001-1.gat,41,29,0|script|Debug1|154, +001-1.gat,41,29,0|script|Debug#1|154, { callfunc "Debug"; end; OnInit: if (!debug) - disablenpc "Debug1"; + disablenpc "Debug#1"; end; } -009-1.gat,52,33,0|script|Debug2|154, +009-1.gat,52,33,0|script|Debug#2|154, { callfunc "Debug"; end; OnInit: if (!debug) - disablenpc "Debug2"; + disablenpc "Debug#2"; end; } -020-1.gat,75,85,0|script|Debug3|154, +020-1.gat,75,85,0|script|Debug#3|154, { callfunc "Debug"; end; OnInit: if (!debug) - disablenpc "Debug3"; + disablenpc "Debug#3"; end; } -017-9.gat,21,24,0|script|Debug4|154, +017-9.gat,21,24,0|script|Debug#4|154, { callfunc "Debug"; end; OnInit: if (!debug) - disablenpc "Debug4"; + disablenpc "Debug#4"; end; } -027-2.gat,125,103,0|script|Debug5|154, +027-2.gat,125,103,0|script|Debug#5|154, { callfunc "Debug"; end; OnInit: if (!debug) - disablenpc "Debug5"; + disablenpc "Debug#5"; end; } diff --git a/world/map/npc/functions/headstyles.txt b/world/map/npc/functions/headstyles.txt new file mode 100644 index 00000000..989bef83 --- /dev/null +++ b/world/map/npc/functions/headstyles.txt @@ -0,0 +1,41 @@ +// headstyles config file +// author: meko + +function|script|getHeadStyles|, +{ + set @HairStyles$, 0; + set @HairColors$, 0; + set @BaseClass, 0; // this is the default class + cleararray @HairStyles$, "", getarraysize(@HairStyles$); + cleararray @HairColors$, "", getarraysize(@HairColors$); + cleararray @ValidClasses, "", getarraysize(@ValidClasses); + setarray @ValidClasses, 0; // add new classes here + set @loop, 0; + goto L_LoopValid; + + L_LoopValid: + if(@ValidClasses[@loop] == Class) goto L_ValidClass; + set @loop, (@loop + 1); + if(@loop >= getarraysize(@ValidClasses)) goto L_FixClass; + goto L_LoopValid; + + L_FixClass: + set Class, @BaseClass; + goto L_ValidClass; + + L_ValidClass: + if(Class == 0) + setarray @HairStyles$, // TALPONIAN (human) + "Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk", + "Pompadour", "Center parting/Short and slick", "Long and slick", + "Short and curly", "Pigtails", "Long and curly", "Parted", + "Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick", + "Fizzy", "Long and Clipped"; + if(Class == 0) + setarray @HairColors$, // TALPONIAN (human) + "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde", + "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink", + "Brown";//, "(free slot)", "(free slot)"; + // adding a new species is as simple as adding another if(Class == X) and adding the class to @ValidClasses + return; +} diff --git a/world/map/npc/items/mirror.txt b/world/map/npc/items/mirror.txt new file mode 100644 index 00000000..fc2ca69b --- /dev/null +++ b/world/map/npc/items/mirror.txt @@ -0,0 +1,20 @@ +function|script|useMirror|, +{ + callfunc "getHeadStyles"; + goto L_Rand; + + L_Rand: + set @style, rand(0,(getarraysize(@HairStyles$) -2)); + set @color, rand((15 * Class),((getarraysize(@HairColors$) -2) + (15 * Class))); + if((getlook(LOOK_HAIR_STYLE) == @style) || (getlook(LOOK_HAIR_COLOR) == @color)) + goto L_Rand; + goto L_Proceed; + + L_Proceed: + if(@fixedMirror) + setlook LOOK_HAIR_STYLE, @style; + setlook LOOK_HAIR_COLOR, @color; + //if(!@fixedMirror) getitem "SilverMirror", 1; <== this can be used in the future to have a portable hair color changer (like scissors but for the color) + set @fixedMirror, 0; + return; +} diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf index 8aa774e0..047d7dbb 100644 --- a/world/map/npc/scripts.conf +++ b/world/map/npc/scripts.conf @@ -22,6 +22,7 @@ npc: npc/functions/debug.txt npc: npc/functions/lockpicking.txt npc: npc/functions/default_npc_checks.txt npc: npc/functions/undead_debug.txt +npc: npc/functions/headstyles.txt // Item Functions npc: npc/items/magic_gm_top_hat.txt @@ -35,12 +36,14 @@ npc: npc/items/warpTowels.txt npc: npc/items/unequipcb.txt npc: npc/items/launcher_ammo.txt npc: npc/items/check_wand.txt +npc: npc/items/mirror.txt import: npc/_import.txt // GM Events npc: npc/functions/gm_island.txt - +// Annuals Framework npc: npc/annuals/fathertime.txt +npc: npc/annuals/tree_beard.txt // Annual Christmas npc: npc/annuals/xmas/config.txt npc: npc/annuals/xmas/states.txt @@ -51,4 +54,8 @@ npc: npc/annuals/xmas/helpers.txt npc: npc/annuals/xmas/list.txt npc: npc/annuals/xmas/reagents.txt npc: npc/annuals/xmas/mobmanager.txt -npc: npc/annuals/xmas/tree_beard.txt +// Annual halloween +npc: npc/annuals/halloween/config.txt +npc: npc/annuals/halloween/debug.txt +npc: npc/annuals/halloween/munro.txt +npc: npc/annuals/halloween/trick_or_treat.txt |