From 331dedfce9a805c6b46e23495e25ae701452eecc Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 29 Jan 2020 01:03:03 -0300 Subject: Tolchi: Take in account armor special calculation Fix a bug of .@bonus not being set. Fix a bug on Event Equipment --- npc/005-4/tolchi.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'npc/005-4/tolchi.txt') diff --git a/npc/005-4/tolchi.txt b/npc/005-4/tolchi.txt index 417a3e47c..a2c2c0f33 100644 --- a/npc/005-4/tolchi.txt +++ b/npc/005-4/tolchi.txt @@ -292,37 +292,46 @@ function tolchi_tweaks { Zeny=Zeny-.@price; // Options which Tolchi knows - setarray .@vartps, 0, + setarray @csys_attr, 0, IOPT_RICHNESS, 11, IOPT_EXPGAIN, 9, IOPT_CRITDMG, 25, VAR_HPACCELERATION, 30, VAR_MAXHPAMOUNT, 35; + // Armor fix + if (getiteminfo(.@handle, ITEMINFO_TYPE) == IT_ARMOR) { + csys_ArmorFix(); + .@lv=max(1, .@lv/4); + } + // Select a bonus and purge it - .@vartp=relative_array_random(.@vartps); + .@vartp=relative_array_random(@csys_attr); .@popindex=getarrayindex(.@vartp); deletearray(.@popindex, 1); deletearray(.@popindex, 1); // Apply the bonus + .@bonus=csys_Multiplier(.@lv); setitemoptionbyindex(.@id, 0, .@vartp, .@bonus); // Re-roll: Easier for lower levels. Equip based. if (rand2(1000) < 250-(.@lv*2)) { - .@vartp=relative_array_random(.@vartps); + .@vartp=relative_array_random(@csys_attr); .@popindex=getarrayindex(.@vartp); deletearray(.@popindex, 1); deletearray(.@popindex, 1); + .@bonus=csys_Multiplier(.@lv); 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); + .@vartp=relative_array_random(@csys_attr); .@popindex=getarrayindex(.@vartp); deletearray(.@popindex, 1); deletearray(.@popindex, 1); + .@bonus=csys_Multiplier(.@lv); setitemoptionbyindex(.@id, 1, .@vartp, .@bonus); } -- cgit v1.2.3-60-g2f50