From 4ade56dc431cbdf4c279e7ce432f338c3413ecf1 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 19 Oct 2021 19:11:31 -0300 Subject: Initial version of Beatrice --- npc/031-5/beatrice.txt | 132 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 2 deletions(-) diff --git a/npc/031-5/beatrice.txt b/npc/031-5/beatrice.txt index bd363867c..2c620b100 100644 --- a/npc/031-5/beatrice.txt +++ b/npc/031-5/beatrice.txt @@ -5,6 +5,12 @@ // Questmaker Handbook 14.0 (F = Favorable) 031-5,97,41,0 script Beatrice NPC_SAVIOR_F,{ + // Unlocks upon: Rebirth + if (!REBIRTH) { + mesn; + mesq l("Hey there, %s. What I deal with is too much for your weak bones. So please come again after you are reborn, then I'll have something for you.", get_race()); + close; + } mesn; mesq l("Hey there, %s. I deal with ultra rare items. If the Powers That Be decided you're out of luck, well, I am here to help you to bypass it.", get_race()); next; @@ -13,7 +19,6 @@ next; L_Loop: - clear; mesc l("Aethyr Points: %s", fnum(AETHYR_PTS)), 2; select l("Nothing right now."), @@ -25,6 +30,12 @@ L_Loop: case 1: closeclientdialog; close; + case 2: + openshop; + closedialog; // Top-Level exit + end; + case 3: + goto L_Seller; case 4: mesc l("How many points? (0-%d)", Zeny/.price); input .@points, 0, Zeny/.price; @@ -35,6 +46,47 @@ L_Loop: mesc l("Done!"), 2; break; } + clear; + goto L_Loop; + +L_Seller: + .@id = 0; + .@rt = 0; + .@pc = 0; + .@am = 0; + + .@mr$=sprintf("%d.%02d", .ratio/100, .ratio%100); + mesc l("Only items with max %s%% drop rate are accepted!", .@mr$), 1; + .@id = requestitem(); + if (.@id < 1) goto L_Cont; + if (checkbound(.@id)) goto L_Cont; + .@rt = getiteminfo(.@id, ITEMINFO_MAXCHANCE); + // Some items are... special. Refuse them. + if (.@rt == 0) + .@rt=10000; + if (array_find(.blacklist, .@id) >= 0) + .@rt=10000; + + .@mb$=sprintf("%d.%02d", .@rt/100, .@rt%100); + if (.@rt > .ratio) { + mesc l("This item drop rate is %s%%, which exceeds the threshold of %s%%.", .@mb$, .@mr$); + next; + goto L_Cont; + } + debugmes "Ratio %s", .@mb$; + .@pc = 1+.ratio-(.@rt); // The reverse, so it goes from 1 to ratio + .@pc *= 12; // Each 0.01% chance gives a bonus of 12 points + mesn; + mesq l("I offer you %s Aethyr Points per unit of %s. How many do you wish to sell? (0-%d)", fnum(.@pc), getitemlink(.@id), countitem(.@id)); + input .@am, 0, countitem(.@id); + if (.@am < 1) + goto L_Cont; + delitem .@id, .@am; + AETHYR_PTS+=.@pc; + // FALLTHROUGH + +L_Cont: + clear; goto L_Loop; OnInit: @@ -47,7 +99,83 @@ OnInit: .sex = G_FEMALE; .distance = 5; - .price = 570; + .price = 520; // Loosely ased on Crafty Wings price + .ratio = 100; // Max drop rate + // Some items can be obtained by "other means" and thus, their value cannot be + // reliably calculated + setarray .blacklist, GuildCoin, WarlordPlate, Lightsaber, PowerfulLightsaber, Emperium, PinkieCrystal, PinkieHat, IronIngot, Kanabo, WarlordHelmet, Kitana, LeatherGloves, SacredManaPotion, EverburnPowder, WoodenSword, MoubooFigurine, FancyHat, LOFCoin, JeansShorts, MinerHat, LeatherShield, Boots, CommonCarp, IcedBottle, ShortBow, CottonShirt, MinerGloves, LoveLetter, LegendaryTortuga, ChocolateDye; + + tradertype(NST_CUSTOM); + // Okay, so for the catalog + /* Some important prices + Crystallized Maggot - 1,200 pts + Light Green Diamond - 1,176 pts + Amethyst - 384 pts + TL;DR From 12 to 1200 pts */ + + // Hats Price Factor: ×10 + sellitem HeartNecklace, 12500; + sellitem MoubiHat, 12500; + sellitem BloodyMoubooHat, 12250; + sellitem AlphaMoubooHat, 12200; + sellitem MoubooHat, 12000; + sellitem AntlersHat, 12000; + sellitem FluffyHat, 12000; + sellitem ShroomHat, 12000; + sellitem CaveSnakeHat, 12000; + sellitem SantaBeardHat, 12000; + sellitem MushHat, 12000; + sellitem ForestShroomHat, 12000; + sellitem PinkieHat, 12000; + sellitem WickedShroomHat, 12000; + sellitem MoonshroomHat, 12000; + sellitem TerraniteMask, 12000; + sellitem DragonStar, 12000; + sellitem Kanabo, 12000; + sellitem FourLeafClover, 12000; + sellitem IceGladius, 12000; + + // Non Hats are cheaper + sellitem Bloodstone, 10000; + sellitem Butterfly, 10000; + sellitem CrystallizedMaggot, 10000; + sellitem PirateTreasureMap, 10000; + sellitem BlueManaPearl, 10000; + sellitem DesertTablet, 10000; + sellitem LavaManaPearl, 10000; + sellitem LightGreenDiamond, 10000; + sellitem BlackPearl, 10000; + + // "Kinda generic" + sellitem BanditPants, 7500; + sellitem CentaurSpear, 7500; + sellitem DarkDesertMushroom, 7500; + sellitem SkullMask, 7500; + sellitem BunnyEars, 7500; + sellitem Quill, 7500; + sellitem CopperKey, 7500; + //sellitem TerraniteBlueprint, 7500; + sellitem SilverMirror, 7500; + sellitem GoldenApple, 7500; + sellitem SaxsoKey, 1200; + + // Not drops + sellitem StrangeCoin, 1000; + sellitem BottleOfDivineWater, 600; + sellitem Curshroom, 300; end; + +OnCountFunds: + setcurrency(AETHYR_PTS); + end; + +/* @price is total cost. @points is if we accept two items as currency. */ +OnPayFunds: + if( AETHYR_PTS < @price ) + end; + AETHYR_PTS -= @price; + purchaseok(); + end; + } -- cgit v1.2.3-60-g2f50