summaryrefslogtreecommitdiff
path: root/npc/craft/tweak.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-05-26 23:23:32 -0300
committerJesusaves <cpntb1@ymail.com>2020-05-26 23:23:32 -0300
commitc499870528356e28327206fa6380b4ca2d17cab2 (patch)
tree3518b1fc2d6972e435359cf34c3e21ca265dc048 /npc/craft/tweak.txt
parent750ebe84bb822103ae755b45efab471499da4983 (diff)
downloadserverdata-c499870528356e28327206fa6380b4ca2d17cab2.tar.gz
serverdata-c499870528356e28327206fa6380b4ca2d17cab2.tar.bz2
serverdata-c499870528356e28327206fa6380b4ca2d17cab2.tar.xz
serverdata-c499870528356e28327206fa6380b4ca2d17cab2.zip
Tweaking: Try to improve a bit memory and CPU usage
Diffstat (limited to 'npc/craft/tweak.txt')
-rw-r--r--npc/craft/tweak.txt19
1 files changed, 11 insertions, 8 deletions
diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt
index ef1614e3d..35022d1af 100644
--- a/npc/craft/tweak.txt
+++ b/npc/craft/tweak.txt
@@ -60,24 +60,27 @@ function script SmithTweakSystem {
if (!csys_Confirm(.@id))
return false;
- // If the item have no bonuses - fail
- setarray .@AlwaysTweaks, BlacksmithAxe, Dustynator, Lightbringer,
- DemureAxe, Tyranny, Runestaff, AegisShield;
+ // Collect the item ID
delinventorylist();
getinventorylist();
.@x=@inventorylist_id[.@id];
- if (getitemoptionidbyindex(.@id, 0) <= 0 && !is_master() && array_find(.@AlwaysTweaks, .@x) < 0) {
- mesc l("This item have no bonuses, and cannot be tweaked."), 1;
- return false;
- }
-
// No duplicates
if (countitem(.@x) > 1) {
mesc l("You are carrying duplicates of the same item. Sorry, but I have no idea which one you want to tweak."), 1;
return false;
}
+ // If the item have no bonuses - fail
+ setarray .@AlwaysTweaks, BlacksmithAxe, Dustynator, Lightbringer,
+ DemureAxe, Tyranny, Runestaff, AegisShield;
+
+ // Tweaked items
+ if (getitemoptionidbyindex(.@id, 0) <= 0 && !is_master() && array_find(.@AlwaysTweaks, .@x) < 0) {
+ mesc l("This item have no bonuses, and cannot be tweaked."), 1;
+ return false;
+ }
+
// Take the money and AP away
POL_PlayerMoney(.@price);
SMITH_TWEAKS+=1;