Does anyone remember the finalfantasylization addon? Well I took a look at its code(bare in mind my coding knowledge is extremely limited) and based on what i can tell its call functions are based on slash commands and that looks like that’s the only issue since WoW no longer lets addons use slash commands it seems.
I could be wrong but if that’s the case my theory is, if i implement some code that gives it a mini-map button and simple popup menu when said mini-map button is clicked that displays options to enable or disable the addon, it would work as intended.
Now here’s the rub:
I. CAN’T. CODE.
Suffice it to say, if the world depended on me making a “hello world” script I’d probably screw something up so I’m asking here if its possible to get the code so i can import it into the addon.
For anyone who wants to take a look at the code, find out the problem is a lot more complex than that and blow my hopes and dreams of bringing this dead addon back to life here’s a copy pasta of the lua:
FinalFantasylization_Status = "Enable"
FinalFantasylization_Debug = "Disable"
FinalFantasylization_Music = "Enable"
FinalFantasylization_Sound = "Enable"
RestSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Resting.mp3"
Mounted1Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Chocobo1.mp3"
Mounted2Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Chocobo2.mp3"
Mounted3Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Chocobo3.mp3"
EscapeSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Escape.mp3"
BattleSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\PVEBattle.mp3"
PVPSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\PVPBattle.mp3"
BossSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\PVPBattle.mp3"
BG1Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\BattleGround1.mp3"
BG2Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\BattleGround2.mp3"
BG3Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\BattleGround3.mp3"
FanFare = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Fanfare.mp3"
Dies = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Dies.mp3"
Kill = "Interface\\AddOns\\FinalFantasylization\\Sounds\\kill.wav"
Dead1Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Dead1.mp3"
Dead2Song = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Dead2.mp3"
IntroSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Intro.mp3"
TaxiSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\Taxi.mp3"
MacoSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\MacoSong.mp3" --'Makou Reactor
FriendlySong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\FriendlySong.mp3" --'Tifas Theme
ContestedSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\World.mp3" --'Main Theme of FFVII
HostileSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\HostileSong.mp3" --'The Great North Cave
SwimSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\SwimSong.mp3"--'A Secret Sleeping in the Deep Sea.mp3
FanFareSong = "Interface\\AddOns\\FinalFantasylization\\Sounds\\FanFareSong.mp3"--'Victory Fanfare
function FinalFantasylization_ClearMusicState()
FinalFantasylization_Isworlding = false
FinalFantasylization_PlayerIsResting = false
FinalFantasylization_PlayerIscombat = false
FinalFantasylization_IsMounted = false
FinalFantasylization_IsEscape = false
FinalFantasylization_IsBattling = false
FinalFantasylization_IsMounting = false
FinalFantasylization_IsResting = false
FinalFantasylization_RewGain = false
FinalFantasylization_Introing = false
FinalFantasylization_IsGhosting = false
FinalFantasylization_Dies = false
FinalFantasylization_UnitDies = false
FinalFantasylization_IsTaxi = false
FinalFantasylization_IsDead = false
FinalFantasylization_IsHostileMounting = false
FinalFantasylization_InWarsongGulch = false
FinalFantasylization_InArathiBasin = false
FinalFantasylization_InAlteracValley = false
FinalFantasylization_InZoneIronforge = false
FinalFantasylization_InContestedSongArea = false
FinalFantasylization_InHostileArea = false
FinalFantasylization_IsSwimming = false
FinalFantasylization_InFriendlySongArea = false
FinalFantasylization_InBGFanFaring = false
FinalFantasylization_BGEnd = "Nostatus"
end
function FinalFantasylization_Msg(msg)
if( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage(msg);
end
end
function FinalFantasylization_debugMsg(msg)
if( DEFAULT_CHAT_FRAME ) and FinalFantasylization_Debug == "Enable" then
DEFAULT_CHAT_FRAME:AddMessage(msg);
end
end
function FinalFantasylization_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
this:RegisterEvent("PLAYER_REGEN_DISABLED");--'gets agro
this:RegisterEvent("PLAYER_REGEN_ENABLED");--'loses agro
this:RegisterEvent("PLAYER_DEAD");
this:RegisterEvent("ZONE_CHANGED_NEW_AREA");
this:RegisterEvent("PLAYER_XP_UPDATE");
this:RegisterEvent("PLAYER_PVP_KILLS_CHANGED");
this:RegisterEvent("PLAYER_UPDATE_RESTING");
this:RegisterEvent("PLAYER_CAMPING");
this:RegisterEvent("PLAYER_AURAS_CHANGED");
this:RegisterEvent("PLAYER_UNGHOST");
this:RegisterEvent("UNIT_MANA");
this:RegisterEvent("UNIT_HEALTH");
this:RegisterEvent("UNIT_ENERGY");
this:RegisterEvent("UNIT_MODEL_CHANGED");
this:RegisterEvent("PLAYER_DEAD");
this:RegisterEvent("PLAYER_ALIVE");
this:RegisterEvent("PLAYER_UNGHOST");
this:RegisterEvent("UNIT_DIES");
this:RegisterEvent("PLAYER_CONTROL_GAINED");
this:RegisterEvent("PLAYER_CONTROL_LOST");
this:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH");
this:RegisterEvent("UNIT_ENERGY");
this:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL");
this:RegisterEvent("UPDATE_BATTLEFIELD_SCORE");
this:RegisterEvent("UPDATE_BATTLEFIELD_STATUS");
this:RegisterEvent("UPDATE_WORLD_STATES");
this:RegisterEvent("UPDATE_CHAT_WINDOWS");
this:RegisterEvent("CHAT_MSG_CHANNEL");
this:RegisterEvent("CHAT_MSG_BATTLEGROUND");
FinalFantasylization_Intro = true
SLASH_FinalFantasylizationCMD1 = "/FF";
SLASH_FinalFantasylizationCMD1 = "/FFSound";
SLASH_FinalFantasylizationCMD2 = "/FinalFantasylization";
SlashCmdList["FinalFantasylizationCMD"] = FinalFantasylization_Command;
FinalFantasylization_ClearMusicState()
end
function FinalFantasylization_Command(param1)
local start, finish, command, value = string.find(param1, "(%w+) (%w+)");
if (string.lower(param1) == "enable") then
FinalFantasylization_Msg("|cffffff00 FinalFantasylization are now enabled")
FinalFantasylization_Status = "Enable"
FinalFantasylization_ClearMusicState()
elseif (string.lower(param1) == "disable") then
FinalFantasylization_Status = "Disable"
FinalFantasylization_Msg("|cffffff00 FinalFantasylization are now disabled, to enabled type: /FFSound enable")
elseif (string.lower(param1) == "debug") then
if FinalFantasylization_Debug == "Disable" then
FinalFantasylization_Debug = "Enable"
FinalFantasylization_Msg("|cffffff00 FinalFantasylization debug mode are now enabled, to disable type: /FFSound debug")
else
FinalFantasylization_Debug = "Disable"
FinalFantasylization_Msg("|cffffff00 FinalFantasylization debug mode are now disabled")
StopMusic()
end
elseif (string.lower(param1) == "music") then
if FinalFantasylization_Music == "Enable" then
FinalFantasylization_Music = "Disable"
FinalFantasylization_ClearMusicState()
StopMusic();
FinalFantasylization_Msg("|cffffff00 FinalFantasylization music are now disabled, to enable type: /FFSound music")
else
FinalFantasylization_Music = "Enable"
FinalFantasylization_GetMusic()
FinalFantasylization_Msg("|cffffff00 FinalFantasylization music are now enabled")
end
elseif (string.lower(param1) == "sound") then
if FinalFantasylization_Sound == "Enable" then
FinalFantasylization_Sound = "Disable"
FinalFantasylization_Msg("|cffffff00 FinalFantasylization sound are now disabled, to enable type: /FFSound sound")
else
FinalFantasylization_Sound = "Enable"
FinalFantasylization_Msg("|cffffff00 FinalFantasylization sound are now enabled")
end
elseif (string.lower(param1) == "test") then
ZoneName = GetRealZoneText();
MimimapZoneName = GetMinimapZoneText()
SubZoneName = GetSubZoneText()
local pvpType, factionName, isArena = GetZonePVPInfo(); --'"friendly", "Alliance", false
ZoneText = GetZoneText()
local classification = UnitClassification("target");
FinalFantasylization_Msg("|cffffff00 FinalFantasylization test: "..pvpType.." "..ZoneName)
FinalFantasylization_Msg("|cffffff00 FinalFantasylization test: classification: "..classification)
else
FinalFantasylization_Usage()
end
end
function FinalFantasylization_Usage()
FinalFantasylization_Msg("|cffffff00 Usage:\n");
FinalFantasylization_Msg(" Type /FFSound and then the command that you wish to use\n");
FinalFantasylization_Msg(" /FFSound enable - Enables the addon\n");
FinalFantasylization_Msg(" /FFSound disable - Disables the addon \n");
FinalFantasylization_Msg(" /FFSound music - Toggles if music are allowed to be played or not\n");
FinalFantasylization_Msg(" /FFSound sound - Toggles if sounds are allowed to be played or notd\n");
FinalFantasylization_Msg(" /FFSound debug - Toggles debug mode\n");
end
function FinalFantasylization_PlayMusic( file )
if( FinalFantasylization_Status == "Enable" ) and ( FinalFantasylization_Music == "Enable" ) then
if( file ~= nil ) then
PlayMusic( file );
end
end
end
function FinalFantasylization_PlayFile( file )
if( FinalFantasylization_Status == "Enable" ) and ( FinalFantasylization_Sound == "Enable" ) then
if( file ~= nil ) then
PlaySoundFile( file );
end
end
end
function FinalFantasylization_GetMusic()
if FinalFantasylization_Status == "Enable" then
ZoneName = GetRealZoneText();
MimimapZoneName = GetMinimapZoneText()
SubZoneName = GetSubZoneText()
local pvpType, factionName, isArena = GetZonePVPInfo(); --'"friendly", "Alliance", false
ZoneText = GetZoneText()
--'Sounds
if FinalFantasylization_PlayerIscombat == false and FinalFantasylization_RewGain == true then
FinalFantasylization_PlayFile( FanFare )
FinalFantasylization_debugMsg("Victory")
FinalFantasylization_RewGain = false
end
if FinalFantasylization_UnitDies == true then
FinalFantasylization_PlayFile( Kill )
FinalFantasylization_debugMsg("Kill")
FinalFantasylization_UnitDies = false
end
--'Music
FinalFantasylization_IsPlaying = false
if FinalFantasylization_Intro == true then
if FinalFantasylization_Introing == false then
FinalFantasylization_PlayMusic( IntroSong )
end
FinalFantasylization_Introing = true
else
FinalFantasylization_Introing = false
end
if ( UnitIsGhost("Player") ) and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_IsGhosting == false then
local x = math.random(1, 2);
if x == 1 then
FinalFantasylization_PlayMusic(Dead1Song)
else
FinalFantasylization_PlayMusic(Dead2Song)
end
end
FinalFantasylization_debugMsg("Player ghosted..")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsGhosting = true
FinalFantasylization_Intro = false
FinalFantasylization_RewGain = false
else
FinalFantasylization_IsGhosting = false
end
if ( UnitIsDead("Player") ) then
if FinalFantasylization_IsDead == false then
FinalFantasylization_PlayMusic(Dies)
end
FinalFantasylization_debugMsg("Player dies..")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsDead = true
FinalFantasylization_Intro = false
FinalFantasylization_RewGain = false
else
FinalFantasylization_IsDead = false
end
if ( GetBattlefieldWinner() ) and FinalFantasylization_IsPlaying == false then
Faction1 = "Alliance"
Faction2 = "Horde"
if GetBattlefieldWinner() == 1 then --'Ally
if Faction1 == UnitFactionGroup("player") then --'Ally
FinalFantasylization_BGEnd = "Won"
else
FinalFantasylization_BGEnd = "Lost"
end
elseif GetBattlefieldWinner() == 0 then --'Horde
if Faction1 == UnitFactionGroup("player") then --'Ally
FinalFantasylization_BGEnd = "Lost"
else
FinalFantasylization_BGEnd = "Won"
end
end
if FinalFantasylization_InBGFanFaring == false then
if FinalFantasylization_BGEnd == "Lost" then
FinalFantasylization_PlayMusic(Dies)
elseif FinalFantasylization_BGEnd == "Won" then
FinalFantasylization_PlayMusic(FanFareSong)
end
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_Intro = false
FinalFantasylization_debugMsg("Player in BG:WSG")
FinalFantasylization_InBGFanFaring = true
else
FinalFantasylization_InBGFanFaring = false
FinalFantasylization_BGEnd = "Nostatus"
end
if ( ZoneName == "Warsong Gulch" ) and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_InWarsongGulch == false then
local x = math.random(1, 3);
if x == 1 then
FinalFantasylization_PlayMusic(BG1Song)
elseif x == 2 then
FinalFantasylization_PlayMusic(BG2Song)
else
FinalFantasylization_PlayMusic(BG3Song)
end
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_Intro = false
FinalFantasylization_debugMsg("Player in BG:WSG")
FinalFantasylization_InWarsongGulch = true
else
FinalFantasylization_InWarsongGulch = false
end
if ( ZoneName == "Arathi Basin" ) and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_InArathiBasin == false then
local x = math.random(1, 3);
if x == 1 then
FinalFantasylization_PlayMusic(BG1Song)
elseif x == 2 then
FinalFantasylization_PlayMusic(BG2Song)
else
FinalFantasylization_PlayMusic(BG3Song)
end
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_Intro = false
FinalFantasylization_debugMsg("Player in BG:AB")
FinalFantasylization_InArathiBasin = true
else
FinalFantasylization_InArathiBasin = false
end
if ( ZoneName == "Alterac Valley" ) and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_InAlteracValley == false then
local x = math.random(1, 3);
if x == 1 then
FinalFantasylization_PlayMusic(BG1Song)
elseif x == 2 then
FinalFantasylization_PlayMusic(BG2Song)
else
FinalFantasylization_PlayMusic(BG3Song)
end
end
FinalFantasylization_Intro = false
FinalFantasylization_IsPlaying = true
FinalFantasylization_debugMsg("Player in BG:AV")
FinalFantasylization_InAlteracValley = true
else
FinalFantasylization_InAlteracValley = false
end
if ( UnitOnTaxi("Player") ) and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_IsTaxi == false then
FinalFantasylization_PlayMusic(TaxiSong)
end
FinalFantasylization_debugMsg("Player In taxi.")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsTaxi = true
FinalFantasylization_Intro = false
else
FinalFantasylization_IsTaxi = false
end
if IsMounted() and FinalFantasylization_PlayerIscombat == true and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_IsEscape == false then
FinalFantasylization_PlayMusic(EscapeSong)
end
FinalFantasylization_debugMsg("Player In combat on mount, escape!")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsEscape = true
FinalFantasylization_Intro = false
else
FinalFantasylization_IsEscape = false
end
if FinalFantasylization_PlayerIscombat == true and FinalFantasylization_IsPlaying == false then
FinalFantasylization_debugMsg("Player In combat, Battle!")
local classification = UnitClassification("target");
--'"worldboss", "rareelite", "elite", "rare" or "normal"
if classification == "worldboss" or classification == "rareelite" or classification == "rare" then
if FinalFantasylization_IsBattling == false then
FinalFantasylization_PlayMusic(BossSong)
FinalFantasylization_debugMsg("Boss!.."..classification)
end
elseif not ( IsInInstance() ) and classification == "elite" then
if FinalFantasylization_IsBattling == false then
FinalFantasylization_PlayMusic(BossSong)
FinalFantasylization_debugMsg("Boss!.."..classification)
end
elseif ( UnitName("target") ) and UnitIsPlayer("target") and UnitIsEnemy("player", "target") and UnitHealth("target") > 0 then
if FinalFantasylization_IsBattling == false then
FinalFantasylization_PlayMusic(PVPSong)
FinalFantasylization_debugMsg("PvP!")
end
else
if FinalFantasylization_IsBattling == false then
FinalFantasylization_PlayMusic(BattleSong)
FinalFantasylization_debugMsg("PvE")
FinalFantasylization_debugMsg("But..")
if ( UnitName("target") ) then
FinalFantasylization_debugMsg("UnitName('target') == true")
end
if ( UnitIsPlayer("target") ) then
FinalFantasylization_debugMsg("UnitIsPlayer('target') == true")
end
if ( UnitIsEnemy("player", "target") ) then
FinalFantasylization_debugMsg("UnitIsEnemy('player', 'target') == true")
end
if UnitHealth("target") > 0 then
FinalFantasylization_debugMsg("UnitHealth('target') > 0 == true")
end
end
end
FinalFantasylization_Intro = false
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsBattling = true
else
FinalFantasylization_IsBattling = false
end
if IsMounted() and ( pvpType == "Hostile" ) and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_IsHostileMounting == false then
FinalFantasylization_PlayMusic(EscapeSong)
end
FinalFantasylization_debugMsg("Player mounted in hostile territory.. Escape!")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsHostileMounting = true
FinalFantasylization_Intro = false
else
FinalFantasylization_IsHostileMounting = false
end
if IsMounted() and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_IsMounting == false then
local x = math.random(1, 3);
if x == 1 then
FinalFantasylization_PlayMusic(Mounted1Song)
elseif x == 2 then
FinalFantasylization_PlayMusic(Mounted2Song)
else
FinalFantasylization_PlayMusic(Mounted3Song)
end
end
FinalFantasylization_debugMsg("Player mounted.. Chocobo!")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsMounting = true
FinalFantasylization_Intro = false
else
FinalFantasylization_IsMounting = false
end
if IsSwimming() and FinalFantasylization_IsPlaying == false then
if FinalFantasylization_IsSwimming == false then
FinalFantasylization_PlayMusic(SwimSong)
end
FinalFantasylization_debugMsg("Player swimming")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsSwimming = true
FinalFantasylization_Intro = false
else
FinalFantasylization_IsSwimming = false
end
if ( ZoneName == "Ironforge" ) and FinalFantasylization_IsPlaying == false and FinalFantasylization_Intro == false then
if FinalFantasylization_InZoneIronforge == false then
FinalFantasylization_PlayMusic(MacoSong)
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_debugMsg("Player in Ironforge")
FinalFantasylization_InZoneIronforge = true
else
FinalFantasylization_InZoneIronforge = false
end
if ( IsResting() ) and FinalFantasylization_IsPlaying == false and FinalFantasylization_Intro == false then
if FinalFantasylization_IsResting == false then
FinalFantasylization_PlayMusic(RestSong)
end
FinalFantasylization_debugMsg("Player resting")
FinalFantasylization_IsPlaying = true
FinalFantasylization_IsResting = true
else
FinalFantasylization_IsResting = false
end
if ( pvpType == "friendly" ) and FinalFantasylization_IsPlaying == false and FinalFantasylization_Intro == false then
if FinalFantasylization_InFriendlySongArea == false then
FinalFantasylization_PlayMusic(FriendlySong)
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_debugMsg("Player in Friendly Area")
FinalFantasylization_InFriendlySongArea = true
else
FinalFantasylization_InFriendlySongArea = false
end
if ( pvpType == "contested" ) and FinalFantasylization_IsPlaying == false and FinalFantasylization_Intro == false then
if FinalFantasylization_InContestedSongArea == false then
FinalFantasylization_PlayMusic(ContestedSong)
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_debugMsg("Player in Contested Area")
FinalFantasylization_InContestedSongArea = true
else
FinalFantasylization_InContestedSongArea = false
end
if ( pvpType == "hostile" ) and FinalFantasylization_IsPlaying == false and FinalFantasylization_Intro == false then
if FinalFantasylization_InHostileArea == false then
FinalFantasylization_PlayMusic(HostileSong)
end
FinalFantasylization_IsPlaying = true
FinalFantasylization_debugMsg("Player in Hostile Area")
FinalFantasylization_InHostileArea = true
else
FinalFantasylization_InHostileArea = false
end
if FinalFantasylization_IsPlaying == false and FinalFantasylization_Intro == false then
--StopMusic();
if FinalFantasylization_Isworlding == false then
FinalFantasylization_PlayMusic(FriendlySong)--'some uncontested zones returns Nil on pvpType.
end
FinalFantasylization_Isworlding = true
FinalFantasylization_debugMsg("Player does nothing")
else
FinalFantasylization_Isworlding = false
end
else
StopMusic();
end
end
function FinalFantasylization_OnEvent()
if event == "PLAYER_REGEN_DISABLED" then
FinalFantasylization_PlayerIscombat = true
FinalFantasylization_debugMsg("Player enters combat")
elseif event == "PLAYER_REGEN_ENABLED" then
FinalFantasylization_PlayerIscombat = false
FinalFantasylization_debugMsg("Player leaves combat")
FinalFantasylization_IsPVP = false
elseif event == "PLAYER_AURAS_CHANGED" then
elseif event == "PLAYER_CAMPING" then
FinalFantasylization_debugMsg("PLAYER_CAMPING test")
elseif event == "PLAYER_XP_UPDATE" then
if FinalFantasylization_PlayerIscombat == true then
FinalFantasylization_RewGain = true
end
elseif event == "PLAYER_PVP_KILLS_CHANGED" then
if FinalFantasylization_PlayerIscombat == true then
FinalFantasylization_RewGain = true
end
elseif event == "CHAT_MSG_COMBAT_HOSTILE_DEATH" then
if string.find(string.lower(arg1), "dies", 1, true) then
FinalFantasylization_UnitDies = true
end
elseif event == "PLAYER_DEAD" then
end
FinalFantasylization_GetMusic()
end`Preformatted text``Preformatted text``Preformatted text``Preformatted text``Preformatted text``Preformatted text``Preformatted text`