This commit is contained in:
parent
2204d5fb86
commit
03fc95bfb7
105 changed files with 9135 additions and 161 deletions
|
|
@ -50,7 +50,7 @@ namespace Server.Items
|
|||
|
||||
public virtual bool RetainDeedHue{ get{ return false; } }
|
||||
|
||||
public void OnChop( Mobile from )
|
||||
public virtual void OnChop( Mobile from )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ namespace Server.Items
|
|||
return ( CouldFit( p, map, null, ref h ) == AddonFitResult.Valid );
|
||||
}
|
||||
|
||||
public AddonFitResult CouldFit( IPoint3D p, Map map, Mobile from, ref BaseHouse house )
|
||||
public virtual AddonFitResult CouldFit( IPoint3D p, Map map, Mobile from, ref BaseHouse house )
|
||||
{
|
||||
if ( Deleted )
|
||||
return AddonFitResult.Blocked;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ namespace Server.Items
|
|||
public virtual int OldDexReq{ get{ return 0; } }
|
||||
public virtual int OldIntReq{ get{ return 0; } }
|
||||
|
||||
public virtual bool CanFortify{ get{ return true; } }
|
||||
|
||||
public override void OnAfterDuped( Item newItem )
|
||||
{
|
||||
BaseArmor armor = newItem as BaseArmor;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArtifactLargeVase : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ArtifactLargeVase() : base( 0x0B47 )
|
||||
{
|
||||
}
|
||||
|
||||
public ArtifactLargeVase( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Champion Artifacts/Decorative/ArtifactVase.cs
Normal file
32
Scripts/Items/Champion Artifacts/Decorative/ArtifactVase.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArtifactVase : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ArtifactVase() : base( 0x0B48 )
|
||||
{
|
||||
}
|
||||
|
||||
public ArtifactVase( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Champion Artifacts/Decorative/DemonSkull.cs
Normal file
33
Scripts/Items/Champion Artifacts/Decorative/DemonSkull.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x2250, 0x2251 )]
|
||||
public class DemonSkull : Item
|
||||
{
|
||||
[Constructable]
|
||||
public DemonSkull() : base( 0x2250 )
|
||||
{
|
||||
}
|
||||
|
||||
public DemonSkull( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Scripts/Items/Champion Artifacts/Decorative/EvilIdolSkull.cs
Normal file
34
Scripts/Items/Champion Artifacts/Decorative/EvilIdolSkull.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EvilIdolSkull : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1095237; } } // Evil Idol
|
||||
|
||||
[Constructable]
|
||||
public EvilIdolSkull() : base( 0x1F18 )
|
||||
{
|
||||
}
|
||||
|
||||
public EvilIdolSkull( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/Items/Champion Artifacts/Decorative/Futon.cs
Normal file
42
Scripts/Items/Champion Artifacts/Decorative/Futon.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable]
|
||||
public class Futon : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Futon() : base( Utility.RandomDouble() > 0.5 ? 0x295C : 0x295E )
|
||||
{
|
||||
}
|
||||
|
||||
public Futon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public void Flip()
|
||||
{
|
||||
switch ( ItemID )
|
||||
{
|
||||
case 0x295C: ItemID = 0x295D; break;
|
||||
case 0x295E: ItemID = 0x295F; break;
|
||||
|
||||
case 0x295D: ItemID = 0x295C; break;
|
||||
case 0x295F: ItemID = 0x295E; break;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Champion Artifacts/Decorative/LavaTile.cs
Normal file
32
Scripts/Items/Champion Artifacts/Decorative/LavaTile.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LavaTile : Item
|
||||
{
|
||||
[Constructable]
|
||||
public LavaTile() : base( 0x12EE )
|
||||
{
|
||||
}
|
||||
|
||||
public LavaTile( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Champion Artifacts/Decorative/Pier.cs
Normal file
32
Scripts/Items/Champion Artifacts/Decorative/Pier.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Pier : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Pier() : base( 0x03AE )
|
||||
{
|
||||
}
|
||||
|
||||
public Pier( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Champion Artifacts/Decorative/SkullPole.cs
Normal file
33
Scripts/Items/Champion Artifacts/Decorative/SkullPole.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SkullPole : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SkullPole() : base( 0x2204 )
|
||||
{
|
||||
Weight = 5;
|
||||
}
|
||||
|
||||
public SkullPole( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Champion Artifacts/Decorative/SwampTile.cs
Normal file
32
Scripts/Items/Champion Artifacts/Decorative/SwampTile.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SwampTile : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SwampTile() : base( 0x320D )
|
||||
{
|
||||
}
|
||||
|
||||
public SwampTile( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TatteredAncientMummyWrapping : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094912; } } // Tattered Ancient Mummy Wrapping [Replica]
|
||||
|
||||
[Constructable]
|
||||
public TatteredAncientMummyWrapping() : base( 0xE21 )
|
||||
{
|
||||
Hue = 0x909;
|
||||
}
|
||||
|
||||
public TatteredAncientMummyWrapping( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Champion Artifacts/Decorative/WallBlood.cs
Normal file
32
Scripts/Items/Champion Artifacts/Decorative/WallBlood.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WallBlood : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WallBlood() : base( 0x1D95 )
|
||||
{
|
||||
}
|
||||
|
||||
public WallBlood( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Champion Artifacts/Decorative/WaterTile.cs
Normal file
32
Scripts/Items/Champion Artifacts/Decorative/WaterTile.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WaterTile : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WaterTile() : base( 0x346E )
|
||||
{
|
||||
}
|
||||
|
||||
public WaterTile( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Scripts/Items/Champion Artifacts/Decorative/Web.cs
Normal file
29
Scripts/Items/Champion Artifacts/Decorative/Web.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Web : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Web() : base( 0x10DD )
|
||||
{
|
||||
}
|
||||
|
||||
public Web( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Scripts/Items/Champion Artifacts/Decorative/WindSpirit.cs
Normal file
34
Scripts/Items/Champion Artifacts/Decorative/WindSpirit.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WindSpirit : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094925; } } // Wind Spirit [Replica]
|
||||
|
||||
[Constructable]
|
||||
public WindSpirit() : base( 0x1F1F )
|
||||
{
|
||||
}
|
||||
|
||||
public WindSpirit( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ANecromancerShroud : Robe
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094913; } } // A Necromancer Shroud [Replica]
|
||||
|
||||
public override int BaseColdResistance{ get{ return 5; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public ANecromancerShroud()
|
||||
{
|
||||
Hue = 0x1;
|
||||
}
|
||||
|
||||
public ANecromancerShroud( 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,53 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BraveKnightOfTheBritannia : Katana
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094909; } } // Brave Knight of The Britannia [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public BraveKnightOfTheBritannia()
|
||||
{
|
||||
Attributes.WeaponSpeed = 30;
|
||||
Attributes.WeaponDamage = 35;
|
||||
|
||||
WeaponAttributes.HitLeechStam = 48;
|
||||
WeaponAttributes.HitHarm = 26;
|
||||
WeaponAttributes.HitLeechHits = 22;
|
||||
}
|
||||
|
||||
public override void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy )
|
||||
{
|
||||
phys = 0;
|
||||
fire = 40;
|
||||
cold = 30;
|
||||
pois = 10;
|
||||
nrgy = 20;
|
||||
}
|
||||
|
||||
public BraveKnightOfTheBritannia( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/Items/Champion Artifacts/Shared/CaptainJohnsHat.cs
Normal file
52
Scripts/Items/Champion Artifacts/Shared/CaptainJohnsHat.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CaptainJohnsHat : TricorneHat
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094911; } } // Captain John's Hat [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 2; } }
|
||||
public override int BaseFireResistance{ get{ return 6; } }
|
||||
public override int BaseColdResistance{ get{ return 9; } }
|
||||
public override int BasePoisonResistance{ get{ return 7; } }
|
||||
public override int BaseEnergyResistance{ get{ return 23; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public CaptainJohnsHat()
|
||||
{
|
||||
Hue = 0x1;
|
||||
|
||||
Attributes.BonusDex = 8;
|
||||
Attributes.NightSight = 1;
|
||||
Attributes.AttackChance = 15;
|
||||
|
||||
SkillBonuses.Skill_1_Name = SkillName.Swords;
|
||||
SkillBonuses.Skill_1_Value = 20;
|
||||
}
|
||||
|
||||
public CaptainJohnsHat( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Scripts/Items/Champion Artifacts/Shared/DetectiveBoots.cs
Normal file
50
Scripts/Items/Champion Artifacts/Shared/DetectiveBoots.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DetectiveBoots : Boots
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094894 + m_Level; } } // [Quality] Detective of the Royal Guard [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
private int m_Level;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Level
|
||||
{
|
||||
get{ return m_Level; }
|
||||
set{ m_Level = Math.Max( Math.Min( 2, value), 0 ); Attributes.BonusInt = 2 + m_Level; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DetectiveBoots()
|
||||
{
|
||||
Level = Utility.RandomMinMax( 0, 2 );
|
||||
}
|
||||
|
||||
public DetectiveBoots( 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();
|
||||
|
||||
Level = Attributes.BonusInt - 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/Champion Artifacts/Shared/DjinnisRing.cs
Normal file
39
Scripts/Items/Champion Artifacts/Shared/DjinnisRing.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DjinnisRing : SilverRing
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094927; } } // Djinni's Ring [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
[Constructable]
|
||||
public DjinnisRing()
|
||||
{
|
||||
Attributes.BonusInt = 5;
|
||||
Attributes.SpellDamage = 10;
|
||||
Attributes.CastSpeed = 2;
|
||||
}
|
||||
|
||||
public DjinnisRing( 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,43 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EmbroideredOakLeafCloak : BaseOuterTorso
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094901; } } // Embroidered Oak Leaf Cloak [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public EmbroideredOakLeafCloak() : base( 0x2684 )
|
||||
{
|
||||
Hue = 0x557;
|
||||
StrRequirement = 0;
|
||||
|
||||
SkillBonuses.Skill_1_Name = SkillName.Stealth;
|
||||
SkillBonuses.Skill_1_Value = 5;
|
||||
}
|
||||
|
||||
public EmbroideredOakLeafCloak( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Champion Artifacts/Shared/GuantletsOfAnger.cs
Normal file
49
Scripts/Items/Champion Artifacts/Shared/GuantletsOfAnger.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GuantletsOfAnger : PlateGloves
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094902; } } // Gauntlets of Anger [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 4; } }
|
||||
public override int BaseFireResistance{ get{ return 4; } }
|
||||
public override int BaseColdResistance{ get{ return 5; } }
|
||||
public override int BasePoisonResistance{ get{ return 6; } }
|
||||
public override int BaseEnergyResistance{ get{ return 5; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public GuantletsOfAnger()
|
||||
{
|
||||
Hue = 0x557;
|
||||
|
||||
Attributes.BonusHits = 8;
|
||||
Attributes.RegenHits = 2;
|
||||
Attributes.DefendChance = 10;
|
||||
}
|
||||
|
||||
public GuantletsOfAnger( 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,43 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LieutenantOfTheBritannianRoyalGuard : BodySash
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094910; } } // Lieutenant of the Britannian Royal Guard [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public LieutenantOfTheBritannianRoyalGuard()
|
||||
{
|
||||
Hue = 0x7B;
|
||||
|
||||
Attributes.BonusInt = 5;
|
||||
Attributes.RegenMana = 2;
|
||||
Attributes.LowerRegCost = 10;
|
||||
}
|
||||
|
||||
public LieutenantOfTheBritannianRoyalGuard( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Scripts/Items/Champion Artifacts/Shared/OblivionsNeedle.cs
Normal file
44
Scripts/Items/Champion Artifacts/Shared/OblivionsNeedle.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class OblivionsNeedle : Dagger
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094916; } } // Oblivion's Needle [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public OblivionsNeedle()
|
||||
{
|
||||
Attributes.BonusStam = 20;
|
||||
Attributes.AttackChance = 20;
|
||||
Attributes.DefendChance = -20;
|
||||
Attributes.WeaponDamage = 40;
|
||||
|
||||
WeaponAttributes.HitLeechStam = 50;
|
||||
}
|
||||
|
||||
public OblivionsNeedle( 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,44 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RoyalGuardSurvivalKnife : SkinningKnife
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094918; } } // Royal Guard Survival Knife [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public RoyalGuardSurvivalKnife()
|
||||
{
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.Luck = 140;
|
||||
Attributes.EnhancePotions = 25;
|
||||
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
WeaponAttributes.LowerStatReq = 50;
|
||||
}
|
||||
|
||||
public RoyalGuardSurvivalKnife( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Champion Artifacts/Shared/SamaritanRobe.cs
Normal file
41
Scripts/Items/Champion Artifacts/Shared/SamaritanRobe.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SamaritanRobe : Robe
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094926; } } // Good Samaritan of Britannia [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 5; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public SamaritanRobe()
|
||||
{
|
||||
Hue = 0x558;
|
||||
}
|
||||
|
||||
public SamaritanRobe( 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,44 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TheMostKnowledgePerson : BaseOuterTorso
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094893; } } // The Most Knowledge Person [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
public override bool CanBeBlessed{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public TheMostKnowledgePerson() : base( 0x2684 )
|
||||
{
|
||||
Hue = 0x242;
|
||||
StrRequirement = 0;
|
||||
|
||||
Attributes.BonusHits = 3 + Utility.RandomMinMax( 0, 2 );
|
||||
}
|
||||
|
||||
public TheMostKnowledgePerson( 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,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TheRobeOfBritanniaAri : BaseOuterTorso
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094931; } } // The Robe of Britannia "Ari" [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 10; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public TheRobeOfBritanniaAri() : base( 0x2684 )
|
||||
{
|
||||
Hue = 0x486;
|
||||
StrRequirement = 0;
|
||||
}
|
||||
|
||||
public TheRobeOfBritanniaAri( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/Items/Champion Artifacts/Unique/AcidProofRobe.cs
Normal file
42
Scripts/Items/Champion Artifacts/Unique/AcidProofRobe.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AcidProofRobe : Robe
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1095236; } } // Acid-Proof Robe [Replica]
|
||||
|
||||
public override int BaseFireResistance{ get{ return 4; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public AcidProofRobe()
|
||||
{
|
||||
Hue = 0x1;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public AcidProofRobe( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Scripts/Items/Champion Artifacts/Unique/Calm.cs
Normal file
44
Scripts/Items/Champion Artifacts/Unique/Calm.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Calm : Halberd
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094915; } } // Calm [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public Calm()
|
||||
{
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.WeaponSpeed = 20;
|
||||
Attributes.WeaponDamage = 50;
|
||||
|
||||
WeaponAttributes.HitLeechMana = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public Calm( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Champion Artifacts/Unique/CrownOfTalKeesh.cs
Normal file
49
Scripts/Items/Champion Artifacts/Unique/CrownOfTalKeesh.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CrownOfTalKeesh : Bandana
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094903; } } // Crown of Tal'Keesh [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 0; } }
|
||||
public override int BaseFireResistance{ get{ return 5; } }
|
||||
public override int BaseColdResistance{ get{ return 9; } }
|
||||
public override int BasePoisonResistance{ get{ return 20; } }
|
||||
public override int BaseEnergyResistance{ get{ return 20; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public CrownOfTalKeesh()
|
||||
{
|
||||
Hue = 0x4F2;
|
||||
|
||||
Attributes.BonusInt = 8;
|
||||
Attributes.RegenMana = 4;
|
||||
Attributes.SpellDamage = 10;
|
||||
}
|
||||
|
||||
public CrownOfTalKeesh( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Champion Artifacts/Unique/FangOfRactus.cs
Normal file
47
Scripts/Items/Champion Artifacts/Unique/FangOfRactus.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FangOfRactus : Kryss
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094892; } } // Fang of Ractus [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public FangOfRactus()
|
||||
{
|
||||
Hue = 0x1D9;
|
||||
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.AttackChance = 5;
|
||||
Attributes.DefendChance = 5;
|
||||
Attributes.WeaponDamage = 35;
|
||||
|
||||
WeaponAttributes.HitPoisonArea = 20;
|
||||
WeaponAttributes.ResistPoisonBonus = 15;
|
||||
}
|
||||
|
||||
public FangOfRactus( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Scripts/Items/Champion Artifacts/Unique/GladiatorsCollar.cs
Normal file
50
Scripts/Items/Champion Artifacts/Unique/GladiatorsCollar.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GladiatorsCollar : PlateGorget
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094917; } } // Gladiator's Collar [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 18; } }
|
||||
public override int BaseFireResistance{ get{ return 18; } }
|
||||
public override int BaseColdResistance{ get{ return 17; } }
|
||||
public override int BasePoisonResistance{ get{ return 18; } }
|
||||
public override int BaseEnergyResistance{ get{ return 16; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public GladiatorsCollar()
|
||||
{
|
||||
Hue = 0x967;
|
||||
|
||||
Attributes.BonusHits = 10;
|
||||
Attributes.AttackChance = 10;
|
||||
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
}
|
||||
|
||||
public GladiatorsCollar( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Champion Artifacts/Unique/OrcChieftainHelm.cs
Normal file
49
Scripts/Items/Champion Artifacts/Unique/OrcChieftainHelm.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class OrcChieftainHelm : OrcHelm
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094924; } } // Orc Chieftain Helm [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 23; } }
|
||||
public override int BaseFireResistance{ get{ return 1; } }
|
||||
public override int BaseColdResistance{ get{ return 23; } }
|
||||
public override int BasePoisonResistance{ get{ return 3; } }
|
||||
public override int BaseEnergyResistance{ get{ return 5; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public OrcChieftainHelm()
|
||||
{
|
||||
Hue = 0x3F;
|
||||
|
||||
Attributes.Luck = 100;
|
||||
Attributes.BonusHits = 30;
|
||||
Attributes.RegenHits = 3;
|
||||
}
|
||||
|
||||
public OrcChieftainHelm( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Champion Artifacts/Unique/Pacify.cs
Normal file
45
Scripts/Items/Champion Artifacts/Unique/Pacify.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Pacify : Pike
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094929; } } // Pacify [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public Pacify()
|
||||
{
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.AttackChance = 10;
|
||||
Attributes.WeaponSpeed = 20;
|
||||
Attributes.WeaponDamage = 50;
|
||||
|
||||
WeaponAttributes.HitLeechMana = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public Pacify( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Champion Artifacts/Unique/Quell.cs
Normal file
45
Scripts/Items/Champion Artifacts/Unique/Quell.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Quell : Bardiche
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094928; } } // Quell [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public Quell()
|
||||
{
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.WeaponSpeed = 20;
|
||||
Attributes.WeaponDamage = 50;
|
||||
Attributes.AttackChance = 10;
|
||||
|
||||
WeaponAttributes.HitLeechMana = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public Quell( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/Items/Champion Artifacts/Unique/ShroudOfDeceit.cs
Normal file
52
Scripts/Items/Champion Artifacts/Unique/ShroudOfDeceit.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ShroudOfDeciet : BoneChest
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094914; } } // Shroud of Deceit [Replica]
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 11; } }
|
||||
public override int BaseFireResistance{ get{ return 6; } }
|
||||
public override int BaseColdResistance{ get{ return 18; } }
|
||||
public override int BasePoisonResistance{ get{ return 15; } }
|
||||
public override int BaseEnergyResistance{ get{ return 13; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public ShroudOfDeciet()
|
||||
{
|
||||
Hue = 0x3D5;
|
||||
|
||||
Attributes.RegenHits = 3;
|
||||
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
|
||||
SkillBonuses.Skill_1_Name = SkillName.MagicResist;
|
||||
SkillBonuses.Skill_1_Value = 10;
|
||||
}
|
||||
|
||||
public ShroudOfDeciet( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Champion Artifacts/Unique/Subdue.cs
Normal file
45
Scripts/Items/Champion Artifacts/Unique/Subdue.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Subdue : Scythe
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1094930; } } // Subdue [Replica]
|
||||
|
||||
public override int InitMinHits{ get{ return 150; } }
|
||||
public override int InitMaxHits{ get{ return 150; } }
|
||||
|
||||
public override bool CanFortify{ get{ return false; } }
|
||||
|
||||
[Constructable]
|
||||
public Subdue()
|
||||
{
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.WeaponSpeed = 20;
|
||||
Attributes.WeaponDamage = 50;
|
||||
Attributes.AttackChance = 10;
|
||||
|
||||
WeaponAttributes.HitLeechMana = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public Subdue( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -41,6 +41,7 @@ namespace Server.Items
|
|||
}
|
||||
#endregion
|
||||
|
||||
public virtual bool CanFortify{ get{ return false; } }
|
||||
|
||||
private int m_MaxHitPoints;
|
||||
private int m_HitPoints;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -155,7 +156,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[Flipable]
|
||||
public class RewardCloak : BaseCloak, Engines.VeteranRewards.IRewardItem
|
||||
public class RewardCloak : BaseCloak, IRewardItem
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
private bool m_IsRewardItem;
|
||||
|
|
@ -209,6 +210,14 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( RewardSystem.GetRewardYearLabel( this, new object[]{ Hue, m_LabelNumber } ) ); // X Year Veteran Reward
|
||||
}
|
||||
|
||||
public override bool CanEquip( Mobile m )
|
||||
{
|
||||
if ( !base.CanEquip( m ) )
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -140,7 +141,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[Flipable]
|
||||
public class RewardRobe : BaseOuterTorso, Engines.VeteranRewards.IRewardItem
|
||||
public class RewardRobe : BaseOuterTorso, IRewardItem
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
private bool m_IsRewardItem;
|
||||
|
|
@ -194,12 +195,20 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( RewardSystem.GetRewardYearLabel( this, new object[]{ Hue, m_LabelNumber } ) ); // X Year Veteran Reward
|
||||
}
|
||||
|
||||
public override bool CanEquip( Mobile m )
|
||||
{
|
||||
if ( !base.CanEquip( m ) )
|
||||
return false;
|
||||
|
||||
return !m_IsRewardItem || Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( m, this, new object[]{ Hue, m_LabelNumber } );
|
||||
return !m_IsRewardItem || RewardSystem.CheckIsUsableBy( m, this, new object[]{ Hue, m_LabelNumber } );
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
|
|
@ -256,6 +265,131 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
[Flipable]
|
||||
public class RewardDress : BaseOuterTorso, IRewardItem
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Number
|
||||
{
|
||||
get{ return m_LabelNumber; }
|
||||
set{ m_LabelNumber = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_LabelNumber > 0 )
|
||||
return m_LabelNumber;
|
||||
|
||||
return base.LabelNumber;
|
||||
}
|
||||
}
|
||||
|
||||
public override int BasePhysicalResistance{ get{ return 3; } }
|
||||
|
||||
public override void OnAdded( object parent )
|
||||
{
|
||||
base.OnAdded( parent );
|
||||
|
||||
if ( parent is Mobile )
|
||||
((Mobile)parent).VirtualArmorMod += 2;
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( parent is Mobile )
|
||||
((Mobile)parent).VirtualArmorMod -= 2;
|
||||
}
|
||||
|
||||
public override bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
from.SendLocalizedMessage( sender.FailMessage );
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( RewardSystem.GetRewardYearLabel( this, new object[]{ Hue, m_LabelNumber } ) ); // X Year Veteran Reward
|
||||
}
|
||||
|
||||
public override bool CanEquip( Mobile m )
|
||||
{
|
||||
if ( !base.CanEquip( m ) )
|
||||
return false;
|
||||
|
||||
return !m_IsRewardItem || RewardSystem.CheckIsUsableBy( m, this, new object[]{ Hue, m_LabelNumber } );
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardDress() : this( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardDress( int hue ) : this( hue, 0 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardDress( int hue, int labelNumber ) : base( 0x1F01, hue )
|
||||
{
|
||||
Weight = 2.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_LabelNumber = labelNumber;
|
||||
}
|
||||
|
||||
public RewardDress( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_LabelNumber );
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_LabelNumber = reader.ReadInt();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( Parent is Mobile )
|
||||
((Mobile)Parent).VirtualArmorMod += 2;
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable]
|
||||
public class Robe : BaseOuterTorso, IArcaneEquip
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,7 +122,9 @@ namespace Server.Items
|
|||
int number;
|
||||
|
||||
BankBox box = from.FindBankNoCreate();
|
||||
|
||||
CommodityDeedBox cox = CommodityDeedBox.Find( this );
|
||||
|
||||
// Veteran Rewards mods
|
||||
if ( m_Commodity != null )
|
||||
{
|
||||
if ( box != null && IsChildOf( box ) )
|
||||
|
|
@ -134,14 +136,46 @@ namespace Server.Items
|
|||
m_Commodity = null;
|
||||
Delete();
|
||||
}
|
||||
else if ( cox != null )
|
||||
{
|
||||
if ( cox.IsSecure )
|
||||
{
|
||||
number = 1047031; // The commodity has been redeemed.
|
||||
|
||||
cox.DropItem( m_Commodity );
|
||||
|
||||
m_Commodity = null;
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
number = 1080525; // The commodity deed box must be secured before you can use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047024; // To claim the resources ....
|
||||
if( Core.ML )
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047024; // To claim the resources ....
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( box == null || !IsChildOf( box ) )
|
||||
else if ( cox != null && !cox.IsSecure )
|
||||
{
|
||||
number = 1047026; // That must be in your bank box to use it.
|
||||
number = 1080525; // The commodity deed box must be secured before you can use it.
|
||||
}
|
||||
else if ( ( box == null || !IsChildOf( box ) ) && cox == null )
|
||||
{
|
||||
if( Core.ML )
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047026; // That must be in your bank box to use it.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -176,8 +210,11 @@ namespace Server.Items
|
|||
else if ( targeted is Item )
|
||||
{
|
||||
BankBox box = from.FindBankNoCreate();
|
||||
CommodityDeedBox cox = CommodityDeedBox.Find( m_Deed );
|
||||
|
||||
if ( box != null && m_Deed.IsChildOf( box ) && ((Item)targeted).IsChildOf( box ) )
|
||||
// Veteran Rewards mods
|
||||
if ( box != null && m_Deed.IsChildOf( box ) && ((Item)targeted).IsChildOf( box ) ||
|
||||
cox != null && cox.IsSecure && ((Item)targeted).IsChildOf( cox ) )
|
||||
{
|
||||
if ( m_Deed.SetCommodity( (Item) targeted ) )
|
||||
{
|
||||
|
|
@ -190,7 +227,14 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
number = 1047026; // That must be in your bank box to use it.
|
||||
if( Core.ML )
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047026; // That must be in your bank box to use it.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ namespace Server.Items
|
|||
|
||||
public abstract class BaseJewel : Item, ICraftable
|
||||
{
|
||||
private int m_MaxHitPoints;
|
||||
private int m_HitPoints;
|
||||
|
||||
private AosAttributes m_AosAttributes;
|
||||
private AosElementAttributes m_AosResistances;
|
||||
private AosSkillBonuses m_AosSkillBonuses;
|
||||
|
|
@ -26,6 +29,36 @@ namespace Server.Items
|
|||
private GemType m_GemType;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxHitPoints
|
||||
{
|
||||
get{ return m_MaxHitPoints; }
|
||||
set{ m_MaxHitPoints = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int HitPoints
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_HitPoints;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( value != m_HitPoints && MaxHitPoints > 0 )
|
||||
{
|
||||
m_HitPoints = value;
|
||||
|
||||
if ( m_HitPoints < 0 )
|
||||
Delete();
|
||||
else if ( m_HitPoints > MaxHitPoints )
|
||||
m_HitPoints = MaxHitPoints;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Player )]
|
||||
public AosAttributes Attributes
|
||||
{
|
||||
get{ return m_AosAttributes; }
|
||||
|
|
@ -67,6 +100,9 @@ namespace Server.Items
|
|||
public override int EnergyResistance{ get{ return m_AosResistances.Energy; } }
|
||||
public virtual int BaseGemTypeNumber{ get{ return 0; } }
|
||||
|
||||
public virtual int InitMinHits{ get{ return 0; } }
|
||||
public virtual int InitMaxHits{ get{ return 0; } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
|
|
@ -101,6 +137,8 @@ namespace Server.Items
|
|||
m_GemType = GemType.None;
|
||||
|
||||
Layer = layer;
|
||||
|
||||
m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );
|
||||
}
|
||||
|
||||
public override void OnAdded( object parent )
|
||||
|
|
@ -236,13 +274,19 @@ namespace Server.Items
|
|||
list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~%
|
||||
|
||||
base.AddResistanceProperties( list );
|
||||
|
||||
if ( m_HitPoints >= 0 && m_MaxHitPoints > 0 )
|
||||
list.Add( 1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints ); // durability ~1_val~ / ~2_val~
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 2 ); // version
|
||||
writer.Write( (int) 3 ); // version
|
||||
|
||||
writer.WriteEncodedInt( (int) m_MaxHitPoints );
|
||||
writer.WriteEncodedInt( (int) m_HitPoints );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_Resource );
|
||||
writer.WriteEncodedInt( (int) m_GemType );
|
||||
|
|
@ -260,6 +304,13 @@ namespace Server.Items
|
|||
|
||||
switch ( version )
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
m_MaxHitPoints = reader.ReadEncodedInt();
|
||||
m_HitPoints = reader.ReadEncodedInt();
|
||||
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadEncodedInt();
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ namespace Server.Items
|
|||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( item );
|
||||
|
||||
if ( house == null || !house.IsLockedDown( item ) )
|
||||
if ( house == null || ( !house.IsLockedDown( item ) && !house.IsSecure( item ) ) )
|
||||
from.SendLocalizedMessage( 501022 ); // Furniture must be locked down to paint it.
|
||||
else if ( !house.IsCoOwner( from ) )
|
||||
from.SendLocalizedMessage( 501023 ); // You must be the owner to use this item.
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
|
|
|||
|
|
@ -35,6 +35,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076220 ); // 4st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
|
|
|||
|
|
@ -34,6 +34,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076221 ); // 5st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
|
|
|||
|
|
@ -110,6 +110,12 @@ namespace Server.Items
|
|||
{
|
||||
BaseArmor ar = (BaseArmor)targeted;
|
||||
|
||||
if ( !ar.CanFortify )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ar.IsChildOf( from.Backpack ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = ar.MaxHitPoints;
|
||||
|
|
@ -168,6 +174,12 @@ namespace Server.Items
|
|||
{
|
||||
BaseWeapon wep = (BaseWeapon)targeted;
|
||||
|
||||
if ( !wep.CanFortify )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( wep.IsChildOf( from.Backpack ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = wep.MaxHitPoints;
|
||||
|
|
@ -226,6 +238,12 @@ namespace Server.Items
|
|||
{
|
||||
BaseClothing clothing = (BaseClothing)targeted;
|
||||
|
||||
if ( !clothing.CanFortify )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( clothing.IsChildOf( from.Backpack ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = clothing.MaxHitPoints;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,12 @@ namespace Server.Items
|
|||
|
||||
public void Construct()
|
||||
{
|
||||
foreach ( AddonComponent c in Components )
|
||||
{
|
||||
c.Addon = null;
|
||||
c.Delete();
|
||||
}
|
||||
|
||||
Components.Clear();
|
||||
|
||||
MiniHouseInfo info = MiniHouseInfo.GetInfo( m_Type );
|
||||
|
|
@ -40,7 +46,8 @@ namespace Server.Items
|
|||
|
||||
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 );
|
||||
if ( info.Graphics[num] != 0x1 ) // Veteran Rewards Mod
|
||||
AddComponent( new AddonComponent( info.Graphics[num++] ), size - x - 1, size - y - 1, 0 );
|
||||
}
|
||||
|
||||
public MiniHouseAddon( Serial serial ) : base( serial )
|
||||
|
|
@ -162,7 +169,9 @@ namespace Server.Items
|
|||
TwoStoryVilla,
|
||||
SandstoneHouseWithPatio,
|
||||
SmallStoneWorkshop,
|
||||
SmallMarbleWorkshop
|
||||
SmallMarbleWorkshop,
|
||||
MalasMountainPass, //Veteran reward house
|
||||
ChurchAtNight //Veteran reward house
|
||||
}
|
||||
|
||||
public class MiniHouseInfo
|
||||
|
|
@ -210,7 +219,9 @@ namespace Server.Items
|
|||
/* 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 )
|
||||
/* Small marble workshop */ new MiniHouseInfo( 0x22F4, 1, 1011322 ),
|
||||
/* Malas Mountain Pass */ new MiniHouseInfo( 1062692, 0x2316, 0x2315, 0x2314, 0x2313 ),
|
||||
/* Church At Night */ new MiniHouseInfo( 1072215, 0x2318, 0x2317, 0x2319, 0x1 )
|
||||
};
|
||||
|
||||
public static MiniHouseInfo GetInfo( MiniHouseType type )
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Server.Multis;
|
|||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -33,7 +34,16 @@ namespace Server.Items
|
|||
FireElemental,
|
||||
Wolf,
|
||||
PhillipsWoodenSteed,
|
||||
Seahorse
|
||||
Seahorse,
|
||||
Harrower,
|
||||
Efreet,
|
||||
Slime,
|
||||
PlagueBeast,
|
||||
RedDeath,
|
||||
Spider,
|
||||
OphidianArchMage,
|
||||
OphidianWarrior,
|
||||
DreadHorn
|
||||
}
|
||||
|
||||
public class MonsterStatuetteInfo
|
||||
|
|
@ -41,10 +51,12 @@ namespace Server.Items
|
|||
private int m_LabelNumber;
|
||||
private int m_ItemID;
|
||||
private int[] m_Sounds;
|
||||
private int m_Hue;
|
||||
|
||||
public int LabelNumber{ get{ return m_LabelNumber; } }
|
||||
public int ItemID{ get{ return m_ItemID; } }
|
||||
public int[] Sounds{ get{ return m_Sounds; } }
|
||||
public int Hue{ get{ return m_Hue; } }
|
||||
|
||||
public MonsterStatuetteInfo( int labelNumber, int itemID, int baseSoundID )
|
||||
{
|
||||
|
|
@ -53,33 +65,49 @@ namespace Server.Items
|
|||
m_Sounds = new int[]{ baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 };
|
||||
}
|
||||
|
||||
public MonsterStatuetteInfo( int labelNumber, int itemID, int[] sounds )
|
||||
{
|
||||
m_LabelNumber = labelNumber;
|
||||
m_ItemID = itemID;
|
||||
m_Sounds = sounds;
|
||||
}
|
||||
|
||||
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 ),
|
||||
/* 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 ),
|
||||
/* Lich */ new MonsterStatuetteInfo( 1041256, 0x20F8, 1001 ),
|
||||
/* Lizardman */ new MonsterStatuetteInfo( 1041257, 0x20DE, 417 ),
|
||||
/* Ogre */ new MonsterStatuetteInfo( 1041258, 0x20DF, 427 ),
|
||||
/* Orc */ new MonsterStatuetteInfo( 1041259, 0x20E0, 1114 ),
|
||||
/* 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 ),
|
||||
/* Troll */ new MonsterStatuetteInfo( 1041262, 0x20E9, 461 ),
|
||||
/* Cow */ new MonsterStatuetteInfo( 1041263, 0x2103, 120 ),
|
||||
/* Zombie */ new MonsterStatuetteInfo( 1041264, 0x20EC, 471 ),
|
||||
/* Llama */ new MonsterStatuetteInfo( 1041265, 0x20F6, 1011 ),
|
||||
/* 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 ),
|
||||
/* 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, 168 ),
|
||||
/* Seahorse */ new MonsterStatuetteInfo( 1070819, 0x25BA, 138 )
|
||||
/* Wolf */ new MonsterStatuetteInfo( 1049770, 0x2122, 229 ),
|
||||
/* Phillip's Steed */ new MonsterStatuetteInfo( 1063488, 0x3FFE, 168 ),
|
||||
/* Seahorse */ new MonsterStatuetteInfo( 1070819, 0x25BA, 138 ),
|
||||
/* Harrower */ new MonsterStatuetteInfo( 1080520, 0x25BB, new int[] { 0x289, 0x28A, 0x28B } ),
|
||||
/* Efreet */ new MonsterStatuetteInfo( 1080521, 0x2590, 0x300 ),
|
||||
/* Slime */ new MonsterStatuetteInfo( 1015246, 0x20E8, 456 ),
|
||||
/* PlagueBeast */ new MonsterStatuetteInfo( 1029747, 0x2613, 0x1BF ),
|
||||
/* RedDeath */ new MonsterStatuetteInfo( 1094932, 0x2617, new int[] { } ),
|
||||
/* Spider */ new MonsterStatuetteInfo( 1029668, 0x25C4, 1170 ),
|
||||
/* OphidianArchMage */ new MonsterStatuetteInfo( 1029641, 0x25A9, 639 ),
|
||||
/* OphidianWarrior */ new MonsterStatuetteInfo( 1029645, 0x25AD, 634 ),
|
||||
/* DreadHorn */ new MonsterStatuetteInfo( 1031651, 0x2D83, 0xA8 )
|
||||
};
|
||||
|
||||
public static MonsterStatuetteInfo GetInfo( MonsterStatuetteType type )
|
||||
|
|
@ -93,7 +121,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public class MonsterStatuette : Item, Engines.VeteranRewards.IRewardItem
|
||||
public class MonsterStatuette : Item, IRewardItem
|
||||
{
|
||||
private MonsterStatuetteType m_Type;
|
||||
private bool m_TurnedOn;
|
||||
|
|
@ -121,6 +149,14 @@ namespace Server.Items
|
|||
{
|
||||
m_Type = value;
|
||||
ItemID = MonsterStatuetteInfo.GetInfo( m_Type ).ItemID;
|
||||
|
||||
if( m_Type == MonsterStatuetteType.Slime )
|
||||
Hue = Utility.RandomSlimeHue();
|
||||
else if( m_Type == MonsterStatuetteType.RedDeath )
|
||||
Hue = 0x21;
|
||||
else
|
||||
Hue = 0;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -146,6 +182,11 @@ namespace Server.Items
|
|||
LootType = LootType.Blessed;
|
||||
|
||||
m_Type = type;
|
||||
|
||||
if( m_Type == MonsterStatuetteType.Slime )
|
||||
Hue = Utility.RandomSlimeHue();
|
||||
else if( m_Type == MonsterStatuetteType.RedDeath )
|
||||
Hue = 0x21;
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement{ get{ return m_TurnedOn && IsLockedDown; } }
|
||||
|
|
@ -156,7 +197,8 @@ namespace Server.Items
|
|||
{
|
||||
int[] sounds = MonsterStatuetteInfo.GetInfo( m_Type ).Sounds;
|
||||
|
||||
Effects.PlaySound( this.Location, this.Map, sounds[Utility.Random( sounds.Length )] );
|
||||
if( sounds.Length > 0 )
|
||||
Effects.PlaySound( this.Location, this.Map, sounds[Utility.Random( sounds.Length )] );
|
||||
}
|
||||
|
||||
base.OnMovement( m, oldLocation );
|
||||
|
|
@ -170,6 +212,9 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( RewardSystem.GetRewardYearLabel( this, new object[]{ m_Type } ) ); // X Year Veteran Reward
|
||||
|
||||
if ( m_TurnedOn )
|
||||
list.Add( 502695 ); // turned on
|
||||
else
|
||||
|
|
|
|||
|
|
@ -3,16 +3,27 @@ using Server;
|
|||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Accounting;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SoulStone : Item
|
||||
public class SoulStone : Item, ISecurable
|
||||
{
|
||||
public override int LabelNumber { get { return 1030899; } } // soulstone
|
||||
|
||||
private int m_ActiveItemID;
|
||||
private int m_InactiveItemID;
|
||||
|
||||
private SecureLevel m_Level;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get{ return m_Level; }
|
||||
set{ m_Level = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual int ActiveItemID
|
||||
{
|
||||
|
|
@ -725,7 +736,9 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 1 ); // version
|
||||
writer.WriteEncodedInt( 2 ); // version
|
||||
|
||||
writer.Write( (int)m_Level );
|
||||
|
||||
writer.Write( m_ActiveItemID );
|
||||
writer.Write( m_InactiveItemID );
|
||||
|
|
@ -745,6 +758,11 @@ namespace Server.Items
|
|||
|
||||
switch( version )
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_ActiveItemID = reader.ReadInt();
|
||||
|
|
@ -924,7 +942,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public class RedSoulstone : SoulStone
|
||||
public class RedSoulstone : SoulStone, IRewardItem
|
||||
{
|
||||
[Constructable]
|
||||
public RedSoulstone()
|
||||
|
|
@ -944,11 +962,30 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 ); // version
|
||||
writer.Write( (int)1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -956,6 +993,15 @@ namespace Server.Items
|
|||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
|
|
@ -72,7 +73,13 @@ namespace Server.Items
|
|||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
if ( from.StatCap >= m_Value )
|
||||
int NewValue = m_Value;
|
||||
if ( from is PlayerMobile && ((PlayerMobile)from).HasStatReward )
|
||||
{
|
||||
NewValue += 5;
|
||||
}
|
||||
|
||||
if ( from.StatCap >= NewValue )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049510 ); // Your stats are too high for this power scroll.
|
||||
}
|
||||
|
|
@ -88,7 +95,7 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 1049512 ); // You feel a surge of magic as the scroll enhances your powers!
|
||||
|
||||
from.StatCap = m_Value;
|
||||
from.StatCap = NewValue;
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
|
||||
Effects.PlaySound( from.Location, from.Map, 0x243 );
|
||||
|
|
|
|||
329
Scripts/Items/Special/Veteran Rewards/AnkhOfSacrifice.cs
Normal file
329
Scripts/Items/Special/Veteran Rewards/AnkhOfSacrifice.cs
Normal file
|
|
@ -0,0 +1,329 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AnkhOfSacrificeComponent : AddonComponent
|
||||
{
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
public override int LabelNumber{ get{ return 1027772; } } // Ankh of Sacrifice
|
||||
|
||||
public AnkhOfSacrificeComponent( int itemID ) : base( itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public AnkhOfSacrificeComponent( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if ( from is PlayerMobile )
|
||||
list.Add( new LockKarmaEntry( (PlayerMobile)from, Addon as AnkhOfSacrificeAddon ) );
|
||||
|
||||
list.Add( new ResurrectEntry( from, Addon as AnkhOfSacrificeAddon ) );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
|
||||
{
|
||||
if ( m == null )
|
||||
{
|
||||
}
|
||||
else if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
m.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( m.Alive )
|
||||
{
|
||||
m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
|
||||
}
|
||||
else if ( m.AnkhNextUse > DateTime.Now )
|
||||
{
|
||||
TimeSpan delay = m.AnkhNextUse - DateTime.Now;
|
||||
|
||||
if ( delay.TotalMinutes > 0 )
|
||||
m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
|
||||
else
|
||||
m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.
|
||||
}
|
||||
else
|
||||
{
|
||||
m.CloseGump( typeof( AnkhResurrectGump ) );
|
||||
m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
|
||||
}
|
||||
}
|
||||
|
||||
private class ResurrectEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private AnkhOfSacrificeAddon m_Ankh;
|
||||
|
||||
public ResurrectEntry( Mobile mobile, AnkhOfSacrificeAddon ankh ) : base( 6195, 2 )
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Ankh = ankh;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if ( m_Ankh == null || m_Ankh.Deleted )
|
||||
return;
|
||||
|
||||
Resurrect( m_Mobile as PlayerMobile, m_Ankh );
|
||||
}
|
||||
}
|
||||
|
||||
private class LockKarmaEntry : ContextMenuEntry
|
||||
{
|
||||
private PlayerMobile m_Mobile;
|
||||
private AnkhOfSacrificeAddon m_Ankh;
|
||||
|
||||
public LockKarmaEntry( PlayerMobile mobile, AnkhOfSacrificeAddon ankh ) : base( mobile.KarmaLocked ? 6197 : 6196, 2 )
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Ankh = ankh;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if ( !m_Mobile.InRange( m_Ankh.GetWorldLocation(), 2 ) )
|
||||
m_Mobile.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
else
|
||||
{
|
||||
m_Mobile.KarmaLocked = !m_Mobile.KarmaLocked;
|
||||
|
||||
if ( m_Mobile.KarmaLocked )
|
||||
m_Mobile.SendLocalizedMessage( 1060192 ); // Your karma has been locked. Your karma can no longer be raised.
|
||||
else
|
||||
m_Mobile.SendLocalizedMessage( 1060191 ); // Your karma has been unlocked. Your karma can be raised again.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AnkhResurrectGump : ResurrectGump
|
||||
{
|
||||
public AnkhResurrectGump( Mobile owner, ResurrectMessage msg ) : base( owner, owner, msg, false )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if( info.ButtonID == 1 || info.ButtonID == 2 )
|
||||
{
|
||||
if( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
|
||||
return;
|
||||
}
|
||||
|
||||
if ( from is PlayerMobile )
|
||||
{
|
||||
((PlayerMobile) from).AnkhNextUse = DateTime.Now + TimeSpan.FromHours( 1 );
|
||||
}
|
||||
|
||||
base.OnResponse( state, info );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public class AnkhOfSacrificeAddon : BaseAddon, IRewardItem
|
||||
{
|
||||
public override bool HandlesOnMovement{ get{ return true; } }
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
AnkhOfSacrificeDeed deed = new AnkhOfSacrificeDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AnkhOfSacrificeAddon( bool east ) : base()
|
||||
{
|
||||
if ( east )
|
||||
{
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1D98 ), 0, 0, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1D97 ), 0, 1, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CD6 ), 1, 0, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CD4 ), 1, 1, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CD0 ), 2, 0, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CCE ), 2, 1, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1E5D ), 0, 0, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1E5C ), 1, 0, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CD2 ), 0, 1, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CD8 ), 1, 1, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CCD ), 0, 2, 0 );
|
||||
AddComponent( new AnkhOfSacrificeComponent( 0x1CCE ), 1, 2, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
public AnkhOfSacrificeAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
if ( !m.Alive && Utility.InRange( Location, m.Location, 1 ) && !Utility.InRange( Location, oldLocation, 1 ) )
|
||||
AnkhOfSacrificeComponent.Resurrect( m as PlayerMobile, this );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class AnkhOfSacrificeDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080397; } } // Deed For An Ankh Of Sacrifice
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
AnkhOfSacrificeAddon addon = new AnkhOfSacrificeAddon( m_East );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_East;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AnkhOfSacrificeDeed() : this( false )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AnkhOfSacrificeDeed( bool isRewardItem ) : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_IsRewardItem = isRewardItem;
|
||||
}
|
||||
|
||||
public AnkhOfSacrificeDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardOptionGump ) );
|
||||
from.SendGump( new RewardOptionGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1080457 ); // 10th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public void GetOptions( RewardOptionList list )
|
||||
{
|
||||
list.Add( 1, 1080398 ); // Ankh of Sacrifice South
|
||||
list.Add( 2, 1080399 ); // Ankh of Sacrifice East
|
||||
}
|
||||
|
||||
public void OnOptionSelected( Mobile from, int option )
|
||||
{
|
||||
switch ( option )
|
||||
{
|
||||
case 1: m_East = false; break;
|
||||
case 2: m_East = true; break;
|
||||
}
|
||||
|
||||
if ( !Deleted )
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
}
|
||||
386
Scripts/Items/Special/Veteran Rewards/Banner.cs
Normal file
386
Scripts/Items/Special/Veteran Rewards/Banner.cs
Normal file
|
|
@ -0,0 +1,386 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Banner : Item, IAddon, IDyable, IRewardItem
|
||||
{
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
|
||||
public Item Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
BannerDeed deed = new BannerDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool FacingSouth
|
||||
{
|
||||
get{ return ( ItemID & 0x1 ) == 0; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Banner( int itemID ) : base( itemID )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public Banner( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( Location, 2 ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardDemolitionGump ) );
|
||||
from.SendGump( new RewardDemolitionGump( this, 1018318 ) ); // Do you wish to re-deed this banner?
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1018330 ); // You can only re-deed a banner if you placed it or you are the owner of the house.
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
if ( map == null || !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
|
||||
return false;
|
||||
|
||||
if ( FacingSouth )
|
||||
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 class BannerDeed : Item, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041007; } } // a banner deed
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
[Constructable]
|
||||
public BannerDeed() : base( 0x14F0 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public BannerDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public const int Start = 0x15AE;
|
||||
public const int End = 0x15F4;
|
||||
|
||||
private BannerDeed m_Banner;
|
||||
|
||||
public InternalGump( BannerDeed banner ) : base( 100, 200 )
|
||||
{
|
||||
m_Banner = banner;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 25, 0, 520, 230, 0xA28 );
|
||||
AddLabel( 70, 12, 0x3E3, "Choose a Banner:" );
|
||||
|
||||
|
||||
int itemID = Start;
|
||||
|
||||
for ( int i = 1; i <= 4; i++ )
|
||||
{
|
||||
AddPage( i );
|
||||
|
||||
for ( int j = 0; j < 8; j++, itemID += 2 )
|
||||
{
|
||||
AddItem( 50 + 60 * j, 70, itemID );
|
||||
AddButton( 50 + 60 * j, 50, 0x845, 0x846, itemID, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
if ( i > 1 )
|
||||
AddButton( 75, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, i - 1 );
|
||||
|
||||
if ( i < 4 )
|
||||
AddButton( 475, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, i + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Banner == null | m_Banner.Deleted )
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID >= Start && info.ButtonID <= End )
|
||||
{
|
||||
if ( ( info.ButtonID & 0x1 ) == 0 )
|
||||
{
|
||||
m.SendLocalizedMessage( 1042037 ); // Where would you like to place this banner?
|
||||
m.Target = new InternalTarget( m_Banner, info.ButtonID );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private BannerDeed m_Banner;
|
||||
private int m_ItemID;
|
||||
|
||||
public InternalTarget( BannerDeed banner, int itemID ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Banner = banner;
|
||||
m_ItemID = itemID;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Banner == null || m_Banner.Deleted )
|
||||
return;
|
||||
|
||||
if ( m_Banner.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if ( p == null || map == null )
|
||||
return;
|
||||
|
||||
Point3D p3d = new Point3D( p );
|
||||
ItemData id = TileData.ItemTable[ m_ItemID & 0x3FFF ];
|
||||
|
||||
if ( map.CanFit( p3d, id.Height ) )
|
||||
{
|
||||
house = BaseHouse.FindHouseAt( p3d, map, id.Height );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
|
||||
bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );
|
||||
|
||||
if ( north && west )
|
||||
{
|
||||
from.CloseGump( typeof( FacingGump ) );
|
||||
from.SendGump( new FacingGump( m_Banner, m_ItemID, p3d, house ) );
|
||||
}
|
||||
else if ( north || west )
|
||||
{
|
||||
Banner banner = null;
|
||||
|
||||
if ( north )
|
||||
banner = new Banner( m_ItemID );
|
||||
else if ( west )
|
||||
banner = new Banner( m_ItemID + 1 );
|
||||
|
||||
house.Addons.Add( banner );
|
||||
|
||||
banner.IsRewardItem = m_Banner.IsRewardItem;
|
||||
banner.MoveToWorld( p3d, map );
|
||||
|
||||
m_Banner.Delete();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042039 ); // The banner must be placed next to a wall.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 500269 ); // You cannot build that there.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
private class FacingGump : Gump
|
||||
{
|
||||
private BannerDeed m_Banner;
|
||||
private int m_ItemID;
|
||||
private Point3D m_Location;
|
||||
private BaseHouse m_House;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
East,
|
||||
South
|
||||
}
|
||||
|
||||
public FacingGump( BannerDeed banner, int itemID, Point3D location, BaseHouse house ) : base( 150, 50 )
|
||||
{
|
||||
m_Banner = banner;
|
||||
m_ItemID = itemID;
|
||||
m_Location = location;
|
||||
m_House = house;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
|
||||
AddItem( 90, 30, itemID + 1 );
|
||||
AddItem( 180, 30, itemID );
|
||||
|
||||
AddButton( 50, 35, 0x868, 0x869, (int) Buttons.East, GumpButtonType.Reply, 0 );
|
||||
AddButton( 145, 35, 0x868, 0x869, (int) Buttons.South, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Banner == null || m_Banner.Deleted || m_House == null )
|
||||
return;
|
||||
|
||||
Banner banner = null;
|
||||
|
||||
if ( info.ButtonID == (int) Buttons.East )
|
||||
banner = new Banner( m_ItemID + 1 );
|
||||
if ( info.ButtonID == (int) Buttons.South )
|
||||
banner = new Banner( m_ItemID );
|
||||
|
||||
if ( banner != null )
|
||||
{
|
||||
m_House.Addons.Add( banner );
|
||||
|
||||
banner.IsRewardItem = m_Banner.IsRewardItem;
|
||||
banner.MoveToWorld( m_Location, sender.Mobile.Map );
|
||||
|
||||
m_Banner.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
194
Scripts/Items/Special/Veteran Rewards/BloodyPentagram.cs
Normal file
194
Scripts/Items/Special/Veteran Rewards/BloodyPentagram.cs
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BloodyPentagramComponent : AddonComponent
|
||||
{
|
||||
public override bool DisplayWeight{ get{ return false; } }
|
||||
public override int LabelNumber{ get{ return 1080279; } } // Bloody Pentagram
|
||||
|
||||
public BloodyPentagramComponent( int itemID ) : base( itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public BloodyPentagramComponent( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodyPentagramAddon : BaseAddon, IRewardItem
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
BloodyPentagramDeed deed = new BloodyPentagramDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BloodyPentagramAddon() : base()
|
||||
{
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF9 ), 0, 1, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF8 ), 0, 2, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF7 ), 0, 3, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF6 ), 0, 4, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF5 ), 0, 5, 0 );
|
||||
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CFB ), 1, 0, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CFA ), 1, 1, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D09 ), 1, 2, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D08 ), 1, 3, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D07 ), 1, 4, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF4 ), 1, 5, 0 );
|
||||
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CFC ), 2, 0, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D0A ), 2, 1, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D11 ), 2, 2, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D10 ), 2, 3, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D06 ), 2, 4, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF3 ), 2, 5, 0 );
|
||||
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CFD ), 3, 0, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D0B ), 3, 1, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D12 ), 3, 2, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D0F ), 3, 3, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D05 ), 3, 4, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF2 ), 3, 5, 0 );
|
||||
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CFE ), 4, 0, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D0C ), 4, 1, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D0D ), 4, 2, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D0E ), 4, 3, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D04 ), 4, 4, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CF1 ), 4, 5, 0 );
|
||||
|
||||
AddComponent( new BloodyPentagramComponent( 0x1CFF ), 5, 0, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D00 ), 5, 1, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D01 ), 5, 2, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D02 ), 5, 3, 0 );
|
||||
AddComponent( new BloodyPentagramComponent( 0x1D03 ), 5, 4, 0 );
|
||||
}
|
||||
|
||||
public BloodyPentagramAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodyPentagramDeed : BaseAddonDeed, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080384; } } // Bloody Pentagram
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
BloodyPentagramAddon addon = new BloodyPentagramAddon();
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BloodyPentagramDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BloodyPentagramDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076221 ); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
237
Scripts/Items/Special/Veteran Rewards/Brazier.cs
Normal file
237
Scripts/Items/Special/Veteran Rewards/Brazier.cs
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RewardBrazier : Item, IRewardItem
|
||||
{
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private Item m_Fire;
|
||||
|
||||
private static int[] m_Art = new int[]
|
||||
{
|
||||
0x19AA, 0x19BB
|
||||
};
|
||||
|
||||
[Constructable]
|
||||
public RewardBrazier() : this( Utility.RandomList( m_Art ) )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardBrazier( int itemID ) : base( itemID )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 10.0;
|
||||
}
|
||||
|
||||
public RewardBrazier( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public void TurnOff()
|
||||
{
|
||||
if ( m_Fire != null )
|
||||
{
|
||||
m_Fire.Delete();
|
||||
m_Fire = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void TurnOn()
|
||||
{
|
||||
if ( m_Fire == null )
|
||||
m_Fire = new Item();
|
||||
|
||||
m_Fire.ItemID = 0x19AB;
|
||||
m_Fire.Movable = false;
|
||||
m_Fire.MoveToWorld( new Point3D( X, Y, Z + ItemData.Height + 2 ), Map );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
else if ( IsLockedDown )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
if ( m_Fire != null )
|
||||
TurnOff();
|
||||
else
|
||||
TurnOn();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502436 ); // That is not accessible.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
|
||||
}
|
||||
|
||||
public override void OnLocationChange( Point3D old )
|
||||
{
|
||||
if ( m_Fire != null )
|
||||
m_Fire.MoveToWorld( new Point3D( X, Y, Z + ItemData.Height ), Map );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076222 ); // 6th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (Item) m_Fire );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
m_Fire = reader.ReadItem();
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardBrazierDeed : Item, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080527; } } // Brazier Deed
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardBrazierDeed() : base( 0x14F0 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public RewardBrazierDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076222 ); // 6th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private RewardBrazierDeed m_Brazier;
|
||||
|
||||
public InternalGump( RewardBrazierDeed brazier ) : base( 100, 200 )
|
||||
{
|
||||
m_Brazier = brazier;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
AddBackground( 0, 0, 200, 200, 2600 );
|
||||
|
||||
AddPage( 1 );
|
||||
AddLabel( 45, 15, 0, "Choose a Brazier:" );
|
||||
|
||||
AddItem( 40, 75, 0x19AA );
|
||||
AddButton( 55, 50, 0x845, 0x846, 0x19AA, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 100, 75, 0x19BB );
|
||||
AddButton( 115, 50, 0x845, 0x846, 0x19BB, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Brazier == null | m_Brazier.Deleted )
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID == 0x19AA || info.ButtonID == 0x19BB )
|
||||
{
|
||||
RewardBrazier brazier = new RewardBrazier( info.ButtonID );
|
||||
brazier.IsRewardItem = m_Brazier.IsRewardItem;
|
||||
|
||||
if ( !m.PlaceInBackpack( brazier ) )
|
||||
{
|
||||
brazier.Delete();
|
||||
m.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
|
||||
}
|
||||
else
|
||||
m_Brazier.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
469
Scripts/Items/Special/Veteran Rewards/Cannon.cs
Normal file
469
Scripts/Items/Special/Veteran Rewards/Cannon.cs
Normal file
|
|
@ -0,0 +1,469 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Engines.Quests.Haven;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CannonAddonComponent : AddonComponent
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1076157; } } // Decorative Cannon
|
||||
|
||||
public CannonAddonComponent( int itemID ) : base( itemID )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CannonAddonComponent( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Addon is CannonAddon )
|
||||
{
|
||||
if ( ((CannonAddon) Addon).IsRewardItem )
|
||||
list.Add( 1076223 ); // 7th Year Veteran Reward
|
||||
|
||||
list.Add( 1076207, ((CannonAddon) Addon).Charges.ToString() ); // Remaining Charges: ~1_val~
|
||||
}
|
||||
}
|
||||
|
||||
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 CannonAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
CannonDeed deed = new CannonDeed();
|
||||
deed.Charges = m_Charges;
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private CannonDirection m_CannonDirection;
|
||||
private int m_Charges;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CannonDirection CannonDirection
|
||||
{
|
||||
get{ return m_CannonDirection; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Charges
|
||||
{
|
||||
get{ return m_Charges; }
|
||||
set
|
||||
{
|
||||
m_Charges = value;
|
||||
|
||||
foreach ( AddonComponent c in Components )
|
||||
c.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
|
||||
foreach ( AddonComponent c in Components )
|
||||
c.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CannonAddon( CannonDirection direction )
|
||||
{
|
||||
m_CannonDirection = direction;
|
||||
|
||||
switch ( direction )
|
||||
{
|
||||
case CannonDirection.North:
|
||||
{
|
||||
AddComponent( new CannonAddonComponent( 0xE8D ), 0, 0, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE8C ), 0, 1, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE8B ), 0, 2, 0 );
|
||||
|
||||
break;
|
||||
}
|
||||
case CannonDirection.East:
|
||||
{
|
||||
AddComponent( new CannonAddonComponent( 0xE96 ), 0, 0, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE95 ), -1, 0, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE94 ), -2, 0, 0 );
|
||||
|
||||
break;
|
||||
}
|
||||
case CannonDirection.South:
|
||||
{
|
||||
AddComponent( new CannonAddonComponent( 0xE91 ), 0, 0, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE92 ), 0, -1, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE93 ), 0, -2, 0 );
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
AddComponent( new CannonAddonComponent( 0xE8E ), 0, 0, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE8F ), 1, 0, 0 );
|
||||
AddComponent( new CannonAddonComponent( 0xE90 ), 2, 0, 0 );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CannonAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnComponentUsed( AddonComponent c, Mobile from )
|
||||
{
|
||||
if ( from.InRange( Location, 2 ) )
|
||||
{
|
||||
if ( m_Charges > 0 )
|
||||
{
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( from.Backpack != null )
|
||||
{
|
||||
PotionKeg keg = from.Backpack.FindItemByType( typeof( PotionKeg ) ) as PotionKeg;
|
||||
|
||||
if ( Validate( keg ) > 0 )
|
||||
from.SendGump( new InternalGump( this, keg ) );
|
||||
else
|
||||
from.SendLocalizedMessage( 1076198 ); // You do not have a full keg of explosion potions needed to recharge the cannon.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1076766 ); // That is too far away.
|
||||
}
|
||||
|
||||
public int Validate( PotionKeg keg )
|
||||
{
|
||||
if ( keg != null && !keg.Deleted && keg.Held == 100 )
|
||||
{
|
||||
if ( keg.Type == PotionEffect.ExplosionLesser )
|
||||
return 5;
|
||||
else if ( keg.Type == PotionEffect.Explosion )
|
||||
return 10;
|
||||
else if ( keg.Type == PotionEffect.ExplosionGreater )
|
||||
return 15;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void Fill( Mobile from, PotionKeg keg )
|
||||
{
|
||||
Charges = Validate( keg );
|
||||
|
||||
if ( Charges > 0 )
|
||||
{
|
||||
keg.Delete();
|
||||
from.SendLocalizedMessage( 1076199 ); // Your cannon is recharged.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1076198 ); // You do not have a full keg of explosion potions needed to recharge the cannon.
|
||||
}
|
||||
|
||||
private static int[] m_Effects = new int[]
|
||||
{
|
||||
0x36B0, 0x3728, 0x3709, 0x36FE
|
||||
};
|
||||
|
||||
public void DoFireEffect( IPoint3D target )
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if ( target == null || map == null )
|
||||
return;
|
||||
|
||||
Effects.PlaySound( target, map, Utility.RandomList( 0x11B, 0x11C, 0x11D ) );
|
||||
Effects.SendLocationEffect( target, map, Utility.RandomList( m_Effects ), 16, 1 );
|
||||
|
||||
for ( int count = Utility.Random( 3 ); count > 0; count-- )
|
||||
{
|
||||
IPoint3D location = new Point3D( target.X + Utility.RandomMinMax( -1, 1 ), target.Y + Utility.RandomMinMax( -1, 1 ), target.Z );
|
||||
int effect = Utility.RandomList( m_Effects );
|
||||
Effects.SendLocationEffect( location, map, effect, 16, 1 );
|
||||
}
|
||||
|
||||
Charges -= 1;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (int) m_CannonDirection );
|
||||
writer.Write( (int) m_Charges );
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_CannonDirection = (CannonDirection) reader.ReadInt();
|
||||
m_Charges = reader.ReadInt();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CannonAddon m_Cannon;
|
||||
|
||||
public InternalTarget( CannonAddon cannon ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Cannon = cannon;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Cannon == null || m_Cannon.Deleted )
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if ( p == null )
|
||||
return;
|
||||
|
||||
if ( from.InLOS( new Point3D( p ) ) )
|
||||
{
|
||||
if ( !Utility.InRange( new Point3D( p ), m_Cannon.Location, 2 ) )
|
||||
{
|
||||
bool allow = false;
|
||||
|
||||
int x = p.X - m_Cannon.X;
|
||||
int y = p.Y - m_Cannon.Y;
|
||||
|
||||
switch ( m_Cannon.CannonDirection )
|
||||
{
|
||||
case CannonDirection.North:
|
||||
if ( y < 0 && Math.Abs( x ) <= -y / 3 )
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.East:
|
||||
if ( x > 0 && Math.Abs( y ) <= x / 3 )
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.South:
|
||||
if ( y > 0 && Math.Abs( x ) <= y / 3 )
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.West:
|
||||
if ( x < 0 && Math.Abs( y ) <= -x / 3 )
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ( allow && Utility.InRange( new Point3D( p ), m_Cannon.Location, 14 ) )
|
||||
m_Cannon.DoFireEffect( p );
|
||||
else
|
||||
from.SendLocalizedMessage( 1076203 ); // Target out of range.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1076215 ); // Cannon must be aimed farther away.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1049630 ); // You cannot see that target!
|
||||
}
|
||||
|
||||
protected override void OnTargetOutOfRange( Mobile from, object targeted )
|
||||
{
|
||||
from.SendLocalizedMessage( 1076203 ); // Target out of range.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private CannonAddon m_Cannon;
|
||||
private PotionKeg m_Keg;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
Recharge
|
||||
}
|
||||
|
||||
public InternalGump( CannonAddon cannon, PotionKeg keg ) : base( 50, 50 )
|
||||
{
|
||||
m_Cannon = cannon;
|
||||
m_Keg = keg;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 291, 133, 0x13BE );
|
||||
AddImageTiled( 5, 5, 280, 100, 0xA40 );
|
||||
|
||||
AddHtmlLocalized( 9, 9, 272, 100, 1076196, cannon.Validate( keg ).ToString(), 0x7FFF, false, false ); // You will need a full keg of explosion potions to recharge the cannon. Your keg will provide ~1_CHARGES~ charges.
|
||||
|
||||
AddButton( 5, 107, 0xFB1, 0xFB2, (int) Buttons.Cancel, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 40, 109, 100, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
|
||||
AddButton( 160, 107, 0xFB7, 0xFB8, (int) Buttons.Recharge, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 195, 109, 120, 20, 1076197, 0x7FFF, false, false ); // Recharge
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if ( m_Cannon == null || m_Cannon.Deleted )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == (int) Buttons.Recharge )
|
||||
m_Cannon.Fill( state.Mobile, m_Keg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CannonDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1076195; } } // A deed for a cannon
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
CannonAddon addon = new CannonAddon( m_Direction );
|
||||
addon.Charges = m_Charges;
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private CannonDirection m_Direction;
|
||||
private int m_Charges;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Charges
|
||||
{
|
||||
get{ return m_Charges; }
|
||||
set{ m_Charges = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CannonDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CannonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076223 ); // 7th Year Veteran Reward
|
||||
|
||||
list.Add( 1076207, m_Charges.ToString() ); // Remaining Charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardOptionGump ) );
|
||||
from.SendGump( new RewardOptionGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Charges );
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_Charges = reader.ReadInt();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public void GetOptions( RewardOptionList list )
|
||||
{
|
||||
list.Add( (int) CannonDirection.South, 1075386 ); // South
|
||||
list.Add( (int) CannonDirection.East, 1075387 ); // East
|
||||
list.Add( (int) CannonDirection.North, 1075389 ); // North
|
||||
list.Add( (int) CannonDirection.West, 1075390 ); // West
|
||||
}
|
||||
|
||||
public void OnOptionSelected( Mobile from, int option )
|
||||
{
|
||||
m_Direction = (CannonDirection) option;
|
||||
|
||||
if ( !Deleted )
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
}
|
||||
69
Scripts/Items/Special/Veteran Rewards/CommodityDeedBox.cs
Normal file
69
Scripts/Items/Special/Veteran Rewards/CommodityDeedBox.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Furniture]
|
||||
public class CommodityDeedBox : BaseContainer, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get { return 1080523; } } // Commodity Deed Box
|
||||
public override int DefaultGumpID{ get{ return 0x43; } }
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CommodityDeedBox() : base( 0x9AA )
|
||||
{
|
||||
Hue = 0x47;
|
||||
Weight = 4.0;
|
||||
}
|
||||
|
||||
public CommodityDeedBox( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public static CommodityDeedBox Find( Item deed )
|
||||
{
|
||||
Item parent = deed;
|
||||
|
||||
while ( parent != null && !( parent is CommodityDeedBox ) )
|
||||
parent = parent.Parent as Item;
|
||||
|
||||
return parent as CommodityDeedBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
132
Scripts/Items/Special/Veteran Rewards/ContestMiniHouse.cs
Normal file
132
Scripts/Items/Special/Veteran Rewards/ContestMiniHouse.cs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ContestMiniHouse : MiniHouseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
ContestMiniHouseDeed deed = new ContestMiniHouseDeed( Type );
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouse() : base( MiniHouseType.MalasMountainPass )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouse( MiniHouseType type ) : base( type )
|
||||
{
|
||||
}
|
||||
|
||||
public ContestMiniHouse( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class ContestMiniHouseDeed : MiniHouseDeed, IRewardItem
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
ContestMiniHouse addon = new ContestMiniHouse( Type );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouseDeed() : base( MiniHouseType.MalasMountainPass )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ContestMiniHouseDeed( MiniHouseType type ) : base( type )
|
||||
{
|
||||
}
|
||||
|
||||
public ContestMiniHouseDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, new object[] { Type } ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
400
Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs
Normal file
400
Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DecorativeShield : Item, IAddon, IRewardItem
|
||||
{
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
|
||||
public Item Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
DecorativeShieldDeed deed = new DecorativeShieldDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool FacingSouth
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ItemID < 0x1582 )
|
||||
return ( ItemID & 0x1 ) == 0;
|
||||
|
||||
return ItemID <= 0x1585;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DecorativeShield() : this( 0x156C )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DecorativeShield( int itemID ) : base( itemID )
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public DecorativeShield( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076220 ); // 4th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( Location, 2 ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardDemolitionGump ) );
|
||||
from.SendGump( new RewardDemolitionGump( this, 1049783 ) ); // Do you wish to re-deed this decoration?
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1049784 ); // You can only re-deed this decoration if you are the house owner or originally placed the decoration.
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
if ( map == null || !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
|
||||
return false;
|
||||
|
||||
if ( FacingSouth )
|
||||
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 class DecorativeShieldDeed : Item, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1049771; } } // deed for a decorative shield wall hanging
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DecorativeShieldDeed() : base( 0x14F0 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public DecorativeShieldDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076220 ); // 4th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public static int GetWestItemID( int east )
|
||||
{
|
||||
switch ( east )
|
||||
{
|
||||
case 0x1582: return 0x1635;
|
||||
case 0x1583: return 0x1634;
|
||||
case 0x1584: return 0x1637;
|
||||
case 0x1585: return 0x1636;
|
||||
default: return east + 1;
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public const int Start = 0x156C;
|
||||
public const int End = 0x1585;
|
||||
|
||||
private DecorativeShieldDeed m_Shield;
|
||||
private int m_Page;
|
||||
|
||||
public InternalGump( DecorativeShieldDeed shield ) : this( shield, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public InternalGump( DecorativeShieldDeed shield, int page ) : base( 150, 50 )
|
||||
{
|
||||
m_Shield = shield;
|
||||
m_Page = page;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 25, 0, 500, 230, 0xA28 );
|
||||
|
||||
int itemID = Start;
|
||||
|
||||
for ( int i = 1; i <= 2; i++ )
|
||||
{
|
||||
AddPage( i );
|
||||
|
||||
for ( int j = 0; j < 9 - i; j++ )
|
||||
{
|
||||
AddItem( 40 + j * 60, 70, itemID );
|
||||
AddButton( 60 + j * 60, 50, 0x845, 0x846, itemID, GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( itemID < 0x1582 )
|
||||
itemID += 2;
|
||||
else
|
||||
itemID += 1;
|
||||
}
|
||||
|
||||
switch ( i )
|
||||
{
|
||||
case 1: AddButton( 455, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 2 ); break;
|
||||
case 2: AddButton( 70, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 1 ); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Shield == null | m_Shield.Deleted )
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID >= Start && info.ButtonID <= End )
|
||||
{
|
||||
if ( ( info.ButtonID & 0x1 ) == 0 && info.ButtonID < 0x1582 || info.ButtonID >= 0x1582 && info.ButtonID <= 0x1585 )
|
||||
{
|
||||
m.SendLocalizedMessage( 1049780 ); // Where would you like to place this decoration?
|
||||
m.Target = new InternalTarget( m_Shield, info.ButtonID );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private DecorativeShieldDeed m_Shield;
|
||||
private int m_ItemID;
|
||||
|
||||
public InternalTarget( DecorativeShieldDeed shield, int itemID ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Shield = shield;
|
||||
m_ItemID = itemID;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Shield == null || m_Shield.Deleted )
|
||||
return;
|
||||
|
||||
if ( m_Shield.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if ( p == null || map == null )
|
||||
return;
|
||||
|
||||
Point3D p3d = new Point3D( p );
|
||||
ItemData id = TileData.ItemTable[ m_ItemID & 0x3FFF ];
|
||||
|
||||
if ( map.CanFit( p3d, id.Height ) )
|
||||
{
|
||||
house = BaseHouse.FindHouseAt( p3d, map, id.Height );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
|
||||
bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );
|
||||
|
||||
if ( north && west )
|
||||
{
|
||||
from.CloseGump( typeof( FacingGump ) );
|
||||
from.SendGump( new FacingGump( m_Shield, m_ItemID, p3d, house ) );
|
||||
}
|
||||
else if ( north || west )
|
||||
{
|
||||
DecorativeShield shield = null;
|
||||
|
||||
if ( north )
|
||||
shield = new DecorativeShield( m_ItemID );
|
||||
else if ( west )
|
||||
shield = new DecorativeShield( GetWestItemID( m_ItemID ) );
|
||||
|
||||
house.Addons.Add( shield );
|
||||
|
||||
shield.IsRewardItem = m_Shield.IsRewardItem;
|
||||
shield.MoveToWorld( p3d, map );
|
||||
|
||||
m_Shield.Delete();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1049781 ); // This decoration must be placed next to a wall.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 500269 ); // You cannot build that there.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
private class FacingGump : Gump
|
||||
{
|
||||
private DecorativeShieldDeed m_Shield;
|
||||
private int m_ItemID;
|
||||
private Point3D m_Location;
|
||||
private BaseHouse m_House;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
South,
|
||||
East
|
||||
}
|
||||
|
||||
public FacingGump( DecorativeShieldDeed shield, int itemID, Point3D location, BaseHouse house ) : base( 150, 50 )
|
||||
{
|
||||
m_Shield = shield;
|
||||
m_ItemID = itemID;
|
||||
m_Location = location;
|
||||
m_House = house;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
|
||||
AddItem( 90, 30, GetWestItemID( itemID ) );
|
||||
AddItem( 180, 30, itemID );
|
||||
|
||||
AddButton( 50, 35, 0x867, 0x869, (int) Buttons.East, GumpButtonType.Reply, 0 );
|
||||
AddButton( 145, 35, 0x867, 0x869, (int) Buttons.South, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Shield == null || m_Shield.Deleted || m_House == null )
|
||||
return;
|
||||
|
||||
DecorativeShield shield = null;
|
||||
|
||||
if ( info.ButtonID == (int) Buttons.East )
|
||||
shield = new DecorativeShield( GetWestItemID( m_ItemID ) );
|
||||
if ( info.ButtonID == (int) Buttons.South )
|
||||
shield = new DecorativeShield( m_ItemID );
|
||||
|
||||
if ( shield != null )
|
||||
{
|
||||
m_House.Addons.Add( shield );
|
||||
|
||||
shield.IsRewardItem = m_Shield.IsRewardItem;
|
||||
shield.MoveToWorld( m_Location, sender.Mobile.Map );
|
||||
|
||||
m_Shield.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
257
Scripts/Items/Special/Veteran Rewards/FlamingHead.cs
Normal file
257
Scripts/Items/Special/Veteran Rewards/FlamingHead.cs
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FlamingHead : StoneFaceTrapNoDamage, IAddon, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041266; } } // Flaming Head
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
|
||||
public Item Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
FlamingHeadDeed deed = new FlamingHeadDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlamingHead() : this( StoneFaceTrapType.NorthWall )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlamingHead( StoneFaceTrapType type ) : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Movable = false;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public FlamingHead( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( Location, 2 ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardDemolitionGump ) );
|
||||
from.SendGump( new RewardDemolitionGump( this, 1018329 ) ); // Do you wish to re-deed this skull?
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1018328 ); // You can only re-deed a skull if you placed it or you are the owner of the house.
|
||||
}
|
||||
else
|
||||
from.Say( 1019045 ); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
if ( map == null || !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
|
||||
return false;
|
||||
|
||||
if ( Type == StoneFaceTrapType.NorthWestWall )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ) && BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // north and west wall
|
||||
else if ( Type == StoneFaceTrapType.NorthWall )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
|
||||
else if ( Type == StoneFaceTrapType.WestWall )
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class FlamingHeadDeed : Item, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041050; } } // a flaming head deed
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlamingHeadDeed() : base( 0x14F0 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public FlamingHeadDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042264 ); // Where would you like to place this head?
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502115 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private FlamingHeadDeed m_Head;
|
||||
|
||||
public InternalTarget( FlamingHeadDeed head ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Head = head;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Head == null || m_Head.Deleted )
|
||||
return;
|
||||
|
||||
if ( m_Head.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if ( p == null || map == null )
|
||||
return;
|
||||
|
||||
Point3D p3d = new Point3D( p );
|
||||
ItemData id = TileData.ItemTable[ 0x10F5 ];
|
||||
|
||||
house = BaseHouse.FindHouseAt( p3d, map, id.Height );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
if ( map.CanFit( p3d, id.Height ) )
|
||||
{
|
||||
bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
|
||||
bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );
|
||||
|
||||
FlamingHead head = null;
|
||||
|
||||
if ( north && west )
|
||||
head = new FlamingHead( StoneFaceTrapType.NorthWestWall );
|
||||
else if ( north )
|
||||
head = new FlamingHead( StoneFaceTrapType.NorthWall );
|
||||
else if ( west )
|
||||
head = new FlamingHead( StoneFaceTrapType.WestWall );
|
||||
|
||||
if ( north || west )
|
||||
{
|
||||
house.Addons.Add( head );
|
||||
|
||||
head.IsRewardItem = m_Head.IsRewardItem;
|
||||
head.MoveToWorld( p3d, map );
|
||||
|
||||
m_Head.Delete();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042266 ); // The head must be placed next to a wall.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042266 ); // The head must be placed next to a wall.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502115 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
390
Scripts/Items/Special/Veteran Rewards/HangingSkeleton.cs
Normal file
390
Scripts/Items/Special/Veteran Rewards/HangingSkeleton.cs
Normal file
|
|
@ -0,0 +1,390 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HangingSkeleton : Item, IAddon, IRewardItem
|
||||
{
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
|
||||
public Item Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
HangingSkeletonDeed deed = new HangingSkeletonDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool FacingSouth
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ItemID == 0x1A03 || ItemID == 0x1A05 || ItemID == 0x1A09 ||
|
||||
ItemID == 0x1B1E || ItemID == 0x1B7F )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HangingSkeleton() : this( 0x1596 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HangingSkeleton( int itemID ) : base( itemID )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public HangingSkeleton( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076220 ); // 4th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( Location, 3 ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardDemolitionGump ) );
|
||||
from.SendGump( new RewardDemolitionGump( this, 1049783 ) ); // Do you wish to re-deed this decoration?
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1049784 ); // You can only re-deed this decoration if you are the house owner or originally placed the decoration.
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
if ( map == null || !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
|
||||
return false;
|
||||
|
||||
if ( FacingSouth )
|
||||
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 class HangingSkeletonDeed : Item, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1049772; } } // deed for a hanging skeleton decoration
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HangingSkeletonDeed() : base( 0x14F0 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public HangingSkeletonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076220 ); // 4th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public static int GetWestItemID( int south )
|
||||
{
|
||||
switch ( south )
|
||||
{
|
||||
case 0x1B1E: return 0x1B1D;
|
||||
case 0x1B7F: return 0x1B7C;
|
||||
default: return south + 1;
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private HangingSkeletonDeed m_Skeleton;
|
||||
|
||||
public InternalGump( HangingSkeletonDeed skeleton ) : base( 100, 200 )
|
||||
{
|
||||
m_Skeleton = skeleton;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 25, 0, 500, 230, 0xA28 );
|
||||
|
||||
AddPage( 1 );
|
||||
|
||||
AddItem( 130, 70, 0x1A03 );
|
||||
AddButton( 150, 50, 0x845, 0x846, 0x1A03, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 190, 70, 0x1A05 );
|
||||
AddButton( 210, 50, 0x845, 0x846, 0x1A05, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 250, 70, 0x1A09 );
|
||||
AddButton( 270, 50, 0x845, 0x846, 0x1A09, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 310, 70, 0x1B1E );
|
||||
AddButton( 330, 50, 0x845, 0x846, 0x1B1E, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 370, 70, 0x1B7F );
|
||||
AddButton( 390, 50, 0x845, 0x846, 0x1B7F, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Skeleton == null | m_Skeleton.Deleted )
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID == 0x1A03 || info.ButtonID == 0x1A05 || info.ButtonID == 0x1A09 ||
|
||||
info.ButtonID == 0x1B1E || info.ButtonID == 0x1B7F )
|
||||
{
|
||||
m.SendLocalizedMessage( 1049780 ); // Where would you like to place this decoration?
|
||||
m.Target = new InternalTarget( m_Skeleton, info.ButtonID );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private HangingSkeletonDeed m_Skeleton;
|
||||
private int m_ItemID;
|
||||
|
||||
public InternalTarget( HangingSkeletonDeed banner, int itemID ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Skeleton = banner;
|
||||
m_ItemID = itemID;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Skeleton == null || m_Skeleton.Deleted )
|
||||
return;
|
||||
|
||||
if ( m_Skeleton.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if ( p == null || map == null )
|
||||
return;
|
||||
|
||||
Point3D p3d = new Point3D( p );
|
||||
ItemData id = TileData.ItemTable[ m_ItemID & 0x3FFF ];
|
||||
|
||||
if ( map.CanFit( p3d, id.Height ) )
|
||||
{
|
||||
house = BaseHouse.FindHouseAt( p3d, map, id.Height );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
|
||||
bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );
|
||||
|
||||
if ( north && west )
|
||||
{
|
||||
from.CloseGump( typeof( FacingGump ) );
|
||||
from.SendGump( new FacingGump( m_Skeleton, m_ItemID, p3d, house ) );
|
||||
}
|
||||
else if ( north || west )
|
||||
{
|
||||
HangingSkeleton banner = null;
|
||||
|
||||
if ( north )
|
||||
banner = new HangingSkeleton( m_ItemID );
|
||||
else if ( west )
|
||||
banner = new HangingSkeleton( GetWestItemID( m_ItemID ) );
|
||||
|
||||
house.Addons.Add( banner );
|
||||
|
||||
banner.IsRewardItem = m_Skeleton.IsRewardItem;
|
||||
banner.MoveToWorld( p3d, map );
|
||||
|
||||
m_Skeleton.Delete();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042039 ); // The banner must be placed next to a wall.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 500269 ); // You cannot build that there.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
private class FacingGump : Gump
|
||||
{
|
||||
private HangingSkeletonDeed m_Skeleton;
|
||||
private int m_ItemID;
|
||||
private Point3D m_Location;
|
||||
private BaseHouse m_House;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
South,
|
||||
East
|
||||
}
|
||||
|
||||
public FacingGump( HangingSkeletonDeed banner, int itemID, Point3D location, BaseHouse house ) : base( 150, 50 )
|
||||
{
|
||||
m_Skeleton = banner;
|
||||
m_ItemID = itemID;
|
||||
m_Location = location;
|
||||
m_House = house;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
|
||||
AddItem( 90, 30, GetWestItemID( itemID ) );
|
||||
AddItem( 180, 30, itemID );
|
||||
|
||||
AddButton( 50, 35, 0x868, 0x869, (int) Buttons.East, GumpButtonType.Reply, 0 );
|
||||
AddButton( 145, 35, 0x868, 0x869, (int) Buttons.South, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Skeleton == null || m_Skeleton.Deleted || m_House == null )
|
||||
return;
|
||||
|
||||
HangingSkeleton banner = null;
|
||||
|
||||
if ( info.ButtonID == (int) Buttons.East )
|
||||
banner = new HangingSkeleton( GetWestItemID( m_ItemID ) );
|
||||
if ( info.ButtonID == (int) Buttons.South )
|
||||
banner = new HangingSkeleton( m_ItemID );
|
||||
|
||||
if ( banner != null )
|
||||
{
|
||||
m_House.Addons.Add( banner );
|
||||
|
||||
banner.IsRewardItem = m_Skeleton.IsRewardItem;
|
||||
banner.MoveToWorld( m_Location, sender.Mobile.Map );
|
||||
|
||||
m_Skeleton.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
404
Scripts/Items/Special/Veteran Rewards/MiningCart.cs
Normal file
404
Scripts/Items/Special/Veteran Rewards/MiningCart.cs
Normal file
|
|
@ -0,0 +1,404 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MiningCartType
|
||||
{
|
||||
OreSouth = 100,
|
||||
OreEast = 101,
|
||||
GemSouth = 102,
|
||||
GemEast = 103
|
||||
}
|
||||
|
||||
public class MiningCart : BaseAddon, IRewardItem
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
MiningCartDeed deed = new MiningCartDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
deed.Gems = m_Gems;
|
||||
deed.Ore = m_Ore;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; }
|
||||
}
|
||||
|
||||
private MiningCartType m_CartType;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public MiningCartType CartType
|
||||
{
|
||||
get{ return m_CartType; }
|
||||
}
|
||||
|
||||
private int m_Gems;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Gems
|
||||
{
|
||||
get{ return m_Gems; }
|
||||
set{ m_Gems = value; }
|
||||
}
|
||||
|
||||
private int m_Ore;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Ore
|
||||
{
|
||||
get{ return m_Ore; }
|
||||
set{ m_Ore = value; }
|
||||
}
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public MiningCart( MiningCartType type ) : base()
|
||||
{
|
||||
m_CartType = type;
|
||||
|
||||
switch ( type )
|
||||
{
|
||||
case MiningCartType.OreSouth:
|
||||
AddComponent( new AddonComponent( 0x1A83 ), 0, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x1A82 ), 0, 1, 0 );
|
||||
AddComponent( new AddonComponent( 0x1A86 ), 0, -1, 0 );
|
||||
break;
|
||||
case MiningCartType.OreEast:
|
||||
AddComponent( new AddonComponent( 0x1A88 ), 0, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x1A87 ), 1, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x1A8B ), -1, 0, 0 );
|
||||
break;
|
||||
case MiningCartType.GemSouth:
|
||||
AddComponent( new LocalizedAddonComponent( 0x1A83, 1080388 ), 0, 0, 0 );
|
||||
AddComponent( new LocalizedAddonComponent( 0x1A82, 1080388 ), 0, 1, 0 );
|
||||
AddComponent( new LocalizedAddonComponent( 0x1A86, 1080388 ), 0, -1, 0 );
|
||||
|
||||
AddComponent( new AddonComponent( 0xF2C ), 0, 0, 6 );
|
||||
AddComponent( new AddonComponent( 0xF1D ), 0, 0, 5 );
|
||||
AddComponent( new AddonComponent( 0xF2B ), 0, 0, 2 );
|
||||
AddComponent( new AddonComponent( 0xF21 ), 0, 0, 1 );
|
||||
AddComponent( new AddonComponent( 0xF22 ), 0, 0, 4 );
|
||||
AddComponent( new AddonComponent( 0xF2F ), 0, 0, 5 );
|
||||
AddComponent( new AddonComponent( 0xF26 ), 0, 0, 6 );
|
||||
AddComponent( new AddonComponent( 0xF27 ), 0, 0, 3 );
|
||||
AddComponent( new AddonComponent( 0xF29 ), 0, 0, 0 );
|
||||
break;
|
||||
case MiningCartType.GemEast:
|
||||
AddComponent( new LocalizedAddonComponent( 0x1A88, 1080388 ), 0, 0, 0 );
|
||||
AddComponent( new LocalizedAddonComponent( 0x1A87, 1080388 ), 1, 0, 0 );
|
||||
AddComponent( new LocalizedAddonComponent( 0x1A8B, 1080388 ), -1, 0, 0 );
|
||||
|
||||
AddComponent( new AddonComponent( 0xF2E ), 0, 0, 6 );
|
||||
AddComponent( new AddonComponent( 0xF12 ), 0, 0, 3 );
|
||||
AddComponent( new AddonComponent( 0xF29 ), 0, 0, 1 );
|
||||
AddComponent( new AddonComponent( 0xF24 ), 0, 0, 5 );
|
||||
AddComponent( new AddonComponent( 0xF21 ), 0, 0, 1 );
|
||||
AddComponent( new AddonComponent( 0xF2B ), 0, 0, 3 );
|
||||
AddComponent( new AddonComponent( 0xF2F ), 0, 0, 4 );
|
||||
AddComponent( new AddonComponent( 0xF23 ), 0, 0, 3 );
|
||||
AddComponent( new AddonComponent( 0xF27 ), 0, 0, 3 );
|
||||
break;
|
||||
}
|
||||
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromDays( 1 ), TimeSpan.FromDays( 1 ), new TimerCallback( GiveResources ) );
|
||||
}
|
||||
|
||||
public MiningCart( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private void GiveResources()
|
||||
{
|
||||
switch ( m_CartType )
|
||||
{
|
||||
case MiningCartType.OreSouth:
|
||||
case MiningCartType.OreEast:
|
||||
m_Ore = Math.Min( 100, m_Ore + 10 );
|
||||
break;
|
||||
case MiningCartType.GemSouth:
|
||||
case MiningCartType.GemEast:
|
||||
m_Gems = Math.Min( 50, m_Gems + 5 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComponentUsed( AddonComponent c, Mobile from )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) )
|
||||
{
|
||||
switch ( m_CartType )
|
||||
{
|
||||
case MiningCartType.OreSouth:
|
||||
case MiningCartType.OreEast:
|
||||
if ( m_Ore > 0 )
|
||||
{
|
||||
Item ingots = null;
|
||||
|
||||
switch ( Utility.Random( 9 ) )
|
||||
{
|
||||
case 0: ingots = new IronIngot(); break;
|
||||
case 1: ingots = new DullCopperIngot(); break;
|
||||
case 2: ingots = new ShadowIronIngot(); break;
|
||||
case 3: ingots = new CopperIngot(); break;
|
||||
case 4: ingots = new BronzeIngot(); break;
|
||||
case 5: ingots = new GoldIngot(); break;
|
||||
case 6: ingots = new AgapiteIngot(); break;
|
||||
case 7: ingots = new VeriteIngot(); break;
|
||||
case 8: ingots = new ValoriteIngot(); break;
|
||||
}
|
||||
|
||||
int amount = Math.Min( 10, m_Ore );
|
||||
ingots.Amount = amount;
|
||||
|
||||
if ( !from.PlaceInBackpack( ingots ) )
|
||||
{
|
||||
ingots.Delete();
|
||||
from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
|
||||
}
|
||||
else
|
||||
{
|
||||
PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString() ); // Ore: ~1_COUNT~
|
||||
m_Ore -= amount;
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time.
|
||||
|
||||
break;
|
||||
case MiningCartType.GemSouth:
|
||||
case MiningCartType.GemEast:
|
||||
if ( m_Gems > 0 )
|
||||
{
|
||||
Item gems = null;
|
||||
|
||||
switch ( Utility.Random( 17 ) )
|
||||
{
|
||||
case 0: gems = new Amber(); break;
|
||||
case 1: gems = new Amethyst(); break;
|
||||
case 2: gems = new Citrine(); break;
|
||||
case 3: gems = new Diamond(); break;
|
||||
case 4: gems = new Emerald(); break;
|
||||
case 5: gems = new Ruby(); break;
|
||||
case 6: gems = new Sapphire(); break;
|
||||
case 7: gems = new StarSapphire(); break;
|
||||
case 8: gems = new Tourmaline(); break;
|
||||
|
||||
// Mondain's Legacy gems
|
||||
case 9: gems = new PerfectEmerald(); break;
|
||||
case 10: gems = new DarkSapphire(); break;
|
||||
case 11: gems = new Turquoise(); break;
|
||||
case 12: gems = new EcruCitrine(); break;
|
||||
case 13: gems = new WhitePearl(); break;
|
||||
case 14: gems = new FireRuby(); break;
|
||||
case 15: gems = new BlueDiamond(); break;
|
||||
case 16: gems = new BrilliantAmber(); break;
|
||||
}
|
||||
|
||||
int amount = Math.Min( 5, m_Gems );
|
||||
gems.Amount = amount;
|
||||
|
||||
if ( !from.PlaceInBackpack( gems ) )
|
||||
{
|
||||
gems.Delete();
|
||||
from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
|
||||
}
|
||||
else
|
||||
{
|
||||
PublicOverheadMessage( MessageType.Regular, 0, 1094723, amount.ToString() ); // Gems: ~1_COUNT~
|
||||
m_Gems -= amount;
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time.
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1061637 ); // You are not allowed to access this.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 1 ); // version
|
||||
|
||||
#region version 1
|
||||
writer.Write( (int) m_CartType );
|
||||
#endregion
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (int) m_Gems );
|
||||
writer.Write( (int) m_Ore );
|
||||
|
||||
if ( m_Timer != null )
|
||||
writer.Write( (DateTime) m_Timer.Next );
|
||||
else
|
||||
writer.Write( (DateTime) DateTime.Now + TimeSpan.FromDays( 1 ) );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
m_CartType = (MiningCartType) reader.ReadInt();
|
||||
goto case 0;
|
||||
case 0:
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
m_Gems = reader.ReadInt();
|
||||
m_Ore = reader.ReadInt();
|
||||
|
||||
DateTime next = reader.ReadDateTime();
|
||||
|
||||
if ( next < DateTime.Now )
|
||||
next = DateTime.Now;
|
||||
|
||||
m_Timer = Timer.DelayCall( next - DateTime.Now, TimeSpan.FromDays( 1 ), new TimerCallback( GiveResources ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MiningCartDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080385; } } // deed for a mining cart decoration
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
MiningCart addon = new MiningCart( m_CartType );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
addon.Gems = m_Gems;
|
||||
addon.Ore = m_Ore;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private MiningCartType m_CartType;
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private int m_Gems;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Gems
|
||||
{
|
||||
get{ return m_Gems; }
|
||||
set{ m_Gems = value; }
|
||||
}
|
||||
|
||||
private int m_Ore;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Ore
|
||||
{
|
||||
get{ return m_Ore; }
|
||||
set{ m_Ore = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MiningCartDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MiningCartDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1080457 ); // 10th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardOptionGump ) );
|
||||
from.SendGump( new RewardOptionGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (int) m_Gems );
|
||||
writer.Write( (int) m_Ore );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
m_Gems = reader.ReadInt();
|
||||
m_Ore = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions( RewardOptionList list )
|
||||
{
|
||||
list.Add( (int) MiningCartType.OreSouth, 1080391 );
|
||||
list.Add( (int) MiningCartType.OreEast, 1080390 );
|
||||
list.Add( (int) MiningCartType.GemSouth, 1080500 );
|
||||
list.Add( (int) MiningCartType.GemEast, 1080499 );
|
||||
}
|
||||
|
||||
public void OnOptionSelected( Mobile from, int choice )
|
||||
{
|
||||
m_CartType = (MiningCartType) choice;
|
||||
|
||||
if ( !Deleted )
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
}
|
||||
180
Scripts/Items/Special/Veteran Rewards/MinotaurStatue.cs
Normal file
180
Scripts/Items/Special/Veteran Rewards/MinotaurStatue.cs
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MinotaurStatueType
|
||||
{
|
||||
AttackSouth = 100,
|
||||
AttackEast = 101,
|
||||
DefendSouth = 102,
|
||||
DefendEast = 103
|
||||
}
|
||||
|
||||
public class MinotaurStatue : BaseAddon, IRewardItem
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
MinotaurStatueDeed deed = new MinotaurStatueDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MinotaurStatue( MinotaurStatueType type ) : base()
|
||||
{
|
||||
switch ( type )
|
||||
{
|
||||
case MinotaurStatueType.AttackSouth:
|
||||
AddComponent( new AddonComponent( 0x306C ), 0, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x306D ), -1, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x306E ), 0, -1, 0 );
|
||||
break;
|
||||
case MinotaurStatueType.AttackEast:
|
||||
AddComponent( new AddonComponent( 0x3074 ), 0, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x3075 ), -1, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x3076 ), 0, -1, 0 );
|
||||
break;
|
||||
case MinotaurStatueType.DefendSouth:
|
||||
AddComponent( new AddonComponent( 0x3072 ), 0, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x3073 ), 0, -1, 0 );
|
||||
break;
|
||||
case MinotaurStatueType.DefendEast:
|
||||
AddComponent( new AddonComponent( 0x306F ), 0, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x3070 ), -1, 0, 0 );
|
||||
AddComponent( new AddonComponent( 0x3071 ), 0, -1, 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public MinotaurStatue( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class MinotaurStatueDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080409; } } // Minotaur Statue Deed
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
MinotaurStatue addon = new MinotaurStatue( m_StatueType );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private MinotaurStatueType m_StatueType;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MinotaurStatueDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MinotaurStatueDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardOptionGump ) );
|
||||
from.SendGump( new RewardOptionGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public void GetOptions( RewardOptionList list )
|
||||
{
|
||||
list.Add( (int) MinotaurStatueType.AttackSouth, 1080410 ); // Minotaur Attack South
|
||||
list.Add( (int) MinotaurStatueType.AttackEast, 1080411 ); // Minotaur Attack East
|
||||
list.Add( (int) MinotaurStatueType.DefendSouth, 1080412 ); // Minotaur Defend South
|
||||
list.Add( (int) MinotaurStatueType.DefendEast, 1080413 ); // Minotaur Defend East
|
||||
}
|
||||
|
||||
public void OnOptionSelected( Mobile from, int option )
|
||||
{
|
||||
m_StatueType = (MinotaurStatueType) option;
|
||||
|
||||
if ( !Deleted )
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
}
|
||||
188
Scripts/Items/Special/Veteran Rewards/PottedCactus.cs
Normal file
188
Scripts/Items/Special/Veteran Rewards/PottedCactus.cs
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RewardPottedCactus : Item, IRewardItem
|
||||
{
|
||||
public override bool ForceShowProperties{ get { return ObjectPropertyList.Enabled; } }
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get { return m_IsRewardItem; }
|
||||
set { m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardPottedCactus() : this( Utility.RandomMinMax( 0x1E0F, 0x1E14 ) )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RewardPottedCactus( int itemID ) : base( itemID )
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public RewardPottedCactus( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class PottedCactusDeed : Item, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080407; } } // Potted Cactus Deed
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PottedCactusDeed() : base( 0x14F0 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public PottedCactusDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076219 ); // 3rd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private PottedCactusDeed m_Cactus;
|
||||
|
||||
public InternalGump( PottedCactusDeed cactus ) : base( 100, 200 )
|
||||
{
|
||||
m_Cactus = cactus;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
AddBackground( 0, 0, 425, 250, 0xA28 );
|
||||
|
||||
AddPage( 1 );
|
||||
AddLabel( 45, 15, 0, "Choose a Potted Cactus:" );
|
||||
|
||||
AddItem( 45, 75, 0x1E0F );
|
||||
AddButton( 55, 50, 0x845, 0x846, 0x1E0F, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 105, 75, 0x1E10 );
|
||||
AddButton( 115, 50, 0x845, 0x846, 0x1E10, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 160, 75, 0x1E14 );
|
||||
AddButton( 175, 50, 0x845, 0x846, 0x1E14, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 220, 75, 0x1E11 );
|
||||
AddButton( 235, 50, 0x845, 0x846, 0x1E11, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 280, 75, 0x1E12 );
|
||||
AddButton( 295, 50, 0x845, 0x846, 0x1E12, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 340, 75, 0x1E13 );
|
||||
AddButton( 355, 50, 0x845, 0x846, 0x1E13, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Cactus == null | m_Cactus.Deleted )
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if ( info.ButtonID >= 0x1E0F && info.ButtonID <= 0x1E14 )
|
||||
{
|
||||
RewardPottedCactus cactus = new RewardPottedCactus( info.ButtonID );
|
||||
cactus.IsRewardItem = m_Cactus.IsRewardItem;
|
||||
|
||||
if ( !m.PlaceInBackpack( cactus ) )
|
||||
{
|
||||
cactus.Delete();
|
||||
m.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
|
||||
}
|
||||
else
|
||||
m_Cactus.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
269
Scripts/Items/Special/Veteran Rewards/StoneAnkh.cs
Normal file
269
Scripts/Items/Special/Veteran Rewards/StoneAnkh.cs
Normal file
|
|
@ -0,0 +1,269 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StoneAnkhComponent : AddonComponent
|
||||
{
|
||||
public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }
|
||||
|
||||
public StoneAnkhComponent( int itemID ) : base( itemID )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public StoneAnkhComponent( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Addon is StoneAnkh && ((StoneAnkh) Addon).IsRewardItem )
|
||||
list.Add( 1076221 ); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StoneAnkh : BaseAddon, IRewardItem
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
StoneAnkhDeed deed = new StoneAnkhDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StoneAnkh() : this( true )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StoneAnkh( bool east ) : base()
|
||||
{
|
||||
if ( east )
|
||||
{
|
||||
AddComponent( new StoneAnkhComponent( 0x2 ), 0, 0, 0 );
|
||||
AddComponent( new StoneAnkhComponent( 0x3 ), 0, -1, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent( new StoneAnkhComponent( 0x5 ), 0, 0, 0 );
|
||||
AddComponent( new StoneAnkhComponent( 0x4 ), -1, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
public StoneAnkh( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnChop( Mobile from )
|
||||
{
|
||||
from.SendLocalizedMessage( 500489 ); // You can't use an axe on that.
|
||||
return;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
list.Add( 1076221 ); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnComponentUsed( AddonComponent c, Mobile from )
|
||||
{
|
||||
if ( from.InRange( Location, 2 ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardDemolitionGump ) );
|
||||
from.SendGump( new RewardDemolitionGump( this, 1049783 ) ); // Do you wish to re-deed this decoration?
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1049784 ); // You can only re-deed this decoration if you are the house owner or originally placed the decoration.
|
||||
}
|
||||
else
|
||||
from.Say( 1019045 ); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class StoneAnkhDeed : BaseAddonDeed, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1049773; } } // deed for a stone ankh
|
||||
|
||||
private bool m_East;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
StoneAnkh addon = new StoneAnkh( m_East );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StoneAnkhDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public StoneAnkhDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
private void SendTarget( Mobile m )
|
||||
{
|
||||
base.OnDoubleClick( m );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076221 ); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private StoneAnkhDeed m_Deed;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
South,
|
||||
East
|
||||
}
|
||||
|
||||
public InternalGump( StoneAnkhDeed deed ) : base( 150, 50 )
|
||||
{
|
||||
m_Deed = deed;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
|
||||
AddItem( 90, 30, 0x4 );
|
||||
AddItem( 112, 30, 0x5 );
|
||||
AddButton( 50, 35, 0x867, 0x869, (int) Buttons.South, GumpButtonType.Reply, 0 ); // South
|
||||
|
||||
AddItem( 170, 30, 0x2 );
|
||||
AddItem( 192, 30, 0x3 );
|
||||
AddButton( 145, 35, 0x867, 0x869, (int) Buttons.East, GumpButtonType.Reply, 0 ); // East
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Deed == null || m_Deed.Deleted )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID != (int) Buttons.Cancel )
|
||||
{
|
||||
m_Deed.m_East = ( info.ButtonID == (int) Buttons.East );
|
||||
m_Deed.SendTarget( sender.Mobile );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
246
Scripts/Items/Special/Veteran Rewards/TreeStump.cs
Normal file
246
Scripts/Items/Special/Veteran Rewards/TreeStump.cs
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Multis;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TreeStump : BaseAddon, IRewardItem
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
TreeStumpDeed deed = new TreeStumpDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
deed.Logs = m_Logs;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private int m_Logs;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Logs
|
||||
{
|
||||
get{ return m_Logs; }
|
||||
set{ m_Logs = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public TreeStump( int itemID ) : base()
|
||||
{
|
||||
AddComponent( new AddonComponent( itemID ), 0, 0, 0 );
|
||||
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromDays( 1 ), TimeSpan.FromDays( 1 ), new TimerCallback( GiveLogs ) );
|
||||
}
|
||||
|
||||
public TreeStump( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private void GiveLogs()
|
||||
{
|
||||
m_Logs = Math.Min( 100, m_Logs + 10 );
|
||||
}
|
||||
|
||||
public override void OnComponentUsed( AddonComponent c, Mobile from )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) )
|
||||
{
|
||||
if ( m_Logs > 0 )
|
||||
{
|
||||
Item logs = null;
|
||||
|
||||
switch ( Utility.Random( 7 ) )
|
||||
{
|
||||
case 0: logs = new Log(); break;
|
||||
case 1: logs = new AshLog(); break;
|
||||
case 2: logs = new OakLog(); break;
|
||||
case 3: logs = new YewLog(); break;
|
||||
case 4: logs = new HeartwoodLog(); break;
|
||||
case 5: logs = new BloodwoodLog(); break;
|
||||
case 6: logs = new FrostwoodLog(); break;
|
||||
}
|
||||
|
||||
int amount = Math.Min( 10, m_Logs );
|
||||
logs.Amount = amount;
|
||||
|
||||
if ( !from.PlaceInBackpack( logs ) )
|
||||
{
|
||||
logs.Delete();
|
||||
from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Logs -= amount;
|
||||
PublicOverheadMessage( MessageType.Regular, 0, 1094719, m_Logs.ToString() ); // Logs: ~1_COUNT~
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1094720 ); // There are no more logs available.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1061637 ); // You are not allowed to access this.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (int) m_Logs );
|
||||
|
||||
if ( m_Timer != null )
|
||||
writer.Write( (DateTime) m_Timer.Next );
|
||||
else
|
||||
writer.Write( (DateTime) DateTime.Now + TimeSpan.FromDays( 1 ) );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
m_Logs = reader.ReadInt();
|
||||
|
||||
DateTime next = reader.ReadDateTime();
|
||||
|
||||
if ( next < DateTime.Now )
|
||||
next = DateTime.Now;
|
||||
|
||||
m_Timer = Timer.DelayCall( next - DateTime.Now, TimeSpan.FromDays( 1 ), new TimerCallback( GiveLogs ) );
|
||||
}
|
||||
}
|
||||
|
||||
public class TreeStumpDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080406; } } // a deed for a tree stump decoration
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
TreeStump addon = new TreeStump( m_ItemID );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
addon.Logs = m_Logs;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_ItemID;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private int m_Logs;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Logs
|
||||
{
|
||||
get{ return m_Logs; }
|
||||
set{ m_Logs = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public TreeStumpDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public TreeStumpDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076223 ); // 7th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( RewardOptionGump ) );
|
||||
from.SendGump( new RewardOptionGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (int) m_Logs );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
m_Logs = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions( RewardOptionList list )
|
||||
{
|
||||
list.Add( 1, 1080403 ); // Tree Stump with Axe West
|
||||
list.Add( 2, 1080404 ); // Tree Stump with Axe North
|
||||
list.Add( 3, 1080401 ); // Tree Stump East
|
||||
list.Add( 4, 1080402 ); // Tree Stump South
|
||||
}
|
||||
|
||||
public void OnOptionSelected( Mobile from, int option )
|
||||
{
|
||||
switch ( option )
|
||||
{
|
||||
case 1: m_ItemID = 0xE56; break;
|
||||
case 2: m_ItemID = 0xE58; break;
|
||||
case 3: m_ItemID = 0xE57; break;
|
||||
case 4: m_ItemID = 0xE59; break;
|
||||
}
|
||||
|
||||
if ( !Deleted )
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
}
|
||||
500
Scripts/Items/Special/Veteran Rewards/WallBanner.cs
Normal file
500
Scripts/Items/Special/Veteran Rewards/WallBanner.cs
Normal file
|
|
@ -0,0 +1,500 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WallBannerComponent : AddonComponent, IDyable
|
||||
{
|
||||
public override bool NeedsWall{ get{ return true; } }
|
||||
public override Point3D WallPosition{ get{ return this.East ? new Point3D( -1, 0, 0 ) : new Point3D( 0, -1, 0 ); } }
|
||||
|
||||
public bool East{ get { return ((WallBanner)Addon).East; } }
|
||||
|
||||
public WallBannerComponent( int itemID ) : base( itemID )
|
||||
{
|
||||
}
|
||||
|
||||
public WallBannerComponent( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
if ( Addon != null )
|
||||
Addon.Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class WallBanner : BaseAddon, IRewardItem
|
||||
{
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
WallBannerDeed deed = new WallBannerDeed();
|
||||
deed.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return deed;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private bool m_East;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool East
|
||||
{
|
||||
get{ return m_East; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WallBanner( int bannerID ) : base()
|
||||
{
|
||||
m_East = ((bannerID % 2) == 1 );
|
||||
|
||||
switch ( bannerID )
|
||||
{
|
||||
case 1:
|
||||
AddComponent( new WallBannerComponent( 0x161F ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x161E ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x161D ), 0, 2, 0 );
|
||||
break;
|
||||
case 2:
|
||||
AddComponent( new WallBannerComponent( 0x1586 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1587 ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1588 ), 2, 0, 0 );
|
||||
break;
|
||||
case 3:
|
||||
AddComponent( new WallBannerComponent( 0x1622 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1621 ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1620 ), 0, 2, 0 );
|
||||
break;
|
||||
case 4:
|
||||
AddComponent( new WallBannerComponent( 0x1589 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x158A ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x158B ), 2, 0, 0 );
|
||||
break;
|
||||
case 5:
|
||||
AddComponent( new WallBannerComponent( 0x1625 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1624 ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1623 ), 0, 2, 0 );
|
||||
break;
|
||||
case 6:
|
||||
AddComponent( new WallBannerComponent( 0x158C ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x158D ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x158E ), 2, 0, 0 );
|
||||
break;
|
||||
case 7:
|
||||
AddComponent( new WallBannerComponent( 0x1628 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1627 ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1626 ), 0, 2, 0 );
|
||||
break;
|
||||
case 8:
|
||||
AddComponent( new WallBannerComponent( 0x1590 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1591 ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x158F ), 2, 0, 0 );
|
||||
break;
|
||||
case 9:
|
||||
AddComponent( new WallBannerComponent( 0x162A ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1629 ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1626 ), 0, 2, 0 );
|
||||
break;
|
||||
case 10:
|
||||
AddComponent( new WallBannerComponent( 0x1592 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1593 ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x158F ), 2, 0, 0 );
|
||||
break;
|
||||
case 11:
|
||||
AddComponent( new WallBannerComponent( 0x162D ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x162C ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x162B ), 0, 2, 0 );
|
||||
break;
|
||||
case 12:
|
||||
AddComponent( new WallBannerComponent( 0x1594 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1595 ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1596 ), 2, 0, 0 );
|
||||
break;
|
||||
case 13:
|
||||
AddComponent( new WallBannerComponent( 0x1632 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1631 ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x162E ), 0, 2, 0 );
|
||||
break;
|
||||
case 14:
|
||||
AddComponent( new WallBannerComponent( 0x1598 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x159B ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x159C ), 2, 0, 0 );
|
||||
break;
|
||||
case 15:
|
||||
AddComponent( new WallBannerComponent( 0x1633 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1630 ), 0, 1, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x162F ), 0, 2, 0 );
|
||||
break;
|
||||
case 16:
|
||||
AddComponent( new WallBannerComponent( 0x1599 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x159A ), 1, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x159D ), 2, 0, 0 );
|
||||
break;
|
||||
|
||||
|
||||
case 17:
|
||||
AddComponent( new WallBannerComponent( 0x1610 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x160F ), 0, 1, 0 );
|
||||
break;
|
||||
case 18:
|
||||
AddComponent( new WallBannerComponent( 0x15A0 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15A1 ), 1, 0, 0 );
|
||||
break;
|
||||
|
||||
case 19:
|
||||
AddComponent( new WallBannerComponent( 0x1612 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1611 ), 0, 1, 0 );
|
||||
break;
|
||||
case 20:
|
||||
AddComponent( new WallBannerComponent( 0x15A2 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15A3 ), 1, 0, 0 );
|
||||
break;
|
||||
|
||||
case 21:
|
||||
AddComponent( new WallBannerComponent( 0x1614 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1613 ), 0, 1, 0 );
|
||||
break;
|
||||
case 22:
|
||||
AddComponent( new WallBannerComponent( 0x15A4 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15A5 ), 1, 0, 0 );
|
||||
break;
|
||||
|
||||
case 23:
|
||||
AddComponent( new WallBannerComponent( 0x1616 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1615 ), 0, 1, 0 );
|
||||
break;
|
||||
case 24:
|
||||
AddComponent( new WallBannerComponent( 0x15A6 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15A7 ), 1, 0, 0 );
|
||||
break;
|
||||
|
||||
case 25:
|
||||
AddComponent( new WallBannerComponent( 0x1618 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1617 ), 0, 1, 0 );
|
||||
break;
|
||||
case 26:
|
||||
AddComponent( new WallBannerComponent( 0x15A8 ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15A9 ), 1, 0, 0 );
|
||||
break;
|
||||
|
||||
case 27:
|
||||
AddComponent( new WallBannerComponent( 0x161A ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x1619 ), 0, 1, 0 );
|
||||
break;
|
||||
case 28:
|
||||
AddComponent( new WallBannerComponent( 0x15AA ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15AB ), 1, 0, 0 );
|
||||
break;
|
||||
|
||||
case 29:
|
||||
AddComponent( new WallBannerComponent( 0x161C ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x161B ), 0, 1, 0 );
|
||||
break;
|
||||
case 30:
|
||||
AddComponent( new WallBannerComponent( 0x15AC ), 0, 0, 0 );
|
||||
AddComponent( new WallBannerComponent( 0x15AD ), 1, 0, 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public WallBanner( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_East );
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_East = reader.ReadBool();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class WallBannerDeed : BaseAddonDeed, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1080549; } } // Wall Banner Deed
|
||||
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
WallBanner addon = new WallBanner( m_BannerID );
|
||||
addon.IsRewardItem = m_IsRewardItem;
|
||||
|
||||
return addon;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_BannerID;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WallBannerDeed() : base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public WallBannerDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076225 ); // 9th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( this ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
|
||||
public void Use( Mobile m, int bannerID )
|
||||
{
|
||||
m_BannerID = bannerID;
|
||||
|
||||
base.OnDoubleClick( m );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private WallBannerDeed m_WallBanner;
|
||||
|
||||
public InternalGump( WallBannerDeed WallBanner ) : base( 150, 50 )
|
||||
{
|
||||
m_WallBanner = WallBanner;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddBackground( 25, 0, 500, 265, 0xA28 );
|
||||
AddLabel( 70, 12, 0x3E3, "Choose a Wall Banner:" );
|
||||
|
||||
AddPage( 1 );
|
||||
|
||||
AddItem( 55, 110, 0x161D );
|
||||
AddItem( 75, 90, 0x161E );
|
||||
AddItem( 95, 70, 0x161F );
|
||||
AddButton( 70, 50, 0x845, 0x846, 1, GumpButtonType.Reply, 0 );
|
||||
AddItem( 105, 70, 0x1586 );
|
||||
AddItem( 125, 90, 0x1587 );
|
||||
AddItem( 145, 110, 0x1588 );
|
||||
AddButton( 145, 50, 0x845, 0x846, 2, GumpButtonType.Reply, 0 );
|
||||
AddItem( 200, 110, 0x1620 );
|
||||
AddItem( 220, 90, 0x1621 );
|
||||
AddItem( 240, 70, 0x1622 );
|
||||
AddButton( 220, 50, 0x845, 0x846, 3, GumpButtonType.Reply, 0 );
|
||||
AddItem( 250, 70, 0x1589 );
|
||||
AddItem( 270, 90, 0x158A );
|
||||
AddItem( 290, 110, 0x158B );
|
||||
AddButton( 300, 50, 0x845, 0x846, 4, GumpButtonType.Reply, 0 );
|
||||
AddItem( 350, 110, 0x1623 );
|
||||
AddItem( 370, 90, 0x1624 );
|
||||
AddItem( 390, 70, 0x1625 );
|
||||
AddButton( 365, 50, 0x845, 0x846, 5, GumpButtonType.Reply, 0 );
|
||||
AddItem( 400, 70, 0x158C );
|
||||
AddItem( 420, 90, 0x158D );
|
||||
AddItem( 440, 110, 0x158E );
|
||||
AddButton( 445, 50, 0x845, 0x846, 6, GumpButtonType.Reply, 0 );
|
||||
AddButton( 455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 2 );
|
||||
|
||||
AddPage( 2 );
|
||||
|
||||
AddItem( 52, 110, 0x1626 );
|
||||
AddItem( 72, 90, 0x1627 );
|
||||
AddItem( 95, 70, 0x1628 );
|
||||
AddButton( 70, 50, 0x845, 0x846, 7, GumpButtonType.Reply, 0 );
|
||||
AddItem( 105, 70, 0x1590 );
|
||||
AddItem( 125, 90, 0x1591 );
|
||||
AddItem( 145, 110, 0x158F );
|
||||
AddButton( 145, 50, 0x845, 0x846, 8, GumpButtonType.Reply, 0 );
|
||||
AddItem( 197, 110, 0x1626 );
|
||||
AddItem( 217, 90, 0x1629 );
|
||||
AddItem( 240, 70, 0x162A );
|
||||
AddButton( 220, 50, 0x845, 0x846, 9, GumpButtonType.Reply, 0 );
|
||||
AddItem( 250, 70, 0x1592 );
|
||||
AddItem( 270, 90, 0x1593 );
|
||||
AddItem( 290, 110, 0x158F );
|
||||
AddButton( 300, 50, 0x845, 0x846, 10, GumpButtonType.Reply, 0 );
|
||||
AddItem( 340, 110, 0x162B );
|
||||
AddItem( 363, 90, 0x162C );
|
||||
AddItem( 385, 70, 0x162D );
|
||||
AddButton( 365, 50, 0x845, 0x846, 11, GumpButtonType.Reply, 0 );
|
||||
AddItem( 395, 70, 0x1594 );
|
||||
AddItem( 417, 90, 0x1595 );
|
||||
AddItem( 439, 111, 0x1596 );
|
||||
AddButton( 445, 50, 0x845, 0x846, 12, GumpButtonType.Reply, 0 );
|
||||
AddButton( 70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 1 );
|
||||
AddButton( 455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 3 );
|
||||
|
||||
AddPage( 3 );
|
||||
|
||||
AddItem( 55, 110, 0x162E );
|
||||
AddItem( 75, 93, 0x1631 );
|
||||
AddItem( 95, 70, 0x1632 );
|
||||
AddButton( 70, 50, 0x845, 0x846, 13, GumpButtonType.Reply, 0 );
|
||||
AddItem( 118, 70, 0x1598 );
|
||||
AddItem( 138, 94, 0x159B );
|
||||
AddItem( 159, 113, 0x159C );
|
||||
AddButton( 160, 50, 0x845, 0x846, 14, GumpButtonType.Reply, 0 );
|
||||
AddItem( 219, 111, 0x162F );
|
||||
AddItem( 238, 94, 0x1630 );
|
||||
AddItem( 258, 70, 0x1633 );
|
||||
AddButton( 240, 50, 0x845, 0x846, 15, GumpButtonType.Reply, 0 );
|
||||
AddItem( 279, 70, 0x1599 );
|
||||
AddItem( 298, 93, 0x159A );
|
||||
AddItem( 319, 113, 0x159D );
|
||||
AddButton( 320, 50, 0x845, 0x846, 16, GumpButtonType.Reply, 0 );
|
||||
AddItem( 380, 90, 0x160F );
|
||||
AddItem( 400, 70, 0x1610 );
|
||||
AddButton( 390, 50, 0x845, 0x846, 17, GumpButtonType.Reply, 0 );
|
||||
AddItem( 420, 70, 0x15A0 );
|
||||
AddItem( 440, 90, 0x15A1 );
|
||||
AddButton( 455, 50, 0x845, 0x846, 18, GumpButtonType.Reply, 0 );
|
||||
AddButton( 70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 2 );
|
||||
AddButton( 455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 4 );
|
||||
|
||||
AddPage( 4 );
|
||||
|
||||
AddItem( 55, 90, 0x1611 );
|
||||
AddItem( 75, 70, 0x1612 );
|
||||
AddButton( 70, 50, 0x845, 0x846, 19, GumpButtonType.Reply, 0 );
|
||||
AddItem( 105, 70, 0x15A2 );
|
||||
AddItem( 125, 90, 0x15A3 );
|
||||
AddButton( 145, 50, 0x845, 0x846, 20, GumpButtonType.Reply, 0 );
|
||||
AddItem( 200, 84, 0x1613 );
|
||||
AddItem( 220, 70, 0x1614 );
|
||||
AddButton( 215, 50, 0x845, 0x846, 21, GumpButtonType.Reply, 0 );
|
||||
AddItem( 250, 70, 0x15A4 );
|
||||
AddItem( 270, 84, 0x15A5 );
|
||||
AddButton( 290, 50, 0x845, 0x846, 22, GumpButtonType.Reply, 0 );
|
||||
AddItem( 350, 90, 0x1615 );
|
||||
AddItem( 370, 70, 0x1616 );
|
||||
AddButton( 365, 50, 0x845, 0x846, 23, GumpButtonType.Reply, 0 );
|
||||
AddItem( 400, 70, 0x15A6 );
|
||||
AddItem( 420, 90, 0x15A7 );
|
||||
AddButton( 445, 50, 0x845, 0x846, 24, GumpButtonType.Reply, 0 );
|
||||
AddButton( 70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 3 );
|
||||
AddButton( 455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 5 );
|
||||
|
||||
AddPage( 5 );
|
||||
|
||||
AddItem( 55, 90, 0x1617 );
|
||||
AddItem( 77, 70, 0x1618 );
|
||||
AddButton( 70, 50, 0x845, 0x846, 25, GumpButtonType.Reply, 0 );
|
||||
AddItem( 105, 70, 0x15A8 );
|
||||
AddItem( 127, 90, 0x15A9 );
|
||||
AddButton( 145, 50, 0x845, 0x846, 26, GumpButtonType.Reply, 0 );
|
||||
AddItem( 200, 90, 0x1619 );
|
||||
AddItem( 222, 70, 0x161A );
|
||||
AddButton( 220, 50, 0x845, 0x846, 27, GumpButtonType.Reply, 0 );
|
||||
AddItem( 250, 70, 0x15AA );
|
||||
AddItem( 272, 90, 0x15AB );
|
||||
AddButton( 300, 50, 0x845, 0x846, 28, GumpButtonType.Reply, 0 );
|
||||
AddItem( 350, 90, 0x161B );
|
||||
AddItem( 372, 70, 0x161C );
|
||||
AddButton( 365, 50, 0x845, 0x846, 29, GumpButtonType.Reply, 0 );
|
||||
AddItem( 400, 70, 0x15AC );
|
||||
AddItem( 422, 90, 0x15AD );
|
||||
AddButton( 445, 50, 0x845, 0x846, 30, GumpButtonType.Reply, 0 );
|
||||
AddButton( 70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 4 );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_WallBanner == null || m_WallBanner.Deleted )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID > 0 && info.ButtonID < 31 )
|
||||
m_WallBanner.Use( sender.Mobile, info.ButtonID );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
330
Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs
Normal file
330
Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs
Normal file
|
|
@ -0,0 +1,330 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1076158; } } // Weapon Engraving Tool
|
||||
|
||||
private int m_UsesRemaining;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get{ return m_UsesRemaining; }
|
||||
set{ m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public virtual bool ShowUsesRemaining
|
||||
{
|
||||
get{ return true; }
|
||||
set{}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get{ return m_IsRewardItem; }
|
||||
set{ m_IsRewardItem = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WeaponEngravingTool() : this( 10 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WeaponEngravingTool( int uses ) : base( 0x32F8 )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
|
||||
m_UsesRemaining = uses;
|
||||
}
|
||||
|
||||
public WeaponEngravingTool( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
if ( m_UsesRemaining > 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1072357 ); // Select an object to engrave.
|
||||
from.Target = new TargetWeapon( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( from.Skills.Tinkering.Value == 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1076179 ); // Since you have no tinkering skill, you will need to find an NPC tinkerer to repair this for you.
|
||||
}
|
||||
else if ( from.Skills.Tinkering.Value < 75.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1076178 ); // Your tinkering skill is too low to fix this yourself. An NPC tinkerer can help you repair this for a fee.
|
||||
}
|
||||
else
|
||||
{
|
||||
Item diamond = from.Backpack.FindItemByType( typeof( BlueDiamond ) );
|
||||
|
||||
if ( diamond != null )
|
||||
from.SendGump( new ConfirmGump( this, null ) );
|
||||
else
|
||||
from.SendLocalizedMessage( 1076166 ); // You do not have a blue diamond needed to recharge the engraving tool.
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1076163 ); // There are no charges left on this engraving tool.
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_IsRewardItem )
|
||||
list.Add( 1076224 ); // 8th Year Veteran Reward
|
||||
|
||||
if ( ShowUsesRemaining )
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
|
||||
public virtual void Recharge( Mobile from, Mobile guildmaster )
|
||||
{
|
||||
if ( from.Backpack != null )
|
||||
{
|
||||
Item diamond = from.Backpack.FindItemByType( typeof( BlueDiamond ) );
|
||||
|
||||
if ( guildmaster != null )
|
||||
{
|
||||
if ( m_UsesRemaining <= 0 )
|
||||
{
|
||||
if ( diamond != null && Banker.Withdraw( from, 100000 ) )
|
||||
{
|
||||
diamond.Consume();
|
||||
UsesRemaining = 10;
|
||||
guildmaster.Say( 1076165 ); // Your weapon engraver should be good as new!
|
||||
}
|
||||
else
|
||||
guildmaster.Say( 1076167 ); // You need a 100,000 gold and a blue diamond to recharge the weapon engraver.
|
||||
}
|
||||
else
|
||||
guildmaster.Say( 1076164 ); // I can only help with this if you are carrying an engraving tool that needs repair.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( from.Skills.Tinkering.Value == 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1076179 ); // Since you have no tinkering skill, you will need to find an NPC tinkerer to repair this for you.
|
||||
}
|
||||
else if ( from.Skills.Tinkering.Value < 75.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1076178 ); // Your tinkering skill is too low to fix this yourself. An NPC tinkerer can help you repair this for a fee.
|
||||
}
|
||||
else if ( diamond != null )
|
||||
{
|
||||
diamond.Consume();
|
||||
|
||||
if ( Utility.RandomDouble() < from.Skills.Tinkering.Value / 100 )
|
||||
{
|
||||
UsesRemaining = 10;
|
||||
from.SendLocalizedMessage( 1076165 ); // Your weapon engraver should be good as new! ?????
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1076175 ); // You cracked the diamond attempting to fix the weapon engraver.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1076166 ); // You do not have a blue diamond needed to recharge the engraving tool.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static WeaponEngravingTool Find( Mobile from )
|
||||
{
|
||||
if ( from.Backpack != null )
|
||||
return from.Backpack.FindItemByType( typeof( WeaponEngravingTool ) ) as WeaponEngravingTool;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private class TargetWeapon : Target
|
||||
{
|
||||
private WeaponEngravingTool m_Tool;
|
||||
|
||||
public TargetWeapon( WeaponEngravingTool tool ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Tool = tool;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Tool == null || m_Tool.Deleted )
|
||||
return;
|
||||
|
||||
if ( targeted is BaseWeapon )
|
||||
{
|
||||
BaseWeapon item = (BaseWeapon) targeted;
|
||||
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( m_Tool, item ) );
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 1072309 ); // The selected item cannot be engraved by this engraving tool.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private WeaponEngravingTool m_Tool;
|
||||
private BaseWeapon m_Target;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
Okay,
|
||||
Text
|
||||
}
|
||||
|
||||
public InternalGump( WeaponEngravingTool tool, BaseWeapon target ) : base( 0, 0 )
|
||||
{
|
||||
m_Tool = tool;
|
||||
m_Target = target;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddBackground( 50, 50, 400, 300, 0xA28 );
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddHtmlLocalized( 50, 70, 400, 20, 1072359, 0x0, false, false ); // <CENTER>Engraving Tool</CENTER>
|
||||
AddHtmlLocalized( 75, 95, 350, 145, 1076229, 0x0, true, true ); // Please enter the text to add to the selected object. Leave the text area blank to remove any existing text. Removing text does not use a charge.
|
||||
AddButton( 125, 300, 0x81A, 0x81B, (int) Buttons.Okay, GumpButtonType.Reply, 0 );
|
||||
AddButton( 320, 300, 0x819, 0x818, (int) Buttons.Cancel, GumpButtonType.Reply, 0 );
|
||||
AddImageTiled( 75, 245, 350, 40, 0xDB0 );
|
||||
AddImageTiled( 76, 245, 350, 2, 0x23C5 );
|
||||
AddImageTiled( 75, 245, 2, 40, 0x23C3 );
|
||||
AddImageTiled( 75, 285, 350, 2, 0x23C5 );
|
||||
AddImageTiled( 425, 245, 2, 42, 0x23C3 );
|
||||
|
||||
AddTextEntry( 75, 245, 350, 40, 0x0, (int) Buttons.Text, "" );
|
||||
}
|
||||
|
||||
public override void OnResponse( Server.Network.NetState state, RelayInfo info )
|
||||
{
|
||||
if ( m_Tool == null || m_Tool.Deleted || m_Target == null || m_Target.Deleted )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == (int) Buttons.Okay )
|
||||
{
|
||||
TextRelay relay = info.GetTextEntry( (int) Buttons.Text );
|
||||
|
||||
if ( relay != null )
|
||||
{
|
||||
if ( String.IsNullOrEmpty( relay.Text ) )
|
||||
{
|
||||
m_Target.EngravedText = null;
|
||||
state.Mobile.SendLocalizedMessage( 1072362 ); // You remove the engraving from the object.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( relay.Text.Length > 64 )
|
||||
m_Target.EngravedText = relay.Text.Substring( 0, 64 );
|
||||
else
|
||||
m_Target.EngravedText = relay.Text;
|
||||
|
||||
state.Mobile.SendLocalizedMessage( 1072361 ); // You engraved the object.
|
||||
m_Target.InvalidateProperties();
|
||||
m_Tool.UsesRemaining -= 1;
|
||||
m_Tool.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
state.Mobile.SendLocalizedMessage( 1072363 ); // The object was not engraved.
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfirmGump : Gump
|
||||
{
|
||||
private WeaponEngravingTool m_Engraver;
|
||||
private Mobile m_Guildmaster;
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
Confirm
|
||||
}
|
||||
|
||||
public ConfirmGump( WeaponEngravingTool engraver, Mobile guildmaster ) : base( 200, 200 )
|
||||
{
|
||||
m_Engraver = engraver;
|
||||
m_Guildmaster = guildmaster;
|
||||
|
||||
Closable = false;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 291, 133, 0x13BE );
|
||||
AddImageTiled( 5, 5, 280, 100, 0xA40 );
|
||||
|
||||
if ( guildmaster != null )
|
||||
{
|
||||
AddHtmlLocalized( 9, 9, 272, 100, 1076169, 0x7FFF, false, false ); // It will cost you 100,000 gold and a blue diamond to recharge your weapon engraver with 10 charges.
|
||||
AddHtmlLocalized( 195, 109, 120, 20, 1076172, 0x7FFF, false, false ); // Recharge it
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized( 9, 9, 272, 100, 1076176, 0x7FFF, false, false ); // You will need a blue diamond to repair the tip of the engraver. A successful repair will give the engraver 10 charges.
|
||||
AddHtmlLocalized( 195, 109, 120, 20, 1076177, 0x7FFF, false, false ); // Replace the tip.
|
||||
}
|
||||
|
||||
AddButton( 160, 107, 0xFB7, 0xFB8, (int) Buttons.Confirm, GumpButtonType.Reply, 0 );
|
||||
AddButton( 5, 107, 0xFB1, 0xFB2, (int) Buttons.Cancel, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 40, 109, 100, 20, 1060051, 0x7FFF, false, false ); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse( Server.Network.NetState state, RelayInfo info )
|
||||
{
|
||||
if ( m_Engraver == null || m_Engraver.Deleted )
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == (int) Buttons.Confirm )
|
||||
m_Engraver.Recharge( state.Mobile, m_Guildmaster );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,15 @@ namespace Server.Items
|
|||
|
||||
public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability
|
||||
{
|
||||
private string m_EngravedText;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string EngravedText
|
||||
{
|
||||
get{ return m_EngravedText; }
|
||||
set{ m_EngravedText = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
#region Factions
|
||||
private FactionItem m_FactionState;
|
||||
|
||||
|
|
@ -135,6 +144,8 @@ namespace Server.Items
|
|||
public virtual int InitMinHits{ get{ return 0; } }
|
||||
public virtual int InitMaxHits{ get{ return 0; } }
|
||||
|
||||
public virtual bool CanFortify{ get{ return true; } }
|
||||
|
||||
public override int PhysicalResistance{ get{ return m_AosWeaponAttributes.ResistPhysicalBonus; } }
|
||||
public override int FireResistance{ get{ return m_AosWeaponAttributes.ResistFireBonus; } }
|
||||
public override int ColdResistance{ get{ return m_AosWeaponAttributes.ResistColdBonus; } }
|
||||
|
|
@ -2397,7 +2408,7 @@ namespace Server.Items
|
|||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
|
||||
writer.Write( (int) 8 ); // version
|
||||
|
||||
SaveFlag flags = SaveFlag.None;
|
||||
|
|
@ -2432,6 +2443,7 @@ namespace Server.Items
|
|||
SetSaveFlag( ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty );
|
||||
SetSaveFlag( ref flags, SaveFlag.Slayer2, m_Slayer2 != SlayerName.None );
|
||||
SetSaveFlag( ref flags, SaveFlag.ElementalDamages, !m_AosElementDamages.IsEmpty );
|
||||
SetSaveFlag( ref flags, SaveFlag.EngravedText, !String.IsNullOrEmpty( m_EngravedText ) );
|
||||
|
||||
writer.Write( (int) flags );
|
||||
|
||||
|
|
@ -2518,6 +2530,9 @@ namespace Server.Items
|
|||
|
||||
if( GetSaveFlag( flags, SaveFlag.ElementalDamages ) )
|
||||
m_AosElementDamages.Serialize( writer );
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.EngravedText ) )
|
||||
writer.Write( (string) m_EngravedText );
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
|
@ -2553,7 +2568,8 @@ namespace Server.Items
|
|||
PlayerConstructed = 0x04000000,
|
||||
SkillBonuses = 0x08000000,
|
||||
Slayer2 = 0x10000000,
|
||||
ElementalDamages = 0x20000000
|
||||
ElementalDamages = 0x20000000,
|
||||
EngravedText = 0x40000000
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -2727,6 +2743,9 @@ namespace Server.Items
|
|||
else
|
||||
m_AosElementDamages = new AosElementAttributes( this );
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.EngravedText ) )
|
||||
m_EngravedText = reader.ReadString();
|
||||
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
|
|
@ -2989,6 +3008,9 @@ namespace Server.Items
|
|||
list.Add( LabelNumber );
|
||||
else
|
||||
list.Add( Name );
|
||||
|
||||
if ( !String.IsNullOrEmpty( m_EngravedText ) )
|
||||
list.Add( 1062613, m_EngravedText );
|
||||
}
|
||||
|
||||
public override bool AllowEquipedCast( Mobile from )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue