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); } }
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); * }*/ }
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); } } }
//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); } }