BOD book item counts corrected

http://www.uodemise.com/forum/showthread.php?t=121015

Discordance cool down timer
http://www.uodemise.com/forum/showthread.php?t=122146

Summoned Hoarde minions dont behave correctly
http://www.uodemise.com/forum/showthread.php?t=149555

Fame and karma rewards should be 30% higher in fel
http://www.uodemise.com/forum/showthread.php?t=146893

Incorrect skill requirement in tailoring
http://www.uodemise.com/forum/showthread.php?t=149095

Mined resources should stack
http://www.uodemise.com/forum/showthread.php?t=147055

Runebook behavior
http://www.uodemise.com/forum/showthread.php?t=146030

Correct allowed guild name length
http://www.uodemise.com/forum/showthread.php?t=148603

Corrections to wool/sheep
http://www.uodemise.com/forum/showthread.php?t=150988
This commit is contained in:
xavier 2010-09-19 14:41:01 +00:00
parent 4dbb400ce3
commit 4dec86b91d
15 changed files with 252 additions and 61 deletions

View file

@ -336,6 +336,13 @@ namespace Server.Engines.BulkOrders
m_From.SendLocalizedMessage(1045152); // The bulk order deed has been placed in your backpack.
m_Book.Entries.Remove(obj);
m_Book.InvalidateProperties();
if ( m_Book.Entries.Count / 5 < m_Book.ItemCount )
{
m_Book.ItemCount--;
m_Book.InvalidateItems();
}
if (m_Book.Entries.Count > 0)
{
m_Page = GetPageForIndex(index, sizeOfDroppedBod);

View file

@ -75,6 +75,12 @@ namespace Server.Engines.BulkOrders
pv.HoldGold += price;
m_From.AddToBackpack( item );
m_From.SendLocalizedMessage( 1045152 ); // The bulk order deed has been placed in your backpack.
if ( m_Book.Entries.Count / 5 < m_Book.ItemCount )
{
m_Book.ItemCount--;
m_Book.InvalidateItems();
}
if ( m_Book.Entries.Count > 0 )
m_From.SendGump( new BOBGump( m_From, m_Book, m_Page, null ) );

View file

@ -17,6 +17,7 @@ namespace Server.Engines.BulkOrders
private BOBFilter m_Filter;
private string m_BookName;
private SecureLevel m_Level;
private int m_ItemCount;
[CommandProperty( AccessLevel.GameMaster )]
public string BookName
@ -41,6 +42,12 @@ namespace Server.Engines.BulkOrders
{
get{ return m_Filter; }
}
public int ItemCount
{
get{ return m_ItemCount; }
set{ m_ItemCount = value; }
}
[Constructable]
public BulkOrderBook() : base( 0x2259 )
@ -94,44 +101,29 @@ namespace Server.Engines.BulkOrders
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is LargeBOD )
if ( dropped is LargeBOD || dropped is SmallBOD )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
return false;
}
else if ( !from.Backpack.CheckHold( from, dropped, true, true ) )
return false;
else if ( m_Entries.Count < 500 )
{
m_Entries.Add( new BOBLargeEntry( (LargeBOD)dropped ) );
InvalidateProperties();
from.PlaySound(0x42);
from.SendLocalizedMessage( 1062386 ); // Deed added to book.
if ( from is PlayerMobile )
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
dropped.Delete();
return true;
}
else
{
from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
return false;
}
}
else if ( dropped is SmallBOD )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
return false;
}
else if ( m_Entries.Count < 500 )
{
m_Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
if ( dropped is LargeBOD )
m_Entries.Add( new BOBLargeEntry( (LargeBOD)dropped ) );
else if ( dropped is SmallBOD ) // Sanity
m_Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
InvalidateProperties();
if ( m_Entries.Count / 5 > m_ItemCount )
{
m_ItemCount++;
InvalidateItems();
}
from.PlaySound(0x42);
from.SendLocalizedMessage( 1062386 ); // Deed added to book.
@ -140,6 +132,7 @@ namespace Server.Engines.BulkOrders
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
dropped.Delete();
return true;
}
else
@ -152,6 +145,38 @@ namespace Server.Engines.BulkOrders
from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
return false;
}
public override int GetTotal( TotalType type )
{
int total = base.GetTotal( type );
if ( type == TotalType.Items )
total = m_ItemCount;
return total;
}
public void InvalidateItems()
{
if ( RootParent is Mobile )
{
Mobile m = (Mobile) RootParent;
m.UpdateTotals();
InvalidateContainers( Parent );
}
}
public void InvalidateContainers( object parent )
{
if ( parent != null && parent is Container )
{
Container c = (Container)parent;
c.InvalidateProperties();
InvalidateContainers( c.Parent );
}
}
public BulkOrderBook( Serial serial ) : base( serial )
{
@ -161,7 +186,9 @@ namespace Server.Engines.BulkOrders
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
writer.Write( (int) 2 ); // version
writer.Write( (int) m_ItemCount );
writer.Write( (int) m_Level );
@ -200,6 +227,11 @@ namespace Server.Engines.BulkOrders
switch ( version )
{
case 2:
{
m_ItemCount = reader.ReadInt();
goto case 1;
}
case 1:
{
m_Level = (SecureLevel)reader.ReadInt();

View file

@ -32,6 +32,13 @@ namespace Server.Engines.Craft
if ( !(item is BaseArmor) && !(item is BaseWeapon) )
return EnhanceResult.BadItem;
if ( item is IArcaneEquip )
{
IArcaneEquip eq = (IArcaneEquip)item;
if ( eq.IsArcane )
return EnhanceResult.BadItem;
}
if ( CraftResources.IsStandard( resource ) )
return EnhanceResult.BadResource;

View file

@ -110,7 +110,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( SkullCap ), 1011375, 1025444, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
AddCraft( typeof( Bandana ), 1011375, 1025440, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
AddCraft( typeof( FloppyHat ), 1011375, 1025907, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
AddCraft( typeof( Cap ), 1011375, 1025909, -18.8, 6.2, typeof( Cloth ), 1044286, 11, 1044287 );
AddCraft( typeof( Cap ), 1011375, 1025909, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
AddCraft( typeof( WideBrimHat ), 1011375, 1025908, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
AddCraft( typeof( StrawHat ), 1011375, 1025911, 6.2, 31.2, typeof( Cloth ), 1044286, 10, 1044287 );
AddCraft( typeof( TallStrawHat ), 1011375, 1025910, 6.7, 31.7, typeof( Cloth ), 1044286, 13, 1044287 );

View file

@ -331,7 +331,8 @@ namespace Server.Gumps
m_Book.DropRune( from, e, index );
from.CloseGump( typeof( RunebookGump ) );
from.SendGump( new RunebookGump( from, m_Book ) );
if ( !Core.ML )
from.SendGump( new RunebookGump( from, m_Book ) );
}
else
{

View file

@ -24,6 +24,16 @@ namespace Server.Items
{
BaseClothing item = (BaseClothing)target;
if ( item is IArcaneEquip )
{
IArcaneEquip eq = (IArcaneEquip)item;
if ( eq.IsArcane )
{
from.SendLocalizedMessage( 1005019 ); // This bless deed is for Clothes only.
return;
}
}
if ( item.LootType == LootType.Blessed || item.BlessedFor == from || (Mobile.InsuranceEnabled && item.Insured) ) // Check if its already newbied (blessed)
{
from.SendLocalizedMessage( 1045113 ); // That item is already blessed

View file

@ -62,6 +62,15 @@ namespace Server.Items
if ( obj is IArcaneEquip && obj is Item )
{
Item item = (Item)obj;
CraftResource resource = CraftResource.None;
if( item is BaseClothing )
resource = ((BaseClothing)item).Resource;
else if( item is BaseArmor )
resource = ((BaseArmor)item).Resource;
else if( item is BaseWeapon ) // Sanity, weapons cannot recieve gems...
resource = ((BaseWeapon)item).Resource;
IArcaneEquip eq = (IArcaneEquip)obj;
if ( !item.IsChildOf( from.Backpack ) )
@ -69,6 +78,16 @@ namespace Server.Items
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
return;
}
else if ( item.LootType == LootType.Blessed )
{
from.SendMessage( "You can only use this on exceptionally crafted robes, thigh boots, cloaks, or leather gloves." );
return;
}
else if ( resource != CraftResource.None && resource != CraftResource.RegularLeather )
{
from.SendLocalizedMessage( 1049690 ); // Arcane gems can not be used on that type of leather.
return;
}
int charges = GetChargesFor( from );
@ -108,11 +127,21 @@ namespace Server.Items
if ( isExceptional )
{
if ( item is BaseClothing )
{
((BaseClothing)item).Quality = ClothingQuality.Regular;
((BaseClothing)item).Crafter = from;
}
else if ( item is BaseArmor )
{
((BaseArmor)item).Quality = ArmorQuality.Regular;
((BaseArmor)item).Crafter = from;
else if ( item is BaseWeapon )
((BaseArmor)item).PhysicalBonus = ((BaseArmor)item).FireBonus = ((BaseArmor)item).ColdBonus = ((BaseArmor)item).PoisonBonus = ((BaseArmor)item).EnergyBonus = 0; // Is there a method to remove bonuses?
}
else if ( item is BaseWeapon ) // Sanity, weapons cannot recieve gems...
{
((BaseWeapon)item).Quality = WeaponQuality.Regular;
((BaseWeapon)item).Crafter = from;
}
eq.CurArcaneCharges = eq.MaxArcaneCharges = charges;
@ -135,7 +164,7 @@ namespace Server.Items
}
else
{
from.SendMessage( "You cannot use the gem on that." );
from.SendMessage( "You can only use this on exceptionally crafted robes, thigh boots, cloaks, or leather gloves." );
}
}
@ -187,8 +216,6 @@ namespace Server.Items
return true;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

View file

@ -19,7 +19,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) 1 ); // version
writer.Write( (int) m_Resource );
}
@ -32,22 +32,27 @@ namespace Server.Items
switch ( version )
{
case 1:
case 0:
{
m_Resource = (CraftResource)reader.ReadInt();
break;
}
}
if ( version < 1 )
Stackable = Core.ML;
}
public override double DefaultWeight
{
get { return 10.0; }
get { return Core.ML ? 1.0 : 10.0; } // Pub 57
}
public BaseGranite( CraftResource resource ) : base( 0x1779 )
{
Hue = CraftResources.GetHue( resource );
Stackable = Core.ML;
m_Resource = resource;
}
@ -71,7 +76,6 @@ namespace Server.Items
else
list.Add( CraftResources.GetName( m_Resource ) );
}
Stackable = Core.ML;
}
}

View file

@ -102,7 +102,8 @@ namespace Server.Items
else
{
m_Wool.Consume();
wheel.BeginSpin( new SpinCallback( Wool.OnSpun ), from, m_Wool.Hue );
if ( m_Wool is TaintedWool ) wheel.BeginSpin( new SpinCallback( TaintedWool.OnSpun ), from, m_Wool.Hue );
else wheel.BeginSpin( new SpinCallback( Wool.OnSpun ), from, m_Wool.Hue );
}
}
else
@ -112,4 +113,46 @@ namespace Server.Items
}
}
}
public class TaintedWool : Wool
{
[Constructable]
public TaintedWool() : this( 1 )
{
}
[Constructable]
public TaintedWool( int amount ) : base( 0x101F )
{
Stackable = true;
Weight = 4.0;
Amount = amount;
}
public TaintedWool( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue )
{
Item item = new DarkYarn( 1 );
item.Hue = hue;
from.AddToBackpack( item );
from.SendLocalizedMessage( 1010574 ); // You put a ball of yarn in your backpack.
}
}
}

