-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathRaidBuffs.lua
93 lines (80 loc) · 2.66 KB
/
RaidBuffs.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--[[
--PLEASE NOTE THAT RAID BUFFS ARE DISABLED IN RAIDS BY DEFAULT
------------------------------------------------------------------------------------------------
-- COMMAND GUIDE
-- .raidbuff ony
-- .raidbuff rend
-- .raidbuff fengus
-- .raidbuff moldar
-- .raidbuff slipkik
-- .raidbuff zg
-- .raidbuff serenade
------------------------------------------------------------------------------------------------
------------------------------------------
-- Begin of config section
------------------------------------------
local TEAM_ALLIANCE = 0
local TEAM_HORDE = 1
local TEAM_NEUTRAL = 2
local message = 'Hope you guys enjoy the repack!'
local function splitString(inputstr, seperator)
if seperator == nil then
seperator = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..seperator.."]+)") do
table.insert(t, str)
end
return t
end
local function buffPlayers(event, player, command)
local commandArray = splitString(command)
if commandArray[1] ~= 'raidbuff' then
return
end
if player ~= nil then
if player:GetGMRank() < 3 then
return
end
end
local allyPlayers = GetPlayersInWorld(TEAM_ALLIANCE)
local hordePlayers = GetPlayersInWorld(TEAM_HORDE)
local spell
if commandArray[2] == nil then
return false
elseif commandArray[2] == 'ony' then
spell = 22888
elseif commandArray[2] == 'rend' then
spell = 16609
elseif commandArray[2] == 'fengus' then
spell = 22817
elseif commandArray[2] == 'moldar' then
spell = 22818
elseif commandArray[2] == 'slipkik' then
spell = 22820
elseif commandArray[2] == 'zg' then
spell = 24425
elseif commandArray[2] == 'serenade' then
spell = 15366
end
for n = 1, #allyPlayers do
if allyPlayers[n]:IsAlive() then
allyPlayers[n]:CastSpell(allyPlayers[n], spell)
allyPlayers[n]:AddAura(spell, allyPlayers[n])
allyPlayers[n]:PlayDirectSound(2847, allyPlayers[n])
allyPlayers[n]:SendBroadcastMessage( message )
end
end
for n = 1, #hordePlayers do
if hordePlayers[n]:IsAlive() then
hordePlayers[n]:CastSpell(hordePlayers[n], spell)
hordePlayers[n]:AddAura(spell, hordePlayers[n])
hordePlayers[n]:PlayDirectSound(2847, hordePlayers[n])
hordePlayers[n]:SendBroadcastMessage( message )
end
end
return false
end
local PLAYER_EVENT_ON_COMMAND = 42 -- (event, player, command) - player is nil if command used from console. Can return false
RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, buffPlayers)
]]