This repository has been archived by the owner on Dec 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1468 from zach2good/addallweaponskills
Add !addallweaponskills command
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |