Hello, this is my first attempt to create an addon, any constructive criticism is appreciated.
Mountster aims to be an extension of usual in-game mount macros.
With just one button on your action bars Mountster allows you to:
Summon specified mounts for up to 5 designated zones in world (other from Dalaran and Wintergrasp, which have special support) - works for world zones, battlegrounds etc.
Use land mount for areas where you can't fly and summon flying mount wherever flying is allowed
Summon land mount in Dalaran and flying mount upon entering Krasus' Landing subzone
Summon land mount in Wintergrasp when the battle is in progress and flying mount when it's over
Dismount everytime you're mounted
Please note that this is an early version of the addon and thus there are some limitations:
Works only with En-US (En-GB) locales - if you wanted to translate the addon, please check the image with options, translate the text and send it to me via pm or as comment, i'll create the locale files by myself, also please add there translation for "Krasus' Landing", "Wintergrasp" and "Dalaran" if needed.
Setting up:
Step 1: Install the addon, log in the game and open menu by typing "/mountsterui".
Step 2: Specify mounts by numbers, make sure that all fields in the left hand column are filled (for example if you're levelling a character and can't get in Wintergrasp or Dalaran yet, just leave the fields filled with number 1, you can change the setting at any time). Settings are saved per-character.
Step 3: After clicking the "Done" button, create macro with text "/mountster" (without the quotes), drag it on your action bars, feel free to keybind it and use instead of your current mount macro.
If you later change your settings, the changes are applied immediately, just close the window by clicking on "Done" button.
To Do:
Support for other languages
0.3a Tweaks for Dalaran - now it should mount you on flying mount when you're mounting on balcony of Purple parlor
-- *********************************************************************************************************
local MountsterTable1 = {};
---------------------------------------
local function MountsterCallPet()
for i=1,GetNumCompanions("MOUNT") do
local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("MOUNT", i);
table.insert(MountsterTable1,i,creatureName);
end
end
local function loc()
if IsMounted() == 1 then
Dismount();
elseif IsMounted() == nil then
if (GetZoneText() == "Dalaran") and (GetSubZoneText() ~="Krasus' Landing") and IsFlyableArea()== nil
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooNormalDala);
elseif (GetZoneText() == "Dalaran") and IsFlyableArea == 1 --and (GetSubZoneText()=="Krasus' Landing")
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooFlyingDala);
elseif (GetZoneText() == "Wintergrasp") and (GetWintergraspWaitTime() == nil)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooNormalWG);
elseif (GetZoneText() == "Wintergrasp") and (GetWintergraspWaitTime() >= 1)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooFlyingWG);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone1)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet1);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone2)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet2);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone3)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet3);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone4)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet4);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone5)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet5);
elseif IsFlyableArea() == 1
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooFlying);
elseif IsFlyableArea() == nil
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooNormal);
end
end
end
------------------------------------------------------------
with
Code:
-- *********************************************************************************************************
if GetLocale() == "deDE" then
DALARAN = "Dalaran";
KRASUS = "Krasus' Landeplatz";
WINTERGRASP = "Tausendwintersee";
else
DALARAN = "Dalaran";
KRASUS = "Krasus' Landing";
WINTERGRASP = "Wintergrasp";
end
-- *********************************************************************************************************
local MountsterTable1 = {};
---------------------------------------
local function MountsterCallPet()
for i=1,GetNumCompanions("MOUNT") do
local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("MOUNT", i);
table.insert(MountsterTable1,i,creatureName);
end
end
local function loc()
if IsMounted() == 1 then
Dismount();
elseif IsMounted() == nil then
if (GetZoneText() == DALARAN) and (GetSubZoneText() ~= KRASUS) and IsFlyableArea()== nil
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooNormalDala);
elseif (GetZoneText() == DALARAN) and IsFlyableArea == 1 --and (GetSubZoneText() == KRASUS)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooFlyingDala);
elseif (GetZoneText() == WINTERGRASP) and (GetWintergraspWaitTime() == nil)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooNormalWG);
elseif (GetZoneText() == WINTERGRASP) and (GetWintergraspWaitTime() >= 1)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooFlyingWG);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone1)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet1);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone2)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet2);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone3)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet3);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone4)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet4);
elseif strlower(GetZoneText()) == strlower(Mountster_SavedVariables.mstrzone5)
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrpet5);
elseif IsFlyableArea() == 1
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooFlying);
elseif IsFlyableArea() == nil
then CallCompanion("MOUNT",Mountster_SavedVariables.mstrglobalMooNormal);
end
end
end
------------------------------------------------------------
Getting this error when using the macro after lua setup on german client:
Message: Interface\AddOns\Mountster\mountster.lua:142: Usage: CallCompanion(type, index)
Time: Sat Nov 21 11:21:08 2009
Count: 1
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
[C]: ?
[C]: in function `CallCompanion'
Interface\AddOns\Mountster\mountster.lua:142: in function `loc'
Interface\AddOns\Mountster\mountster.lua:179: in function `value'
Interface\FrameXML\ChatFrame.lua:3529: in function <Interface\FrameXML\ChatFrame.lua:3461>
[C]: in function `ChatEdit_ParseText'
Interface\FrameXML\ChatFrame.lua:3177: in function `ChatEdit_SendText'
Interface\FrameXML\ChatFrame.lua:2275: in function <Interface\FrameXML\ChatFrame.lua:2268>
[C]: in function `RunMacroText'
Interface\FrameXML\SecureTemplates.lua:378: in function `handler'
Interface\FrameXML\SecureTemplates.lua:529: in function <Interface\FrameXML\SecureTemplates.lua:478>