diff options
author | Jesusaves <cpntb1@ymail.com> | 2025-01-11 11:30:20 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2025-01-11 11:30:20 -0300 |
commit | 3bdc34b8adbdf1532b909d5c4127e68a9d571648 (patch) | |
tree | bea15311636051f9ab9979ac5331dc77d136f828 | |
parent | 77bacd3a52735008a507a213eb02230ece8dac96 (diff) | |
download | serverdata-3bdc34b8adbdf1532b909d5c4127e68a9d571648.tar.gz serverdata-3bdc34b8adbdf1532b909d5c4127e68a9d571648.tar.bz2 serverdata-3bdc34b8adbdf1532b909d5c4127e68a9d571648.tar.xz serverdata-3bdc34b8adbdf1532b909d5c4127e68a9d571648.zip |
Ofelia Event Rewards. Be so, and this is already overly generous...
even if I only got junk on my debug run with all tasks done XD
-rw-r--r-- | npc/019-4-1/ofelia.txt | 365 |
1 files changed, 360 insertions, 5 deletions
diff --git a/npc/019-4-1/ofelia.txt b/npc/019-4-1/ofelia.txt index c9933fd16..1cb1e751c 100644 --- a/npc/019-4-1/ofelia.txt +++ b/npc/019-4-1/ofelia.txt @@ -10,6 +10,7 @@ 019-4-1,54,44,0 script Ofelia NPC_ANGELA_SNOW,{ function _done; + function _spin; // Christmas still running if ($EVENT$ == "Christmas") @@ -28,16 +29,25 @@ L_OutOfSeason: close; L_Reward: - inventoryplace NPCEyes, 6, Iten, 1; .@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; - switch (.@progress) { - default: - break; + 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; } + // Some explanation and last chance for regrets + mesc l("Prizes are divided in 8 categories: Food, Tea, Cake, Potions, Paper, Exploration, Boxes 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 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); } - //X24_CHALLENGES_DONE = 0; // !!!!!TODO!!!!! close; L_Main: @@ -141,5 +151,350 @@ 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", "Food", "Tea", "Cake", "Potion", "Exploration Utility", "Paper"); + .@amount = 1; + if (.@type$ == "Food") { + .@item = relative_array_random(.food); + .@tmp = array_find(.food, .@item) + 1; + if (.@tmp) + .@amount = 1 + (.food[.@tmp] / 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); + } else if (.@type$ == "Potion") { + .@item = relative_array_random(.potions); + } else if (.@type$ == "Box") { + .@item = relative_array_random(.boxes); + } else if (.@type$ == "Paper") { + .@item = relative_array_random(.paper); + } 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(.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, + ToothNecklace, 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 + ); + ////////////////////////////////////////// + // Gives 1~3x + setarray(.explore, 0, + TreasureKey, 15, // Exception + Wurtzite, 10, + Graphene, 7, + Arcanum, 3, + FluoPowder, 10, + IronPowder, 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, + Lockpicks, 10, + TreasureKey, 10, + WoodenLog, 10, + IronOre, 10, + CopperOre, 9, + SilverOre, 8, + GoldOre, 7, + TerraniteOre, 6, + TinOre, 5, + LeadOre, 4, + TitaniumOre, 3, + IridiumOre, 2, + PlatinumOre, 1 + ); + end; } |