mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 14:04:41 +02:00
Man0u0 & Man0u1 work progress.
Man0u0 nearly finished. Needs some misc. background actors Id'd and placed, and some additional bug-testing. Man0u1 still very early. Initial area's actors mostly scripted.
This commit is contained in:
parent
0465bf6b8d
commit
96cb8070be
11 changed files with 512 additions and 217 deletions
|
@ -0,0 +1,3 @@
|
|||
function init(npc)
|
||||
return false, false, 0, 0, 0, 0;
|
||||
end
|
|
@ -48,8 +48,9 @@ function init(npc)
|
|||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
local classId = npc:GetActorClassId();
|
||||
local curLevel = 20; -- TODO: pull from character
|
||||
local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]);
|
||||
local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[classId]);
|
||||
local hasChocobo = player.hasChocobo;
|
||||
|
||||
if (hasChocobo == false) then -- Let GMs auto have the issuance for debugging
|
||||
|
@ -57,50 +58,64 @@ function onEventStarted(player, npc, triggerName)
|
|||
end
|
||||
|
||||
local hasFunds = (player:GetCurrentGil() >= rentalPrice);
|
||||
|
||||
callClientFunction(player, "eventTalkWelcome", player);
|
||||
|
||||
local menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 0);
|
||||
|
||||
if (menuChoice == 1) then -- Issuance option
|
||||
|
||||
callClientFunction(player, "eventTalkMyChocobo", player);
|
||||
local nameResponse = callClientFunction(player, "eventSetChocoboName", true);
|
||||
|
||||
if (nameResponse == "") then -- Cancel Chocobo naming
|
||||
callClientFunction(player, "eventCancelChocoboName", player);
|
||||
callClientFunction(player, "eventTalkStepBreak", player);
|
||||
player:EndEvent();
|
||||
return;
|
||||
else
|
||||
local appearance = startAppearances[npc:GetActorClassId()];
|
||||
player:IssueChocobo(appearance, nameResponse);
|
||||
|
||||
callClientFunction(player, "eventAfterChocoboName", player);
|
||||
|
||||
--Add Chocobo License and remove issuance
|
||||
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
|
||||
player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007);
|
||||
end
|
||||
player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1);
|
||||
|
||||
--Warp with the special chocobo warp mode.
|
||||
mountChocobo(player);
|
||||
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_CHOCOBO_GET, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
|
||||
end
|
||||
|
||||
elseif(menuChoice == 2) then -- Summon Bird
|
||||
mountChocobo(player);
|
||||
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_NO_ANIM, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
|
||||
elseif(menuChoice == 3) then -- Change Barding
|
||||
callClientFunction(player, "eventTalkStepBreak", player);
|
||||
elseif(menuChoice == 5) then -- Rent Bird
|
||||
mountChocobo(player, true, 1);
|
||||
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_CHOCOBO_RENTAL, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
|
||||
else
|
||||
callClientFunction(player, "eventTalkStepBreak", player);
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
if ((classId == 1000840) and (player:HasQuest(110009))) then -- Cross-script Man0u0 dialog
|
||||
local sequence = player:GetQuest(110009):getSequence();
|
||||
|
||||
if (sequence == 0) then
|
||||
callClientFunction(player, "delegateEvent", player, GetStaticActor("Man0u0"), "processEvent000_13");
|
||||
elseif (sequence == 10) then
|
||||
callClientFunction(player, "delegateEvent", player, GetStaticActor("Man0u0"), "processEvent020_7");
|
||||
else
|
||||
player:EndEvent();
|
||||
end
|
||||
else
|
||||
callClientFunction(player, "eventTalkWelcome", player);
|
||||
|
||||
local menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 0);
|
||||
|
||||
if (menuChoice == 1) then -- Issuance option
|
||||
|
||||
callClientFunction(player, "eventTalkMyChocobo", player);
|
||||
local nameResponse = callClientFunction(player, "eventSetChocoboName", true);
|
||||
|
||||
if (nameResponse == "") then -- Cancel Chocobo naming
|
||||
callClientFunction(player, "eventCancelChocoboName", player);
|
||||
callClientFunction(player, "eventTalkStepBreak", player);
|
||||
player:EndEvent();
|
||||
return;
|
||||
else
|
||||
local appearance = startAppearances[classId];
|
||||
player:IssueChocobo(appearance, nameResponse);
|
||||
|
||||
callClientFunction(player, "eventAfterChocoboName", player);
|
||||
|
||||
--Add Chocobo License and remove issuance
|
||||
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
|
||||
player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007);
|
||||
end
|
||||
player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[classId], 1);
|
||||
|
||||
--Warp with the special chocobo warp mode.
|
||||
mountChocobo(player);
|
||||
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_CHOCOBO_GET, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
|
||||
end
|
||||
|
||||
elseif(menuChoice == 2) then -- Summon Bird
|
||||
mountChocobo(player);
|
||||
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_NO_ANIM, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
|
||||
elseif(menuChoice == 3) then -- Change Barding
|
||||
callClientFunction(player, "eventTalkStepBreak", player);
|
||||
elseif(menuChoice == 5) then -- Rent Bird
|
||||
mountChocobo(player, true, 1);
|
||||
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_CHOCOBO_RENTAL, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
|
||||
else
|
||||
callClientFunction(player, "eventTalkStepBreak", player);
|
||||
end
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
|
@ -114,6 +129,6 @@ function mountChocobo(player, isRental, rentalMinutes)
|
|||
|
||||
player:SendMountAppearance();
|
||||
player:SetMountState(1);
|
||||
player:ChangeSpeed(0.0, 5.0, 10.0, 10.0);
|
||||
player:ChangeSpeed(0.0, 3.6, 9.0, 9.0);
|
||||
player:ChangeState(15);
|
||||
end
|
|
@ -109,10 +109,11 @@ function onEventStarted(player, npc, triggerName)
|
|||
|
||||
if (choice ~= 0) then
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
|
||||
callClientFunction(player, "eventAfterWarpOtherZone", player);
|
||||
|
||||
wait(1);
|
||||
player:EndEvent();
|
||||
local player_zone = player:GetPos()[5];
|
||||
spawnType = 0x0A;
|
||||
if (player_zone == aethernet[city][choice].zone) then
|
||||
|
|
|
@ -28,10 +28,10 @@ function onEventStarted(player, npc, eventType, eventName)
|
|||
local possibleQuests = {};
|
||||
|
||||
-- Create the switch table for this npc
|
||||
if (defaultTalk ~= nil and eventType == EVENT_TALK) then
|
||||
if (defaultTalk ~= nil and eventType == ETYPE_TALK) then
|
||||
table.insert(possibleQuests, defaultTalk);
|
||||
end
|
||||
if (tutorialTalk ~= nil and eventType == EVENT_TALK) then
|
||||
if (tutorialTalk ~= nil and eventType == ETYPE_TALK) then
|
||||
table.insert(possibleQuests, tutorialTalk);
|
||||
end
|
||||
if (activeQuests ~= nil) then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue