1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 11:47:48 +00:00

Actor script fixes, documented populace classes and misc things

Base
        - gcseals.lua
            Helper functions for GC seals.  Tables the seal caps per rank and checks against it when adding seals.

    Commands
        - PartyTargetCommand.lua :
            Handles markers above head.  Basic documentation, only works on self. "Heart" doesn't work, client bug?
            Eventually will need an object in the party class to handle tracking marked players/targets for the group.

    Class Scripts
        - PopulaceCaravanAdviser.lua
            Documented.  Can purchase gysahl greens from them, unsure what else their use is.
        - PopulaceCaravanGuide.lua
            Documented the Caravan Guide NPC, who escorts the chocobos with you.
        - PopulaceCaravanManager.lua
            NPC who handles signing up for Caravan escort, among other functions.
        - PopulaceSpecialEventCryer.lua
            Covers three NPCs for the Foundation Event.  They handle trading specific items in exchange for GC seals.

    Unique ID Script fixes
        - flame_private_sisimuza_tetemuza.lua
            Foundation Event NPC functions laid out.
        - flame_sergeant_mimio_mio.lua
            Foundation Event NPC functions laid out.
        - serpent_lieutenant_marette.lua
            Foundation Event NPC functions laid out.
        - serpent_private_tristelle.lua
            Foundation Event NPC functions laid out.
        - serpent_sergeant_frilaix.lua
            Foundation Event NPC functions laid out.
        - serpent_sergeant_nelhah.lua
            Removed unique script. PopulaceSpecialEventCryer handles it.
        - ansgor.lua
            Had incorrect defaultTalk value
        - ne_of_eshtaimes.lua
            Door @ !warp 209 -139 206.113 195   Had incorrect mapObj value.
This commit is contained in:
CuriousJorge 2017-12-13 15:09:10 -05:00
parent 88233cf6d2
commit 359ea8a40e
14 changed files with 389 additions and 20 deletions

View file

