mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 14:04:41 +02:00
Updated Map Server namespace. Moved all other data folders (www and sql) to data folder. Renamed boot name to Project Meteor.
This commit is contained in:
parent
18ef69f3d1
commit
91549bff7a
1823 changed files with 102704 additions and 901 deletions
5
Data/scripts/base/chara/npc/object/BgKeepout.lua
Normal file
5
Data/scripts/base/chara/npc/object/BgKeepout.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
10
Data/scripts/base/chara/npc/object/BookShelf.lua
Normal file
10
Data/scripts/base/chara/npc/object/BookShelf.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
callClientFunction(player, "bookTalk");
|
||||
player:EndEvent();
|
||||
end
|
5
Data/scripts/base/chara/npc/object/ElevatorStandard.lua
Normal file
5
Data/scripts/base/chara/npc/object/ElevatorStandard.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
43
Data/scripts/base/chara/npc/object/GuildleveWarpPoint.lua
Normal file
43
Data/scripts/base/chara/npc/object/GuildleveWarpPoint.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
--[[
|
||||
|
||||
GuildleveWarpPoint Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventGuildleveReward(glId, completionTimeSec, completeReward, difficultyBonus, faction, gil???, factionBonus, RewardId1, RewardAmount1, RewardId2, RewardAmount2, difficulty) - Open Reward Dialog
|
||||
eventTalkGuildleveWarp(returnAetheryteID1, returnAetheryte2) - Opens choice menu
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
local currentGLDirector = player:GetGuildleveDirector();
|
||||
local glData = currentGLDirector.guildleveData;
|
||||
|
||||
callClientFunction(player, "eventGuildleveReward", currentGLDirector.guildleveId, currentGLDirector.completionTime, 24, 24, 0, 0, 0, 0, 0, 0, 0, currentGLDirector.selectedDifficulty);
|
||||
|
||||
local choice = callClientFunction(player, "eventTalkGuildleveWarp", glData.aetheryte, 0);
|
||||
|
||||
if (choice == 3) then
|
||||
local destination = aetheryteTeleportPositions[glData.aetheryte];
|
||||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
currentGLDirector:EndDirector();
|
||||
end
|
||||
elseif (choice == 4) then
|
||||
currentGLDirector:EndDirector();
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
--50023: GL COMPLETE!
|
||||
--50132: You earn faction credits from X
|
23
Data/scripts/base/chara/npc/object/MarketEntrance.lua
Normal file
23
Data/scripts/base/chara/npc/object/MarketEntrance.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
--[[
|
||||
|
||||
MarketEntrance Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventPushChoiceAreaOrQuest(gcLeaderPlaceName[Fronds, etc], showMarketWards/Houses (must be 0xc1a), gcHQPlaceName, anotherPlaceName, showItemSearchCounter, stopSearchingItemId) -
|
||||
eventPushStepPrvMarket(?, ?, ?) -
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
local MARKETWARD_ENTRANCE = {-201.0, 0.0, -160.0, 1.5};
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
callClientFunction(player, "eventPushChoiceAreaOrQuest", 0xc13, 0xc1a, 0xdba, 0, true, 1);
|
||||
player:EndEvent();
|
||||
end
|
10
Data/scripts/base/chara/npc/object/MateriaBook.lua
Normal file
10
Data/scripts/base/chara/npc/object/MateriaBook.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
callClientFunction(player, "materiabookTalk");
|
||||
player:EndEvent();
|
||||
end
|
19
Data/scripts/base/chara/npc/object/MiningPoint.lua
Normal file
19
Data/scripts/base/chara/npc/object/MiningPoint.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
harvestJudge = GetStaticActor("HarvestJudge");
|
||||
|
||||
--callClientFunction(player, "delegateEvent", player, harvestJudge, "loadTextData", dummy);
|
||||
--callClientFunction(player, "delegateEvent", player, harvestJudge, "targetCancel", dummy);
|
||||
--callClientFunction(player, "delegateEvent", player, harvestJudge, "turnToTarget", dummy, 0);
|
||||
--callClientFunction(player, "delegateEvent", player, harvestJudge, "openInputWidget", 22002, 1);
|
||||
--callClientFunction(player, "delegateEvent", player, harvestJudge, "textInputWidget", harvestJudge, 22002, npc, false);
|
||||
--callClientFunction(player, "delegateEvent", player, harvestJudge, "askInputWidget", harvestJudge, 22002, 1);
|
||||
|
||||
player:EndEvent();
|
||||
end
|
21
Data/scripts/base/chara/npc/object/ObjectBed.lua
Normal file
21
Data/scripts/base/chara/npc/object/ObjectBed.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
choice = callClientFunction(player, "askLogout", player);
|
||||
|
||||
if (choice == 2) then
|
||||
player:QuitGame();
|
||||
elseif (choice == 3) then
|
||||
player:Logout();
|
||||
elseif (choice == 4) then
|
||||
player:SendMessage(33, "", "Heck the bed");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
25
Data/scripts/base/chara/npc/object/ObjectEventDoor.lua
Normal file
25
Data/scripts/base/chara/npc/object/ObjectEventDoor.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
--[[
|
||||
|
||||
ObjectEventDoor Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventDoorMoveAsk() - Shows confirm to move into event
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
choice = callClientFunction(player, "eventDoorMoveAsk");
|
||||
|
||||
if (choice == 1) then
|
||||
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
16
Data/scripts/base/chara/npc/object/ObjectInnDoor.lua
Normal file
16
Data/scripts/base/chara/npc/object/ObjectInnDoor.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
defaultFst = GetStaticActor("DftFst");
|
||||
choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil);
|
||||
|
||||
if (choice == 1) then
|
||||
GetWorldManager():DoZoneChange(player, 1);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
54
Data/scripts/base/chara/npc/object/ObjectItemStorage.lua
Normal file
54
Data/scripts/base/chara/npc/object/ObjectItemStorage.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
--[[
|
||||
|
||||
ObjectItemStorage Script
|
||||
|
||||
Functions:
|
||||
|
||||
storageMenu() - Shows store/retrieve/help menu.
|
||||
selectCategory() - Shows the category menu
|
||||
selectStoreItem(nil, categoryId) - Shows store item menu
|
||||
selectReceiveItem(nil, categoryId) - Shows retrieve item menu
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
::TOP_MENU::
|
||||
storageChoice = callClientFunction(player, "storageMenu");
|
||||
|
||||
if (storageChoice == 1) then
|
||||
categoryChoice = callClientFunction(player, "selectCategory");
|
||||
|
||||
if (categoryChoice == 5) then
|
||||
goto TOP_MENU;
|
||||
end
|
||||
|
||||
itemId = callClientFunction(player, "selectStoreItem", nil, categoryChoice);
|
||||
|
||||
if (itemId ~= nil) then
|
||||
player:GetItemPackage(INVENTORY_NORMAL):RemoveItem(itemId, 1);
|
||||
end
|
||||
|
||||
elseif (storageChoice == 2) then
|
||||
categoryChoice = callClientFunction(player, "selectCategory");
|
||||
|
||||
if (categoryChoice == 5) then
|
||||
goto TOP_MENU;
|
||||
end
|
||||
|
||||
itemId = callClientFunction(player, "selectReceiveItem", nil, categoryChoice);
|
||||
|
||||
if (itemId ~= nil) then
|
||||
player:GetItemPackage(INVENTORY_NORMAL):AddItem(itemId, 1);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
6
Data/scripts/base/chara/npc/object/ObjectShip.lua
Normal file
6
Data/scripts/base/chara/npc/object/ObjectShip.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
13
Data/scripts/base/chara/npc/object/OpeningStoperF0B1.lua
Normal file
13
Data/scripts/base/chara/npc/object/OpeningStoperF0B1.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
if (triggerName == "caution") then
|
||||
worldMaster = GetWorldMaster();
|
||||
player:SendGameMessage(player, worldMaster, 34109, 0x20);
|
||||
elseif (triggerName == "exit") then
|
||||
GetWorldManager():DoPlayerMoveInZone(player, 5);
|
||||
end
|
||||
player:EndEvent();
|
||||
end
|
12
Data/scripts/base/chara/npc/object/PrivateAreaPastExit.lua
Normal file
12
Data/scripts/base/chara/npc/object/PrivateAreaPastExit.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
if (triggerName == "caution") then
|
||||
worldMaster = GetWorldMaster();
|
||||
player:SendGameMessage(player, worldMaster, 34109, 0x20);
|
||||
elseif (triggerName == "exit") then
|
||||
end
|
||||
player:EndEvent();
|
||||
end
|
19
Data/scripts/base/chara/npc/object/RaidDungeonBarrier.lua
Normal file
19
Data/scripts/base/chara/npc/object/RaidDungeonBarrier.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
isActive = true;
|
||||
|
||||
if (isActive) then
|
||||
choice = callClientFunction(player, "askYesNo");
|
||||
else
|
||||
callClientFunction(player, "eventTalkRead");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
56
Data/scripts/base/chara/npc/object/RetainerFurniture.lua
Normal file
56
Data/scripts/base/chara/npc/object/RetainerFurniture.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
--[[
|
||||
|
||||
RetainerFurniture Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventPushStepOpenRetainerMenu() - Opens menu to choose retainer
|
||||
eventRingBell() - Plays the bell ring animation
|
||||
eventPushRetainerCallCaution() - Shows warning that a open bazaar will be closed if retainer chosen
|
||||
eventTalkRetainerMenu(hasPossessions, showDispatchChoice) - Opens retainer menu.
|
||||
eventTalkRetainerDismissal(hasPossessions) - Show dismiss confirmation.
|
||||
eventTalkRetainerMannequin(0:Enable/1:Disable) - Shows dialog to enable/disable modeling.
|
||||
eventTalkRetainerItemTrade(operationCode) - Operate RetainerTradeWidget. Codes: 1 - Open, 2 - Select Mode, 3 - Close.
|
||||
eventTalkRetainerItemList(operationCode) - Operate Bazaar Widget. Codes: 1 - Open, 2 - Select Mode, 3 - Close.
|
||||
eventReturnResult(resultCode, ?) - Redraws the RetainerTrade UI.
|
||||
eventTalkSelectBazaarStreet(limitsWardChoices) - Shows the dialog to send a retainer to a street. Set to 20.
|
||||
eventTalkFinish() - Finishs the talk with retainer
|
||||
eventPlayerTurn(rotation) - Turns the player
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
require ("retainer")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
retainerNumber = callClientFunction(player, "eventPushStepOpenRetainerMenu");
|
||||
|
||||
if (retainerNumber == nil or retainerNumber == 0) then
|
||||
player:EndEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
callClientFunction(player, "eventRingBell");
|
||||
retainer = player:SpawnMyRetainer(npc, retainerNumber);
|
||||
|
||||
while (true) do
|
||||
choice = callClientFunction(player, "eventTalkRetainerMenu", false, true);
|
||||
if (choice == 1) then
|
||||
doItemTrade(player, retainer);
|
||||
elseif (choice == 2) then
|
||||
doBazaar(player, retainer);
|
||||
elseif (choice == 7) then
|
||||
callClientFunction(player, "eventTalkRetainerMannequin", 0);
|
||||
elseif (choice == 8) then
|
||||
callClientFunction(player, "eventTalkSelectBazaarStreet", 20);
|
||||
else
|
||||
break;
|
||||
end
|
||||
end
|
||||
|
||||
player:DespawnMyRetainer();
|
||||
player:EndEvent();
|
||||
end
|
19
Data/scripts/base/chara/npc/object/TaskBoard.lua
Normal file
19
Data/scripts/base/chara/npc/object/TaskBoard.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
questNOC = GetStaticActor("Noc000");
|
||||
|
||||
if (npc:GetActorClassId() == 1200193) then
|
||||
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskLimsa", nil, nil, nil);
|
||||
elseif (npc:GetActorClassId() == 1200194) then
|
||||
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskUldah", nil, nil, nil);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskGridania", nil, nil, nil);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
119
Data/scripts/base/chara/npc/object/aetheryte/AetheryteChild.lua
Normal file
119
Data/scripts/base/chara/npc/object/aetheryte/AetheryteChild.lua
Normal file
|
@ -0,0 +1,119 @@
|
|||
--[[
|
||||
|
||||
AetheryteChild Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventAetheryteChildSelect(showTeleport, parentAetheryteID, animaAmount, animaCost(always 1)): Opens menu
|
||||
eventAetheryteChildDesion(aetheryteId): "Your homepoint is now X"
|
||||
|
||||
eventGLSelect(?) - Open GL selector
|
||||
eventGLSelectDetail(glid, ?, reward, rewardQuantity, subreward, subrewardQuantity, faction, ?, completed) - Show GL details
|
||||
eventGLDifficulty() - Open difficulty selector
|
||||
eventGLStart(glId, difficulty, evaluatingFaction, areaFactionStanding, factionReward, warningBoundByDuty, warningTooFar, warningYouCannotRecieve, warningChangingClass) - Confirmation dialog
|
||||
|
||||
eventGLBoost(currentFavor, minNeeded) - Ask player for Guardian Aspect
|
||||
eventGLPlay(??) - Open Menu (GL active version)
|
||||
eventGLReward (glId, clearTime, missionBonus, difficultyBonus, factionNumber, factionBonus, factionCredit, reward, rewardQuantity, subreward, subrewardQuantity, difficulty) - Open reward window
|
||||
eventGLJoin () - Ask to join party leader's leve
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
require ("guildleve")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
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 parentNode = aetheryteChildLinks[aetheryteId];
|
||||
local menuChoice = callClientFunction(player, "eventAetheryteChildSelect", true, parentNode, 100, 1);
|
||||
|
||||
--Teleport
|
||||
if (menuChoice == 2) then
|
||||
printf("%ud", parentNode);
|
||||
destination = aetheryteTeleportPositions[parentNode];
|
||||
|
||||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
end
|
||||
--Init Levequest
|
||||
elseif (menuChoice == -1) then
|
||||
doLevequestInit(player, aetheryte);
|
||||
--Set Homepoint
|
||||
elseif (menuChoice == -2) then
|
||||
player:SetHomePoint(aetheryteId);
|
||||
callClientFunction(player, "eventAetheryteChildDesion", aetheryteId);
|
||||
--View Faction Standing
|
||||
elseif (menuChoice == -3) then
|
||||
player:SendGameMessage(player, aetheryte, 27, 0x20);
|
||||
player:SendGameMessage(player, aetheryte, 28, 0x20, 1, 15);
|
||||
player:SendGameMessage(player, aetheryte, 29, 0x20, 2, 10);
|
||||
player:SendGameMessage(player, aetheryte, 30, 0x20, 3, 5);
|
||||
end
|
||||
end
|
||||
|
||||
function doLevequestInit(player, aetheryte)
|
||||
local worldMaster = GetWorldMaster();
|
||||
::SELECT_LOOP::
|
||||
unknown, glId = callClientFunction(player, "eventGLSelect", 0x0);
|
||||
if (glId ~= 0) then
|
||||
::SELECT_DETAIL::
|
||||
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
|
||||
::SELECT_DIFFICULTY::
|
||||
player:SendGameMessage(worldMaster, 50014, 0x20); --"Please select a difficulty level. This may be lowered later."
|
||||
difficulty = callClientFunction(player, "eventGLDifficulty", glId);
|
||||
if (difficulty == nil) then goto SELECT_DETAIL; end
|
||||
confirmResult = callClientFunction(player, "eventGLStart", glId, difficulty, 1, 10, 20, 0, 0, 0, 0);
|
||||
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
|
||||
else
|
||||
goto SELECT_LOOP;
|
||||
end
|
||||
end
|
||||
end
|
154
Data/scripts/base/chara/npc/object/aetheryte/AetheryteParent.lua
Normal file
154
Data/scripts/base/chara/npc/object/aetheryte/AetheryteParent.lua
Normal file
|
@ -0,0 +1,154 @@
|
|||
--[[
|
||||
|
||||
AetheryteParent Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventAetheryteParentSelect(showTeleportMenu, animaAmount, gate1, gate2, gate3, gate4, gate5) - Open Menu
|
||||
eventAetheryteParentDesion(sheetId) - Show Homepoint Set Message
|
||||
|
||||
eventGLSelect(?) - Open GL selector
|
||||
eventGLSelectDetail(glid, ?, reward, rewardQuantity, subreward, subrewardQuantity, faction, ?, completed) - Show GL details
|
||||
eventGLDifficulty() - Open difficulty selector
|
||||
eventGLStart(glId, difficulty, evaluatingFaction, areaFactionStanding, factionReward, warningBoundByDuty, warningTooFar, warningYouCannotRecieve, warningChangingClass) - Confirmation dialog
|
||||
eventGLBoost(currentFavor, minNeeded) - Ask player for Guardian Aspect
|
||||
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
|
||||
eventGLJoin () - Ask to join party leader's leve
|
||||
|
||||
|
||||
--callClientFunction(player, "eventGLBoost", 0xc8, 0xb);
|
||||
--callClientFunction(player, "eventGLReward", 0x2a48, 120, 123, 125, 1, 111, 0, 0xf4241, 5, 0, 0, 3);
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
require ("guildleve")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
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 childNodes = aetheryteParentLinks[aetheryteId];
|
||||
|
||||
local listPosition = 1;
|
||||
local activeChildNodes = {0, 0, 0, 0, 0};
|
||||
|
||||
if (childNodes ~= nil) then
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[1])) then
|
||||
activeChildNodes[listPosition] = childNodes[1];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[2])) then
|
||||
activeChildNodes[listPosition] = childNodes[2];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[3])) then
|
||||
activeChildNodes[listPosition] = childNodes[3];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[4])) then
|
||||
activeChildNodes[listPosition] = childNodes[4];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[5])) then
|
||||
activeChildNodes[listPosition] = childNodes[5];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
end
|
||||
|
||||
local showTeleportOptions = true;
|
||||
if (listPosition == 1) then
|
||||
showTeleportOptions = false;
|
||||
end
|
||||
|
||||
local choice = callClientFunction(player, "eventAetheryteParentSelect", showTeleportOptions, 100, activeChildNodes[1], activeChildNodes[2], activeChildNodes[3], activeChildNodes[4], activeChildNodes[5]);
|
||||
|
||||
if (choice ~= nil) then
|
||||
--Init Leavequest
|
||||
if (choice == -1) then
|
||||
doLevequestInit(player, aetheryte);
|
||||
--Set Homepoint
|
||||
elseif (choice == -2) then
|
||||
player:SetHomePoint(aetheryteId);
|
||||
callClientFunction(player, "eventAetheryteParentDesion", aetheryteId);
|
||||
--View Faction Standings
|
||||
elseif (choice == -3) then
|
||||
player:SendGameMessage(player, aetheryte, 124, 0x20);
|
||||
player:SendGameMessage(player, aetheryte, 125, 0x20, 1, 15);
|
||||
player:SendGameMessage(player, aetheryte, 126, 0x20, 2, 10);
|
||||
player:SendGameMessage(player, aetheryte, 127, 0x20, 3, 5);
|
||||
--Teleport to Gate
|
||||
elseif (choice > 0) then
|
||||
destination = aetheryteTeleportPositions[activeChildNodes[choice]];
|
||||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function doLevequestInit(player, aetheryte)
|
||||
local worldMaster = GetWorldMaster();
|
||||
::SELECT_LOOP::
|
||||
unknown, glId = callClientFunction(player, "eventGLSelect", 0x0);
|
||||
if (glId ~= 0) then
|
||||
::SELECT_DETAIL::
|
||||
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
|
||||
::SELECT_DIFFICULTY::
|
||||
player:SendGameMessage(worldMaster, 50014, 0x20); --"Please select a difficulty level. This may be lowered later."
|
||||
difficulty = callClientFunction(player, "eventGLDifficulty", glId);
|
||||
if (difficulty == nil) then goto SELECT_DETAIL; end
|
||||
confirmResult = callClientFunction(player, "eventGLStart", glId, difficulty, 1, guildleveData.favorCount, 20, 0, 0, 0, 0);
|
||||
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
|
||||
else
|
||||
goto SELECT_LOOP;
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue