/// <summary> /// 这个函数目前没有作用, /// 准备将来用于Buff第一次释放时,需要调用的函数 /// </summary> public void FirstCast(RtBufData rtbf) { /// /// --- 设置NPC的状态 --- /// ServerNPC hang = BFSelector.getHangUp(rtbf); ServerLifeNpc life = hang as ServerLifeNpc; if (life != null) { NpcStatus status = (NpcStatus)Enum.ToObject(typeof(NpcStatus), rtbf.BuffCfg.Status); //去除不需要挂载的状态 status = status.rmDiscrete(); if (status != NpcStatus.None) { life.curStatus = life.curStatus.set(status); } //如果有嘲讽的话 if (status.AnySame(NpcStatus.Taunt)) { life.addHatred(rtbf.CastorNpcID, 1); } } /// /// ---- 释放技能 --- /// castBuff_Skill(rtbf, BuffPhase.Start); }
public virtual void OnNpcStatus() { if (cachedNpc != null) { NpcStatus status = cachedNpc.curStatus; if (status != statusInLastFrame) { NpcStatusInfo info = new NpcStatusInfo(); if (status.AnySame(NpcStatus.Slient) && !statusInLastFrame.AnySame(NpcStatus.Slient)) { info.addItem(NpcStatus.Slient, true); } else if (!status.AnySame(NpcStatus.Slient) && statusInLastFrame.AnySame(NpcStatus.Slient)) { info.addItem(NpcStatus.Slient, false); } if (status.AnySame(NpcStatus.Unconscious) && !statusInLastFrame.AnySame(NpcStatus.Unconscious)) { info.addItem(NpcStatus.Unconscious, true); On_Suffer(true); } else if (!status.AnySame(NpcStatus.Unconscious) && statusInLastFrame.AnySame(NpcStatus.Unconscious)) { info.addItem(NpcStatus.Unconscious, false); On_Suffer(false); } if (status.AnySame(NpcStatus.Taunt) && !statusInLastFrame.AnySame(NpcStatus.Taunt)) { info.addItem(NpcStatus.Taunt, true); } else if (!status.AnySame(NpcStatus.Taunt) && statusInLastFrame.AnySame(NpcStatus.Taunt)) { info.addItem(NpcStatus.Taunt, false); } animMsg.nextAnim = WarMsg_Type.OnStatus.ToString(); animMsg.uniqueId = cachedNpc.UniqueID; animMsg.data = JSON.Instance.ToJSON(info); if (serMgr != null) { serMgr.realServer.proxyCli.NPCAnim(animMsg); } } statusInLastFrame = status; } }