landsandboat/scripts/commands/provokeall.lua
claywar 55de6a5440
Fix issues reported in command scripts
Additional nil checks
2024-08-25 12:01:53 -04:00

26 lines
535 B
Lua

-----------------------------------
-- func: provokeall
-- desc: Makes all enemies in the current zone target you and sets their TP to 3000.
-----------------------------------
---@type TCommand
local commandObj = {}
commandObj.cmdprops =
{
permission = 1,
parameters = ''
}
commandObj.onTrigger = function(player)
local zone = player:getZone()
if not zone then
return
end
for _, mob in pairs(zone:getMobs()) do
mob:updateEnmity(player)
mob:setTP(3000)
end
end
return commandObj