diff options
author | Jesusaves <cpntb1@ymail.com> | 2025-06-19 18:16:38 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2025-06-19 18:16:38 -0300 |
commit | 2a84f9fdf415b7892bb98a9d680b2a301f194df2 (patch) | |
tree | b9dee12007747118631dd541b89f7328393d1c53 | |
parent | 902ac49c820a7eb5d01327c9169430319593753d (diff) | |
download | serverdata-2a84f9fdf415b7892bb98a9d680b2a301f194df2.tar.gz serverdata-2a84f9fdf415b7892bb98a9d680b2a301f194df2.tar.bz2 serverdata-2a84f9fdf415b7892bb98a9d680b2a301f194df2.tar.xz serverdata-2a84f9fdf415b7892bb98a9d680b2a301f194df2.zip |
Initial version of Lydon, which will never go live
-rw-r--r-- | npc/003-1/shop.txt | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/npc/003-1/shop.txt b/npc/003-1/shop.txt index 7cc8ecd74..f8a1f831a 100644 --- a/npc/003-1/shop.txt +++ b/npc/003-1/shop.txt @@ -136,6 +136,13 @@ function script BazaarToggle { .@lof = ($BAZAAR_TIMER / BAZAARFREQ) % 2; if (getarg(0)) { // Begin the Bazaar! + // Special Vendor + enablenpc "Lydon"; + .@gid = getnpcid("Lydon"); + if (.@lof) + unitwarp(.@gid, "017-1", 183, 168); + else + unitwarp(.@gid, "003-1", 108, 109); // Esperia Vendor enablenpc "Foreign Tiki"; .@gid = getnpcid("Foreign Tiki"); @@ -198,6 +205,7 @@ function script BazaarToggle { unitwarp(.@gid, "003-1", 106, 112); } else { // Close the Bazaar! + disablenpc "Lydon"; disablenpc "Foreign Tiki"; disablenpc "Candor Vendor"; disablenpc "Hurnscald Vendor"; @@ -210,6 +218,110 @@ function script BazaarToggle { return; } + +// Special Vendor +003-1,108,109,0 script Lydon NPC_LYDON,{ + function refreshRates; + if ($GAME_STORYLINE < 4) goto L_NoDice; + if (.cache < gettimeparam(GETTIME_DAYOFMONTH)) refreshRates(); + if (.mpt < 10 || .apt < 10 || .rpt < 10) Exception("Lydon compromised, administrator intervention strictly required.", RB_ISFATAL|RB_IRCBROADCAST); + mesn; + mesq l("Hello, my name is Lydon and I sell sanctioned Points. In practice, I hire mercenaries, miners and researchers, and share with you some of their results."); + mesc l("You can still spend %s GP at the Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR)); + next; + mesn; + mes l("Current Aethyr Point rate is %s GP per thousand.", fnum(.apt*1000)); + mes l("Current Monster Point rate is %s GP per thousand.", fnum(.mpt*1000)); + mes l("Current Research Point rate is %s GP per thousand.", fnum(.rpt*1000)); + next; + select + l("Thanks but bye."), + l("Purchase Aethyr Points"), + l("Purchase Monster Points"), + l("Purchase Research Points"); + mes ""; + switch (@menu) { + case 2: + mes l("How many? (0-%s)", fnum(Zeny / .apt)); + input .@c, 0, (Zeny / .apt); + @price = .@c * .apt; + BazaarPurchase(); + AETHYR_PTS += .@c; + break; + case 3: + mes l("How many? (0-%s)", fnum(Zeny / .mpt)); + input .@c, 0, (Zeny / .mpt); + @price = .@c * .mpt; + BazaarPurchase(); + Mobpt += .@c; + break; + case 4: + mes l("How many? (0-%s)", fnum(Zeny / .rpt)); + input .@c, 0, (Zeny / .rpt); + @price = .@c * .rpt; + BazaarPurchase(); + MAGIC_RP += .@c; + break; + default: + closeclientdialog; + } + close; + +L_NoDice: + mesn; + mesq l("Hey, welcome to the Bazaar! I hope you enjoy your time here."); + mesc l("You can still spend %s GP at the Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR)); + mes l("* This limit is not shared between different editions of the Bazaar."); + close; + +// Determine the rates, and also if an update is necessary +// (It's updated every two days) +function refreshRates { + .cache = gettimeparam(GETTIME_DAYOFMONTH) + 1; + query_sql("SELECT SUM(`value`) FROM char_reg_num_db WHERE `key` = 'Mobpt' LIMIT 1", .mpt); + query_sql("SELECT SUM(`value`) FROM char_reg_num_db WHERE `key` = 'MAGIC_RP' LIMIT 1", .rpt); + query_sql("SELECT SUM(`value`) FROM char_reg_num_db WHERE `key` = 'AETHYR_PTS' LIMIT 1", .apt); + //query_sql("SELECT SUM(`value`) FROM char_reg_num_db WHERE `key` = 'PC_DIE_COUNTER' LIMIT 1", .rpt); // MonsterMoney REBIRTH skillInvoke ? + + debugmes "There are %s aethyr points in the world", fnum(.apt); + debugmes "There are %s monster points in the world", fnum(.mpt); + debugmes "There are %s research points in the world", fnum(.rpt); + + // log2() can go from -1 to 30 + // So we start by making the price range from 12 to 42 GP per point + // (we also destroy the variable) + .apt = 42 - abs(log2(.apt)); + .rpt = 42 - abs(log2(.rpt)); + .mpt = 42 - abs(log2(.mpt)); + // Now we factor storyline, +2 gp/pt per each incomplete act + .apt += 10 - (min($GAME_STORYLINE, 5) * 2); + .rpt += 10 - (min($GAME_STORYLINE, 5) * 2); + .mpt += 10 - (min($GAME_STORYLINE, 5) * 2); + // Now we add 5 gp for the dynamic rebirth bonus factor + // And we add another 3gp to cover for general administrative expenses + // And stabilize the price if anything went wrong (it can't go lower than 12) + .apt = 8 + max(.apt, 12); + .rpt = 8 + max(.apt, 12); + .mpt = 8 + max(.apt, 12); + // The prices therefore range from 15gp to 60gp per point + // However, Research Points and Aethyr Points are more valuable. And thus + .rpt *= 2; + .apt = .apt * 7 / 2; // *= 3.5 + return; +} + +OnInit: + .sex = G_FEMALE; + .distance = 3; + + // Determine the rates, and also if an update is necessary + refreshRates(); + + disablenpc .name$; + end; +} + + // Esperia Vendor 003-1,98,110,0 script Foreign Tiki NPC_TIKI,{ mesn; |