This is what I have so far.
Code: Select all
-----------------------------------------
-- ID: 15533
-- Item: chocobo whistle
-- Food Effect: 3Min, All Races
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/keyitems");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
result = 246; -- full from food.
hasLicense = target:hasKeyItem(CHOCOBO_LICENSE);
level = target:getMainLvl();
if (hasLicense and level >= 15) then
result = 0; -- continue
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
--if (hasLicense and level >= 15) then
target:addStatusEffect(EFFECT_CHOCOBO,1,0,1800);
--end
end;
- it checks to see if you are above lvl 15 and that you have the CHOCOBO_LICENSE
- if you do, you are put on the chocobo
- if you don't, you don't get a chocobo
What don't work
- if you don't have a CHOCOBO_LICENSE, the chat spits out "you are full" (not sure of the right result number)
- you can get on a chocobo in town (not sure how to check players location.)