Skip to content

Commit a10f64f

Browse files
committed
refactor: Generics for soe CHAR Commands
CHAR_repairItemsCommand CHAR_banCommand CHAR_unbanCommand CHAR_banInfoCommand CHAR_banListCommand CHAR_appearCommand CHAR_summonCommand CHAR_groupSummonCommand CHAR_teleportNameCommand CHAR_teleportGroupCommand
1 parent 2ee1808 commit a10f64f

5 files changed

Lines changed: 1547 additions & 1587 deletions

File tree

Commands/Commands_Char.lua

Lines changed: 92 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,101 @@ CHAR_genericCommands = {
159159
[GENERICS_canTargetBeACreature] = true,
160160
[GENERICS_command] = ".unpossess",
161161
[GENERICS_message] = "logCHAR_unpossess"
162-
}
162+
},
163+
[CHAR_repairItemsCommand] = {
164+
[GENERICS_isTargetCheckNeeded] = true,
165+
[GENERICS_command] = ".repairitems",
166+
[GENERICS_message] = "logCHAR_repairItems"
167+
},
168+
[CHAR_banCommand] = {
169+
[GENERICS_isParametersNeeded] = true,
170+
[GENERICS_command] = ".ban ",
171+
[GENERICS_message] = "logCHAR_ban"
172+
},
173+
[CHAR_unbanCommand] = {
174+
[GENERICS_isParametersNeeded] = true,
175+
[GENERICS_command] = ".unban ",
176+
[GENERICS_message] = "logCHAR_unban"
177+
},
178+
[CHAR_banInfoCommand] = {
179+
[GENERICS_isParametersNeeded] = true,
180+
[GENERICS_command] = ".baninfo ",
181+
[GENERICS_message] = "logCHAR_banInfo"
182+
},
183+
[CHAR_banListCommand] = {
184+
[GENERICS_isParametersNeeded] = true,
185+
[GENERICS_command] = ".banlist ",
186+
[GENERICS_message] = "logCHAR_banList"
187+
},
188+
[CHAR_appearCommand] = {
189+
[GENERICS_isParametersNeeded] = true,
190+
[GENERICS_command] = ".appear ",
191+
[GENERICS_message] = "logCHAR_appear"
192+
},
193+
[CHAR_summonCommand] = {
194+
[GENERICS_isParametersNeeded] = true,
195+
[GENERICS_command] = ".summon ",
196+
[GENERICS_message] = "logCHAR_summon"
197+
},
198+
[CHAR_groupSummonCommand] = {
199+
[GENERICS_isParametersNeeded] = true,
200+
[GENERICS_command] = ".groupsummon ",
201+
[GENERICS_message] = "logCHAR_groupSummon"
202+
},
203+
[CHAR_teleportNameCommand] = {
204+
[GENERICS_isParametersNeeded] = true,
205+
[GENERICS_command] = ".teleport name ",
206+
[GENERICS_message] = "logCHAR_teleportName"
207+
},
208+
[CHAR_teleportGroupCommand] = {
209+
[GENERICS_isParametersNeeded] = true,
210+
[GENERICS_isTargetCheckNeeded] = true,
211+
[GENERICS_command] = ".teleport group ",
212+
[GENERICS_message] = "logCHAR_teleportGroup"
213+
},
163214
}
164215
-- Delete
165216

217+
function CreateGuildButton()
218+
local cname = ma_charactertarget:GetText()
219+
local npccname = ma_npccharactertarget:GetText()
220+
MangAdmin:ChatMsg(".guild create "..cname)
221+
MangAdmin:LogAction("Created Guild: "..cname..".")
222+
223+
end
224+
225+
function GuildInviteButton()
226+
local cname = ma_charactertarget:GetText()
227+
local npccname = ma_npccharactertarget:GetText()
228+
MangAdmin:ChatMsg(".guild invite "..cname)
229+
MangAdmin:LogAction("Guild invitation: "..cname..".")
230+
231+
end
232+
233+
function GuildRankButton()
234+
local cname = ma_charactertarget:GetText()
235+
local npccname = ma_npccharactertarget:GetText()
236+
MangAdmin:ChatMsg(".guild rank "..cname)
237+
MangAdmin:LogAction("Guild rank change: "..cname..".")
238+
239+
end
240+
241+
function GuildDeleteButton()
242+
local cname = ma_charactertarget:GetText()
243+
local npccname = ma_npccharactertarget:GetText()
244+
MangAdmin:ChatMsg(".guild delete "..cname)
245+
MangAdmin:LogAction("Deleted guild: "..cname..".")
246+
247+
end
248+
249+
function GuildUninviteButton()
250+
local cname = ma_charactertarget:GetText()
251+
local npccname = ma_npccharactertarget:GetText()
252+
MangAdmin:ChatMsg(".guild uninvite "..cname)
253+
MangAdmin:LogAction("Removed from guild: "..cname..".")
254+
255+
end
256+
166257
--
167258

168259
function InitModelFrame()
@@ -456,130 +547,6 @@ function ResetDropDownInitialize()
456547
UIDropDownMenu_SetSelectedValue(ma_resetdropdown, "talents")
457548
end
458549

