diff --git a/Scripts/Engines/Plants/EmptyTheBowlGump.cs b/Scripts/Engines/Plants/EmptyTheBowlGump.cs index 6d662a5ca..c67376fb7 100644 --- a/Scripts/Engines/Plants/EmptyTheBowlGump.cs +++ b/Scripts/Engines/Plants/EmptyTheBowlGump.cs @@ -52,8 +52,14 @@ namespace Server.Engines.Plants { Mobile from = sender.Mobile; - if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant || !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant ) return; + + if ( info.ButtonID == 3 && !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3E9, 500446 ); // That is too far away. + return; + } if ( !m_Plant.IsUsableBy( from ) ) { diff --git a/Scripts/Engines/Plants/MainPlantGump.cs b/Scripts/Engines/Plants/MainPlantGump.cs index c5544506c..0eb19ad57 100644 --- a/Scripts/Engines/Plants/MainPlantGump.cs +++ b/Scripts/Engines/Plants/MainPlantGump.cs @@ -226,8 +226,14 @@ namespace Server.Engines.Plants { Mobile from = sender.Mobile; - if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant || !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant ) return; + + if ( ( ( info.ButtonID >= 6 && info.ButtonID <= 10 ) || info.ButtonID == 12 ) && !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3E9, 500446 ); // That is too far away. + return; + } if ( !m_Plant.IsUsableBy( from ) ) { @@ -286,8 +292,30 @@ namespace Server.Engines.Plants } case 6: // Water { - from.Target = new PlantPourTarget( m_Plant ); - from.SendLocalizedMessage( 1060808, "#" + m_Plant.GetLocalizedPlantStatus().ToString() ); // Target the container you wish to use to water the ~1_val~. + Item[] item = from.Backpack.FindItemsByType( typeof( BaseBeverage ) ); + + bool foundUsableWater = false; + + if ( item != null && item.Length > 0 ) + { + for ( int i = 0; i < item.Length; ++i ) + { + BaseBeverage beverage = (BaseBeverage)item[i]; + + if ( !beverage.IsEmpty && beverage.Pourable && beverage.Content == BeverageType.Water ) + { + foundUsableWater = true; + m_Plant.Pour( from, beverage ); + break; + } + } + } + + if ( !foundUsableWater ) + { + from.Target = new PlantPourTarget( m_Plant ); + from.SendLocalizedMessage( 1060808, "#" + m_Plant.GetLocalizedPlantStatus().ToString() ); // Target the container you wish to use to water the ~1_val~. + } break; } diff --git a/Scripts/Engines/Plants/PlantItem.cs b/Scripts/Engines/Plants/PlantItem.cs index 1b9f176c9..c490b9629 100644 --- a/Scripts/Engines/Plants/PlantItem.cs +++ b/Scripts/Engines/Plants/PlantItem.cs @@ -6,6 +6,7 @@ using Server.Gumps; using Server.Items; using Server.Multis; using Server.ContextMenus; +using Server.Network; namespace Server.Engines.Plants { @@ -212,8 +213,10 @@ namespace Server.Engines.Plants return 1060812; // plant else if ( m_PlantStatus >= PlantStatus.Sapling ) return 1023305; // sapling - else + else if ( m_PlantStatus >= PlantStatus.Seed ) return 1060810; // seed + else + return 1026951; // dirt } private void Update() @@ -341,6 +344,14 @@ namespace Server.Engines.Plants { if ( m_PlantStatus >= PlantStatus.DecorativePlant ) return; + + Point3D loc = this.GetWorldLocation(); + + if ( !from.InLOS( loc ) || !from.InRange( loc, 2 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3E9, 1019045 ); // I can't reach that. + return; + } if ( !IsUsableBy( from ) ) { @@ -363,12 +374,7 @@ namespace Server.Engines.Plants } else if ( m_PlantStatus != PlantStatus.BowlOfDirt ) { - if ( m_PlantStatus >= PlantStatus.Plant ) - LabelTo( from, "This bowl of dirt already has a plant in it!" ); - else if ( m_PlantStatus >= PlantStatus.Sapling ) - LabelTo( from, "This bowl of dirt already has a sapling in it!" ); - else - LabelTo( from, "This bowl of dirt already has a seed in it!" ); + from.SendLocalizedMessage( 1080389, "#" + GetLocalizedPlantStatus().ToString() ); // This bowl of dirt already has a ~1_val~ in it! } else if ( m_PlantSystem.Water < 2 ) { diff --git a/Scripts/Engines/Plants/ReproductionGump.cs b/Scripts/Engines/Plants/ReproductionGump.cs index 6105f909b..9672532c4 100644 --- a/Scripts/Engines/Plants/ReproductionGump.cs +++ b/Scripts/Engines/Plants/ReproductionGump.cs @@ -116,9 +116,15 @@ namespace Server.Engines.Plants { Mobile from = sender.Mobile; - if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant || m_Plant.PlantStatus == PlantStatus.BowlOfDirt || !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant || m_Plant.PlantStatus == PlantStatus.BowlOfDirt ) return; + if ( ( info.ButtonID >= 6 && info.ButtonID <= 8 ) && !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3E9, 500446 ); // That is too far away. + return; + } + if ( !m_Plant.IsUsableBy( from ) ) { m_Plant.LabelTo( from, 1061856 ); // You must have the item in your backpack or locked down in order to use it. diff --git a/Scripts/Engines/Plants/Seed.cs b/Scripts/Engines/Plants/Seed.cs index d945b65ad..b812d3236 100644 --- a/Scripts/Engines/Plants/Seed.cs +++ b/Scripts/Engines/Plants/Seed.cs @@ -140,9 +140,10 @@ namespace Server.Engines.Plants { private Seed m_Seed; - public InternalTarget( Seed seed ) : base( 3, false, TargetFlags.None ) + public InternalTarget( Seed seed ) : base( -1, false, TargetFlags.None ) { m_Seed = seed; + CheckLOS = false; } protected override void OnTarget( Mobile from, object targeted ) diff --git a/Scripts/Engines/Plants/SetToDecorativeGump.cs b/Scripts/Engines/Plants/SetToDecorativeGump.cs index f4c44379a..b9b016061 100644 --- a/Scripts/Engines/Plants/SetToDecorativeGump.cs +++ b/Scripts/Engines/Plants/SetToDecorativeGump.cs @@ -41,8 +41,14 @@ namespace Server.Engines.Plants { Mobile from = sender.Mobile; - if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus != PlantStatus.Stage9 || !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + if ( info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus != PlantStatus.Stage9 ) return; + + if ( info.ButtonID == 3 && !from.InRange( m_Plant.GetWorldLocation(), 3 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3E9, 500446 ); // That is too far away. + return; + } if ( !m_Plant.IsUsableBy( from ) ) { diff --git a/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs b/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs index 805d54b91..99cbea336 100644 --- a/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs +++ b/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs @@ -56,8 +56,6 @@ namespace Server.Items public override int BasePoisonResistance { get { return 17; } } public override int BaseEnergyResistance { get { return 17; } } - public override bool CanBeBlessed { get { return false; } } - public override int InitMinHits { get { return 255; } } public override int InitMaxHits { get { return 255; } } diff --git a/Scripts/Gumps/PlayerVendorGumps.cs b/Scripts/Gumps/PlayerVendorGumps.cs index 0a9377219..5f99fdf85 100644 --- a/Scripts/Gumps/PlayerVendorGumps.cs +++ b/Scripts/Gumps/PlayerVendorGumps.cs @@ -55,6 +55,8 @@ namespace Server.Gumps if ( info.ButtonID == 1 ) { + m_Vendor.Say( from.Name ); + if ( !m_VI.Valid || !m_VI.Item.IsChildOf( m_Vendor.Backpack ) ) { m_Vendor.SayTo( from, 503216 ); // You can't buy that. diff --git a/Scripts/Gumps/RunebookGump.cs b/Scripts/Gumps/RunebookGump.cs index bfcf70530..9b0cc87db 100644 --- a/Scripts/Gumps/RunebookGump.cs +++ b/Scripts/Gumps/RunebookGump.cs @@ -149,12 +149,11 @@ namespace Server.Gumps AddButton( 135 + (half * 160), 115, 2437, 2438, 2 + (index * 6) + 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 150 + (half * 160), 115, 100, 18, 1011298, false, false ); // Drop rune - if ( e != m_Book.Default ) - { - // Set as default button - AddButton( 160 + (half * 140), 20, 2361, 2361, 2 + (index * 6) + 2, GumpButtonType.Reply, 0 ); - AddHtmlLocalized( 175 + (half * 140), 15, 100, 18, 1011300, false, false ); // Set default - } + // Set as default button + int defButtonID = e != m_Book.Default ? 2361 : 2360; + + AddButton( 160 + (half * 140), 20, defButtonID, defButtonID, 2 + (index * 6) + 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 175 + (half * 140), 15, 100, 18, 1011300, false, false ); // Set default if ( Core.AOS ) { @@ -239,6 +238,8 @@ namespace Server.Gumps } else { + m_Book.Openers.Remove( from ); + from.SendLocalizedMessage( 502416 ); // That cannot be done while the book is locked down. } } @@ -260,7 +261,10 @@ namespace Server.Gumps Mobile from = state.Mobile; if ( m_Book.Deleted || !from.InRange( m_Book.GetWorldLocation(), (Core.ML ? 3 : 1) ) || !Multis.DesignContext.Check( from ) ) + { + m_Book.Openers.Remove( from ); return; + } int buttonID = info.ButtonID; @@ -273,6 +277,8 @@ namespace Server.Gumps } else { + m_Book.Openers.Remove( from ); + from.SendLocalizedMessage( 502413, null, 0x35 ); // That cannot be done while the book is locked down. } } @@ -311,8 +317,9 @@ namespace Server.Gumps } m_Book.OnTravel(); - new RecallSpell( from, m_Book, e, m_Book ).Cast(); + + m_Book.Openers.Remove( from ); } break; @@ -328,6 +335,8 @@ namespace Server.Gumps } else { + m_Book.Openers.Remove( from ); + from.SendLocalizedMessage( 502413, null, 0x35 ); // That cannot be done while the book is locked down. } @@ -368,6 +377,8 @@ namespace Server.Gumps { from.SendLocalizedMessage( 500015 ); // You do not have that spell! } + + m_Book.Openers.Remove( from ); break; } @@ -392,6 +403,8 @@ namespace Server.Gumps { from.SendLocalizedMessage( 500015 ); // You do not have that spell! } + + m_Book.Openers.Remove( from ); break; } @@ -419,11 +432,15 @@ namespace Server.Gumps from.SendLocalizedMessage( 500015 ); // You do not have that spell! } } + + m_Book.Openers.Remove( from ); break; } } } + else + m_Book.Openers.Remove( from ); } } } diff --git a/Scripts/Items/Containers/Container.cs b/Scripts/Items/Containers/Container.cs index 1786824fb..95dec3642 100644 --- a/Scripts/Items/Containers/Container.cs +++ b/Scripts/Items/Containers/Container.cs @@ -40,6 +40,14 @@ namespace Server.Items return base.CheckHold( m, item, message, checkItems, plusItems, plusWeight ); } + public override bool CheckItemUse( Mobile from, Item item ) + { + if ( IsDecoContainer && item is BaseBook ) + return true; + + return base.CheckItemUse( from, item ); + } + public override void GetContextMenuEntries( Mobile from, List list ) { base.GetContextMenuEntries( from, list ); diff --git a/Scripts/Items/Containers/ParagonChest.cs b/Scripts/Items/Containers/ParagonChest.cs index b7ddfe120..063d16ab2 100644 --- a/Scripts/Items/Containers/ParagonChest.cs +++ b/Scripts/Items/Containers/ParagonChest.cs @@ -9,6 +9,7 @@ using Server.Engines.PartySystem; namespace Server.Items { + [Flipable] public class ParagonChest : LockableContainer { public override int LabelNumber{ get{ return 3000541; } } @@ -21,7 +22,7 @@ namespace Server.Items private static int[] m_Hues = new int[] { 0x0, 0x455, 0x47E, 0x89F, 0x8A5, 0x8AB, - 0x966, 0x96D, 0x972, 0x973, 0x979, + 0x966, 0x96D, 0x972, 0x973, 0x979 }; private string m_Name; @@ -76,6 +77,18 @@ namespace Server.Items min = 10; max = 20; } } + + public void Flip() + { + switch ( ItemID ) + { + case 0x9AB : ItemID = 0xE7C; break; + case 0xE7C : ItemID = 0x9AB; break; + + case 0xE40 : ItemID = 0xE41; break; + case 0xE41 : ItemID = 0xE40; break; + } + } private void Fill( int level ) { diff --git a/Scripts/Items/Skill Items/Magical/Runebook.cs b/Scripts/Items/Skill Items/Magical/Runebook.cs index 53310592c..731d1c922 100644 --- a/Scripts/Items/Skill Items/Magical/Runebook.cs +++ b/Scripts/Items/Skill Items/Magical/Runebook.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using Server; using Server.Gumps; using Server.Network; +using Server.Mobiles; using Server.Multis; using Server.Engines.Craft; using Server.ContextMenus; @@ -22,6 +23,8 @@ namespace Server.Items private Mobile m_Crafter; private DateTime m_NextUse; + + private List m_Openers = new List(); [CommandProperty( AccessLevel.GameMaster )] public DateTime NextUse @@ -83,6 +86,18 @@ namespace Server.Items m_MaxCharges = value; } } + + public List Openers + { + get + { + return m_Openers; + } + set + { + m_Openers = value; + } + } public override int LabelNumber{ get{ return 1041267; } } // runebook @@ -264,6 +279,23 @@ namespace Server.Items if ( m_Description != null && m_Description.Length > 0 ) list.Add( m_Description ); } + + public override bool OnDragLift( Mobile from ) + { + if ( from.HasGump( typeof( RunebookGump ) ) ) + { + from.SendLocalizedMessage( 500169 ); // You cannot pick that up. + return false; + } + + foreach ( Mobile m in m_Openers ) + if ( IsOpen( m ) ) + m.CloseGump( typeof( RunebookGump ) ); + + m_Openers.Clear(); + + return true; + } public override void OnSingleClick( Mobile from ) { @@ -280,6 +312,12 @@ namespace Server.Items { if ( from.InRange( GetWorldLocation(), (Core.ML ? 3 : 1) ) && CheckAccess( from ) ) { + if ( RootParent is BaseCreature ) + { + from.SendLocalizedMessage( 502402 ); // That is inaccessible. + return; + } + if ( DateTime.Now < NextUse ) { from.SendLocalizedMessage( 502406 ); // This book needs time to recharge. @@ -288,6 +326,8 @@ namespace Server.Items from.CloseGump( typeof( RunebookGump ) ); from.SendGump( new RunebookGump( from, this ) ); + + m_Openers.Add( from ); } } diff --git a/Scripts/Skills/Hiding.cs b/Scripts/Skills/Hiding.cs index b1adf5fc2..782d7a776 100644 --- a/Scripts/Skills/Hiding.cs +++ b/Scripts/Skills/Hiding.cs @@ -97,6 +97,7 @@ namespace Server.SkillHandlers if ( ok ) { m.Hidden = true; + m.Warmode = false; m.LocalOverheadMessage( MessageType.Regular, 0x1F4, 501240 ); // You have hidden yourself well. } else diff --git a/Scripts/Spells/Chivalry/SacredJourney.cs b/Scripts/Spells/Chivalry/SacredJourney.cs index 10e1df2f8..4c5f23fee 100644 --- a/Scripts/Spells/Chivalry/SacredJourney.cs +++ b/Scripts/Spells/Chivalry/SacredJourney.cs @@ -180,6 +180,10 @@ namespace Server.Spells.Chivalry from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object. } } + + protected override void OnNonlocalTarget( Mobile from, object o ) + { + } protected override void OnTargetFinish( Mobile from ) { diff --git a/Scripts/Spells/Fourth/Recall.cs b/Scripts/Spells/Fourth/Recall.cs index 24df44f3b..96e591f06 100644 --- a/Scripts/Spells/Fourth/Recall.cs +++ b/Scripts/Spells/Fourth/Recall.cs @@ -187,6 +187,10 @@ namespace Server.Spells.Fourth from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object. } } + + protected override void OnNonlocalTarget( Mobile from, object o ) + { + } protected override void OnTargetFinish( Mobile from ) { diff --git a/Scripts/Spells/Seventh/GateTravel.cs b/Scripts/Spells/Seventh/GateTravel.cs index e310a6edd..71ce5872d 100644 --- a/Scripts/Spells/Seventh/GateTravel.cs +++ b/Scripts/Spells/Seventh/GateTravel.cs @@ -238,6 +238,10 @@ namespace Server.Spells.Seventh from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object. } } + + protected override void OnNonlocalTarget( Mobile from, object o ) + { + } protected override void OnTargetFinish( Mobile from ) {