summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRuntimeAddBuff.cs
blob: 011876af76f8ed466c7757dec711df12524920bd (plain)
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
using System;
using System.Xml;
using XUtliPoolLib;

namespace XMainClient
{
	internal class AIRuntimeAddBuff : AIRunTimeNodeAction
	{
		private int BuffId;

		private int BuffId2;

		private string BuffIdName;

		private string BuffId2Name;

		private int MonsterId;

		private string MonsterIdName;

		public AIRuntimeAddBuff(XmlElement node) : base(node)
		{
			this.BuffId = int.Parse(node.GetAttribute("Shared_BuffIdmValue"));
			this.BuffId2 = int.Parse(node.GetAttribute("Shared_BuffId2mValue"));
			this.BuffIdName = node.GetAttribute("Shared_BuffIdName");
			this.BuffId2Name = node.GetAttribute("Shared_BuffId2Name");
			this.MonsterId = int.Parse(node.GetAttribute("Shared_MonsterIdmValue"));
			this.MonsterIdName = node.GetAttribute("Shared_MonsterIdName");
		}

		public override bool Update(XEntity entity)
		{
			int intByName = entity.AI.AIData.GetIntByName(this.MonsterIdName, this.MonsterId);
			int intByName2 = entity.AI.AIData.GetIntByName(this.BuffIdName, this.BuffId);
			int intByName3 = entity.AI.AIData.GetIntByName(this.BuffId2Name, this.BuffId2);
			return XSingleton<XAIOtherActions>.singleton.AddBuff(intByName, intByName2, intByName3);
		}
	}
}