summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/PTC/Process/Process_PtcG2C_ClientOnlyBuffNotify.cs
blob: 7204ce9f28041f471bc42b1ea30a91ed0d0da489 (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
using System;
using KKSG;
using XUtliPoolLib;

namespace XMainClient
{
	internal class Process_PtcG2C_ClientOnlyBuffNotify
	{
		public static void Process(PtcG2C_ClientOnlyBuffNotify roPtc)
		{
			XRole xrole = XSingleton<XEntityMgr>.singleton.GetEntity(roPtc.Data.roleid) as XRole;
			bool flag = !XEntity.ValideEntity(xrole);
			if (!flag)
			{
				for (int i = 0; i < roPtc.Data.buffs.Count; i++)
				{
					XBuffAddEventArgs @event = XEventPool<XBuffAddEventArgs>.GetEvent();
					Buff buff = roPtc.Data.buffs[i];
					@event.xBuffDesc.BuffID = buff.buffID;
					@event.xBuffDesc.BuffLevel = buff.buffLevel;
					@event.Firer = xrole;
					@event.xBuffDesc.CasterID = roPtc.Data.casterid;
					bool skillIDSpecified = buff.skillIDSpecified;
					if (skillIDSpecified)
					{
						@event.xBuffDesc.SkillID = buff.skillID;
					}
					bool effecttimeSpecified = buff.effecttimeSpecified;
					if (effecttimeSpecified)
					{
						@event.xBuffDesc.EffectTime = buff.effecttime;
					}
					XSingleton<XEventMgr>.singleton.FireEvent(@event);
				}
			}
		}
	}
}