|
Mount lua
Server: Odin
Game: FFXI
Posts: 6
By Odin.Zackily 2017-10-26 08:49:44
Hi, i was trying to write in my gearswap a code where it changes my calling mount for a mount based on day.
I got this idea from my Summoner.lua, where i can call allways "Dark Spirit" but depends on weather & day it will change to the right one.
I'm no coder, i live from the things, people publish, so any help would be apreciated =)
Here is what i tried to do: Code
sets.mount = {"Fenrir", "Bomb", "Crawler", "Magic Pot", "Tiger"}
mount_element={Fire='Bomb',Earth='Crawler',Water='Crawler',Wind='Magic Pot',Ice='Chocobo',Lightning='Crawler',
Light='Crawler',Dark='Crawler'}spirit_conflict={Fire='Ice',Earth='Lightning',Water='Fire',Wind='Earth',Ice='Wind',
Lightning='Water',Light='Dark',Dark='Light'}
function job_precast(spell, action, spellMap, eventArgs)
if spell.type == 'Mount' then
if spell.name == 'Fenrir' then
if world.weather_element == 'Dark' then
-- Dark Weather is active, lets the spell go ahead and equips summoning precast
send_command('input /mount "%" <me>':format(mount_element[world.day_element]))
elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
-- It's not dark weather but there is some weather up, cancels dark and summons the right spirit
cancel_spell()
send_command('input /mount "%" <me>':format(mount_element[world.weather_element]))
elseif world.day_element == 'Dark' then
else
-- There is no weather up and it's not darksday, so summon the current day's spirit
cancel_spell()
send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
equip(sets.precast.summoning)
end
end
end
end
Hi, i was trying to write in my gearswap a code where it changes my calling mount for a mount based on day.
I got this idea from my Summoner.lua, where i can call allways "Dark Spirit" but depends on weather & day it will change to the right one.
I'm no coder, i live from the things, people publish, so any help would be apreciated =)
Here is what i tried to do: Code
sets.mount = {"Fenrir", "Bomb", "Crawler", "Magic Pot", "Tiger"}
mount_element={Fire='Bomb',Earth='Crawler',Water='Crawler',Wind='Magic Pot',Ice='Chocobo',Lightning='Crawler',
Light='Crawler',Dark='Crawler'}spirit_conflict={Fire='Ice',Earth='Lightning',Water='Fire',Wind='Earth',Ice='Wind',
Lightning='Water',Light='Dark',Dark='Light'}
function job_precast(spell, action, spellMap, eventArgs)
if spell.type == 'Mount' then
if spell.name == 'Fenrir' then
if world.weather_element == 'Dark' then
-- Dark Weather is active, lets the spell go ahead and equips summoning precast
send_command('input /mount "%" <me>':format(mount_element[world.day_element]))
elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
-- It's not dark weather but there is some weather up, cancels dark and summons the right spirit
cancel_spell()
send_command('input /mount "%" <me>':format(mount_element[world.weather_element]))
elseif world.day_element == 'Dark' then
else
-- There is no weather up and it's not darksday, so summon the current day's spirit
cancel_spell()
send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
equip(sets.precast.summoning)
end
end
end
end
|
|