summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-06 08:49:16 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-06 08:49:16 -0300
commit117737ce26125cf41a8f6de4b2e7a0fefb4e164f (patch)
tree8acab91cdcac3552f35fc4dce9812d0d3f6cbdcf /npc/commands
parenta8340975719304b2501c806dde93b746ec1e9e48 (diff)
downloadserverdata-117737ce26125cf41a8f6de4b2e7a0fefb4e164f.tar.gz
serverdata-117737ce26125cf41a8f6de4b2e7a0fefb4e164f.tar.bz2
serverdata-117737ce26125cf41a8f6de4b2e7a0fefb4e164f.tar.xz
serverdata-117737ce26125cf41a8f6de4b2e7a0fefb4e164f.zip
@grantpower <someone>
Transfers a legendary weapon. (Except Lightbringer and AegisShield)
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/grantpower.txt57
1 files changed, 57 insertions, 0 deletions
diff --git a/npc/commands/grantpower.txt b/npc/commands/grantpower.txt
new file mode 100644
index 000000000..96a7ac1c2
--- /dev/null
+++ b/npc/commands/grantpower.txt
@@ -0,0 +1,57 @@
+// TMW2 Script
+//
+// @grantpower <username>
+// Grants a legendary weapon to <username>. Cannot be undone.
+// Only way to bypass restrictions on legendary weapons.
+
+- script @grantpower 32767,{
+ end;
+
+OnCall:
+ .@request$ = "";
+ .@request$ += implode(.@atcmd_parameters$, " ");
+
+ // Player is not attached
+ .@id = getcharid(0, .@request$);
+ if (!.@id) {
+ Exception("Player not found.", RB_ISFATAL|RB_DISPBOTTOM);
+ }
+ mes ".:: " + l("Grant Power") + " ::.";
+ mesc l("You're about to transfer a legendary weapon to @@.", .@request$), 1;
+ mesc l("This action CANNOT BE UNDONE."), 1;
+ mes l("Are you sure?");
+ if (askyesno() == ASK_NO)
+ close;
+ mes "";
+ mes ".:: " + l("Grant Power") + " ::.";
+ mes l("Please select the weapon to transfer.");
+ menuint
+ l("None"), 0,
+ rif(countitem(DemureAxe), l("Demure's Axe")), DemureAxe,
+ rif(countitem(Tyranny), l("Tyranny")), Tyranny,
+ rif(countitem(Runestaff), l("Runestaff")), Runestaff,
+ //rif(countitem(AegisShield), l("Aegis Shield")), AegisShield,
+ l("Abort"), 0;
+ mes "";
+ .@ori=getcharid(0);
+ .@ite=@menuret;
+ if (!.@ite)
+ close;
+
+ // Transfer the weapon
+ if (attachrid(.@id)) {
+ getitembound .@ite, 1, 1; // Account bound or char bound? (1 or 4)
+ dispbottom l("You received the @@ from @@.", getitemlink(.@ite), strcharinfo(0, "someone", .@ori));
+ detachrid();
+ attachrid(.@ori);
+ delitem .@ite, 1;
+ } else {
+ Exception("Player not found.", RB_ISFATAL|RB_SPEECH);
+ }
+
+ close;
+
+OnInit:
+ bindatcmd "grantpower", "@grantpower::OnCall", 0, 100, 1;
+}
+