summaryrefslogtreecommitdiff
path: root/npc/craft
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-01-08 16:49:09 -0300
committerJesusaves <cpntb1@ymail.com>2021-01-08 16:49:09 -0300
commitd7c60f32b33c03ad0f64d318c4980750910e2002 (patch)
tree0192257620f85c4fc36983f1aea875866955a637 /npc/craft
parente4f1d1cca6d2f97c19b8e96313814327b8215bbf (diff)
downloadserverdata-d7c60f32b33c03ad0f64d318c4980750910e2002.tar.gz
serverdata-d7c60f32b33c03ad0f64d318c4980750910e2002.tar.bz2
serverdata-d7c60f32b33c03ad0f64d318c4980750910e2002.tar.xz
serverdata-d7c60f32b33c03ad0f64d318c4980750910e2002.zip
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
Diffstat (limited to 'npc/craft')
-rw-r--r--npc/craft/options.txt60
1 files changed, 60 insertions, 0 deletions
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;
+}
+