public static void SendPetEnterBattleField(long petID, Pos pos, Vector2 vector, float existTime)
    {
        BattleAction_PetEnterField battleAction_PetEnterField = new BattleAction_PetEnterField();

        battleAction_PetEnterField.petId    = petID;
        battleAction_PetEnterField.pos      = pos;
        battleAction_PetEnterField.vector   = vector;
        battleAction_PetEnterField.exitTime = (int)existTime;
        EventDispatcher.Broadcast <BattleAction_PetEnterField, bool>(BattleActionEvent.PetEnterBattleField, battleAction_PetEnterField, false);
    }
Beispiel #2
0
 public override void PetEnterBattleField(BattleAction_PetEnterField data, bool isServerData)
 {
     if (data.petId != this.owner.ID)
     {
         return;
     }
     if (this.owner.IsDead)
     {
         return;
     }
     this.owner.GetSkillManager().SetDebutCD();
     (this.owner as EntityPet).ExistTime = (float)data.exitTime;
     if (this.owner.Owner != null && this.owner.Owner.IsEntitySelfType)
     {
         BattleBlackboard.Instance.SetPetCountDown(this.owner.OwnerListIdx, new KeyValuePair <float, DateTime>((float)(data.exitTime * 1000), DateTime.get_Now()));
     }
     this.owner.IsFighting = true;
     this.owner.IsFuse     = false;
     if (InstanceManager.CurrentCommunicationType == CommunicationType.Mixed && this.owner.Owner != null && this.owner.Owner.Actor)
     {
         this.owner.Pos = LocalInstanceHandler.Instance.GetPetRandomPos(this.owner.TypeID, this.owner.Owner.Actor.FixTransform.get_position(), this.owner.Owner.Actor.FixTransform.get_rotation());
         this.owner.Dir = LocalInstanceHandler.Instance.GetPetDir(this.owner.Owner.Actor.FixTransform.get_rotation());
     }
     else
     {
         this.owner.Pos = PosDirUtility.ToTerrainPoint(data.pos, (!this.owner.Actor) ? this.owner.CurFloorStandardHeight : this.owner.Actor.FixTransform.get_position().y);
         this.owner.Dir = new Vector3(data.vector.x, 0f, data.vector.y);
     }
     if (this.owner.Actor)
     {
         this.owner.Actor.EndAnimationResetToIdle();
         this.owner.Actor.ChangeAction("hide", true, false, 1f, 0, 0, string.Empty);
     }
     if (this.owner.IsClientDominate)
     {
         EnterBattleFieldAnnouncer.Announce(this.owner);
     }
     if (InstanceManager.IsLocalBattle && this.owner.Actor)
     {
         int skillIDByIndex = this.owner.GetSkillIDByIndex(PetSkillManager.DebutSkillIndex);
         this.owner.GetSkillManager().SetTargetBySkillID(skillIDByIndex, TargetRangeType.SkillRange, 0f);
         this.owner.GetSkillManager().ClientCastSkillByID(skillIDByIndex);
     }
 }
 public virtual void PetEnterBattleField(BattleAction_PetEnterField data, bool isServerData)
 {
 }