This commit is contained in:
commit
47711d616e
2644 changed files with 479454 additions and 0 deletions
|
|
@ -0,0 +1,134 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x13E4, 0x13E3 )]
|
||||
public class AncientSmithyHammer : BaseTool
|
||||
{
|
||||
private int m_Bonus;
|
||||
private SkillMod m_SkillMod;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Bonus
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bonus;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if ( m_Bonus == 0 )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if ( m_SkillMod == null && Parent is Mobile )
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Blacksmith, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
else if ( m_SkillMod != null )
|
||||
{
|
||||
m_SkillMod.Value = m_Bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAdded( object parent )
|
||||
{
|
||||
base.OnAdded( parent );
|
||||
|
||||
if ( m_Bonus != 0 && parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Blacksmith, true, m_Bonus );
|
||||
((Mobile)parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved( object parent )
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem{ get{ return DefBlacksmithy.CraftSystem; } }
|
||||
public override int LabelNumber{ get{ return 1045127; } } // ancient smithy hammer
|
||||
|
||||
[Constructable]
|
||||
public AncientSmithyHammer( int bonus ) : this( bonus, 600 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSmithyHammer( int bonus, int uses ) : base( uses, 0x13E4 )
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = 0x482;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Bonus != 0 )
|
||||
list.Add( 1060451, "#1042354\t{0}", m_Bonus.ToString() ); // ~1_skillname~ +~2_val~
|
||||
}
|
||||
|
||||
public AncientSmithyHammer( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Bonus );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Bonus = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Bonus != 0 && Parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Blacksmith, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
|
||||
if ( Hue == 0 )
|
||||
Hue = 0x482;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Anvil, Flipable( 0xFAF, 0xFB0 )]
|
||||
public class ColoredAnvil : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ColoredAnvil() : this( CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Valorite ) ) )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ColoredAnvil( int hue ) : base( 0xFAF )
|
||||
{
|
||||
Hue = hue;
|
||||
Weight = 20;
|
||||
}
|
||||
|
||||
public ColoredAnvil( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x13c6, 0x13ce )]
|
||||
public class LeatherGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
public override int BasePhysicalResistance{ get{ return 2; } }
|
||||
public override int BaseFireResistance{ get{ return 4; } }
|
||||
public override int BaseColdResistance{ get{ return 3; } }
|
||||
public override int BasePoisonResistance{ get{ return 3; } }
|
||||
public override int BaseEnergyResistance{ get{ return 3; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 30; } }
|
||||
public override int InitMaxHits{ get{ return 40; } }
|
||||
|
||||
public override int AosStrReq{ get{ return 20; } }
|
||||
public override int OldStrReq{ get{ return 10; } }
|
||||
|
||||
public override int ArmorBase{ get{ return 13; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Leather; } }
|
||||
public override CraftResource DefaultResource{ get{ return CraftResource.RegularLeather; } }
|
||||
|
||||
public override ArmorMeditationAllowance DefMedAllowance{ get{ return ArmorMeditationAllowance.All; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1045122; } } // leather blacksmith gloves of mining
|
||||
|
||||
[Constructable]
|
||||
public LeatherGlovesOfMining( int bonus ) : base( bonus, 0x13C6 )
|
||||
{
|
||||
Weight = 1;
|
||||
}
|
||||
|
||||
public LeatherGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x13d5, 0x13dd )]
|
||||
public class StuddedGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
public override int BasePhysicalResistance{ get{ return 2; } }
|
||||
public override int BaseFireResistance{ get{ return 4; } }
|
||||
public override int BaseColdResistance{ get{ return 3; } }
|
||||
public override int BasePoisonResistance{ get{ return 3; } }
|
||||
public override int BaseEnergyResistance{ get{ return 4; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 35; } }
|
||||
public override int InitMaxHits{ get{ return 45; } }
|
||||
|
||||
public override int AosStrReq{ get{ return 25; } }
|
||||
public override int OldStrReq{ get{ return 25; } }
|
||||
|
||||
public override int ArmorBase{ get{ return 16; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Studded; } }
|
||||
public override CraftResource DefaultResource{ get{ return CraftResource.RegularLeather; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1045123; } } // studded leather blacksmith gloves of mining
|
||||
|
||||
[Constructable]
|
||||
public StuddedGlovesOfMining( int bonus ) : base( bonus, 0x13D5 )
|
||||
{
|
||||
Weight = 2;
|
||||
}
|
||||
|
||||
public StuddedGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x13eb, 0x13f2 )]
|
||||
public class RingmailGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
public override int BasePhysicalResistance{ get{ return 3; } }
|
||||
public override int BaseFireResistance{ get{ return 3; } }
|
||||
public override int BaseColdResistance{ get{ return 1; } }
|
||||
public override int BasePoisonResistance{ get{ return 5; } }
|
||||
public override int BaseEnergyResistance{ get{ return 3; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 40; } }
|
||||
public override int InitMaxHits{ get{ return 50; } }
|
||||
|
||||
public override int AosStrReq{ get{ return 40; } }
|
||||
public override int OldStrReq{ get{ return 20; } }
|
||||
|
||||
public override int OldDexBonus{ get{ return -1; } }
|
||||
|
||||
public override int ArmorBase{ get{ return 22; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Ringmail; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1045124; } } // ringmail blacksmith gloves of mining
|
||||
|
||||
[Constructable]
|
||||
public RingmailGlovesOfMining( int bonus ) : base( bonus, 0x13EB )
|
||||
{
|
||||
Weight = 1;
|
||||
}
|
||||
|
||||
public RingmailGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseGlovesOfMining : BaseArmor
|
||||
{
|
||||
private int m_Bonus;
|
||||
private SkillMod m_SkillMod;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Bonus
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bonus;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if ( m_Bonus == 0 )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if ( m_SkillMod == null && Parent is Mobile )
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Mining, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
else if ( m_SkillMod != null )
|
||||
{
|
||||
m_SkillMod.Value = m_Bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAdded( object parent )
|
||||
{
|
||||
base.OnAdded( parent );
|
||||
|
||||
if ( m_Bonus != 0 && parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Mining, true, m_Bonus );
|
||||
((Mobile)parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved( object parent )
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
public BaseGlovesOfMining( int bonus, int itemID ) : base( itemID )
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
|
||||
this.Hue = CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Valorite ) );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Bonus != 0 )
|
||||
list.Add( 1062005, m_Bonus.ToString() ); // mining bonus +~1_val~
|
||||
}
|
||||
|
||||
public BaseGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Bonus );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Bonus = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Bonus != 0 && Parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Mining, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowderOfTemperament : Item, IUsesRemaining
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining{ get{ return true; } set{} }
|
||||
|
||||
public override int LabelNumber{ get{ return 1049082; } } // powder of temperament
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTemperament() : this( 10 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTemperament( int charges ) : base( 4102 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 2419;
|
||||
UsesRemaining = charges;
|
||||
}
|
||||
|
||||
public PowderOfTemperament( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public virtual void DisplayDurabilityTo( Mobile m )
|
||||
{
|
||||
LabelToAffix( m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString() ); // Durability
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
DisplayDurabilityTo( from );
|
||||
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
from.Target = new InternalTarget( this );
|
||||
else
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PowderOfTemperament m_Powder;
|
||||
|
||||
public InternalTarget( PowderOfTemperament powder ) : base( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_Powder = powder;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Powder.Deleted || m_Powder.UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049086 ); // You have used up your powder of temperament.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( targeted is BaseArmor /*&& (DefBlacksmithy.CraftSystem.CraftItems.SearchForSubclass( targeted.GetType() ) != null)*/ )
|
||||
{
|
||||
BaseArmor ar = (BaseArmor)targeted;
|
||||
|
||||
if ( ar.IsChildOf( from.Backpack ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = ar.MaxHitPoints;
|
||||
int origCurHP = ar.HitPoints;
|
||||
|
||||
int initMaxHP = Core.AOS ? 255 : ar.InitMaxHits;
|
||||
|
||||
ar.UnscaleDurability();
|
||||
|
||||
if ( ar.MaxHitPoints < initMaxHP )
|
||||
{
|
||||
int bonus = initMaxHP - ar.MaxHitPoints;
|
||||
|
||||
if ( bonus > 10 )
|
||||
bonus = 10;
|
||||
|
||||
ar.MaxHitPoints += bonus;
|
||||
ar.HitPoints += bonus;
|
||||
|
||||
ar.ScaleDurability();
|
||||
|
||||
if ( ar.MaxHitPoints > 255 ) ar.MaxHitPoints = 255;
|
||||
if ( ar.HitPoints > 255 ) ar.HitPoints = 255;
|
||||
|
||||
if ( ar.MaxHitPoints > origMaxHP )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049084 ); // You successfully use the powder on the item.
|
||||
|
||||
--m_Powder.UsesRemaining;
|
||||
|
||||
if ( m_Powder.UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049086 ); // You have used up your powder of temperament.
|
||||
m_Powder.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ar.MaxHitPoints = origMaxHP;
|
||||
ar.HitPoints = origCurHP;
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
ar.ScaleDurability();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
else if ( targeted is BaseWeapon /*&& (DefBlacksmithy.CraftSystem.CraftItems.SearchForSubclass( targeted.GetType() ) != null)*/ )
|
||||
{
|
||||
BaseWeapon wep = (BaseWeapon)targeted;
|
||||
|
||||
if ( wep.IsChildOf( from.Backpack ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = wep.MaxHitPoints;
|
||||
int origCurHP = wep.HitPoints;
|
||||
|
||||
int initMaxHP = Core.AOS ? 255 : wep.InitMaxHits;
|
||||
|
||||
wep.UnscaleDurability();
|
||||
|
||||
if ( wep.MaxHitPoints < initMaxHP )
|
||||
{
|
||||
int bonus = initMaxHP - wep.MaxHitPoints;
|
||||
|
||||
if ( bonus > 10 )
|
||||
bonus = 10;
|
||||
|
||||
wep.MaxHitPoints += bonus;
|
||||
wep.HitPoints += bonus;
|
||||
|
||||
wep.ScaleDurability();
|
||||
|
||||
if ( wep.MaxHitPoints > 255 ) wep.MaxHitPoints = 255;
|
||||
if ( wep.HitPoints > 255 ) wep.HitPoints = 255;
|
||||
|
||||
if ( wep.MaxHitPoints > origMaxHP )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049084 ); // You successfully use the powder on the item.
|
||||
|
||||
--m_Powder.UsesRemaining;
|
||||
|
||||
if ( m_Powder.UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049086 ); // You have used up your powder of temperament.
|
||||
m_Powder.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wep.MaxHitPoints = origMaxHP;
|
||||
wep.HitPoints = origCurHP;
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
wep.ScaleDurability();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
else if ( targeted is BaseClothing /*&& (DefBlacksmithy.CraftSystem.CraftItems.SearchForSubclass( targeted.GetType() ) != null)*/ )
|
||||
{
|
||||
BaseClothing clothing = (BaseClothing)targeted;
|
||||
|
||||
if ( clothing.IsChildOf( from.Backpack ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = clothing.MaxHitPoints;
|
||||
int origCurHP = clothing.HitPoints;
|
||||
|
||||
int initMaxHP = Core.AOS ? 255 : clothing.InitMaxHits;
|
||||
|
||||
if ( clothing.MaxHitPoints < initMaxHP )
|
||||
{
|
||||
int bonus = initMaxHP - clothing.MaxHitPoints;
|
||||
|
||||
if ( bonus > 10 )
|
||||
bonus = 10;
|
||||
|
||||
clothing.MaxHitPoints += bonus;
|
||||
clothing.HitPoints += bonus;
|
||||
|
||||
if ( clothing.MaxHitPoints > 255 ) clothing.MaxHitPoints = 255;
|
||||
if ( clothing.HitPoints > 255 ) clothing.HitPoints = 255;
|
||||
|
||||
if ( clothing.MaxHitPoints > origMaxHP )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049084 ); // You successfully use the powder on the item.
|
||||
|
||||
--m_Powder.UsesRemaining;
|
||||
|
||||
if ( m_Powder.UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049086 ); // You have used up your powder of temperament.
|
||||
m_Powder.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clothing.MaxHitPoints = origMaxHP;
|
||||
clothing.HitPoints = origCurHP;
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
132
Scripts/Items/Special/Gifts/HearthOfHomeFire.cs
Normal file
132
Scripts/Items/Special/Gifts/HearthOfHomeFire.cs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HearthOfHomeFire : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed{ get{ return new HearthOfHomeFireDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public HearthOfHomeFire( bool east )
|
||||
{
|
||||
if ( east )
|
||||
{
|
||||
AddLightComponent( new AddonComponent( 0x2352 ), 0, 0, 0 );
|
||||
AddLightComponent( new AddonComponent( 0x2358 ), 0, -1, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddLightComponent( new AddonComponent( 0x2360 ), 0, 0, 0 );
|
||||
AddLightComponent( new AddonComponent( 0x2366 ), -1, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
private void AddLightComponent( AddonComponent component, int x, int y, int z )
|
||||
{
|
||||
component.Light = LightType.Circle150;
|
||||
|
||||
AddComponent( component, x, y, z );
|
||||
}
|
||||
|
||||
public HearthOfHomeFire( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HearthOfHomeFireDeed : BaseAddonDeed
|
||||
{
|
||||
private bool m_East;
|
||||
|
||||
public override BaseAddon Addon{ get{ return new HearthOfHomeFire( m_East ); } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1062919; } } // Hearth of the Home Fire
|
||||
|
||||
[Constructable]
|
||||
public HearthOfHomeFireDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
private void SendTarget( Mobile m )
|
||||
{
|
||||
base.OnDoubleClick( m );
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private HearthOfHomeFireDeed m_Deed;
|
||||
|
||||
public InternalGump( HearthOfHomeFireDeed deed ) : base( 150, 50 )
|
||||
{
|
||||
m_Deed = deed;
|
||||
|
||||
AddBackground( 0, 0, 350, 250, 0xA28 );
|
||||
|
||||
AddItem( 90, 52, 0x2367 );
|
||||
AddItem( 112, 35, 0x2360 );
|
||||
AddButton( 70, 35, 0x868, 0x869, 1, GumpButtonType.Reply, 0 ); // South
|
||||
|
||||
AddItem( 220, 35, 0x2352 );
|
||||
AddItem( 242, 52, 0x2358 );
|
||||
AddButton( 185, 35, 0x868, 0x869, 2, GumpButtonType.Reply, 0 ); // East
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Deed.Deleted || info.ButtonID == 0 )
|
||||
return;
|
||||
|
||||
m_Deed.m_East = (info.ButtonID != 1);
|
||||
m_Deed.SendTarget( sender.Mobile );
|
||||
}
|
||||
}
|
||||
|
||||
public HearthOfHomeFireDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Special/Gifts/HolySword.cs
Normal file
45
Scripts/Items/Special/Gifts/HolySword.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HolySword : Longsword
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1062921; } } // The Holy Sword
|
||||
|
||||
public override int InitMinHits{ get{ return 255; } }
|
||||
public override int InitMaxHits{ get{ return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public HolySword()
|
||||
{
|
||||
Hue = 0x482;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Slayer = SlayerName.Silver;
|
||||
|
||||
Attributes.WeaponDamage = 40;
|
||||
WeaponAttributes.SelfRepair = 10;
|
||||
WeaponAttributes.LowerStatReq = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public HolySword( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Special/Gifts/LeggingsOfEmbers.cs
Normal file
48
Scripts/Items/Special/Gifts/LeggingsOfEmbers.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LeggingsOfEmbers : PlateLegs
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1062911; } } // Royal Leggings of Embers
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 15; } }
|
||||
public override int BaseFireResistance{ get{ return 25; } }
|
||||
public override int BaseColdResistance{ get{ return 0; } }
|
||||
public override int BasePoisonResistance{ get{ return 15; } }
|
||||
public override int BaseEnergyResistance{ get{ return 15; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 255; } }
|
||||
public override int InitMaxHits{ get{ return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public LeggingsOfEmbers()
|
||||
{
|
||||
Hue = 0x2C;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
ArmorAttributes.SelfRepair = 10;
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
ArmorAttributes.LowerStatReq = 100;
|
||||
}
|
||||
|
||||
public LeggingsOfEmbers( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
223
Scripts/Items/Special/Gifts/RoseOfTrinsic.cs
Normal file
223
Scripts/Items/Special/Gifts/RoseOfTrinsic.cs
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x234C, 0x234D )]
|
||||
public class RoseOfTrinsic : Item, ISecurable
|
||||
{
|
||||
private static readonly TimeSpan m_SpawnTime = TimeSpan.FromHours( 4.0 );
|
||||
|
||||
private int m_Petals;
|
||||
private DateTime m_NextSpawnTime;
|
||||
private SpawnTimer m_SpawnTimer;
|
||||
|
||||
private SecureLevel m_Level;
|
||||
|
||||
public override int LabelNumber{ get{ return 1062913; } } // Rose of Trinsic
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get{ return m_Level; }
|
||||
set{ m_Level = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Petals
|
||||
{
|
||||
get{ return m_Petals; }
|
||||
set
|
||||
{
|
||||
if ( value >= 10 )
|
||||
{
|
||||
m_Petals = 10;
|
||||
|
||||
StopSpawnTimer();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( value <= 0 )
|
||||
m_Petals = 0;
|
||||
else
|
||||
m_Petals = value;
|
||||
|
||||
StartSpawnTimer( m_SpawnTime );
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RoseOfTrinsic() : base( 0x234D )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_Petals = 0;
|
||||
StartSpawnTimer( TimeSpan.FromMinutes( 1.0 ) );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( 1062925, Petals.ToString() ); // Petals: ~1_COUNT~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
SetSecureLevelEntry.AddTo( from, this, list );
|
||||
}
|
||||
|
||||
private void StartSpawnTimer( TimeSpan delay )
|
||||
{
|
||||
StopSpawnTimer();
|
||||
|
||||
m_SpawnTimer = new SpawnTimer( this, delay );
|
||||
m_SpawnTimer.Start();
|
||||
|
||||
m_NextSpawnTime = DateTime.Now + delay;
|
||||
}
|
||||
|
||||
private void StopSpawnTimer()
|
||||
{
|
||||
if ( m_SpawnTimer != null )
|
||||
{
|
||||
m_SpawnTimer.Stop();
|
||||
m_SpawnTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class SpawnTimer : Timer
|
||||
{
|
||||
private RoseOfTrinsic m_Rose;
|
||||
|
||||
public SpawnTimer( RoseOfTrinsic rose, TimeSpan delay ) : base( delay )
|
||||
{
|
||||
m_Rose = rose;
|
||||
|
||||
Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_Rose.Deleted )
|
||||
return;
|
||||
|
||||
m_Rose.m_SpawnTimer = null;
|
||||
m_Rose.Petals++;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
else if ( Petals > 0 )
|
||||
{
|
||||
from.AddToBackpack( new RoseOfTrinsicPetal( Petals ) );
|
||||
Petals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public RoseOfTrinsic( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Petals );
|
||||
writer.WriteDeltaTime( (DateTime) m_NextSpawnTime );
|
||||
writer.WriteEncodedInt( (int) m_Level );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Petals = reader.ReadEncodedInt();
|
||||
m_NextSpawnTime = reader.ReadDeltaTime();
|
||||
m_Level = (SecureLevel) reader.ReadEncodedInt();
|
||||
|
||||
if ( m_Petals < 10 )
|
||||
StartSpawnTimer( m_NextSpawnTime - DateTime.Now );
|
||||
}
|
||||
}
|
||||
|
||||
public class RoseOfTrinsicPetal : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1062926; } } // Petal of the Rose of Trinsic
|
||||
|
||||
[Constructable]
|
||||
public RoseOfTrinsicPetal() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RoseOfTrinsicPetal( int amount ) : base( 0x1021 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
|
||||
Weight = 1.0;
|
||||
Hue = 0xE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if ( from.GetStatMod( "RoseOfTrinsicPetal" ) != null )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062927 ); // You have eaten one of these recently and eating another would provide no benefit.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound( 0x1EE );
|
||||
from.AddStatMod( new StatMod( StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes( 5.0 ) ) );
|
||||
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
|
||||
public RoseOfTrinsicPetal( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/Items/Special/Gifts/SamuraiHelm.cs
Normal file
52
Scripts/Items/Special/Gifts/SamuraiHelm.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x236C, 0x236D )]
|
||||
public class SamuraiHelm : BaseArmor
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1062923; } } // Ancient Samurai Helm
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 15; } }
|
||||
public override int BaseFireResistance{ get{ return 10; } }
|
||||
public override int BaseColdResistance{ get{ return 10; } }
|
||||
public override int BasePoisonResistance{ get{ return 15; } }
|
||||
public override int BaseEnergyResistance{ get{ return 10; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 255; } }
|
||||
public override int InitMaxHits{ get{ return 255; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }
|
||||
|
||||
[Constructable]
|
||||
public SamuraiHelm() : base( 0x236C )
|
||||
{
|
||||
Weight = 5.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Attributes.DefendChance = 15;
|
||||
ArmorAttributes.SelfRepair = 10;
|
||||
ArmorAttributes.LowerStatReq = 100;
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
}
|
||||
|
||||
public SamuraiHelm( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/Special/Gifts/ShaminoCrossbow.cs
Normal file
43
Scripts/Items/Special/Gifts/ShaminoCrossbow.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ShaminoCrossbow : RepeatingCrossbow
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1062915; } } // Shamino’s Best Crossbow
|
||||
|
||||
public override int InitMinHits{ get{ return 255; } }
|
||||
public override int InitMaxHits{ get{ return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public ShaminoCrossbow()
|
||||
{
|
||||
Hue = 0x504;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Attributes.AttackChance = 15;
|
||||
Attributes.WeaponDamage = 40;
|
||||
WeaponAttributes.SelfRepair = 10;
|
||||
WeaponAttributes.LowerStatReq = 100;
|
||||
}
|
||||
|
||||
public ShaminoCrossbow( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
83
Scripts/Items/Special/Gifts/TapestryOfSosaria.cs
Normal file
83
Scripts/Items/Special/Gifts/TapestryOfSosaria.cs
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x234E, 0x234F )]
|
||||
public class TapestryOfSosaria : Item, ISecurable
|
||||
{
|
||||
private SecureLevel m_Level;
|
||||
|
||||
public override int LabelNumber{ get{ return 1062917; } } // The Tapestry of Sosaria
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get{ return m_Level; }
|
||||
set{ m_Level = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public TapestryOfSosaria() : base( 0x234E )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
SetSecureLevelEntry.AddTo( from, this, list );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump() );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public InternalGump() : base( 50, 50 )
|
||||
{
|
||||
AddImage( 0, 0, 0x2C95 );
|
||||
}
|
||||
}
|
||||
|
||||
public TapestryOfSosaria( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Level );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Level = (SecureLevel) reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
281
Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs
Normal file
281
Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum HolidayTreeType
|
||||
{
|
||||
Classic,
|
||||
Modern
|
||||
}
|
||||
|
||||
public class HolidayTree : Item
|
||||
{
|
||||
private ArrayList m_Components;
|
||||
private Mobile m_Placer;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Placer
|
||||
{
|
||||
get{ return m_Placer; }
|
||||
set{ m_Placer = value; }
|
||||
}
|
||||
|
||||
private class Ornament : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041118; } } // a tree ornament
|
||||
|
||||
public Ornament( int itemID ) : base( itemID )
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Ornament( 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();
|
||||
}
|
||||
}
|
||||
|
||||
private class TreeTrunk : Item
|
||||
{
|
||||
private HolidayTree m_Tree;
|
||||
|
||||
public override int LabelNumber{ get{ return 1041117; } } // a tree for the holidays
|
||||
|
||||
public TreeTrunk( HolidayTree tree, int itemID ) : base( itemID )
|
||||
{
|
||||
Movable = false;
|
||||
MoveToWorld( tree.Location, tree.Map );
|
||||
|
||||
m_Tree = tree;
|
||||
}
|
||||
|
||||
public TreeTrunk( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Tree != null && !m_Tree.Deleted )
|
||||
m_Tree.OnDoubleClick( from );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Tree );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Tree = reader.ReadItem() as HolidayTree;
|
||||
|
||||
if ( m_Tree == null )
|
||||
Delete();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber{ get{ return 1041117; } } // a tree for the holidays
|
||||
|
||||
public HolidayTree( Mobile from, HolidayTreeType type, Point3D loc ) : base( 1 )
|
||||
{
|
||||
Movable = false;
|
||||
MoveToWorld( loc, from.Map );
|
||||
|
||||
m_Placer = from;
|
||||
m_Components = new ArrayList();
|
||||
|
||||
switch ( type )
|
||||
{
|
||||
case HolidayTreeType.Classic:
|
||||
{
|
||||
ItemID = 0xCD7;
|
||||
|
||||
AddItem( 0, 0, 0, new TreeTrunk( this, 0xCD6 ) );
|
||||
|
||||
AddOrnament( 0, 0, 2, 0xF22 );
|
||||
AddOrnament( 0, 0, 9, 0xF18 );
|
||||
AddOrnament( 0, 0, 15, 0xF20 );
|
||||
AddOrnament( 0, 0, 19, 0xF17 );
|
||||
AddOrnament( 0, 0, 20, 0xF24 );
|
||||
AddOrnament( 0, 0, 20, 0xF1F );
|
||||
AddOrnament( 0, 0, 20, 0xF19 );
|
||||
AddOrnament( 0, 0, 21, 0xF1B );
|
||||
AddOrnament( 0, 0, 28, 0xF2F );
|
||||
AddOrnament( 0, 0, 30, 0xF23 );
|
||||
AddOrnament( 0, 0, 32, 0xF2A );
|
||||
AddOrnament( 0, 0, 33, 0xF30 );
|
||||
AddOrnament( 0, 0, 34, 0xF29 );
|
||||
AddOrnament( 0, 1, 7, 0xF16 );
|
||||
AddOrnament( 0, 1, 7, 0xF1E );
|
||||
AddOrnament( 0, 1, 12, 0xF0F );
|
||||
AddOrnament( 0, 1, 13, 0xF13 );
|
||||
AddOrnament( 0, 1, 18, 0xF12 );
|
||||
AddOrnament( 0, 1, 19, 0xF15 );
|
||||
AddOrnament( 0, 1, 25, 0xF28 );
|
||||
AddOrnament( 0, 1, 29, 0xF1A );
|
||||
AddOrnament( 0, 1, 37, 0xF2B );
|
||||
AddOrnament( 1, 0, 13, 0xF10 );
|
||||
AddOrnament( 1, 0, 14, 0xF1C );
|
||||
AddOrnament( 1, 0, 16, 0xF14 );
|
||||
AddOrnament( 1, 0, 17, 0xF26 );
|
||||
AddOrnament( 1, 0, 22, 0xF27 );
|
||||
|
||||
break;
|
||||
}
|
||||
case HolidayTreeType.Modern:
|
||||
{
|
||||
ItemID = 0x1B7E;
|
||||
|
||||
AddOrnament( 0, 0, 2, 0xF2F );
|
||||
AddOrnament( 0, 0, 2, 0xF20 );
|
||||
AddOrnament( 0, 0, 2, 0xF22 );
|
||||
AddOrnament( 0, 0, 5, 0xF30 );
|
||||
AddOrnament( 0, 0, 5, 0xF15 );
|
||||
AddOrnament( 0, 0, 5, 0xF1F );
|
||||
AddOrnament( 0, 0, 5, 0xF2B );
|
||||
AddOrnament( 0, 0, 6, 0xF0F );
|
||||
AddOrnament( 0, 0, 7, 0xF1E );
|
||||
AddOrnament( 0, 0, 7, 0xF24 );
|
||||
AddOrnament( 0, 0, 8, 0xF29 );
|
||||
AddOrnament( 0, 0, 9, 0xF18 );
|
||||
AddOrnament( 0, 0, 14, 0xF1C );
|
||||
AddOrnament( 0, 0, 15, 0xF13 );
|
||||
AddOrnament( 0, 0, 15, 0xF20 );
|
||||
AddOrnament( 0, 0, 16, 0xF26 );
|
||||
AddOrnament( 0, 0, 17, 0xF12 );
|
||||
AddOrnament( 0, 0, 18, 0xF17 );
|
||||
AddOrnament( 0, 0, 20, 0xF1B );
|
||||
AddOrnament( 0, 0, 23, 0xF28 );
|
||||
AddOrnament( 0, 0, 25, 0xF18 );
|
||||
AddOrnament( 0, 0, 25, 0xF2A );
|
||||
AddOrnament( 0, 1, 7, 0xF16 );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
for ( int i = 0; i < m_Components.Count; ++i )
|
||||
((Item)m_Components[i]).Delete();
|
||||
}
|
||||
|
||||
private void AddOrnament( int x, int y, int z, int itemID )
|
||||
{
|
||||
AddItem( x + 1, y + 1, z + 11, new Ornament( itemID ) );
|
||||
}
|
||||
|
||||
private void AddItem( int x, int y, int z, Item item )
|
||||
{
|
||||
item.MoveToWorld( new Point3D( this.Location.X + x, this.Location.Y + y, this.Location.Z + z ), this.Map );
|
||||
|
||||
m_Components.Add( item );
|
||||
}
|
||||
|
||||
public HolidayTree( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_Placer );
|
||||
|
||||
writer.Write( (int) m_Components.Count );
|
||||
|
||||
for ( int i = 0; i < m_Components.Count; ++i )
|
||||
writer.Write( (Item)m_Components[i] );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Placer = reader.ReadMobile();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
int count = reader.ReadInt();
|
||||
|
||||
m_Components = new ArrayList( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
Item item = reader.ReadItem();
|
||||
|
||||
if ( item != null )
|
||||
m_Components.Add( item );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( this.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
if ( m_Placer == null || from == m_Placer || from.AccessLevel >= AccessLevel.GameMaster )
|
||||
{
|
||||
from.AddToBackpack( new HolidayTreeDeed() );
|
||||
|
||||
this.Delete();
|
||||
|
||||
from.SendLocalizedMessage( 503393 ); // A deed for the tree has been placed in your backpack.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 503396 ); // You cannot take this tree down.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Special/Holiday/GiftBox.cs
Normal file
41
Scripts/Items/Special/Holiday/GiftBox.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Furniture]
|
||||
[Flipable( 0x232A, 0x232B )]
|
||||
public class GiftBox : BaseContainer
|
||||
{
|
||||
[Constructable]
|
||||
public GiftBox() : this( Utility.RandomDyedHue() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GiftBox( int hue ) : base( Utility.Random( 0x232A, 2 ) )
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public GiftBox( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Scripts/Items/Special/Holiday/Poinsettias.cs
Normal file
62
Scripts/Items/Special/Holiday/Poinsettias.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RedPoinsettia : Item
|
||||
{
|
||||
[Constructable]
|
||||
public RedPoinsettia() : base( 0x2330 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public RedPoinsettia( 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 class WhitePoinsettia : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WhitePoinsettia() : base( 0x2331 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public WhitePoinsettia( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Scripts/Items/Special/Holiday/Snowflakes.cs
Normal file
62
Scripts/Items/Special/Holiday/Snowflakes.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlueSnowflake : Item
|
||||
{
|
||||
[Constructable]
|
||||
public BlueSnowflake() : base( 0x232E )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BlueSnowflake( 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 class WhiteSnowflake : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WhiteSnowflake() : base( 0x232F )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public WhiteSnowflake( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
159
Scripts/Items/Special/Holiday/Snowman.cs
Normal file
159
Scripts/Items/Special/Holiday/Snowman.cs
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x2328, 0x2329 )]
|
||||
public class Snowman : Item, IDyable
|
||||
{
|
||||
public static string GetRandomTitle()
|
||||
{
|
||||
// All hail OSI staff
|
||||
string[] titles = new string[]
|
||||
{
|
||||
/* 1 */ "Backflash",
|
||||
/* 2 */ "Carbon",
|
||||
/* 3 */ "Colbalistic",
|
||||
/* 4 */ "Comforl",
|
||||
/* 5 */ "Coppacchia",
|
||||
/* 6 */ "Cyrus",
|
||||
/* 7 */ "DannyB",
|
||||
/* 8 */ "DJSoul",
|
||||
/* 9 */ "DraconisRex",
|
||||
/* 10 */ "Earia",
|
||||
/* 11 */ "Foster",
|
||||
/* 12 */ "Gonzo",
|
||||
/* 13 */ "Haan",
|
||||
/* 14 */ "Halona",
|
||||
/* 15 */ "Hugo",
|
||||
/* 16 */ "Hyacinth",
|
||||
/* 17 */ "Imirian",
|
||||
/* 18 */ "Jinsol",
|
||||
/* 19 */ "Liciatia",
|
||||
/* 20 */ "Loewen",
|
||||
/* 21 */ "Loke",
|
||||
/* 22 */ "Magnus",
|
||||
/* 23 */ "Maleki",
|
||||
/* 24 */ "Morpheus",
|
||||
/* 25 */ "Obberron",
|
||||
/* 26 */ "Odee",
|
||||
/* 27 */ "Orbeus",
|
||||
/* 28 */ "Pax",
|
||||
/* 29 */ "Phields",
|
||||
/* 30 */ "Pigpen",
|
||||
/* 31 */ "Platinum",
|
||||
/* 32 */ "Polpol",
|
||||
/* 33 */ "Prume",
|
||||
/* 34 */ "Quinnly",
|
||||
/* 35 */ "Ragnarok",
|
||||
/* 36 */ "Rend",
|
||||
/* 37 */ "Roland",
|
||||
/* 38 */ "RyanM",
|
||||
/* 39 */ "Screach",
|
||||
/* 40 */ "Seraph",
|
||||
/* 41 */ "Silvani",
|
||||
/* 42 */ "Sherbear",
|
||||
/* 43 */ "SkyWalker",
|
||||
/* 44 */ "Snark",
|
||||
/* 45 */ "Sowl",
|
||||
/* 46 */ "Spada",
|
||||
/* 47 */ "Starblade",
|
||||
/* 48 */ "Tenacious",
|
||||
/* 49 */ "Tnez",
|
||||
/* 50 */ "Wasia",
|
||||
/* 51 */ "Zilo",
|
||||
/* 52 */ "Zippy",
|
||||
/* 53 */ "Zoer"
|
||||
};
|
||||
|
||||
if ( titles.Length > 0 )
|
||||
return titles[Utility.Random( titles.Length )];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private string m_Title;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string Title
|
||||
{
|
||||
get{ return m_Title; }
|
||||
set{ m_Title = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Snowman() : this( Utility.RandomDyedHue(), GetRandomTitle() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Snowman( int hue ) : this( hue, GetRandomTitle() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Snowman( string title ) : this( Utility.RandomDyedHue(), title )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Snowman( int hue, string title ) : base( Utility.Random( 0x2328, 2 ) )
|
||||
{
|
||||
Weight = 10.0;
|
||||
Hue = hue;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_Title = title;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Title != null )
|
||||
list.Add( 1062841, m_Title ); // ~1_NAME~ the Snowman
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public Snowman( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (string) m_Title );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Title = reader.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Utility.Intern( ref m_Title );
|
||||
}
|
||||
}
|
||||
}
|
||||
37
Scripts/Items/Special/Holiday/WinterGiftPackage2003.cs
Normal file
37
Scripts/Items/Special/Holiday/WinterGiftPackage2003.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x232A, 0x232B )]
|
||||
public class WinterGiftPackage2003 : GiftBox
|
||||
{
|
||||
[Constructable]
|
||||
public WinterGiftPackage2003()
|
||||
{
|
||||
DropItem( new Snowman() );
|
||||
DropItem( new WreathDeed() );
|
||||
DropItem( new BlueSnowflake() );
|
||||
DropItem( new RedPoinsettia() );
|
||||
}
|
||||
|
||||
public WinterGiftPackage2003( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
328
Scripts/Items/Special/Holiday/Wreath.cs
Normal file
328
Scripts/Items/Special/Holiday/Wreath.cs
Normal file
|
|
@ -0,0 +1,328 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WreathAddon : Item, IDyable, IAddon
|
||||
{
|
||||
[Constructable]
|
||||
public WreathAddon() : this( Utility.RandomDyedHue() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WreathAddon( int hue ) : base( 0x232C )
|
||||
{
|
||||
Hue = hue;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public WreathAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
if ( !map.CanFit( p.X, p.Y, p.Z, this.ItemData.Height ) )
|
||||
return false;
|
||||
|
||||
if ( this.ItemID == 0x232C )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
|
||||
else
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixMovingCrate ) );
|
||||
}
|
||||
|
||||
private void FixMovingCrate()
|
||||
{
|
||||
if ( this.Deleted )
|
||||
return;
|
||||
|
||||
if ( this.Movable || this.IsLockedDown )
|
||||
{
|
||||
Item deed = this.Deed;
|
||||
|
||||
if ( this.Parent is Item )
|
||||
{
|
||||
((Item)this.Parent).AddItem( deed );
|
||||
deed.Location = this.Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
deed.MoveToWorld( this.Location, this.Map );
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public Item Deed
|
||||
{
|
||||
get{ return new WreathDeed( this.Hue ); }
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
if ( from.InRange( this.GetWorldLocation(), 3 ) )
|
||||
{
|
||||
from.CloseGump( typeof( WreathAddonGump ) );
|
||||
from.SendGump( new WreathAddonGump( from, this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), 1 ) )
|
||||
{
|
||||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class WreathAddonGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private WreathAddon m_Addon;
|
||||
|
||||
public WreathAddonGump( Mobile from, WreathAddon addon ) : base( 150, 50 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Addon = addon;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 220, 170, 0x13BE );
|
||||
AddBackground( 10, 10, 200, 150, 0xBB8 );
|
||||
AddHtmlLocalized( 20, 30, 180, 60, 1062839, false, false ); // Do you wish to re-deed this decoration?
|
||||
AddHtmlLocalized( 55, 100, 160, 25, 1011011, false, false ); // CONTINUE
|
||||
AddButton( 20, 100, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 55, 125, 160, 25, 1011012, false, false ); // CANCEL
|
||||
AddButton( 20, 125, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Addon.Deleted )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == 1 )
|
||||
{
|
||||
if ( m_From.InRange( m_Addon.GetWorldLocation(), 3 ) )
|
||||
{
|
||||
m_From.AddToBackpack( m_Addon.Deed );
|
||||
m_Addon.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable( 0x14F0, 0x14EF )]
|
||||
public class WreathDeed : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1062837; } } // holiday wreath deed
|
||||
|
||||
[Constructable]
|
||||
public WreathDeed() : this( Utility.RandomDyedHue() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WreathDeed( int hue ) : base( 0x14F0 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = hue;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public WreathDeed( 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 override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062838 ); // Where would you like to place this decoration?
|
||||
from.BeginTarget( -1, true, TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), null );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public void Placement_OnTarget( Mobile from, object targeted, object state )
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if ( p == null )
|
||||
return;
|
||||
|
||||
Point3D loc = new Point3D( p );
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( loc, from.Map, 16 );
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
bool northWall = BaseAddon.IsWall( loc.X, loc.Y - 1, loc.Z, from.Map );
|
||||
bool westWall = BaseAddon.IsWall( loc.X - 1, loc.Y, loc.Z, from.Map );
|
||||
|
||||
if ( northWall && westWall )
|
||||
from.SendGump( new WreathDeedGump( from, loc, this ) );
|
||||
else
|
||||
PlaceAddon( from, loc, northWall, westWall );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
}
|
||||
}
|
||||
|
||||
private void PlaceAddon( Mobile from, Point3D loc, bool northWall, bool westWall )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( loc, from.Map, 16 );
|
||||
|
||||
if ( house == null || !house.IsCoOwner( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
return;
|
||||
}
|
||||
|
||||
int itemID = 0;
|
||||
|
||||
if ( northWall )
|
||||
itemID = 0x232C;
|
||||
else if ( westWall )
|
||||
itemID = 0x232D;
|
||||
else
|
||||
from.SendLocalizedMessage( 1062840 ); // The decoration must be placed next to a wall.
|
||||
|
||||
if ( itemID > 0 )
|
||||
{
|
||||
Item addon = new WreathAddon( this.Hue );
|
||||
|
||||
addon.ItemID = itemID;
|
||||
addon.MoveToWorld( loc, from.Map );
|
||||
|
||||
house.Addons.Add( addon );
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class WreathDeedGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Point3D m_Loc;
|
||||
private WreathDeed m_Deed;
|
||||
|
||||
public WreathDeedGump( Mobile from, Point3D loc, WreathDeed deed ) : base( 150, 50 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Loc = loc;
|
||||
m_Deed = deed;
|
||||
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddItem( 90, 30, 0x232D );
|
||||
AddItem( 180, 30, 0x232C );
|
||||
AddButton( 50, 35, 0x868, 0x869, 1, GumpButtonType.Reply, 0 );
|
||||
AddButton( 145, 35, 0x868, 0x869, 2, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Deed.Deleted )
|
||||
return;
|
||||
|
||||
switch( info.ButtonID )
|
||||
{
|
||||
case 1:
|
||||
m_Deed.PlaceAddon( m_From, m_Loc, false, true );
|
||||
break;
|
||||
case 2:
|
||||
m_Deed.PlaceAddon( m_From, m_Loc, true, false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
226
Scripts/Items/Special/MiniHouses.cs
Normal file
226
Scripts/Items/Special/MiniHouses.cs
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MiniHouseAddon : BaseAddon
|
||||
{
|
||||
private MiniHouseType m_Type;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public MiniHouseType Type
|
||||
{
|
||||
get{ return m_Type; }
|
||||
set{ m_Type = value; Construct(); }
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed{ get{ return new MiniHouseDeed( m_Type ); } }
|
||||
|
||||
[Constructable]
|
||||
public MiniHouseAddon() : this( MiniHouseType.StoneAndPlaster )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MiniHouseAddon( MiniHouseType type )
|
||||
{
|
||||
m_Type = type;
|
||||
|
||||
Construct();
|
||||
}
|
||||
|
||||
public void Construct()
|
||||
{
|
||||
Components.Clear();
|
||||
|
||||
MiniHouseInfo info = MiniHouseInfo.GetInfo( m_Type );
|
||||
|
||||
int size = (int)Math.Sqrt( info.Graphics.Length );
|
||||
int num = 0;
|
||||
|
||||
for ( int y = 0; y < size; ++y )
|
||||
for ( int x = 0; x < size; ++x )
|
||||
AddComponent( new AddonComponent( info.Graphics[num++] ), size - x - 1, size - y - 1, 0 );
|
||||
}
|
||||
|
||||
public MiniHouseAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Type );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Type = (MiniHouseType)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MiniHouseDeed : BaseAddonDeed
|
||||
{
|
||||
private MiniHouseType m_Type;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public MiniHouseType Type
|
||||
{
|
||||
get{ return m_Type; }
|
||||
set{ m_Type = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public override BaseAddon Addon{ get{ return new MiniHouseAddon( m_Type ); } }
|
||||
public override int LabelNumber{ get{ return 1062096; } } // a mini house deed
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( MiniHouseInfo.GetInfo( m_Type ).LabelNumber );
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MiniHouseDeed() : this( MiniHouseType.StoneAndPlaster )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MiniHouseDeed( MiniHouseType type )
|
||||
{
|
||||
m_Type = type;
|
||||
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MiniHouseDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Type );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Type = (MiniHouseType)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( Weight == 0.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
public enum MiniHouseType
|
||||
{
|
||||
StoneAndPlaster,
|
||||
FieldStone,
|
||||
SmallBrick,
|
||||
Wooden,
|
||||
WoodAndPlaster,
|
||||
ThatchedRoof,
|
||||
Brick,
|
||||
TwoStoryWoodAndPlaster,
|
||||
TwoStoryStoneAndPlaster,
|
||||
Tower,
|
||||
SmallStoneKeep,
|
||||
Castle,
|
||||
LargeHouseWithPatio,
|
||||
MarbleHouseWithPatio,
|
||||
SmallStoneTower,
|
||||
TwoStoryLogCabin,
|
||||
TwoStoryVilla,
|
||||
SandstoneHouseWithPatio,
|
||||
SmallStoneWorkshop,
|
||||
SmallMarbleWorkshop
|
||||
}
|
||||
|
||||
public class MiniHouseInfo
|
||||
{
|
||||
private int[] m_Graphics;
|
||||
private int m_LabelNumber;
|
||||
|
||||
public int[] Graphics{ get{ return m_Graphics; } }
|
||||
public int LabelNumber{ get{ return m_LabelNumber; } }
|
||||
|
||||
public MiniHouseInfo( int start, int count, int labelNumber )
|
||||
{
|
||||
m_Graphics = new int[count];
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
m_Graphics[i] = start + i;
|
||||
|
||||
m_LabelNumber = labelNumber;
|
||||
}
|
||||
|
||||
public MiniHouseInfo( int labelNumber, params int[] graphics )
|
||||
{
|
||||
m_LabelNumber = labelNumber;
|
||||
m_Graphics = graphics;
|
||||
}
|
||||
|
||||
private static MiniHouseInfo[] m_Info = new MiniHouseInfo[]
|
||||
{
|
||||
/* Stone and plaster house */ new MiniHouseInfo( 0x22C4, 1, 1011303 ),
|
||||
/* Field stone house */ new MiniHouseInfo( 0x22DE, 1, 1011304 ),
|
||||
/* Small brick house */ new MiniHouseInfo( 0x22DF, 1, 1011305 ),
|
||||
/* Wooden house */ new MiniHouseInfo( 0x22C9, 1, 1011306 ),
|
||||
/* Wood and plaster house */ new MiniHouseInfo( 0x22E0, 1, 1011307 ),
|
||||
/* Thatched-roof cottage */ new MiniHouseInfo( 0x22E1, 1, 1011308 ),
|
||||
/* Brick house */ new MiniHouseInfo( 1011309, 0x22CD, 0x22CB, 0x22CC, 0x22CA ),
|
||||
/* Two-story wood and plaster house */ new MiniHouseInfo( 1011310, 0x2301, 0x2302, 0x2304, 0x2303 ),
|
||||
/* Two-story stone and plaster house */ new MiniHouseInfo( 1011311, 0x22FC, 0x22FD, 0x22FF, 0x22FE ),
|
||||
/* Tower */ new MiniHouseInfo( 1011312, 0x22F7, 0x22F8, 0x22FA, 0x22F9 ),
|
||||
/* Small stone keep */ new MiniHouseInfo( 0x22E6, 9, 1011313 ),
|
||||
/* Castle */ new MiniHouseInfo( 1011314, 0x22CE, 0x22D0, 0x22D2, 0x22D7, 0x22CF, 0x22D1, 0x22D4, 0x22D9, 0x22D3, 0x22D5, 0x22D6, 0x22DB, 0x22D8, 0x22DA, 0x22DC, 0x22DD ),
|
||||
/* Large house with patio */ new MiniHouseInfo( 0x22E2, 4, 1011315 ),
|
||||
/* Marble house with patio */ new MiniHouseInfo( 0x22EF, 4, 1011316 ),
|
||||
/* Small stone tower */ new MiniHouseInfo( 0x22F5, 1, 1011317 ),
|
||||
/* Two-story log cabin */ new MiniHouseInfo( 0x22FB, 1, 1011318 ),
|
||||
/* Two-story villa */ new MiniHouseInfo( 0x2300, 1, 1011319 ),
|
||||
/* Sandstone house with patio */ new MiniHouseInfo( 0x22F3, 1, 1011320 ),
|
||||
/* Small stone workshop */ new MiniHouseInfo( 0x22F6, 1, 1011321 ),
|
||||
/* Small marble workshop */ new MiniHouseInfo( 0x22F4, 1, 1011322 )
|
||||
};
|
||||
|
||||
public static MiniHouseInfo GetInfo( MiniHouseType type )
|
||||
{
|
||||
int v = (int)type;
|
||||
|
||||
if ( v < 0 || v >= m_Info.Length )
|
||||
v = 0;
|
||||
|
||||
return m_Info[v];
|
||||
}
|
||||
}
|
||||
}
|
||||
266
Scripts/Items/Special/MonsterStatuette.cs
Normal file
266
Scripts/Items/Special/MonsterStatuette.cs
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MonsterStatuetteType
|
||||
{
|
||||
Crocodile,
|
||||
Daemon,
|
||||
Dragon,
|
||||
EarthElemental,
|
||||
Ettin,
|
||||
Gargoyle,
|
||||
Gorilla,
|
||||
Lich,
|
||||
Lizardman,
|
||||
Ogre,
|
||||
Orc,
|
||||
Ratman,
|
||||
Skeleton,
|
||||
Troll,
|
||||
Cow,
|
||||
Zombie,
|
||||
Llama,
|
||||
Ophidian,
|
||||
Reaper,
|
||||
Mongbat,
|
||||
Gazer,
|
||||
FireElemental,
|
||||
Wolf,
|
||||
PhillipsWoodenSteed,
|
||||
Seahorse
|
||||
}
|
||||
|
||||
public class MonsterStatuetteInfo
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
private int m_ItemID;
|
||||
private int[] m_Sounds;
|
||||
|
||||
public int LabelNumber{ get{ return m_LabelNumber; } }
|
||||
public int ItemID{ get{ return m_ItemID; } }
|
||||
public int[] Sounds{ get{ return m_Sounds; } }
|
||||
|
||||
public MonsterStatuetteInfo( int labelNumber, int itemID, int baseSoundID )
|
||||
{
|
||||
m_LabelNumber = labelNumber;
|
||||
m_ItemID = itemID;
|
||||
m_Sounds = new int[]{ baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 };
|
||||
}
|
||||
|
||||
private static MonsterStatuetteInfo[] m_Table = new MonsterStatuetteInfo[]
|
||||
{
|
||||
/* Crocodile */ new MonsterStatuetteInfo( 1041249, 0x20DA, 660 ),
|
||||
/* Daemon */ new MonsterStatuetteInfo( 1041250, 0x20D3, 357 ),
|
||||
/* Dragon */ new MonsterStatuetteInfo( 1041251, 0x20D6, 362 ),
|
||||
/* EarthElemental */ new MonsterStatuetteInfo( 1041252, 0x20D7, 268 ),
|
||||
/* Ettin */ new MonsterStatuetteInfo( 1041253, 0x20D8, 367 ),
|
||||
/* Gargoyle */ new MonsterStatuetteInfo( 1041254, 0x20D9, 372 ),
|
||||
/* Gorilla */ new MonsterStatuetteInfo( 1041255, 0x20F5, 158 ),
|
||||
/* Lich */ new MonsterStatuetteInfo( 1041256, 0x20F8, 1001 ),
|
||||
/* Lizardman */ new MonsterStatuetteInfo( 1041257, 0x20DE, 417 ),
|
||||
/* Ogre */ new MonsterStatuetteInfo( 1041258, 0x20DF, 427 ),
|
||||
/* Orc */ new MonsterStatuetteInfo( 1041259, 0x20E0, 1114 ),
|
||||
/* Ratman */ new MonsterStatuetteInfo( 1041260, 0x20E3, 437 ),
|
||||
/* Skeleton */ new MonsterStatuetteInfo( 1041261, 0x20E7, 1165 ),
|
||||
/* Troll */ new MonsterStatuetteInfo( 1041262, 0x20E9, 461 ),
|
||||
/* Cow */ new MonsterStatuetteInfo( 1041263, 0x2103, 120 ),
|
||||
/* Zombie */ new MonsterStatuetteInfo( 1041264, 0x20EC, 471 ),
|
||||
/* Llama */ new MonsterStatuetteInfo( 1041265, 0x20F6, 1011 ),
|
||||
/* Ophidian */ new MonsterStatuetteInfo( 1049742, 0x2133, 634 ),
|
||||
/* Reaper */ new MonsterStatuetteInfo( 1049743, 0x20FA, 442 ),
|
||||
/* Mongbat */ new MonsterStatuetteInfo( 1049744, 0x20F9, 422 ),
|
||||
/* Gazer */ new MonsterStatuetteInfo( 1049768, 0x20F4, 377 ),
|
||||
/* FireElemental */ new MonsterStatuetteInfo( 1049769, 0x20F3, 838 ),
|
||||
/* Wolf */ new MonsterStatuetteInfo( 1049770, 0x2122, 229 ),
|
||||
/* Phillip's Steed */ new MonsterStatuetteInfo( 1063488, 0x3FFE, 205 ),
|
||||
/* Seahorse */ new MonsterStatuetteInfo( 1070819, 0x25BA, 138 )
|
||||
};
|
||||
|
||||
public static MonsterStatuetteInfo GetInfo( MonsterStatuetteType type )
|
||||
{
|
||||
int v = (int)type;
|
||||
|
||||
if ( v < 0 || v >= m_Table.Length )
|
||||
v = 0;
|
||||
|
||||
return m_Table[v];
|
||||
}
|
||||
}
|
||||
|
||||
public class MonsterStatuette : Item, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private MonsterStatuetteType m_Type;
|
||||
private bool m_TurnedOn;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool TurnedOn
|
||||
{
|
||||
get{ return m_TurnedOn; }
|
||||
set{ m_TurnedOn = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public MonsterStatuetteType Type
|
||||
{
|
||||
get{ return m_Type; }
|
||||
set
|
||||
{
|
||||
m_Type = value;
|
||||
ItemID = MonsterStatuetteInfo.GetInfo( m_Type ).ItemID;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get{ return MonsterStatuetteInfo.GetInfo( m_Type ).LabelNumber; }
|
||||
}
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 1.0; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MonsterStatuette() : this( MonsterStatuetteType.Crocodile )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MonsterStatuette( MonsterStatuetteType type ) : base( MonsterStatuetteInfo.GetInfo( type ).ItemID )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_Type = type;
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement{ get{ return m_TurnedOn && IsLockedDown; } }
|
||||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
if ( m_TurnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) && Utility.InRange( m.Location, this.Location, 2 ) && !Utility.InRange( oldLocation, this.Location, 2 ) )
|
||||
{
|
||||
int[] sounds = MonsterStatuetteInfo.GetInfo( m_Type ).Sounds;
|
||||
|
||||
Effects.PlaySound( this.Location, this.Map, sounds[Utility.Random( sounds.Length )] );
|
||||
}
|
||||
|
||||
base.OnMovement( m, oldLocation );
|
||||
}
|
||||
|
||||
public MonsterStatuette( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_TurnedOn )
|
||||
list.Add( 502695 ); // turned on
|
||||
else
|
||||
list.Add( 502696 ); // turned off
|
||||
}
|
||||
|
||||
public bool IsOwner( Mobile mob )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
return ( house != null && house.IsOwner( mob ) );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsOwner( from ) )
|
||||
{
|
||||
OnOffGump onOffGump = new OnOffGump( this );
|
||||
from.SendGump( onOffGump );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502691 ); // You must be the owner to use this.
|
||||
}
|
||||
}
|
||||
|
||||
private class OnOffGump : Gump
|
||||
{
|
||||
private MonsterStatuette m_Statuette;
|
||||
|
||||
public OnOffGump( MonsterStatuette statuette ) : base( 150, 200 )
|
||||
{
|
||||
m_Statuette = statuette;
|
||||
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
|
||||
AddHtmlLocalized( 45, 20, 300, 35, statuette.TurnedOn ? 1011035 : 1011034, false, false ); // [De]Activate this item
|
||||
|
||||
AddButton( 40, 53, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 80, 55, 65, 35, 1011036, false, false ); // OKAY
|
||||
|
||||
AddButton( 150, 53, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 190, 55, 100, 35, 1011012, false, false ); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID == 1 )
|
||||
{
|
||||
bool newValue = !m_Statuette.TurnedOn;
|
||||
m_Statuette.TurnedOn = newValue;
|
||||
|
||||
if ( newValue && !m_Statuette.IsLockedDown )
|
||||
from.SendLocalizedMessage( 502693 ); // Remember, this only works when locked down.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502694 ); // Cancelled action.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Type );
|
||||
writer.Write( (bool) m_TurnedOn );
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Type = (MonsterStatuetteType)reader.ReadEncodedInt();
|
||||
m_TurnedOn = reader.ReadBool();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Special/RewardCake.cs
Normal file
49
Scripts/Items/Special/RewardCake.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RewardCake : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1049786; } } // Happy Birthday! ...
|
||||
|
||||
[Constructable]
|
||||
public RewardCake() : base( 0x9e9 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
Hue = Utility.RandomList(0x135, 0xcd, 0x38, 0x3b, 0x42, 0x4f, 0x11e, 0x60, 0x317, 0x10, 0x136, 0x1f9, 0x1a, 0xeb, 0x86, 0x2e);
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public RewardCake( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DisplayLootType{ get{ return false; } }
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if (! from.InRange( this.GetWorldLocation(), 1 ))
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
270
Scripts/Items/Special/Solen Items/BagOfSending.cs
Normal file
270
Scripts/Items/Special/Solen Items/BagOfSending.cs
Normal file
|
|
@ -0,0 +1,270 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.ContextMenus;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum BagOfSendingHue
|
||||
{
|
||||
Yellow,
|
||||
Blue,
|
||||
Red
|
||||
}
|
||||
|
||||
public class BagOfSending : Item, TranslocationItem
|
||||
{
|
||||
public static BagOfSendingHue RandomHue()
|
||||
{
|
||||
switch ( Utility.Random( 3 ) )
|
||||
{
|
||||
case 0: return BagOfSendingHue.Yellow;
|
||||
case 1: return BagOfSendingHue.Blue;
|
||||
default: return BagOfSendingHue.Red;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private BagOfSendingHue m_BagOfSendingHue;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Charges
|
||||
{
|
||||
get{ return m_Charges; }
|
||||
set
|
||||
{
|
||||
if ( value > this.MaxCharges )
|
||||
m_Charges = this.MaxCharges;
|
||||
else if ( value < 0 )
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Recharges
|
||||
{
|
||||
get{ return m_Recharges; }
|
||||
set
|
||||
{
|
||||
if ( value > this.MaxRecharges )
|
||||
m_Recharges = this.MaxRecharges;
|
||||
else if ( value < 0 )
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxCharges{ get{ return 30; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxRecharges{ get{ return 255; } }
|
||||
|
||||
public string TranslocationItemName{ get{ return "bag of sending"; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1054104; } } // a bag of sending
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public BagOfSendingHue BagOfSendingHue
|
||||
{
|
||||
get{ return m_BagOfSendingHue; }
|
||||
set
|
||||
{
|
||||
m_BagOfSendingHue = value;
|
||||
|
||||
switch ( value )
|
||||
{
|
||||
case BagOfSendingHue.Yellow: this.Hue = 0x8A5; break;
|
||||
case BagOfSendingHue.Blue: this.Hue = 0x8AD; break;
|
||||
case BagOfSendingHue.Red: this.Hue = 0x89B; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BagOfSending() : this( RandomHue() )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BagOfSending( BagOfSendingHue hue ) : base( 0xE76 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
|
||||
this.BagOfSendingHue = hue;
|
||||
|
||||
m_Charges = Utility.RandomMinMax( 3, 9 );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( 1060741, m_Charges.ToString() ); // charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
LabelTo( from, 1060741, m_Charges.ToString() ); // charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if ( from.Alive )
|
||||
list.Add( new UseBagEntry( this, Charges > 0 && IsChildOf( from.Backpack ) ) );
|
||||
}
|
||||
|
||||
private class UseBagEntry : ContextMenuEntry
|
||||
{
|
||||
private BagOfSending m_Bag;
|
||||
|
||||
public UseBagEntry( BagOfSending bag, bool enabled ) : base( 6189 )
|
||||
{
|
||||
m_Bag = bag;
|
||||
|
||||
if ( !enabled )
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if ( m_Bag.Deleted )
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if ( from.CheckAlive() )
|
||||
m_Bag.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !this.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1054107, 0x59 ); // The bag of sending must be in your backpack.
|
||||
}
|
||||
else if ( this.Charges == 0 )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1042544, 0x59 ); // This item is out of charges.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Target = new SendTarget( this );
|
||||
}
|
||||
}
|
||||
|
||||
private class SendTarget : Target
|
||||
{
|
||||
private BagOfSending m_Bag;
|
||||
|
||||
public SendTarget( BagOfSending bag ) : base( -1, false, TargetFlags.None )
|
||||
{
|
||||
m_Bag = bag;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Bag.Deleted )
|
||||
return;
|
||||
|
||||
if ( !m_Bag.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054107, 0x59 ); // The bag of sending must be in your backpack.
|
||||
}
|
||||
else if ( m_Bag.Charges == 0 )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1042544, 0x59 ); // This item is out of charges.
|
||||
}
|
||||
else if ( targeted is Item )
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
|
||||
if ( !item.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054152, 0x59 ); // You may only send items from your backpack to your bank box.
|
||||
}
|
||||
else if ( item is BagOfSending || item is Container )
|
||||
{
|
||||
from.Send( new AsciiMessage( m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending." ) );
|
||||
}
|
||||
else if ( item.LootType == LootType.Cursed )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054108, 0x59 ); // The bag of sending rejects the cursed item.
|
||||
}
|
||||
else if ( !item.VerifyMove( from ) || item is Server.Engines.Quests.QuestItem )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054109, 0x59 ); // The bag of sending rejects that item.
|
||||
}
|
||||
else if ( Spells.SpellHelper.IsDoomGauntlet( from.Map, from.Location ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062089 ); // You cannot use that here.
|
||||
}
|
||||
else if ( from.BankBox == null || !from.BankBox.TryDropItem( from, item, false ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054110, 0x59 ); // Your bank box is full.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Bag.Charges--;
|
||||
|
||||
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054150, 0x59 ); // The item was placed in your bank box.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BagOfSending( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 1 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Recharges );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Charges );
|
||||
writer.WriteEncodedInt( (int) m_BagOfSendingHue );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Charges = Math.Min( reader.ReadEncodedInt(), MaxCharges );
|
||||
m_BagOfSendingHue = (BagOfSendingHue) reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
345
Scripts/Items/Special/Solen Items/BallOfSummoning.cs
Normal file
345
Scripts/Items/Special/Solen Items/BallOfSummoning.cs
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BallOfSummoning : Item, TranslocationItem
|
||||
{
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private BaseCreature m_Pet;
|
||||
private string m_PetName;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Charges
|
||||
{
|
||||
get{ return m_Charges; }
|
||||
set
|
||||
{
|
||||
if ( value > this.MaxCharges )
|
||||
m_Charges = this.MaxCharges;
|
||||
else if ( value < 0 )
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Recharges
|
||||
{
|
||||
get{ return m_Recharges; }
|
||||
set
|
||||
{
|
||||
if ( value > this.MaxRecharges )
|
||||
m_Recharges = this.MaxRecharges;
|
||||
else if ( value < 0 )
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxCharges{ get{ return 20; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxRecharges{ get{ return 255; } }
|
||||
|
||||
public string TranslocationItemName{ get{ return "crystal ball of pet summoning"; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public BaseCreature Pet
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Pet != null && m_Pet.Deleted )
|
||||
{
|
||||
m_Pet = null;
|
||||
InternalUpdatePetName();
|
||||
}
|
||||
|
||||
return m_Pet;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Pet = value;
|
||||
InternalUpdatePetName();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string PetName{ get{ return m_PetName; } }
|
||||
|
||||
[Constructable]
|
||||
public BallOfSummoning() : base( 0xE2E )
|
||||
{
|
||||
Weight = 10.0;
|
||||
Light = LightType.Circle150;
|
||||
|
||||
m_Charges = Utility.RandomMinMax( 3, 9 );
|
||||
|
||||
m_PetName = "";
|
||||
}
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
list.Add( 1054131, m_Charges.ToString() + ( m_PetName == "" ? "\t " : "\t" + m_PetName ) ); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
LabelTo( from, 1054131, m_Charges.ToString() + ( m_PetName == "" ? "\t " : "\t" + m_PetName ) ); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
}
|
||||
|
||||
private delegate void BallCallback( Mobile from );
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if ( from.Alive && from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
if ( Pet == null )
|
||||
{
|
||||
list.Add( new BallEntry( new BallCallback( LinkPet ), 6180 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add( new BallEntry( new BallCallback( SummonPet ), 6181 ) );
|
||||
list.Add( new BallEntry( new BallCallback( UpdatePetName ), 6183 ) );
|
||||
list.Add( new BallEntry( new BallCallback( UnlinkPet ), 6182 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class BallEntry : ContextMenuEntry
|
||||
{
|
||||
private BallCallback m_Callback;
|
||||
|
||||
public BallEntry( BallCallback callback, int number ) : base( number, 2 )
|
||||
{
|
||||
m_Callback = callback;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if ( from.CheckAlive() )
|
||||
m_Callback( from );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
if ( Pet == null )
|
||||
{
|
||||
LinkPet( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
SummonPet( from );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkPet( Mobile from )
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if ( Deleted || pet != null )
|
||||
return;
|
||||
|
||||
from.SendLocalizedMessage( 1054114 ); // Target your pet that you wish to link to this Crystal Ball of Pet Summoning.
|
||||
from.Target = new PetLinkTarget( this );
|
||||
}
|
||||
|
||||
private class PetLinkTarget : Target
|
||||
{
|
||||
private BallOfSummoning m_Ball;
|
||||
|
||||
public PetLinkTarget( BallOfSummoning ball ) : base( -1, false, TargetFlags.None )
|
||||
{
|
||||
m_Ball = ball;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Ball.Deleted || m_Ball.Pet != null )
|
||||
return;
|
||||
|
||||
if ( !from.InRange( m_Ball.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
else if ( targeted is BaseCreature )
|
||||
{
|
||||
BaseCreature creature = (BaseCreature)targeted;
|
||||
|
||||
if ( !creature.Controlled || creature.ControlMaster != from )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Ball, from, 1054117, 0x59 ); // You may only link your own pets to a Crystal Ball of Pet Summoning.
|
||||
}
|
||||
else if ( !creature.IsBonded )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Ball, from, 1054118, 0x59 ); // You must bond with your pet before it can be linked to a Crystal Ball of Pet Summoning.
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Ball, from, 1054119, 0x59 ); // Your pet is now linked to this Crystal Ball of Pet Summoning.
|
||||
|
||||
m_Ball.Pet = creature;
|
||||
}
|
||||
}
|
||||
else if ( targeted == m_Ball )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Ball, from, 1054115, 0x59 ); // The Crystal Ball of Pet Summoning cannot summon itself.
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Ball, from, 1054116, 0x59 ); // Only pets can be linked to this Crystal Ball of Pet Summoning.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SummonPet( Mobile from )
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if ( Deleted || pet == null )
|
||||
return;
|
||||
|
||||
if ( Charges == 0 )
|
||||
{
|
||||
SendLocalizedMessageTo( from, 1054122 ); // The Crystal Ball darkens. It must be charged before it can be used again.
|
||||
}
|
||||
else if ( pet is BaseMount && ((BaseMount)pet).Rider == from )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1054124, 0x36 ); // The Crystal Ball fills with a yellow mist. Why would you summon your pet while riding it?
|
||||
}
|
||||
else if ( pet.Map == Map.Internal && ( !pet.IsStabled || (from.Followers + pet.ControlSlots) > from.FollowersMax ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1054125, 0x5 ); // The Crystal Ball fills with a blue mist. Your pet is not responding to the summons.
|
||||
}
|
||||
else if ( ( !pet.Controlled || pet.ControlMaster != from ) && !from.Stabled.Contains( pet ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1054126, 0x8FD ); // The Crystal Ball fills with a grey mist. You are not the owner of the pet you are attempting to summon.
|
||||
}
|
||||
else if ( !pet.IsBonded )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1054127, 0x22 ); // The Crystal Ball fills with a red mist. You appear to have let your bond to your pet deteriorate.
|
||||
}
|
||||
else if ( from.Map == Map.Ilshenar || from.Region.IsPartOf( typeof( DungeonRegion ) ) || from.Region.IsPartOf( typeof( Jail ) ) )
|
||||
{
|
||||
from.Send( new AsciiMessage( this.Serial, this.ItemID, MessageType.Regular, 0x22, 3, "", "You cannot summon your pet to this location." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Charges--;
|
||||
|
||||
if ( pet.IsStabled )
|
||||
{
|
||||
pet.SetControlMaster( from );
|
||||
|
||||
if ( pet.Summoned )
|
||||
pet.SummonMaster = from;
|
||||
|
||||
pet.ControlTarget = from;
|
||||
pet.ControlOrder = OrderType.Follow;
|
||||
|
||||
pet.IsStabled = false;
|
||||
from.Stabled.Remove( pet );
|
||||
}
|
||||
|
||||
pet.MoveToWorld( from.Location, from.Map );
|
||||
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1054128, 0x43 ); // The Crystal Ball fills with a green mist. Your pet has been summoned.
|
||||
}
|
||||
}
|
||||
|
||||
public void UnlinkPet( Mobile from )
|
||||
{
|
||||
if ( !Deleted && Pet != null )
|
||||
{
|
||||
Pet = null;
|
||||
|
||||
SendLocalizedMessageTo( from, 1054120 ); // This crystal ball is no longer linked to a pet.
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePetName( Mobile from )
|
||||
{
|
||||
InternalUpdatePetName();
|
||||
}
|
||||
|
||||
private void InternalUpdatePetName()
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if ( pet == null )
|
||||
m_PetName = "";
|
||||
else
|
||||
m_PetName = pet.Name;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public BallOfSummoning( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 1 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Recharges );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Charges );
|
||||
writer.Write( (Mobile) this.Pet );
|
||||
writer.Write( (string) m_PetName );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Charges = Math.Min( reader.ReadEncodedInt(), MaxCharges );
|
||||
this.Pet = (BaseCreature) reader.ReadMobile();
|
||||
m_PetName = reader.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
474
Scripts/Items/Special/Solen Items/BraceletOfBinding.cs
Normal file
474
Scripts/Items/Special/Solen Items/BraceletOfBinding.cs
Normal file
|
|
@ -0,0 +1,474 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BraceletOfBinding : BaseBracelet, TranslocationItem
|
||||
{
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private string m_Inscription;
|
||||
private BraceletOfBinding m_Bound;
|
||||
private TransportTimer m_Timer;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Charges
|
||||
{
|
||||
get{ return m_Charges; }
|
||||
set
|
||||
{
|
||||
if ( value > this.MaxCharges )
|
||||
m_Charges = this.MaxCharges;
|
||||
else if ( value < 0 )
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Recharges
|
||||
{
|
||||
get{ return m_Recharges; }
|
||||
set
|
||||
{
|
||||
if ( value > this.MaxRecharges )
|
||||
m_Recharges = this.MaxRecharges;
|
||||
else if ( value < 0 )
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxCharges{ get{ return 20; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxRecharges{ get{ return 255; } }
|
||||
|
||||
public string TranslocationItemName{ get{ return "bracelet of binding"; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string Inscription
|
||||
{
|
||||
get{ return m_Inscription; }
|
||||
set
|
||||
{
|
||||
m_Inscription = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public BraceletOfBinding Bound
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Bound != null && m_Bound.Deleted )
|
||||
m_Bound = null;
|
||||
|
||||
return m_Bound;
|
||||
}
|
||||
set{ m_Bound = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BraceletOfBinding() : base( 0x1086 )
|
||||
{
|
||||
Hue = 0x489;
|
||||
Weight = 1.0;
|
||||
|
||||
m_Inscription = "";
|
||||
}
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
list.Add( 1054000, m_Charges.ToString() + ( m_Inscription == "" ? "\t " : " :\t" + m_Inscription ) ); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
LabelTo( from, 1054000, m_Charges.ToString() + ( m_Inscription == "" ? "\t " : " :\t" + m_Inscription ) ); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if ( from.Alive && this.IsChildOf( from ) )
|
||||
{
|
||||
BraceletOfBinding bound = this.Bound;
|
||||
|
||||
list.Add( new BraceletEntry( new BraceletCallback( Activate ), 6170, bound != null ) );
|
||||
list.Add( new BraceletEntry( new BraceletCallback( Search ), 6171, bound != null ) );
|
||||
list.Add( new BraceletEntry( new BraceletCallback( Bind ), bound == null ? 6173 : 6174, true ) );
|
||||
list.Add( new BraceletEntry( new BraceletCallback( Inscribe ), 6175, true ) );
|
||||
}
|
||||
}
|
||||
|
||||
private delegate void BraceletCallback( Mobile from );
|
||||
|
||||
private class BraceletEntry : ContextMenuEntry
|
||||
{
|
||||
private BraceletCallback m_Callback;
|
||||
|
||||
public BraceletEntry( BraceletCallback callback, int number, bool enabled ) : base( number )
|
||||
{
|
||||
m_Callback = callback;
|
||||
|
||||
if ( !enabled )
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if ( from.CheckAlive() )
|
||||
m_Callback( from );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
BraceletOfBinding bound = this.Bound;
|
||||
|
||||
if ( Bound == null )
|
||||
{
|
||||
Bind( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
Activate( from );
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate( Mobile from )
|
||||
{
|
||||
BraceletOfBinding bound = this.Bound;
|
||||
|
||||
if ( Deleted || bound == null )
|
||||
return;
|
||||
|
||||
if ( !this.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if ( m_Timer != null )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054013 ); // The bracelet is already attempting contact. You decide to wait a moment.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound( 0xF9 );
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x5D, true, "* You concentrate on the bracelet to summon its power *" );
|
||||
|
||||
from.Frozen = true;
|
||||
|
||||
m_Timer = new TransportTimer( this, from );
|
||||
m_Timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private class TransportTimer : Timer
|
||||
{
|
||||
private BraceletOfBinding m_Bracelet;
|
||||
private Mobile m_From;
|
||||
|
||||
public TransportTimer( BraceletOfBinding bracelet, Mobile from ) : base( TimeSpan.FromSeconds( 2.0 ) )
|
||||
{
|
||||
m_Bracelet = bracelet;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Bracelet.m_Timer = null;
|
||||
m_From.Frozen = false;
|
||||
|
||||
if ( m_Bracelet.Deleted || m_From.Deleted )
|
||||
return;
|
||||
|
||||
if ( m_Bracelet.CheckUse( m_From, false ) )
|
||||
{
|
||||
Mobile boundRoot = m_Bracelet.Bound.RootParent as Mobile;
|
||||
|
||||
if ( boundRoot != null )
|
||||
{
|
||||
m_Bracelet.Charges--;
|
||||
|
||||
BaseCreature.TeleportPets( m_From, boundRoot.Location, boundRoot.Map, true );
|
||||
|
||||
m_From.PlaySound( 0x1FC );
|
||||
m_From.MoveToWorld( boundRoot.Location, boundRoot.Map );
|
||||
m_From.PlaySound( 0x1FC );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Search( Mobile from )
|
||||
{
|
||||
BraceletOfBinding bound = this.Bound;
|
||||
|
||||
if ( Deleted || bound == null )
|
||||
return;
|
||||
|
||||
if ( !this.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckUse( from, true );
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckUse( Mobile from, bool successMessage )
|
||||
{
|
||||
BraceletOfBinding bound = this.Bound;
|
||||
|
||||
if ( bound == null )
|
||||
return false;
|
||||
|
||||
Mobile boundRoot = bound.RootParent as Mobile;
|
||||
|
||||
if ( Charges == 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054005 ); // The bracelet glows black. It must be charged before it can be used again.
|
||||
return false;
|
||||
}
|
||||
else if ( from.FindItemOnLayer( Layer.Bracelet ) != this )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054004 ); // You must equip the bracelet in order to use its power.
|
||||
return false;
|
||||
}
|
||||
else if ( boundRoot == null || boundRoot.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054006 ); // The bracelet emits a red glow. The bracelet's twin is not available for transport.
|
||||
return false;
|
||||
}
|
||||
else if ( !Core.AOS && from.Map != boundRoot.Map )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054014 ); // The bracelet glows black. The bracelet's target is on another facet.
|
||||
return false;
|
||||
}
|
||||
else if ( Factions.Sigil.ExistsOn( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
return false;
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( from, TravelCheckType.RecallFrom ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ( boundRoot.Map == Map.Felucca && from is PlayerMobile && ((PlayerMobile)from).Young )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Kills >= 5 && boundRoot.Map != Map.Felucca )
|
||||
{
|
||||
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Criminal )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
|
||||
return false;
|
||||
}
|
||||
else if ( SpellHelper.CheckCombat( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
|
||||
return false;
|
||||
}
|
||||
else if ( Server.Misc.WeightOverloading.IsOverloaded( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Region.IsPartOf( typeof( Server.Regions.Jail ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
|
||||
return false;
|
||||
}
|
||||
else if ( boundRoot.Region.IsPartOf( typeof( Server.Regions.Jail ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( successMessage )
|
||||
from.SendLocalizedMessage( 1054015 ); // The bracelet's twin is available for transport.
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Bind( Mobile from )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
if ( !this.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1054001 ); // Target the bracelet of binding you wish to bind this bracelet to.
|
||||
from.Target = new BindTarget( this );
|
||||
}
|
||||
}
|
||||
|
||||
private class BindTarget : Target
|
||||
{
|
||||
private BraceletOfBinding m_Bracelet;
|
||||
|
||||
public BindTarget( BraceletOfBinding bracelet ) : base( -1, false, TargetFlags.None )
|
||||
{
|
||||
m_Bracelet = bracelet;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Bracelet.Deleted )
|
||||
return;
|
||||
|
||||
if ( !m_Bracelet.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if ( targeted is BraceletOfBinding )
|
||||
{
|
||||
BraceletOfBinding bindBracelet = (BraceletOfBinding)targeted;
|
||||
|
||||
if ( bindBracelet == m_Bracelet )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054012 ); // You cannot bind a bracelet of binding to itself!
|
||||
}
|
||||
else if ( !bindBracelet.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1054003 ); // You bind the bracelet to its counterpart. The bracelets glow with power.
|
||||
from.PlaySound( 0x1FA );
|
||||
|
||||
m_Bracelet.Bound = bindBracelet;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1054002 ); // You can only bind this bracelet to another bracelet of binding!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Inscribe( Mobile from )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
if ( !this.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1054009 ); // Enter the text to inscribe upon the bracelet :
|
||||
from.Prompt = new InscribePrompt( this );
|
||||
}
|
||||
}
|
||||
|
||||
private class InscribePrompt : Prompt
|
||||
{
|
||||
private BraceletOfBinding m_Bracelet;
|
||||
|
||||
public InscribePrompt( BraceletOfBinding bracelet )
|
||||
{
|
||||
m_Bracelet = bracelet;
|
||||
}
|
||||
|
||||
public override void OnResponse( Mobile from, string text )
|
||||
{
|
||||
if ( m_Bracelet.Deleted )
|
||||
return;
|
||||
|
||||
if ( !m_Bracelet.IsChildOf( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1054011 ); // You mark the bracelet with your inscription.
|
||||
m_Bracelet.Inscription = text;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCancel( Mobile from )
|
||||
{
|
||||
from.SendLocalizedMessage( 1054010 ); // You decide not to inscribe the bracelet at this time.
|
||||
}
|
||||
}
|
||||
|
||||
public BraceletOfBinding( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 1 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Recharges );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Charges );
|
||||
writer.Write( (string) m_Inscription );
|
||||
writer.Write( (Item) this.Bound );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Charges = Math.Min( reader.ReadEncodedInt(), MaxCharges );
|
||||
m_Inscription = reader.ReadString();
|
||||
this.Bound = (BraceletOfBinding) reader.ReadItem();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Scripts/Items/Special/Solen Items/MessageHelper.cs
Normal file
18
Scripts/Items/Special/Solen Items/MessageHelper.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class MessageHelper
|
||||
{
|
||||
public static void SendLocalizedMessageTo( Item from, Mobile to, int number, int hue )
|
||||
{
|
||||
SendLocalizedMessageTo( from, to, number, "", hue );
|
||||
}
|
||||
|
||||
public static void SendLocalizedMessageTo( Item from, Mobile to, int number, string args, int hue )
|
||||
{
|
||||
to.Send( new MessageLocalized( from.Serial, from.ItemID, MessageType.Regular, hue, 3, number, "", args ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
125
Scripts/Items/Special/Solen Items/PowderOfTranslocation.cs
Normal file
125
Scripts/Items/Special/Solen Items/PowderOfTranslocation.cs
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface TranslocationItem
|
||||
{
|
||||
int Charges{ get; set; }
|
||||
int Recharges{ get; set; }
|
||||
int MaxCharges{ get; }
|
||||
int MaxRecharges{ get; }
|
||||
string TranslocationItemName{ get; }
|
||||
}
|
||||
|
||||
public class PowderOfTranslocation : Item
|
||||
{
|
||||
[Constructable]
|
||||
public PowderOfTranslocation() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTranslocation( int amount ) : base( 0x26B8 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 0.1;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PowderOfTranslocation m_Powder;
|
||||
|
||||
public InternalTarget( PowderOfTranslocation powder ) : base( -1, false, TargetFlags.None )
|
||||
{
|
||||
m_Powder = powder;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Powder.Deleted )
|
||||
return;
|
||||
|
||||
if ( !from.InRange( m_Powder.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
else if ( targeted is TranslocationItem )
|
||||
{
|
||||
TranslocationItem transItem = (TranslocationItem)targeted;
|
||||
|
||||
if ( transItem.Charges >= transItem.MaxCharges )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Powder, from, 1054137, 0x59 ); // This item cannot absorb any more powder of translocation.
|
||||
}
|
||||
else if ( transItem.Recharges >= transItem.MaxRecharges )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Powder, from, 1054138, 0x59 ); // This item has been oversaturated with powder of translocation and can no longer be recharged.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( transItem.Charges + m_Powder.Amount > transItem.MaxCharges )
|
||||
{
|
||||
int delta = transItem.MaxCharges - transItem.Charges;
|
||||
|
||||
m_Powder.Amount -= delta;
|
||||
transItem.Charges = transItem.MaxCharges;
|
||||
transItem.Recharges += delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
transItem.Charges += m_Powder.Amount;
|
||||
transItem.Recharges += m_Powder.Amount;
|
||||
m_Powder.Delete();
|
||||
}
|
||||
|
||||
if ( transItem is Item )
|
||||
{
|
||||
// The ~1_translocationItem~ glows with green energy and absorbs magical power from the powder.
|
||||
MessageHelper.SendLocalizedMessageTo( (Item)transItem, from, 1054139, transItem.TranslocationItemName, 0x43 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( m_Powder, from, 1054140, 0x59 ); // Powder of translocation has no effect on this item.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PowderOfTranslocation( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Special/Solen Items/ZoogiFungus.cs
Normal file
41
Scripts/Items/Special/Solen Items/ZoogiFungus.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ZoogiFungus : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ZoogiFungus() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ZoogiFungus( int amount ) : base( 0x26B7 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 0.1;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ZoogiFungus( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
877
Scripts/Items/Special/SoulStone.cs
Normal file
877
Scripts/Items/Special/SoulStone.cs
Normal file
|
|
@ -0,0 +1,877 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Accounting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SoulStone : Item
|
||||
{
|
||||
private int m_ActiveItemID;
|
||||
private int m_InactiveItemID;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual int ActiveItemID
|
||||
{
|
||||
get { return m_ActiveItemID; }
|
||||
set
|
||||
{
|
||||
m_ActiveItemID = value;
|
||||
|
||||
if( !IsEmpty )
|
||||
this.ItemID = m_ActiveItemID;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual int InactiveItemID
|
||||
{
|
||||
get { return m_InactiveItemID; }
|
||||
set
|
||||
{
|
||||
m_InactiveItemID = value;
|
||||
|
||||
if( IsEmpty )
|
||||
this.ItemID = m_InactiveItemID;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly TimeSpan UseDelay = TimeSpan.FromDays( 1.0 );
|
||||
|
||||
private string m_Account;
|
||||
private DateTime m_NextUse;
|
||||
|
||||
private SkillName m_Skill;
|
||||
private double m_SkillValue;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string Account
|
||||
{
|
||||
get{ return m_Account; }
|
||||
set{ m_Account = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime NextUse
|
||||
{
|
||||
get{ return m_NextUse; }
|
||||
set{ m_NextUse = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SkillName Skill
|
||||
{
|
||||
get{ return m_Skill; }
|
||||
set{ m_Skill = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public double SkillValue
|
||||
{
|
||||
get{ return m_SkillValue; }
|
||||
set
|
||||
{
|
||||
m_SkillValue = value;
|
||||
|
||||
if ( !IsEmpty )
|
||||
this.ItemID = m_ActiveItemID;
|
||||
else
|
||||
this.ItemID = m_InactiveItemID;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get{ return m_SkillValue <= 0.0; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SoulStone() : this( null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SoulStone( string account )
|
||||
: this( account, 0x2A93, 0x2A94 )
|
||||
{
|
||||
}
|
||||
|
||||
public SoulStone( string account, int itemID )
|
||||
: this( account, itemID, itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public SoulStone( string account, int inactiveItemID, int activeItemID ) : base( inactiveItemID )
|
||||
{
|
||||
Light = LightType.Circle300;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_InactiveItemID = inactiveItemID;
|
||||
m_ActiveItemID = activeItemID;
|
||||
|
||||
m_Account = account;
|
||||
m_NextUse = DateTime.MinValue;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( !this.IsEmpty )
|
||||
{
|
||||
list.Add( 1070721, "#{0}\t{1:0.0}", 1044060 + (int)this.Skill, this.SkillValue ); // Skill stored: ~1_skillname~ ~2_skillamount~
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CheckCombat( Mobile m, TimeSpan time )
|
||||
{
|
||||
for ( int i = 0; i < m.Aggressed.Count; ++i )
|
||||
{
|
||||
AggressorInfo info = m.Aggressed[i];
|
||||
|
||||
if ( DateTime.Now - info.LastCombatTime < time )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual bool CheckUse( Mobile from )
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
if ( this.Deleted || !this.IsAccessibleTo( from ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return false;
|
||||
}
|
||||
else if ( this.Account != null && ( !(from.Account is Account) || from.Account.Username != this.Account ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070714 ); // This is an Account Bound Soulstone, and your character is not bound to it. You cannot use this Soulstone.
|
||||
return false;
|
||||
}
|
||||
else if ( CheckCombat( from, TimeSpan.FromMinutes( 2.0 ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070727 ); // You must wait two minutes after engaging in combat before you can use a Soulstone.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Criminal )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070728 ); // You must wait two minutes after committing a criminal act before you can use a Soulstone.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Region.GetLogoutDelay( from ) > TimeSpan.Zero )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070729 ); // In order to use your Soulstone, you must be in a safe log-out location.
|
||||
return false;
|
||||
}
|
||||
else if ( !from.Alive )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070730 ); // You may not use a Soulstone while your character is dead.
|
||||
return false;
|
||||
}
|
||||
else if ( Factions.Sigil.ExistsOn( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070731 ); // You may not use a Soulstone while your character has a faction town sigil.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Spell != null && from.Spell.IsCasting )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070733 ); // You may not use a Soulstone while your character is casting a spell.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Poisoned )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070734 ); // You may not use a Soulstone while your character is poisoned.
|
||||
return false;
|
||||
}
|
||||
else if ( from.Paralyzed )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070735 ); // You may not use a Soulstone while your character is paralyzed.
|
||||
return false;
|
||||
}
|
||||
else if ( now < this.NextUse )
|
||||
{
|
||||
TimeSpan time = this.NextUse - now;
|
||||
|
||||
if ( time.TotalHours > 0.0 )
|
||||
from.SendLocalizedMessage( 1070736, ((int)time.TotalHours).ToString() ); // You must wait ~1_hours~ hours before you can use your Soulstone.
|
||||
else if ( time.TotalMinutes > 0.0 )
|
||||
from.SendLocalizedMessage( 1070737, ((int)time.TotalMinutes).ToString() ); // You must wait ~1_minutes~ minutes before you can use your Soulstone.
|
||||
else
|
||||
from.SendLocalizedMessage( 1070738, ((int)time.TotalSeconds).ToString() ); // You must wait ~1_seconds~ seconds before you can use your Soulstone.
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !CheckUse( from ) )
|
||||
return;
|
||||
|
||||
from.CloseGump( typeof( SelectSkillGump ) );
|
||||
from.CloseGump( typeof( ConfirmSkillGump ) );
|
||||
from.CloseGump( typeof( ConfirmTransferGump ) );
|
||||
from.CloseGump( typeof( ConfirmRemovalGump ) );
|
||||
from.CloseGump( typeof( ErrorGump ) );
|
||||
|
||||
if ( this.IsEmpty )
|
||||
from.SendGump( new SelectSkillGump( this, from ) );
|
||||
else
|
||||
from.SendGump( new ConfirmTransferGump( this, from ) );
|
||||
}
|
||||
|
||||
private class SelectSkillGump : Gump
|
||||
{
|
||||
private SoulStone m_Stone;
|
||||
|
||||
public SelectSkillGump( SoulStone stone, Mobile from ) : base( 50, 50 )
|
||||
{
|
||||
m_Stone = stone;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 520, 440, 0x13BE );
|
||||
|
||||
AddImageTiled( 10, 10, 500, 20, 0xA40 );
|
||||
AddImageTiled( 10, 40, 500, 360, 0xA40 );
|
||||
AddImageTiled( 10, 410, 500, 20, 0xA40 );
|
||||
|
||||
AddAlphaRegion( 10, 10, 500, 420 );
|
||||
|
||||
AddHtmlLocalized( 10, 12, 500, 20, 1061087, 0x7FFF, false, false ); // Which skill do you wish to transfer to the Soulstone?
|
||||
|
||||
AddButton( 10, 410, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 412, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
|
||||
for ( int i = 0, n = 0; i < from.Skills.Length; i++ )
|
||||
{
|
||||
Skill skill = from.Skills[i];
|
||||
|
||||
if ( skill.Base > 0.0 )
|
||||
{
|
||||
int p = n % 30;
|
||||
|
||||
if ( p == 0 )
|
||||
{
|
||||
int page = n / 30;
|
||||
|
||||
if ( page > 0 )
|
||||
{
|
||||
AddButton( 260, 380, 0xFA5, 0xFA6, 0, GumpButtonType.Page, page + 1 );
|
||||
AddHtmlLocalized( 305, 382, 200, 20, 1011066, 0x7FFF, false, false ); // Next page
|
||||
}
|
||||
|
||||
AddPage( page + 1 );
|
||||
|
||||
if ( page > 0 )
|
||||
{
|
||||
AddButton( 10, 380, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page );
|
||||
AddHtmlLocalized( 55, 382, 200, 20, 1011067, 0x7FFF, false, false ); // Previous page
|
||||
}
|
||||
}
|
||||
|
||||
int x = ( p % 2 == 0 ) ? 10 : 260;
|
||||
int y = ( p / 2 ) * 20 + 40;
|
||||
|
||||
AddButton( x, y, 0xFA5, 0xFA6, i + 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( x + 45, y + 2, 200, 20, 1044060 + i, 0x7FFF, false, false );
|
||||
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 0 || !m_Stone.IsEmpty )
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
int iSkill = info.ButtonID - 1;
|
||||
if ( iSkill < 0 || iSkill >= from.Skills.Length )
|
||||
return;
|
||||
|
||||
Skill skill = from.Skills[iSkill];
|
||||
if ( skill.Base <= 0.0 )
|
||||
return;
|
||||
|
||||
if ( !m_Stone.CheckUse( from ) )
|
||||
return;
|
||||
|
||||
from.SendGump( new ConfirmSkillGump( m_Stone, skill ) );
|
||||
}
|
||||
}
|
||||
|
||||
private class ConfirmSkillGump : Gump
|
||||
{
|
||||
private SoulStone m_Stone;
|
||||
private Skill m_Skill;
|
||||
|
||||
public ConfirmSkillGump( SoulStone stone, Skill skill ) : base( 50, 50 )
|
||||
{
|
||||
m_Stone = stone;
|
||||
m_Skill = skill;
|
||||
|
||||
AddBackground( 0, 0, 520, 440, 0x13BE );
|
||||
|
||||
AddImageTiled( 10, 10, 500, 20, 0xA40 );
|
||||
AddImageTiled( 10, 40, 500, 360, 0xA40 );
|
||||
AddImageTiled( 10, 410, 500, 20, 0xA40 );
|
||||
|
||||
AddAlphaRegion( 10, 10, 500, 420 );
|
||||
|
||||
AddHtmlLocalized( 10, 12, 500, 20, 1070709, 0x7FFF, false, false ); // <CENTER>Confirm Soulstone Transfer</CENTER>
|
||||
|
||||
/* <CENTER>Soulstone</CENTER><BR>
|
||||
* You are using a Soulstone. This powerful artifact allows you to remove skill points
|
||||
* from your character and store them in the stone for later retrieval. In order to use
|
||||
* the stone, you must make sure your Skill Lock for the indicated skill is pointed downward.
|
||||
* Click the "Skills" button on your Paperdoll to access the Skill List, and double-check
|
||||
* your skill lock.<BR><BR>
|
||||
*
|
||||
* Once you activate the stone, all skill points in the indicated skill will be removed from
|
||||
* your character. These skill points can later be retrieved. IMPORTANT: When retrieving
|
||||
* skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points
|
||||
* already on your character!<BR><BR>
|
||||
*
|
||||
* This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any
|
||||
* character on the same account as the character who placed them into the stone.
|
||||
*/
|
||||
AddHtmlLocalized( 10, 42, 500, 110, 1061067, 0x7FFF, false, true );
|
||||
|
||||
AddHtmlLocalized( 10, 200, 390, 20, 1062297, 0x7FFF, false, false ); // Skill Chosen:
|
||||
AddHtmlLocalized( 210, 200, 390, 20, 1044060 + skill.SkillID, 0x7FFF, false, false );
|
||||
|
||||
AddHtmlLocalized( 10, 220, 390, 20, 1062298, 0x7FFF, false, false ); // Current Value:
|
||||
AddLabel( 210, 220, 0x481, skill.Base.ToString( "0.0" ) );
|
||||
|
||||
AddHtmlLocalized( 10, 240, 390, 20, 1062299, 0x7FFF, false, false ); // Current Cap:
|
||||
AddLabel( 210, 240, 0x481, skill.Cap.ToString( "0.0" ) );
|
||||
|
||||
AddHtmlLocalized( 10, 260, 390, 20, 1062300, 0x7FFF, false, false ); // New Value:
|
||||
AddLabel( 210, 260, 0x481, "0.0" );
|
||||
|
||||
AddButton( 10, 360, 0xFA5, 0xFA6, 2, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 362, 450, 20, 1070720, 0x7FFF, false, false ); // Activate the stone. I am ready to transfer the skill points to it.
|
||||
|
||||
AddButton( 10, 380, 0xFA5, 0xFA6, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 382, 450, 20, 1062279, 0x7FFF, false, false ); // No, let me make another selection.
|
||||
|
||||
AddButton( 10, 410, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 412, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 0 || !m_Stone.IsEmpty )
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if ( !m_Stone.CheckUse( from ) )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == 1 ) // Is asking for another selection
|
||||
{
|
||||
from.SendGump( new SelectSkillGump( m_Stone, from ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_Skill.Base <= 0.0 )
|
||||
return;
|
||||
|
||||
if ( m_Skill.Lock != SkillLock.Down )
|
||||
{
|
||||
// <CENTER>Unable to Transfer Selected Skill to Soulstone</CENTER>
|
||||
|
||||
/* You cannot transfer the selected skill to the Soulstone at this time. The selected
|
||||
* skill may be locked or set to raise in your skill menu. Click on "Skills" in your
|
||||
* paperdoll menu to check your raise/locked/lower settings and your total skills.
|
||||
* Make any needed adjustments, then click "Continue". If you do not wish to transfer
|
||||
* the selected skill at this time, click "Cancel".
|
||||
*/
|
||||
|
||||
from.SendGump( new ErrorGump( m_Stone, 1070710, 1070711 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
m_Stone.Skill = m_Skill.SkillName;
|
||||
m_Stone.SkillValue = m_Skill.Base;
|
||||
|
||||
m_Skill.Base = 0.0;
|
||||
|
||||
from.SendLocalizedMessage( 1070712 ); // You have successfully transferred your skill points into the Soulstone.
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
|
||||
Effects.PlaySound( from.Location, from.Map, 0x243 );
|
||||
|
||||
Effects.SendMovingParticles( new Entity( Server.Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
|
||||
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
|
||||
}
|
||||
}
|
||||
|
||||
private class ConfirmTransferGump : Gump
|
||||
{
|
||||
private SoulStone m_Stone;
|
||||
|
||||
public ConfirmTransferGump( SoulStone stone, Mobile from ) : base( 50, 50 )
|
||||
{
|
||||
m_Stone = stone;
|
||||
|
||||
AddBackground( 0, 0, 520, 440, 0x13BE );
|
||||
|
||||
AddImageTiled( 10, 10, 500, 20, 0xA40 );
|
||||
AddImageTiled( 10, 40, 500, 360, 0xA40 );
|
||||
AddImageTiled( 10, 410, 500, 20, 0xA40 );
|
||||
|
||||
AddAlphaRegion( 10, 10, 500, 420 );
|
||||
|
||||
AddHtmlLocalized( 10, 12, 500, 20, 1070709, 0x7FFF, false, false ); // <CENTER>Confirm Soulstone Transfer</CENTER>
|
||||
|
||||
/* <CENTER>Soulstone</CENTER><BR>
|
||||
* You are using a Soulstone. This powerful artifact allows you to remove skill points
|
||||
* from your character and store them in the stone for later retrieval. In order to use
|
||||
* the stone, you must make sure your Skill Lock for the indicated skill is pointed downward.
|
||||
* Click the "Skills" button on your Paperdoll to access the Skill List, and double-check
|
||||
* your skill lock.<BR><BR>
|
||||
*
|
||||
* Once you activate the stone, all skill points in the indicated skill will be removed from
|
||||
* your character. These skill points can later be retrieved. IMPORTANT: When retrieving
|
||||
* skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points
|
||||
* already on your character!<BR><BR>
|
||||
*
|
||||
* This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any
|
||||
* character on the same account as the character who placed them into the stone.
|
||||
*/
|
||||
AddHtmlLocalized( 10, 42, 500, 110, 1061067, 0x7FFF, false, true );
|
||||
|
||||
AddHtmlLocalized( 10, 200, 390, 20, 1070718, 0x7FFF, false, false ); // Skill Stored:
|
||||
AddHtmlLocalized( 210, 200, 390, 20, 1044060 + (int)stone.Skill, 0x7FFF, false, false );
|
||||
|
||||
Skill fromSkill = from.Skills[stone.Skill];
|
||||
|
||||
AddHtmlLocalized( 10, 220, 390, 20, 1062298, 0x7FFF, false, false ); // Current Value:
|
||||
AddLabel( 210, 220, 0x481, fromSkill.Base.ToString( "0.0" ) );
|
||||
|
||||
AddHtmlLocalized( 10, 240, 390, 20, 1062299, 0x7FFF, false, false ); // Current Cap:
|
||||
AddLabel( 210, 240, 0x481, fromSkill.Cap.ToString( "0.0" ) );
|
||||
|
||||
AddHtmlLocalized( 10, 260, 390, 20, 1062300, 0x7FFF, false, false ); // New Value:
|
||||
AddLabel( 210, 260, 0x481, stone.SkillValue.ToString( "0.0" ) );
|
||||
|
||||
AddButton( 10, 360, 0xFA5, 0xFA6, 2, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 362, 450, 20, 1070719, 0x7FFF, false, false ); // Activate the stone. I am ready to retrieve the skill points from it.
|
||||
|
||||
AddButton( 10, 380, 0xFA5, 0xFA6, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 382, 450, 20, 1070723, 0x7FFF, false, false ); // Remove all skill points from this stone and DO NOT absorb them.
|
||||
|
||||
AddButton( 10, 410, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 412, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 0 || m_Stone.IsEmpty )
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if ( !m_Stone.CheckUse( from ) )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == 1 ) // Remove skill points
|
||||
{
|
||||
from.SendGump( new ConfirmRemovalGump( m_Stone ) );
|
||||
return;
|
||||
}
|
||||
|
||||
SkillName skill = m_Stone.Skill;
|
||||
double skillValue = m_Stone.SkillValue;
|
||||
Skill fromSkill = from.Skills[m_Stone.Skill];
|
||||
|
||||
/* If we have, say, 88.4 in our skill and the stone holds 100, we need
|
||||
* 11.6 free points. Also, if we're below our skillcap by, say, 8.2 points,
|
||||
* we only need 11.6 - 8.2 = 3.4 points.
|
||||
*/
|
||||
int requiredAmount = (int)(skillValue * 10) - fromSkill.BaseFixedPoint - (from.SkillsCap - from.SkillsTotal);
|
||||
|
||||
bool cannotAbsorb = false;
|
||||
|
||||
if ( fromSkill.Lock != SkillLock.Up )
|
||||
{
|
||||
cannotAbsorb = true;
|
||||
}
|
||||
else if ( requiredAmount > 0 )
|
||||
{
|
||||
int available = 0;
|
||||
|
||||
for ( int i = 0; i < from.Skills.Length; ++i )
|
||||
{
|
||||
if ( from.Skills[i].Lock != SkillLock.Down )
|
||||
continue;
|
||||
|
||||
available += from.Skills[i].BaseFixedPoint;
|
||||
}
|
||||
|
||||
if ( requiredAmount > available )
|
||||
cannotAbsorb = true;
|
||||
}
|
||||
|
||||
//if ( fromSkill.Lock != SkillLock.Up || ( from.SkillsTotal - fromSkill.BaseFixedPoint + (int)(skillValue * 10) > from.SkillsCap ) )
|
||||
if ( cannotAbsorb )
|
||||
{
|
||||
// <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>
|
||||
|
||||
/* You cannot absorb the selected skill from the Soulstone at this time. The selected
|
||||
* skill may be locked or set to lower in your skill menu. You may also be at your
|
||||
* total skill cap. Click on "Skills" in your paperdoll menu to check your
|
||||
* raise/locked/lower settings and your total skills. Make any needed adjustments,
|
||||
* then click "Continue". If you do not wish to transfer the selected skill at this
|
||||
* time, click "Cancel".
|
||||
*/
|
||||
|
||||
from.SendGump( new ErrorGump( m_Stone, 1070717, 1070716 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( skillValue > fromSkill.Cap )
|
||||
{
|
||||
// <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>
|
||||
|
||||
/* The amount of skill stored in this stone exceeds your individual skill cap for
|
||||
* that skill. In order to retrieve the skill points stored in this stone, you must
|
||||
* obtain a Power Scroll of the appropriate type and level in order to increase your
|
||||
* skill cap. You cannot currently retrieve the skill points stored in this stone.
|
||||
*/
|
||||
|
||||
from.SendGump( new ErrorGump( m_Stone, 1070717, 1070715 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( fromSkill.Base >= skillValue )
|
||||
{
|
||||
// <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>
|
||||
|
||||
/* You cannot transfer the selected skill to the Soulstone at this time. The selected
|
||||
* skill has a skill level higher than what is stored in the Soulstone.
|
||||
*/
|
||||
|
||||
// Wrong message?!
|
||||
|
||||
from.SendGump( new ErrorGump( m_Stone, 1070717, 1070802 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( requiredAmount > 0 )
|
||||
{
|
||||
for ( int i = 0; i < from.Skills.Length; ++i )
|
||||
{
|
||||
if ( from.Skills[i].Lock != SkillLock.Down )
|
||||
continue;
|
||||
|
||||
if ( requiredAmount >= from.Skills[i].BaseFixedPoint )
|
||||
{
|
||||
requiredAmount -= from.Skills[i].BaseFixedPoint;
|
||||
from.Skills[i].Base = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Skills[i].BaseFixedPoint -= requiredAmount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fromSkill.Base = skillValue;
|
||||
m_Stone.SkillValue = 0.0;
|
||||
|
||||
m_Stone.NextUse = DateTime.Now + UseDelay;
|
||||
|
||||
from.SendLocalizedMessage( 1070713 ); // You have successfully absorbed the Soulstone's skill points.
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
|
||||
Effects.PlaySound( from.Location, from.Map, 0x243 );
|
||||
|
||||
Effects.SendMovingParticles( new Entity( Server.Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
|
||||
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
|
||||
|
||||
if( m_Stone is SoulstoneFragment )
|
||||
{
|
||||
SoulstoneFragment frag = m_Stone as SoulstoneFragment;
|
||||
|
||||
if( --frag.UsesRemaining <= 0 )
|
||||
from.SendLocalizedMessage( 1070974 ); // You have used up your soulstone fragment.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ConfirmRemovalGump : Gump
|
||||
{
|
||||
private SoulStone m_Stone;
|
||||
|
||||
public ConfirmRemovalGump( SoulStone stone ) : base( 50, 50 )
|
||||
{
|
||||
m_Stone = stone;
|
||||
|
||||
AddBackground( 0, 0, 520, 440, 0x13BE );
|
||||
|
||||
AddImageTiled( 10, 10, 500, 20, 0xA40 );
|
||||
AddImageTiled( 10, 40, 500, 360, 0xA40 );
|
||||
AddImageTiled( 10, 410, 500, 20, 0xA40 );
|
||||
|
||||
AddAlphaRegion( 10, 10, 500, 420 );
|
||||
|
||||
AddHtmlLocalized( 10, 12, 500, 20, 1070725, 0x7FFF, false, false ); // <CENTER>Confirm Soulstone Skill Removal</CENTER>
|
||||
|
||||
/* WARNING!<BR><BR>
|
||||
*
|
||||
* You are about to permanently remove all skill points stored in this Soulstone.
|
||||
* You WILL NOT absorb these skill points. They will be DELETED.<BR><BR>
|
||||
*
|
||||
* Are you sure you wish to do this? If not, press the Cancel button.
|
||||
*/
|
||||
AddHtmlLocalized( 10, 42, 500, 110, 1070724, 0x7FFF, false, true );
|
||||
|
||||
AddButton( 10, 380, 0xFA5, 0xFA6, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 382, 450, 20, 1052072, 0x7FFF, false, false ); // Continue
|
||||
|
||||
AddButton( 10, 410, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 412, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 0 || m_Stone.IsEmpty )
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if ( !m_Stone.CheckUse( from ) )
|
||||
return;
|
||||
|
||||
m_Stone.SkillValue = 0.0;
|
||||
from.SendLocalizedMessage( 1070726 ); // You have successfully deleted the Soulstone's skill points.
|
||||
}
|
||||
}
|
||||
|
||||
private class ErrorGump : Gump
|
||||
{
|
||||
private SoulStone m_Stone;
|
||||
|
||||
public ErrorGump( SoulStone stone, int title, int message ) : base( 50, 50 )
|
||||
{
|
||||
m_Stone = stone;
|
||||
|
||||
AddBackground( 0, 0, 520, 440, 0x13BE );
|
||||
|
||||
AddImageTiled( 10, 10, 500, 20, 0xA40 );
|
||||
AddImageTiled( 10, 40, 500, 360, 0xA40 );
|
||||
AddImageTiled( 10, 410, 500, 20, 0xA40 );
|
||||
|
||||
AddAlphaRegion( 10, 10, 500, 420 );
|
||||
|
||||
AddHtmlLocalized( 10, 12, 500, 20, title, 0x7FFF, false, false );
|
||||
|
||||
AddHtmlLocalized( 10, 42, 500, 110, message, 0x7FFF, false, true );
|
||||
|
||||
AddButton( 10, 380, 0xFA5, 0xFA6, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 382, 450, 20, 1052072, 0x7FFF, false, false ); // Continue
|
||||
|
||||
AddButton( 10, 410, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 45, 412, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 0 )
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if ( !m_Stone.CheckUse( from ) )
|
||||
return;
|
||||
|
||||
if ( m_Stone.IsEmpty )
|
||||
from.SendGump( new SelectSkillGump( m_Stone, from ) );
|
||||
else
|
||||
from.SendGump( new ConfirmTransferGump( m_Stone, from ) );
|
||||
}
|
||||
}
|
||||
|
||||
public SoulStone( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 1 ); // version
|
||||
|
||||
writer.Write( m_ActiveItemID );
|
||||
writer.Write( m_InactiveItemID );
|
||||
|
||||
writer.Write( (string) m_Account );
|
||||
writer.Write( (DateTime) m_NextUse );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Skill );
|
||||
writer.Write( (double) m_SkillValue );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_ActiveItemID = reader.ReadInt();
|
||||
m_InactiveItemID = reader.ReadInt();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Account = reader.ReadString();
|
||||
m_NextUse = reader.ReadDateTime();
|
||||
|
||||
m_Skill = (SkillName)reader.ReadEncodedInt();
|
||||
m_SkillValue = reader.ReadDouble();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( version == 0 )
|
||||
{
|
||||
m_ActiveItemID = 0x2A94;
|
||||
m_InactiveItemID = 0x2A93;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SoulstoneFragment : SoulStone, IUsesRemaining
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
|
||||
public override int LabelNumber { get { return 1071000; } } // soulstone fragment
|
||||
|
||||
[Constructable]
|
||||
public SoulstoneFragment() : this( 5, null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SoulstoneFragment( int usesRemaining ) : this( usesRemaining, null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SoulstoneFragment( string account ) : this( 5, account )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SoulstoneFragment( int usesRemaining, string account ) : base( account, Utility.Random( 0x2AA1, 9 ) )
|
||||
{
|
||||
m_UsesRemaining = usesRemaining;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_UsesRemaining;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value; InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 2 ); // version
|
||||
|
||||
writer.WriteEncodedInt( m_UsesRemaining );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
if( version <= 1 )
|
||||
{
|
||||
if( ItemID == 0x2A93 || ItemID == 0x2A94 )
|
||||
{
|
||||
ActiveItemID = Utility.Random( 0x2AA1, 9 );
|
||||
}
|
||||
else
|
||||
{
|
||||
ActiveItemID = ItemID;
|
||||
}
|
||||
|
||||
InactiveItemID = ActiveItemID;
|
||||
}
|
||||
|
||||
if ( version == 0 && Weight == 1 )
|
||||
Weight = -1;
|
||||
}
|
||||
|
||||
public SoulstoneFragment( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool CheckUse( Mobile from )
|
||||
{
|
||||
bool canUse = base.CheckUse( from );
|
||||
|
||||
if( canUse )
|
||||
{
|
||||
if( m_UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070975 ); // That soulstone fragment has no more uses.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return canUse;
|
||||
}
|
||||
|
||||
|
||||
public bool ShowUsesRemaining{ get{ return true; } set{} }
|
||||
}
|
||||
}
|
||||
368
Scripts/Items/Special/Special Scrolls/PowerScroll.cs
Normal file
368
Scripts/Items/Special/Special Scrolls/PowerScroll.cs
Normal file
|
|
@ -0,0 +1,368 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowerScroll : Item
|
||||
{
|
||||
private SkillName m_Skill;
|
||||
private double m_Value;
|
||||
|
||||
private static SkillName[] m_Skills = new SkillName[]
|
||||
{
|
||||
SkillName.Blacksmith,
|
||||
SkillName.Tailoring,
|
||||
SkillName.Swords,
|
||||
SkillName.Fencing,
|
||||
SkillName.Macing,
|
||||
SkillName.Archery,
|
||||
SkillName.Wrestling,
|
||||
SkillName.Parry,
|
||||
SkillName.Tactics,
|
||||
SkillName.Anatomy,
|
||||
SkillName.Healing,
|
||||
SkillName.Magery,
|
||||
SkillName.Meditation,
|
||||
SkillName.EvalInt,
|
||||
SkillName.MagicResist,
|
||||
SkillName.AnimalTaming,
|
||||
SkillName.AnimalLore,
|
||||
SkillName.Veterinary,
|
||||
SkillName.Musicianship,
|
||||
SkillName.Provocation,
|
||||
SkillName.Discordance,
|
||||
SkillName.Peacemaking
|
||||
};
|
||||
|
||||
private static SkillName[] m_AOSSkills = new SkillName[]
|
||||
{
|
||||
SkillName.Blacksmith,
|
||||
SkillName.Tailoring,
|
||||
SkillName.Swords,
|
||||
SkillName.Fencing,
|
||||
SkillName.Macing,
|
||||
SkillName.Archery,
|
||||
SkillName.Wrestling,
|
||||
SkillName.Parry,
|
||||
SkillName.Tactics,
|
||||
SkillName.Anatomy,
|
||||
SkillName.Healing,
|
||||
SkillName.Magery,
|
||||
SkillName.Meditation,
|
||||
SkillName.EvalInt,
|
||||
SkillName.MagicResist,
|
||||
SkillName.AnimalTaming,
|
||||
SkillName.AnimalLore,
|
||||
SkillName.Veterinary,
|
||||
SkillName.Musicianship,
|
||||
SkillName.Provocation,
|
||||
SkillName.Discordance,
|
||||
SkillName.Peacemaking,
|
||||
SkillName.Chivalry,
|
||||
SkillName.Focus,
|
||||
SkillName.Necromancy,
|
||||
SkillName.Stealing,
|
||||
SkillName.Stealth,
|
||||
SkillName.SpiritSpeak
|
||||
};
|
||||
|
||||
private static SkillName[] m_SESkills = new SkillName[]
|
||||
{
|
||||
SkillName.Blacksmith,
|
||||
SkillName.Tailoring,
|
||||
SkillName.Swords,
|
||||
SkillName.Fencing,
|
||||
SkillName.Macing,
|
||||
SkillName.Archery,
|
||||
SkillName.Wrestling,
|
||||
SkillName.Parry,
|
||||
SkillName.Tactics,
|
||||
SkillName.Anatomy,
|
||||
SkillName.Healing,
|
||||
SkillName.Magery,
|
||||
SkillName.Meditation,
|
||||
SkillName.EvalInt,
|
||||
SkillName.MagicResist,
|
||||
SkillName.AnimalTaming,
|
||||
SkillName.AnimalLore,
|
||||
SkillName.Veterinary,
|
||||
SkillName.Musicianship,
|
||||
SkillName.Provocation,
|
||||
SkillName.Discordance,
|
||||
SkillName.Peacemaking,
|
||||
SkillName.Chivalry,
|
||||
SkillName.Focus,
|
||||
SkillName.Necromancy,
|
||||
SkillName.Stealing,
|
||||
SkillName.Stealth,
|
||||
SkillName.SpiritSpeak,
|
||||
SkillName.Ninjitsu,
|
||||
SkillName.Bushido
|
||||
};
|
||||
|
||||
public static SkillName[] Skills{ get{ return ( Core.SE ? m_SESkills : Core.AOS ? m_AOSSkills : m_Skills ); } }
|
||||
|
||||
public static PowerScroll CreateRandom( int min, int max )
|
||||
{
|
||||
min /= 5;
|
||||
max /= 5;
|
||||
|
||||
SkillName[] skills = PowerScroll.Skills;
|
||||
|
||||
return new PowerScroll( skills[Utility.Random( skills.Length )], 100 + (Utility.RandomMinMax( min, max ) * 5));
|
||||
}
|
||||
|
||||
public static PowerScroll CreateRandomNoCraft( int min, int max )
|
||||
{
|
||||
min /= 5;
|
||||
max /= 5;
|
||||
|
||||
SkillName[] skills = PowerScroll.Skills;
|
||||
SkillName skillName;
|
||||
|
||||
do
|
||||
{
|
||||
skillName = skills[Utility.Random( skills.Length )];
|
||||
} while ( skillName == SkillName.Blacksmith || skillName == SkillName.Tailoring );
|
||||
|
||||
return new PowerScroll( skillName, 100 + (Utility.RandomMinMax( min, max ) * 5));
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowerScroll( SkillName skill, double value ) : base( 0x14F0 )
|
||||
{
|
||||
base.Hue = 0x481;
|
||||
base.Weight = 1.0;
|
||||
|
||||
|
||||
m_Skill = skill;
|
||||
m_Value = value;
|
||||
if ( m_Value > 105.0 )
|
||||
LootType = LootType.Cursed;
|
||||
}
|
||||
|
||||
public PowerScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SkillName Skill
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Skill;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Skill = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public double Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetNameLocalized()
|
||||
{
|
||||
return String.Concat( "#", (1044060 + (int)m_Skill).ToString() );
|
||||
}
|
||||
|
||||
private string GetName()
|
||||
{
|
||||
int index = (int)m_Skill;
|
||||
SkillInfo[] table = SkillInfo.Table;
|
||||
|
||||
if ( index >= 0 && index < table.Length )
|
||||
return table[index].Name.ToLower();
|
||||
else
|
||||
return "???";
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if ( m_Value == 105.0 )
|
||||
list.Add( 1049639, GetNameLocalized() ); // a wonderous scroll of ~1_type~ (105 Skill)
|
||||
else if ( m_Value == 110.0 )
|
||||
list.Add( 1049640, GetNameLocalized() ); // an exalted scroll of ~1_type~ (110 Skill)
|
||||
else if ( m_Value == 115.0 )
|
||||
list.Add( 1049641, GetNameLocalized() ); // a mythical scroll of ~1_type~ (115 Skill)
|
||||
else if ( m_Value == 120.0 )
|
||||
list.Add( 1049642, GetNameLocalized() ); // a legendary scroll of ~1_type~ (120 Skill)
|
||||
else
|
||||
list.Add( "a power scroll of {0} ({1} Skill)", GetName(), m_Value );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if ( m_Value == 105.0 )
|
||||
base.LabelTo( from, 1049639, GetNameLocalized() ); // a wonderous scroll of ~1_type~ (105 Skill)
|
||||
else if ( m_Value == 110.0 )
|
||||
base.LabelTo( from, 1049640, GetNameLocalized() ); // an exalted scroll of ~1_type~ (110 Skill)
|
||||
else if ( m_Value == 115.0 )
|
||||
base.LabelTo( from, 1049641, GetNameLocalized() ); // a mythical scroll of ~1_type~ (115 Skill)
|
||||
else if ( m_Value == 120.0 )
|
||||
base.LabelTo( from, 1049642, GetNameLocalized() ); // a legendary scroll of ~1_type~ (120 Skill)
|
||||
else
|
||||
base.LabelTo( from, "a power scroll of {0} ({1} Skill)", GetName(), m_Value );
|
||||
}
|
||||
|
||||
public void Use( Mobile from, bool firstStage )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
Skill skill = from.Skills[m_Skill];
|
||||
|
||||
if ( skill != null )
|
||||
{
|
||||
if ( skill.Cap >= m_Value )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049511, GetNameLocalized() ); // Your ~1_type~ is too high for this power scroll.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( firstStage )
|
||||
{
|
||||
from.CloseGump( typeof( StatCapScroll.InternalGump ) );
|
||||
from.CloseGump( typeof( PowerScroll.InternalGump ) );
|
||||
from.SendGump( new InternalGump( from, this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049513, GetNameLocalized() ); // You feel a surge of magic as the scroll enhances your ~1_type~!
|
||||
|
||||
skill.Cap = m_Value;
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
|
||||
Effects.PlaySound( from.Location, from.Map, 0x243 );
|
||||
|
||||
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 4, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 4, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
|
||||
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Use( from, true );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Skill );
|
||||
writer.Write( (double) m_Value );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Skill = (SkillName)reader.ReadInt();
|
||||
m_Value = reader.ReadDouble();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Value == 105.0 )
|
||||
{
|
||||
LootType = LootType.Regular;
|
||||
}
|
||||
else
|
||||
{
|
||||
LootType = LootType.Cursed;
|
||||
|
||||
if ( Insured )
|
||||
Insured = false;
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalGump : Gump
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private PowerScroll m_Scroll;
|
||||
|
||||
public InternalGump( Mobile mobile, PowerScroll scroll ) : base( 25, 50 )
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Scroll = scroll;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 25, 10, 420, 200, 5054 );
|
||||
|
||||
AddImageTiled( 33, 20, 401, 181, 2624 );
|
||||
AddAlphaRegion( 33, 20, 401, 181 );
|
||||
|
||||
AddHtmlLocalized( 40, 48, 387, 100, 1049469, true, true ); /* Using a scroll increases the maximum amount of a specific skill or your maximum statistics.
|
||||
* When used, the effect is not immediately seen without a gain of points with that skill or statistics.
|
||||
* You can view your maximum skill values in your skills window.
|
||||
* You can view your maximum statistic value in your statistics window.
|
||||
*/
|
||||
|
||||
AddHtmlLocalized( 125, 148, 200, 20, 1049478, 0xFFFFFF, false, false ); // Do you wish to use this scroll?
|
||||
|
||||
AddButton( 100, 172, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 135, 172, 120, 20, 1046362, 0xFFFFFF, false, false ); // Yes
|
||||
|
||||
AddButton( 275, 172, 4005, 4007, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 310, 172, 120, 20, 1046363, 0xFFFFFF, false, false ); // No
|
||||
|
||||
double value = scroll.m_Value;
|
||||
|
||||
if ( value == 105.0 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049635, 0xFFFFFF, false, false ); // Wonderous Scroll (105 Skill):
|
||||
else if ( value == 110.0 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049636, 0xFFFFFF, false, false ); // Exalted Scroll (110 Skill):
|
||||
else if ( value == 115.0 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049637, 0xFFFFFF, false, false ); // Mythical Scroll (115 Skill):
|
||||
else if ( value == 120.0 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049638, 0xFFFFFF, false, false ); // Legendary Scroll (120 Skill):
|
||||
else
|
||||
AddHtml( 40, 20, 260, 20, String.Format( "<basefont color=#FFFFFF>Power Scroll ({0} Skill):</basefont>", value ), false, false );
|
||||
|
||||
AddHtmlLocalized( 310, 20, 120, 20, 1044060 + (int)scroll.m_Skill, 0xFFFFFF, false, false );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 1 )
|
||||
m_Scroll.Use( m_Mobile, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
204
Scripts/Items/Special/Special Scrolls/StatScroll.cs
Normal file
204
Scripts/Items/Special/Special Scrolls/StatScroll.cs
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StatCapScroll : Item
|
||||
{
|
||||
private int m_Value;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Value;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StatCapScroll( int value ) : base( 0x14F0 )
|
||||
{
|
||||
Hue = 0x481;
|
||||
Weight = 1.0;
|
||||
|
||||
LootType = LootType.Cursed;
|
||||
|
||||
m_Value = value;
|
||||
}
|
||||
|
||||
public StatCapScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if ( m_Value == 230 )
|
||||
list.Add( 1049463, "#1049476" ); // a wonderous scroll of ~1_type~ (+5 Maximum Stats)
|
||||
else if ( m_Value == 235 )
|
||||
list.Add( 1049464, "#1049476" ); // an exalted scroll of ~1_type~ (+10 Maximum Stats)
|
||||
else if ( m_Value == 240 )
|
||||
list.Add( 1049465, "#1049476" ); // a mythical scroll of ~1_type~ (+15 Maximum Stats)
|
||||
else if ( m_Value == 245 )
|
||||
list.Add( 1049466, "#1049476" ); // a legendary scroll of ~1_type~ (+20 Maximum Stats)
|
||||
else if ( m_Value == 250 )
|
||||
list.Add( 1049467, "#1049476" ); // an ultimate scroll of ~1_type~ (+25 Maximum Stats)
|
||||
else
|
||||
list.Add( "a scroll of power ({0}{1} Maximum Stats)", (m_Value - 225) >= 0 ? "+" : "", m_Value - 225 );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if ( m_Value == 230 )
|
||||
base.LabelTo( from, 1049463, "#1049476" ); // a wonderous scroll of ~1_type~ (+5 Maximum Stats)
|
||||
else if ( m_Value == 235 )
|
||||
base.LabelTo( from, 1049464, "#1049476" ); // an exalted scroll of ~1_type~ (+10 Maximum Stats)
|
||||
else if ( m_Value == 240 )
|
||||
base.LabelTo( from, 1049465, "#1049476" ); // a mythical scroll of ~1_type~ (+15 Maximum Stats)
|
||||
else if ( m_Value == 245 )
|
||||
base.LabelTo( from, 1049466, "#1049476" ); // a legendary scroll of ~1_type~ (+20 Maximum Stats)
|
||||
else if ( m_Value == 250 )
|
||||
base.LabelTo( from, 1049467, "#1049476" ); // an ultimate scroll of ~1_type~ (+25 Maximum Stats)
|
||||
else
|
||||
base.LabelTo( from, "a scroll of power ({0}{1} Maximum Stats)", (m_Value - 225) >= 0 ? "+" : "", m_Value - 225 );
|
||||
}
|
||||
|
||||
public void Use( Mobile from, bool firstStage )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
if ( from.StatCap >= m_Value )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049510 ); // Your stats are too high for this power scroll.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( firstStage )
|
||||
{
|
||||
from.CloseGump( typeof( StatCapScroll.InternalGump ) );
|
||||
from.CloseGump( typeof( PowerScroll.InternalGump ) );
|
||||
from.SendGump( new InternalGump( from, this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049512 ); // You feel a surge of magic as the scroll enhances your powers!
|
||||
|
||||
from.StatCap = m_Value;
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
|
||||
Effects.PlaySound( from.Location, from.Map, 0x243 );
|
||||
|
||||
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 4, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 4, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
|
||||
|
||||
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Use( from, true );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Value );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Value = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( LootType != LootType.Cursed )
|
||||
LootType = LootType.Cursed;
|
||||
|
||||
if ( Insured )
|
||||
Insured = false;
|
||||
}
|
||||
|
||||
public class InternalGump : Gump
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private StatCapScroll m_Scroll;
|
||||
|
||||
public InternalGump( Mobile mobile, StatCapScroll scroll ) : base( 25, 50 )
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Scroll = scroll;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 25, 10, 420, 200, 5054 );
|
||||
|
||||
AddImageTiled( 33, 20, 401, 181, 2624 );
|
||||
AddAlphaRegion( 33, 20, 401, 181 );
|
||||
|
||||
AddHtmlLocalized( 40, 48, 387, 100, 1049469, true, true ); /* Using a scroll increases the maximum amount of a specific skill or your maximum statistics.
|
||||
* When used, the effect is not immediately seen without a gain of points with that skill or statistics.
|
||||
* You can view your maximum skill values in your skills window.
|
||||
* You can view your maximum statistic value in your statistics window.
|
||||
*/
|
||||
AddHtmlLocalized( 125, 148, 200, 20, 1049478, 0xFFFFFF, false, false ); // Do you wish to use this scroll?
|
||||
|
||||
AddButton( 100, 172, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 135, 172, 120, 20, 1046362, 0xFFFFFF, false, false ); // Yes
|
||||
|
||||
AddButton( 275, 172, 4005, 4007, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 310, 172, 120, 20, 1046363, 0xFFFFFF, false, false ); // No
|
||||
|
||||
int value = scroll.m_Value;
|
||||
|
||||
if ( value == 230 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049458, 0xFFFFFF, false, false ); // Wonderous Scroll (+5 Maximum Stats):
|
||||
else if ( value == 235 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049459, 0xFFFFFF, false, false ); // Exalted Scroll (+10 Maximum Stats):
|
||||
else if ( value == 240 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049460, 0xFFFFFF, false, false ); // Mythical Scroll (+15 Maximum Stats):
|
||||
else if ( value == 245 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049461, 0xFFFFFF, false, false ); // Legendary Scroll (+20 Maximum Stats):
|
||||
else if ( value == 250 )
|
||||
AddHtmlLocalized( 40, 20, 260, 20, 1049462, 0xFFFFFF, false, false ); // Ultimate Scroll (+25 Maximum Stats):
|
||||
else
|
||||
AddHtml( 40, 20, 260, 20, String.Format( "<basefont color=#FFFFFF>Power Scroll ({0}{1} Maximum Stats):</basefont>", (value - 225) >= 0 ? "+" : "", value - 225), false, false );
|
||||
|
||||
AddHtmlLocalized( 310, 20, 120, 20, 1038019, 0xFFFFFF, false, false ); // Power
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID == 1 )
|
||||
m_Scroll.Use( m_Mobile, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue