Skip to content

Instantly share code, notes, and snippets.

@t-mart
Created June 27, 2010 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t-mart/454694 to your computer and use it in GitHub Desktop.
Save t-mart/454694 to your computer and use it in GitHub Desktop.
From a9a78aa85012d4ef5bd25ebf74292268a5f90d00 Mon Sep 17 00:00:00 2001
From: Tim Martin <tim.martin@gatech.edu>
Date: Sun, 27 Jun 2010 01:44:24 -0400
Subject: [PATCH] mammoths will not be chosen when mounting in capitals
---
GoGoMount.lua | 21 +++++++++++++++++++++
GoGoMountData.lua | 38 +++++++++++++++++++-------------------
2 files changed, 40 insertions(+), 19 deletions(-)
diff --git a/GoGoMount.lua b/GoGoMount.lua
index d4d9378..3f7e13e 100755
--- a/GoGoMount.lua
+++ b/GoGoMount.lua
@@ -132,6 +132,11 @@ function GoGo_PreClick(button)
local level = UnitLevel("player")
GoGo_DebugAddLine("GoGo_PreClick: We are level " .. level)
GoGo_DebugAddLine("GoGo_PreClick: We are a " .. GoGo_Variables.Player.Class)
+ if GoGo_InCapitalCity() then
+ GoGo_DebugAddLine("GoGo_PreClick: We are in a capital city as per GoGo_InCapitalCity()")
+ else
+ GoGo_DebugAddLine("GoGo_PreClick: We are not in a capital city as per GoGo_InCaptialCity()")
+ end --if
if GoGo_CanFly() then
GoGo_DebugAddLine("GoGo_PreClick: We can fly here as per GoGo_CanFly()")
else
@@ -513,6 +518,9 @@ function GoGo_ChooseMount()
if (table.getn(mounts) == 0) then
mounts = GoGo_FilterMountsIn(GoGo_FilteredMounts, 25)
end --if
+ if GoGo_InCapitalCity() then
+ mounts = GoGo_FilterMountsOut(GoGo_FilteredMounts, "mammoth")
+ end --if
end --if
if table.getn(GoGo_FilteredMounts) >= 1 then
@@ -907,6 +915,19 @@ function GoGo_CheckBindings()
end --function
---------
+function GoGo_InCapitalCity()
+---------
+ local cities = { "Orgrimmar", "Undercity", "Shattrath", "Stormwind City", "Ironforge", "Dalaran", "Thunder Bluff", "Silvermoon City", "Darnassus", "The Exodar" }
+
+ for city in ipairs(cities) do
+ if string.find(GetRealZoneText(), cities[city]) then
+ return true
+ end --if
+ end --for
+ return false
+end --function
+
+---------
function GoGo_CanFly()
---------
GoGo_Variables.Player.Zone = GetRealZoneText()
diff --git a/GoGoMountData.lua b/GoGoMountData.lua
index e8b0ade..d19825d 100755
--- a/GoGoMountData.lua
+++ b/GoGoMountData.lua
@@ -340,25 +340,25 @@ GoGo_Variables.MountDB = {
[50281] = {[16] = true, [21] = true, [37] = true}, -- Black Warp Stalker
- [59785] = {[16] = true, [21] = true, [37] = true}, -- Black War Mammoth
- [59788] = {[16] = true, [21] = true, [37] = true}, -- Black War Mammoth
- [59791] = {[16] = true, [21] = true, [37] = true}, -- Wooly Mammoth
- [59793] = {[16] = true, [21] = true, [37] = true}, -- Wooly Mammoth
- [59797] = {[16] = true, [21] = true, [37] = true, [73] = true}, -- Ice Mammoth
- [59799] = {[16] = true, [21] = true, [37] = true, [73] = true}, -- Ice Mammoth
- [59802] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Ice Mammoth
- [59804] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Ice Mammoth
- [59810] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Black War Mammoth
- [59811] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Black War Mammoth
- [60136] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Caravan Mammoth
- [60140] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Caravan Mammoth
- [61425] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Traveler's Tundra Mammoth
- [61447] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Traveler's Tundra Mammoth
- [61465] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Black War Mammoth
- [61466] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Black War Mammoth
- [61467] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Black War Mammoth
- [61469] = {[16] = true, [21] = true, [37] = true, [2] = true}, -- Grand Ice Mammoth
- [61470] = {[16] = true, [21] = true, [37] = true, [2] = true, [73] = true}, -- Grand Ice Mammoth
+ [59785] = {[16] = true, [21] = true, [37] = true, ["mammoth"] = true}, -- Black War Mammoth
+ [59788] = {[16] = true, [21] = true, [37] = true, ["mammoth"] = true}, -- Black War Mammoth
+ [59791] = {[16] = true, [21] = true, [37] = true, ["mammoth"] = true}, -- Wooly Mammoth
+ [59793] = {[16] = true, [21] = true, [37] = true, ["mammoth"] = true}, -- Wooly Mammoth
+ [59797] = {[16] = true, [21] = true, [37] = true, [73] = true, ["mammoth"] = true}, -- Ice Mammoth
+ [59799] = {[16] = true, [21] = true, [37] = true, [73] = true, ["mammoth"] = true}, -- Ice Mammoth
+ [59802] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Ice Mammoth
+ [59804] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Ice Mammoth
+ [59810] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Black War Mammoth
+ [59811] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Black War Mammoth
+ [60136] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Caravan Mammoth
+ [60140] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Caravan Mammoth
+ [61425] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Traveler's Tundra Mammoth
+ [61447] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Traveler's Tundra Mammoth
+ [61465] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Black War Mammoth
+ [61466] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Black War Mammoth
+ [61467] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Black War Mammoth
+ [61469] = {[16] = true, [21] = true, [37] = true, [2] = true, ["mammoth"] = true}, -- Grand Ice Mammoth
+ [61470] = {[16] = true, [21] = true, [37] = true, [2] = true, [73] = true, ["mammoth"] = true}, -- Grand Ice Mammoth
[48954] = {[16] = true, [21] = true, [37] = true}, -- Swift Zhevra
[49322] = {[16] = true, [21] = true, [37] = true}, -- Swift Zhevra
--
1.7.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment