Added homepoint and aetheryte code. You can set the homepoint on an aetheryte or inn and the return menu will show the correct response. Added effects/msgs to teleport/return. Some sql changes I forgot.

This commit is contained in:
Filip Maj 2017-05-01 22:30:43 -04:00
parent 8c9ecebae6
commit 1516e0bc50
18 changed files with 481 additions and 140 deletions

View file

@ -12,10 +12,10 @@ eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly)
require ("global")
function doTeleport(region, aetheryte)
end
function onEventStarted(player, actor, triggerName, isTeleport)
local worldMaster = GetWorldMaster();
if (isTeleport == 0) then
while (true) do
regionChoice = callClientFunction(player, "delegateCommand", actor, "eventRegion", 100);
@ -27,45 +27,33 @@ function onEventStarted(player, actor, triggerName, isTeleport)
if (aetheryteChoice == nil) then break end
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
player:PlayAnimation(0x4000FFA);
player:SendGameMessage(worldMaster, 34101, 0x20, 2, 0x13883d, 100, 100);
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
if (confirmChoice == 1) then
doTeleport(regionChoice, aetheryteChoice);
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34105, 0x20);
--Do teleport
end
player:endEvent();
return;
end
end
else
callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, 1, 0x138824, false);
player:PlayAnimation(0x4000FFA);
local choice, wasMulti = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);
if (wasMulti and choice == 1 or choice == 2) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20);
--Do return
elseif (not wasMulti and choice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20);
--Do return
end
end
player:endEvent();
end
function onEventUpdate(player, actor, step, arg1)
menuId = player:GetCurrentMenuId();
if (menuId == 0) then --Region
if (arg1 ~= nil and arg1 >= 1) then
player:SetCurrentMenuId(1);
player:RunEventFunction("delegateCommand", actor, "eventAetheryte", arg1, 2, 2, 2, 4, 4, 4);
else
player:EndCommand();
end
elseif (menuId == 1) then --Aetheryte
if (arg1 == nil) then
player:EndCommand();
return;
end
player:SetCurrentMenuId(2);
player:RunEventFunction("delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
elseif (menuId == 2) then --Confirm
player:EndCommand();
end
end
end