forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathL2StaticObject.cs
More file actions
78 lines (67 loc) · 1.9 KB
/
Copy pathL2StaticObject.cs
File metadata and controls
78 lines (67 loc) · 1.9 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
71
72
73
74
75
76
77
78
using System;
using System.Linq;
using System.Threading.Tasks;
using L2dotNET.Models.Player;
using L2dotNET.Network.serverpackets;
using L2dotNET.Templates;
namespace L2dotNET.Models.Npcs.Decor
{
public class L2StaticObject : L2Character
{
/// <summary>
/// EL2_DOOR (1), EL2_AIRSHIPKEY (3)
/// </summary>
public int StaticId;
public int MeshId = 0;
public int StructureId = 0;
public int Type = 0;
public byte Closed = 1;
public ShowTownMap TownMap;
public string Htm;
public int Pdef;
public int Mdef;
public bool UnlockTrigger = false;
public bool UnlockSkill = false;
public bool UnlockNpc = false;
public L2StaticObject(int objectId, CharTemplate template) : base(objectId, template)
{
}
public override async Task BroadcastUserInfoAsync()
{
foreach (L2Player obj in KnownObjects.Values.OfType<L2Player>())
await obj.SendPacketAsync(new StaticObject(this));
}
public override async Task OnActionAsync(L2Player player)
{
await player.SendMessageAsync(AsString());
player.SetTargetAsync(this);
}
public byte CanBeSelected()
{
return 1;
}
public byte ShowHp()
{
//TODO castle war
return 0;
}
public virtual int GetDamage()
{
return 0;
}
public int Enemy()
{
return 0;
}
public void SetLoc(string[] p)
{
X = Convert.ToInt32(p[0]);
Y = Convert.ToInt32(p[1]);
Z = Convert.ToInt32(p[2]);
}
public void SetTex(string[] d)
{
TownMap = new ShowTownMap($"town_map.{d[0]}", Convert.ToInt32(d[1]), Convert.ToInt32(d[2]));
}
}
}