XmdsVirtual_NPC.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using CommonAI.Zone.Formula;
  2. using CommonAI.Zone.Instance;
  3. using XmdsCommon.Message;
  4. using XmdsCommonServer.Plugin.Units;
  5. using XmdsCommonServer.XLS.Data;
  6. namespace XmdsCommonServer.Plugin
  7. {
  8. public class XmdsVirtual_NPC : XmdsVirtual_Monster
  9. {
  10. public XmdsVirtual_NPC(InstanceUnit unit) : base(unit)
  11. {
  12. mHateSystem.SetFindHeirs(true);
  13. }
  14. public override string GetPlayerUUID()
  15. {
  16. return mUnit.ID.ToString();
  17. }
  18. protected override void Init(bool pointLv)
  19. {
  20. //if (this.mProp.LoadDataConfig == true)
  21. //{
  22. // InitMonsterData(GetCurSceneType(), mUnit.Info.TemplateID, mUnit.Level, this.mUnit.RandomN);
  23. // InitMonsterData2(GetCurSceneType(), mUnit.Info.TemplateID);
  24. // log.Error("NPC properties loadDataConfig异常设置成false:" + this.mUnit.Info.ID + ", " + this.mUnit.Info.Name);
  25. //}
  26. //else
  27. {
  28. MonsterVisibleDataB2C edata = new MonsterVisibleDataB2C();
  29. NPCData npcd = XmdsDataMgr.GetInstance().GetNPCData(mUnit.Info.ID, mUnit.Level);
  30. string name = mUnit.Name;
  31. if (npcd != null)
  32. {
  33. name = npcd.Name;
  34. edata.Title = npcd.Title;
  35. edata.MonsterID = npcd.NpcID;
  36. edata.SenceType = "NpcList";
  37. mUnit.Level = npcd.Level;
  38. }
  39. else
  40. {
  41. edata.MonsterID = mUnit.Info.ID;
  42. }
  43. edata.DisplayName = name;
  44. edata.AttackType = MonsterVisibleDataB2C.MonsterAttackType.Passive;
  45. edata.Atype = MonsterVisibleDataB2C.MonsterAtype.Monster;
  46. edata.MType = MonsterVisibleDataB2C.MonsterType.MType0;
  47. edata.Qcolor = MonsterVisibleDataB2C.MonsterQcolor.Q0;
  48. mUnit.SetVisibleInfo(edata);
  49. }
  50. }
  51. }
  52. }