#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
8eae46895e
7512 changed files with 416187 additions and 0 deletions
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue