private static bool OnProfanityDetected( Mobile from, string speech ) { switch ( Action ) { case ProfanityAction.None: return true; case ProfanityAction.Disallow: return false; case ProfanityAction.Criminal: from.Criminal = true; return true; case ProfanityAction.CriminalAction: from.CriminalAction( false ); return true; case ProfanityAction.Disconnect: { GameClient ns = from.Client; if ( ns != null ) ns.Dispose(); return false; } default: case ProfanityAction.Other: // TODO: Provide custom implementation if this is chosen { return true; } } }
public void Carve( Mobile from, Item item ) { Mobile dead = m_Owner; if ( m_Carved || dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( String.Format( "the head of {0}", dead.Name ) ).MoveToWorld( Location, Map ); m_Carved = true; ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }
public void Carve( Mobile from, Item item ) { Mobile dead = m_Owner; PlayerMobile fr = from as PlayerMobile; PlayerMobile ow = this.Owner as PlayerMobile; if( this.Owner != null && this.Owner is PlayerMobile && fr.IsHardcore == false) //Killer is not HC { from.SendMessage( "You are not capable of inflicting a wound on that target, as you do not possess the Hardcore merit." ); } if( this.Owner != null && this.Owner is PlayerMobile && ow.IsHardcore == false && fr.IsHardcore == true)//Killer is HC, target is not { if (ow.HCWound + TimeSpan.FromHours(24) < DateTime.Now) //Must Pass 24 Hour Rule { from.SendMessage( 32, "You inflict a finishing wound upon " + dead.Name + "!" ); UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1)); from.Emote( "*{0} wounds {1}*", from.Name , dead.Name ); dead.SendMessage( 32, "You have been dealt a finishing wound by {0}!", from.Name ); ow.HCWound = DateTime.Now; if (HealthAttachment.HasHealthAttachment(dead)) { HealthAttachment.GetHA(dead).NormalWound(from); } new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); } else from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." ); } else if( this.Owner != null && this.Owner is PlayerMobile && ow.IsHardcore == true && fr.IsHardcore == true)//Killer and target are HC { if (ow.HCWound + TimeSpan.FromHours(24) < DateTime.Now) //Must Pass 24 Hour Rule { if (ow.Maimings >= 1) //Do our check for Maimings first, to see if they need a chance at PDing { int r = Utility.Random(1,10); if (ow.Maimings > r) //Escalating chance of PD based on the more injuries. { from.SendMessage( 32, "Rolled {0}",r); from.SendMessage( 32, "You have permanently ended the life of " + dead.Name + " by inflicting a fatal wound upon them!" ); ow.m_DeathTimer.Stop(); ow.CloseGump( typeof( DeathGump ) ); Map deathmap = Map.Felucca; Point3D permdeath = new Point3D( 5689,1768,0 ); dead.MoveToWorld( permdeath, deathmap ); from.Emote( "*{0} fatally wounds {1}*",from.Name ,dead.Name ); PlayerMobile PM = m_Owner as PlayerMobile; string stringdeath = "A person has been slain by the hands of another; the lands of Khaeros whisper of their passing."; UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1)); World.Broadcast( 0x35, true, "{0}", stringdeath ); dead.SendMessage( 32, "You have been fatally wounded, and your character is now permanently dead!" ); dead.CantWalk = false; dead.Squelched = false; ow.Lives = -1000; ow.Maimings = 666; // Set Maimings to 666, so it doesn't re-maim them if they've PDed dead.Kill(); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( dead.Name ).MoveToWorld( Location, Map ); m_Carved = true; ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); } } if (ow.Maimings < 666) //Do our check to make sure the dude aint dead already! { //If maim count is below 2, or if the lucky dog passed his chance to DIE... from.SendMessage( 32, "You inflict a grievous finishing wound upon " + dead.Name + "!" ); from.Emote( "*{0} inflicts a grievous wound upon {1}*",from.Name ,dead.Name ); UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1)); dead.SendMessage( 32, "You have been dealt a grievous finishing wound! Your wound count has increased by 1!" ); if (HealthAttachment.HasHealthAttachment(dead)) { HealthAttachment.GetHA(dead).HCWound(from); } ow.Maimings += 1; ow.HCWound = DateTime.Now; new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); //Blow through our checks to see if we should lower stats! if (ow.RawHits > 25 && ow.Maimings + 1 > Utility.Random(10)) { ow.RawHits -= Utility.RandomList(5,10); dead.SendMessage( 32, "You have lost some hit points permenantly due to the wound you've sustained!" ); } if (ow.RawStam > 25 && ow.Maimings + 1 > Utility.Random(10)) { ow.RawStam -= Utility.RandomList(5,10); dead.SendMessage( 32, "You have lost some stamina points permenantly due to the wound you've sustained!" ); } if (ow.RawMana > 25 && ow.Maimings + 1 > Utility.Random(10)) { ow.RawMana -= Utility.RandomList(5,10); dead.SendMessage( 32, "You have lost some mana points permenantly due to the wound you've sustained!" ); } } } else from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." ); } else if( this.Owner != null && this.Owner is PlayerMobile && ((PlayerMobile)this.Owner).Lives > -1 ) from.SendMessage( "That person is not dead yet, so you cannot carve their body." ); else if ( dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( dead.Name ).MoveToWorld( Location, Map ); m_Carved = true; ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }
public static string FilterText( Mobile m, string s ) { try{ string filter = ""; string subOne = ""; string subTwo = ""; string subThree = ""; int index = 0; for( int i = 0; i < ChatInfo.Filters.Count; ++i ) { filter = ChatInfo.Filters[i].ToString(); if ( filter == "" ) { ChatInfo.Filters.Remove( filter ); continue; } index = s.ToLower().IndexOf( filter ); if ( index >= 0 ) { if ( m.AccessLevel == AccessLevel.Player ) { if ( !ChatInfo.NoFilterPenalty ) m.SendMessage( ChatInfo.GetInfo( m ).SystemColor, "Filter violation detected: " + filter ); if ( ChatInfo.FilterBan ) ChatInfo.GetInfo( m ).Ban( ChatInfo.FilterBanLength ); else if ( ChatInfo.FilterKick ) { m.Say( "I've been kicked!" ); if ( m.NetState != null ) m.NetState.Dispose(); } else if ( ChatInfo.FilterCriminal ) m.CriminalAction( false ); if ( !ChatInfo.NoFilterPenalty ) return ""; } subOne = s.Substring( 0, index ); subTwo = ""; for( int ii = 0; ii < filter.Length; ++ii ) subTwo+="*"; subThree = s.Substring( index+filter.Length, s.Length-filter.Length-index ); s = subOne + subTwo + subThree; i--; } } }catch{ Errors.Report( String.Format( "Filter-> FilterText-> |{0}|", m ) ); } return s; }
public override void OnItemLifted( Mobile from, Item item ) { base.OnItemLifted( from, item ); if ( item != this && from != m_Owner ) from.RevealingAction(); if ( item != this && IsCriminalAction( from ) ) from.CriminalAction( true ); if ( !m_Looters.Contains( from ) ) m_Looters.Add( from ); if ( m_InstancedItems != null && m_InstancedItems.ContainsKey( item ) ) m_InstancedItems.Remove( item ); // Scriptiz : on log les loots ! if (from != null && m_Owner != null && item != null && from.Player && m_Owner.Player) { string sItem = String.Format("{0} ({1})", item.GetType().Name, item.Serial); string sLooter = String.Format("{0} ({1})", from.Name, (from.Account != null ? from.Account.Username : "******")); string sLooted = String.Format("{0} ({1})", m_Owner.Name, (m_Owner.Account != null ? m_Owner.Account.Username : "******")); LogLoot(String.Format(DateTime.Now + ": {0} a été looté par {1} sur le corps de {2}", sItem, sLooter, sLooted)); } }
public virtual void OnCarve( Mobile from, Corpse corpse ) { int feathers = Feathers; int wool = Wool; int meat = Meat; int hides = Hides; int scales = Scales; int lightfur = LightFur; int darkfur = DarkFur; if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded ) { from.SendAsciiMessage( "You see nothing useful to carve from the corpse." ); } else { if ( corpse.Map == Map.Felucca ) { feathers *= 2; wool *= 2; hides *= 2; } new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map ); if ( feathers != 0 ) { corpse.DropItem( new Feather( feathers ) ); from.SendAsciiMessage( "You pluck the bird. The feathers are now on the corpse." ); } if ( wool != 0 ) { corpse.DropItem( new Wool( wool ) ); from.SendAsciiMessage( "You shear it, and the wool is now on the corpse." ); } if ( meat != 0 ) { if ( MeatType == MeatType.Ribs ) corpse.DropItem( new RawRibs( meat ) ); else if ( MeatType == MeatType.Bird ) corpse.DropItem( new RawBird( meat ) ); else if ( MeatType == MeatType.LambLeg ) corpse.DropItem( new RawLambLeg( meat ) ); from.SendAsciiMessage( "You carve some meat, which remains on the corpse." ); } if ( lightfur != 0 ) { if ( LightFurType == LightFurType.LightFur ) corpse.DropItem( new LightFur( lightfur ) ); from.SendAsciiMessage ( "You skin it, and the fur is now on the corpse." ); } if ( darkfur != 0 ) { if ( DarkFurType == DarkFurType.DarkFur ) corpse.DropItem( new DarkFur( darkfur ) ); from.SendAsciiMessage ( "You skin it, and the fur is now on the corpse." ); } if ( hides != 0 ) { if ( HideType == HideType.Regular ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Spined ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Horned ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Barbed ) corpse.DropItem( new Hides( hides ) ); from.SendAsciiMessage( "You skin it, and the hides are now on the corpse." ); } if ( scales != 0 ) { ScaleType sc = this.ScaleType; switch ( sc ) { case ScaleType.Red: corpse.DropItem( new RedScales( scales ) ); break; case ScaleType.Yellow: corpse.DropItem( new YellowScales( scales ) ); break; case ScaleType.Black: corpse.DropItem( new BlackScales( scales ) ); break; case ScaleType.Green: corpse.DropItem( new GreenScales( scales ) ); break; case ScaleType.White: corpse.DropItem( new WhiteScales( scales ) ); break; case ScaleType.Blue: corpse.DropItem( new BlueScales( scales ) ); break; case ScaleType.All: { corpse.DropItem( new RedScales( scales ) ); corpse.DropItem( new YellowScales( scales ) ); corpse.DropItem( new BlackScales( scales ) ); corpse.DropItem( new GreenScales( scales ) ); corpse.DropItem( new WhiteScales( scales ) ); corpse.DropItem( new BlueScales( scales ) ); break; } } from.SendAsciiMessage( "You cut away some scales, but they remain on the corpse." ); } corpse.Carved = true; if ( corpse.IsCriminalAction( from ) ) from.CriminalAction( true ); } }
public override void OnItemUsed( Mobile from, Item item ) { base.OnItemUsed( from, item ); if ( item is Food ) from.RevealingAction(); if ( item != this && IsCriminalAction( from ) ) from.CriminalAction( true ); if ( !m_Looters.Contains( from ) ) m_Looters.Add( from ); if ( m_InstancedItems != null && m_InstancedItems.ContainsKey( item ) ) m_InstancedItems.Remove( item ); }
private bool CheckLoot( Mobile m, bool criminalAction ) { if ( m_Temporary ) return false; if ( m.AccessLevel >= AccessLevel.GameMaster || m_Owner == null || m == m_Owner ) return true; Party p = Party.Get( m_Owner ); if ( p != null && p.Contains( m ) ) return true; Map map = this.Map; if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 ) { if ( criminalAction ) m.CriminalAction( true ); else m.SendLocalizedMessage( 1010630 ); // Taking someone else's treasure is a criminal offense! return true; } m.SendLocalizedMessage( 1010631 ); // You did not discover this chest! return false; }
public virtual void OnLoot(Mobile from) { Item m_Loot; string m_Collected = ""; DefragLooters(); if (!FindLooter(from)) { // always one m_Loot = Loot.Construct(m_TrashCommonTypes); from.AddToBackpack(m_Loot); m_Collected = "You have recovered " + GetName(m_Loot); if (Utility.RandomBool())// maybe two { m_Loot = Loot.Construct(m_TrashCommonTypes); from.AddToBackpack(m_Loot); m_Collected = m_Collected + ", " + GetName(m_Loot); } if (m_ItemChance > Utility.RandomDouble())// plus chance for a random item { m_Loot = Loot.Construct(m_TrashItemTypes); from.AddToBackpack(m_Loot); m_Collected = m_Collected + ", " + GetName(m_Loot); } if (m_RareChance > Utility.RandomDouble())// plus chance for a random prize { m_Loot = Loot.Construct(m_TrashRareTypes); from.AddToBackpack(m_Loot); m_Collected = m_Collected + ", and " + GetName(m_Loot) + "!"; } if (m_Sound > 0) Effects.PlaySound(from.Location, from.Map, m_Sound); from.SendMessage(m_Collected); Looters.Add(new TrashLooter(from)); m_usesCount++; if (m_MaxUses > 0 && m_usesCount >= m_MaxUses) { from.SendMessage("You have recovered the last useable item!"); this.Delete(); } if (m_MakesCriminal) { from.CriminalAction(false); from.SendLocalizedMessage(1010630); // Taking someone else's treasure is a criminal offense! } } else from.SendMessage("You find nothing of value at this time."); }
public void Carve( Mobile from, Item item ) { if ( IsCriminalAction( from ) && this.Map != null && ( this.Map.Rules & MapRules.HarmfulRestrictions ) != 0 || ( Instanced && GetInstancedCorpse( from ) == null ) ) { // You may not dismember that corpse as you do not have rights to it. from.SendLocalizedMessage( 1005016 ); return; } Mobile dead = m_Owner; if ( GetFlag( CorpseFlag.Carved ) || dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( dead is TyballShadow ) { // You may not dismember that corpse as you do not have rights to it. from.SendLocalizedMessage( 1005016 ); } else if ( ( (Body) Amount ).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( String.Format( "the head of {0}", dead.Name ) ).MoveToWorld( Location, Map ); SetFlag( CorpseFlag.Carved, true ); ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; Direction = Direction.North; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) ( (BaseCreature) dead ).OnCarve( from, this, item is ButchersWarCleaver ); else from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. }
public virtual void OnCarve( Mobile from, Corpse corpse ) { int feathers = Feathers; int wool = Wool; int meat = Meat; int hides = Hides; int scales = Scales; if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else { // 6/8/2004 - Pulse // No longer doubles the resources from corpses if in Felucca, to re-add double resources // un-comment the 6 lines of code below. // if ( corpse.Map == Map.Felucca ) // { // feathers *= 2; // wool *= 2; // hides *= 2; // } new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map ); if ( feathers != 0 ) { corpse.DropItem( new Feather( feathers ) ); from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse. } if ( wool != 0 ) { corpse.DropItem( new Wool( wool ) ); from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse. } if ( meat != 0 ) { if ( MeatType == MeatType.Ribs ) corpse.DropItem( new RawRibs( meat ) ); else if ( MeatType == MeatType.Bird ) corpse.DropItem( new RawBird( meat ) ); else if ( MeatType == MeatType.LambLeg ) corpse.DropItem( new RawLambLeg( meat ) ); from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse. } if ( hides != 0 ) { if ( HideType == HideType.Regular ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Spined ) corpse.DropItem( new SpinedHides( hides ) ); else if ( HideType == HideType.Horned ) corpse.DropItem( new HornedHides( hides ) ); else if ( HideType == HideType.Barbed ) corpse.DropItem( new BarbedHides( hides ) ); from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse. } if ( scales != 0 ) { ScaleType sc = this.ScaleType; switch ( sc ) { case ScaleType.Red: corpse.DropItem( new RedScales( scales ) ); break; case ScaleType.Yellow: corpse.DropItem( new YellowScales( scales ) ); break; case ScaleType.Black: corpse.DropItem( new BlackScales( scales ) ); break; case ScaleType.Green: corpse.DropItem( new GreenScales( scales ) ); break; case ScaleType.White: corpse.DropItem( new WhiteScales( scales ) ); break; case ScaleType.Blue: corpse.DropItem( new BlueScales( scales ) ); break; case ScaleType.All: { corpse.DropItem( new RedScales( scales ) ); corpse.DropItem( new YellowScales( scales ) ); corpse.DropItem( new BlackScales( scales ) ); corpse.DropItem( new GreenScales( scales ) ); corpse.DropItem( new WhiteScales( scales ) ); corpse.DropItem( new BlueScales( scales ) ); break; } } from.SendMessage( "You cut away some scales, but they remain on the corpse." ); } corpse.Carved = true; if ( corpse.IsCriminalAction( from ) ) from.CriminalAction( true ); } }
private void ExecuteCriminalAction( Mobile state ) { if ( state != null && !state.Deleted ) state.CriminalAction( true ); }
public virtual void OnLoot(Mobile from) { Item m_Loot; string m_Collected = "You have recovered "; DefragLooters(); if (!FindLooter(from)) { List<Item> loots = new List<Item>(); bool rare = false; // improved chance of finding good loot based on certian skills // Calculated out of 200% double useskills = (from.Skills.Begging.Value + from.Skills.ItemID.Value) / 5000; // always one m_Loot = Loot.Construct( m_TrashCommonTypes ); m_Loot.Movable = true; from.AddToBackpack(m_Loot); loots.Add( m_Loot ); if ( Utility.RandomBool() ) // maybe two { m_Loot = Loot.Construct(m_TrashCommonTypes); m_Loot.Movable = true; from.AddToBackpack(m_Loot); loots.Add( m_Loot ); } if ( ( m_ItemChance + ( useskills * 2 ) ) > Utility.RandomDouble() )// plus chance for a random item { m_Loot = Loot.Construct(m_TrashItemTypes); m_Loot.Movable = true; from.AddToBackpack(m_Loot); loots.Add( m_Loot ); } else if ( m_RareChance + useskills > Utility.RandomDouble() )// plus chance for a random prize { m_Loot = Loot.Construct(m_TrashRareTypes); m_Loot.Movable = true; from.AddToBackpack(m_Loot); loots.Add( m_Loot ); rare = true; } else if ( ( m_RareChance + useskills ) / 100.0 > Utility.RandomDouble() ) { m_Loot = Loot.Construct(m_TrashVeryRareTypes); m_Loot.Movable = true; from.AddToBackpack(m_Loot); loots.Add( m_Loot ); rare = true; } if ( m_Sound > 0 ) Effects.PlaySound(from.Location, from.Map, m_Sound); for ( int i = 0;i < loots.Count; i++ ) { if ( i == 0 ) //First m_Collected += GetName( loots[i] ); else if ( i == loots.Count-1 ) //Last { m_Collected += String.Format( ", and {0}{1}", GetName( loots[i] ), rare ? "!" : "." ); } else m_Collected += String.Format( ", {0}", GetName( loots[i] ) ); } from.SendMessage(m_Collected); Looters.Add(new TrashLooter(from)); m_usesCount++; if (m_MaxUses > 0 && m_usesCount >= m_MaxUses) { from.SendMessage("You have recovered the last useable item!"); this.Delete(); } if (m_MakesCriminal) { from.CriminalAction(false); from.SendLocalizedMessage(1010630); // Taking someone else's treasure is a criminal offense! } } else from.SendMessage("You find nothing of value at this time."); }
public virtual void OnCarve( Mobile from, Corpse corpse ) { int feathers = Feathers; int wool = Wool; int meat = Meat; int hides = Hides; int scales = 0;//Scales; int furs = GenerateFurs( corpse ); if ( (feathers == 0 && furs == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else { new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map ); if ( feathers != 0 ) { corpse.DropItem( new Feather( feathers ) ); //from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse. } if ( wool != 0 ) { corpse.DropItem( new Wool( wool ) ); //from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse. } if ( meat != 0 ) { if ( MeatType == MeatType.Ribs ) corpse.DropItem( new RawRibs( meat ) ); else if ( MeatType == MeatType.Bird ) corpse.DropItem( new RawBird( meat ) ); else if ( MeatType == MeatType.LambLeg ) corpse.DropItem( new RawLambLeg( meat ) ); //from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse. } if ( hides != 0 ) { if ( HideType == HideType.Regular ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Spined ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Horned ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Barbed ) corpse.DropItem( new Hides( hides ) ); } //if ( hides != 0 || furs != 0 ) // from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse. corpse.Carved = true; if ( corpse.IsCriminalAction( from ) ) from.CriminalAction( true ); } }
private bool CanUseTrap(Mobile from) { if (m_Owner == null || RootParent != null) return false; if (!from.InRange(this.Location, 6)) { from.SendLocalizedMessage(500295); //You are too far away to do that. return false; } //is owner, or in same guild if (m_Owner == from || (from.Guild != null && from.Guild == m_Owner.Guild)) return true; //partied if (Party.Get(from) == Party.Get(m_Owner)) return true; //fel rules if (from.Map != null && from.Map.Rules == MapRules.FeluccaRules) { from.CriminalAction(true); from.SendLocalizedMessage(1149823); //The owner of the lobster trap notices you committing a criminal act! if (m_Owner != null) m_Owner.SendMessage("You notice {0} taking your lobster trap out of the water!", from.Name); return true; } from.SendLocalizedMessage(1116391); //You realize that the trap isn't yours so you leave it alone. return false; }
public virtual void OnCarve( Mobile from, Corpse corpse ) { int feathers = Feathers; int wool = Wool; int meat = Meat; int hides = Hides; int scales = Scales; if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else { if( Core.ML && from.Race == Race.Human ) { hides = (int)Math.Ceiling( hides * 1.1 ); //10% Bonus Only applies to Hides, Ore & Logs } if ( corpse.Map == Map.Felucca ) { feathers *= 2; wool *= 2; hides *= 2; } new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map ); if ( feathers != 0 ) { corpse.DropItem( new Feather( feathers ) ); from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse. } if ( wool != 0 ) { corpse.DropItem( new Wool( wool ) ); from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse. } if ( meat != 0 ) { if ( MeatType == MeatType.Ribs ) corpse.DropItem( new RawRibs( meat ) ); else if ( MeatType == MeatType.Bird ) corpse.DropItem( new RawBird( meat ) ); else if ( MeatType == MeatType.LambLeg ) corpse.DropItem( new RawLambLeg( meat ) ); from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse. } if ( hides != 0 ) { if ( HideType == HideType.Regular ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Spined ) corpse.DropItem( new SpinedHides( hides ) ); else if ( HideType == HideType.Horned ) corpse.DropItem( new HornedHides( hides ) ); else if ( HideType == HideType.Barbed ) corpse.DropItem( new BarbedHides( hides ) ); from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse. } if ( scales != 0 ) { ScaleType sc = this.ScaleType; switch ( sc ) { case ScaleType.Red: corpse.DropItem( new RedScales( scales ) ); break; case ScaleType.Yellow: corpse.DropItem( new YellowScales( scales ) ); break; case ScaleType.Black: corpse.DropItem( new BlackScales( scales ) ); break; case ScaleType.Green: corpse.DropItem( new GreenScales( scales ) ); break; case ScaleType.White: corpse.DropItem( new WhiteScales( scales ) ); break; case ScaleType.Blue: corpse.DropItem( new BlueScales( scales ) ); break; case ScaleType.All: { corpse.DropItem( new RedScales( scales ) ); corpse.DropItem( new YellowScales( scales ) ); corpse.DropItem( new BlackScales( scales ) ); corpse.DropItem( new GreenScales( scales ) ); corpse.DropItem( new WhiteScales( scales ) ); corpse.DropItem( new BlueScales( scales ) ); break; } } from.SendMessage( "You cut away some scales, but they remain on the corpse." ); } corpse.Carved = true; if ( corpse.IsCriminalAction( from ) ) from.CriminalAction( true ); } }
public override void OnItemLifted( Mobile from, Item item ) { base.OnItemLifted( from, item ); if ( item != this && from != m_Owner ) from.RevealingAction(); if ( item != this && IsCriminalAction( from ) ) from.CriminalAction( true ); if ( !m_Looters.Contains( from ) ) m_Looters.Add( from ); }
public void Carve( Mobile from, Item item ) { Mobile dead = m_Owner; if ( GetFlag(CorpseFlag.Carved) || dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Blood( 0x122D ).MoveToWorld( Location, Map ); if ( m_Owner.AccessLevel == AccessLevel.Player ) { new Torso( m_Owner ).MoveToWorld( Location, Map ); new LeftLeg( m_Owner ).MoveToWorld( Location, Map ); new LeftArm( m_Owner ).MoveToWorld( Location, Map ); new RightLeg( m_Owner ).MoveToWorld( Location, Map ); new RightArm( m_Owner ).MoveToWorld( Location, Map ); new Head( m_Owner ).MoveToWorld( Location, Map ); } SetFlag(CorpseFlag.Carved, true); while ( Items.Count > 0 ) { Item j = (Item)Items[0]; if ( (j.Layer == Layer.Hair || j.Layer == Layer.FacialHair) || !j.Movable ) j.Delete(); else j.MoveToWorld( GetWorldLocation(), Map ); } if ( IsCriminalAction( from ) ) from.CriminalAction( true ); Delete(); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }
public void Carve( Mobile from, Item item ) { if ( IsCriminalAction( from ) && this.Map != null && (this.Map.Rules & MapRules.HarmfulRestrictions) != 0 ) { if ( m_Owner == null || !m_Owner.Player ) from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature! else from.SendLocalizedMessage( 1010049 ); // You may not loot this corpse. return; } Mobile dead = m_Owner; if ( GetFlag( CorpseFlag.Carved ) || dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( dead.Name ).MoveToWorld( Location, Map ); SetFlag( CorpseFlag.Carved, true ); ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this, item ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }
public override void OnItemUsed( Mobile from, Item item ) { base.OnItemUsed( from, item ); if ( item != this && IsCriminalAction( from ) ) from.CriminalAction( true ); if ( !m_Looters.Contains( from ) ) m_Looters.Add( from ); }
public virtual void OnCarve( Mobile from, Corpse corpse, Item with ) { int feathers = Feathers; int wool = Wool; int meat = Meat; int hides = Hides; int scales = Scales; if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else { if( Core.ML && from.Race == Race.Human ) { hides = (int)Math.Ceiling( hides * 1.1 ); //10% Bonus Only applies to Hides, Ore & Logs } if ( corpse.Map == Map.Felucca ) { feathers *= 2; wool *= 2; hides *= 2; } new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map ); if ( feathers != 0 ) { corpse.AddCarvedItem( new Feather( feathers ), from ); from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse. } if ( wool != 0 ) { corpse.AddCarvedItem( new TaintedWool( wool ), from ); from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse. } if ( meat != 0 ) { if ( MeatType == MeatType.Ribs ) corpse.AddCarvedItem( new RawRibs( meat ), from ); else if ( MeatType == MeatType.Bird ) corpse.AddCarvedItem( new RawBird( meat ), from ); else if ( MeatType == MeatType.LambLeg ) corpse.AddCarvedItem( new RawLambLeg( meat ), from ); from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse. } if ( hides != 0 ) { Item holding = from.Weapon as Item; if ( Core.AOS && ( holding is SkinningKnife /* TODO: || holding is ButcherWarCleaver || with is ButcherWarCleaver */ ) ) { Item leather = null; switch ( HideType ) { case HideType.Regular: leather = new Leather( hides ); break; case HideType.Spined: leather = new SpinedLeather( hides ); break; case HideType.Horned: leather = new HornedLeather( hides ); break; case HideType.Barbed: leather = new BarbedLeather( hides ); break; } if ( leather != null ) { if ( !from.PlaceInBackpack( leather ) ) { corpse.DropItem( leather ); from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse. } else from.SendLocalizedMessage( 1073555 ); // You skin it and place the cut-up hides in your backpack. } } else { if ( HideType == HideType.Regular ) corpse.DropItem( new Hides( hides ) ); else if ( HideType == HideType.Spined ) corpse.DropItem( new SpinedHides( hides ) ); else if ( HideType == HideType.Horned ) corpse.DropItem( new HornedHides( hides ) ); else if ( HideType == HideType.Barbed ) corpse.DropItem( new BarbedHides( hides ) ); from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse. } } if ( scales != 0 ) { ScaleType sc = this.ScaleType; switch ( sc ) { case ScaleType.Red: corpse.AddCarvedItem( new RedScales( scales ), from ); break; case ScaleType.Yellow: corpse.AddCarvedItem( new YellowScales( scales ), from ); break; case ScaleType.Black: corpse.AddCarvedItem( new BlackScales( scales ), from ); break; case ScaleType.Green: corpse.AddCarvedItem( new GreenScales( scales ), from ); break; case ScaleType.White: corpse.AddCarvedItem( new WhiteScales( scales ), from ); break; case ScaleType.Blue: corpse.AddCarvedItem( new BlueScales( scales ), from ); break; case ScaleType.All: { corpse.AddCarvedItem( new RedScales( scales ), from ); corpse.AddCarvedItem( new YellowScales( scales ), from ); corpse.AddCarvedItem( new BlackScales( scales ), from ); corpse.AddCarvedItem( new GreenScales( scales ), from ); corpse.AddCarvedItem( new WhiteScales( scales ), from ); corpse.AddCarvedItem( new BlueScales( scales ), from ); break; } } from.SendMessage( "You cut away some scales, but they remain on the corpse." ); } corpse.Carved = true; if ( corpse.IsCriminalAction( from ) ) from.CriminalAction( true ); } }
public static bool Mobile_AllowHarmful( Mobile from, Mobile target ) { if (from == null || target == null || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player) return true; #region Dueling PlayerMobile pmFrom = from as PlayerMobile; PlayerMobile pmTarg = target as PlayerMobile; BaseCreature bcFrom = from as BaseCreature; if (pmFrom == null && bcFrom != null) { if (bcFrom.Summoned) pmFrom = bcFrom.SummonMaster as PlayerMobile; } if (pmFrom != null && pmFrom.Kills >= 5 && !MurderSystemController._RedAllowHarmfulToBluesInTown) { if (target != null && target.Region != null) { GuardedRegion region = (GuardedRegion)target.Region.GetRegion(typeof(GuardedRegion)); if (region != null && !region.Disabled) { if (Notoriety.Compute(from, target) == Notoriety.Innocent) { return false; } } } } if (pmTarg == null && target is BaseCreature) { BaseCreature bcTarg = (BaseCreature)target; if (bcTarg.Summoned) pmTarg = bcTarg.SummonMaster as PlayerMobile; } if (pmFrom != null && pmTarg != null) { if (pmFrom.DuelContext != pmTarg.DuelContext && ((pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg.DuelContext != null && pmTarg.DuelContext.Started))) return false; if (pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && ((pmFrom.DuelContext.StartedReadyCountdown && !pmFrom.DuelContext.Started) || pmFrom.DuelContext.Tied || pmFrom.DuelPlayer.Eliminated || pmTarg.DuelPlayer.Eliminated)) return false; if (pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.m_Tournament != null && pmFrom.DuelContext.m_Tournament.IsNotoRestricted && pmFrom.DuelPlayer != null && pmTarg.DuelPlayer != null && pmFrom.DuelPlayer.Participant == pmTarg.DuelPlayer.Participant) return false; if (pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.Started) return true; } if ((pmFrom != null && pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg != null && pmTarg.DuelContext != null && pmTarg.DuelContext.Started)) return false; Engines.ConPVP.SafeZone sz = from.Region.GetRegion(typeof(Engines.ConPVP.SafeZone)) as Engines.ConPVP.SafeZone; if (sz != null /*&& sz.IsDisabled()*/ ) return false; sz = target.Region.GetRegion(typeof(Engines.ConPVP.SafeZone)) as Engines.ConPVP.SafeZone; if (sz != null /*&& sz.IsDisabled()*/ ) return false; #endregion // Alan mod: custom teams if (from.CustomTeam && target.CustomTeam) { List<XmlTeam> targetTeams = XmlAttach.GetTeams(target); List<XmlTeam> fromTeams = XmlAttach.GetTeams(from); if (XmlTeam.SameTeam(fromTeams, targetTeams)) { return XmlTeam.AllowTeamHarmful(fromTeams, targetTeams); } // they are on the enemy team, allow harmful return true; } // end Alan mod if (bcFrom != null) { if (!bcFrom.Pseu_CanAttackInnocents && Notoriety.Compute(from, target) == Notoriety.Innocent) { return false; } } // end Alan mod // ALAN MOD: protect young players from other players in regions where they are given protection if (MurderSystemController._YoungProtectionRegionsEnabled) { if (target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection(from) && !CheckAggressor(from.Aggressors, target) && !CheckAggressed(from.Aggressed, target)) { return false; } } // END ALAN MOD var g = (Guild)BaseGuild.FindByAbbrev("New");//don't allow people in the new guild to attack eachother if (g != null && g.IsMember(from) && g.IsMember(target)) { from.CriminalAction(true); return true; } Map map = from.Map; if (map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0) return true; // In felucca, anything goes // check uncontrolled NPC mobs--there's a chance they won't attack if young protection is on if (!from.Player && !(bcFrom != null && bcFrom.GetMaster() != null && bcFrom.GetMaster().AccessLevel == AccessLevel.Player)) { if (target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection(from) && !CheckAggressor(from.Aggressors, target) && !CheckAggressed(from.Aggressed, target)) return false; return true; // Uncontrolled NPCs are only restricted by the young system } Guild fromGuild = GetGuildFor(from.Guild as Guild, from); Guild targetGuild = GetGuildFor(target.Guild as Guild, target); if (fromGuild != null && targetGuild != null && (fromGuild == targetGuild || fromGuild.IsAlly(targetGuild) || fromGuild.IsEnemy(targetGuild))) return true; // Guild allies or enemies can be harmful if (target is BaseCreature && (((BaseCreature)target).Controlled || (((BaseCreature)target).Summoned && from != ((BaseCreature)target).SummonMaster))) return false; // Cannot harm other controlled mobiles if (target.Player) return false; // Cannot harm other players if (!(target is BaseCreature && ((BaseCreature)target).InitialInnocent)) { if (Notoriety.Compute(from, target) == Notoriety.Innocent) return false; // Cannot harm innocent mobiles } return true; }
public virtual void Carve( Mobile from, Item item ) { if ( IsCriminalAction( from ) && this.Map != null && (this.Map.Rules & MapRules.HarmfulRestrictions) != 0 ) { if ( m_Owner == null || !m_Owner.Player ) from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature! else from.SendLocalizedMessage( 1010049 ); // You may not loot this corpse. return; } Mobile dead = m_Owner; if ( GetFlag( CorpseFlag.Carved ) || dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); Head head = new Head( dead.Name ); head.MoveToWorld( Location, Map ); if (m_Killer != null) { if (m_Killer is BaseCreature && ((BaseCreature)m_Killer).ControlMaster != null) head.HeadKiller = ((BaseCreature)m_Killer).ControlMaster; else head.HeadKiller = m_Killer; head.DateKill = m_TimeOfDeath; head.HeadOwner = m_Owner; } if ( Region.Find( Location, Map ).IsPartOf( "a spectator area" ) ) head.HeadType = HeadType.Duel; SetFlag( CorpseFlag.Carved, true ); ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this, item ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }
public void Carve( Mobile from, Item item ) { Mobile dead = m_Owner; if ( m_Carved || dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso( dead.Name ).MoveToWorld( Location, Map ); new LeftLeg( dead.Name ).MoveToWorld( Location, Map ); new LeftArm( dead.Name ).MoveToWorld( Location, Map ); new RightLeg( dead.Name ).MoveToWorld( Location, Map ); new RightArm( dead.Name ).MoveToWorld( Location, Map ); //bounty system here Head head = new Head( String.Format( dead.Name ) ); head.MoveToWorld( Location, Map ); if(m_Killer is PlayerMobile) { head.Owner = m_Owner; head.Killer = m_Killer; head.CreationTime = DateTime.Now; head.IsPlayer = true; } //end bounty sytem m_Carved = true; ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }