#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
142
Scripts/Items/Rares/BottleOfAcid.cs
Normal file
142
Scripts/Items/Rares/BottleOfAcid.cs
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BottleOfAcid : Item
|
||||
{
|
||||
public override int Hue{ get { return 0x428; } }
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 1.0; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BottleOfAcid() : base( 0x2038 )
|
||||
{
|
||||
Name = "bottle of acid";
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Target t;
|
||||
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "What chest do you want to use the acid on?" );
|
||||
t = new UnlockTarget( this );
|
||||
from.Target = t;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Dissolve Chest Traps & Locks" );
|
||||
}
|
||||
|
||||
private class UnlockTarget : Target
|
||||
{
|
||||
private BottleOfAcid m_Key;
|
||||
|
||||
public UnlockTarget( BottleOfAcid key ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Key = key;
|
||||
CheckLOS = true;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( !m_Key.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
|
||||
}
|
||||
else if ( targeted == m_Key )
|
||||
{
|
||||
from.SendMessage( "This acid is to dissolve locks and traps on most chests." );
|
||||
}
|
||||
else if ( targeted is LootChest || targeted is SunkenChest || targeted is AncientChest || targeted is TreasureMapChest )
|
||||
{
|
||||
if ( targeted is LootChest )
|
||||
((LootChest)targeted).Setup();
|
||||
|
||||
ILockable o = (ILockable)targeted;
|
||||
LockableContainer cont2 = (LockableContainer)o;
|
||||
TrapableContainer cont3 = (TrapableContainer)o;
|
||||
|
||||
if ( ( o.Locked ) || ( cont3.TrapType != TrapType.None ) )
|
||||
{
|
||||
if ( o is BaseDoor && !((BaseDoor)o).UseLocks() ) // this seems to check house doors also
|
||||
{
|
||||
from.SendMessage( "This acid is used to dissolve locks and traps on chests." );
|
||||
}
|
||||
else
|
||||
{
|
||||
o.Locked = false;
|
||||
|
||||
if ( o is LockableContainer )
|
||||
{
|
||||
LockableContainer cont = (LockableContainer)o;
|
||||
if ( cont.LockLevel == -255 )
|
||||
{
|
||||
cont.LockLevel = cont.RequiredSkill - 10;
|
||||
if ( cont.LockLevel == 0 )
|
||||
cont.LockLevel = -1;
|
||||
}
|
||||
|
||||
cont.Picker = from; // sets "lockpicker" to the user.
|
||||
}
|
||||
|
||||
if ( o is TrapableContainer )
|
||||
{
|
||||
TrapableContainer cont = (TrapableContainer)o;
|
||||
|
||||
if ( cont.TrapType != TrapType.None )
|
||||
cont.TrapType = TrapType.None;
|
||||
}
|
||||
|
||||
from.SendMessage( "The acid seems to have eaten away at the mechanism inside." );
|
||||
from.RevealingAction();
|
||||
from.PlaySound( 0x231 );
|
||||
from.AddToBackpack( new Bottle() );
|
||||
m_Key.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You don't need to use acid on that." );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "This acid is to dissolve locks and traps on chests." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BottleOfAcid( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Scripts/Items/Rares/Elixirs/BaseManaElixir.cs
Normal file
67
Scripts/Items/Rares/Elixirs/BaseManaElixir.cs
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseManaElixir : BasePotion
|
||||
{
|
||||
public override int Hue{ get { return 0x43C; } }
|
||||
|
||||
public abstract int MinMana { get; }
|
||||
public abstract int MaxMana { get; }
|
||||
public abstract double Delay { get; }
|
||||
|
||||
public BaseManaElixir( PotionEffect effect ) : base( 0x180F, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseManaElixir( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public void DoMana( Mobile from )
|
||||
{
|
||||
from.Mana = from.Mana + ( Utility.RandomMinMax( MinMana, MaxMana ) );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.Mana < from.ManaMax )
|
||||
{
|
||||
if ( from.BeginAction( typeof( BaseManaElixir ) ) )
|
||||
{
|
||||
DoMana( from );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseManaLock ), from );
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x22, true, "You must wait 10 seconds before using another mana potion." );
|
||||
|
||||
}
|
||||
else
|
||||
from.SendMessage( "You decide against drinking this potion, as you are already at full mana." );
|
||||
}
|
||||
|
||||
private static void ReleaseManaLock( object state )
|
||||
{
|
||||
((Mobile)state).EndAction( typeof( BaseManaElixir ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
74
Scripts/Items/Rares/Elixirs/BaseVigorElixir.cs
Normal file
74
Scripts/Items/Rares/Elixirs/BaseVigorElixir.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseVigorElixir : BasePotion
|
||||
{
|
||||
public override int Hue{ get { return 0x429; } }
|
||||
|
||||
public abstract int MinRejuv { get; }
|
||||
public abstract int MaxRejuv { get; }
|
||||
public abstract double Delay { get; }
|
||||
|
||||
public BaseVigorElixir( PotionEffect effect ) : base( 0x180F, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseVigorElixir( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void DoRejuv( Mobile from )
|
||||
{
|
||||
int min = MinRejuv;
|
||||
int max = MaxRejuv;
|
||||
|
||||
from.Mana = from.Mana + ( Utility.RandomMinMax( min, max ) );
|
||||
from.Stam = from.Stam + ( Utility.RandomMinMax( min, max ) );
|
||||
|
||||
if ( from is PlayerMobile )
|
||||
{
|
||||
min = (int)(min * Server.Misc.Settings.HitPoints());
|
||||
max = (int)(max * Server.Misc.Settings.HitPoints());
|
||||
}
|
||||
|
||||
from.Hits = from.Hits + ( Utility.RandomMinMax( min, max ) );
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.BeginAction( typeof( BaseVigorElixir ) ) )
|
||||
{
|
||||
DoRejuv( from );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
this.Consume();
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseRejuvenateLock ), from );
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x22, true, "You must wait 10 seconds before using another rejuvenation potion." );
|
||||
}
|
||||
|
||||
private static void ReleaseRejuvenateLock( object state )
|
||||
{
|
||||
((Mobile)state).EndAction( typeof( BaseVigorElixir ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
138
Scripts/Items/Rares/Elixirs/InvisibilityElixir.cs
Normal file
138
Scripts/Items/Rares/Elixirs/InvisibilityElixir.cs
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
using System;
|
||||
using Server;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using System.Text;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class InvisibilityElixir : BasePotion
|
||||
{
|
||||
public override int Hue{ get { return 0x432; } }
|
||||
|
||||
[Constructable]
|
||||
public InvisibilityElixir() : base( 0x180F, PotionEffect.Invisibility )
|
||||
{
|
||||
Name = "elixir of invisibility";
|
||||
ItemID = 0x2038;
|
||||
}
|
||||
|
||||
public InvisibilityElixir( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static bool HasEffect( Mobile m )
|
||||
{
|
||||
return ( m_Table[m] != null );
|
||||
}
|
||||
|
||||
public static void RemoveEffect( Mobile m )
|
||||
{
|
||||
object[] mods = (object[])m_Table[m];
|
||||
|
||||
if ( mods != null )
|
||||
{
|
||||
m.RemoveSkillMod( (SkillMod)mods[0] );
|
||||
m.RemoveSkillMod( (SkillMod)mods[1] );
|
||||
}
|
||||
|
||||
m_Table.Remove( m );
|
||||
m.EndAction( typeof( InvisibilityElixir ) );
|
||||
m.Hidden = false;
|
||||
}
|
||||
|
||||
public override void Drink( Mobile m )
|
||||
{
|
||||
if ( !m.CanBeginAction( typeof( InvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else if ( !m.CanBeginAction( typeof( WeakInvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else if ( !m.CanBeginAction( typeof( StrongInvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else
|
||||
{
|
||||
int MyHide = 100 - (int)m.Skills[SkillName.Hiding].Base;
|
||||
if ( MyHide < 0 ){ MyHide = 0; }
|
||||
int MyStealth = 100 - (int)m.Skills[SkillName.Stealth].Base;
|
||||
if ( MyStealth < 0 ){ MyStealth = 0; }
|
||||
|
||||
object[] mods = new object[]
|
||||
{
|
||||
new DefaultSkillMod( SkillName.Hiding, true, MyHide ),
|
||||
new DefaultSkillMod( SkillName.Stealth, true, MyStealth ),
|
||||
};
|
||||
|
||||
m_Table[m] = mods;
|
||||
|
||||
m.AddSkillMod( (SkillMod)mods[0] );
|
||||
m.AddSkillMod( (SkillMod)mods[1] );
|
||||
|
||||
foreach ( Mobile pet in World.Mobiles.Values )
|
||||
{
|
||||
if ( pet is BaseCreature )
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)pet;
|
||||
if ( bc.Controlled && bc.ControlMaster == m )
|
||||
pet.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
new InternalTimer( m, TimeSpan.FromMinutes( 2 ) ).Start();
|
||||
|
||||
BasePotion.PlayDrinkEffect( m );
|
||||
|
||||
m.Hidden = true;
|
||||
|
||||
m.BeginAction( typeof( InvisibilityElixir ) );
|
||||
|
||||
this.Amount--;
|
||||
if (this.Amount <= 0)
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_m;
|
||||
private DateTime m_Expire;
|
||||
|
||||
public InternalTimer( Mobile m, TimeSpan duration ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 0.1 ) )
|
||||
{
|
||||
m_m = m;
|
||||
m_Expire = DateTime.Now + duration;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( DateTime.Now >= m_Expire )
|
||||
{
|
||||
InvisibilityElixir.RemoveEffect( m_m );
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Rares/Elixirs/ManaElixir.cs
Normal file
35
Scripts/Items/Rares/Elixirs/ManaElixir.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ManaElixir : BaseManaElixir
|
||||
{
|
||||
public override int MinMana { get{ return 13; } }
|
||||
public override int MaxMana { get{ return 16; } }
|
||||
public override double Delay { get{ return 8.0; } }
|
||||
|
||||
[Constructable]
|
||||
public ManaElixir( ) : base( PotionEffect.Mana )
|
||||
{
|
||||
Name = "elixir of mana";
|
||||
ItemID = 0x2038;
|
||||
}
|
||||
|
||||
public ManaElixir( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
144
Scripts/Items/Rares/Elixirs/StrongInvisibilityElixir.cs
Normal file
144
Scripts/Items/Rares/Elixirs/StrongInvisibilityElixir.cs
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
using System;
|
||||
using Server;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using System.Text;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StrongInvisibilityElixir : BasePotion
|
||||
{
|
||||
public override int Hue{ get { return 0x432; } }
|
||||
|
||||
[Constructable]
|
||||
public StrongInvisibilityElixir() : base( 0x180F, PotionEffect.InvisibilityStrong )
|
||||
{
|
||||
Name = "elixir of invisibility";
|
||||
ItemID = 0x2037;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Strong" );
|
||||
}
|
||||
|
||||
public StrongInvisibilityElixir( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static bool HasEffect( Mobile m )
|
||||
{
|
||||
return ( m_Table[m] != null );
|
||||
}
|
||||
|
||||
public static void RemoveEffect( Mobile m )
|
||||
{
|
||||
object[] mods = (object[])m_Table[m];
|
||||
|
||||
if ( mods != null )
|
||||
{
|
||||
m.RemoveSkillMod( (SkillMod)mods[0] );
|
||||
m.RemoveSkillMod( (SkillMod)mods[1] );
|
||||
}
|
||||
|
||||
m_Table.Remove( m );
|
||||
m.EndAction( typeof( StrongInvisibilityElixir ) );
|
||||
m.Hidden = false;
|
||||
}
|
||||
|
||||
public override void Drink( Mobile m )
|
||||
{
|
||||
if ( !m.CanBeginAction( typeof( InvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else if ( !m.CanBeginAction( typeof( WeakInvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else if ( !m.CanBeginAction( typeof( StrongInvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else
|
||||
{
|
||||
int MyHide = 100 - (int)m.Skills[SkillName.Hiding].Base;
|
||||
if ( MyHide < 0 ){ MyHide = 0; }
|
||||
int MyStealth = 100 - (int)m.Skills[SkillName.Stealth].Base;
|
||||
if ( MyStealth < 0 ){ MyStealth = 0; }
|
||||
|
||||
object[] mods = new object[]
|
||||
{
|
||||
new DefaultSkillMod( SkillName.Hiding, true, MyHide ),
|
||||
new DefaultSkillMod( SkillName.Stealth, true, MyStealth ),
|
||||
};
|
||||
|
||||
m_Table[m] = mods;
|
||||
|
||||
m.AddSkillMod( (SkillMod)mods[0] );
|
||||
m.AddSkillMod( (SkillMod)mods[1] );
|
||||
|
||||
foreach ( Mobile pet in World.Mobiles.Values )
|
||||
{
|
||||
if ( pet is BaseCreature )
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)pet;
|
||||
if ( bc.Controlled && bc.ControlMaster == m )
|
||||
pet.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
new InternalTimer( m, TimeSpan.FromMinutes( 3 ) ).Start();
|
||||
|
||||
BasePotion.PlayDrinkEffect( m );
|
||||
|
||||
m.Hidden = true;
|
||||
|
||||
m.BeginAction( typeof( StrongInvisibilityElixir ) );
|
||||
|
||||
this.Amount--;
|
||||
if (this.Amount <= 0)
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_m;
|
||||
private DateTime m_Expire;
|
||||
|
||||
public InternalTimer( Mobile m, TimeSpan duration ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 0.1 ) )
|
||||
{
|
||||
m_m = m;
|
||||
m_Expire = DateTime.Now + duration;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( DateTime.Now >= m_Expire )
|
||||
{
|
||||
StrongInvisibilityElixir.RemoveEffect( m_m );
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Rares/Elixirs/StrongManaElixir.cs
Normal file
41
Scripts/Items/Rares/Elixirs/StrongManaElixir.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StrongManaElixir : BaseManaElixir
|
||||
{
|
||||
public override int MinMana { get{ return 20; } }
|
||||
public override int MaxMana { get{ return 25; } }
|
||||
public override double Delay { get{ return 10.0; } }
|
||||
|
||||
[Constructable]
|
||||
public StrongManaElixir( ) : base( PotionEffect.ManaStrong )
|
||||
{
|
||||
Name = "elixir of mana";
|
||||
ItemID = 0x2037;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Strong" );
|
||||
}
|
||||
|
||||
public StrongManaElixir( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Rares/Elixirs/StrongVigorElixir.cs
Normal file
41
Scripts/Items/Rares/Elixirs/StrongVigorElixir.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StrongVigorElixir : BaseVigorElixir
|
||||
{
|
||||
public override int MinRejuv { get{ return 20; } }
|
||||
public override int MaxRejuv { get{ return 25; } }
|
||||
public override double Delay { get{ return 10.0; } }
|
||||
|
||||
[Constructable]
|
||||
public StrongVigorElixir( ) : base( PotionEffect.VigorStrong )
|
||||
{
|
||||
Name = "elixir of vigor";
|
||||
ItemID = 0x2037;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Strong" );
|
||||
}
|
||||
|
||||
public StrongVigorElixir( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Rares/Elixirs/VigorElixir.cs
Normal file
35
Scripts/Items/Rares/Elixirs/VigorElixir.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class VigorElixir : BaseVigorElixir
|
||||
{
|
||||
public override int MinRejuv { get{ return 13; } }
|
||||
public override int MaxRejuv { get{ return 16; } }
|
||||
public override double Delay { get{ return 8.0; } }
|
||||
|
||||
[Constructable]
|
||||
public VigorElixir( ) : base( PotionEffect.Vigor )
|
||||
{
|
||||
Name = "elixir of vigor";
|
||||
ItemID = 0x2038;
|
||||
}
|
||||
|
||||
public VigorElixir( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
144
Scripts/Items/Rares/Elixirs/WeakInvisibilityElixir.cs
Normal file
144
Scripts/Items/Rares/Elixirs/WeakInvisibilityElixir.cs
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
using System;
|
||||
using Server;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using System.Text;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WeakInvisibilityElixir : BasePotion
|
||||
{
|
||||
public override int Hue{ get { return 0x432; } }
|
||||
|
||||
[Constructable]
|
||||
public WeakInvisibilityElixir() : base( 0x23BD, PotionEffect.InvisibilityWeak )
|
||||
{
|
||||
Name = "elixir of invisibility";
|
||||
ItemID = 0x12AD;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Weak" );
|
||||
}
|
||||
|
||||
public WeakInvisibilityElixir( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static bool HasEffect( Mobile m )
|
||||
{
|
||||
return ( m_Table[m] != null );
|
||||
}
|
||||
|
||||
public static void RemoveEffect( Mobile m )
|
||||
{
|
||||
object[] mods = (object[])m_Table[m];
|
||||
|
||||
if ( mods != null )
|
||||
{
|
||||
m.RemoveSkillMod( (SkillMod)mods[0] );
|
||||
m.RemoveSkillMod( (SkillMod)mods[1] );
|
||||
}
|
||||
|
||||
m_Table.Remove( m );
|
||||
m.EndAction( typeof( WeakInvisibilityElixir ) );
|
||||
m.Hidden = false;
|
||||
}
|
||||
|
||||
public override void Drink( Mobile m )
|
||||
{
|
||||
if ( !m.CanBeginAction( typeof( InvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else if ( !m.CanBeginAction( typeof( WeakInvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else if ( !m.CanBeginAction( typeof( StrongInvisibilityElixir ) ) )
|
||||
{
|
||||
m.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You cannot drink another invisibility potion yet", m.NetState);
|
||||
}
|
||||
else
|
||||
{
|
||||
int MyHide = 100 - (int)m.Skills[SkillName.Hiding].Base;
|
||||
if ( MyHide < 0 ){ MyHide = 0; }
|
||||
int MyStealth = 100 - (int)m.Skills[SkillName.Stealth].Base;
|
||||
if ( MyStealth < 0 ){ MyStealth = 0; }
|
||||
|
||||
object[] mods = new object[]
|
||||
{
|
||||
new DefaultSkillMod( SkillName.Hiding, true, MyHide ),
|
||||
new DefaultSkillMod( SkillName.Stealth, true, MyStealth ),
|
||||
};
|
||||
|
||||
m_Table[m] = mods;
|
||||
|
||||
m.AddSkillMod( (SkillMod)mods[0] );
|
||||
m.AddSkillMod( (SkillMod)mods[1] );
|
||||
|
||||
foreach ( Mobile pet in World.Mobiles.Values )
|
||||
{
|
||||
if ( pet is BaseCreature )
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)pet;
|
||||
if ( bc.Controlled && bc.ControlMaster == m )
|
||||
pet.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
new InternalTimer( m, TimeSpan.FromMinutes( 1 ) ).Start();
|
||||
|
||||
BasePotion.PlayDrinkEffect( m );
|
||||
|
||||
m.Hidden = true;
|
||||
|
||||
m.BeginAction( typeof( WeakInvisibilityElixir ) );
|
||||
|
||||
this.Amount--;
|
||||
if (this.Amount <= 0)
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_m;
|
||||
private DateTime m_Expire;
|
||||
|
||||
public InternalTimer( Mobile m, TimeSpan duration ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 0.1 ) )
|
||||
{
|
||||
m_m = m;
|
||||
m_Expire = DateTime.Now + duration;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( DateTime.Now >= m_Expire )
|
||||
{
|
||||
WeakInvisibilityElixir.RemoveEffect( m_m );
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Rares/Elixirs/WeakManaElixir.cs
Normal file
41
Scripts/Items/Rares/Elixirs/WeakManaElixir.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WeakManaElixir : BaseManaElixir
|
||||
{
|
||||
public override int MinMana { get{ return 6; } }
|
||||
public override int MaxMana { get{ return 8; } }
|
||||
public override double Delay { get{ return 3.0; } }
|
||||
|
||||
[Constructable]
|
||||
public WeakManaElixir( ) : base( PotionEffect.ManaWeak )
|
||||
{
|
||||
Name = "elixir of mana";
|
||||
ItemID = 0x12AD;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Weak" );
|
||||
}
|
||||
|
||||
public WeakManaElixir( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Rares/Elixirs/WeakVigorElixir.cs
Normal file
41
Scripts/Items/Rares/Elixirs/WeakVigorElixir.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WeakVigorElixir : BaseVigorElixir
|
||||
{
|
||||
public override int MinRejuv { get{ return 6; } }
|
||||
public override int MaxRejuv { get{ return 8; } }
|
||||
public override double Delay { get{ return 3.0; } }
|
||||
|
||||
[Constructable]
|
||||
public WeakVigorElixir( ) : base( PotionEffect.VigorWeak )
|
||||
{
|
||||
Name = "elixir of vigor";
|
||||
ItemID = 0x12AD;
|
||||
}
|
||||
|
||||
public override void AddNameProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperties( list );
|
||||
list.Add( 1070722, "Weak" );
|
||||
}
|
||||
|
||||
public WeakVigorElixir( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
180
Scripts/Items/Rares/SkeletonKeys.cs
Normal file
180
Scripts/Items/Rares/SkeletonKeys.cs
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SkeletonKeys : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SkeletonKeys() : base( 0x176B )
|
||||
{
|
||||
Name = "skeleton keys";
|
||||
Uses = Utility.RandomMinMax( 3, 10 );
|
||||
UsesMax = Uses;
|
||||
}
|
||||
|
||||
public SkeletonKeys( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
from.SendMessage( "What do you want to the keys on?" );
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperty( list );
|
||||
|
||||
if ( Uses > 0 )
|
||||
{
|
||||
if ( Uses > 1 )
|
||||
list.Add( 1062518, "{0}", Uses );
|
||||
else
|
||||
list.Add( 1062519, "{0}", Uses );
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private SkeletonKeys m_Item;
|
||||
|
||||
public InternalTarget( SkeletonKeys item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted )
|
||||
return;
|
||||
|
||||
if ( targeted is LootChest )
|
||||
((LootChest)targeted).Setup();
|
||||
|
||||
if ( targeted is BaseDoor && from.Region is DungeonRegion )
|
||||
{
|
||||
BaseDoor door = (BaseDoor)targeted;
|
||||
|
||||
if ( door.Sealed > DateTime.Now )
|
||||
{
|
||||
from.PlaySound( 0x241 );
|
||||
door.Sealed = DateTime.MinValue;
|
||||
door.SendLocalizedMessageTo( from, 502076 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502069 ); // This does not appear to be locked
|
||||
}
|
||||
}
|
||||
else if ( targeted is ILockpickable )
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
from.Direction = from.GetDirectionTo( item );
|
||||
|
||||
if ( ((ILockpickable)targeted).Locked )
|
||||
{
|
||||
from.PlaySound( 0x241 );
|
||||
|
||||
new InternalTimer( from, (ILockpickable)targeted, m_Item ).Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The door is not locked
|
||||
from.SendLocalizedMessage( 502069 ); // This does not appear to be locked
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 501666 ); // You can't unlock that!
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private ILockpickable m_Item;
|
||||
private SkeletonKeys m_SkeletonKeys;
|
||||
|
||||
public InternalTimer( Mobile from, ILockpickable item, SkeletonKeys keys ) : base( TimeSpan.FromSeconds( 3.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Item = item;
|
||||
m_SkeletonKeys = keys;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected void BrokeSkeletonKeysTest()
|
||||
{
|
||||
// When failed, a 25% chance to break the SkeletonKeys
|
||||
if ( Utility.Random( 4 ) == 0 )
|
||||
{
|
||||
Item item = (Item)m_Item;
|
||||
m_From.SendMessage( "You broke one of the keys!" );
|
||||
m_From.PlaySound( 0x3A4 );
|
||||
m_SkeletonKeys.Uses--;
|
||||
if ( m_SkeletonKeys.Uses < 1 )
|
||||
m_SkeletonKeys.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Item item = (Item)m_Item;
|
||||
|
||||
if ( !m_From.InRange( item.GetWorldLocation(), 1 ) )
|
||||
return;
|
||||
|
||||
if ( m_Item.LockLevel == 0 || m_Item.LockLevel == -255 )
|
||||
{
|
||||
// LockLevel of 0 means that the door can't be picklocked
|
||||
// LockLevel of -255 means it's magic locked
|
||||
m_From.SendMessage( "This lock cannot be unlocked by normal means." );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (m_From.Skills[SkillName.Lockpicking].Value+20) < m_Item.RequiredSkill )
|
||||
{
|
||||
/*
|
||||
// Do some training to gain skills
|
||||
m_From.CheckSkill( SkillName.Lockpicking, 0, m_Item.LockLevel );*/
|
||||
|
||||
// The LockLevel is higher thant the Lockpicking of the player
|
||||
item.SendLocalizedMessageTo( m_From, 502072 ); // You don't see how that lock can be manipulated.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_From.CheckTargetSkill( SkillName.Lockpicking, m_Item, m_Item.LockLevel-20, m_Item.MaxLockLevel-20 ) )
|
||||
{
|
||||
// Success! Pick the lock!
|
||||
m_From.SendMessage( "The lock opens with the keys." );
|
||||
m_From.PlaySound( 0x4A );
|
||||
m_Item.LockPick( m_From );
|
||||
}
|
||||
else
|
||||
{
|
||||
// The player failed to pick the lock
|
||||
BrokeSkeletonKeysTest();
|
||||
m_From.SendMessage( "You are unable to unlock this." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue