This repository has been archived by the owner on Dec 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- func: addallmounts | ||
-- desc: Adds all mount key items to player, granting access to their associated mounts | ||
--------------------------------------------------------------------------------------------------- | ||
|
||
require("scripts/globals/status") | ||
require("scripts/globals/keyitems") | ||
|
||
cmdprops = | ||
{ | ||
permission = 1, | ||
parameters = "s" | ||
} | ||
|
||
function error(player, msg) | ||
player:PrintToPlayer(msg) | ||
player:PrintToPlayer("!addallmounts {player}") | ||
end | ||
|
||
function onTrigger(player, target) | ||
|
||
-- validate target | ||
local targ | ||
if (target == nil) then | ||
targ = player | ||
else | ||
targ = GetPlayerByName(target) | ||
if (targ == nil) then | ||
error(player, string.format("Player named '%s' not found!", target)) | ||
return | ||
end | ||
end | ||
|
||
-- add all mount key items | ||
for i = tpz.ki.CHOCOBO_COMPANION, tpz.ki.CHOCOBO_COMPANION + 26 do | ||
targ:addKeyItem(i) | ||
end | ||
|
||
player:PrintToPlayer(string.format("%s now has all mounts.", targ:getName())) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require("scripts/globals/status") | ||
|
||
cmdprops = | ||
{ | ||
permission = 1, | ||
parameters = "sss" | ||
}; | ||
|
||
function error(player, msg) | ||
player:PrintToPlayer(msg) | ||
player:PrintToPlayer("!mount <mount ID> {player}") | ||
end | ||
|
||
function onTrigger(player, mount, target) | ||
|
||
-- Default to Chocobo (0) | ||
if (mount == nil) then | ||
mount = 0 | ||
end | ||
|
||
-- validate mount | ||
mount = tonumber(mount) or tpz.mount[string.upper(mount)] | ||
if (mount == nil or mount < 0 or mount > 27) then | ||
error(player, "Invalid mount ID.") | ||
return | ||
end | ||
|
||
-- validate target | ||
local targ | ||
if (target == nil) then | ||
targ = player | ||
else | ||
targ = GetPlayerByName(target) | ||
if (targ == nil) then | ||
error(player, string.format("Player named '%s' not found!", target)) | ||
return | ||
end | ||
end | ||
|
||
targ:addStatusEffectEx(tpz.effect.MOUNTED, tpz.effect.MOUNTED, mount, 0, 0, true) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
----------------------------------- | ||
-- Area: Upper Jeuno | ||
-- NPC: Mapitoto | ||
-- Type: Full Speed Ahead Mount NPC | ||
-- !pos -54.310 8.200 85.940 244 | ||
----------------------------------- | ||
local ID = require("scripts/zones/Upper_Jeuno/IDs") | ||
require("scripts/globals/chocobo") | ||
require("scripts/globals/keyitems") | ||
require("scripts/globals/npc_util") | ||
require("scripts/globals/status") | ||
----------------------------------- | ||
|
||
function onTrade(player,npc,trade) | ||
-- The Fenrir (10057) and Omega (10067) items and mounts have their own questlines, so they aren't valid trades here | ||
if trade:getSlotCount() == 1 and not (npcUtil.tradeHasExactly(trade, 10057) or npcUtil.tradeHasExactly(trade, 10067)) then | ||
local item = trade:getItemId(0) | ||
local mount = item - 10050 | ||
if item == 15533 then | ||
player:startEvent(10227, 15533, tpz.ki.TRAINERS_WHISTLE, tpz.mount.CHOCOBO) | ||
player:setLocalVar("FullSpeedAheadReward", tpz.ki.CHOCOBO_COMPANION) | ||
elseif mount >= 0 and mount <= 24 then | ||
player:setLocalVar("FullSpeedAheadReward", tpz.ki.TIGER_COMPANION + mount) | ||
player:startEvent(10227, item, tpz.ki.TRAINERS_WHISTLE, tpz.mount.TIGER + mount - 1) | ||
end | ||
end | ||
end | ||
|
||
function onTrigger(player,npc) | ||
-- Minigame complete | ||
local fullSpeedAheadStatus = player:getCharVar("[QUEST]FullSpeedAhead") | ||
local hasTrainersWhistle = player:hasKeyItem(tpz.ki.TRAINERS_WHISTLE) | ||
|
||
if hasTrainersWhistle then | ||
player:startEvent(10226) | ||
elseif | ||
player:hasKeyItem(tpz.ki.CHOCOBO_LICENSE) and | ||
player:getMainLvl() >= 20 and | ||
player:hasKeyItem(tpz.ki.MAP_OF_THE_JEUNO_AREA) | ||
then | ||
player:startEvent(10223, 0, 0, 4) | ||
elseif fullSpeedAheadStatus == 1 then | ||
player:startEvent(10225, tpz.ki.TRAINERS_WHISTLE) | ||
else | ||
player:startEvent(10222) | ||
end | ||
end | ||
|
||
function onEventUpdate(player,csid,option) | ||
end | ||
|
||
function onEventFinish(player,csid,option) | ||
if csid == 10223 and option == 1 then | ||
player:setPos(475, 8.8, -159, 128, 105) | ||
elseif csid == 10225 then | ||
-- Complete quest | ||
npcUtil.giveKeyItem(player, tpz.ki.TRAINERS_WHISTLE) | ||
npcUtil.giveKeyItem(player, tpz.ki.RAPTOR_COMPANION) | ||
elseif csid == 10227 then | ||
local rewardKI = player:getLocalVar("FullSpeedAheadReward") | ||
player:setLocalVar("FullSpeedAheadReward", 0) | ||
if rewardKI ~= tpz.ki.CHOCOBO_COMPANION then | ||
player:tradeComplete() | ||
end | ||
npcUtil.giveKeyItem(player, rewardKI) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters