From d7c60f32b33c03ad0f64d318c4980750910e2002 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 8 Jan 2021 16:49:09 -0300 Subject: Ladies and Gentleman, allow me to present you Ihclot, the insanely expensive and extremely expertise craftsmaster blacksmith. They will take over Tolchi in FI. Their minimum wage is 415k GP for a level 50 equip with lv 10 options. Maximum wage is 33 millions for a level 100 equip with lv 100 options. Totally unbalanced, see --- npc/craft/options.txt | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'npc/craft/options.txt') diff --git a/npc/craft/options.txt b/npc/craft/options.txt index 3928adff1..b023a1e19 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -636,6 +636,66 @@ function script csys_Apply { return; } +// Attribute perfect item options +// For Fortress Island only +// csys_ApplyPerfect( invindex, lvl{, scope} ) +function script csys_ApplyPerfect { + .@id=getarg(0); + .@lv=getarg(1); + .@sc=getarg(2, CRAFTSYS_CURRENT); + + // Generate lists, disregarding level + csys_Generate(.@sc); + // @csys_attr → Available attributes + // @csys_penalty → Penalty attribute array + + // Remove weapon-only bonuses if it is armor + delinventorylist(); + getinventorylist(); + .@itemid=@inventorylist_id[.@id]; + if (getiteminfo(.@itemid, ITEMINFO_TYPE) != IT_WEAPON) + csys_ArmorFix(.@itemid); + else + csys_WeaponFix(.@itemid); + .@eqplv=getiteminfo(.@itemid, ITEMINFO_ELV); + + // Shuffle the arrays + array_shuffle(@csys_attr); + array_shuffle(@csys_penalty); + + // How many bonuses we'll have? Never more than 3 bonus and 2 onus. + .@max_attr=getarraysize(@csys_attr); + .@max_pena=getarraysize(@csys_penalty); + + if ($@GM_OVERRIDE) + debugmes "ApplyPerfect: We have %d attributes and %d penalties", + .@max_attr, .@max_pena; + + .@slot=0; + while (.@slot < min(3, .@max_attr)) { + // Apply a bonus using array_pop (it was shuffled so we're fine) + .@vartp=array_pop(@csys_attr); + .@bonus=csys_BonusCalc(10, .@lv, .@vartp, .@eqplv); + setitemoptionbyindex(.@id, .@slot, .@vartp, .@bonus); + //debugmes "Bonus applied: %d at %d (slot: %d)", .@vartp, .@bonus, .@slot; + .@slot+=1; + } + + if (.@max_pena) { + // Apply a malus using array_pop (it was shuffled so we're fine) + .@vartp=array_pop(@csys_penalty); + .@malus=csys_BonusCalc(10, .@lv, .@vartp); + .@malus=.@malus*70/100; + if (.@vartp > 0 && .@malus > 0) + setitemoptionbyindex(.@id, .@slot, .@vartp, -(.@malus)); + .@slot+=1; + } + + // The options have been attributed, clear temporary variables + @csysArmor=false; + return; +} + -- cgit v1.2.3-60-g2f50