Skip to content

Commit

Permalink
Create DismountMe.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
fadichmn authored Aug 14, 2019
1 parent 7b1e82f commit 5da8f3c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions DismountMe.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
DismountMe = CreateFrame("Frame")
DismountMe:RegisterEvent("UI_ERROR_MESSAGE")

DismountMe.Buffs = { "spell_nature_swiftness", "_mount_", "_qirajicrystal_",
"ability_racial_bearform", "ability_druid_catform", "ability_druid_travelform",
"spell_nature_forceofnature", "ability_druid_aquaticform", "spell_nature_spiritwolf" }

DismountMe.Errors = { SPELL_FAILED_NOT_MOUNTED, ERR_ATTACK_MOUNTED, ERR_TAXIPLAYERALREADYMOUNTED,
SPELL_FAILED_NOT_SHAPESHIFT, SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED, SPELL_NOT_SHAPESHIFTED,
SPELL_NOT_SHAPESHIFTED_NOSPACE, ERR_CANT_INTERACT_SHAPESHIFTED, ERR_NOT_WHILE_SHAPESHIFTED,
ERR_NO_ITEMS_WHILE_SHAPESHIFTED, ERR_TAXIPLAYERSHAPESHIFTED,ERR_MOUNT_SHAPESHIFTED }

DismountMe:SetScript("OnEvent", function()
for id, errorstring in pairs(DismountMe.Errors) do
if arg1 == errorstring then
for i=0,15,1 do
currBuffTex = GetPlayerBuffTexture(i);
if (currBuffTex) then

for id, bufftype in pairs(DismountMe.Buffs) do
if string.find(string.lower(currBuffTex), bufftype) then
CancelPlayerBuff(i);
end
end
end
end
end
end
end)

0 comments on commit 5da8f3c

Please sign in to comment.