mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Cleaned up the way a npc ls is set. Added an optimization, no changes are made if it is being set to the same value already set. Added the handler for npc linkshells when they are used.
This commit is contained in:
parent
90e48f9ddd
commit
0d4ed1d1c8
3 changed files with 84 additions and 6 deletions
|
@ -10,13 +10,13 @@ function onTrigger(player, argc, lsId, state)
|
|||
local id = tonumber(lsId) or 0;
|
||||
|
||||
if (state == "alert") then
|
||||
player:SetNpcLS(id, true, true);
|
||||
player:SetNpcLS(id, NPCLS_ALERT);
|
||||
elseif (state == "active") then
|
||||
player:SetNpcLS(id, true, false);
|
||||
player:SetNpcLS(id, NPCLS_ACTIVE);
|
||||
elseif (state == "inactive") then
|
||||
player:SetNpcLS(id, false, true);
|
||||
player:SetNpcLS(id, NPCLS_INACTIVE);
|
||||
elseif (state == "gone") then
|
||||
player:SetNpcLS(id, false, false);
|
||||
player:SetNpcLS(id, NPCLS_GONE);
|
||||
else
|
||||
player:SendMessage(0x20, "", "Invalid state argument");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue