コード例 #1
0
 public static void SendAuraUpdate(Unit owner, Aura aura)
 {
     if (owner is NPC)
     {
         Asda2CombatHandler.SendNpcBuffedResponse((NPC)owner, aura);
     }
     else
     {
         if (!(owner is Character))
         {
             return;
         }
         Character character = (Character)owner;
         if (!character.CanMove)
         {
             Asda2MovmentHandler.SendEndMoveByFastInstantRegularMoveResponse(character);
         }
         Asda2SpellHandler.SendCharacterBuffedResponse(character, aura);
         if (character.IsInGroup)
         {
             Asda2GroupHandler.SendPartyMemberBuffInfoResponse(character);
         }
         if (character.SoulmateCharacter == null)
         {
             return;
         }
         Asda2SoulmateHandler.SendSoulmateBuffUpdateInfoResponse(character);
     }
 }
コード例 #2
0
ファイル: AuraHandler.cs プロジェクト: 0xFh/Asda2-Project
        public static void SendAuraUpdate(Unit owner, Aura aura)
        {
            if (owner is NPC)
            {
                Asda2CombatHandler.SendNpcBuffedResponse((NPC)owner, aura);
            }
            else if (owner is Character)
            {
                var chr = (Character)owner;
                if (!chr.CanMove)
                {
                    Asda2MovmentHandler.SendEndMoveByFastInstantRegularMoveResponse(chr);
                }
                Asda2SpellHandler.SendCharacterBuffedResponse(chr, aura);
                if (chr.IsInGroup)
                {
                    Asda2GroupHandler.SendPartyMemberBuffInfoResponse(chr);
                }
                if (chr.SoulmateCharacter != null)
                {
                    Asda2SoulmateHandler.SendSoulmateBuffUpdateInfoResponse(chr);
                }
            }

            /*if (!owner.IsAreaActive) return;
             *  using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_AURA_UPDATE))
             *  {
             *          owner.EntityId.WritePacked(packet);
             *
             *          WriteAura(aura, packet);
             *
             *          owner.SendPacketToArea(packet);
             *  }*/
        }
コード例 #3
0
ファイル: Asda2WarPoint.cs プロジェクト: uvbs/Asda2-Server
 public void TryCapture(Character activeCharacter)
 {
     lock (this)
     {
         if (this.CapturingCharacter != null)
         {
             activeCharacter.SendWarMsg(string.Format("Point {0} already capturing by {1}.",
                                                      (object)((int)this.Id + 1), (object)this.CapturingCharacter.Name));
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, this.Id,
                                                                        OcupationPointStartedStatus.Fail);
         }
         else if ((double)activeCharacter.Asda2Position.GetDistance(new Vector3((float)this.X,
                                                                                (float)this.Y)) > 7.0)
         {
             activeCharacter.SendWarMsg(string.Format("Distance to {0} is too big.",
                                                      (object)((int)this.Id + 1)));
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, this.Id,
                                                                        OcupationPointStartedStatus.Fail);
         }
         else if (this.Status != Asda2WarPointStatus.NotOwned &&
                  (int)this.OwnedFaction == (int)activeCharacter.Asda2FactionId)
         {
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, this.Id,
                                                                        OcupationPointStartedStatus.YouAreOcupaingTheSameSide);
         }
         else
         {
             this.CapturingCharacter = activeCharacter;
             activeCharacter.CurrentCapturingPoint = this;
             this.CapturingCharacter.IsMoving      = false;
             this.CapturingCharacter.IsFighting    = false;
             Asda2MovmentHandler.SendEndMoveByFastInstantRegularMoveResponse(this.CapturingCharacter);
             this._isCapturing          = false;
             this._timeToStartCapturing = CharacterFormulas.DefaultTimeToStartCapture;
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, this.Id,
                                                                        OcupationPointStartedStatus.Ok);
         }
     }
 }
コード例 #4
0
 //todo disable on move\take dmg\stun
 public void TryCapture(Character activeCharacter)
 {
     lock (this)
     {
         if (CapturingCharacter != null)
         {
             activeCharacter.SendWarMsg(string.Format("Point {0} already capturing by {1}.", Id + 1,
                                                      CapturingCharacter.Name));
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, Id,
                                                                        OcupationPointStartedStatus.Fail);
             return;
         }
         if (activeCharacter.Asda2Position.GetDistance(new Vector3(X, Y)) > 7)
         {
             activeCharacter.SendWarMsg(string.Format("Distance to {0} is too big.", Id + 1));
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, Id,
                                                                        OcupationPointStartedStatus.Fail);
             return;
         }
         if (Status != Asda2WarPointStatus.NotOwned && OwnedFaction == activeCharacter.Asda2FactionId)
         {
             Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, Id,
                                                                        OcupationPointStartedStatus.YouAreOcupaingTheSameSide);
             return;
         }
         CapturingCharacter = activeCharacter;
         activeCharacter.CurrentCapturingPoint = this;
         CapturingCharacter.IsMoving           = false;
         CapturingCharacter.IsFighting         = false;
         Asda2MovmentHandler.SendEndMoveByFastInstantRegularMoveResponse(CapturingCharacter);
         _isCapturing          = false;
         _timeToStartCapturing = CharacterFormulas.DefaultTimeToStartCapture;
         Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(activeCharacter.Client, Id,
                                                                    OcupationPointStartedStatus.Ok);
     }
 }