// TMW2/LoF scripts. // Authors: // TMW-LoF Team // Jesusalva // Description: // Christmas 2024 Quest // Uses a player scoped variable, X24_CHALLENGES_DONE // Once event ends, rewards are claimed and variable is cleared // If rewards are never claimed, their score accumulates for next year. 019-4-1,54,44,0 script Ofelia NPC_ANGELA_SNOW,{ function _done; function _spin; // Christmas still running if ($EVENT$ == "Christmas") goto L_Main; // Last year if (X24_CHALLENGES_DONE) goto L_Reward; // Not in season goto L_OutOfSeason; L_OutOfSeason: mesn; mesq l("I entered this building to shield myself from the snowstorm, but now I can't bring myself to leave..."); close; L_Reward: .@progress = bitmask_count(X24_CHALLENGES_DONE); inventoryplace NPCEyes, .@progress, Iten, 3; if (.@progress >= 32 || .@progress <= 0) Exception("Invalid X24_BM", RB_ISFATAL); // ERROR mesc b(l("The Thirty One Challenges")), 2; mesc b(l("You have accomplished %d challenges this year.", .@progress)), 3; next; mesc b(l("Do you want to spin the wheel and claim your rewards now? Make sure you have enough space for everything and a stable internet connection!")), 1; if (askyesno() == ASK_NO) { closeclientdialog; close; } // There are only 31 challenges instead of 32, so here's the special rule // Main Quest goes up to 23, which completes it. You can also have 5 rebirths. // Max base level is 200. Max job level is 150. .@expectation = getq(General_Narrator) + REBIRTH + (JobLevel >= 100) + min(2, BaseLevel/100); // So if you meet my "expectation", you get a free extra pull. if (.@progress >= .@expectation) .@progress += 1; // Some explanation and last chance for regrets mesc l("Prizes are divided in 9 categories: Food, Tea, Cake, Potions, Paper, Exploration, Boxes, Dyes and Rares. You'll do %d pulls in total.", .@progress); mesc l("All categories have an equal chance of being selected, except for Rares, which are always the 15th and 30th pull. Every 5 non-rare pulls, you'll also get some Strange Coins as a memento."); mesc l("If you're ready I'll begin now."); next; // We eliminate your saved data NOW X24_CHALLENGES_DONE = 0; // And only then we bother handing out prizes for (.@i = 0; .@i < .@progress; .@i++) { _spin(.@i); } close; L_Main: if (!getq(SQuest_Christmas)) { mesn; mesq l("Hi! Sorry, it's too cold outside, so I'm still catching my breath. Try talking to Christmas Chief first?"); close; } mesn; mesq l("Hey %s, did you knew that in 2025 AD (or 425 AT) Moubootaur Legends celebrates its 7th anniversary?", strcharinfo(0)); dnext; mesn; mesq l("Despite being so old, many adventurers didn't experience everything this world has to offer, or did it so long ago they forgot. So for this Christmas Event, I'm challenging everyone to finish some of these challenges."); next; mesc b(l("You have accomplished %d challenges this year.", bitmask_count(X24_CHALLENGES_DONE))), 1; //msObjective(false, l("- Complete %s during Christmas", "Nothing")); // X24Event( X24_BITID ) msObjective(_done(X24_PVP), l("- Complete %s during Christmas", l("a PVP victory"))); msObjective(_done(X24_FEFE), l("- Complete %s during Christmas", l("a Candor Battle"))); msObjective(_done(X24_BLOOD), l("- Complete %s during Christmas", l("a Candor Bloodbath"))); msObjective(_done(X24_CTF), l("- Complete %s during Christmas", l("a Capture the Flag"))); msObjective(_done(X24_GROATA), l("- Complete %s during Christmas", l("Groata Grotto"))); msObjective(_done(X24_ICICLE), l("- Complete %s during Christmas", l("The Icicle Challenge"))); msObjective(_done(X24_COD), l("- Complete %s during Christmas", l("Call of Dusty"))); msObjective(_done(X24_SEALED), l("- Complete %s during Christmas", l("The Sealed Moubootaur Showdown"))); // WITH REDUNDANCY if ($GAME_STORYLINE >= 5) msObjective(_done(X24_MK), l("- Complete %s during Christmas", l("The Monster King Showdown"))); else msObjective(_done(X24_SIEGE), l("- Complete %s during Christmas", l("a Siege"))); // NOT WITH REDUNDANCY msObjective(_done(X24_HH), l("- Complete %s during Christmas", l("any Heroes Hold Dungeon"))); msObjective(_done(X24_CELESTIA), l("- Complete %s during Christmas", l("The Yeti King Duel"))); // NOTE: Duel, not just quest msObjective(_done(X24_VORAZ), l("- Complete %s during Christmas", l("Arena Quirin Voraz"))); msObjective(_done(X24_GEMINI), l("- Complete %s during Christmas", l("Gemini Sisters Quest"))); msObjective(_done(X24_CINDY), l("- Complete %s during Christmas", l("Cindy's Rescue"))); // WITH REDUNDANCY if ($GAME_STORYLINE >= 5) msObjective(_done(X24_AEROS), l("- Complete %s during Christmas", l("Aeros Raid"))); else msObjective(_done(X24_FORT), l("- Complete %s during Christmas", l("Fortress Town Siege"))); // NOT WITH REDUNDANCY msObjective(_done(X24_FISHING), l("- Complete %s during Christmas", l("a rare fishing"))); msObjective(_done(X24_RAIN), l("- Complete %s during Christmas", l("killing a monster while it rains"))); msObjective(_done(X24_BOSS), l("- Complete %s during Christmas", l("killing a roaming boss"))); msObjective(_done(X24_LOCKPICK), l("- Complete %s during Christmas", l("lock-picking a vault or similar"))); msObjective(_done(X24_DUNGEON), l("- Complete %s during Christmas", l("a buried dungeon"))); msObjective(_done(X24_ELECTION), l("- Complete %s during Christmas", l("a vote for town admin"))); msObjective(_done(X24_KAMELOT), l("- Complete %s during Christmas", l("a Kamelot Raid"))); msObjective(_done(X24_DEMURE), l("- Complete %s during Christmas", l("a Duel with Demure"))); msObjective(_done(X24_BREWING), l("- Complete %s during Christmas", l("brewing a fermented beverage"))); msObjective(_done(X24_COOKING), l("- Complete %s during Christmas", l("cooking any dish"))); msObjective(_done(X24_REFINING), l("- Complete %s during Christmas", l("refining any equipment"))); msObjective(_done(X24_POKER), l("- Complete %s during Christmas", l("a game of Poker"))); /////////// // Groups .@cur = getcharid(0) + getq(SQuest_Christmas); // .:: GROUP 1 ::. switch (.@cur % X24_G1_MAX) { case X24_G1_CRAPS: msObjective(_done(X24_GROUP1), l("- Complete %s during Christmas", l("a game of Craps"))); break; case X24_G1_SEQUENCE: msObjective(_done(X24_GROUP1), l("- Complete %s during Christmas", l("a game of Sequence"))); break; case X24_G1_HIGHLOW: msObjective(_done(X24_GROUP1), l("- Complete %s during Christmas", l("a game of Higher or Lower"))); break; case X24_G1_BLACKJACK: msObjective(_done(X24_GROUP1), l("- Complete %s during Christmas", l("a game of Black Jack"))); break; } // .:: GROUP 2 ::. switch (.@cur % X24_G2_MAX) { case X24_G2_UDT: msObjective(_done(X24_GROUP2), l("- Complete %s during Christmas", l("an UDT Challenge"))); break; case X24_G2_MPT: msObjective(_done(X24_GROUP2), l("- Complete %s during Christmas", l("a Monster Point trade"))); break; } // .:: GROUP 3 ::. switch (.@cur % X24_G3_MAX) { case X24_G3_TREASURE: msObjective(_done(X24_GROUP3), l("- Complete %s during Christmas", l("opening a treasure box"))); break; case X24_G3_TREE: msObjective(_done(X24_GROUP3), l("- Complete %s during Christmas", l("planting a tree"))); break; } // .:: GROUP 4 ::. switch (.@cur % X24_G4_MAX) { //case X24_G4_INSURANCE: // msObjective(_done(X24_GROUP4), l("- Complete %s during Christmas", l("using an insurance"))); break; case X24_G4_GRENADE: msObjective(_done(X24_GROUP4), l("- Complete %s during Christmas", l("using a grenade or equivalent magic"))); break; case X24_G4_SAXSO: msObjective(_done(X24_GROUP4), l("- Complete %s during Christmas", l("opening Saxso's Chest"))); break; } // A Guild Skill Use? Guild Craft? ~~Donate Blood~~ Something of magic? At least 36 tasks were listed above... Up to 40 for all gamblers. But max is 31 tasks for an INT_MAX. Some will not make the cut. next; mesn; mesq l("Talk to me once Christmas is over to claim your rewards. The more challenges you accomplish, the better the rewards, but it might be impossible to do all of them."); close; function _done { return X24_CHALLENGES_DONE & getarg(0); } function _spin { .@pull = getarg(0) + 1; //////////////////////////////// // Now we can talk about logic // Every 15 pulls, it's a rare if (!(.@pull % 15)) { .@item = relative_array_random(.rare); mesc l("Congratulations! You pulled a Rare. It's a(n) %s!", getitemlink(.@item)), 3; getitem .@item, 1; } else { if (!(.@pull % 5)) { getitem StrangeCoin, .@pull / 5; mesc l("This is your %dth pull. You have received %d %s as a memento.", .@pull, (.@pull/5), getitemlink(StrangeCoin)), 2; } .@type$ = any("Box", "Dye", "Food", "Tea", "Cake", "Potion", "Exploration Utility", "Paper"); .@amount = 1; // Pattern A: 1 + a third prob if (.@type$ == "Food") { .@item = relative_array_random(.food); .@tmp = array_find(.food, .@item) + 1; if (.@tmp) .@amount = 1 + (.food[.@tmp] / 3); // Pattern A': 1 but can be 2 if it is common } else if (.@type$ == "Paper") { .@item = relative_array_random(.paper); .@tmp = array_find(.paper, .@item) + 1; if (.@tmp) .@amount = (.paper[.@tmp] >= 3 ? any(2,1) : 1); // Pattern A'': 1 but can be 2 if Main Quest is advanced enough } else if (.@type$ == "Potion") { .@item = relative_array_random(.potions); .@amount = any(1,(getq(General_Narrator) > 17 ? 2 : 1)); // Pattern B: Randomly 1~3 } else if (.@type$ == "Tea") { .@item = relative_array_random(.tea); .@amount = rand2(1,3); } else if (.@type$ == "Cake") { .@item = relative_array_random(.cake); .@amount = rand2(1,3); } else if (.@type$ == "Exploration Utility") { .@item = relative_array_random(.explore); .@amount = rand2(1,3); // Pattern C: Always 1 } else if (.@type$ == "Box") { .@item = relative_array_random(.boxes); } else if (.@type$ == "Dye") { .@item = relative_array_random(.dyes); } else { Exception(sprintf("Unknown Ofelia Item Class: %s. Using fallback.", .@type$), RB_SPEECH|RB_PLEASEREPORT|RB_DEBUGMES|RB_IRCBROADCAST); .@item = any(CreasedShirt, CreasedShorts, XmasGift); } mesc l("Congratulations! You pulled a(n) %s. It's a(n) %s!", .@type$, getitemlink(.@item)); getitem .@item, .@amount; } dnext; return; } OnInit: .distance = 7; .sex = G_FEMALE; ////////////////////////////////////////// // amount given is 1 + a third of prob setarray(.food, 0, Acorn, 10, Bread, 10, Fungus, 7, Cheese, 10, LettuceLeaf, 10, Piberries, 10, Croconut, 9, UrchinMeat, 1, // NEW Manana, 10, Carrot, 7, Curshroom, 2, RoastedMaggot, 10, RedApple, 10, GoldenApple, 3, DivineApple, 1, MagicApple, 1, Manapple, 1, ElixirOfLife, 1, Candy, 10, Honey, 6, ApanaCake, 1, PiberriesInfusion, 8, FatesPotion, 6, ClothoLiquor, 4, LachesisBrew, 3, AtroposMixture, 1, Pear, 8, Orange, 9, OrangeCupcake, 9, MoubooSteak, 10, TonoriDelight, 8, Tomato, 8, Potatoz, 10, SnakeEgg, 8, MountainSnakeEgg, 7, BlackMambaEgg, 5, Dragonfruit, 7, BottleOfDivineWater, 3, Coffee, 9, Milk, 10, ChickenLeg, 5, DodgeDonut, 3, ChocolateDonut, 3, SparklyChocolateDonut, 3, MintDonut, 3, SparklyMintDonut, 2, StrawberryDonut, 3, SparklyStrawberryDonut, 3 ); ////////////////////////////////////////// // amount given is 1~3x setarray(.tea, 0, ChamomileTea, 10, SpearmintTea, 8, OolongTea, 6, JasmineTea, 4, YerbaMate, 2, HerbalTea, 1, Manapple, 1 ); ////////////////////////////////////////// // amount given is 1~3x setarray(.cake, 0, XmasCake, 10, CherryCake, 7, ApanaCake, 3, ElixirOfLife, 1, LemonCake, 10, OrangeCake, 8, ChocolateCake, 6, WhiteCake, 4, AppleCake, 2, BlueberryCake, 1, SparklyMintDonut, 7 ); ////////////////////////////////////////// // Always give 1 setarray(.potions, 0, PiberriesInfusion, 10, FatesPotion, 8, ClothoLiquor, 6, LachesisBrew, 4, AtroposMixture, 2, ElixirOfLife, 1, DeathPotion, 3, NymphPoison, 3, HastePotion, 10, StrengthPotion, 10, ScentGrenade, 10, SmokeGrenade, 10, Grenade, 10, MysteriousBottle, 5, ReturnPotion, 10, StatusResetPotion, 5, HomunResetPotion, 5, MoveSpeedPotion, 6, PrecisionPotion, 7, DodgePotion, 6, SacredLifePotion, 3, SacredManaPotion, 3, SacredImmortalityPotion, 2, IcedBottle, 4, PurificationPotion, 4, Coffee, 4, LukPotionA, 10, DexPotionA, 10, IntPotionA, 10, VitPotionA, 10, AgiPotionA, 10, LukPotionB, 7, DexPotionB, 7, IntPotionB, 7, VitPotionB, 7, AgiPotionB, 7, LukPotionC, 3, DexPotionC, 3, IntPotionC, 3, VitPotionC, 3, AgiPotionC, 3, DodgeDonut, 3, ChocolateDonut, 6, SparklyChocolateDonut, 6, MintDonut, 6, StrawberryDonut, 6, SparklyStrawberryDonut, 6, MysteriousFruit, 1 ); ////////////////////////////////////////// // Always give 1 setarray(.boxes, 0, EmptyBox, 10, XmasGift, 5, BronzeGift, 4, SilverGift, 3, GoldenGift, 2, PrismGift, 1, BronzeBossGift, 5, SilverBossGift, 3, GoldenBossGift, 1, TolchiAmmoBox, 10, TrainingAmmoBox, 9, ArrowAmmoBox, 8, IronAmmoBox, 7, CursedAmmoBox, 6, PoisonAmmoBox, 5, ThornAmmoBox, 4, BoneAmmoBox, 3, MediumBulletSack, 25, // Exception BigBulletSack, 20, // Exception ArcmageBoxset, 10, WallCard, 2, PowerCard, 2, ReflectCard, 2, SpeedCard, 2, SaviorBlueprint, 1, MercBoxAA, 9, MercBoxBB, 7, MercBoxCC, 5, MercBoxDD, 3, MercBoxEE, 1, MercBoxA, 11, // Exception MercBoxB, 9, MercBoxC, 7, MercBoxD, 5, MercBoxE, 3 ); ////////////////////////////////////////// // Always give 1 setarray(.paper, 0, InsuranceContract, 10, Insurance, 5, ScholarshipTuition, 10, PirateTreasureMap, 1, DesertTablet, 1, HousingLetterI, 8, HousingLetterII, 5, HousingLetterIII, 2, DungeonMap, 10, TreasureMap, 10, ScrollSMaggot, 10, ScrollSCave, 8, ScrollSWolvern, 6, ScrollSYeti, 4, ScrollSDragon, 2, ScrollSTerranite, 1, // Skill scrolls are purposefully swapped to encourage MMO ScrollMagnusHealA, 3, ScrollAngelLightA, 3, ScrollBattlePlansA, 3, ScrollDefenseBlessA, 3, ScrollCriticalFortuneA, 3, ScrollMagnusHealB, 10, ScrollAngelLightB, 10, ScrollBattlePlansB, 10, ScrollDefenseBlessB, 10, ScrollCriticalFortuneB, 10, ScrollMagnusHealC, 7, ScrollAngelLightC, 7, ScrollBattlePlansC, 7, ScrollDefenseBlessC, 7, ScrollCriticalFortuneC, 7, AlchemyBlueprintA, 10, EquipmentBlueprintA, 10, AlchemyBlueprintB, 8, EquipmentBlueprintB, 8, AlchemyBlueprintC, 6, EquipmentBlueprintC, 6, AncientBlueprint, 5, AlchemyBlueprintD, 4, EquipmentBlueprintD, 4, AlchemyBlueprintE, 2, EquipmentBlueprintE, 2, SaviorBlueprint, 1 ); ////////////////////////////////////////// // Always give 1 setarray(.dyes, 0, PurpleDye, 2, DarkRedDye, 2, BlackDye, 2, SilverDye, 4, NavyBlueDye, 4, BlueGrayDye, 4, FuschiaDye, 4, BrownDye, 4, MauveDye, 4, RedDye, 6, CamelDye, 6, CrimsonDye, 6, KhakiDye, 6, MintDye, 6, TealDye, 8, PinkDye, 8, GreenDye, 8, LimeDye, 8, BlueDye, 10, YellowDye, 10, ChocolateDye, 10, OrangeDye, 10, ArcmageBoxset, 1 ); ////////////////////////////////////////// // Always give 1 setarray(.rare, 0, Manapple, 3, DivineApple, 2, MagicApple, 2, ElixirOfLife, 1, DesertTablet, 1, Toothbrush, 1, TimeFlask, 2, CandorWarpCrystal, 1, TulimWarpCrystal, 1, HalinWarpCrystal, 1, HurnsWarpCrystal, 1, LoFWarpCrystal, 1, NivalWarpCrystal, 1, FrostiaWarpCrystal, 1, MercBoxE, 1, BoneAmmoBox, 1, LeatherQuiver, 1, DarkEggshellHat, 1, Shemagh, 1, Cap, 1, BlackPearl, 1, Bloodstone, 1, LavaManaPearl, 1, GemPowder, 1, BlueManaPearl, 1, CrystallizedMaggot, 1, LightGreenDiamond, 1, DarkDesertMushroom, 1, Arcanum, 1, Brain, 1, IceGladius, 1, Kanabo, 1, SmileyCap, 1, ClericCap, 1, Barrel, 1, MysteriousFruit, 1 ); ////////////////////////////////////////// // Gives 1~3x setarray(.explore, 0, TreasureKey, 21, // Exception Wurtzite, 10, Graphene, 7, Arcanum, 3, FluoPowder, 10, IronPowder, 10, DungeonMap, 10, TreasureMap, 10, CoinBag, 10, SulfurPowder, 10, Flour, 7, EarthPowder, 7, EverburnPowder, 7, ArcmageBoxset, 5, AlchemyBlueprintA, 10, EquipmentBlueprintA, 10, AlchemyBlueprintB, 8, EquipmentBlueprintB, 8, AlchemyBlueprintC, 6, EquipmentBlueprintC, 6, AncientBlueprint, 5, AlchemyBlueprintD, 4, EquipmentBlueprintD, 4, AlchemyBlueprintE, 2, EquipmentBlueprintE, 2, ToothNecklace, 1, Lockpicks, 10, WoodenLog, 10, IronOre, 10, CopperOre, 9, SilverOre, 8, GoldOre, 7, TerraniteOre, 6, TinOre, 5, LeadOre, 4, TitaniumOre, 3, IridiumOre, 2, PlatinumOre, 1 ); end; }