Thread: Skillstance
View Single Post
12-09-06, 02:00 PM   #1
Radoznali
A Deviate Faerie Dragon
 
Radoznali's Avatar
Join Date: Dec 2006
Posts: 11
[Request]-Skillstance

if someone can update this addon to wow 2.0 it would be great


localization.lua
Wanttarget = "You have no target" -- tries to target nearest enemy
WantBattleStance = "Must be in Battle Stance"
WantBerserkerStance = "Must be in Berserker Stance"
WantDefensiveStance = "Must be in Defensive Stance"
WantOffensiveStance = "Must be in Battle Stance, Berserker Stance"

battle_stance = "Battle Stance"
defensive_stance = "Defensive Stance"
berserker_stance = "Berserker Stance"

if(GetLocale() == "deDE") then
Wanttarget = "Ihr habt kein Ziel"
WantBattleStance = "Muss in Kampfhaltung sein"
WantBerserkerStance = "Muss in Berserkerhaltung sein"
WantDefensiveStance = "Muss in Verteidigungshaltung sein"
WantOffensiveStance = "Muss in Kampfhaltung, Berserkerhaltung sein"

battle_stance = "Kampfhaltung"
defensive_stance = "Verteidigungshaltung"
berserker_stance = "Berserkerhaltung"
end

if(GetLocale() == "frFR") then
Wanttarget = "Cible hors de portée"
WantBattleStance = "Doit être en Posture de combat"
WantBerserkerStance = "Doit être en Posture berserker"
WantDefensiveStance = "Doit être en Posture défensive"
WantOffensiveStance = "Doit être en Posture de combat ou berserker"

battle_stance = "Posture de combat"
defensive_stance = "Posture défensive"
berserker_stance = "Posture berserker"
end

SkillStance.lua
--SkillStance AddOn by Taloquin, original code by Leleth--

local current_argument = "";

function SkillStance_OnLoad()
_,lclass = UnitClass("player")
if (lclass == "WARRIOR") then
isWarrior = true
end
this:RegisterEvent("UI_ERROR_MESSAGE")
end

function SkillStance_OnEvent()
SkillStance_Loop()
end

function SkillStance_Loop()
local i = 1;
while(getglobal("arg"..i) ~= nil) do
current_argument = getglobal("arg"..i);
if _CheckFor( Wanttarget) then
TargetNearestEnemy()
return
end
if _CheckFor( WantBattleStance) then
if isWarrior then
CastShapeshiftForm(1)
return
end
end
if _CheckFor( WantDefensiveStance) then
if isWarrior then
CastShapeshiftForm(2)
return
end
end
if _CheckFor( WantBerserkerStance) then
if isWarrior then
CastShapeshiftForm(3)
return
end
end
if _CheckFor( WantOffensiveStance) then
if isWarrior then
CastShapeshiftForm(1)
return
end
end
i = i+1;
end
end

function _CheckFor(TheString)
if (TheString ~= nil) then
if ((string.find(current_argument, TheString) ~= nil)) then
return true
else
return false
end
else
DEFAULT_CHAT_FRAME:AddMessage("SkillStance Error: Compare String is Nil value. Check the localisation.lua for errors!")
return false;
end
end

SkillStance.toc
## Interface: 1800
## Title: SkillStance
## Author: Taloquin
## Notes: Switches stances based on skill requirements.
SkillStance.xml

SkillStance.xml
- <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="SkillStance.lua" />
<Script file="localization.lua" />
- <Frame name="SkillStanceFrame">
- <Scripts>
<OnLoad>SkillStance_OnLoad();</OnLoad>
<OnEvent>SkillStance_OnEvent();</OnEvent>
</Scripts>
</Frame>
</Ui>

Last edited by Radoznali : 12-10-06 at 01:09 PM. Reason: renameing title
  Reply With Quote