///daat99 [claim v0.4 ///Basically a player type [claim and click on a corpse that he have looting rights on (he or his pet\summon killed). ///It make sounds when you get gold and when you click at the wrong thing. ///Players can claim human corpses but not player corpses ;) using System; using System.Collections; using Server.Items; using Server.Targeting; using Server.Mobiles; using Server.Misc; using Server.Factions; namespace Server.Scripts.Commands { public class ClaimCmd { public static void Initialize() { Server.Commands.Register( "Claim", AccessLevel.Player, new CommandEventHandler( Claim_OnCommand ) ); } [Usage( "Claim" )] [Description( "Claim a corpse for Gold!" )] public static void Claim_OnCommand( CommandEventArgs e ) { e.Mobile.Target = new ClaimCmdTarget(); e.Mobile.SendMessage( "Which corpse do you want to claim as your kill?" ); } public static void Reclaim( Mobile from ) { from.Target = new ClaimCmdTarget(); from.SendMessage( "Do you want to claim more corpses as your kills?" ); } private class ClaimCmdTarget : Target { public ClaimCmdTarget() : base( 15, false, TargetFlags.None ) { } protected override void OnTarget( Mobile from, object target ) { if (from.Alive == false) { from.PlaySound(1069); //hey from.SendMessage( "Hey, don't try to trick me, EVER!!!" ); } else if ( target is Corpse ) { Corpse c = (Corpse)target; if (c.Owner != null) { int amount = 0; if (c.Owner.Fame < 0) amount = (amount - c.Owner.Fame); else amount = (amount + c.Owner.Fame); if (c.Owner.Karma < 0) amount = (amount - c.Owner.Karma); else amount = (amount + c.Owner.Karma); amount = (amount/100); if (amount < 10) amount = 10; if ( c.Owner is PlayerMobile ) { switch ( Utility.Random( 2 )) { case 0: { from.PlaySound(1088); //scream from.SendMessage( "You were spooked away by this players soul and decided not to claim his corpse." ); break; } case 1: { from.PlaySound(1086); //oops from.SendMessage( "Oops, I didn't mean to claim you, really..." ); break; } } } else if (amount == 10) { from.SendMessage( "Here, have your pitty reward...." ); from.PlaySound(0x2E6); // drop gold sound from.AddToBackpack ( new Gold(10) ); ((Corpse)c).Delete(); Reclaim(from); } else if ( NotorietyHandlers.CorpseNotoriety( from, c ) != Notoriety.Innocent ) { from.SendMessage( "Great job, have this reward for killing this evil creature." ); from.PlaySound(0x2E6); // drop gold sound from.AddToBackpack ( new Gold(amount) ); ((Corpse)c).Delete(); Reclaim(from); } else { switch ( Utility.Random( 2 )) { case 0: { from.PlaySound(1074); //no from.SendMessage( "You did not kill this creature!!!" ); break; } case 1: { from.PlaySound(1069); //hey from.SendMessage( "Hey, don't try to trick me, EVER!!!" ); break; } } } } } else { switch ( Utility.Random( 2 )) { case 0: { from.PlaySound(1073); //lought from.SendMessage( "ROFL, Yeah I bet you believed that I'll give you something for this..." ); break; } case 1: { from.PlaySound(1066); //giggle from.SendMessage( "He he he, that isn't a corpse..." ); break; } } } } } } }