mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 02:22:19 -04:00
Add files via upload
This commit is contained in:
@@ -3,7 +3,7 @@ local ALLOWED_MAPS = {
|
||||
1,
|
||||
}
|
||||
|
||||
local ALLOWED_SPELLS = {100150, 100160, 100161, 100177}
|
||||
local ALLOWED_SPELLS = {100150, 100160, 100161, 100177, 100186}
|
||||
|
||||
function table.indexOf(t, value)
|
||||
for k, v in ipairs(t) do
|
||||
@@ -19,15 +19,28 @@ local spellId = spell:GetEntry()
|
||||
local mapId = player:GetMapId()
|
||||
|
||||
if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then
|
||||
if table.indexOf(ALLOWED_MAPS, mapId) == -1 then
|
||||
spell:Cancel()
|
||||
player:SendBroadcastMessage("You cannot use that here.")
|
||||
else
|
||||
if spellId == 100150 then
|
||||
player:PlayDirectSound(20428)
|
||||
end
|
||||
end
|
||||
if table.indexOf(ALLOWED_MAPS, mapId) == -1 then
|
||||
spell:Cancel()
|
||||
player:SendBroadcastMessage("You can't use that here.")
|
||||
else
|
||||
if spellId == 100150 then
|
||||
player:PlayDirectSound(20428)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function OnPlayerZoneChange(event, player, newZone, newArea)
|
||||
local mapId = player:GetMapId()
|
||||
if table.indexOf(ALLOWED_MAPS, mapId) == -1 then
|
||||
for i, allowedSpell in ipairs(ALLOWED_SPELLS) do
|
||||
local aura = player:GetAura(allowedSpell)
|
||||
if aura then
|
||||
player:RemoveAura(allowedSpell)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterPlayerEvent(27, OnPlayerZoneChange)
|
||||
RegisterPlayerEvent(5, OnPlayerCastSpell)
|
||||
Reference in New Issue
Block a user