Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DM.VAR.FORGE_HASAURA(pUnit,Event)
- local id = pUnit:GetInstanceID()
- if id == nil then id = 1 end
- DM[id] = DM[id] or {VAR={}}
- if DM[id].VAR.Stacks == nil then DM[id].VAR.Stacks = 0 end
- -- if he has aura
- if pUnit:HasAura(61509) == true then
- -- add to stacks
- DM[id].VAR.Stacks = DM[id].VAR.Stacks + 1
- -- if stacks more than 0, cast spell
- if DM[id].VAR.Stacks > 0 then
- -- cast spell
- local PlayersAllAround = pUnit:GetInRangePlayers()
- for a, players in pairs(PlayersAllAround) do
- if pUnit:GetDistanceYards(players) < 40 then
- pUnit:CastSpellOnTargets(23341,players)
- end
- end
- end
- else
- -- if more than one stack, spawn adds
- if DM[id].VAR.Stacks > 1 then
- -- spawn creature on nearby players
- local PlayersAllAround = pUnit:GetInRangePlayers()
- for a, players in pairs(PlayersAllAround) do
- if pUnit:GetDistanceYards(players) < 40 then
- players:SpawnCreature(6812, players:GetX(), players:GetY(), players:GetZ(), 0, 35, 15000)
- end
- end
- else
- -- he doesn't have the aura
- DM[id].VAR.Stacks = 0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment