diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-01-29 01:03:03 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-01-29 01:03:03 -0300 |
commit | 331dedfce9a805c6b46e23495e25ae701452eecc (patch) | |
tree | cd4d918c72a4c1bcca6c80357390da4578a54d00 /npc/005-4/tolchi.txt | |
parent | 36c45b01efbf74e8fbdcc2eb312b6c910f49a3f2 (diff) | |
download | serverdata-331dedfce9a805c6b46e23495e25ae701452eecc.tar.gz serverdata-331dedfce9a805c6b46e23495e25ae701452eecc.tar.bz2 serverdata-331dedfce9a805c6b46e23495e25ae701452eecc.tar.xz serverdata-331dedfce9a805c6b46e23495e25ae701452eecc.zip |
Tolchi: Take in account armor special calculation
Fix a bug of .@bonus not being set.
Fix a bug on Event Equipment
Diffstat (limited to 'npc/005-4/tolchi.txt')
-rw-r--r-- | npc/005-4/tolchi.txt | 17 |
1 files changed, 13 insertions, 4 deletions
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); } |