public void OnCrime(ShPlayer player, byte crimeIndex, ShPlayer victim) { if (player.svPlayer.godMode || player.svPlayer.InvalidCrime(crimeIndex)) { return; } Crime crime = player.manager.GetCrime(crimeIndex); ShPlayer witness; if (!crime.witness) { witness = victim; } else if (!player.svPlayer.GetWitness(victim, out witness)) { return; } player.AddCrime(crime.index, witness); player.svPlayer.Send(SvSendType.Self, Channel.Reliable, ClPacket.AddCrime, crime.index, witness ? witness.ID : 0); // Don't hand out crime penalties for criminal jobs and default job if (!player.svPlayer.job.IsCriminal && player.svPlayer.job.info.shared.jobIndex > 0) { player.svPlayer.Reward(-crime.experiencePenalty, -crime.fine); } }
public void OnCrime(ShPlayer player, byte crimeIndex, ShPlayer victim) { if (player.svPlayer.InvalidCrime(crimeIndex)) { return; } Crime crime = player.manager.GetCrime(crimeIndex); ShPlayer witness = null; if (crime.witness && !player.svPlayer.GetWitness(victim, out witness)) { return; } player.AddCrime(crime.index, witness); player.svPlayer.Send(SvSendType.Self, Channel.Reliable, ClPacket.AddCrime, crime.index, witness ? witness.ID : 0); if (!player.svPlayer.job.IsCriminal) { player.svPlayer.Reward(-crime.experiencePenalty, -crime.fine); } }