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:
36
MiscTools/FlightHandler2.lua
Normal file
36
MiscTools/FlightHandler2.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
local AURA_ID = 100225
|
||||
local TRIGGER_SPELLS = {100211, 100213, 100214}
|
||||
local CAST_SPELLS = {100210, 100218, 100219, 100220}
|
||||
local CAST_SPELL_ID = 69669
|
||||
|
||||
local function tableContains(table, element)
|
||||
for _, value in pairs(table) do
|
||||
if value == element then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function CheckAuraStacksAndCast(player, auraId, triggerSpells, castSpellId)
|
||||
if player:HasAura(auraId) then
|
||||
local aura = player:GetAura(auraId)
|
||||
local stacks = aura:GetStackAmount()
|
||||
if stacks >= 3 then
|
||||
player:CastSpell(player, castSpellId, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function OnSpellCast(event, player, spell, skipCheck)
|
||||
local spellId = spell:GetEntry()
|
||||
if tableContains(TRIGGER_SPELLS, spellId) then
|
||||
CheckAuraStacksAndCast(player, AURA_ID, TRIGGER_SPELLS, CAST_SPELL_ID)
|
||||
elseif tableContains(CAST_SPELLS, spellId) then
|
||||
if player:HasAura(AURA_ID) then
|
||||
player:RemoveAura(AURA_ID)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterPlayerEvent(5, OnSpellCast)
|
||||
@@ -1,5 +1,10 @@
|
||||
function MurkyOnSpawn(event, creature)
|
||||
local playerName = creature:GetOwner():GetName()
|
||||
local owner = creature:GetOwner()
|
||||
if not owner then
|
||||
return
|
||||
end
|
||||
local playerName = owner:GetName()
|
||||
|
||||
local dialogue = {
|
||||
"Mrglglglgl! Murky here, reporting for duty!",
|
||||
"Mrrrrrrrglglglgl! Murky happy to serve you, " .. playerName .. "!",
|
||||
|
||||
Reference in New Issue
Block a user