459-
function CharRecall()
460-
local player = UnitName("target") or UnitName("player")
461-
MangAdmin:ChatMsg(".recall")
462-
MangAdmin:LogAction("Recalled "..player)
463-
end
464-
465-
function CharRepair()
466-
local player = UnitName("target") or UnitName("player")
467-
MangAdmin:ChatMsg(".repairitems")
468-
MangAdmin:LogAction("Repaired "..player.."'s items")
469-
end
470-
471-
--[[CHAR2 TAB Copy Over]]
472-
function BanButton()
473-
local cname = ma_charactertarget:GetText()
474-
local npccname = ma_npccharactertarget:GetText()
475-
MangAdmin:ChatMsg(".ban "..cname)
476-
MangAdmin:LogAction("Banned player: "..cname..".")
477-
478-
end
479-
480-
function GoNameButton()
481-
local cname = ma_charactertarget:GetText()
482-
local npccname = ma_npccharactertarget:GetText()
483-
MangAdmin:ChatMsg(".appear "..cname)
484-
MangAdmin:LogAction("Teleported TO player: "..cname..".")
485-
486-
end
487-
488-
function CreateGuildButton()
489-
local cname = ma_charactertarget:GetText()
490-
local npccname = ma_npccharactertarget:GetText()
491-
MangAdmin:ChatMsg(".guild create "..cname)
492-
MangAdmin:LogAction("Created Guild: "..cname..".")
493-
494-
end
495-
496-
function BanInfoButton()
497-
local cname = ma_charactertarget:GetText()
498-
local npccname = ma_npccharactertarget:GetText()
499-
MangAdmin:ChatMsg(".baninfo "..cname)
500-
MangAdmin:LogAction("Listed .baninfo: "..cname..".")
501-
502-
end
503-
504-
function GroupGoButton()
505-
local cname = ma_charactertarget:GetText()
506-
local npccname = ma_npccharactertarget:GetText()
507-
MangAdmin:ChatMsg(".groupsummon "..cname)
508-
MangAdmin:LogAction("Teleported "..cname.." and his/her group to me.")
509-
510-
end
511-
512-
function GuildInviteButton()
513-
local cname = ma_charactertarget:GetText()
514-
local npccname = ma_npccharactertarget:GetText()
515-
MangAdmin:ChatMsg(".guild invite "..cname)
516-
MangAdmin:LogAction("Guild invitation: "..cname..".")
517-
518-
end
519-
520-
function BanlistButton()
521-
local cname = ma_charactertarget:GetText()
522-
local npccname = ma_npccharactertarget:GetText()
523-
MangAdmin:ChatMsg(".banlist "..cname)
524-
MangAdmin:LogAction("Listed bans matching: "..cname..".")
525-
526-
end
527-
528-
function NameGoButton()
529-
local cname = ma_charactertarget:GetText()
530-
local npccname = ma_npccharactertarget:GetText()
531-
MangAdmin:ChatMsg(".summon "..cname)
532-
MangAdmin:LogAction("Teleported "..cname.." TO me.")
533-
534-
end
535-
536-
function GuildRankButton()
537-
local cname = ma_charactertarget:GetText()
538-
local npccname = ma_npccharactertarget:GetText()
539-
MangAdmin:ChatMsg(".guild rank "..cname)
540-
MangAdmin:LogAction("Guild rank change: "..cname..".")
541-
542-
end
543-
544-
function TeleGroupButton()
545-
local cname = ma_charactertarget:GetText()
546-
local npccname = ma_npccharactertarget:GetText()
547-
MangAdmin:ChatMsg(".tele group "..cname)
548-
MangAdmin:LogAction("Group teleported: "..cname..".")
549-
550-
end
551-
552-
function UnBanButton()
553-
local cname = ma_charactertarget:GetText()
554-
local npccname = ma_npccharactertarget:GetText()
555-
MangAdmin:ChatMsg(".unban "..cname)
556-
MangAdmin:LogAction("Unbanned "..cname..".")
557-
558-
end
559-
560-
function GuildDeleteButton()
561-
local cname = ma_charactertarget:GetText()
562-
local npccname = ma_npccharactertarget:GetText()
563-
MangAdmin:ChatMsg(".guild delete "..cname)
564-
MangAdmin:LogAction("Deleted guild: "..cname..".")
565-
566-
end
567-
568-
function GuildUninviteButton()
569-
local cname = ma_charactertarget:GetText()
570-
local npccname = ma_npccharactertarget:GetText()
571-
MangAdmin:ChatMsg(".guild uninvite "..cname)
572-
MangAdmin:LogAction("Removed from guild: "..cname..".")
573-
574-
end
575-
576-
function TeleNameButton()
577-
local cname = ma_charactertarget:GetText()
578-
local npccname = ma_npccharactertarget:GetText()
579-
self:ChatMsg(".tele name "..cname)
580-
self:LogAction("Teleported: "..cname..".")
581-
582-
end
583550

584551
function MuteButton()
585552
local cname = ma_charactertarget:GetText()

Commands/declarations/command_keys.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ CHAR_unfreezeCommand = "unfreeze"
8484
CHAR_possessCommand = "possess"
8585
CHAR_unpossessCommand = "unpossess"
8686

87+
CHAR_repairItemsCommand = "repairItems"
88+
CHAR_banCommand = "ban"
89+
CHAR_unbanCommand = "unban"
90+
CHAR_banInfoCommand = "banInfo"
91+
CHAR_banListCommand = "banList"
92+
CHAR_appearCommand = "appear"
93+
CHAR_summonCommand = "summon"
94+
CHAR_groupSummonCommand = "groupSummon"
95+
CHAR_teleportNameCommand = "teleportName"
96+
CHAR_teleportGroupCommand = "teleportGroup"
97+

0 commit comments

Comments
 (0)