vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | Mang Admin Notes |
||
3 | Writen by: Athrus of Sandoria |
||
4 | Website: http://mangadmin.thruhere.net |
||
5 | This is an addon i made to help GMs of MangOS servers. |
||
6 | Feel free to distrube this for free. If you paid for this, you got ripped off. |
||
7 | If you edit anything please leave my name as the creator. |
||
8 | That's all :), Enjoy. |
||
9 | |||
10 | PS. This is coded in my own unique style. AKA no comments and variable names that will |
||
11 | need to be deciphered. Edit this at your own risk of personal health loss and |
||
12 | mental instability. <3 Athrus. |
||
13 | |||
14 | Special Thanks To: |
||
15 | Weedy, for helping me test. |
||
16 | Creators of WoW UI Designer |
||
17 | www.wowwiki.com |
||
18 | wow.mmhell.com |
||
19 | www.wowinterface.com |
||
20 | ]] |
||
21 | |||
22 | |||
23 | Xvalue = "-8913.230469" |
||
24 | Yvalue = "554.632996" |
||
25 | Zvalue = "93.794403" |
||
26 | MAPvalue = "0" |
||
27 | Xfor = Xvalue; |
||
28 | Yfor = Yvalue; |
||
29 | Zfor = Zvalue; |
||
30 | Mfor = MAPValue; |
||
31 | options={["Supress"]=0, ["Notes"]=0,["PMGreet"]=0,["PMSystem"]=0, ["PMBye"]=0,["PMSystem"]=0,["PMGreetMSG"]="Greetings. I am currently busy with another player. Please wait and I will address you shortly. This is an automated message.",["PMByeMSG"]="Enjoy your travels in Azeroth.",["NotesChan"]="MangAdminDefaultChannel", ["Mini"]=0,["Maplocal"]=45}; |
||
32 | PMMessages={}; |
||
33 | PMLang={}; |
||
34 | PMNames={}; |
||
35 | PMNameColors={}; |
||
36 | version="0.10a"; |
||
37 | PMcheck=false; |
||
38 | vertext=""; |
||
39 | PMListOffset=0; |
||
40 | MessCurUser=""; |
||
41 | lastlineno=0; |
||
42 | pname=UnitName("player"); |
||
43 | pnamelen=string.len(pname); |
||
44 | pnameoutlen=2+pnamelen; |
||
45 | bypassgps=false; |
||
46 | transfer=false; |
||
47 | allowtrans=true; |
||
48 | TBBarOpen=false; |
||
49 | TB_LocationNames={}; |
||
50 | TB_LocationNames[1]={"Darnassus","10037.599609","2496.800049","1318.400024", "1"}; |
||
51 | TB_LocationNames[2]={"Booty Bay","-14440.948242","487.123627","28.746725", "0"}; |
||
52 | TB_LocationNames[3]={"Dustwallow Marsh","-2840.130859","-3338.907715","31.947880", "1"}; |
||
53 | TB_LocationNames[4]={"Gadgetzan","-7160.931152","-3816.634766","8.371173", "1"}; |
||
54 | TB_LocationNames[5]={"Ironforge","-4981.250000","-881.541992","501.660004", "0"}; |
||
55 | TB_LocationNames[6]={"Orgrimmar","1676.209961","-4315.290039","61.529301", "1"}; |
||
56 | TB_LocationNames[7]={"Stormwind","-8913.230469","554.632996","93.794403", "0"}; |
||
57 | TB_LocationNames[8]={"Undercity","1586.479980","239.561996","-52.148998", "0"}; |
||
58 | TB_LocationNames[9]={"Azshara","2711.686523","-3880.104248","102.469734","1"}; |
||
59 | TB_LocationNames[10]={"Southshore","-846.814636","-526.218323","10.981694","0"}; |
||
60 | IB_Sets={}; |
||
61 | IB_Sets[1]={"Netherwind Regalia","210"}; |
||
62 | IB_Sets[2]={"Vestments of Transcendence","211"}; |
||
63 | IB_Sets[3]={"Nemesis Raiment","212"}; |
||
64 | IB_Sets[4]={"Bloodfang Armor","213"}; |
||
65 | IB_Sets[5]={"Stormrage Raiment","214"}; |
||
66 | IB_Sets[6]={"Dragonstalker Armor","215"}; |
||
67 | IB_Sets[7]={"The Ten Storms","216"}; |
||
68 | IB_Sets[8]={"Judgement Armor","217"}; |
||
69 | IB_Sets[9]={"Battlegear of Wrath","218"}; |
||
70 | IB_Sets[10]={"Frostfire Regalia","526"}; |
||
71 | IB_Sets[11]={"Vestments of Faith","525"}; |
||
72 | IB_Sets[12]={"Plagueheart Raiment","529"}; |
||
73 | IB_Sets[13]={"Bonescythe Armor","524"}; |
||
74 | IB_Sets[14]={"Dreamwalker Raiment","521"}; |
||
75 | IB_Sets[15]={"Cryptstalker Armor","530"}; |
||
76 | IB_Sets[16]={"The Earthshatterer","527"}; |
||
77 | IB_Sets[17]={"Redemption Armor","528"}; |
||
78 | IB_Sets[18]={"Dreadnaught's Battlegear","523"}; |
||
79 | IB_Sets[19]={"5 Onyxia Bags","a1","17966","17966","17966","17966","17966"}; |
||
80 | IB_SetsDefault=18; |
||
81 | IB_Items={}; |
||
82 | IB_Items[1]={"Onyxia Hide Backpack","17966"}; |
||
83 | IB_Items[2]={"Snowball","17202"}; |
||
84 | IB_SetCreator={}; |
||
85 | IB_SetiNum=1; |
||
86 | IB_MadeNum=0; |
||
87 | newSetNum=0; |
||
88 | pkey=1; |
||
89 | gkey=1; |
||
90 | --Key, Username, Leader, Title, Body, Confirmed, Place Number, PostKey, Type |
||
91 | ANArray={} |
||
92 | ANArray[1]={0,"Athrus","Athrus","Hello","Hello World",0,1,1,"start"}; |
||
93 | ANArray[2]={1,"Ziggy","Athrus","RE: Hello","How annoying is this?\nPoop",0,2,1,"reply"}; |
||
94 | ANUsers={}; |
||
95 | ANUsers["Athrus"]={1,0}; |
||
96 | ANUsers["Ziggy"]={1,0}; |
||
97 | gkey=3; |
||
98 | pkey=3; |
||
99 | ANOffset=0; |
||
100 | ANSynch=false; |
||
101 | chanNum=0; |
||
102 | active=false; |
||
103 | postKey="`";--DO NOT CHANGE FOR THE LOVE OF GOD |
||
104 | --GM Buddy Stuff |
||
105 | GMArray={} |
||
106 | GMArray["Profs"]={333, 171, 164, 165, 202, 197, 182, 186, 393, 129, 185, 356} |
||
107 | GMArray["Weapons"]={43,44,45,46,54,55,95,118,136,160,162,172,173,176,226,228,229,473} |
||
108 | GMArray["Armor"]={293, 413, 414, 415, 433} |
||
109 | GMArray["Spells"]={674, 2480, 7918, 7919, 5019,7738} |
||
110 | GMArray["ProfSpells"]={13920, 13262,11611,9785,10662,12656,12180,2383, 11993, 10248, 2580, 10768, 10846, 18260, 818, 18248} |
||
111 | GMArray["Pimp"]={23402,6668,11540,11541,11542,11543,11544,21713,26636,31700,25953,26054,26055,26056} |
||
112 | GMArray["Morph"]={} |
||
113 | GMArray["Morph"]["Onyxia"]=8570 |
||
114 | GMArray["Morph"]["Sheep"]=856 |
||
115 | GMArray["Morph"]["Cow"]=1060 |
||
116 | GMArray["Morph"]["Bunny"]=328 |
||
117 | --Ticket Buddy Stuff |
||
118 | tCount=0; |
||
119 | tCounter=0; |
||
120 | tOffset=0; |
||
121 | tNum=0; |
||
122 | tInitial=false; |
||
123 | tArray={}--[#]={Name, Number, Message} |
||
124 | |||
125 | StaticPopupDialogs["ALLOW_TRANS"] = { |
||
126 | text = "A user is trying to send you their Teleport Buddy locations?", |
||
127 | button1 = "Accept", |
||
128 | button2 = "Decline", |
||
129 | OnAccept = function() |
||
130 | TB_LocAccept("->None<-"); |
||
131 | end, |
||
132 | timeout = 30, |
||
133 | whileDead = 1, |
||
134 | hideOnEscape = 1 |
||
135 | }; |
||
136 | StaticPopupDialogs["ALLOW_IB_TRANS"] = { |
||
137 | text = "A user is trying to send you their Item Buddy array(s)?", |
||
138 | button1 = "Accept", |
||
139 | button2 = "Decline", |
||
140 | OnAccept = function() |
||
141 | IB_ARRAYAccept("->None<-"); |
||
142 | end, |
||
143 | timeout = 30, |
||
144 | whileDead = 1, |
||
145 | hideOnEscape = 1 |
||
146 | }; |
||
147 | StaticPopupDialogs["TEST_SET"] = { |
||
148 | text = "Your new set needs to be tested. MangAdmin will now create each of the items. Were all the items created properly?", |
||
149 | button1 = "Yes", |
||
150 | button2 = "No", |
||
151 | OnAccept = function() |
||
152 | SetCreator_Confirm(); |
||
153 | end, |
||
154 | OnCancel = function () |
||
155 | SetCreator_Fail(); |
||
156 | end, |
||
157 | timeout = 0, |
||
158 | whileDead = 1, |
||
159 | hideOnEscape = 1 |
||
160 | }; |
||
161 | |||
162 | local lOriginalChatFrame_OnEvent; |
||
163 | |||
164 | function MangAdmin_EventHandler(event) |
||
165 | if ( event == "VARIABLES_LOADED" ) then |
||
166 | -- if (options)then |
||
167 | Map_Pos(); |
||
168 | MenuManager("Mini"); |
||
169 | tB_Initialize(); |
||
170 | |||
171 | -- else |
||
172 | |||
173 | -- end |
||
174 | end |
||
175 | end |
||
176 | |||
177 | function MangAdmin_OnLoad() |
||
178 | |||
179 | lOriginalChatFrame_OnEvent = ChatFrame_OnEvent; |
||
180 | ChatFrame_OnEvent = MA_ChatFrame_OnEvent; |
||
181 | |||
182 | SLASH_MANGADMIN1 = "/mangadmin"; |
||
183 | SLASH_MANGADMIN2 = "/ma"; |
||
184 | |||
185 | SlashCmdList["MANGADMIN"] = function(msg) |
||
186 | MangAdmin_SlashCommandHandler(msg); |
||
187 | end |
||
188 | |||
189 | |||
190 | this:RegisterEvent("CHAT_MSG_SYSTEM"); |
||
191 | this:RegisterEvent("CHAT_MSG_WHISPER"); |
||
192 | this:RegisterEvent("CHAT_MSG_CHANNEL"); |
||
193 | this:RegisterEvent("VARIABLES_LOADED"); |
||
194 | outSYS("MangAdmin Loaded v"..version); |
||
195 | out("Type .gps to place a bookmark."); |
||
196 | |||
197 | |||
198 | end |
||
199 | |||
200 | |||
201 | |||
202 | function MangReset() |
||
203 | Xvalue = "-8913.230469" |
||
204 | Yvalue = "554.632996" |
||
205 | Zvalue = "93.794403" |
||
206 | MAPvalue = "0" |
||
207 | options={["Supress"]=0, ["Notes"]=0,["PMGreet"]=0,["PMSystem"]=0, ["PMBye"]=0,["PMSystem"]=0,["PMGreetMSG"]="Greetings. I am currently busy with another player. Please wait and I will address you shortly. This is an automated message.",["PMByeMSG"]="Enjoy your travels in Azeroth.",["NotesChan"]="MangAdminDefaultChannel", ["Mini"]=0,["Maplocal"]=45 }; |
||
208 | PMMessages={}; |
||
209 | PMNames={}; |
||
210 | PMNameColors={}; |
||
211 | PMcheck=false; |
||
212 | vertext=""; |
||
213 | PMListOffset=0; |
||
214 | MessCurUser=""; |
||
215 | lastlineno=0; |
||
216 | pname=UnitName("player"); |
||
217 | pnamelen=string.len(pname); |
||
218 | pnameoutlen=2+pnamelen; |
||
219 | bypassgps=false; |
||
220 | transfer=false; |
||
221 | allowtrans=true; |
||
222 | TB_LocationNames={}; |
||
223 | TB_LocationNames[1]={"Darnassus","10037.599609","2496.800049","1318.400024", "1"}; |
||
224 | TB_LocationNames[2]={"Booty Bay","-14440.948242","487.123627","28.746725", "0"}; |
||
225 | TB_LocationNames[3]={"Dustwallow Marsh","-2840.130859","-3338.907715","31.947880", "1"}; |
||
226 | TB_LocationNames[4]={"Gadgetzan","-7160.931152","-3816.634766","8.371173", "1"}; |
||
227 | TB_LocationNames[5]={"Ironforge","-4981.250000","-881.541992","501.660004", "0"}; |
||
228 | TB_LocationNames[6]={"Orgrimmar","1676.209961","-4315.290039","61.529301", "1"}; |
||
229 | TB_LocationNames[7]={"Stormwind","-8913.230469","554.632996","93.794403", "0"}; |
||
230 | TB_LocationNames[8]={"Undercity","1586.479980","239.561996","-52.148998", "0"}; |
||
231 | TB_LocationNames[9]={"Azshara","2711.686523","-3880.104248","102.469734","1"}; |
||
232 | TB_LocationNames[10]={"Southshore","-846.814636","-526.218323","10.981694","0"}; |
||
233 | IB_Sets={}; |
||
234 | IB_Sets[1]={"Netherwind Regalia","210"}; |
||
235 | IB_Sets[2]={"Vestments of Transcendence","211"}; |
||
236 | IB_Sets[3]={"Nemesis Raiment","212"}; |
||
237 | IB_Sets[4]={"Bloodfang Armor","213"}; |
||
238 | IB_Sets[5]={"Stormrage Raiment","214"}; |
||
239 | IB_Sets[6]={"Dragonstalker Armor","215"}; |
||
240 | IB_Sets[7]={"The Ten Storms","216"}; |
||
241 | IB_Sets[8]={"Judgement Armor","217"}; |
||
242 | IB_Sets[9]={"Battlegear of Wrath","218"}; |
||
243 | IB_Sets[10]={"Frostfire Regalia","526"}; |
||
244 | IB_Sets[11]={"Vestments of Faith","525"}; |
||
245 | IB_Sets[12]={"Plagueheart Raiment","529"}; |
||
246 | IB_Sets[13]={"Bonescythe Armor","524"}; |
||
247 | IB_Sets[14]={"Dreamwalker Raiment","521"}; |
||
248 | IB_Sets[15]={"Cryptstalker Armor","530"}; |
||
249 | IB_Sets[16]={"The Earthshatterer","527"}; |
||
250 | IB_Sets[17]={"Redemption Armor","528"}; |
||
251 | IB_Sets[18]={"Dreadnaught's Battlegear","523"}; |
||
252 | IB_Sets[19]={"5 Onyxia Bags","a1","17966","17966","17966","17966","17966"}; |
||
253 | IB_SetsDefault=18; |
||
254 | IB_Items={}; |
||
255 | IB_Items[1]={"Onyxia Hide Backpack","17966"}; |
||
256 | IB_Items[2]={"Snowball","17202"}; |
||
257 | IB_SetCreator={}; |
||
258 | IB_SetiNum=1; |
||
259 | IB_MadeNum=0; |
||
260 | newSetNum=0; |
||
261 | end |
||
262 | |||
263 | |||
264 | function out(text) |
||
265 | DEFAULT_CHAT_FRAME:AddMessage(text); |
||
266 | end |
||
267 | |||
268 | function outHUD(text) |
||
269 | UIErrorsFrame:AddMessage(text, 1.0, 1.0, 0, 1,10); |
||
270 | end |
||
271 | |||
272 | function outERROR(text) |
||
273 | DEFAULT_CHAT_FRAME:AddMessage(text, 1.0, 0.0, 0.0, 1.0); |
||
274 | UIErrorsFrame:AddMessage(text, 1.0, 1.0, 0, 1,10); |
||
275 | end |
||
276 | |||
277 | function outPM(text,recipient) |
||
278 | SendChatMessage(text, "WHISPER", nil,recipient); |
||
279 | end |
||
280 | |||
281 | function outPMSET(text,lang, recipient) |
||
282 | SendChatMessage(text, "WHISPER", lang ,recipient); |
||
283 | end |
||
284 | |||
285 | function outSAY(text) |
||
286 | SendChatMessage(text, "SAY", nil,nil); |
||
287 | end |
||
288 | |||
289 | function outSYS(text) |
||
290 | DEFAULT_CHAT_FRAME:AddMessage(text, 1.0, 1.0, 0, 0); |
||
291 | end |
||
292 | |||
293 | function outNotes(text) |
||
294 | SendChatMessage(text, "CHANNEL", nil, chanNum); |
||
295 | end |
||
296 | |||
297 | function outMESS(text,name) |
||
298 | MessengerMainFrame:AddMessage(text); |
||
299 | end |
||
300 | |||
301 | |||
302 | |||
303 | function MangAdmin_SlashCommandHandler(msg) |
||
304 | if (msg == "reload") then |
||
305 | ReloadUI(); |
||
306 | elseif (msg == "mark" or msg=="back") then |
||
307 | MangAdmin_Mark(msg); |
||
308 | out("Returning to your bookmarked location."); |
||
309 | elseif (msg == "pm") then |
||
310 | MangAdminForm4:Show(); |
||
311 | elseif (msg == "tele" or msg=="teleport") then |
||
312 | MangAdminForm6:Show(); |
||
313 | elseif (msg == "item") then |
||
314 | MangAdminForm7:Show(); |
||
315 | elseif (msg == "help") then |
||
316 | MangHelp(); |
||
317 | elseif (msg == "info") then |
||
318 | MangAdminForm2:Show(); |
||
319 | elseif (msg == "options") then |
||
320 | MangAdminForm1:Show(); |
||
321 | elseif (msg == "menu") then |
||
322 | MangAdminForm:Show(); |
||
323 | elseif (msg == "reset") then |
||
324 | MangReset(); |
||
325 | elseif (msg == "gm") then |
||
326 | MangAdminForm11:Show(); |
||
327 | elseif (msg == "easter") then |
||
328 | Secret(); |
||
329 | out("What have you found???!"); |
||
330 | else |
||
331 | MangAdminFrames_Toggle(msg); |
||
332 | end |
||
333 | end |
||
334 | |||
335 | function MangAdminFrames_Toggle(num) |
||
336 | local frame = getglobal("MangAdminForm" .. num) |
||
337 | if (frame) then |
||
338 | if( frame:IsVisible() ) then |
||
339 | frame:Hide(); |
||
340 | else |
||
341 | frame:Show(); |
||
342 | end |
||
343 | end |
||
344 | end |
||
345 | |||
346 | function MangAdmin_Mark(arg1) |
||
347 | msg=".go "..Xvalue.." "..Yvalue.." "..Zvalue.." "..MAPvalue; |
||
348 | outSAY(msg); |
||
349 | end |
||
350 | |||
351 | function InfoLoad() |
||
352 | local vertext="Version "..version; |
||
353 | local fs = getglobal("LBLVersion".."Label"); |
||
354 | fs:SetText(vertext); |
||
355 | end |
||
356 | |||
357 | |||
358 | function Tele_Load(item) |
||
359 | UIDropDownMenu_ClearAll(CBXGo); |
||
360 | UIDropDownMenu_ClearAll(CBXBring); |
||
361 | UIDropDownMenu_Initialize(CBXGo, GoButtons); |
||
362 | UIDropDownMenu_SetButtonWidth(300,CBXGo); |
||
363 | UIDropDownMenu_Initialize(CBXBring, BringButtons); |
||
364 | |||
365 | end |
||
366 | |||
367 | function GoButtons() |
||
368 | local i = 0; |
||
369 | local info = {}; |
||
370 | info.text = "Available Characters"; |
||
371 | info.textHeight = 18; |
||
372 | info.isTitle = 1; |
||
373 | UIDropDownMenu_AddButton(info); |
||
374 | for i = 1, table.getn(PMNames) do |
||
375 | info = {}; |
||
376 | info.text = PMNames[i]; |
||
377 | info.textHeight = 18; |
||
378 | info.func = function() |
||
379 | UIDropDownMenu_SetSelectedID(CBXGo, this:GetID(), 0); |
||
380 | GoBoxAutoChange(); |
||
381 | end |
||
382 | UIDropDownMenu_AddButton(info); |
||
383 | end |
||
384 | UIDropDownMenu_SetText("Characters",CBXGo); |
||
385 | |||
386 | end |
||
387 | |||
388 | function BringButtons() |
||
389 | local i = 0; |
||
390 | local info = {}; |
||
391 | info.text = "Available Characters"; |
||
392 | info.textHeight = 18; |
||
393 | info.isTitle = 1; |
||
394 | UIDropDownMenu_AddButton(info); |
||
395 | for i = 1, table.getn(PMNames) do |
||
396 | info = {}; |
||
397 | info.text = PMNames[i]; |
||
398 | info.textHeight = 18; |
||
399 | info.func = function() |
||
400 | UIDropDownMenu_SetSelectedID(CBXBring, this:GetID(), 0); |
||
401 | BringBoxAutoChange(); |
||
402 | end |
||
403 | UIDropDownMenu_AddButton(info); |
||
404 | end |
||
405 | UIDropDownMenu_SetText("Characters",CBXBring); |
||
406 | |||
407 | end |
||
408 | |||
409 | function GoBoxAutoChange() |
||
410 | if (UIDropDownMenu_GetText(CBXGo)~="Characters")then |
||
411 | BXGo:SetText(UIDropDownMenu_GetText(CBXGo)); |
||
412 | end |
||
413 | end |
||
414 | |||
415 | function BringBoxAutoChange() |
||
416 | if (UIDropDownMenu_GetText(CBXBring)~="Characters")then |
||
417 | BXBring:SetText(UIDropDownMenu_GetText(CBXBring)); |
||
418 | end |
||
419 | end |
||
420 | |||
421 | function Tele_Event(event) |
||
422 | result=""; |
||
423 | if (event=="GO" and (BXGo:GetText() and BXGo:GetText()~="")) then |
||
424 | result=".goname "..BXGo:GetText(); |
||
425 | outSAY(result); |
||
426 | end |
||
427 | |||
428 | if (event=="BRING" and (BXBring:GetText() and BXBring:GetText()~="")) then |
||
429 | result=".namego "..BXBring:GetText(); |
||
430 | outSAY(result); |
||
431 | end |
||
432 | |||
433 | end |
||
434 | |||
435 | |||
436 | function PM_Open(arg1) |
||
437 | if(options["PMSystem"]==1)then |
||
438 | MangAdminForm4:Show(); |
||
439 | MangAdminForm:Hide(); |
||
440 | else |
||
441 | outERROR("Private Message System is not enabled in the options."); |
||
442 | end |
||
443 | end |
||
444 | |||
445 | function OptionsLoad(item) |
||
446 | if(item=="CHKNotes") then |
||
447 | if(options["Notes"]==1) then |
||
448 | CHKNotes:SetChecked(1); |
||
449 | end |
||
450 | end |
||
451 | |||
452 | if(item=="CHKPMGreet") then |
||
453 | if(options["PMGreet"]==1) then |
||
454 | CHKPMGreet:SetChecked(1); |
||
455 | end |
||
456 | end |
||
457 | |||
458 | if(item=="BXPMGreetMSG") then |
||
459 | --if(options["PMGreet"]==1) then |
||
460 | BXPMGreetMSG:SetText(options["PMGreetMSG"]); |
||
461 | -- end |
||
462 | end |
||
463 | |||
464 | if(item=="BXPMByeMSG") then |
||
465 | BXPMByeMSG:SetText(options["PMByeMSG"]); |
||
466 | |||
467 | end |
||
468 | |||
469 | if(item=="BXNotesChan") then |
||
470 | -- if(options["Notes"]==1) then |
||
471 | BXNotesChan:SetText(options["NotesChan"]); |
||
472 | -- end |
||
473 | end |
||
474 | |||
475 | if(item=="CHKPMSupress") then |
||
476 | if(options["Supress"]==1) then |
||
477 | CHKPMSupress:SetChecked(1); |
||
478 | end |
||
479 | end |
||
480 | if(item=="CHKPMBye") then |
||
481 | if(options["PMBye"]==1) then |
||
482 | CHKPMBye:SetChecked(1); |
||
483 | end |
||
484 | end |
||
485 | |||
486 | if(item=="CHKPMSystem") then |
||
487 | if(options["PMSystem"]==1) then |
||
488 | CHKPMSystem:SetChecked(1); |
||
489 | CHKPMBye:Show(); |
||
490 | CHKPMSupress:Show(); |
||
491 | end |
||
492 | end |
||
493 | |||
494 | if(item=="CHKMini") then |
||
495 | if(options["Mini"]==1) then |
||
496 | CHKMini:SetChecked(1); |
||
497 | end |
||
498 | end |
||
499 | local Slider=getglobal("SliderLocalSlider"); |
||
500 | Slider:SetValue(options["Maplocal"]); |
||
501 | |||
502 | end |
||
503 | |||
504 | function OptionsSave(arg1) |
||
505 | if (CHKPMGreet:GetChecked()) then |
||
506 | options["PMGreet"]=1; |
||
507 | else |
||
508 | options["PMGreet"]=0; |
||
509 | end |
||
510 | |||
511 | if (CHKPMSystem:GetChecked()) then |
||
512 | options["PMSystem"]=1; |
||
513 | else |
||
514 | options["PMSystem"]=0; |
||
515 | |||
516 | end |
||
517 | |||
518 | if (CHKPMBye:GetChecked()) then |
||
519 | |||
520 | options["PMBye"]=1; |
||
521 | |||
522 | else |
||
523 | options["PMBye"]=0; |
||
524 | end |
||
525 | |||
526 | if (CHKPMSupress:GetChecked()) then |
||
527 | options["Supress"]=1; |
||
528 | else |
||
529 | options["Supress"]=0; |
||
530 | |||
531 | end |
||
532 | |||
533 | if (CHKNotes:GetChecked()) then |
||
534 | options["Notes"]=1; |
||
535 | else |
||
536 | options["Notes"]=0; |
||
537 | end |
||
538 | |||
539 | local Slider=getglobal("SliderLocalSlider"); |
||
540 | options["Maplocal"]=Slider:GetValue(); |
||
541 | |||
542 | options["PMGreetMSG"]=BXPMGreetMSG:GetText(); |
||
543 | options["PMByeMSG"]=BXPMByeMSG:GetText(); |
||
544 | options["NotesChan"]=BXNotesChan:GetText(); |
||
545 | |||
546 | if (CHKMini:GetChecked()) then |
||
547 | options["Mini"]=1; |
||
548 | else |
||
549 | options["Mini"]=0; |
||
550 | |||
551 | end |
||
552 | out("Options Saved"); |
||
553 | end |
||
554 | |||
555 | function OptionsEvents(event) |
||
556 | if (event=="SAVE")then |
||
557 | OptionsSave(); |
||
558 | elseif (event=="SAVE&CLOSE")then |
||
559 | OptionsSave(); |
||
560 | MangAdminForm1:Hide(); |
||
561 | MangAdminForm:Show(); |
||
562 | elseif (event=="CLOSE")then |
||
563 | MangAdminForm1:Hide(); |
||
564 | MangAdminForm:Show(); |
||
565 | end |
||
566 | |||
567 | if(event=="PMSYSCLICK")then |
||
568 | if (CHKPMSystem:GetChecked()) then |
||
569 | CHKPMBye:Show(); |
||
570 | CHKPMSupress:Show(); |
||
571 | else |
||
572 | CHKPMBye:Hide(); |
||
573 | CHKPMBye:SetChecked(0); |
||
574 | CHKPMSupress:Hide(); |
||
575 | CHKPMSupress:SetChecked(0); |
||
576 | end |
||
577 | end |
||
578 | end |
||
579 | |||
580 | function PMChecker(arg1,arg2) |
||
581 | if (PMcheck == true)then |
||
582 | return true; |
||
583 | else |
||
584 | if (PMNames[arg1]==arg2) then |
||
585 | return true; |
||
586 | else |
||
587 | return false; |
||
588 | end |
||
589 | end |
||
590 | end |
||
591 | |||
592 | function PM_AutoGreet(name) |
||
593 | outPM(options["PMGreetMSG"],name); |
||
594 | end |
||
595 | |||
596 | function explode(d,p) |
||
597 | t={} |
||
598 | ll=0 |
||
599 | while true do |
||
600 | l=string.find(p,d,ll+1,true) -- find the next d in the string |
||
601 | if l~=nil then -- if "not not" found then.. |
||
602 | table.insert(t, string.sub(p,ll,l-1)) -- Save it in our array. |
||
603 | ll=l+1 -- save just after where we found it for searching next time. |
||
604 | else |
||
605 | table.insert(t, string.sub(p,ll)) -- Save what's left in our array. |
||
606 | break -- Break at end, as it should be, according to the lua manual. |
||
607 | end |
||
608 | end |
||
609 | return t |
||
610 | end |
||
611 | |||
612 | function MA_ChatFrame_OnEvent(event) |
||
613 | CkMsg={} |
||
614 | PMcheck=false; |
||
615 | shutty=false; |
||
616 | local quiet=false; |
||
617 | |||
618 | if strsub(event,1,24) == "CHAT_MSG_WHISPER_INFORM" then |
||
619 | local msg = arg1; |
||
620 | local plr = arg2; |
||
621 | local lang = arg3; |
||
622 | local num=0; |
||
623 | local messNum=0; |
||
624 | quiet=true; |
||
625 | if ( (msg and msg ~= nil) and (plr and plr ~= nil) and msg~=options["PMByeMSG"] ) then |
||
626 | |||
627 | for i=1,table.getn(PMNames) do |
||
628 | PMcheck=PMChecker(i,plr); |
||
629 | num=i; |
||
630 | end |
||
631 | num= num +1; |
||
632 | if (PMcheck == false) then |
||
633 | PMNames[num]=plr; |
||
634 | PMMessages[plr]={}; |
||
635 | PMLang[plr]=lang; |
||
636 | end |
||
637 | if (strsub(msg,1,11)=="INCLOCATION" or strsub(msg,1,9)=="TRANSDONE" or strsub(msg,1,15)=="ACCEPTTRANSSEND" or strsub(msg,1,14)=="INCTRANSTBLOCS" or strsub(msg,1,11)=="INCIBARRAYS" or strsub(msg,1,10)=="IBACCEPTED" or strsub(msg,1,13)=="TRANSCOMPLETE" or strsub(msg,1,19)=="RETURNTRANSCOMPLETE" or strsub(msg,1,8)=="INDARRAY" or strsub(msg,1,8)=="SETARRAY") then |
||
638 | transfer=true; |
||
639 | end |
||
640 | |||
641 | messNum=table.getn(PMMessages[plr]) + 1; |
||
642 | |||
643 | if (transfer==false)then |
||
644 | if (msg~=options["PMByeMSG"])then |
||
645 | msg="["..pname.."]: "..msg; |
||
646 | PMMessages[plr][messNum]=msg; |
||
647 | end |
||
648 | end |
||
649 | |||
650 | end |
||
651 | elseif strsub(event,1,16) == "CHAT_MSG_SYSTEM" then |
||
652 | local msg = arg1; |
||
653 | local plr = arg2; |
||
654 | |||
655 | if ( (msg and msg ~= nil) and (plr and plr ~= nil) ) then |
||
656 | --out("Received: "..msg); |
||
657 | CkMsg =explode(" ",msg); |
||
658 | if (CkMsg[1]=="Map:" and bypassgps==false) then |
||
659 | MAPvalue=CkMsg[2]; |
||
660 | elseif (CkMsg[1]=="Map:" and bypassgps==true) then |
||
661 | Mfor=CkMsg[2]; |
||
662 | elseif (CkMsg[1]=="X:" and bypassgps==false) then |
||
663 | Xvalue=CkMsg[2]; |
||
664 | Yvalue=CkMsg[4]; |
||
665 | Zvalue=CkMsg[6]; |
||
666 | outHUD("Bookmark Placed. Type /ma mark to return here."); |
||
667 | elseif (CkMsg[1]=="X:" and bypassgps==true) then |
||
668 | Xfor=CkMsg[2]; |
||
669 | Yfor=CkMsg[4]; |
||
670 | Zfor=CkMsg[6]; |
||
671 | TB_Setter(); |
||
672 | elseif (CkMsg[1]=="Tickets" and CkMsg[2]=="count:") then |
||
673 | for i=1, 10 do |
||
674 | getglobal("BTNTB"..i):Hide(); |
||
675 | end |
||
676 | tCount=0; |
||
677 | tCounter=0; |
||
678 | tArray={}; |
||
679 | tB_LoadTickets(CkMsg[3]); |
||
680 | shutty=true; |
||
681 | elseif (CkMsg[1]=="Ticket" and CkMsg[2]=="of") then |
||
682 | tb_AddTicket(msg,CkMsg[3],strsub(CkMsg[5],1,1) ); |
||
683 | shutty=true; |
||
684 | elseif (CkMsg[1]=="New" and CkMsg[2]=="ticket") then |
||
685 | outSAY(".ticket"); |
||
686 | end |
||
687 | |||
688 | end |
||
689 | elseif strsub(event,1,16) == "CHAT_MSG_CHANNEL" then |
||
690 | local msg = arg1; |
||
691 | local plr = arg2; |
||
692 | local chanNumber = arg8; |
||
693 | --out(event); |
||
694 | -- if (chanNumber == chanNum and pname==plr) then |
||
695 | -- --transfer=true; |
||
696 | -- elseif (chanNumber == chanNum and pname~=plr) then |
||
697 | -- local expMsg = explode(postKey,msg); |
||
698 | -- if (expMsg[1]== "CLUSTER UPDATEME")then |
||
699 | -- if (ANSynch==true and active==false)then |
||
700 | -- outNotes("CLUSTER UPDATE AVAILABLE"); |
||
701 | -- active=true; |
||
702 | -- else |
||
703 | -- outNotes("CLUSTER UPDATE BUSY"); |
||
704 | -- end |
||
705 | -- elseif (expMsg[1]== "CLUSTER UPDATE AVAILABLE" and active==false and ANSynch==false) then |
||
706 | -- active=true; |
||
707 | -- outPM("NOTES UPDATEME",plr); |
||
708 | -- elseif (expMsg[1]== "CLUSTER UPDATE BUSY") then |
||
709 | -- |
||
710 | -- elseif (expMsg[1]== "CLUSTER POST " and table.getn(expMsg)==9) then |
||
711 | -- --out(expMsg[2]); |
||
712 | -- AN_GET_Post(expMsg[2],expMsg[3],expMsg[4],expMsg[5],expMsg[6],expMsg[7],expMsg[8],expMsg[9]); |
||
713 | -- |
||
714 | -- elseif (expMsg[1]== "YOU_JOINED") then |
||
715 | -- elseif (expMsg[1]== "YOU_LEFT") then |
||
716 | -- else |
||
717 | -- out("Invalid AdminNotes command recieved from: "..plr..msg); |
||
718 | -- end |
||
719 | -- --transfer=true; |
||
720 | -- |
||
721 | -- |
||
722 | -- end |
||
723 | elseif strsub(event,1,17) == "CHAT_MSG_WHISPER" then |
||
724 | local msg = arg1; |
||
725 | local plr = arg2; |
||
726 | local chanNumber = arg7; |
||
727 | local num=0; |
||
728 | local messNum=0; |
||
729 | local post=0; |
||
730 | local exist=0; |
||
731 | quiet=true; |
||
732 | -- out(event); |
||
733 | if (strsub(msg,1,14)=="NOTES UPDATEME") then |
||
734 | local newmsg= explode (",",msg); |
||
735 | for j=1, j<table.getn(ANArray) do |
||
736 | post=0; |
||
737 | exist=0; |
||
738 | for i=2, i < table.getn(newmsg) do |
||
739 | if (newmsg[i]==ANArray[j][2] and newmsg[i+1]>ANArray[8]) then |
||
740 | post=1; |
||
741 | exist=1; |
||
742 | elseif (newmsg[i]==ANArray[j][2]) then |
||
743 | exist=1; |
||
744 | end |
||
745 | i=i+1; |
||
746 | end |
||
747 | if ((post==1 or exist==0) and plr~=ANArray[j][2]) then |
||
748 | outPM("NOTES POST"..postKey..ANArray[j][2]..postKey..ANArray[j][3]..postKey..ANArray[j][4]..postKey..ANArray[j][5]..postKey..ANArray[j][6]..postKey..ANArray[j][7]..postKey..ANArray[j][8]..postKey..ANArray[j][9],plr); |
||
749 | end |
||
750 | end |
||
751 | end |
||
752 | |||
753 | |||
754 | if (strsub(msg,1,10)=="NOTES POST") then |
||
755 | local newmsg= explode (postKey,msg); |
||
756 | AN_GET_Post(newmsg[2],newmsg[3],newmsg[4],newmsg[5],newmsg[6],newmsg[7],newmsg[8],newmsg[9]); |
||
757 | end |
||
758 | |||
759 | if (strsub(msg,1,14)=="INCTRANSTBLOCS") then |
||
760 | --transfer=true; |
||
761 | StaticPopupDialogs["ALLOW_TRANS"].text=plr.." is trying to send you Teleport Buddy locations. Do you accept?"; |
||
762 | StaticPopupDialogs["ALLOW_TRANS"].OnAccept= function() TB_LocAccept(plr); end; |
||
763 | StaticPopup_Show ("ALLOW_TRANS"); |
||
764 | end |
||
765 | if (strsub(msg,1,15)=="ACCEPTTRANSSEND") then |
||
766 | -- transfer=true; |
||
767 | TB_SendLocs(plr); |
||
768 | end |
||
769 | |||
770 | if (strsub(msg,1,9)=="TRANSDONE") then |
||
771 | -- transfer=true; |
||
772 | out("Transfer Complete"); |
||
773 | outHUD("Transfer Complete"); |
||
774 | outPM("Transfer Done.",plr) |
||
775 | MangAdminScrollBar_Update2(); |
||
776 | allowtrans=false; |
||
777 | end |
||
778 | |||
779 | if (strsub(msg,1,11)=="INCLOCATION") then |
||
780 | --transfer=true; |
||
781 | local STOP=false; |
||
782 | local locals =explode("`",msg); |
||
783 | local startnum=table.getn(TB_LocationNames)+1; |
||
784 | for i=9,table.getn(TB_LocationNames) do |
||
785 | if (locals[2]==TB_LocationNames[i][1]) then |
||
786 | STOP=true; |
||
787 | end |
||
788 | end |
||
789 | if (STOP==false) then |
||
790 | TB_LocationNames[startnum]={locals[2],locals[3],locals[4],locals[5],locals[6]}; |
||
791 | end |
||
792 | end |
||
793 | |||
794 | if (strsub(msg,1,11)=="INCIBARRAYS") then |
||
795 | StaticPopupDialogs["ALLOW_IB_TRANS"].text=plr.." is trying to send you Item Buddy array(s). Do you accept?"; |
||
796 | StaticPopupDialogs["ALLOW_IB_TRANS"].OnAccept= function() IB_ARRAYAccept(plr); end; |
||
797 | StaticPopup_Show ("ALLOW_IB_TRANS"); |
||
798 | end |
||
799 | |||
800 | if (strsub(msg,1,10)=="IBACCEPTED") then |
||
801 | -- transfer=true; |
||
802 | IB_SendArray(plr); |
||
803 | end |
||
804 | |||
805 | if (strsub(msg,1,13)=="TRANSCOMPLETE") then |
||
806 | out("Transfer Complete"); |
||
807 | outPM("RETURNTRANSCOMPLETE",plr) |
||
808 | end |
||
809 | |||
810 | if (strsub(msg,1,19)=="RETURNTRANSCOMPLETE") then |
||
811 | out("Transfer Complete"); |
||
812 | end |
||
813 | |||
814 | if (strsub(msg,1,8)=="INDARRAY") then |
||
815 | --transfer=true; |
||
816 | local startnum=table.getn(IB_Items)+1; |
||
817 | local STOP=false |
||
818 | local locals =explode("`",msg); |
||
819 | |||
820 | for i=1,table.getn(IB_Items) do |
||
821 | if (locals[2]==IB_Items[i][1]) then |
||
822 | STOP=true; |
||
823 | end |
||
824 | end |
||
825 | if (STOP==false) then |
||
826 | IB_Items[startnum]={locals[2],locals[3]}; |
||
827 | end |
||
828 | |||
829 | end |
||
830 | |||
831 | if (strsub(msg,1,8)=="SETARRAY") then |
||
832 | local locals =explode("`",msg); |
||
833 | local IB_MadeNums=0; |
||
834 | local taken=false; |
||
835 | local startnum=table.getn(IB_Sets)+1; |
||
836 | for i=1,table.getn(IB_Sets) do |
||
837 | if(strsub(IB_Sets[i][2],0,1)=="a") then |
||
838 | IB_MadeNums=IB_MadeNums+1; |
||
839 | end |
||
840 | if (locals[2]==IB_Sets[i][1])then |
||
841 | taken=true; |
||
842 | end |
||
843 | end |
||
844 | IB_MadeNums=IB_MadeNums+1; |
||
845 | if (taken==false) then |
||
846 | IB_SetiNum=1; |
||
847 | local label = getglobal("LBLiNum".."Label") |
||
848 | IB_Sets[startnum]={}; |
||
849 | IB_Sets[startnum][1]="New"--locals[2]; |
||
850 | IB_Sets[startnum][2]="a"..IB_MadeNums; |
||
851 | for i=3, table.getn(locals) do |
||
852 | IB_Sets[startnum][i]=locals[i+1] |
||
853 | end |
||
854 | |||
855 | end |
||
856 | |||
857 | --transfer=true; |
||
858 | |||
859 | end |
||
860 | |||
861 | |||
862 | if ( (msg and msg ~= nil) and (plr and plr ~= nil) and msg~=options["PMByeMSG"] ) then |
||
863 | for i=1,table.getn(PMNames) do |
||
864 | PMcheck=PMChecker(i,plr); |
||
865 | num=i; |
||
866 | end |
||
867 | |||
868 | |||
869 | |||
870 | if (PMcheck == false) then |
||
871 | num= num +1; |
||
872 | PMNames[num]=plr; |
||
873 | PMMessages[plr]={}; |
||
874 | PMLang[plr]=GetDefaultLanguage("player"); |
||
875 | if (options["PMGreet"]~=0) then |
||
876 | PM_AutoGreet(plr,num); |
||
877 | end |
||
878 | end |
||
879 | messNum=table.getn(PMMessages[plr]); |
||
880 | messNum=messNum+1; |
||
881 | if (strsub(msg,1,11)=="INCLOCATION" or strsub(msg,1,9)=="TRANSDONE" or strsub(msg,1,15)=="ACCEPTTRANSSEND" or strsub(msg,1,14)=="INCTRANSTBLOCS" or strsub(msg,1,11)=="INCIBARRAYS" or strsub(msg,1,10)=="IBACCEPTED" or strsub(msg,1,13)=="TRANSCOMPLETE" or strsub(msg,1,19)=="RETURNTRANSCOMPLETE" or strsub(msg,1,8)=="INDARRAY" or strsub(msg,1,8)=="SETARRAY") then |
||
882 | transfer=true; |
||
883 | end |
||
884 | if (transfer==false)then |
||
885 | PMMessages[plr][messNum]=msg; |
||
886 | PMNameColors[plr]="green"; |
||
887 | if (MessCurUser~=plr and options["Supress"]==1)then |
||
888 | PlaySound("MapPing"); |
||
889 | end |
||
890 | end |
||
891 | end |
||
892 | |||
893 | |||
894 | |||
895 | end |
||
896 | |||
897 | |||
898 | --End hook, return event to original function. |
||
899 | if ((options["Supress"]==1 and quiet==true)or transfer==true or shutty==true)then |
||
900 | transfer=false; |
||
901 | return; |
||
902 | else |
||
903 | lOriginalChatFrame_OnEvent(event); |
||
904 | end |
||
905 | |||
906 | end |
||
907 | |||
908 | function PMList_OnLoad() |
||
909 | this:RegisterForDrag("LeftButton"); |
||
910 | this:RegisterEvent("NAME_LIST_UPDATE"); |
||
911 | end |
||
912 | |||
913 | function Secret() |
||
914 | BTNPimp:Show(); |
||
915 | end |
||
916 | |||
917 | function PMList_OnEvent() |
||
918 | if ( event == "NAME_LIST_UPDATE" ) then |
||
919 | PMList_Update(); |
||
920 | end |
||
921 | end |
||
922 | |||
923 | function PMList_OnDragStart() |
||
924 | MangAdminForm4:StartMoving() |
||
925 | end |
||
926 | |||
927 | function PMList_OnDragStop() |
||
928 | MangAdminForm4:StopMovingOrSizing() |
||
929 | end |
||
930 | |||
931 | function PMMess_OnDragStart() |
||
932 | MangAdminForm5:StartMoving() |
||
933 | end |
||
934 | |||
935 | function PMMess_OnDragStop() |
||
936 | MangAdminForm5:StopMovingOrSizing() |
||
937 | end |
||
938 | |||
939 | function PMMess_OnLoad() |
||
940 | this:RegisterForDrag("LeftButton"); |
||
941 | end |
||
942 | |||
943 | function PMList_Set(i) |
||
944 | local lable = getglobal ("Name"..i); |
||
945 | local button= getglobal ("NameButton"..i); |
||
946 | lable:SetText(PMNames[i + PMListOffset]); |
||
947 | if (PMNameColors[PMNames[i + PMListOffset]]=="white" or PMNames[i + PMListOffset]==MessCurUser) then |
||
948 | lable:SetTextColor(1,1,1); |
||
949 | PMNameColors[PMNames[i + PMListOffset]]="white"; |
||
950 | else |
||
951 | lable:SetTextColor(0,0.9,0); |
||
952 | end |
||
953 | button:Show(); |
||
954 | lable:Show(); |
||
955 | end |
||
956 | |||
957 | function PMList_Hide(i) |
||
958 | local lable = getglobal ("Name"..i); |
||
959 | local button= getglobal ("NameButton"..i); |
||
960 | button:Hide(); |
||
961 | lable:Hide(); |
||
962 | end |
||
963 | |||
964 | function PMList_Update() |
||
965 | if (options["PMSystem"]==0) then |
||
966 | MangAdminForm4:Hide(); |
||
967 | end |
||
968 | local name="Test"; |
||
969 | local messageNum=0; |
||
970 | PMList_Button(); |
||
971 | if ( table.getn(PMNames) == 0 ) then |
||
972 | NoNamesText:Show(); |
||
973 | else |
||
974 | NoNamesText:Hide(); |
||
975 | end |
||
976 | |||
977 | -- if (table.getn(PMNames) < 10) then |
||
978 | for i=1, 10 do |
||
979 | PMList_Set(i); |
||
980 | end |
||
981 | -- else |
||
982 | -- for i=1, 10 do |
||
983 | --- PMList_Set(i+PMListOffset); |
||
984 | -- end |
||
985 | -- end |
||
986 | |||
987 | for i=table.getn(PMNames)+1, 10 do |
||
988 | PMList_Hide(i) |
||
989 | end |
||
990 | end |
||
991 | |||
992 | function PM_Pressed(lableNum) |
||
993 | MessengerMainFrame:Clear(); |
||
994 | local plr=""; |
||
995 | local lable= getglobal("Name"..lableNum); |
||
996 | local uName= getglobal("PMUser".."Label"); |
||
997 | plr=lable:GetText(); |
||
998 | PMNameColors[plr]="white"; |
||
999 | uName:SetText(plr); |
||
1000 | MessCurUser=plr; |
||
1001 | MangAdminForm5:Show(); |
||
1002 | for i=1, table.getn(PMMessages[plr]) do |
||
1003 | if(strsub(PMMessages[plr][i],1,pnameoutlen)=="["..pname.."]")then |
||
1004 | outMESS(PMMessages[plr][i]); |
||
1005 | lastlineno=i; |
||
1006 | else |
||
1007 | outMESS("["..plr.."]: "..PMMessages[plr][i]); |
||
1008 | lastlineno=i; |
||
1009 | end |
||
1010 | end |
||
1011 | end |
||
1012 | |||
1013 | function PMMessenger_Update() |
||
1014 | local plr = MessCurUser; |
||
1015 | UIDropDownMenu_SetText(PMLang[plr], LangBox); |
||
1016 | if (lastlineno < table.getn(PMMessages[plr])) then |
||
1017 | lastlineno= lastlineno+1; |
||
1018 | if(strsub(PMMessages[plr][lastlineno],1,pnameoutlen)=="["..pname.."]")then |
||
1019 | outMESS(PMMessages[plr][lastlineno]); |
||
1020 | else |
||
1021 | outMESS("["..plr.."]: "..PMMessages[plr][lastlineno]); |
||
1022 | end |
||
1023 | end |
||
1024 | end |
||
1025 | |||
1026 | function PMMessenger_Send() |
||
1027 | local PMtext= BXMessengerSend:GetText(); |
||
1028 | BXMessengerSend:SetText(""); |
||
1029 | if (PMtext and PMtext ~=nil) then |
||
1030 | -- if (PMLang[plr] and PMLang[plr]~="unset")then |
||
1031 | outPMSET(PMtext,PMLang[MessCurUser],MessCurUser); |
||
1032 | --out(PMLang[MessCurUser]); |
||
1033 | -- else |
||
1034 | --out(PMLang[plr]); |
||
1035 | -- outPM(PMtext,MessCurUser); |
||
1036 | -- end |
||
1037 | end |
||
1038 | end |
||
1039 | |||
1040 | function PMMessenger_Close() |
||
1041 | MessCurUser=""; |
||
1042 | end |
||
1043 | |||
1044 | function MangAdminScrollBar_Update2() |
||
1045 | local line; -- 1 through 5 of our window to scroll |
||
1046 | local lineplusoffset; -- an index into our data calculated from the scroll offset |
||
1047 | local total= table.getn(TB_LocationNames)-10; |
||
1048 | |||
1049 | FauxScrollFrame_Update(MangAdminScrollBar2,total,8,14); |
||
1050 | |||
1051 | if (total >10) then |
||
1052 | total=10; |
||
1053 | end |
||
1054 | for line=1,total do |
||
1055 | lineplusoffset = line + FauxScrollFrame_GetOffset(MangAdminScrollBar2); |
||
1056 | if lineplusoffset < 9 then |
||
1057 | getglobal("Text1"..line):SetText(TB_LocationNames[lineplusoffset+10][1]); |
||
1058 | getglobal("MangAdminEntry1"..line):Show(); |
||
1059 | else |
||
1060 | getglobal("Text1"..line):SetText(TB_LocationNames[lineplusoffset+10][1]); |
||
1061 | getglobal("MangAdminEntry1"..line):Show(); |
||
1062 | end |
||
1063 | end |
||
1064 | end |
||
1065 | |||
1066 | function MangAdminScrollBar_Update() |
||
1067 | local line; -- 1 through 5 of our window to scroll |
||
1068 | local lineplusoffset; -- an index into our data calculated from the scroll offset |
||
1069 | FauxScrollFrame_Update(MangAdminScrollBar,10,8,14); |
||
1070 | for line=1,8 do |
||
1071 | lineplusoffset = line + FauxScrollFrame_GetOffset(MangAdminScrollBar); |
||
1072 | if lineplusoffset < 11 then |
||
1073 | getglobal("Text"..line):SetText(TB_LocationNames[lineplusoffset][1]); |
||
1074 | getglobal("MangAdminEntry"..line):Show(); |
||
1075 | else |
||
1076 | getglobal("MangAdminEntry"..line):Hide(); |
||
1077 | end |
||
1078 | end |
||
1079 | end |
||
1080 | |||
1081 | |||
1082 | function TB_Send() |
||
1083 | outPM("INCTRANSTBLOCS If you do not have MangAdmin installed, ignore this message and inform the sender.",BXUser:GetText()); |
||
1084 | end |
||
1085 | |||
1086 | function TB_SetText(int) |
||
1087 | local txt=getglobal("Text"..int):GetText(); |
||
1088 | lblGoThere:SetText(txt); |
||
1089 | end |
||
1090 | |||
1091 | function TB_GoThere() |
||
1092 | local name=lblGoThere:GetText(); |
||
1093 | x,y,z,m = ""; |
||
1094 | for i=1, table.getn(TB_LocationNames) do |
||
1095 | if (name==TB_LocationNames[i][1]) then |
||
1096 | x=TB_LocationNames[i][2]; |
||
1097 | y=TB_LocationNames[i][3]; |
||
1098 | z=TB_LocationNames[i][4]; |
||
1099 | m=TB_LocationNames[i][5]; |
||
1100 | end |
||
1101 | end |
||
1102 | |||
1103 | local msg=".go "..x.." "..y.." "..z.." "..m; |
||
1104 | outSAY(msg); |
||
1105 | end |
||
1106 | |||
1107 | function TB_Make() |
||
1108 | bypassgps=true; |
||
1109 | outSAY(".gps"); |
||
1110 | end |
||
1111 | |||
1112 | function TB_Setter() |
||
1113 | local number = table.getn(TB_LocationNames) + 1; |
||
1114 | TB_LocationNames[number]={BXLocation:GetText(),Xfor,Yfor,Zfor,Mfor}; |
||
1115 | bypassgps=false; |
||
1116 | MangAdminScrollBar_Update2(); |
||
1117 | end |
||
1118 | |||
1119 | function TB_LocAccept(plr) |
||
1120 | allowtrans=true; |
||
1121 | transfer=true; |
||
1122 | outPM("ACCEPTTRANSSEND",plr) |
||
1123 | end |
||
1124 | |||
1125 | function TB_SendLocs(plr) |
||
1126 | for i=11, table.getn(TB_LocationNames) do |
||
1127 | outPM("INCLOCATION`"..TB_LocationNames[i][1].."`"..TB_LocationNames[i][2].."`"..TB_LocationNames[i][3].."`"..TB_LocationNames[i][4].."`"..TB_LocationNames[i][5], plr) |
||
1128 | end |
||
1129 | outPM("TRANSDONE",plr); |
||
1130 | end |
||
1131 | |||
1132 | function ItemBuddy_SpawnSet() |
||
1133 | local id=0; |
||
1134 | if(strsub(BXItemSets:GetText(),0,1)=="a") then |
||
1135 | id=strsub(BXItemSets:GetText(),2); |
||
1136 | out("Creating the '"..IB_Sets[id+IB_SetsDefault][1].."' set"); |
||
1137 | for i=3, table.getn(IB_Sets[id+IB_SetsDefault])do |
||
1138 | ItemBuddy_CallItem(IB_Sets[id+IB_SetsDefault][i]); |
||
1139 | end |
||
1140 | else |
||
1141 | msg=".additemset "..BXItemSets:GetText(); |
||
1142 | outSAY(msg); |
||
1143 | end |
||
1144 | BXItemSets:SetText(""); |
||
1145 | end |
||
1146 | |||
1147 | |||
1148 | function ItemBuddy_SpawnItem() |
||
1149 | ItemBuddy_CallItem(BXIndID:GetText()); |
||
1150 | BXIndName:SetText(""); |
||
1151 | BXIndID:SetText(""); |
||
1152 | end |
||
1153 | |||
1154 | function ItemBuddy_CallItem(iID) |
||
1155 | msg=".additem "..iID; |
||
1156 | outSAY(msg); |
||
1157 | end |
||
1158 | |||
1159 | function ItemBuddy_Load(item) |
||
1160 | UIDropDownMenu_ClearAll(CBXItemSets); |
||
1161 | UIDropDownMenu_Initialize(CBXItemSets, ItemBuddy_Sets); |
||
1162 | UIDropDownMenu_ClearAll(CBXIndItems); |
||
1163 | UIDropDownMenu_Initialize(CBXIndItems, ItemBuddy_Ind); |
||
1164 | end |
||
1165 | |||
1166 | function ItemBuddy_Sets() |
||
1167 | local i = 0; |
||
1168 | local info = {}; |
||
1169 | info.text = "Available Sets"; |
||
1170 | info.textHeight = 18; |
||
1171 | info.isTitle = 1; |
||
1172 | UIDropDownMenu_AddButton(info); |
||
1173 | for i = 1, table.getn(IB_Sets) do |
||
1174 | info = {}; |
||
1175 | info.text = IB_Sets[i][1]; |
||
1176 | info.textHeight = 18; |
||
1177 | info.func = function() |
||
1178 | UIDropDownMenu_SetSelectedID(CBXItemSets, this:GetID(), 0); |
||
1179 | SetBoxAutoChange(); |
||
1180 | end |
||
1181 | UIDropDownMenu_AddButton(info); |
||
1182 | end |
||
1183 | UIDropDownMenu_SetText("Item Sets",CBXItemSets); |
||
1184 | |||
1185 | end |
||
1186 | |||
1187 | function SetBoxAutoChange() |
||
1188 | local id; |
||
1189 | for i = 1, table.getn(IB_Sets) do |
||
1190 | if (UIDropDownMenu_GetText(CBXItemSets)==IB_Sets[i][1])then |
||
1191 | id=IB_Sets[i][2] |
||
1192 | end |
||
1193 | end |
||
1194 | |||
1195 | if (UIDropDownMenu_GetText(CBXItemSets)~="Item Sets")then |
||
1196 | BXItemSets:SetText(id); |
||
1197 | end |
||
1198 | end |
||
1199 | |||
1200 | function ItemBuddy_Ind() |
||
1201 | local i = 0; |
||
1202 | local info = {}; |
||
1203 | info.text = "Available Items"; |
||
1204 | info.textHeight = 18; |
||
1205 | info.isTitle = 1; |
||
1206 | UIDropDownMenu_AddButton(info); |
||
1207 | for i = 1, table.getn(IB_Items) do |
||
1208 | info = {}; |
||
1209 | info.text = IB_Items[i][1]; |
||
1210 | info.textHeight = 18; |
||
1211 | info.func = function() |
||
1212 | UIDropDownMenu_SetSelectedID(CBXIndItems, this:GetID(), 0); |
||
1213 | IndBoxAutoChange(); |
||
1214 | end |
||
1215 | UIDropDownMenu_AddButton(info); |
||
1216 | end |
||
1217 | UIDropDownMenu_SetText("Individual Items",CBXIndItems); |
||
1218 | |||
1219 | end |
||
1220 | |||
1221 | function IndBoxAutoChange() |
||
1222 | local id; |
||
1223 | for i = 1, table.getn(IB_Items) do |
||
1224 | if (UIDropDownMenu_GetText(CBXIndItems)==IB_Items[i][1])then |
||
1225 | id=IB_Items[i][2] |
||
1226 | end |
||
1227 | end |
||
1228 | |||
1229 | if (UIDropDownMenu_GetText(CBXIndItems)~="Item Sets")then |
||
1230 | BXIndName:SetText(UIDropDownMenu_GetText(CBXIndItems)); |
||
1231 | BXIndID:SetText(id); |
||
1232 | end |
||
1233 | end |
||
1234 | |||
1235 | function ItemBuddy_AddInd() |
||
1236 | local addnum=1; |
||
1237 | local taken=false; |
||
1238 | if ((BXIndName:GetText() and BXIndName:GetText()~="") and (BXIndID:GetText() and BXIndID:GetText()~="")) then |
||
1239 | |||
1240 | for i=1,table.getn(IB_Items) do |
||
1241 | if (BXIndName:GetText()==IB_Items[i][1])then |
||
1242 | taken = true; |
||
1243 | end |
||
1244 | end |
||
1245 | if (taken==true)then |
||
1246 | outERROR("You have already added this item.") |
||
1247 | else |
||
1248 | addnum=table.getn(IB_Items) +1; |
||
1249 | IB_Items[addnum]={BXIndName:GetText(), BXIndID:GetText()}; |
||
1250 | BXIndName:SetText(""); |
||
1251 | BXIndID:SetText(""); |
||
1252 | |||
1253 | end |
||
1254 | else |
||
1255 | outERROR("There was a problem adding the item.") |
||
1256 | end |
||
1257 | end |
||
1258 | |||
1259 | function SetCreator_Step1() |
||
1260 | IB_SetCreator={}; |
||
1261 | IB_MadeNum=0; |
||
1262 | local taken=false; |
||
1263 | if (BXSetName:GetText() and BXSetName:GetText()~="") then |
||
1264 | for i=1,table.getn(IB_Sets) do |
||
1265 | if(strsub(IB_Sets[i][2],0,1)=="a") then |
||
1266 | IB_MadeNum=IB_MadeNum+1; |
||
1267 | end |
||
1268 | if (BXSetName:GetText()==IB_Sets[i][1])then |
||
1269 | taken=true; |
||
1270 | end |
||
1271 | end |
||
1272 | IB_MadeNum=IB_MadeNum+1; |
||
1273 | if (taken==false) then |
||
1274 | IB_SetiNum=1; |
||
1275 | local label = getglobal("LBLiNum".."Label") |
||
1276 | label:SetText("Item #"..IB_SetiNum); |
||
1277 | IB_SetCreator[1]=BXSetName:GetText(); |
||
1278 | IB_SetCreator[2]="a"..IB_MadeNum; |
||
1279 | BXSetName:SetText(""); |
||
1280 | MangAdminForm8:Hide(); |
||
1281 | MangAdminForm9:Show(); |
||
1282 | end |
||
1283 | else |
||
1284 | outERROR("Error with set name"); |
||
1285 | end |
||
1286 | end |
||
1287 | |||
1288 | function SetCreator_Next() |
||
1289 | if (BXCreatorID:GetText() and BXCreatorID:GetText()~="") then |
||
1290 | IB_SetCreator[IB_SetiNum+2]=BXCreatorID:GetText(); |
||
1291 | BXCreatorID:SetText(""); |
||
1292 | IB_SetiNum=IB_SetiNum+1; |
||
1293 | local label = getglobal("LBLiNum".."Label") |
||
1294 | label:SetText("Item #"..IB_SetiNum); |
||
1295 | BTNFinish:Enable(); |
||
1296 | else |
||
1297 | outERROR("There was a problem with the ID you entered") |
||
1298 | BXCreatorID:SetText(""); |
||
1299 | end |
||
1300 | end |
||
1301 | |||
1302 | function SetCreator_Finish() |
||
1303 | if(BXCreatorID:GetText()=="" and IB_SetiNum < 3) then |
||
1304 | outERROR("You have not added enough items to make this a set."); |
||
1305 | else |
||
1306 | if (BXCreatorID:GetText() and BXCreatorID:GetText()~="")then |
||
1307 | IB_SetCreator[IB_SetiNum+2]=BXCreatorID:GetText(); |
||
1308 | SetCreator_Finalize(); |
||
1309 | IB_SetiNum=IB_SetiNum+1; |
||
1310 | else |
||
1311 | SetCreator_Finalize(); |
||
1312 | end |
||
1313 | end |
||
1314 | BXCreatorID:SetText(""); |
||
1315 | end |
||
1316 | |||
1317 | function SetCreator_Finalize() |
||
1318 | local entries = table.getn(IB_SetCreator); |
||
1319 | newSetNum = table.getn(IB_Sets)+1; |
||
1320 | if (entries >2)then |
||
1321 | IB_Sets[newSetNum]={} |
||
1322 | for i=1,entries do |
||
1323 | IB_Sets[newSetNum][i]=IB_SetCreator[i]; |
||
1324 | end |
||
1325 | MangAdminForm9:Hide(); |
||
1326 | StaticPopup_Show ("TEST_SET"); |
||
1327 | out("Set Name: "..IB_Sets[newSetNum][1]); |
||
1328 | out("Set ID: "..IB_Sets[newSetNum][2]); |
||
1329 | for i=3,entries do |
||
1330 | ItemBuddy_CallItem(IB_Sets[newSetNum][i]) |
||
1331 | end |
||
1332 | else |
||
1333 | outERROR("There has been a problem with the finalization of the set.") |
||
1334 | end |
||
1335 | end |
||
1336 | |||
1337 | |||
1338 | function SetCreator_Confirm() |
||
1339 | out("Set Created"); |
||
1340 | end |
||
1341 | |||
1342 | function SetCreator_Fail() |
||
1343 | IB_Sets[newSetNum]=nil; |
||
1344 | newSetNum=0; |
||
1345 | outERROR("Set Creation Failed"); |
||
1346 | end |
||
1347 | |||
1348 | function ItemBuddy_Send() |
||
1349 | if (CHKInd:GetChecked()==nil and CHKSet:GetChecked()==nil) then |
||
1350 | outERROR("Please select at least 1 of the Item Buddy arrays to send."); |
||
1351 | elseif (BXIBUser:GetText()=="" or BXIBUser:GetText()==nil)then |
||
1352 | outERROR("Please enter a user to send the Item Buddy array(s) to."); |
||
1353 | else |
||
1354 | outPM("INCIBARRAYS If you do not have MangAdmin installed, ignore this message and inform the sender.",BXIBUser:GetText()) |
||
1355 | end |
||
1356 | end |
||
1357 | |||
1358 | function IB_ARRAYAccept(plr) |
||
1359 | outPM("IBACCEPTED",plr); |
||
1360 | end |
||
1361 | |||
1362 | function IB_SendArray(plr) |
||
1363 | local message="SETARRAY`"; |
||
1364 | if (CHKInd:GetChecked()==1) then |
||
1365 | for i=2, table.getn(IB_Items)do |
||
1366 | outPM("INDARRAY`"..IB_Items[i][1].."`"..IB_Items[i][2],plr); |
||
1367 | end |
||
1368 | end |
||
1369 | |||
1370 | if (CHKSet:GetChecked()==1)then |
||
1371 | |||
1372 | for i=19, table.getn(IB_Sets)do |
||
1373 | message="SETARRAY`"; |
||
1374 | for ii=1,table.getn(IB_Sets[i]) do |
||
1375 | message=message..IB_Sets[i][ii].."`"; |
||
1376 | end |
||
1377 | outPM(message,plr); |
||
1378 | end |
||
1379 | |||
1380 | |||
1381 | end |
||
1382 | outPM("TRANSCOMPLETE",plr); |
||
1383 | end |
||
1384 | |||
1385 | function MangHelp() |
||
1386 | outSYS("Welcome to MangAdmin version "..version); |
||
1387 | outSYS("Allowed commands are: help, menu, info, options, pm, tele, items, gm and reset"); |
||
1388 | end |
||
1389 | |||
1390 | function PMMessenger_End() |
||
1391 | local plr = MessCurUser; |
||
1392 | MangAdminForm5:Hide(); |
||
1393 | throughVar=1; |
||
1394 | for i=1,table.getn(PMNames) do |
||
1395 | if (PMNames[i]==plr)then |
||
1396 | outSYS("Your conversation with "..plr.." has been terminated."); |
||
1397 | if (options["PMBye"]==1)then |
||
1398 | outPMSET (options["PMByeMSG"],PMLang[MessCurUser],plr); |
||
1399 | end |
||
1400 | PMMessages[plr]=nil; |
||
1401 | PMNames[i]=nil; |
||
1402 | else |
||
1403 | PMNames[throughVar]=PMNames[i]; |
||
1404 | throughVar=throughVar+1; |
||
1405 | |||
1406 | end |
||
1407 | end |
||
1408 | PMNames[throughVar]=nil; |
||
1409 | PMList_Update(); |
||
1410 | end |
||
1411 | |||
1412 | function PMList_Down() |
||
1413 | PMListOffset=PMListOffset + 1; |
||
1414 | if (PMListOffset > table.getn(PMNames)-10)then |
||
1415 | PMListOffset = table.getn(PMNames)-10; |
||
1416 | end |
||
1417 | end |
||
1418 | |||
1419 | function PMList_Up() |
||
1420 | PMListOffset= PMListOffset - 1; |
||
1421 | if (PMListOffset<0 and table.getn(PMNames) > 10) then |
||
1422 | PMListOffset=0; |
||
1423 | end |
||
1424 | end |
||
1425 | |||
1426 | function PMList_Button() |
||
1427 | if (table.getn(PMNames) <=10)then |
||
1428 | PMDownButton:Hide(); |
||
1429 | PMUpButton:Hide(); |
||
1430 | else |
||
1431 | PMDownButton:Show(); |
||
1432 | PMUpButton:Show(); |
||
1433 | end |
||
1434 | end |
||
1435 | |||
1436 | function PMMess_LangEdit() |
||
1437 | PMLang[MessCurUser]=UIDropDownMenu_GetText(LangBox); |
||
1438 | end |
||
1439 | --btnAN3 |
||
1440 | |||
1441 | function AN_LOAD() |
||
1442 | |||
1443 | -- if (GetChannelName(options["NotesChan"]) == 0)then |
||
1444 | -- JoinChannelByName(options["NotesChan"], nil, DEFAULT_CHAT_FRAME:GetID()); |
||
1445 | -- end |
||
1446 | -- chanNum= GetChannelName(options["NotesChan"]); |
||
1447 | -- AN_UPDATE(); |
||
1448 | end |
||
1449 | |||
1450 | function AN_UPDATE() |
||
1451 | if (table.getn(ANArray)<=8) then |
||
1452 | for i=1,table.getn(ANArray) do |
||
1453 | local labelEdit=getglobal("lblTitle"..i.."Label"); |
||
1454 | local label=getglobal("lblTitle"..i); |
||
1455 | local button=getglobal("btnAN"..i); |
||
1456 | button:Show(); |
||
1457 | labelEdit:SetText(ANArray[i][4]); |
||
1458 | label:Show(); |
||
1459 | labelEdit=getglobal("lblUser"..i.."Label"); |
||
1460 | label=getglobal("lblUser"..i); |
||
1461 | labelEdit:SetText(ANArray[i][2]); |
||
1462 | label:Show(); |
||
1463 | end |
||
1464 | else |
||
1465 | for i=1,8 do |
||
1466 | |||
1467 | end |
||
1468 | end |
||
1469 | |||
1470 | end |
||
1471 | |||
1472 | function AN_Click(num) |
||
1473 | postNum=num+ANOffset; |
||
1474 | local TitleLabel=getglobal("lblANTitle".."Label"); |
||
1475 | TitleLabel:SetText(ANArray[postNum][4]); |
||
1476 | local UserLabel=getglobal("lblANUser".."Label"); |
||
1477 | UserLabel:SetText(ANArray[postNum][2]); |
||
1478 | local BodyBox=getglobal("mebANBody".."Edit"); |
||
1479 | BodyBox:SetText(ANArray[postNum][5]); |
||
1480 | end |
||
1481 | |||
1482 | function AN_Open() |
||
1483 | if (GetChannelName(options["NotesChan"]) == 0)then |
||
1484 | -- JoinChannelByName(options["NotesChan"], nil, DEFAULT_CHAT_FRAME:GetID()); |
||
1485 | end |
||
1486 | --chanNum= GetChannelName(options["NotesChan"]); |
||
1487 | if (ANSynch==false and active==false)then |
||
1488 | -- outNotes("CLUSTER UPDATEME"); |
||
1489 | end |
||
1490 | end |
||
1491 | --Key, Username, Leader, Title, Body, Confirmed, Place Number, PostKey, Type |
||
1492 | function AN_Post() |
||
1493 | local title=NotesTitle:GetText(); |
||
1494 | local body=getglobal("ANMEBBody".."Edit"):GetText(); |
||
1495 | ANArray[gkey]={gkey,pname,pname,title,body,0,1,pkey,"Start"}; |
||
1496 | outNotes("CLUSTER POST "..postKey..ANArray[gkey][2]..postKey..ANArray[gkey][3]..postKey..ANArray[gkey][4]..postKey..ANArray[gkey][5]..postKey..ANArray[gkey][6]..postKey..ANArray[gkey][7]..postKey..ANArray[gkey][8]..postKey..ANArray[gkey][9]); |
||
1497 | pkey=pkey+1; |
||
1498 | gkey=gkey+1; |
||
1499 | AN_UPDATE(); |
||
1500 | end |
||
1501 | |||
1502 | function AN_GET_Post(a1,a2,a3,a4,a5,a6,a7,a8) |
||
1503 | ANArray[gkey]={gkey,a1,a2,a3,a4,a5,a6,a7,a8}; |
||
1504 | gkey=gkey+1; |
||
1505 | AN_UPDATE(); |
||
1506 | out("New AdminNotes Message"); |
||
1507 | end |
||
1508 | |||
1509 | function GMBuddy(fxn) |
||
1510 | if (fxn=="lang")then |
||
1511 | outSAY(".learn all_lang"); |
||
1512 | |||
1513 | elseif (fxn=="armor")then |
||
1514 | for i=1, table.getn(GMArray["Armor"]) do |
||
1515 | outSAY(".learnsk "..GMArray["Armor"][i].. " 300 300"); |
||
1516 | end |
||
1517 | |||
1518 | elseif (fxn=="weap")then |
||
1519 | out(table.getn(GMArray["Weapons"])); |
||
1520 | for i=1, table.getn(GMArray["Weapons"]) do |
||
1521 | outSAY(".learnsk "..GMArray["Weapons"][i].. " 300 300"); |
||
1522 | end |
||
1523 | for i=1, 5 do |
||
1524 | outSAY(".learn "..GMArray["Spells"][i]); |
||
1525 | end |
||
1526 | |||
1527 | elseif (fxn=="pimp")then |
||
1528 | for i=1, table.getn(GMArray["Pimp"]) do |
||
1529 | outSAY(".learn "..GMArray["Pimp"][i]); |
||
1530 | end |
||
1531 | |||
1532 | elseif (fxn=="skill")then |
||
1533 | outSAY(".learn all_myclass"); |
||
1534 | |||
1535 | elseif (fxn=="max")then |
||
1536 | outSAY(".maxskill"); |
||
1537 | |||
1538 | elseif (fxn=="ench")then |
||
1539 | outSAY(".learnsk "..GMArray["Profs"][1].." 300 300"); |
||
1540 | outSAY(".learn "..GMArray["ProfSpells"][1]); |
||
1541 | outSAY(".learn "..GMArray["ProfSpells"][2]); |
||
1542 | elseif (fxn=="alch")then |
||
1543 | outSAY(".learnsk "..GMArray["Profs"][2].." 300 300"); |
||
1544 | outSAY(".learn "..GMArray["ProfSpells"][3]); |
||
1545 | elseif (fxn=="blac")then |
||
1546 | outSAY(".learnsk "..GMArray["Profs"][3].." 300 300"); |
||
1547 | outSAY(".learn "..GMArray["ProfSpells"][4]); |
||
1548 | elseif (fxn=="leat")then |
||
1549 | outSAY(".learnsk "..GMArray["Profs"][4].." 300 300"); |
||
1550 | outSAY(".learn "..GMArray["ProfSpells"][5]); |
||
1551 | elseif (fxn=="engi")then |
||
1552 | outSAY(".learnsk "..GMArray["Profs"][5].." 300 300"); |
||
1553 | outSAY(".learn "..GMArray["ProfSpells"][6]); |
||
1554 | elseif (fxn=="tail")then |
||
1555 | outSAY(".learnsk "..GMArray["Profs"][6].." 300 300"); |
||
1556 | outSAY(".learn "..GMArray["ProfSpells"][7]); |
||
1557 | elseif (fxn=="herb")then |
||
1558 | outSAY(".learnsk "..GMArray["Profs"][7].." 300 300"); |
||
1559 | outSAY(".learn "..GMArray["ProfSpells"][8]); |
||
1560 | outSAY(".learn "..GMArray["ProfSpells"][9]); |
||
1561 | elseif (fxn=="mini")then |
||
1562 | outSAY(".learnsk "..GMArray["Profs"][8].." 300 300"); |
||
1563 | outSAY(".learn "..GMArray["ProfSpells"][10]); |
||
1564 | outSAY(".learn "..GMArray["ProfSpells"][11]); |
||
1565 | elseif (fxn=="skin")then |
||
1566 | outSAY(".learnsk "..GMArray["Profs"][9].." 300 300"); |
||
1567 | outSAY(".learn "..GMArray["ProfSpells"][12]); |
||
1568 | elseif (fxn=="firs")then |
||
1569 | outSAY(".learnsk "..GMArray["Profs"][10].." 300 300"); |
||
1570 | outSAY(".learn "..GMArray["ProfSpells"][13]); |
||
1571 | elseif (fxn=="cook")then |
||
1572 | outSAY(".learnsk "..GMArray["Profs"][11].." 300 300"); |
||
1573 | outSAY(".learn "..GMArray["ProfSpells"][14]); |
||
1574 | outSAY(".learn "..GMArray["ProfSpells"][15]); |
||
1575 | elseif (fxn=="fish")then |
||
1576 | outSAY(".learnsk "..GMArray["Profs"][12].." 300 300"); |
||
1577 | outSAY(".learn "..GMArray["ProfSpells"][16]); |
||
1578 | elseif (fxn=="anno")then |
||
1579 | outSAY(".announce "..EBAnn:GetText()); |
||
1580 | |||
1581 | elseif (fxn=="morp")then |
||
1582 | outSAY(".morph "..GMArray["Morph"][UIDropDownMenu_GetText(CBXMorph)]); |
||
1583 | |||
1584 | elseif (fxn=="demo")then |
||
1585 | outSAY(".demorph"); |
||
1586 | |||
1587 | elseif (fxn=="leve")then |
||
1588 | outSAY(".levelup "..EBlvl:GetText()); |
||
1589 | |||
1590 | elseif (fxn=="gm")then |
||
1591 | outSAY(".recall gm"); |
||
1592 | end |
||
1593 | |||
1594 | |||
1595 | end |
||
1596 | |||
1597 | |||
1598 | function tBuddy_OnLoad() |
||
1599 | MangAdminForm14:ClearAllPoints(); |
||
1600 | MangAdminForm14:SetPoint("TOPRIGHT",Minimap,"TOPLEFT",-10,10); |
||
1601 | end |
||
1602 | |||
1603 | |||
1604 | function tBuddyUpdate() |
||
1605 | --local lbltCount=getglobal("LBLtCount".."Label"); |
||
1606 | --lbltCount:SetText("0"); |
||
1607 | end |
||
1608 | |||
1609 | function Mini_OnLoad() |
||
1610 | this:RegisterForDrag("LeftButton"); |
||
1611 | end |
||
1612 | |||
1613 | function Mini_OnDragStart() |
||
1614 | MangAdminForm13:StartMoving() |
||
1615 | end |
||
1616 | |||
1617 | function Mini_OnDragStop() |
||
1618 | MangAdminForm13:StopMovingOrSizing() |
||
1619 | end |
||
1620 | |||
1621 | function MiniMenu(fxn) |
||
1622 | if (fxn=="Admin")then |
||
1623 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1624 | GameTooltip:SetText("Admin Notes", 1.0, 0, 0); |
||
1625 | elseif (fxn=="PMB")then |
||
1626 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1627 | GameTooltip:SetText("PM Buddy", 1.0, 1.0, 1.0); |
||
1628 | elseif (fxn=="Tele")then |
||
1629 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1630 | GameTooltip:SetText("Teleport Buddy", 1.0, 1.0, 1.0); |
||
1631 | elseif (fxn=="Item")then |
||
1632 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1633 | GameTooltip:SetText("Item Buddy", 1.0, 1.0, 1.0); |
||
1634 | elseif (fxn=="GM")then |
||
1635 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1636 | GameTooltip:SetText("GM Buddy", 1.0, 1.0, 1.0); |
||
1637 | elseif (fxn=="Ticket")then |
||
1638 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1639 | GameTooltip:SetText("Ticket Buddy", 1.0, 1.0, 1.0); |
||
1640 | elseif (fxn=="Options")then |
||
1641 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1642 | GameTooltip:SetText("Options", 1.0, 1.0, 1.0); |
||
1643 | elseif (fxn=="Map")then |
||
1644 | GameTooltip:SetOwner(this, "ANCHOR_LEFT",-15,-30); |
||
1645 | GameTooltip:SetText("MangAdmin", 1.0, 1.0, 1.0); |
||
1646 | elseif (fxn=="Hide")then |
||
1647 | GameTooltip:Hide(); |
||
1648 | end |
||
1649 | |||
1650 | end |
||
1651 | |||
1652 | function MenuManager(box) |
||
1653 | if (box=="Main" and options["Mini"]==1)then |
||
1654 | MangAdminForm:Hide(); |
||
1655 | elseif (box=="Mini" and options["Mini"]==0)then |
||
1656 | MangAdminForm13:Hide(); |
||
1657 | end |
||
1658 | end |
||
1659 | |||
1660 | function MiniShowHide() |
||
1661 | if (CHKMini:GetChecked()) then |
||
1662 | options["Mini"]=1; |
||
1663 | MangAdminForm13:Show(); |
||
1664 | else |
||
1665 | options["Mini"]=0; |
||
1666 | MangAdminForm13:Hide(); |
||
1667 | |||
1668 | end |
||
1669 | end |
||
1670 | |||
1671 | function Map_Pos() |
||
1672 | MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(options["Maplocal"])),(80*sin(options["Maplocal"]))-52) |
||
1673 | end |
||
1674 | |||
1675 | function MapPos_Change() |
||
1676 | local Slider=getglobal("SliderLocalSlider"); |
||
1677 | options["Maplocal"]=Slider:GetValue(); |
||
1678 | MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(options["Maplocal"])),(80*sin(options["Maplocal"]))-52) |
||
1679 | end |
||
1680 | |||
1681 | function tB_Initialize() |
||
1682 | outSAY(".ticket"); |
||
1683 | tInitial=true; |
||
1684 | BTNBBCode:Disable(); |
||
1685 | BTNDel:Disable(); |
||
1686 | BTNTBSol:Disable(); |
||
1687 | prob = getglobal("EBoxProbEdit"); |
||
1688 | sol = getglobal("EBoxSolEdit"); |
||
1689 | prob:SetText("No Ticket Selected."); |
||
1690 | sol:ClearFocus(); |
||
1691 | end |
||
1692 | |||
1693 | function tB_Toggle() |
||
1694 | if (tCounter==0)then |
||
1695 | tB_Initialize(); |
||
1696 | end |
||
1697 | |||
1698 | if (TBBarOpen==true)then |
||
1699 | MangAdminForm14:Hide(); |
||
1700 | TBBarOpen=false; |
||
1701 | else |
||
1702 | MangAdminForm14:Show(); |
||
1703 | TBBarOpen=true; |
||
1704 | end |
||
1705 | end |
||
1706 | |||
1707 | function tB_LoadTickets(tNum) |
||
1708 | if (tNum ~= "0")then |
||
1709 | TBBarOpen=true; |
||
1710 | MangAdminForm14:Show(); |
||
1711 | end |
||
1712 | local lbltCount=getglobal("LBLtCount".."Label"); |
||
1713 | |||
1714 | lbltCount:SetText(tNum); |
||
1715 | for i=1, tNum do |
||
1716 | outSAY(".ticket "..i); |
||
1717 | end |
||
1718 | outSYS("Current ticket count: "..tNum); |
||
1719 | end |
||
1720 | |||
1721 | function tb_AddTicket(fTicket, tName, tCat) |
||
1722 | lblNoTicket:Hide(); |
||
1723 | tCounter=tCounter + 1; |
||
1724 | fullString = fTicket |
||
1725 | nulString = "Ticket of "..tName.." (Category: "..tCat.."):"; |
||
1726 | newString = strsub(fullString, string.len (nulString)+2, string.len (fullString) ) |
||
1727 | tArray[tCounter]={tName, tCat, newString, ""} |
||
1728 | |||
1729 | if (tCounter < 11) then |
||
1730 | local tBB = getglobal ("BTNTB"..tCounter); |
||
1731 | tBB:SetText(tName.." - Category: "..tCat); |
||
1732 | tBB:Show(); |
||
1733 | end |
||
1734 | if (tCounter > 10)then |
||
1735 | BTNTBDown:Show(); |
||
1736 | else |
||
1737 | BTNTBDown:Hide(); |
||
1738 | BTNTBUp:Hide(); |
||
1739 | end |
||
1740 | end |
||
1741 | |||
1742 | function tB_ShowTicket(tNumber) |
||
1743 | tB_Reset() |
||
1744 | tCount=tNumber + tOffset; |
||
1745 | local tbName=getglobal("lblTBNameLabel"); |
||
1746 | local tbCat=getglobal("lblTBCatLabel"); |
||
1747 | tbName:SetText(tArray[tNumber + tOffset][1]); |
||
1748 | tbCat:SetText(tB_Cat(tArray[tNumber + tOffset][2])); |
||
1749 | prob:SetText(tArray[tNumber + tOffset][3]); |
||
1750 | sol:SetText(tArray[tNumber + tOffset][4]); |
||
1751 | end |
||
1752 | |||
1753 | function tB_Cat(cNumber) |
||
1754 | local strCat=""; |
||
1755 | if (cNumber == "0") then |
||
1756 | strCat="Item Issue"; |
||
1757 | elseif (cNumber == "1") then |
||
1758 | strCat="Harassment"; |
||
1759 | elseif (cNumber == "2") then |
||
1760 | strCat="Guild Issue"; |
||
1761 | elseif (cNumber == "3") then |
||
1762 | strCat="Character Issue"; |
||
1763 | elseif (cNumber == "4") then |
||
1764 | strCat="Non-Quest/Creep Issue"; |
||
1765 | elseif (cNumber == "5") then |
||
1766 | strCat="Stuck"; |
||
1767 | elseif (cNumber == "6") then |
||
1768 | strCat="Environmental Issue"; |
||
1769 | elseif (cNumber == "7") then |
||
1770 | strCat="Quest/Quest NPC Issue"; |
||
1771 | else |
||
1772 | strCat="Unknown Issue"; |
||
1773 | end |
||
1774 | |||
1775 | return strCat; |
||
1776 | end |
||
1777 | |||
1778 | function tB_BBCode() |
||
1779 | compiledCode=""; |
||
1780 | BTNTBSol:Enable(); |
||
1781 | BTNDel:Enable(); |
||
1782 | tbSolCode=getglobal("lblSolCodeLabel"); |
||
1783 | tbSolCode:SetText("BBCode:"); |
||
1784 | tArray[tCount][4]=sol:GetText(); |
||
1785 | compiledCode="User: [color=red]"..tArray[tCount][1].."[/color]\nCatagory: [color=red]"..tB_Cat(tArray[tCount][2]).."[/color]\nProblem: "..tArray[tCount][3].."Solution: "..tArray[tCount][4]; |
||
1786 | sol:SetText(compiledCode); |
||
1787 | end |
||
1788 | |||
1789 | function tB_SolCheck() |
||
1790 | local tbName=getglobal("lblTBNameLabel"); |
||
1791 | if (sol:GetText() ~="" and tbName:GetText()~="Name") then |
||
1792 | BTNBBCode:Enable(); |
||
1793 | end |
||
1794 | end |
||
1795 | |||
1796 | function tB_Reset() |
||
1797 | if (tCount~=0)then |
||
1798 | tArray[tCount][4]=sol:GetText(); |
||
1799 | end |
||
1800 | tOffset=0; |
||
1801 | tCount=0; |
||
1802 | BTNBBCode:Disable(); |
||
1803 | BTNDel:Disable(); |
||
1804 | BTNTBSol:Disable(); |
||
1805 | prob:SetText("No Ticket Selected."); |
||
1806 | sol:SetText(""); |
||
1807 | tbSolCode=getglobal("lblSolCodeLabel"); |
||
1808 | tbSolCode:SetText("Solution:"); |
||
1809 | end |
||
1810 | |||
1811 | function tB_ShowSol() |
||
1812 | tbSolCode=getglobal("lblSolCodeLabel"); |
||
1813 | tbSolCode:SetText("Solution:"); |
||
1814 | sol:SetText(tArray[tCount][4]); |
||
1815 | end |
||
1816 | |||
1817 | function tb_Del() |
||
1818 | outSAY(".delticket "..tArray[tCount][1]); |
||
1819 | outSAY(".ticket"); |
||
1820 | end |
||
1821 | |||
1822 | function tB_Up() |
||
1823 | if (tOffset==0 or tCounter < 11) then |
||
1824 | |||
1825 | else |
||
1826 | tOffset=tOffset-1; |
||
1827 | if (tOffset==0)then |
||
1828 | BTNTBUp:Hide(); |
||
1829 | end |
||
1830 | end |
||
1831 | tB_Redraw(); |
||
1832 | end |
||
1833 | function tB_Down() |
||
1834 | if (tOffset==tCounter-10 or tCounter < 11) then |
||
1835 | |||
1836 | else |
||
1837 | tOffset=tOffset+1; |
||
1838 | if (tOffset==tCounter-10) then |
||
1839 | BTNTBDown:Hide(); |
||
1840 | end |
||
1841 | end |
||
1842 | tB_Redraw(); |
||
1843 | end |
||
1844 | |||
1845 | function tB_Redraw() |
||
1846 | if (tOffset~=tCounter-10 and tCounter > 10) then |
||
1847 | BTNTBDown:Show(); |
||
1848 | elseif (tOffset~=0 and tCounter > 10) then |
||
1849 | BTNTBUp:Show(); |
||
1850 | end |
||
1851 | |||
1852 | |||
1853 | for i=1, 10 do |
||
1854 | if (i <= tCounter)then |
||
1855 | local tBB = getglobal ("BTNTB"..i); |
||
1856 | tBB:SetText(tArray[i+tOffset][1].." - Category: "..tArray[i+tOffset][2]); |
||
1857 | tBB:Show(); |
||
1858 | else |
||
1859 | local tBB = getglobal ("BTNTB"..i); |
||
1860 | tBB:Hide(); |
||
1861 | end |
||
1862 | end |
||
1863 | |||
1864 | |||
1865 | end |