View file

@ -697,7 +697,7 @@ namespace Server.Guilds
public static readonly int RegistrationFee = 25000;
public static readonly int AbbrevLimit = 4;
public static readonly int NameLimit = 20;
public static readonly int NameLimit = 40;
public static readonly int MajorityPercentage = 66;
public static readonly TimeSpan InactiveTime = TimeSpan.FromDays( 30 );

View file

@ -1365,7 +1365,7 @@ namespace Server.Mobiles
if ( wool != 0 )
{
corpse.AddCarvedItem( new Wool( wool ), from );
corpse.AddCarvedItem( new TaintedWool( wool ), from );
from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
}
@ -4444,6 +4444,11 @@ namespace Server.Mobiles
{
int totalFame = Fame / 100;
int totalKarma = -Karma / 100;
if (Map == Map.Felucca)
{
totalFame += ((totalFame/10)*3);
totalKarma += ((totalKarma/10)*3);
}
List<DamageStore> list = GetLootingRights( this.DamageEntries, this.HitsMax );
List<Mobile> titles = new List<Mobile>();

View file

@ -28,7 +28,7 @@ namespace Server.Mobiles
if ( master == null )
return;
if ( master.Deleted || master.Map != this.Map || !InRange( master.Location, 20 ) )
if ( master.Deleted )
{
DropPackContents();
EndRelease( null );

View file

@ -304,8 +304,7 @@ namespace Server.Multis
}
if ( m_LockDowns != null )
fromLockdowns += m_LockDowns.Count;
fromLockdowns += GetLockdowns();
if ( !NewVendorSystem )
{
@ -839,8 +838,7 @@ namespace Server.Multis
{
int v = 0;
if ( m_LockDowns != null )
v += m_LockDowns.Count;
v += GetLockdowns();
if ( m_Secures != null )
v += m_Secures.Count;
@ -2773,14 +2771,36 @@ namespace Server.Multis
public ArrayList Bans{ get{ return m_Bans; } set{ m_Bans = value; } }
public ArrayList Doors{ get{ return m_Doors; } set{ m_Doors = value; } }
public int GetLockdowns()
{
int count = 0;
if ( m_LockDowns != null )
{
for ( int i = 0; i < m_LockDowns.Count; ++i )
{
if ( m_LockDowns[i] is Item )
{
Item item = (Item)m_LockDowns[i];
if ( !(item is Container) )
count += item.TotalItems;
}
count++;
}
}
return count;
}
public int LockDownCount
{
get
{
int count = 0;
if ( m_LockDowns != null )
count += m_LockDowns.Count;
count += GetLockdowns();
if ( m_Secures != null )
{

View file

@ -27,6 +27,7 @@ namespace Server.SkillHandlers
from.RevealingAction();
from.SendLocalizedMessage( 1049541 ); // Choose the target for your song of discordance.
from.Target = new DiscordanceTarget( from, instrument );
from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
}
private class DiscordanceInfo
@ -34,15 +35,17 @@ namespace Server.SkillHandlers
public Mobile m_From;
public Mobile m_Creature;
public DateTime m_EndTime;
public bool m_Ending;
public Timer m_Timer;
public int m_Effect;
public ArrayList m_Mods;
public DiscordanceInfo( Mobile from, Mobile creature, TimeSpan duration, int effect, ArrayList mods )
public DiscordanceInfo( Mobile from, Mobile creature, int effect, ArrayList mods )
{
m_From = from;
m_Creature = creature;
m_EndTime = DateTime.Now + duration;
m_EndTime = DateTime.Now;
m_Ending = false;
m_Effect = effect;
m_Mods = mods;
@ -93,13 +96,26 @@ namespace Server.SkillHandlers
return true;
}
private static void ProcessDiscordance( object state )
private static void ProcessDiscordance( DiscordanceInfo info )
{
DiscordanceInfo info = (DiscordanceInfo)state;
Mobile from = info.m_From;
Mobile targ = info.m_Creature;
bool ends = false;
if ( DateTime.Now >= info.m_EndTime || targ.Deleted || from.Map != targ.Map || targ.GetDistanceToSqrt( from ) > 16 )
// According to uoherald bard must remain alive, visible, and
// within range of the target or the effect ends in 15 seconds.
if ( !targ.Alive || targ.Deleted || !from.Alive || from.Hidden )
ends = true;
else
{
int range = (int) targ.GetDistanceToSqrt( from );
int maxRange = BaseInstrument.GetBardRange( from, SkillName.Discordance );
if ( from.Map != targ.Map || range > maxRange )
ends = true;
}
if ( ends && info.m_Ending && info.m_EndTime < DateTime.Now )
{
if ( info.m_Timer != null )
info.m_Timer.Stop();
@ -109,6 +125,17 @@ namespace Server.SkillHandlers
}
else
{
if ( ends && !info.m_Ending )
{
info.m_Ending = true;
info.m_EndTime = DateTime.Now + TimeSpan.FromSeconds( 15 );
}
else if ( !ends )
{
info.m_Ending = false;
info.m_EndTime = DateTime.Now;
}
targ.FixedEffect( 0x376A, 1, 32 );
}
}
@ -125,6 +152,7 @@ namespace Server.SkillHandlers
protected override void OnTarget( Mobile from, object target )
{
from.RevealingAction();
from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 1.0 );
if ( !m_Instrument.IsChildOf( from.Backpack ) )
{
@ -138,13 +166,12 @@ namespace Server.SkillHandlers
{
from.SendLocalizedMessage( 1049535 ); // A song of discord would have no effect on that.
}
else if ( m_Table.Contains( targ ) ) //Already discorded
{
from.SendLocalizedMessage( 1049537 );// Your target is already in discord.
}
else if ( m_Table.Contains( targ ) ) //Already discorded
{
from.SendLocalizedMessage( 1049537 );// Your target is already in discord.
}
else if ( !targ.Player )
{
TimeSpan len = TimeSpan.FromSeconds( from.Skills[SkillName.Discordance].Value * 2 );
double diff = m_Instrument.GetDifficultyFor( targ ) - 10.0;
double music = from.Skills[SkillName.Musicianship].Value;
@ -209,8 +236,8 @@ namespace Server.SkillHandlers
}
}
DiscordanceInfo info = new DiscordanceInfo( from, targ, len, Math.Abs( effect ), mods );
info.m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1.25 ), new TimerStateCallback( ProcessDiscordance ), info );
DiscordanceInfo info = new DiscordanceInfo( from, targ, Math.Abs( effect ), mods );
info.m_Timer = Timer.DelayCall<DiscordanceInfo>( TimeSpan.Zero, TimeSpan.FromSeconds( 1.25 ), new TimerStateCallback<DiscordanceInfo>( ProcessDiscordance ), info );
m_Table[targ] = info;
}
@ -220,6 +247,8 @@ namespace Server.SkillHandlers
m_Instrument.PlayInstrumentBadly( from );
m_Instrument.ConsumeUse( from );
}
from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 12.0 );
}
else
{