Plant gump issues

http://jira.runuo.com/browse/RUNUO-12

House decay stages should pass at random intervals
http://jira.runuo.com/browse/RUNUO-113

Nature's Fury cast issues
http://jira.runuo.com/browse/RUNUO-114

Animal Form inaccuracies and issue with Talisman of the Fey
http://jira.runuo.com/browse/RUNUO-115

BaseWaterContainer fill messages and behavior
http://jira.runuo.com/browse/RUNUO-116

AdminGump filter for accounts owning houses
http://jira.runuo.com/browse/RUNUO-118

Seeds should be stackable
http://jira.runuo.com/browse/RUNUO-119

Typo in case of a jailbreak
http://jira.runuo.com/browse/RUNUO-120

Prevent creation of invalid account names
http://jira.runuo.com/browse/RUNUO-121
This commit is contained in:
eos 2012-01-01 03:34:02 +00:00
parent d2f79e93ea
commit 4cba2c8d56
18 changed files with 440 additions and 137 deletions

View file

@ -233,7 +233,7 @@ namespace Server.Engines.Help
}
else if ( from.Region.IsPartOf( typeof( Server.Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
from.SendLocalizedMessage( 1114345, "", 0x35 ); // You'll need a better jailbreak plan than that!
}
else if ( Factions.Sigil.ExistsOn( from ) )
{
@ -290,7 +290,7 @@ namespace Server.Engines.Help
{
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
from.SendLocalizedMessage( 1114345, "", 0x35 ); // You'll need a better jailbreak plan than that!
}
else if ( from.Region.IsPartOf( "Haven Island" ) )
{

View file

@ -44,19 +44,19 @@ namespace Server.Engines.Plants
AddPlusMinus( 196, 67, system.Water );
AddButton( 209, 91, 0xD4, 0xD4, 7, GumpButtonType.Reply, 0 ); // Poison potion
AddItem( 197, 91, 0xF0A );
AddItem( 201, 91, 0xF0A );
AddLevel( 196, 91, system.PoisonPotion );
AddButton( 209, 115, 0xD4, 0xD4, 8, GumpButtonType.Reply, 0 ); // Cure potion
AddItem( 192, 115, 0xF07 );
AddItem( 201, 115, 0xF07 );
AddLevel( 196, 115, system.CurePotion );
AddButton( 209, 139, 0xD4, 0xD4, 9, GumpButtonType.Reply, 0 ); // Heal potion
AddItem( 190, 139, 0xF0C );
AddItem( 201, 139, 0xF0C );
AddLevel( 196, 139, system.HealPotion );
AddButton( 209, 163, 0xD4, 0xD4, 10, GumpButtonType.Reply, 0 ); // Strength potion
AddItem( 193, 163, 0xF09 );
AddItem( 201, 163, 0xF09 );
AddLevel( 196, 163, system.StrengthPotion );
AddImage( 48, 47, 0xD2 );
@ -317,6 +317,8 @@ namespace Server.Engines.Plants
from.SendLocalizedMessage( 1060808, "#" + m_Plant.GetLocalizedPlantStatus().ToString() ); // Target the container you wish to use to water the ~1_val~.
}
from.SendGump( new MainPlantGump( m_Plant ) );
break;
}
case 7: // Poison potion

View file

@ -386,7 +386,7 @@ namespace Server.Engines.Plants
m_PlantHue = seed.PlantHue;
m_ShowType = seed.ShowType;
seed.Delete();
seed.Consume();
PlantStatus = PlantStatus.Seed;

View file

@ -25,6 +25,9 @@ namespace Server.Engines.Plants
{
if ( !m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant && from.InRange( m_Plant.GetWorldLocation(), 3 ) && m_Plant.IsUsableBy( from ) )
{
if ( from.HasGump( typeof( MainPlantGump ) ) )
from.CloseGump( typeof( MainPlantGump ) );
from.SendGump( new MainPlantGump( m_Plant ) );
}
}

View file

@ -1,4 +1,5 @@
using System;
using System.Text;
using Server;
using Server.Targeting;
@ -76,6 +77,7 @@ namespace Server.Engines.Plants
public Seed( PlantType plantType, PlantHue plantHue, bool showType ) : base( 0xDCF )
{
Weight = 1.0;
Stackable = Core.SA;
m_PlantType = plantType;
m_PlantHue = plantHue;
@ -90,7 +92,7 @@ namespace Server.Engines.Plants
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
public override void AddNameProperty( ObjectPropertyList list )
private int GetLabel( out string args )
{
PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );
@ -98,30 +100,50 @@ namespace Server.Engines.Plants
if ( title == 0 ) // Not a bonsai
title = hueInfo.Name;
int label;
if ( Amount == 1 )
label = m_ShowType ? 1061917 : 1060838; // ~1_COLOR~ ~2_TYPE~ seed : ~1_val~ seed
else
label = m_ShowType ? 1113492 : 1113490; // ~1_amount~ ~2_color~ ~3_type~ seeds : ~1_amount~ ~2_val~ seeds
if ( hueInfo.IsBright() )
++label;
StringBuilder ab = new StringBuilder();
if ( Amount != 1 )
{
ab.Append( Amount );
ab.Append( '\t' );
}
ab.Append( '#' );
ab.Append( title );
if ( m_ShowType )
{
PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
list.Add( hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", title.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
}
else
{
list.Add( hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", title.ToString() ) ); // [bright] ~1_val~ seed
ab.Append( "\t#" );
ab.Append( typeInfo.Name );
}
args = ab.ToString();
return label;
}
public override void OnSingleClick ( Mobile from )
public override void AddNameProperty( ObjectPropertyList list )
{
PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );
string args;
list.Add( GetLabel( out args ), args );
}
if ( m_ShowType )
{
PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
LabelTo( from, hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", hueInfo.Name.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
}
else
{
LabelTo( from, hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", hueInfo.Name.ToString() ) ); // [bright] ~1_val~ seed
}
public override void OnSingleClick( Mobile from )
{
string args;
LabelTo( from, GetLabel( out args ), args );
}
public override void OnDoubleClick( Mobile from )
@ -136,6 +158,31 @@ namespace Server.Engines.Plants
LabelTo( from, 1061916 ); // Choose a bowl of dirt to plant this seed in.
}
public override bool StackWith( Mobile from, Item dropped, bool playSound )
{
if ( dropped is Seed )
{
Seed other = (Seed)dropped;
if ( other.PlantType == m_PlantType && other.PlantHue == m_PlantHue && other.ShowType == m_ShowType )
return base.StackWith( from, dropped, playSound );
}
return false;
}
public override void OnAfterDuped( Item newItem )
{
Seed newSeed = newItem as Seed;
if ( newSeed == null )
return;
newSeed.PlantType = m_PlantType;
newSeed.PlantHue = m_PlantHue;
newSeed.ShowType = m_ShowType;
}
private class InternalTarget : Target
{
private Seed m_Seed;
@ -178,7 +225,7 @@ namespace Server.Engines.Plants
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) 1 ); // version
writer.Write( (int) m_PlantType );
writer.Write( (int) m_PlantHue );
@ -197,6 +244,9 @@ namespace Server.Engines.Plants
if ( Weight != 1.0 )
Weight = 1.0;
if ( version < 1 )
Stackable = Core.SA;
}
}
}

View file

@ -174,7 +174,7 @@ namespace Server.Engines.Quests
{
if ( m.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
m.SendLocalizedMessage( 1042632 ); // You'll need a better jailbreak plan then that!
m.SendLocalizedMessage( 1114345 ); // You'll need a better jailbreak plan than that!
}
else if ( m == m_Caster )
{