@ -0,0 +1,41 @@
--[[
PopulaceCaravanAdviser Script
Functions:
adviserDeffault() - Not a typo. NPC dialog talking about a chocobo. Resets their sight on you, perhaps used on closing dialog?
adviserAsk() - Brings up a menu for caravan info, or purchasing gysahl greens
adviserAdvise() - NPC dialog discussing feeding chocobos
adviserSales(price) - Gysahl purchase dialog and prompt
adviserBuy() - Dialog to play after purchasing gysahl greens
adviserBuyNG() - NPC plays /shrug animation.
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
local gysahlPrice = 20;
local choice = callClientFunction(player, "adviserAsk");
if choice == 1 then
callClientFunction(player, "adviserAdvise");
elseif choice == 2 then
local purchaseChoice = callClientFunction(player, "adviserSales", gysahlPrice);
if purchaseChoice == 1 then
callClientFunction(player, "adviserBuy");
elseif purchaseChoice == 2 then
callClientFunction(player, "adviserBuyNG");
end
elseif choice == 3 then
callClientFunction(player, "adviserDeffault")
end
player:EndEvent();
end

View file

@ -0,0 +1,68 @@
--[[
PopulaceCaravanGuide Script
This script handles the caravan guide class, which is for the actor who escorts the chocobos behind them during Caravan Security events.
Functions:
caravanGuardCancel() - Menu prompt to abandon the caravan
caravanGuardReward(cargo, nil, areaName, playerGC, killCount, areaName2)
- Reward dialog for completing the caravan
- cargo = 0 (none) through 9 (all) for varying degrees of success dialog
- If playerGC doesn't match the GC of the areaName region, NPC mentions you don't need their seals.
- killCount shows an extra dialog if 40-49 enemies were slain, and a different one at 50+
caravanGuardNotReward() - Dialog stating you didn't contribute to the event at all
caravanGuardFailReward(areaName, areaName2) - Failure dialog, NPC offers free gysahl green, then offers free teleport back to aetheryte
caravanGuardThanks(name1, name2, name3) - Dialog for joining the caravan. NPC names the three chocobos. Name IDs from xtx_displayName
caravanGuardOffer(areaName, areaName2, playerGC) - Dialog for who to talk to for joining the caravan.
caravanGuardAmple(areaName, areaName2) - Dialog for NPC taking a break?
caravanGuardSuccess() - Dialog when you reached destination?
caravanGuardFailure(areaName, areaName2) - Failure dialog for mentioned area.
caravanGuardIgnore() - Resets NPC state for player? Or used for players not flagged for the event.
caravanGuardBonusReward(nil, isBonus?) - NPC says variation on a piece of dialog from the boolean passed
caravanGuardNotBonusReward() - Inventory full flavour dialog
Notes:
Functions employing areaName/areaName2 add their value together in the client's script to get the area name. Said area values are...
1 = Wineport, 2 = Quarrymill, 3 = Silver Bazaar, 4 = Aleport, 5 = Hyrstmill, 6 = Golden Bazaar
areaName will always be 1-3 for caravanGuardReward to function as expected for GC-related dialog
areaName2 will always be either 0 or 3. 0 for the lower level caravan area name, 3 for the higher level.
populaceCaravanGuide sheet:
ID Dialog Comment
6 It is time. Come, let us ride. - Caravan begins.
12 We've arrived at last! Come and speak to me when you're ready to claim your reward. - Caravan completed.
23 We're under attack! The chocobos! Protect the chocobos! - Caravan aggros monsters
27 Gods, have we already come this far? At this pace, we stand to make good time. - Says between 50% & 90% of the way to desgination? Can be said more than once per run
28 Well fought, friend. I thank the gods you're with us. Come, onward! - Cleared monsters that caravan aggro'd
TO-DO:
Document actors involved. Should be six of them.
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
local areaName = 1;
local areaName2 = 3;
local playerGC = 1;
local cargo = 9;
local killCount = 50;
callClientFunction(player, "caravanGuardOffer", areaName, areaName2, playerGC);
--callClientFunction(player, "caravanGuardReward", cargo, nil, areaName, playerGC, killCount, areaName2);
--player:SendGameMessageDisplayIDSender(npc, 6, MESSAGE_TYPE_SAY, npc.displayNameId);
player:EndEvent();
end

View file

@ -0,0 +1,49 @@
--[[
PopulaceCaravanManager Script
Functions:
caravanGuardEntry(areaGC, hasRoomForGCSeals, areaName, difficulty, playerGC, playerCountRequired, levelRequired)
- Dialog for signing up for caravan. areaGC(1-3) & areaName(0 or 3) added together to get location name.
- If difficulty => 40 on areaGC 1-3 & areaName 0, NPC mentions it's be a tougher trip
caravanGuardQuestion(areaName1, areaName2, escortMax, isSameGC?, playerGC?) - Ask about the caravan escort
caravanGuardJoinOK(areaName1, areaName2, playerGC) - Dialog for successfully joining the caravan
caravanGuardJoinNG(nil, maxEscorts, playerGC) - Dialog dictating how many escorts total filled the run.
caravanGuardAmple(nil, playerGC, playerGC) - Dialog for caravan escort being full.
caravanGuardOther(npcGC) - Dialog where NPC mentions you're not part of the given Grand Company parameter
caravanGuardSigh() - NPC does a shrug animation
caravanGuardHuh() - NPC does /huh
caravanGuardCancel(nil, playerGC) - Dialog for canceling caravan escort.
Notes:
Some NPC dialog address you differently if your GC rank is Chief Sergeant (id 27) or higher, but only in non-English languages.
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
local GC = 3;
local playerGC = 1;
local areaName = 0;
local level = 25;
local playerCount = 8;
local difficulty = 41;
local hasRoomForGCSeals = false;
local isSameGC = true;
local escortMax = 8;
areaName1 = 1;
areaName2 = 3;
-- callClientFunction(player, "caravanGuardCancel", nil, 3);
callClientFunction(player, "caravanGuardEntry", GC, hasRoomForGCSeals, areaName, difficulty, playerGC, playerCount, level);
player:EndEvent();
end

View file

@ -0,0 +1,84 @@
--[[
PopulaceSpecialEventCryer Script
Actor Class script to handle the 6 NPCs (technically 3, the actors were duped) involved in the Foundation Day 2011 & 2012 events.
In 2011 they appear to be used for recruitment information for their respective Grand Company.
In 2012, they were used for exchanging Over-aspected Crystals/Clusters for GC seals as part of the ongoing Atomos event.
Functions:
For 2011.
eventTalkStep0(joined) - NPC dialog about joining their cause to fight back Imperials. joined = 0 or 1. Function has hardcoded actor IDs, won't work with 2012 versions
eventTalkNotGCmenber(npcGC) - NPC dialog when you're not part of their grand company.
For 2012.
eventTalkCrystalExchange(player, npcGC, hasCrystal) - NPC dialog explaining they want over-aspected crystals. Brings up crystal exchange prompt if hasCrystal = 1.
eventTalkCsOverflow(player, npcGC) - Error message that you can't hold the seals being offered.
eventTalkCrystalExchange2(player, npcGC) - NPC dialog for accepting exchange of crystals for seals
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
local gcRep = {
[1001619] = 1, -- Maelstrom Representative 2011
[1002105] = 1, -- Maelstrom Representative 2012
[1001623] = 2, -- Adder Representative 2011
[1002109] = 2, -- Adder Representative 2012
[1001627] = 3, -- Flame Representative 2011
[1002113] = 3, -- Flame Representative 2012
}
function onEventStarted(player, npc, triggerName)
local playerGC = player.gcCurrent;
local npcId = npc:GetActorClassId();
local npcGC = gcRep[npcId];
local npcGCSeal = 1000200 + npcGC;
local hasCrystal = 1;
local crystal = 3020537;
local cluster = 3020413;
local eventMode = 2012;
if eventMode == 2011 then
if playerGC == 0 then
callClientFunction(player, "eventTalkStep0", 0);
elseif playerGC == npcGC then
callClientFunction(player, "eventTalkStep0", 1);
else
callClientFunction(player, "eventTalkNotGCmenber", npcGC);
end
elseif eventMode == 2012 then
choice = callClientFunction(player, "eventTalkCrystalExchange", player, npcGC, hasCrystal);
if choice == 1 then
--callClientFunction(player, "eventTalkCsOverflow", player, npcGC);
player:SendMessage(0x20, "", "You pretend to hand over four over-aspected crystals.");
callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC);
local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1);
if invCheck == INV_ERROR_SUCCESS then
player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, crystal, 1, npcGCSeal, 1, 4, 1000);
end
elseif choice == 2 then
player:SendMessage(0x20, "", "You pretend to hand over an over-aspected cluster.");
--callClientFunction(player, "eventTalkCsOverflow", player, npcGC);
callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC);
local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1);
if invCheck == INV_ERROR_SUCCESS then
player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, cluster, 1, npcGCSeal, 1, 1, 3000);
end
end
end
player:EndEvent();
end

View file

@ -0,0 +1,57 @@
--[[
PartyTargetCommand Script
Handles placing marks on targets
--]]
require("global")
markers = { -- [id] = {overheadIcon, textIcon}
[0] = {0, 0}, -- Clear
[1] = {1000, 304},-- Watch my HP!
[2] = {2000, 305},-- Watch my MP!
[3] = {3000, 306},-- Watch my TP!
[5] = {5000, 308},-- I need enhancing magic!
[6] = {6000, 309},-- I am enfeebled!
[7] = {7000, 310},-- Good!
[8] = {8000, 311},-- Bad!
[100] = {-7000, 296}, -- Attack this target!
[101] = {-6000, 297}, -- Focus on this target!
[102] = {-5000, 298}, -- Stop this target!
[104] = {-4000, 299}, -- Do not attack this target!
[105] = {-3000, 300}, -- General mark Spade
[106] = {-2000, 301}, -- General mark Club
[107] = {-1000, 302}, -- General mark Diamond
}
function onEventStarted(player, actor, triggerName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6)
workName = "charaWork.parameterTemp.targetInformation";
uiFunc = "charaWork/stateForAll";
markerIndex = markers[commandValue][1] or 0;
iconIndex = markers[commandValue][2] or 0;
categoryKind = tonumber(category) or -1;
worldMaster = GetWorldMaster();
if categoryKind == -1 then
return
end
player:SetWorkValue(player, workName, uiFunc, markerIndex);
if iconIndex != 0 then
if categoryKind == 1 then
player:SendGameMessage(player, worldMaster, 30422, 0x20, player, iconIndex);
elseif categoryKind == 2 then
player:SendGameMessage(player, worldMaster, 30412, 0x20, player, iconIndex);
end
elseif iconIndex == 0 then
player:SendGameMessage(player, worldMaster, 30413, 0x20, player, 0);
end
player:EndEvent();
end

66
data/scripts/gcseals.lua Normal file
View file

@ -0,0 +1,66 @@
--[[
Grand Company Seal Helper Functions
--]]
require("global");
local companySeal = {1000201, 1000202, 1000203}; -- Storm, Serpent, Flame
local rankSealCap = {
[0] = 0, -- None
[11] = 10000, -- Private Third Class
[13] = 15000, -- Private Second Class
[15] = 20000, -- Private First Class
[17] = 25000, -- Corporal
[21] = 30000, -- Sergeant Third Class
[23] = 35000, -- Sergeant Second Class
[25] = 40000, -- Sergeant First Class
[27] = 45000, -- Chief Sergeant
[31] = 50000, -- Second Lieutenant
[33] = 50000, -- First Lieutenant
[35] = 50000, -- Captain
[41] = 60000, -- Second Commander
[43] = 60000, -- First Commander
[45] = 60000, -- High Commander
[51] = 70000, -- Rear Marshal
[53] = 70000, -- Vice Marshal
[55] = 70000, -- Marshal
[57] = 70000, -- Grand Marshal
[100] = 100000, -- Champion
[111] = 0, -- Chief Admiral/Elder Seedseer/General
[127] = 10000 -- Recruit
}
function GetGCSeals(player, company)
company = tonumber(company);
if company ~= nil and company > 0 and company < 4 then
return player:GetInventory(INVENTORY_CURRENCY):GetItemQuantity(companySeal[tonumber(company)]);
else
return -1;
end
end
function AddGCSeals(player, company, amount)
amount = tonumber(amount);
company = tonumber(company);
local gcRank = {player.gcRankLimsa, player.gcRankGridania, player.gcRankUldah};
local currentAmount = GetGCSeals(player, company);
local maxAmount = rankSealCap[gcRank[company]];
if currentAmount ~= -1 then
if amount then
if currentAmount + amount <= maxAmount then
invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(companySeal[company], amount, 1);
if invCheck == INV_ERROR_SUCCESS then
return INV_ERROR_SUCCESS;
end
else
return INV_ERROR_FULL;
end
end
else
return INV_ERROR_SYSTEM_ERROR;
end
end

View file

@ -1,7 +1,18 @@
require ("global")
function onEventStarted(player, npc)
defaultFst = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, defaultFst, "processEventELNAURE", 1,1,1);
player:endEvent();
Spl = GetStaticActor("Spl000");
magickedPrism = 3020615;
if not player:GetInventory(INVENTORY_NORMAL):HasItem(magickedPrism) then
callClientFunction(player, "delegateEvent", player, Spl, "processEventELNAURE", 2);
local invCheck = player:GetInventory(INVENTORY_NORMAL):AddItem(magickedPrism, 10, 1);
if invCheck == INV_ERROR_SUCCESS then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, magickedPrism, 10);
end
else
callClientFunction(player, "delegateEvent", player, Spl, "processEventELNAURE", 1);
end
player:endEvent();
end

