From 117737ce26125cf41a8f6de4b2e7a0fefb4e164f Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 6 May 2019 08:49:16 -0300 Subject: @grantpower Transfers a legendary weapon. (Except Lightbringer and AegisShield) --- npc/commands/grantpower.txt | 57 +++++++++++++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 2 files changed, 58 insertions(+) create mode 100644 npc/commands/grantpower.txt (limited to 'npc') 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 +// Grants a legendary weapon to . 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; +} + diff --git a/npc/scripts.conf b/npc/scripts.conf index e5d30d959..c54a5d9f1 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -84,6 +84,7 @@ "npc/commands/debug-quest.txt", "npc/commands/debug.txt", "npc/commands/discord.txt", +"npc/commands/grantpower.txt", "npc/commands/ipcheck.txt", "npc/commands/language.txt", "npc/commands/mobinfo.txt", -- cgit v1.2.3-60-g2f50