-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathauto_revive.lua
59 lines (35 loc) · 984 Bytes
/
auto_revive.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
local maxlevel = 80
local function SKULY(eventid, delay, repeats, player)
local corpse = player:GetCorpse()
if corpse ~= nil then
local map = corpse:GetMap()
local mapID = map:GetMapId()
local inDungeon = map:IsDungeon()
local inBG = map:IsBattleground()
local isPvP = player:IsPvPFlagged()
if player:GetLevel() <= maxlevel then
if not inBG and not isPvP then
if player:HasAura( 8326 ) then
local O = corpse:GetO()
local X = corpse:GetX()
local Y = corpse:GetY()
local Z = corpse:GetZ()
player:ResurrectPlayer( 100, false )
player:Teleport( mapID, X, Y, Z, O )
player:CastSpell( player, 1302, true )
player:CastSpell( player, 15007, true )
local aura = player:AddAura( 15007, player )
aura:SetDuration( 45000 )
end
end
end
end
end
function Repop(event, player)
player:RegisterEvent(SKULY, 500, 2, player)
end
local function OnLogin(event, player)
player:RegisterEvent(SKULY, 2000, 5, player)
end
RegisterPlayerEvent(3, OnLogin)
RegisterPlayerEvent(35, Repop)