Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1468 from zach2good/addallweaponskills
Browse files Browse the repository at this point in the history
Add !addallweaponskills command
  • Loading branch information
zach2good authored Nov 2, 2020
2 parents bf633e6 + 7988231 commit 3569b95
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions scripts/commands/addallweaponskills.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---------------------------------------------------------------------------------------------------
-- func: addallweaponskills
-- desc: Adds all learned weaponskills to the given target. If no target then to the current player.
---------------------------------------------------------------------------------------------------

cmdprops =
{
permission = 1,
parameters = "s"
}

function error(player, msg)
player:PrintToPlayer(msg)
player:PrintToPlayer("!addallweaponskills {player}")
end

function onTrigger(player, target)

-- validate target
local targ
if target then
targ = GetPlayerByName(target)
if not targ then
error(player, string.format("Player named '%s' not found!", target))
return
end
else
targ = player
end

-- add all learned weaponskills
for i = 1, 48 do
targ:addLearnedWeaponskill(i)
end
player:PrintToPlayer(string.format("%s now has all learned weaponskills.", targ:getName()))
end

0 comments on commit 3569b95

Please sign in to comment.