private void SendStart() { PacketOut Out; Player plr = _caster as Player; if (plr != null) { //For abilities with a cast time, we send the timer first to ensure the client knows it's modified if (AbInfo.ConstantInfo.Origin != AbilityOrigin.AO_ITEM && AbInfo.CastTime > 0) { Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER, 12); Out.WriteUInt16(1); Out.WriteByte(1); Out.WriteByte(0x1); // initial timer Out.WriteUInt16(0); Out.WriteUInt16(AbInfo.CastTime); Out.WriteUInt16(AbInfo.Entry); Out.WriteByte(_castSequence); Out.WriteByte(0); plr.SendPacket(Out); } } Out = new PacketOut((byte)Opcodes.F_USE_ABILITY, 20); Out.WriteUInt16(0); Out.WriteUInt16(AbInfo.Entry); Out.WriteUInt16(_caster.Oid); Out.WriteUInt16(AbInfo.ConstantInfo.EffectID); if (AbInfo.Target != null) { Out.WriteUInt16(AbInfo.Target.Oid); } else if (AbInfo.Range == 0) { Out.WriteUInt16(_caster.Oid); } else { Out.WriteUInt16(0); } Out.WriteByte(1); Out.WriteByte((byte)AbInfo.ConstantInfo.Origin); Out.WriteUInt32(AbInfo.ConstantInfo.ChannelID == 0 ? AbInfo.CastTime : (uint)0); Out.WriteByte(_castSequence); Out.WriteUInt16(0); Out.WriteByte(0); _caster.DispatchPacket(Out, true); }
public void SendMount(Player Plr) { PacketOut Out = new PacketOut((byte)Opcodes.F_MOUNT_UPDATE); Out.WriteUInt16(Owner.Oid); if (CurrentMountInfo == null) { Out.WriteUInt32(0); } else { Out.WriteUInt32(CurrentMountInfo.Entry); } Out.Fill(0, 14); if (Plr == null) { Owner.DispatchPacket(Out, true); } else { Plr.SendPacket(Out); } }
private void SendChannelStart() { PacketOut Out = new PacketOut((byte)Opcodes.F_USE_ABILITY, 20); Out.WriteUInt16(0); Out.WriteUInt16(_baseEntry); Out.WriteUInt16(_host.Oid); Out.WriteUInt16(_channelInfo.ConstantInfo.EffectID); if (_target != null && !(_target is GroundTarget)) { Out.WriteUInt16(_target.Oid); } else if (_channelInfo.Range == 0) { Out.WriteUInt16(_host.Oid); } else { Out.WriteUInt16(0); } Out.WriteByte(3); // channel Out.WriteByte(1); Out.WriteUInt32(_channelInfo.CastTime); Out.WriteByte(_castSequence); Out.WriteUInt16(0); Out.WriteByte(0); _host.DispatchPacket(Out, true); Out = new PacketOut((byte)Opcodes.F_CAST_PLAYER_EFFECT, 200); Out.WriteUInt16(_host.Oid); Out.WriteUInt16(_host.Oid); Out.WriteUInt16(_baseEntry); Out.WriteByte((byte)_channelInfo.ConstantInfo.EffectID); Out.WriteByte((byte)0); //parried, crit, dodged, etc Out.WriteByte((byte)1); Out.WriteByte((byte)0); _host.DispatchPacket(Out, true); }
public void UpdateMovementState(Player player) { if (_unit.Zone == null) { Log.Error("UpdateMovementState", $"{_unit.Name} with no Zone - pendingDisposal:{_unit.PendingDisposal} isDisposed:{_unit.IsDisposed}"); return; } PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_STATE, 28); WriteMovementState(Out); if (player == null) { _unit.DispatchPacket(Out, false); } else { player.SendPacket(Out); } }