diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-05-06 08:49:16 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-05-06 08:49:16 -0300 |
commit | 117737ce26125cf41a8f6de4b2e7a0fefb4e164f (patch) | |
tree | 8acab91cdcac3552f35fc4dce9812d0d3f6cbdcf /npc | |
parent | a8340975719304b2501c806dde93b746ec1e9e48 (diff) | |
download | serverdata-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')
-rw-r--r-- | npc/commands/grantpower.txt | 57 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
2 files changed, 58 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; +} + 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", |