mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Pushing new Aetheryte scripts that handle when GL is active. Finally added an error check for some lua callbacks.
This commit is contained in:
parent
019e305525
commit
c071b9d684
@ -112,10 +112,18 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
if (mSleepingOnPlayerEvent.ContainsKey(player.actorId))
|
if (mSleepingOnPlayerEvent.ContainsKey(player.actorId))
|
||||||
{
|
{
|
||||||
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
try
|
||||||
mSleepingOnPlayerEvent.Remove(player.actorId);
|
{
|
||||||
DynValue value = coroutine.Resume(LuaUtils.CreateLuaParamObjectList(args));
|
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
||||||
ResolveResume(null, coroutine, value);
|
mSleepingOnPlayerEvent.Remove(player.actorId);
|
||||||
|
DynValue value = coroutine.Resume(LuaUtils.CreateLuaParamObjectList(args));
|
||||||
|
ResolveResume(null, coroutine, value);
|
||||||
|
}
|
||||||
|
catch (ScriptRuntimeException e)
|
||||||
|
{
|
||||||
|
LuaEngine.SendError(player, String.Format("OnEventUpdated: {0}", e.DecoratedMessage));
|
||||||
|
player.EndEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player.EndEvent();
|
player.EndEvent();
|
||||||
@ -364,9 +372,17 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
if (mSleepingOnPlayerEvent.ContainsKey(player.actorId))
|
if (mSleepingOnPlayerEvent.ContainsKey(player.actorId))
|
||||||
{
|
{
|
||||||
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
||||||
mSleepingOnPlayerEvent.Remove(player.actorId);
|
mSleepingOnPlayerEvent.Remove(player.actorId);
|
||||||
DynValue value = coroutine.Resume();
|
|
||||||
ResolveResume(null, coroutine, value);
|
try{
|
||||||
|
DynValue value = coroutine.Resume();
|
||||||
|
ResolveResume(null, coroutine, value);
|
||||||
|
}
|
||||||
|
catch (ScriptRuntimeException e)
|
||||||
|
{
|
||||||
|
LuaEngine.SendError(player, String.Format("OnEventStarted: {0}", e.DecoratedMessage));
|
||||||
|
player.EndEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CallLuaFunction(player, target, "onEventStarted", false, LuaUtils.CreateLuaParamObjectList(lparams));
|
CallLuaFunction(player, target, "onEventStarted", false, LuaUtils.CreateLuaParamObjectList(lparams));
|
||||||
|
@ -22,16 +22,40 @@ eventGLJoin () - Ask to join party leader's leve
|
|||||||
require ("global")
|
require ("global")
|
||||||
require ("aetheryte")
|
require ("aetheryte")
|
||||||
require ("utils")
|
require ("utils")
|
||||||
|
require ("guildleve")
|
||||||
|
|
||||||
function init(npc)
|
function init(npc)
|
||||||
return false, false, 0, 0;
|
return false, false, 0, 0;
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventStarted(player, aetheryte, triggerName)
|
function onEventStarted(player, aetheryte, triggerName)
|
||||||
|
|
||||||
|
if (player:GetGuildleveDirector() ~= nil) then
|
||||||
|
doGuildleveMenu(player, aetheryte);
|
||||||
|
else
|
||||||
|
doNormalMenu(player, aetheryte);
|
||||||
|
end
|
||||||
|
|
||||||
|
player:EndEvent();
|
||||||
|
end
|
||||||
|
|
||||||
aetheryteId = aetheryte:GetActorClassId();
|
function doGuildleveMenu(player, aetheryte)
|
||||||
parentNode = aetheryteChildLinks[aetheryteId];
|
|
||||||
menuChoice = callClientFunction(player, "eventAetheryteChildSelect", true, parentNode, 100, 1);
|
local currentGLDirector = player:GetGuildleveDirector();
|
||||||
|
local choice = callClientFunction(player, "eventGLPlay", currentGLDirector.guildleveId, true, 1, 500, 400, guardian, 8, currentGLDirector.selectedDifficulty, 2);
|
||||||
|
|
||||||
|
--Abandon
|
||||||
|
if (choice == 6) then
|
||||||
|
currentGLDirector:AbandonGuildleve();
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function doNormalMenu(player, aetheryte)
|
||||||
|
|
||||||
|
local aetheryteId = aetheryte:GetActorClassId();
|
||||||
|
local parentNode = aetheryteChildLinks[aetheryteId];
|
||||||
|
local menuChoice = callClientFunction(player, "eventAetheryteChildSelect", true, parentNode, 100, 1);
|
||||||
|
|
||||||
--Teleport
|
--Teleport
|
||||||
if (menuChoice == 2) then
|
if (menuChoice == 2) then
|
||||||
@ -57,22 +81,36 @@ function onEventStarted(player, aetheryte, triggerName)
|
|||||||
player:SendGameMessage(player, aetheryte, 29, 0x20, 2, 10);
|
player:SendGameMessage(player, aetheryte, 29, 0x20, 2, 10);
|
||||||
player:SendGameMessage(player, aetheryte, 30, 0x20, 3, 5);
|
player:SendGameMessage(player, aetheryte, 30, 0x20, 3, 5);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:EndEvent();
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function doLevequestInit(player, aetheryte)
|
function doLevequestInit(player, aetheryte)
|
||||||
|
local worldMaster = GetWorldMaster();
|
||||||
::SELECT_LOOP::
|
::SELECT_LOOP::
|
||||||
unknown, glId = callClientFunction(player, "eventGLSelect", 0x0);
|
unknown, glId = callClientFunction(player, "eventGLSelect", 0x0);
|
||||||
if (glId ~= 0) then
|
if (glId ~= 0) then
|
||||||
::SELECT_DETAIL::
|
::SELECT_DETAIL::
|
||||||
unknown, begin = callClientFunction(player, "eventGLSelectDetail", glId, 0xa, 0xf4241, 1000, 0, 0, 0, true, false);
|
guildleveData = GetGuildleveGamedata(glId);
|
||||||
|
|
||||||
|
if (guildleveData == nil) then
|
||||||
|
player:SendMessage(0x20, "", "An error has occured... aborting.");
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
|
unknown, begin = callClientFunction(player, "eventGLSelectDetail", glId, 0xa, 0xf4241, 1000, 0, 0, 0, true, false);
|
||||||
if (begin) then
|
if (begin) then
|
||||||
::SELECT_DIFFICULTY::
|
::SELECT_DIFFICULTY::
|
||||||
|
player:SendGameMessage(worldMaster, 50014, 0x20); --"Please select a difficulty level. This may be lowered later."
|
||||||
difficulty = callClientFunction(player, "eventGLDifficulty", glId);
|
difficulty = callClientFunction(player, "eventGLDifficulty", glId);
|
||||||
if (difficulty == nil) then goto SELECT_DETAIL; end
|
if (difficulty == nil) then goto SELECT_DETAIL; end
|
||||||
confirmResult = callClientFunction(player, "eventGLStart", glId, difficulty, 1, 10, 20, 0, 0, 0, 0);
|
confirmResult = callClientFunction(player, "eventGLStart", glId, difficulty, 1, 10, 20, 0, 0, 0, 0);
|
||||||
if (confirmResult == nil) then goto SELECT_DIFFICULTY; else
|
if (confirmResult == nil) then goto SELECT_DIFFICULTY; else
|
||||||
|
|
||||||
|
player:SendGameMessage(worldMaster, 50036, 0x20, glId, player);
|
||||||
|
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));
|
||||||
|
director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player);
|
||||||
|
player:AddDirector(director);
|
||||||
|
director:StartDirector(true, glId)
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
goto SELECT_LOOP;
|
goto SELECT_LOOP;
|
||||||
|
@ -11,9 +11,8 @@ eventGLSelect(?) - Open GL selector
|
|||||||
eventGLSelectDetail(glid, ?, reward, rewardQuantity, subreward, subrewardQuantity, faction, ?, completed) - Show GL details
|
eventGLSelectDetail(glid, ?, reward, rewardQuantity, subreward, subrewardQuantity, faction, ?, completed) - Show GL details
|
||||||
eventGLDifficulty() - Open difficulty selector
|
eventGLDifficulty() - Open difficulty selector
|
||||||
eventGLStart(glId, difficulty, evaluatingFaction, areaFactionStanding, factionReward, warningBoundByDuty, warningTooFar, warningYouCannotRecieve, warningChangingClass) - Confirmation dialog
|
eventGLStart(glId, difficulty, evaluatingFaction, areaFactionStanding, factionReward, warningBoundByDuty, warningTooFar, warningYouCannotRecieve, warningChangingClass) - Confirmation dialog
|
||||||
|
|
||||||
eventGLBoost(currentFavor, minNeeded) - Ask player for Guardian Aspect
|
eventGLBoost(currentFavor, minNeeded) - Ask player for Guardian Aspect
|
||||||
eventGLPlay(??) - Open Menu (GL active version)
|
eventGLPlay(glId, showLeveLink, leveLinkFaction, leveLinkFactionStanding, leveLinkReward, guardianFavorAmount, guardianFavorNeeded, currentDifficulty, jobNameForChange) - Open Menu (GL active version)
|
||||||
eventGLReward (glId, clearTime, missionBonus, difficultyBonus, factionNumber, factionBonus, factionCredit, reward, rewardQuantity, subreward, subrewardQuantity, difficulty) - Open reward window
|
eventGLReward (glId, clearTime, missionBonus, difficultyBonus, factionNumber, factionBonus, factionCredit, reward, rewardQuantity, subreward, subrewardQuantity, difficulty) - Open reward window
|
||||||
eventGLJoin () - Ask to join party leader's leve
|
eventGLJoin () - Ask to join party leader's leve
|
||||||
|
|
||||||
@ -33,7 +32,30 @@ function init(npc)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function onEventStarted(player, aetheryte, triggerName)
|
function onEventStarted(player, aetheryte, triggerName)
|
||||||
|
|
||||||
|
if (player:GetGuildleveDirector() ~= nil) then
|
||||||
|
doGuildleveMenu(player, aetheryte);
|
||||||
|
else
|
||||||
|
doNormalMenu(player, aetheryte);
|
||||||
|
end
|
||||||
|
|
||||||
|
player:EndEvent();
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function doGuildleveMenu(player, aetheryte)
|
||||||
|
|
||||||
|
local currentGLDirector = player:GetGuildleveDirector();
|
||||||
|
local choice = callClientFunction(player, "eventGLPlay", currentGLDirector.guildleveId, true, 1, 500, 400, guardian, 8, currentGLDirector.selectedDifficulty, 2);
|
||||||
|
|
||||||
|
--Abandon
|
||||||
|
if (choice == 6) then
|
||||||
|
currentGLDirector:AbandonGuildleve();
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function doNormalMenu(player, aetheryte)
|
||||||
local aetheryteId = aetheryte:GetActorClassId();
|
local aetheryteId = aetheryte:GetActorClassId();
|
||||||
local childNodes = aetheryteParentLinks[aetheryteId];
|
local childNodes = aetheryteParentLinks[aetheryteId];
|
||||||
|
|
||||||
@ -94,9 +116,6 @@ function onEventStarted(player, aetheryte, triggerName)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
player:EndEvent();
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function doLevequestInit(player, aetheryte)
|
function doLevequestInit(player, aetheryte)
|
||||||
@ -119,10 +138,14 @@ function doLevequestInit(player, aetheryte)
|
|||||||
difficulty = callClientFunction(player, "eventGLDifficulty", glId);
|
difficulty = callClientFunction(player, "eventGLDifficulty", glId);
|
||||||
if (difficulty == nil) then goto SELECT_DETAIL; end
|
if (difficulty == nil) then goto SELECT_DETAIL; end
|
||||||
confirmResult = callClientFunction(player, "eventGLStart", glId, difficulty, 1, guildleveData.favorCount, 20, 0, 0, 0, 0);
|
confirmResult = callClientFunction(player, "eventGLStart", glId, difficulty, 1, guildleveData.favorCount, 20, 0, 0, 0, 0);
|
||||||
if (confirmResult == nil) then goto SELECT_DIFFICULTY; else
|
if (confirmResult == nil) then goto SELECT_DIFFICULTY; else
|
||||||
director = player:GetZone():CreateGuildleveDirector("Guildleve/PrivateGLBattleTutorial", glId);
|
|
||||||
|
player:SendGameMessage(worldMaster, 50036, 0x20, glId, player);
|
||||||
|
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));
|
||||||
|
director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player);
|
||||||
player:AddDirector(director);
|
player:AddDirector(director);
|
||||||
director:StartDirector(true, glId)
|
director:StartDirector(true, glId)
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
goto SELECT_LOOP;
|
goto SELECT_LOOP;
|
||||||
|
Loading…
Reference in New Issue
Block a user