using CommonAI.Data;
using CommonAI.Zone;
using CommonAI.Zone.Instance;
using CommonLang.IO;
using CommonLang.IO.Attribute;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XmdsCommon.Plugin;
namespace XmdsCommonServer.Message
{
///
/// 战斗服通知客户端事件.
///
[MessageType(0xFF00001)]
public class PlayerRebirthEventR2B : PlayerEvent
{
//1 = 原地复活.
//2 = 出生点复活.
//3 = 复活点复活.
//4 = 技能复活.
//5 = 随机复活点
public byte type = 0;
public int HP = 0;
public int MP = 0;
public ConsumeItemEventB2R Callback = null;
public PlayerRebirthEventR2B() { }
public PlayerRebirthEventR2B(byte t, ConsumeItemEventB2R c)
{
type = t;
Callback = c;
}
override public void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutU8(type);
output.PutExt(Callback);
output.PutVS32(HP);
output.PutVS32(MP);
}
override public void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
type = input.GetU8();
Callback = input.GetExt();
HP = input.GetVS32();
MP = input.GetVS32();
}
}
///
/// 游戏服通知战斗服救人.
///
[MessageType(0xFF00002)]
public class PlayerSaveEventR2B : PlayerEvent
{
//救助者.
public InstanceUnit Saver = null;
//死者.
public InstanceUnit Decedent = null;
//复活所需要时间.
public int SaveTime = 0;
}
///
/// 游戏通知战斗服召唤坐骑.
///
[MessageType(0xFF00003)]
public class PlayerSummonMountEventR2B : PlayerEvent
{
///
/// 召唤时间.
///
public int TimeMS = 0;
///
/// 是否为上坐骑.
///
public bool IsSummonMount = false;
}
///
/// 游戏服通知技能变更.
///
[MessageType(0xFF00004)]
public class PlayerSkillChangeEventR2B : PlayerEvent
{
public enum SkillOperate : byte
{
Reset = 0, //重置所有.
Replace = 1, //替换(找到指定ID然后替换).
Add = 2, //新增.
Remove = 3, //删除.
}
///
/// 操作标识.
///
public SkillOperate OperateID = SkillOperate.Reset;
///
/// 技能列表(可能包含主动、被动).
///
public List SkillList = null;
override public void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutEnum8(OperateID);
output.PutList(SkillList, output.PutExt);
}
override public void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
OperateID = input.GetEnum8();
SkillList = input.GetList(input.GetExt);
}
}
///
/// 同步玩家可用背包数量.
///
[MessageType(0xFF00005)]
public class SyncPlayerInventorySizeEventR2B : PlayerEvent
{
public int Size = 0;
override public void WriteExternal(IOutputStream output)
{
base.WriteExternal(output);
output.PutS32(Size);
}
override public void ReadExternal(IInputStream input)
{
base.ReadExternal(input);
Size = input.GetS32();
}
}
///
/// 组队信息.
///
[MessageType(0xFF00006)]
public class TeamInfoEventR2B
{
public List UUIDList = null;
}
///
/// 单位PK等级变更事件(游戏服至战斗服).
///
[MessageType(0xFF00007)]
public class PlayerPKLevelChangeEventR2B
{
///
/// 当前等级.
///
public PKLevel CurPKLv;
}
///
/// 单位PK模式变更.(游戏服至战斗服).
///
[MessageType(0xFF00008)]
public class PlayerPKModeChangeEventR2B
{
///
/// 当前模式.
///
public PKMode CurPKMode;
}
///
/// 单位PK模式变更.(游戏服至战斗服).
///
[MessageType(0xFF00009)]
public class PlayerPKValueChangeEventR2B
{
///
/// 更改值,实际计算公式:CurrentValue += ChangeValue.
///
public int ChangeValue;
}
///
/// 属性变更指令.
///
[MessageType(0xFF00010)]
public class PropertyChangeEventR2B
{
///
/// 属性变更类型.
///
public enum PropertyChangeType : byte
{
HP,
NPC
}
public enum ValueType : byte
{
Value,
Percent // 万分比.
}
///
/// 作用类型.
///
public PropertyChangeType ChangeType;
///
/// 值类型.
///
public ValueType ChangeValueType;
///
/// 值.
///
public int ChangeValue;
///
/// 持续时间.
///
public int Duration;
///
/// 过期时间戳.
///
public long TimestampMS;
}
///
/// 宠物基础属性变更.
///
[MessageType(0xFF00011)]
public class PetBaseInfoChangeEventR2B
{
///
/// 基础属性.
///
public PetBaseInfo BaseInfo;
}
///
/// 宠物整体属性变更.
///
[MessageType(0xFF00012)]
public class PetDataChangeEventR2B
{
///
/// 属性变更类型.
///
public enum PetDataChangeType : byte
{
Add, //增加.
Delete, //删除.
Replace, //替换宠物.
Reset, //重置当前.
}
public PetDataChangeType OpType;
public PetData Data;
}
///
/// 宠物技能变更.
///
[MessageType(0xFF00013)]
public class PetSkillChangeEventR2B
{
///
/// 操作标识.
///
public PlayerSkillChangeEventR2B.SkillOperate OperateID;
///
/// 技能列表(可能包含主动、被动).
///
public List SkillList = null;
}
///
/// 组队背包更新.
///
[MessageType(0xFF00014)]
public class TeamInventorySizeChangeEventR2B
{
public int size;
}
///
/// 宠物属性变更指令.
///
[MessageType(0xFF00015)]
public class PetPropertyChangeEventR2B
{
public PropertyChangeEventR2B Order;
}
[MessageType(0xFF00016)]
public class PetFollowModeChangeEventR2B
{
public XmdsCommon.Plugin.XmdsPetConifg.XmdsPetFollowMode mode;
}
/////////////////////////////////////组队相关////////////////////////////////////////////////
///
/// 游戏服通知组队信息
///
public class TeamDataEventR2B
{
public string LeaderId;
public List TeamMembers;
public bool ContainMem(String id)
{
if(this.TeamMembers == null)
{
return false;
}
foreach(TeamMemberEventR2B member in this.TeamMembers)
{
if(member.uuid != null && member.uuid.Equals(id))
{
return true;
}
}
return false;
}
}
public class TeamMemberEventR2B
{
public int followLeader;
public string uuid;
}
}