vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --DeShift AddON by Leleth-- |
2 | |||
3 | -- Basically tries to react to some errors |
||
4 | -- For example: Trying to Starfire, while sitting around in Cat-Form, having no target selected will |
||
5 | -- Stand you up on first press |
||
6 | -- Shifting to humanoid form on second |
||
7 | -- Selecting the nearest target on third |
||
8 | -- Cast Starfire |
||
9 | |||
10 | --Trying to Bash while in CatForm will |
||
11 | --Bring you to Humanoid Form |
||
12 | --Bring you to Bear Form |
||
13 | --Bash |
||
14 | |||
15 | local current_argument = ""; |
||
16 | |||
17 | function DeShift_OnLoad() |
||
18 | DEFAULT_CHAT_FRAME:AddMessage("You gain DeShift AddOn by Leleth") |
||
19 | _,lclass = UnitClass("player") |
||
20 | if (lclass == "DRUID") then |
||
21 | isDruid = true |
||
22 | end |
||
23 | this:RegisterEvent("UI_ERROR_MESSAGE") |
||
24 | end |
||
25 | |||
26 | function DeShift_OnEvent() |
||
27 | DeShift_Loop() |
||
28 | end |
||
29 | |||
30 | function DeShift_Loop() |
||
31 | local i = 1; |
||
32 | while(getglobal("arg"..i) ~= nil) do |
||
33 | current_argument = getglobal("arg"..i); |
||
34 | if _CheckFor( Wantstandup) then |
||
35 | SitOrStand() |
||
36 | return |
||
37 | end |
||
38 | if _CheckFor( Wanttarget) then |
||
39 | TargetNearestEnemy() |
||
40 | return |
||
41 | end |
||
42 | if _CheckFor( Wantspeak) then |
||
43 | if isDruid then |
||
44 | Shapeshift(humanoid_form) |
||
45 | return |
||
46 | end |
||
47 | end |
||
48 | if _CheckFor( WantHumanoidSkill) then |
||
49 | if isDruid then |
||
50 | Shapeshift(humanoid_form) |
||
51 | return |
||
52 | end |
||
53 | end |
||
54 | if _CheckFor( WantHumanoidSkillTwo) then |
||
55 | if isDruid then |
||
56 | Shapeshift(humanoid_form) |
||
57 | return |
||
58 | end |
||
59 | end |
||
60 | if _CheckFor( WantBearSkillOne) then |
||
61 | if isDruid then |
||
62 | Shapeshift(bear_form) |
||
63 | return |
||
64 | end |
||
65 | end |
||
66 | if _CheckFor( WantBearSkillTwo) then |
||
67 | if isDruid then |
||
68 | Shapeshift(bear_form) |
||
69 | return |
||
70 | end |
||
71 | end |
||
72 | if _CheckFor( WantCatSkillOne) then |
||
73 | if isDruid then |
||
74 | Shapeshift(cat_form) |
||
75 | return |
||
76 | end |
||
77 | end |
||
78 | if _CheckFor( WantCatSkillTwo) then |
||
79 | if isDruid then |
||
80 | Shapeshift(cat_form) |
||
81 | return |
||
82 | end |
||
83 | end |
||
84 | i = i+1; |
||
85 | end |
||
86 | end |
||
87 | |||
88 | |||
89 | function _CheckFor(TheString) |
||
90 | if (TheString ~= nil) then |
||
91 | if ((string.find(current_argument, TheString) ~= nil)) then |
||
92 | return true |
||
93 | else |
||
94 | return false |
||
95 | end |
||
96 | else |
||
97 | DEFAULT_CHAT_FRAME:AddMessage("DeShift Error: Compare String is Nil value. Check the localisation.lua for errors!") |
||
98 | return false; |
||
99 | end |
||
100 | end |