forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoisonZone.cs
More file actions
70 lines (56 loc) · 1.7 KB
/
Copy pathPoisonZone.cs
File metadata and controls
70 lines (56 loc) · 1.7 KB
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
using System.Timers;
using L2dotNET.Models.Npcs;
using L2dotNET.Models.Player;
using L2dotNET.Tables;
namespace L2dotNET.Models.Zones.Classes
{
class PoisonZone : L2Zone
{
public PoisonZone(IdFactory idFactory) : base(idFactory)
{
ZoneId = idFactory.NextId();
}
public override void OnInit()
{
Enabled = Template.DefaultStatus;
if (Enabled && (Template.UnitTick > 0))
StartTimer();
}
public override void OnTimerAction(object sender, ElapsedEventArgs e)
{
if (ObjectsInside.Count == 0)
return;
foreach (L2Object o in ObjectsInside.Values)
{
if (o is L2Player)
{
if (Template.Target == ZoneTemplate.ZoneTarget.Npc)
continue;
//affect((L2Character)o);
}
else
{
if (!(o is L2Warrior))
continue;
if ((Template.Target == ZoneTemplate.ZoneTarget.Pc) || (Template.Target == ZoneTemplate.ZoneTarget.OnlyPc))
continue;
// affect((L2Character)o);
}
}
}
public override void OnEnter(L2Object obj)
{
if (!Enabled)
return;
base.OnEnter(obj);
obj.OnEnterZoneAsync(this);
}
public override void OnExit(L2Object obj, bool cls)
{
if (!Enabled)
return;
base.OnExit(obj, cls);
obj.OnExitZoneAsync(this, cls);
}
}
}