BattleEventsB2C.cs 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  1. using CommonAI.data;
  2. using CommonAI.Data;
  3. using CommonAI.Zone;
  4. using CommonAI.Zone.Instance;
  5. using CommonLang.IO;
  6. using CommonLang.IO.Attribute;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using XmdsCommon.Plugin;
  12. namespace XmdsCommon.Message
  13. {
  14. /// <summary>
  15. /// 战斗状态改变事件.
  16. /// </summary>
  17. [MessageType(0x9001001)]
  18. public class CombatStateChangeEvent : ObjectEvent
  19. {
  20. private BattleStatus mCurState = BattleStatus.None;
  21. public BattleStatus CurState { get { return mCurState; } }
  22. public CombatStateChangeEvent() { }
  23. public CombatStateChangeEvent(uint unit_id, BattleStatus state) : base(unit_id) { mCurState = state; }
  24. public override void WriteExternal(IOutputStream output)
  25. {
  26. base.WriteExternal(output);
  27. output.PutEnum8(mCurState);
  28. }
  29. public override void ReadExternal(IInputStream input)
  30. {
  31. base.ReadExternal(input);
  32. mCurState = input.GetEnum8<BattleStatus>();
  33. }
  34. }
  35. /// <summary>
  36. /// 跳战斗数字.
  37. /// </summary>
  38. [MessageType(0xF000010)]
  39. public class BattleHintNumberB2C : PlayerEvent
  40. {
  41. public uint TargetObjID;
  42. public int Value;
  43. public byte State;
  44. public BattleHintNumberB2C() { }
  45. public BattleHintNumberB2C(uint objId, int hp, byte state)
  46. {
  47. TargetObjID = objId;
  48. Value = hp;
  49. State = state;
  50. }
  51. override public void WriteExternal(IOutputStream output)
  52. {
  53. base.WriteExternal(output);
  54. output.PutU32(TargetObjID);
  55. output.PutS32(Value);
  56. output.PutU8(State);
  57. }
  58. override public void ReadExternal(IInputStream input)
  59. {
  60. base.ReadExternal(input);
  61. TargetObjID = input.GetU32();
  62. Value = input.GetS32();
  63. State = input.GetU8();
  64. }
  65. }
  66. /// <summary>
  67. /// 玩家外观变更消息
  68. /// </summary>
  69. [MessageType(0xF000001)]
  70. public class PlayAvatarEventB2C : ObjectEvent
  71. {
  72. public List<XmdsAvatarInfo> AvatarList = null;
  73. public PlayAvatarEventB2C() { }
  74. public PlayAvatarEventB2C(List<XmdsAvatarInfo> avatar)
  75. {
  76. AvatarList = avatar;
  77. }
  78. public PlayAvatarEventB2C(uint unit_id, List<XmdsAvatarInfo> avatar)
  79. : base(unit_id)
  80. {
  81. AvatarList = avatar;
  82. }
  83. override public void WriteExternal(IOutputStream output)
  84. {
  85. base.WriteExternal(output);
  86. output.PutList<XmdsAvatarInfo>(AvatarList, output.PutExt);
  87. }
  88. override public void ReadExternal(IInputStream input)
  89. {
  90. base.ReadExternal(input);
  91. AvatarList = input.GetList<XmdsAvatarInfo>(input.GetExt<XmdsAvatarInfo>);
  92. }
  93. }
  94. /// <summary>
  95. /// 能够同步给给客户端的数据.
  96. /// </summary>
  97. [MessageType(0xF000008)]
  98. public class PlayerVisibleDataB2C : IExternalizable, CommonAI.ZoneClient.IUnitVisibleData
  99. {
  100. /// <summary>
  101. /// 单位基础信息.
  102. /// </summary>
  103. public XmdsUnitBaseInfo BaseInfo = new XmdsUnitBaseInfo();
  104. /// <summary>
  105. ///装备时装信息.
  106. /// </summary>
  107. public List<XmdsAvatarInfo> AvatarList = new List<XmdsAvatarInfo>();
  108. /// <summary>
  109. /// 单位PK相关数据.
  110. /// </summary>
  111. public PKInfo UnitPKInfo = null;
  112. /// <summary>
  113. ///动态场景相关信息.
  114. /// </summary>
  115. public SceneInfo UnitSceneInfo = null;
  116. public void WriteExternal(IOutputStream output)
  117. {
  118. output.PutExt(this.BaseInfo);
  119. output.PutList(this.AvatarList, output.PutExt);
  120. output.PutExt(this.UnitPKInfo);
  121. output.PutExt(this.UnitSceneInfo);
  122. }
  123. public void ReadExternal(IInputStream input)
  124. {
  125. this.BaseInfo = input.GetExt<XmdsUnitBaseInfo>();
  126. this.AvatarList = input.GetList<XmdsAvatarInfo>(input.GetExt<XmdsAvatarInfo>);
  127. this.UnitPKInfo = input.GetExt<PKInfo>();
  128. this.UnitSceneInfo = input.GetExt<SceneInfo>();
  129. }
  130. public void setVisibleName(String name) { }
  131. public void setVisibleCardData(ICardData datas) { }
  132. }
  133. [MessageType(0xF000023)]
  134. public class PlayerGotItemB2C : PlayerEvent
  135. {
  136. public string IconName;//tcCode
  137. public int Qty;//数量.
  138. public int Quality;//品质.
  139. public object Clone()
  140. {
  141. PlayerGotItemB2C ret = new PlayerGotItemB2C();
  142. ret.IconName = IconName;
  143. ret.Qty = Qty;
  144. ret.Quality = Quality;
  145. return ret;
  146. }
  147. override public void WriteExternal(IOutputStream output)
  148. {
  149. base.WriteExternal(output);
  150. output.PutUTF(IconName);
  151. output.PutS32(Qty);
  152. output.PutS32(Quality);
  153. }
  154. override public void ReadExternal(IInputStream input)
  155. {
  156. base.ReadExternal(input);
  157. IconName = input.GetUTF();
  158. Qty = input.GetS32();
  159. Quality = input.GetS32();
  160. }
  161. }
  162. [MessageType(0xF000006)]
  163. public class DropItem : ICloneable, IExternalizable
  164. {
  165. public string ObjID;
  166. public string Name;
  167. public string FileName;//
  168. public int Qty;//数量.
  169. public int TTL;//存在时间.
  170. public int Quality;//品质.
  171. public int TemplateID;//模板ID
  172. public int FreezeTime;//不可捡时间时间.
  173. public int ProtectTime;//保护时间.
  174. public List<string> PlayerUUID;//哪个玩家掉的.
  175. public string IconName;//图标.
  176. public byte Mode;//拾取模式.
  177. public float OriginX;//初始坐标X.
  178. public float OriginY;//初始坐标Y.
  179. public int createTime; //创建时间
  180. public String code; //道具code
  181. //道具绑定玩家id,只有该玩家可见,可拾取
  182. public string bindPlayerId;
  183. public object Clone()
  184. {
  185. DropItem ret = new DropItem();
  186. ret.ObjID = ObjID;
  187. ret.Name = Name;
  188. ret.FileName = FileName;
  189. ret.Qty = Qty;
  190. ret.TTL = TTL;
  191. ret.Quality = Quality;
  192. ret.TemplateID = TemplateID;
  193. ret.FreezeTime = FreezeTime;
  194. ret.ProtectTime = ProtectTime;
  195. ret.PlayerUUID = PlayerUUID;
  196. ret.IconName = IconName;
  197. ret.Mode = Mode;
  198. ret.OriginX = OriginX;
  199. ret.OriginY = OriginY;
  200. ret.code = this.code;
  201. ret.bindPlayerId = this.bindPlayerId;
  202. ret.createTime = this.createTime;
  203. return ret;
  204. }
  205. public void WriteExternal(IOutputStream output)
  206. {
  207. output.PutUTF(ObjID);
  208. output.PutUTF(Name);
  209. output.PutUTF(FileName);
  210. output.PutS32(Qty);
  211. output.PutS32(TTL);
  212. output.PutS32(Quality);
  213. output.PutS32(TemplateID);
  214. output.PutS32(FreezeTime);
  215. output.PutS32(ProtectTime);
  216. output.PutList<string>(PlayerUUID, output.PutUTF);
  217. output.PutUTF(IconName);
  218. output.PutU8(Mode);
  219. output.PutF32(OriginX);
  220. output.PutF32(OriginY);
  221. output.PutUTF(this.code);
  222. output.PutS32(this.createTime);
  223. }
  224. public void ReadExternal(IInputStream input)
  225. {
  226. ObjID = input.GetUTF();
  227. Name = input.GetUTF();
  228. FileName = input.GetUTF();
  229. Qty = input.GetS32();
  230. TTL = input.GetS32();
  231. Quality = input.GetS32();
  232. TemplateID = input.GetS32();
  233. FreezeTime = input.GetS32();
  234. ProtectTime = input.GetS32();
  235. PlayerUUID = input.GetUTFList();
  236. IconName = input.GetUTF();
  237. Mode = input.GetU8();
  238. OriginX = input.GetF32();
  239. OriginY = input.GetF32();
  240. this.code = input.GetUTF();
  241. this.createTime = input.GetS32();
  242. }
  243. }
  244. [MessageType(0xF000011)]
  245. public class ScriptAddUnitEventsB2C : ZoneEvent
  246. {
  247. public uint ObjectID;
  248. public int TemplateID;
  249. public float X;
  250. public float Y;
  251. public ScriptAddUnitEventsB2C() { }
  252. public ScriptAddUnitEventsB2C(InstanceUnit unit)
  253. {
  254. this.ObjectID = unit.ID;
  255. this.TemplateID = unit.Info.ID;
  256. this.X = unit.X;
  257. this.Y = unit.Y;
  258. }
  259. public override void WriteExternal(IOutputStream output)
  260. {
  261. output.PutU32(this.ObjectID);
  262. output.PutS32(this.TemplateID);
  263. output.PutF32(this.X);
  264. output.PutF32(this.Y);
  265. }
  266. public override void ReadExternal(IInputStream input)
  267. {
  268. this.ObjectID = input.GetU32();
  269. this.TemplateID = input.GetS32();
  270. this.X = input.GetF32();
  271. this.Y = input.GetF32();
  272. }
  273. }
  274. [MessageType(0xF000012)]
  275. public class ScriptRemoveUnitEventsB2C : ZoneEvent
  276. {
  277. public uint ObjectID;
  278. public int TemplateID;
  279. public ScriptRemoveUnitEventsB2C() { }
  280. public ScriptRemoveUnitEventsB2C(InstanceUnit unit)
  281. {
  282. this.ObjectID = unit.ID;
  283. this.TemplateID = unit.Info.ID;
  284. }
  285. public override void WriteExternal(IOutputStream output)
  286. {
  287. output.PutU32(this.ObjectID);
  288. output.PutS32(this.TemplateID);
  289. }
  290. public override void ReadExternal(IInputStream input)
  291. {
  292. this.ObjectID = input.GetU32();
  293. this.TemplateID = input.GetS32();
  294. }
  295. }
  296. /// <summary>
  297. /// 基础数据更新主要是等级和VIP消息
  298. /// </summary>
  299. [MessageType(0xF000002)]
  300. public class XmdsUnitBaseInfoEventB2C : ObjectEvent
  301. {
  302. public XmdsUnitBaseInfo Props = null;
  303. public XmdsUnitBaseInfoEventB2C() { }
  304. public XmdsUnitBaseInfoEventB2C(XmdsUnitBaseInfo props)
  305. {
  306. Props = props;
  307. }
  308. public XmdsUnitBaseInfoEventB2C(uint unit_id, XmdsUnitBaseInfo props)
  309. : base(unit_id)
  310. {
  311. Props = props;
  312. }
  313. override public void WriteExternal(IOutputStream output)
  314. {
  315. base.WriteExternal(output);
  316. output.PutExt(Props);
  317. }
  318. override public void ReadExternal(IInputStream input)
  319. {
  320. base.ReadExternal(input);
  321. Props = input.GetExt<XmdsUnitBaseInfo>();
  322. }
  323. }
  324. /// <summary>
  325. /// 属性更新的消息
  326. /// </summary>
  327. [MessageType(0xF000003)]
  328. public class XmdsUnitPropEventB2C : PlayerEvent
  329. {
  330. public XmdsUnitProp Props = null;
  331. public XmdsUnitPropEventB2C() { }
  332. public XmdsUnitPropEventB2C(XmdsUnitProp props)
  333. {
  334. Props = props;
  335. }
  336. public XmdsUnitPropEventB2C(uint unit_id, XmdsUnitProp props)
  337. : base(unit_id)
  338. {
  339. Props = props;
  340. }
  341. override public void WriteExternal(IOutputStream output)
  342. {
  343. base.WriteExternal(output);
  344. output.PutExt(Props);
  345. }
  346. override public void ReadExternal(IInputStream input)
  347. {
  348. base.ReadExternal(input);
  349. Props = input.GetExt<XmdsUnitProp>();
  350. }
  351. }
  352. /// <summary>
  353. /// 战斗服提示信息.
  354. /// </summary>
  355. [MessageType(0xF000014)]
  356. public class ShowTipsEventB2C : PlayerEvent
  357. {
  358. public string Msg = null;
  359. public override void WriteExternal(IOutputStream output)
  360. {
  361. base.WriteExternal(output);
  362. output.PutUTF(Msg);
  363. }
  364. public override void ReadExternal(IInputStream input)
  365. {
  366. base.ReadExternal(input);
  367. Msg = input.GetUTF();
  368. }
  369. }
  370. /// <summary>
  371. /// 怪物扩展数据.
  372. /// </summary>
  373. [MessageType(0xF000015)]
  374. public class MonsterVisibleDataB2C : IExternalizable, CommonAI.ZoneClient.IUnitVisibleData
  375. {
  376. /// <summary>
  377. /// 怪物类型:0:普通怪,1:稀有怪,2:首脑怪,3:精英怪,4:BOSS.
  378. /// </summary>
  379. public enum MonsterType : byte
  380. {
  381. MType0 = 0,
  382. MType1 = 1,
  383. MType2 = 2,
  384. MType3 = 3, //精英
  385. MType4 = 4, //boss
  386. MType5 = 5,
  387. MType6 = 6,
  388. }
  389. /// <summary>
  390. /// 怪物名字颜色:0:白色,默认颜色1:绿色,优秀2: 蓝色,精良3: 紫色,史诗4: 橙色,传说5: 红色,顶级.6:澄绿色
  391. /// </summary>
  392. public enum MonsterQcolor : byte
  393. {
  394. Q0 = 0,
  395. Q1 = 1,
  396. Q2 = 2,
  397. Q3 = 3,
  398. Q4 = 4,
  399. Q5 = 5,
  400. Q6 = 6,
  401. }
  402. /// <summary>
  403. /// 单位种族.
  404. /// </summary>
  405. public enum MonsterAtype : byte
  406. {
  407. Human = 0,
  408. Monster = 1,
  409. UnDead = 2,
  410. Evil = 3,
  411. Other = 9,
  412. }
  413. /// <summary>
  414. /// 攻击类型.
  415. /// </summary>
  416. public enum MonsterAttackType : byte
  417. {
  418. Passive = 0,//被动攻击.
  419. Active = 1,//主动攻击.
  420. }
  421. /// <summary>
  422. /// 归属者信息.
  423. /// </summary>
  424. [MessageType(0xF000030)]
  425. public class HeirInfo : IExternalizable
  426. {
  427. public string Name;
  428. public int hpPercent;
  429. public CommonAI.Data.XmdsUnitPro ProType;
  430. public void ReadExternal(IInputStream input)
  431. {
  432. Name = input.GetUTF();
  433. hpPercent = input.GetS32();
  434. ProType = input.GetEnum8<CommonAI.Data.XmdsUnitPro>();
  435. }
  436. public void WriteExternal(IOutputStream output)
  437. {
  438. output.PutUTF(Name);
  439. output.PutS32(hpPercent);
  440. output.PutEnum8<CommonAI.Data.XmdsUnitPro>(ProType);
  441. }
  442. }
  443. public int MonsterID;
  444. public string DisplayName;
  445. public string Title;
  446. public MonsterAtype Atype;
  447. public MonsterQcolor Qcolor;
  448. public MonsterType MType;
  449. public MonsterAttackType AttackType;
  450. public string SenceType = null;
  451. public HeirInfo UnitHeirInfo = null;
  452. //血条层数
  453. public byte hpPlies = 1;
  454. //卡牌数据
  455. private ICardData cardInterface;
  456. public CardType[] cardData; //0-3代表有
  457. public void setVisibleName(String name)
  458. {
  459. if(name != null && name.Length > 0)
  460. {
  461. this.DisplayName = name;
  462. }
  463. }
  464. public void setVisibleCardData(ICardData datas)
  465. {
  466. this.cardInterface = datas;
  467. }
  468. public void WriteExternal(IOutputStream output)
  469. {
  470. output.PutS32(MonsterID);
  471. output.PutUTF(DisplayName);
  472. output.PutEnum8(Atype);
  473. output.PutEnum8(Qcolor);
  474. output.PutEnum8(MType);
  475. output.PutEnum8(AttackType);
  476. output.PutUTF(SenceType);
  477. output.PutUTF(Title);
  478. output.PutExt(UnitHeirInfo);
  479. output.PutU8(hpPlies);
  480. if (this.MType >= MonsterType.MType4)
  481. {
  482. for (int i = 0; i < (int)CardType.Max; i++)
  483. {
  484. CardType testType = cardInterface == null ? CardType.Max : cardInterface.GetCardData(i);
  485. output.PutEnum8(cardInterface == null ? CardType.Max : cardInterface.GetCardData(i));
  486. //System.Console.WriteLine("boss数据:" + testType);
  487. }
  488. }
  489. }
  490. public void ReadExternal(IInputStream input)
  491. {
  492. MonsterID = input.GetS32();
  493. DisplayName = input.GetUTF();
  494. Atype = input.GetEnum8<MonsterAtype>();
  495. Qcolor = input.GetEnum8<MonsterQcolor>();
  496. MType = input.GetEnum8<MonsterType>();
  497. AttackType = input.GetEnum8<MonsterAttackType>();
  498. SenceType = input.GetUTF();
  499. Title = input.GetUTF();
  500. UnitHeirInfo = input.GetExt<HeirInfo>();
  501. hpPlies = input.GetU8();
  502. if (this.MType >= MonsterType.MType4)
  503. {
  504. cardData = new CardType[(int)CardType.Max];
  505. for (int i = 0; i < (int)CardType.Max; i++)
  506. {
  507. cardData[i] = input.GetEnum8<CardType>();
  508. //System.Console.WriteLine("boss数据:" + cardData[i]);
  509. }
  510. }
  511. }
  512. }
  513. /// <summary>
  514. /// 单位PK模式改变通知.
  515. /// </summary>
  516. [MessageType(0xF000016)]
  517. public class PlayerPKModeChangeEventB2C : PlayerEvent
  518. {
  519. public PKMode CurMode = PKMode.Peace;
  520. public override void WriteExternal(IOutputStream output)
  521. {
  522. base.WriteExternal(output);
  523. output.PutEnum8(CurMode);
  524. }
  525. public override void ReadExternal(IInputStream input)
  526. {
  527. base.ReadExternal(input);
  528. CurMode = input.GetEnum8<PKMode>();
  529. }
  530. }
  531. /// <summary>
  532. /// 单位PK等级改变通知.
  533. /// </summary>
  534. [MessageType(0xF000019)]
  535. public class PlayerPKLvChangeEventB2C : ObjectEvent
  536. {
  537. public PKLevel CurLv = PKLevel.White;
  538. public override void WriteExternal(IOutputStream output)
  539. {
  540. base.WriteExternal(output);
  541. output.PutEnum8(CurLv);
  542. }
  543. public override void ReadExternal(IInputStream input)
  544. {
  545. base.ReadExternal(input);
  546. CurLv = input.GetEnum8<PKLevel>();
  547. }
  548. }
  549. /// <summary>
  550. /// PK值变更通知.
  551. /// </summary>
  552. [MessageType(0xF00001E)]
  553. public class PlayerPKValueChangeEventB2C : PlayerEvent
  554. {
  555. /// <summary>
  556. /// 当前PK值.
  557. /// </summary>
  558. public int CurPKValue;
  559. public override void WriteExternal(IOutputStream output)
  560. {
  561. base.WriteExternal(output);
  562. output.PutS32(CurPKValue);
  563. }
  564. public override void ReadExternal(IInputStream input)
  565. {
  566. base.ReadExternal(input);
  567. CurPKValue = input.GetS32();
  568. }
  569. }
  570. /// <summary>
  571. /// 召唤物客户端同步信息.
  572. /// </summary>
  573. [MessageType(0xF00001A)]
  574. public class SummonUnitVisibleDataB2C : IExternalizable, CommonAI.ZoneClient.IUnitVisibleData
  575. {
  576. /// <summary>
  577. /// 宿主ID.
  578. /// </summary>
  579. public uint MasterObjID = 0;
  580. //召唤物模型信息。如果不为空,则替换之前获取模型的逻辑
  581. public List<XmdsAvatarInfo> AvatarList = null;
  582. public void ReadExternal(IInputStream input)
  583. {
  584. this.MasterObjID = input.GetU32();
  585. this.AvatarList = input.GetList<XmdsAvatarInfo>(input.GetExt<XmdsAvatarInfo>);
  586. }
  587. public void WriteExternal(IOutputStream output)
  588. {
  589. output.PutU32(MasterObjID);
  590. output.PutList(this.AvatarList, output.PutExt);
  591. }
  592. public void setVisibleName(String name) {}
  593. public void setVisibleCardData(ICardData datas) { }
  594. }
  595. /// <summary>
  596. /// 同步队友信息.
  597. /// </summary>
  598. [MessageType(0xF00001C)]
  599. public class PlayerTeamIntoEventB2C : PlayerEvent
  600. {
  601. public List<string> Members;
  602. public override void WriteExternal(IOutputStream output)
  603. {
  604. base.WriteExternal(output);
  605. output.PutList<string>(Members, output.PutUTF);
  606. }
  607. public override void ReadExternal(IInputStream input)
  608. {
  609. base.ReadExternal(input);
  610. Members = input.GetUTFList();
  611. }
  612. }
  613. /// <summary>
  614. /// 单位战斗属性同步.
  615. /// </summary>
  616. [MessageType(0xF00001D)]
  617. public class PlayerBattlePropChangeEventB2C : UnitAttrMaskType
  618. {
  619. public ulong Mask = 0;
  620. //最大血量.
  621. public int MaxHP = 100;
  622. //移动速度(最终值)
  623. public float MoveSpeed = 7;
  624. //移动速度加成
  625. public int MoveSpeedAddition = 0;
  626. //血量恢复值.
  627. public int HPReborn = 10;
  628. //同步Attribute
  629. //生命增加百分比
  630. public int HPPer = 0;
  631. //攻击
  632. public int Attack = 0;
  633. //攻击增加百分比
  634. public int AttackPer = 0;
  635. //防御
  636. public int Def = 0;
  637. //防御增加百分比
  638. public int DefPer = 0;
  639. //穿透增加百分比
  640. public int IgnoreDefensePer = 0;
  641. //暴击率
  642. public int CritRate = 0;
  643. //抗暴率
  644. public int ResCritRate = 0;
  645. //暴击伤害叠加百分比
  646. public int CritDamage = 0;
  647. //伤害增加百分比(玩家之间)
  648. public int IncAllDamage = 0;
  649. //伤害减免百分比(玩家之间)
  650. public int AllDamageReduce = 0;
  651. //韧性
  652. public int CtrlTimeReduce = 0;
  653. //冷却缩减
  654. public int SkillCD = 0;
  655. //治疗效果
  656. public int HealEffect = 0;
  657. //被治疗效果
  658. public int HealedEffect = 0;
  659. //技能加成
  660. public int SkillDamage = 0;
  661. //攻击速度
  662. public int AttackSpeed = 0;
  663. //控制增幅
  664. public int ControlUp = 0;
  665. //金属性攻击
  666. public int GoldAttack = 0;
  667. //金属性防御
  668. public int GoldDefense = 0;
  669. //木属性攻击
  670. public int WoodAttack = 0;
  671. //木属性防御
  672. public int WoodDefense = 0;
  673. //水属性攻击
  674. public int WaterAttack = 0;
  675. //水属性防御
  676. public int WaterDefense = 0;
  677. //火属性攻击
  678. public int FireAttack = 0;
  679. //火属性防御
  680. public int FireDefense = 0;
  681. //土属性攻击
  682. public int SoilAttack = 0;
  683. //土属性防御
  684. public int SoilDefense = 0;
  685. //对Boss额外暴击率
  686. public int ToBossCritRate = 0;
  687. //对Boss额外暴击伤害
  688. public int ToBossCritDamage = 0;
  689. //金克制
  690. public int GoldRestraint = 0;
  691. //木克制
  692. public int WoodRestraint = 0;
  693. //水克制
  694. public int WaterRestraint = 0;
  695. //火克制
  696. public int FireRestraint = 0;
  697. //土克制
  698. public int SoilRestraint = 0;
  699. //金抵御
  700. public int GoldResist = 0;
  701. //木抵御
  702. public int WoodResist = 0;
  703. //水抵御
  704. public int WaterResist = 0;
  705. //火抵御
  706. public int FireResist = 0;
  707. //土抵御
  708. public int SoilResist = 0;
  709. //杀意值
  710. public int PvpKillValue = 0;
  711. //妖气等级
  712. public int YaoQiLevel = 0;
  713. //普攻吸血
  714. public int NormalAtkLeech = 0;
  715. //技能吸血
  716. public int ActiveAtkLeech = 0;
  717. //神器主属性伤害加成
  718. public int ArtifactMainPer = 0;
  719. //最大生命值(ext, 暂时仅角色面板显示)
  720. public int MaxHPExt = 0;
  721. /// 野外boss伤害增益
  722. public int FieldBossDamageAdd;
  723. /// 副本小怪伤害增益
  724. public int DungeonMonsterDamageAdd;
  725. //妖兽破定效率
  726. public int breakShieldValue;
  727. public int[] MonsterRestraint = new int[(int)UnitFateType.Five];
  728. //猎妖属性
  729. public int monsterAtk; // 猎妖攻
  730. public int monsterDef; // 猎妖防
  731. public int monsterAtkPer; // 猎妖攻百分比
  732. public int monsterDefPer; // 猎妖防百分比
  733. public override void WriteExternal(IOutputStream output)
  734. {
  735. base.WriteExternal(output);
  736. output.PutU64(Mask);
  737. if (Mask == 0) { return; }
  738. if ((Mask & MASK_MAX_HP) != 0) output.PutS32(MaxHP);
  739. if ((Mask & MASK_MOVE_SPEED) != 0) output.PutF32(MoveSpeed);
  740. if ((Mask & MASK_HP_REBORN) != 0) output.PutS32(HPReborn);
  741. //同步Attribute
  742. if ((Mask & MASK_HP_PER) != 0) output.PutS32(HPPer);
  743. if ((Mask & MASK_ATTACK) != 0) output.PutS32(Attack);
  744. if ((Mask & MASK_ATTACK_PER) != 0) output.PutS32(AttackPer);
  745. if ((Mask & MASK_DEF) != 0) output.PutS32(Def);
  746. if ((Mask & MASK_DEF_PER) != 0) output.PutS32(DefPer);
  747. if ((Mask & MASK_IGNORE_DEFENSE_PER) != 0) output.PutS32(IgnoreDefensePer);
  748. if ((Mask & MASK_CRIT_RATE) != 0) output.PutS32(CritRate);
  749. if ((Mask & MASK_CRIT_DAMAGE) != 0) output.PutS32(CritDamage);
  750. if ((Mask & MASK_INCALLDAMAGE) != 0) output.PutS32(IncAllDamage);
  751. if ((Mask & MASK_ALL_DAMAGE_REDUCE) != 0) output.PutS32(AllDamageReduce);
  752. if ((Mask & MASK_CTRLTIME_REDUCE) != 0) output.PutS32(CtrlTimeReduce);
  753. if ((Mask & MASK_SKILL_CD) != 0) output.PutS32(SkillCD);
  754. if ((Mask & MASK_HEALEFFECT) != 0) output.PutS32(HealEffect);
  755. if ((Mask & MASK_HEALEDEFFECT) != 0) output.PutS32(HealedEffect);
  756. if ((Mask & MASK_SKILLDAMAGE) != 0) output.PutS32(SkillDamage);
  757. if ((Mask & MASK_ATTACK_SPEED) != 0) output.PutS32(AttackSpeed);
  758. if ((Mask & MASK_CONTROL_UP) != 0) output.PutS32(ControlUp);
  759. if ((Mask & MASK_RES_CRIT_RATE) != 0) output.PutS32(this.ResCritRate);
  760. if ((Mask & MASK_GOLD_ATTACK) != 0) output.PutS32(GoldAttack);
  761. if ((Mask & MASK_GOLD_DEFENSE) != 0) output.PutS32(GoldDefense);
  762. if ((Mask & MASK_WOOD_ATTACK) != 0) output.PutS32(WoodAttack);
  763. if ((Mask & MASK_WOOD_DEFENSE) != 0) output.PutS32(WoodDefense);
  764. if ((Mask & MASK_WATER_ATTACK) != 0) output.PutS32(WaterAttack);
  765. if ((Mask & MASK_WATER_DEFENSE) != 0) output.PutS32(WaterDefense);
  766. if ((Mask & MASK_FIRE_ATTACK) != 0) output.PutS32(FireAttack);
  767. if ((Mask & MASK_FIRE_DEFENSE) != 0) output.PutS32(FireDefense);
  768. if ((Mask & MASK_SOIL_ATTACK) != 0) output.PutS32(SoilAttack);
  769. if ((Mask & MASK_SOIL_DEFENSE) != 0) output.PutS32(SoilDefense);
  770. if ((Mask & MASK_TOBOSS_CRIT_RATE) != 0) output.PutS32(ToBossCritRate);
  771. if ((Mask & MASK_TOBOSS_CRIT_DAMAGE) != 0) output.PutS32(ToBossCritDamage);
  772. if ((Mask & MASK_GOLD_RESTRAINT) != 0) output.PutS32(GoldRestraint);
  773. if ((Mask & MASK_WOOD_RESTRAINT) != 0) output.PutS32(WoodRestraint);
  774. if ((Mask & MASK_WATER_RESTRAINT) != 0) output.PutS32(WaterRestraint);
  775. if ((Mask & MASK_FIRE_RESTRAINT) != 0) output.PutS32(FireRestraint);
  776. if ((Mask & MASK_SOIL_RESTRAINT) != 0) output.PutS32(SoilRestraint);
  777. if ((Mask & MASK_GOLD_RESIST) != 0) output.PutS32(GoldResist);
  778. if ((Mask & MASK_WOOD_RESIST) != 0) output.PutS32(WoodResist);
  779. if ((Mask & MASK_WATER_RESIST) != 0) output.PutS32(WaterResist);
  780. if ((Mask & MASK_FIRE_RESIST) != 0) output.PutS32(FireResist);
  781. if ((Mask & MASK_SOIL_RESIST) != 0) output.PutS32(SoilResist);
  782. if ((Mask & MASK_PVP_KILLVALUE) != 0) output.PutS32(PvpKillValue);
  783. if ((Mask & MASK_YAOQI_LEVEL) != 0) output.PutS32(YaoQiLevel);
  784. if ((Mask & MASK_NORMAL_ATK_LEECH) != 0) output.PutS32(NormalAtkLeech);
  785. if ((Mask & MASK_ACTIVE_ATK_LEECH) != 0) output.PutS32(ActiveAtkLeech);
  786. if ((Mask & MASK_ARTIFACTMAIN_PER) != 0) output.PutS32(ArtifactMainPer);
  787. if ((Mask & MASK_FIELD_BOSS_DAMAGEADD) != 0) output.PutS32(FieldBossDamageAdd);
  788. if ((Mask & MASK_MAX_HP_EXT) != 0) output.PutS32(this.MaxHPExt);
  789. if ((Mask & MASK_DUNGEON_MONETER_DAMAGEADD) != 0) output.PutS32(DungeonMonsterDamageAdd);
  790. if ((Mask & MASK_MOVE_SPEED_ADDITION) != 0) output.PutS32(this.MoveSpeedAddition);
  791. //新增属性
  792. if ((Mask & MASK_MONSTER_RESTRAINT_1) != 0) output.PutS32(this.MonsterRestraint[0]);
  793. if ((Mask & MASK_MONSTER_RESTRAINT_2) != 0) output.PutS32(this.MonsterRestraint[1]);
  794. if ((Mask & MASK_MONSTER_RESTRAINT_3) != 0) output.PutS32(this.MonsterRestraint[2]);
  795. if ((Mask & MASK_MONSTER_RESTRAINT_4) != 0) output.PutS32(this.MonsterRestraint[3]);
  796. if ((Mask & MASK_MONSTER_RESTRAINT_5) != 0) output.PutS32(this.MonsterRestraint[4]);
  797. if ((Mask & MASK_MONSTER_ATK) != 0) output.PutS32(this.monsterAtk);
  798. if ((Mask & MASK_MONSTER_DEF) != 0) output.PutS32(this.monsterDef);
  799. if ((Mask & MASK_MONSTER_ATK_PER) != 0) output.PutS32(this.monsterAtkPer);
  800. if ((Mask & MASK_MONSTER_DEF_PER) != 0) output.PutS32(this.monsterDefPer);
  801. }
  802. public override void ReadExternal(IInputStream input)
  803. {
  804. base.ReadExternal(input);
  805. Mask = input.GetU64();
  806. if (Mask == 0) { return; }
  807. if ((Mask & MASK_MAX_HP) != 0) this.MaxHP = input.GetS32();
  808. if ((Mask & MASK_MOVE_SPEED) != 0) this.MoveSpeed = input.GetF32();
  809. if ((Mask & MASK_HP_REBORN) != 0) this.HPReborn = input.GetS32();
  810. //同步Attribute
  811. if ((Mask & MASK_HP_PER) != 0) this.HPPer = input.GetS32();
  812. if ((Mask & MASK_ATTACK) != 0) this.Attack = input.GetS32();
  813. if ((Mask & MASK_ATTACK_PER) != 0) this.AttackPer = input.GetS32();
  814. if ((Mask & MASK_DEF) != 0) this.Def = input.GetS32();
  815. if ((Mask & MASK_DEF_PER) != 0) this.DefPer = input.GetS32();
  816. if ((Mask & MASK_IGNORE_DEFENSE_PER) != 0) this.IgnoreDefensePer = input.GetS32();
  817. if ((Mask & MASK_CRIT_RATE) != 0) this.CritRate = input.GetS32();
  818. if ((Mask & MASK_CRIT_DAMAGE) != 0) this.CritDamage = input.GetS32();
  819. if ((Mask & MASK_INCALLDAMAGE) != 0) this.IncAllDamage = input.GetS32();
  820. if ((Mask & MASK_ALL_DAMAGE_REDUCE) != 0) this.AllDamageReduce = input.GetS32();
  821. if ((Mask & MASK_CTRLTIME_REDUCE) != 0) this.CtrlTimeReduce = input.GetS32();
  822. if ((Mask & MASK_SKILL_CD) != 0) this.SkillCD = input.GetS32();
  823. if ((Mask & MASK_HEALEFFECT) != 0) this.HealEffect = input.GetS32();
  824. if ((Mask & MASK_HEALEDEFFECT) != 0) this.HealedEffect = input.GetS32();
  825. if ((Mask & MASK_SKILLDAMAGE) != 0) this.SkillDamage = input.GetS32();
  826. if ((Mask & MASK_ATTACK_SPEED) != 0) this.AttackSpeed = input.GetS32();
  827. if ((Mask & MASK_CONTROL_UP) != 0) this.ControlUp = input.GetS32();
  828. if ((Mask & MASK_RES_CRIT_RATE) != 0) this.ResCritRate = input.GetS32();
  829. if ((Mask & MASK_GOLD_ATTACK) != 0) this.GoldAttack = input.GetS32();
  830. if ((Mask & MASK_GOLD_DEFENSE) != 0) this.GoldDefense = input.GetS32();
  831. if ((Mask & MASK_WOOD_ATTACK) != 0) this.WoodAttack = input.GetS32();
  832. if ((Mask & MASK_WOOD_DEFENSE) != 0) this.WoodDefense = input.GetS32();
  833. if ((Mask & MASK_WATER_ATTACK) != 0) this.WaterAttack = input.GetS32();
  834. if ((Mask & MASK_WATER_DEFENSE) != 0) this.WaterDefense = input.GetS32();
  835. if ((Mask & MASK_FIRE_ATTACK) != 0) this.FireAttack = input.GetS32();
  836. if ((Mask & MASK_FIRE_DEFENSE) != 0) this.FireDefense = input.GetS32();
  837. if ((Mask & MASK_SOIL_ATTACK) != 0) this.SoilAttack = input.GetS32();
  838. if ((Mask & MASK_SOIL_DEFENSE) != 0) this.SoilDefense = input.GetS32();
  839. if ((Mask & MASK_TOBOSS_CRIT_RATE) != 0) this.ToBossCritRate = input.GetS32();
  840. if ((Mask & MASK_TOBOSS_CRIT_DAMAGE) != 0) this.ToBossCritDamage = input.GetS32();
  841. if ((Mask & MASK_GOLD_RESTRAINT) != 0) this.GoldRestraint = input.GetS32();
  842. if ((Mask & MASK_WOOD_RESTRAINT) != 0) this.WoodRestraint = input.GetS32();
  843. if ((Mask & MASK_WATER_RESTRAINT) != 0) this.WaterRestraint = input.GetS32();
  844. if ((Mask & MASK_FIRE_RESTRAINT) != 0) this.FireRestraint = input.GetS32();
  845. if ((Mask & MASK_SOIL_RESTRAINT) != 0) this.SoilRestraint = input.GetS32();
  846. if ((Mask & MASK_GOLD_RESIST) != 0) this.GoldResist = input.GetS32();
  847. if ((Mask & MASK_WOOD_RESIST) != 0) this.WoodResist = input.GetS32();
  848. if ((Mask & MASK_WATER_RESIST) != 0) this.WaterResist = input.GetS32();
  849. if ((Mask & MASK_FIRE_RESIST) != 0) this.FireResist = input.GetS32();
  850. if ((Mask & MASK_SOIL_RESIST) != 0) this.SoilResist = input.GetS32();
  851. if ((Mask & MASK_PVP_KILLVALUE) != 0) this.PvpKillValue = input.GetS32();
  852. if ((Mask & MASK_YAOQI_LEVEL) != 0) this.YaoQiLevel = input.GetS32();
  853. if ((Mask & MASK_NORMAL_ATK_LEECH) != 0) this.NormalAtkLeech = input.GetS32();
  854. if ((Mask & MASK_ACTIVE_ATK_LEECH) != 0) this.ActiveAtkLeech = input.GetS32();
  855. if ((Mask & MASK_ARTIFACTMAIN_PER) != 0) this.ArtifactMainPer = input.GetS32();
  856. if ((Mask & MASK_FIELD_BOSS_DAMAGEADD) != 0) this.FieldBossDamageAdd = input.GetS32();
  857. if ((Mask & MASK_MAX_HP_EXT) != 0) this.MaxHPExt = input.GetS32();
  858. if ((Mask & MASK_DUNGEON_MONETER_DAMAGEADD) != 0) this.DungeonMonsterDamageAdd = input.GetS32();
  859. if ((Mask & MASK_MOVE_SPEED_ADDITION) != 0) this.MoveSpeedAddition = input.GetS32();
  860. //新增属性
  861. if ((Mask & MASK_MONSTER_RESTRAINT_1) != 0) this.MonsterRestraint[0] = input.GetS32();
  862. if ((Mask & MASK_MONSTER_RESTRAINT_2) != 0) this.MonsterRestraint[1] = input.GetS32();
  863. if ((Mask & MASK_MONSTER_RESTRAINT_3) != 0) this.MonsterRestraint[2] = input.GetS32();
  864. if ((Mask & MASK_MONSTER_RESTRAINT_4) != 0) this.MonsterRestraint[3] = input.GetS32();
  865. if ((Mask & MASK_MONSTER_RESTRAINT_5) != 0) this.MonsterRestraint[4] = input.GetS32();
  866. if ((Mask & MASK_MONSTER_ATK) != 0) this.monsterAtk = input.GetS32();
  867. if ((Mask & MASK_MONSTER_DEF) != 0) this.monsterDef = input.GetS32();
  868. if ((Mask & MASK_MONSTER_ATK_PER) != 0) this.monsterAtkPer = input.GetS32();
  869. if ((Mask & MASK_MONSTER_DEF_PER) != 0) this.monsterDefPer = input.GetS32();
  870. }
  871. }
  872. /// <summary>
  873. /// NPC治愈协议.
  874. /// </summary>
  875. [MessageType(0xF00001F)]
  876. public class NPCCureEventB2C : PlayerEvent
  877. {
  878. public override void WriteExternal(IOutputStream output)
  879. {
  880. base.WriteExternal(output);
  881. }
  882. public override void ReadExternal(IInputStream input)
  883. {
  884. base.ReadExternal(input);
  885. }
  886. }
  887. /// <summary>
  888. /// Buff触发技能变更.
  889. /// </summary>
  890. [MessageType(0xF000020)]
  891. public class BuffActiveSkillEventB2C : PlayerEvent
  892. {
  893. public bool IsWorking;
  894. public int BuffID;
  895. public int ActiveSkillID;
  896. public int FreezeSkillID;
  897. public override void WriteExternal(IOutputStream output)
  898. {
  899. base.WriteExternal(output);
  900. output.PutBool(IsWorking);
  901. output.PutS32(BuffID);
  902. output.PutS32(ActiveSkillID);
  903. output.PutS32(FreezeSkillID);
  904. }
  905. public override void ReadExternal(IInputStream input)
  906. {
  907. base.ReadExternal(input);
  908. IsWorking = input.GetBool();
  909. BuffID = input.GetS32();
  910. ActiveSkillID = input.GetS32();
  911. FreezeSkillID = input.GetS32();
  912. }
  913. }
  914. /// <summary>
  915. /// Buff触发技能变更.
  916. /// </summary>
  917. [MessageType(0xF000022)]
  918. public class BattleFloatTipsEventB2C : PlayerEvent
  919. {
  920. public CommonAI.XmdsConstConfig.BattleFloatTipsType Type;
  921. public override void WriteExternal(IOutputStream output)
  922. {
  923. base.WriteExternal(output);
  924. output.PutEnum8<CommonAI.XmdsConstConfig.BattleFloatTipsType>(Type);
  925. }
  926. public override void ReadExternal(IInputStream input)
  927. {
  928. base.ReadExternal(input);
  929. Type = input.GetEnum8<CommonAI.XmdsConstConfig.BattleFloatTipsType>();
  930. }
  931. }
  932. /// <summary>
  933. /// 宠物同步客户端数据.
  934. /// </summary>
  935. [MessageType(0xF000024)]
  936. public class PetVisibleDataB2C : IExternalizable, CommonAI.ZoneClient.IUnitVisibleData
  937. {
  938. /// <summary>
  939. /// 单位基础信息.
  940. /// </summary>
  941. public PetBaseInfo BaseInfo = new PetBaseInfo();
  942. public void WriteExternal(IOutputStream output)
  943. {
  944. output.PutExt(this.BaseInfo);
  945. }
  946. public void ReadExternal(IInputStream input)
  947. {
  948. this.BaseInfo = input.GetExt<PetBaseInfo>();
  949. }
  950. public void setVisibleName(String name) { }
  951. public void setVisibleCardData(ICardData datas) { }
  952. }
  953. /// <summary>
  954. /// 宠物基础信息变更事件.
  955. /// </summary>
  956. [MessageType(0xF000025)]
  957. public class PetBaseInfoChangeEventB2C : ObjectEvent
  958. {
  959. public PetBaseInfo BaseInfo;
  960. override public void WriteExternal(IOutputStream output)
  961. {
  962. base.WriteExternal(output);
  963. output.PutExt(BaseInfo);
  964. }
  965. override public void ReadExternal(IInputStream input)
  966. {
  967. base.ReadExternal(input);
  968. BaseInfo = input.GetExt<PetBaseInfo>();
  969. }
  970. }
  971. /// <summary>
  972. /// 单位遗言变更协议.
  973. /// </summary>
  974. [MessageType(0xF000026)]
  975. public class TestamentChangeEventB2C : ObjectEvent
  976. {
  977. public byte TestamentID;
  978. override public void WriteExternal(IOutputStream output)
  979. {
  980. base.WriteExternal(output);
  981. output.PutU8(TestamentID);
  982. }
  983. override public void ReadExternal(IInputStream input)
  984. {
  985. base.ReadExternal(input);
  986. TestamentID = input.GetU8();
  987. }
  988. }
  989. /// <summary>
  990. /// 气泡框.
  991. /// </summary>
  992. [MessageType(0xF000027)]
  993. public class BubbleTipsEventB2C : ObjectEvent
  994. {
  995. /// <summary>
  996. /// 消息.
  997. /// </summary>
  998. public string Msg;
  999. override public void WriteExternal(IOutputStream output)
  1000. {
  1001. base.WriteExternal(output);
  1002. output.PutUTF(Msg);
  1003. }
  1004. override public void ReadExternal(IInputStream input)
  1005. {
  1006. base.ReadExternal(input);
  1007. Msg = input.GetUTF();
  1008. }
  1009. }
  1010. /// <summary>
  1011. /// 向场景内单个单位发送播放音频通知.
  1012. /// </summary>
  1013. [MessageType(0xF000028)]
  1014. public class PlaySoundEventB2CForOne : PlayerEvent
  1015. {
  1016. /// <summary>
  1017. /// 音频文件名,不带后缀.
  1018. /// </summary>
  1019. public string SoundName = null;
  1020. override public void WriteExternal(IOutputStream output)
  1021. {
  1022. base.WriteExternal(output);
  1023. output.PutUTF(SoundName);
  1024. }
  1025. override public void ReadExternal(IInputStream input)
  1026. {
  1027. base.ReadExternal(input);
  1028. SoundName = input.GetUTF();
  1029. }
  1030. }
  1031. /// <summary>
  1032. /// 向场景内所有单位发送播放音频通知.
  1033. /// </summary>
  1034. [MessageType(0xF000029)]
  1035. public class PlaySoundEventB2CForAll : ZoneEvent
  1036. {
  1037. /// <summary>
  1038. /// 音频文件名,不带后缀.
  1039. /// </summary>
  1040. public string SoundName = null;
  1041. override public void WriteExternal(IOutputStream output)
  1042. {
  1043. output.PutUTF(SoundName);
  1044. }
  1045. override public void ReadExternal(IInputStream input)
  1046. {
  1047. SoundName = input.GetUTF();
  1048. }
  1049. }
  1050. /// <summary>
  1051. /// 怪物归属权更改.
  1052. /// </summary>
  1053. [MessageType(0xF000031)]
  1054. public class MonsterHeirInfoChangeEventB2C : ObjectEvent
  1055. {
  1056. public MonsterVisibleDataB2C.HeirInfo UnitHeirInfo;
  1057. public override void WriteExternal(IOutputStream output)
  1058. {
  1059. base.WriteExternal(output);
  1060. output.PutExt(UnitHeirInfo);
  1061. }
  1062. public override void ReadExternal(IInputStream input)
  1063. {
  1064. base.ReadExternal(input);
  1065. UnitHeirInfo = input.GetExt<MonsterVisibleDataB2C.HeirInfo>();
  1066. }
  1067. }
  1068. /// <summary>
  1069. /// 发送可否放置法器通知
  1070. /// </summary>
  1071. [MessageType(0xF000032)]
  1072. public class PlayerPutRefineSoulItemB2c : PlayerEvent
  1073. {
  1074. public bool CanPut = true;
  1075. public string QuestID = null;
  1076. override public void WriteExternal(IOutputStream output)
  1077. {
  1078. base.WriteExternal(output);
  1079. output.PutBool(CanPut);
  1080. output.PutUTF(QuestID);
  1081. }
  1082. override public void ReadExternal(IInputStream input)
  1083. {
  1084. base.ReadExternal(input);
  1085. CanPut = input.GetBool();
  1086. QuestID = input.GetUTF();
  1087. }
  1088. }
  1089. /// <summary>
  1090. /// 单位动态播放特效(非编辑器中的静态数据)
  1091. /// </summary>
  1092. [MessageType(0xF000033)]
  1093. public class DynamicUnitEffectB2C : ObjectEvent
  1094. {
  1095. public string Name;
  1096. public bool BindBody;
  1097. public string BindPartName;
  1098. public float ScaleToBodySize;
  1099. public string SoundName;
  1100. public int EarthQuakeMS;
  1101. public float EarthQuakeXYZ;
  1102. public string CameraAnimation;
  1103. public int EffectTimeMS = 0;
  1104. public override void WriteExternal(IOutputStream output)
  1105. {
  1106. base.WriteExternal(output);
  1107. output.PutUTF(this.Name);
  1108. output.PutBool(this.BindBody);
  1109. output.PutUTF(this.BindPartName);
  1110. output.PutF32(this.ScaleToBodySize);
  1111. output.PutUTF(this.SoundName);
  1112. output.PutS32(this.EarthQuakeMS);
  1113. output.PutF32(this.EarthQuakeXYZ);
  1114. output.PutUTF(this.CameraAnimation);
  1115. output.PutS32(this.EffectTimeMS);
  1116. }
  1117. public override void ReadExternal(IInputStream input)
  1118. {
  1119. base.ReadExternal(input);
  1120. this.Name = input.GetUTF();
  1121. this.BindBody = input.GetBool();
  1122. this.BindPartName = input.GetUTF();
  1123. this.ScaleToBodySize = input.GetF32();
  1124. this.SoundName = input.GetUTF();
  1125. this.EarthQuakeMS = input.GetS32();
  1126. this.EarthQuakeXYZ = input.GetF32();
  1127. this.CameraAnimation = input.GetUTF();
  1128. this.EffectTimeMS = input.GetS32();
  1129. }
  1130. }
  1131. [MessageType(0xF000034)]
  1132. public class ChangeQuestSeekB2C : ObjectEvent
  1133. {
  1134. public string QuestID;
  1135. // x,y or null or funid
  1136. public string SeekInfo;
  1137. public override void WriteExternal(IOutputStream output)
  1138. {
  1139. base.WriteExternal(output);
  1140. output.PutUTF(this.QuestID);
  1141. output.PutUTF(this.SeekInfo);
  1142. }
  1143. public override void ReadExternal(IInputStream input)
  1144. {
  1145. base.ReadExternal(input);
  1146. this.QuestID = input.GetUTF();
  1147. this.SeekInfo = input.GetUTF();
  1148. }
  1149. }
  1150. /// <summary>
  1151. /// 单位遭受攻击提示.
  1152. /// </summary>
  1153. [MessageType(0xF000035)]
  1154. public class UnderAttackNotifyB2C : PlayerEvent
  1155. {
  1156. /// <summary>
  1157. /// 攻击者实例ID.
  1158. /// </summary>
  1159. public uint AttackerID = 0;
  1160. /// <summary>
  1161. /// 攻击者基础信息.
  1162. /// </summary>
  1163. public XmdsUnitBaseInfo AttackerInfo = null;
  1164. public override void WriteExternal(IOutputStream output)
  1165. {
  1166. base.WriteExternal(output);
  1167. output.PutU32(AttackerID);
  1168. output.PutExt(AttackerInfo);
  1169. }
  1170. public override void ReadExternal(IInputStream input)
  1171. {
  1172. base.ReadExternal(input);
  1173. AttackerID = input.GetU32();
  1174. AttackerInfo = input.GetExt<XmdsUnitBaseInfo>();
  1175. }
  1176. }
  1177. /// <summary>
  1178. /// 单位遭受伤害信息.
  1179. /// </summary>
  1180. [MessageType(0xF000036)]
  1181. public class MonsterSufferDamageInfoB2C : PlayerEvent
  1182. {
  1183. /// <summary>
  1184. /// 伤害集合.
  1185. /// </summary>
  1186. public List<PlayerDamageInfo> InfoList = null;
  1187. /// <summary>
  1188. /// 排名.
  1189. /// </summary>
  1190. public int PlayerRank = 0;
  1191. /// <summary>
  1192. /// 玩家伤害.
  1193. /// </summary>
  1194. public int PlayerDamage = 0;
  1195. public override void WriteExternal(IOutputStream output)
  1196. {
  1197. base.WriteExternal(output);
  1198. output.PutExtList(InfoList);
  1199. output.PutS32(PlayerRank);
  1200. output.PutS32(PlayerDamage);
  1201. }
  1202. public override void ReadExternal(IInputStream input)
  1203. {
  1204. base.ReadExternal(input);
  1205. InfoList = input.GetExtList<PlayerDamageInfo>();
  1206. PlayerRank = input.GetS32();
  1207. PlayerDamage = input.GetS32();
  1208. }
  1209. }
  1210. /// <summary>
  1211. /// 跟随状态变换
  1212. /// </summary>
  1213. [MessageType(0xF000037)]
  1214. public class SetAutoFollowB2C : PlayerEvent
  1215. {
  1216. /// <summary>
  1217. /// 是否跟随状态
  1218. /// </summary>
  1219. public int stateFollow;
  1220. public override void ReadExternal(IInputStream input)
  1221. {
  1222. base.ReadExternal(input);
  1223. stateFollow = input.GetS32();
  1224. }
  1225. public override void WriteExternal(IOutputStream output)
  1226. {
  1227. base.WriteExternal(output);
  1228. output.PutS32(stateFollow);
  1229. }
  1230. }
  1231. /// <summary>
  1232. /// 自动战斗状态变换
  1233. /// </summary>
  1234. [MessageType(0xF000038)]
  1235. public class SetAutoBattleB2C : PlayerEvent
  1236. {
  1237. /// <summary>
  1238. /// 是否自动战斗状态
  1239. /// </summary>
  1240. public int isAutoBattle;
  1241. public override void ReadExternal(IInputStream input)
  1242. {
  1243. base.ReadExternal(input);
  1244. isAutoBattle = input.GetS32();
  1245. }
  1246. public override void WriteExternal(IOutputStream output)
  1247. {
  1248. base.WriteExternal(output);
  1249. output.PutS32(isAutoBattle);
  1250. }
  1251. }
  1252. /// <summary>
  1253. /// 掉落物品飞
  1254. /// </summary>
  1255. [MessageType(0xF000039)]
  1256. public class RemoveDropItemB2C : PlayerEvent
  1257. {
  1258. public uint objectId;
  1259. public uint actor_id;
  1260. public RemoveDropItemB2C() { }
  1261. public RemoveDropItemB2C(uint object_id, uint actor_id)
  1262. {
  1263. this.objectId = object_id;
  1264. this.actor_id = actor_id;
  1265. }
  1266. public override void ReadExternal(IInputStream input)
  1267. {
  1268. base.ReadExternal(input);
  1269. objectId = input.GetU32();
  1270. actor_id = input.GetU32();
  1271. }
  1272. public override void WriteExternal(IOutputStream output)
  1273. {
  1274. base.WriteExternal(output);
  1275. output.PutU32(objectId);
  1276. output.PutU32(actor_id);
  1277. }
  1278. }
  1279. }