Cleaned up the new scripting code. Added a helper function to do the yielding automatically. Modified all the scripts to use the new system and added a few new ones.

This commit is contained in:
Filip Maj 2016-06-19 18:52:34 -04:00
parent 51bbf4ae2e
commit 8743042950
28 changed files with 316 additions and 167 deletions

View file

@ -1,25 +1,21 @@
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
player:RunEventFunction("askLogout", player);
end
function onEventUpdate(player, npc, eventStep, menuOptionSelected)
choice = callClientFunction(player, "askLogout", player);
if (menuOptionSelected == 1) then
player:EndEvent();
return;
elseif (menuOptionSelected == 2) then
if (choice == 2) then
player:QuitGame();
elseif (menuOptionSelected == 3) then
elseif (choice == 3) then
player:Logout();
elseif (menuOptionSelected == 4) then
elseif (choice == 4) then
player:SendMessage(33, "", "Heck the bed");
end
end
player:EndEvent();
end