vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 local IMBA_HEIGAN_ERUPT_NORM = 10;
2 local IMBA_HEIGAN_ERUPT_PLAGUE = 2.75;
3 local IMBA_HEIGAN_PHASE_NORM = 90;
4 local IMBA_HEIGAN_PHASE_PLAGUE = 45;
5  
6 local IMBA_HEIGAN_AGGRO_YELL1 = "You... are next.";
7 local IMBA_HEIGAN_AGGRO_YELL2 = "You are mine now.";
8 local IMBA_HEIGAN_AGGRO_YELL3 = "I see you...";
9 local IMBA_HEIGAN_PLAGUE_CLOUD = "The end is upon you.";
10  
11 local IMBA_Heigan_Resetting=false;
12  
13 if (GetLocale()=="frFR") then
14 --Translation by A.su.K.A
15 local IMBA_HEIGAN_AGGRO_YELL1 = "Tu es%.%.%. le suivant.";
16 local IMBA_HEIGAN_AGGRO_YELL2 = "Vous \195\170tes \195\160 moi, maintenant.";
17 local IMBA_HEIGAN_AGGRO_YELL3 = "Je vous vois%.%.%.";
18 local IMBA_HEIGAN_PLAGUE_CLOUD = "Votre fin est venue.";
19 end
20  
21  
22 function IMBA_Heigan_Reset()
23 IMBA_Heigan_EruptNum=0;
24 IMBA_Heigan_PlaguePhase=false;
25 IMBA_Heigan_Resetting=true;
26 IMBA_Heigan_UpdateImage();
27 IMBA_Heigan_Resetting=false;
28 IMBA_Heigan_TimerEruption.active=false
29 IMBA_Heigan_TimerPlague.active=false;
30 IMBA_Heigan_TimerPlague:SetBarText("Plague Cloud Start");
31 end
32  
33 function IMBA_Heigan_UpdateImage()
34 if IMBA_Heigan_EruptNum==IMBA_Heigan_Cycle_Num then
35 return;
36 end
37 if IMBA_Heigan_NextErupt<GetTime() then
38 IMBA_Heigan_NextErupt=GetTime()+1.5;
39  
40 if IMBA_Heigan_PlaguePhase then
41 IMBA_Heigan_ImageSafe:SetTexture("Interface\\AddOns\\IMBA\\Mods\\NaxxPlague\\heigan\\perupt"..4-abs(IMBA_Heigan_Pos)..".blp");
42 else
43 IMBA_Heigan_ImageSafe:SetTexture("Interface\\AddOns\\IMBA\\Mods\\NaxxPlague\\heigan\\erupt"..4-abs(IMBA_Heigan_Pos)..".blp");
44 end
45  
46 IMBA_Heigan_Pos=IMBA_Heigan_Pos+1;
47  
48 if IMBA_Heigan_Pos==3 then
49 IMBA_Heigan_Pos=-3;
50 end
51  
52 IMBA_Heigan_EruptNum=IMBA_Heigan_EruptNum+1;
53 if IMBA_Heigan_EruptNum==IMBA_Heigan_Cycle_Num then
54 IMBA_Heigan_TimerEruption.repeating=false;
55 end
56 end
57  
58 if (IMBA_AddonRunning==false) and (IMBA_Heigan_Resetting==false) then
59 IMBA_Heigan_Reset();
60 end
61 end
62  
63 function IMBA_Heigan_UpdateErupt()
64 if IMBA_Heigan_PlaguePhase then
65 IMBA_Heigan_TimerEruption.timeLength=IMBA_HEIGAN_ERUPT_PLAGUE;
66 IMBA_Heigan_TimerEruption.timeEnd=GetTime()+IMBA_HEIGAN_ERUPT_PLAGUE;
67 else
68 IMBA_Heigan_TimerEruption.timeLength=IMBA_HEIGAN_ERUPT_NORM;
69 IMBA_Heigan_TimerEruption.timeEnd=GetTime()+IMBA_HEIGAN_ERUPT_NORM;
70 end
71 IMBA_Heigan_TimerEruption.repeating=true;
72 IMBA_Heigan_TimerEruption.active=true;
73  
74 if IMBA_AddonRunning==false then
75 IMBA_Heigan_Reset();
76 end
77 end
78  
79 function IMBA_Heigan_NullCallback()
80 if IMBA_AddonRunning==false then
81 IMBA_Heigan_Reset();
82 end
83 end
84  
85 function IMBA_Heigan_StartNormalTimer()
86 IMBA_Heigan_EruptNum=0;
87 IMBA_Heigan_PlaguePhase=false;
88 IMBA_Heigan_Pos=-3;
89  
90 IMBA_Heigan_TimerPlague.timeLength=IMBA_HEIGAN_PHASE_NORM;
91 IMBA_Heigan_TimerPlague.timeEnd=GetTime()+IMBA_HEIGAN_PHASE_NORM;
92 IMBA_Heigan_TimerPlague.repeating=false;
93 IMBA_Heigan_TimerPlague.active=true;
94  
95 IMBA_Heigan_TimerPlague.callback=IMBA_Heigan_NullCallback;
96 IMBA_Heigan_TimerPlague:SetBarText("Plague Cloud Start");
97  
98 IMBA_Heigan_UpdateErupt();
99 IMBA_Heigan_TimerEruption.timeEnd=GetTime()+10.1;
100 IMBA_Heigan_UpdateImage();
101  
102 IMBA_Heigan_Cycle_Num=9;
103 end
104  
105 function IMBA_Heigan_StartPlagueTimer()
106 IMBA_Heigan_EruptNum=0;
107 IMBA_Heigan_PlaguePhase=true;
108 IMBA_Heigan_Pos=-3;
109  
110 IMBA_Heigan_TimerPlague.timeLength=IMBA_HEIGAN_PHASE_PLAGUE;
111 IMBA_Heigan_TimerPlague.timeEnd=GetTime()+IMBA_HEIGAN_PHASE_PLAGUE+0.45;
112 IMBA_Heigan_TimerPlague.repeating=false;
113 IMBA_Heigan_TimerPlague.active=true;
114  
115 IMBA_Heigan_TimerPlague.callback=IMBA_Heigan_StartNormalTimer;
116 IMBA_Heigan_TimerPlague:SetBarText("Plague Cloud End");
117  
118 IMBA_Heigan_UpdateErupt();
119 IMBA_Heigan_UpdateImage();
120  
121 IMBA_Heigan_Cycle_Num=15;
122 end
123  
124 function IMBA_Heigan_Start()
125 IMBA_Heigan_StartNormalTimer();
126 IMBA_Heigan_TimerEruption.timeEnd=GetTime()+16.3;
127 end
128  
129  
130 function IMBA_Heigan_YellActivator(arg1)
131 if string.find(arg1,IMBA_HEIGAN_AGGRO_YELL1) then
132 IMBA_Heigan_Start()
133 IMBA_Heigan:Show();
134 return true;
135 elseif string.find(arg1,IMBA_HEIGAN_AGGRO_YELL2) then
136 IMBA_Heigan_Start()
137 IMBA_Heigan:Show();
138 return true;
139 elseif string.find(arg1,IMBA_HEIGAN_AGGRO_YELL3) then
140 IMBA_Heigan_Start()
141 IMBA_Heigan:Show();
142 return true;
143 end
144 return false;
145 end
146  
147 function IMBA_Heigan_RegisterEvents()
148 this:RegisterEvent("CHAT_MSG_MONSTER_YELL");
149 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
150 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_PARTY_DAMAGE");
151 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE");
152 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
153 end
154  
155 function IMBA_Heigan_UnregisterEvents()
156 this:UnregisterEvent("CHAT_MSG_MONSTER_YELL");
157 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
158 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_PARTY_DAMAGE");
159 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE");
160 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
161 end
162  
163 function IMBA_Heigan_OnLoad()
164 this:SetBackdropBorderColor(1, 1, 1, 1);
165 this:SetBackdropColor(0.0,0.0,0.0,0.6);
166  
167  
168 IMBA_Heigan_Title:SetText("Heigan Timers");
169  
170 IMBA_Heigan_TimerEruption:SetBarText("Eruption");
171 IMBA_Heigan_TimerPlague:SetBarText("Plague Cloud Start");
172 IMBA_Heigan_TimerEruption.callback=IMBA_Heigan_UpdateImage;
173  
174  
175 IMBA_Heigan_NextErupt=0;
176 IMBA_Heigan_Pos=-3;
177 IMBA_Heigan_PlaguePhase=false;
178 IMBA_Heigan_ImageSafe:SetAlpha(0.75);
179  
180  
181 IMBA_AddAddon("Heigan the Unclean", "Eruption Timer, Plague Cloud Timer, and Safe Zone Image", IMBA_LOCATIONS_NAXX_PLAGUE, nil, "IMBA_Heigan_YellActivator", IMBA_HEIGAN_AGGRO_YELL1, "IMBA_Heigan");
182 end
183  
184 function IMBA_Heigan_OnEvent(event)
185 if event == "CHAT_MSG_MONSTER_YELL" then
186 if string.find(arg1,IMBA_HEIGAN_PLAGUE_CLOUD) then
187 IMBA_Heigan_StartPlagueTimer();
188 end
189 elseif ( event == "CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE" or event == "CHAT_MSG_SPELL_CREATURE_VS_PARTY_DAMAGE" or event == "CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE" ) then
190 if string.find(arg1,"Plague Fissure ?'s Eruption") then
191 IMBA_Heigan_UpdateImage();
192 IMBA_Heigan_UpdateErupt();
193 end
194 end
195 end