summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-01-16 22:53:51 -0300
committerJesusaves <cpntb1@ymail.com>2024-01-16 22:53:51 -0300
commit3b9733fa9e62c0fb999c817e93303f26b58d5d13 (patch)
tree827502051b3fd70361ab089784ff72149cf872e3 /npc/commands
parent44b760a134a52d843cec1a3e75fb19301fd8a1de (diff)
downloadserverdata-3b9733fa9e62c0fb999c817e93303f26b58d5d13.tar.gz
serverdata-3b9733fa9e62c0fb999c817e93303f26b58d5d13.tar.bz2
serverdata-3b9733fa9e62c0fb999c817e93303f26b58d5d13.tar.xz
serverdata-3b9733fa9e62c0fb999c817e93303f26b58d5d13.zip
Add extra powerful item manipulation commands
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/rent.txt60
1 files changed, 60 insertions, 0 deletions
diff --git a/npc/commands/rent.txt b/npc/commands/rent.txt
index 2be2ccc61..8417a04e4 100644
--- a/npc/commands/rent.txt
+++ b/npc/commands/rent.txt
@@ -27,8 +27,68 @@ OnCall:
rentitem(.@item, .@time);
end;
+OnCraftBypass:
+ if (getarraysize(.@atcmd_parameters$) < 8) {
+ dispbottom l("Usage: @craft item opt1 val1 opt2 val2 opt3 val3 opt4 val4");
+ end;
+ }
+
+ .@item=atoi(.@atcmd_parameters$[0]);
+ .@opt1=atoi(.@atcmd_parameters$[1]);
+ .@val1=atoi(.@atcmd_parameters$[2]);
+ .@opt2=atoi(.@atcmd_parameters$[3]);
+ .@val2=atoi(.@atcmd_parameters$[4]);
+ .@opt3=atoi(.@atcmd_parameters$[5]);
+ .@val3=atoi(.@atcmd_parameters$[6]);
+ .@opt4=atoi(.@atcmd_parameters$[7]);
+ .@val4=atoi(.@atcmd_parameters$[8]);
+ CsysNpcCraft(.@item, .@opt1, .@val1, .@opt2, .@val2,
+ .@opt3, .@val3, .@opt4, .@val4);
+ end;
+
+OnCraftSuper:
+ if (getarraysize(.@atcmd_parameters$) < 8) {
+ dispbottom l("Usage: @craft2 item refine opt1 val1 opt2 val2 opt3 val3 opt4 val4 opt5 val5");
+ end;
+ }
+ .@item=atoi(.@atcmd_parameters$[0]);
+ .@refi=atoi(.@atcmd_parameters$[1]);
+ .@crd1=atoi(.@atcmd_parameters$[2]);
+ .@crd2=atoi(.@atcmd_parameters$[3]);
+ .@crd3=atoi(.@atcmd_parameters$[4]);
+ .@crd4=atoi(.@atcmd_parameters$[5]);
+ .@opt1=atoi(.@atcmd_parameters$[6]);
+ .@val1=atoi(.@atcmd_parameters$[7]);
+ .@opt2=atoi(.@atcmd_parameters$[8]);
+ .@val2=atoi(.@atcmd_parameters$[9]);
+ .@opt3=atoi(.@atcmd_parameters$[10]);
+ .@val3=atoi(.@atcmd_parameters$[11]);
+ .@opt4=atoi(.@atcmd_parameters$[12]);
+ .@val4=atoi(.@atcmd_parameters$[13]);
+ .@opt5=atoi(.@atcmd_parameters$[14]);
+ .@val5=atoi(.@atcmd_parameters$[15]);
+ getitem(.@item, 1, 1, .@refi, 0, .@crd1, .@crd2, .@crd3, .@crd4);
+ delinventorylist(); // Needed, because we'll rely on rfind()
+ getinventorylist();
+ .@index=array_rfind(@inventorylist_id, .@item);
+
+ // Apply the bonuses if needed
+ if (.@opt1)
+ setitemoptionbyindex(.@index, 0, .@opt1, .@val1);
+ if (.@opt2)
+ setitemoptionbyindex(.@index, 1, .@opt2, .@val2);
+ if (.@opt3)
+ setitemoptionbyindex(.@index, 2, .@opt3, .@val3);
+ if (.@opt4)
+ setitemoptionbyindex(.@index, 3, .@opt4, .@val4);
+ if (.@opt5)
+ setitemoptionbyindex(.@index, 4, .@opt5, .@val5);
+ end;
+
OnInit:
bindatcmd "rentitem", "@rentitem::OnCall", 80, 99, 1;
+ bindatcmd "craft", "@rentitem::OnCraftBypass", 99, 99, 1;
+ bindatcmd "craft2", "@rentitem::OnCraftSuper", 99, 99, 1;
end;
}