summaryrefslogtreecommitdiff
path: root/npc/005-4
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-01-25 18:03:12 -0300
committerJesusaves <cpntb1@ymail.com>2020-01-25 18:03:12 -0300
commit3840fe22259022e6f02f9bb767bb2802de0325a3 (patch)
treefcd6aecbaabff86e3c86cf1da58f4751e75a33f2 /npc/005-4
parenta85d33d5255c3028334834a68fae47f9e3b79d9c (diff)
downloadserverdata-3840fe22259022e6f02f9bb767bb2802de0325a3.tar.gz
serverdata-3840fe22259022e6f02f9bb767bb2802de0325a3.tar.bz2
serverdata-3840fe22259022e6f02f9bb767bb2802de0325a3.tar.xz
serverdata-3840fe22259022e6f02f9bb767bb2802de0325a3.zip
*Cough cough* I present to yall, Tolchi Special Requests system.
The latest, newest, most powerful money sink on the whole game. It beats lottery with so much grace and efficiency! Dear Saulc.
Diffstat (limited to 'npc/005-4')
-rw-r--r--npc/005-4/tolchi.txt94
1 files changed, 94 insertions, 0 deletions
diff --git a/npc/005-4/tolchi.txt b/npc/005-4/tolchi.txt
index 133e6a3fe..117ae7ad8 100644
--- a/npc/005-4/tolchi.txt
+++ b/npc/005-4/tolchi.txt
@@ -20,6 +20,7 @@
function quest_second;
function quest_third;
function tolchi_arrows;
+ function tolchi_tweaks;
/////////////////////////////////////////////////////////////////////////////
@q = getq(CandorQuest_Tolchi);
@@ -61,6 +62,9 @@
case 4:
quest_third();
break;
+ case 5:
+ tolchi_tweaks();
+ break;
default:
quest_close();
goodbye;
@@ -230,6 +234,96 @@ function tolchi_arrows {
close;
}
+// Supreme Tweaking
+function tolchi_tweaks {
+ // Price: the sky is the limit
+ .@price=max(120, 200-(@q*25));
+ mesn;
+ mes l("Hmm, no, not really. However, I can try my hand at tweaking an item options :3");
+ next;
+ mesn;
+ mesq l("Options are %s. Any craftsman can make them. Adventurers tend to be the best craftsman in the world.", b(l("item dependant bonuses")));
+ next;
+ mesn;
+ mesq l("Usually you can only tweak if the item already have another option, but I am Tolchi. So, which item you want to tweak?");
+ next;
+
+ // Request and confirm
+ .@id=requestitemindex();
+ if (!csys_Confirm(.@id))
+ return false;
+
+ // Find numeric ID
+ delinventorylist();
+ getinventorylist();
+ .@handle=@inventorylist_id[.@id];
+
+ // Multiple
+ if (countitem(.@handle) != 1) {
+ mesn;
+ mesq l("Sorry, but you have multiple %s.", getitemlink(.@handle));
+ close;
+ }
+
+ // Calculate price
+ .@lv=getiteminfo(.@handle, ITEMINFO_ELV);
+ .@price=.@lv**3; // Cubic function to determine price.
+ // Lv 1: 3 GP | Lv 10: 1kGP | Lv 20: 8kGP | Lv 40: 64kGP | Lv 60: 216kGP
+ // Lv 80: 512k GP | Lv 100: 1 Million GP!
+ mesn;
+ mesq l("That will be %s GP. Are you sure?", col(format_number(.@price), 1));
+ next;
+
+ if (Zeny < .@price || askyesno() == ASK_NO) {
+ close2;
+ goodbye;
+ } else {
+ mes "";
+ // Okay, time to force a tweaking
+ Zeny=Zeny-.@price;
+
+ // Options which Tolchi knows
+ setarray .@vartps, 0,
+ IOPT_RICHNESS, 11,
+ IOPT_EXPGAIN, 9,
+ IOPT_CRITDMG, 25,
+ VAR_HPACCELERATION, 30,
+ VAR_MAXHPAMOUNT, 35;
+
+ // Select a bonus and purge it
+ .@vartp=relative_array_random(.@vartps);
+ .@popindex=getarrayindex(.@vartp);
+ deletearray(.@popindex, 1);
+ deletearray(.@popindex, 1);
+
+ // Apply the bonus
+ setitemoptionbyindex(.@id, 0, .@vartp, .@bonus);
+
+ // Re-roll: Easier for lower levels. Equip based.
+ if (rand2(1000) < 250-(.@lv*2)) {
+ .@vartp=relative_array_random(.@vartps);
+ .@popindex=getarrayindex(.@vartp);
+ deletearray(.@popindex, 1);
+ deletearray(.@popindex, 1);
+ setitemoptionbyindex(.@id, 1, .@vartp, .@bonus);
+ }
+
+ // Final re-roll: Easier for lower levels. Equip based. Nearly impossible.
+ if (rand2(10000) < 250-(.@lv*2)) {
+ .@vartp=relative_array_random(.@vartps);
+ .@popindex=getarrayindex(.@vartp);
+ deletearray(.@popindex, 1);
+ deletearray(.@popindex, 1);
+ setitemoptionbyindex(.@id, 1, .@vartp, .@bonus);
+ }
+
+ mesn;
+ mesc l("Well, here you are. I hope you enjoy ^^", 3);
+ close;
+ }
+ close;
+}
+
OnTimer1000:
domovestep;