Added DB Support for Chocobo Lenders

This commit is contained in:
Jordan Maxwell 2016-08-19 14:40:43 -05:00
parent 4f3828e594
commit fb18c1fbe4
3 changed files with 100 additions and 6 deletions

View file

@ -21,11 +21,50 @@ end
function onEventStarted(player, npc, triggerName)
--callClientFunction(player, "eventTalkWelcome", player);
callClientFunction(player, "eventAskMainMenu", player, 20, true, true, true, true, 4);
callClientFunction(player, "eventTalkMyChocobo", player);
callClientFunction(player, "eventSetChocoboName", false);
callClientFunction(player, "eventAfterChocoboName", player);
local curLevel = 20;
local hasIssuance = true;
local hasChocobo = player.hasChocobo;
if (player.isGM and hasChocobo == false) then
hasIssuance = true;
end
local rentPrice = 800;
local playerFunds = 0; --TODO: pull character's money
local hasFunds = (playerFunds >= rentPrice);
callClientFunction(player, "eventTalkWelcome", player);
menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 4);
if (menuChoice == 1) then -- Issuance option
callClientFunction(player, "eventTalkMyChocobo", player);
nameResponse = callClientFunction(player, "eventSetChocoboName", false);
if (nameResponse == "") then -- Cancel Chocobo naming
callClientFunction(player, "eventCancelChocoboName", player);
end
appearance = 1; -- TODO: pull correct appearance based on GC
--player:issueChocobo(appearance, nameResponse);
if (nameResponse ~= "") then -- Successfully named Chocobo
callClientFunction(player, "eventAfterChocoboName", player);
end
elseif(menuChoice == 2 and hasChocobo) then -- Summon Bird
player:ChangeMusic(83);
player:SendChocoboAppearance();
player:SendGameMessage(player, worldMaster, 26001, 0x20);
player:SetMountState(1);
elseif(menuChoice == 3) then -- Change Barding
callClientFunction(player, "eventTalkStepBreak", player);
elseif(menuChoice == 5) then -- Rent Bird
if (hasFunds == false) then -- Not enough money
-- Do not enough money action??
else
--Issue rental chocobo
end
else
callClientFunction(player, "eventTalkStepBreak", player);
end
player:EndEvent();
end