View file

@ -1,7 +1,7 @@
require ("global")
function onEventStarted(player, npc)
defaultFst = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, defaultFst, "processEventMERLIE", 1,1,1);
Spl = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, Spl, "processEventMERLIE");
player:endEvent();
end

View file

@ -1,7 +1,7 @@
require ("global")
function onEventStarted(player, npc)
defaultFst = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, defaultFst, "processEventARISMONT", 1, 1, 1);
Spl = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, Spl, "processEventARISMONT");
player:endEvent();
end

View file

@ -1,7 +0,0 @@
require ("global")
function onEventStarted(player, npc)
defaultFst = GetStaticActor("DftFst");
callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithSerpent_sergeant_nelhah_001", nil, nil, nil);
player:endEvent();
end

View file

@ -2,6 +2,6 @@ require ("global")
function onEventStarted(player, npc)
defaultSea = GetStaticActor("DftSea");
callClientFunction(player, "delegateEvent", player, defaultSea, "defaultTalkWithAnsgor_001");
callClientFunction(player, "delegateEvent", player, defaultSea, "defaultTalkWithANSGOR_100");
player:endEvent();
end

View file

@ -1,7 +1,7 @@
require ("global")
function onEventStarted(player, npc)
defaultWil = GetStaticActor("DftWil");
callClientFunction(player, "delegateEvent", player, defaultWil, "defaultTalkWithFlameprivatesisimuzatetemuza_001", nil, nil, nil);
Spl = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, Spl, "processEventSISIMUZA");
player:endEvent();
end

View file

@ -1,8 +1,8 @@
require ("global")
function onEventStarted(player, npc)
defaultWil = GetStaticActor("DftWil");
callClientFunction(player, "delegateEvent", player, defaultWil, "defaultTalkWithFlamesergeantmimiomio_001", nil, nil, nil);
Spl = GetStaticActor("Spl000");
callClientFunction(player, "delegateEvent", player, Spl, "processEventMIMIO");
player:endEvent();
end

View file

@ -1,3 +1,3 @@
function init(npc)
return false, false, 0, 0, 0x1A5, 0xFC7;
return false, false, 0, 0, 0x1A5, 0xFD9;
end