123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- using CommonAI.Zone.Instance;
- using CommonAI.Zone.Formula;
- using XmdsCommon.Message;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Message;
- using XmdsCommon.EditorData;
- using XmdsCommonServer.Plugin.Units;
- using CommonAI.Zone;
- namespace XmdsCommonServer.Plugin
- {
-
-
-
-
-
-
-
- partial class XmdsVirtual
- {
- #region PickUnit复活.
- protected void mUnit_OnPickUnit(InstanceUnit obj, InstanceUnit pickable, int time)
- {
-
- if (pickable is InstancePlayer && pickable.Force == mUnit.Force && pickable.IsDead())
- {
- XmdsUnitProperties prop = (XmdsUnitProperties)(pickable.Info.Properties);
- XmdsVirtual zv = (XmdsVirtual)obj.Virtual;
-
- CommonAI.Zone.Instance.InstanceUnit.StatePickObject spo = mUnit.startPickProgressObject(pickable, time, (s, p) =>
- {
-
- if (pickable.IsDead() == true)
- {
- SendSaveMessage(obj, pickable);
- }
- });
- if (spo != null)
- {
- spo.SetCheckTargetAcvite(OnCheckPickable);
- }
- }
- }
- private bool OnCheckPickable(InstanceUnit unit, InstanceZoneObject pickable, ref string reason)
- {
- bool ret = false;
- if (pickable is InstanceUnit)
- {
- InstanceUnit iu = (InstanceUnit)pickable;
- if (iu.IsDead() == false)
- {
- ret = true;
- }
- }
- return ret;
- }
- private void SendSaveMessage(InstanceUnit obj, InstanceUnit pickable)
- {
- }
-
-
-
-
- public void SendSaveMessage(ShowRebirthDialogueB2R evt)
- {
- if (evt != null)
- {
- this.mUnit.queueEvent(evt);
- }
- }
- #endregion
- #region 上下坐骑.
-
-
-
-
-
-
- public void StartSummonMount(int timeMS, bool isSummonMount, string status)
- {
- if (isSummonMount == false)
- {
- TakeOffMount();
- }
- else
- {
-
- if (timeMS == 0)
- {
- SyncMountStatus(isSummonMount);
- }
- else
- {
- this.mUnit.startPickProgressSelf(timeMS, (s, p) =>
- {
- SyncMountStatus(isSummonMount);
- }, status);
- }
- }
- }
-
-
-
-
- private void SendSummonMountNotify(bool isSummonMount)
- {
- if (this.mUnit is InstancePlayer)
- {
- SummonMountEventB2R evt = new SummonMountEventB2R();
- evt.playerId = (this.mUnit as InstancePlayer).PlayerUUID;
- evt.IsSummonMount = isSummonMount;
- this.mUnit.queueEvent(evt);
- var teamVirtual = (this.mUnit as XmdsInstancePlayer).TeamVirtual;
-
- if (teamVirtual != null && isSummonMount && teamVirtual.TeamLeader == this.mUnit)
- {
- teamVirtual.notifyTeamerRide();
- }
- }
- }
-
-
-
-
- private void SyncMountStatus(bool isSummonMount)
- {
- IsMounted = isSummonMount;
-
- SendSummonMountNotify(isSummonMount);
- }
-
-
-
-
-
- private void MountOnHitCheck(XmdsVirtual attacker)
- {
- if (!IsMounted) { return; }
-
-
-
-
-
-
-
-
-
-
-
- {
- SendMsgToClient(CommonAI.XmdsConstConfig.TIPS_UNDER_ATTACK);
- this.TakeOffMount();
- }
- }
-
-
-
- private void MountOnLaunchSkillCheck()
- {
- if (!IsMounted) { return; }
- this.TakeOffMount();
- }
-
-
-
-
- private void MountOnBuffBegin(BuffTemplate buff)
- {
- if (!IsMounted) { return; }
-
- if (XmdsInstanceUtils.IsControlBuff(buff))
- {
- this.TakeOffMount();
- }
- }
-
-
-
-
- private void MountOnHit(AttackSource source)
- {
- if (!IsMounted) { return; }
- if (source.OutIsDamage == true)
- {
- this.TakeOffMount();
- }
- }
- #endregion
- }
- }
|