#W# Initial Commit: Avatars Conquest

This commit is contained in:
WarrentyExpired 2026-07-04 10:35:30 -04:00
commit 5df497787a
7510 changed files with 416048 additions and 0 deletions

View file

@ -0,0 +1,84 @@
using System;
using Server;
using Server.Network;
using Server.Mobiles;
namespace Server.Items
{
public abstract class BaseHealPotion : BasePotion
{
public abstract int MinHeal { get; }
public abstract int MaxHeal { get; }
public abstract double Delay { get; }
public BaseHealPotion( PotionEffect effect ) : base( 0xF0C, effect )
{
}
public BaseHealPotion( 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 DoHeal( Mobile from )
{
int min = Scale( from, MinHeal );
int max = Scale( from, MaxHeal );
int heal = Utility.RandomMinMax( min, max );
if ( from is PlayerMobile ){ heal = (int)(heal * Server.Misc.Settings.HitPoints()); }
from.Heal( heal );
}
public override void Drink( Mobile from )
{
if ( from.Hits < from.HitsMax )
{
if ( from.Poisoned )
{
from.LocalOverheadMessage( MessageType.Regular, 0x22, 1005000 ); // You can not heal yourself in your current state.
}
else
{
if ( from.BeginAction( typeof( BaseHealPotion ) ) )
{
DoHeal( from );
BasePotion.PlayDrinkEffect( from );
this.Consume();
Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseHealLock ), from );
}
else
{
from.LocalOverheadMessage( MessageType.Regular, 0x22, 500235 ); // You must wait 10 seconds before using another healing potion.
}
}
}
else
{
from.SendLocalizedMessage( 1049547 ); // You decide against drinking this potion, as you are already at full health.
}
}
private static void ReleaseHealLock( object state )
{
((Mobile)state).EndAction( typeof( BaseHealPotion ) );
}
}
}

View file

@ -0,0 +1,35 @@
using System;
using Server;
namespace Server.Items
{
public class GreaterHealPotion : BaseHealPotion
{
public override int MinHeal { get { return 9; } }
public override int MaxHeal { get { return 30; } }
public override double Delay{ get{ return 10.0; } }
[Constructable]
public GreaterHealPotion() : base( PotionEffect.HealGreater )
{
}
public GreaterHealPotion( 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();
}
}
}

View file

@ -0,0 +1,35 @@
using System;
using Server;
namespace Server.Items
{
public class HealPotion : BaseHealPotion
{
public override int MinHeal { get { return 6; } }
public override int MaxHeal { get { return 20; } }
public override double Delay{ get{ return 10.0; } }
[Constructable]
public HealPotion() : base( PotionEffect.Heal )
{
}
public HealPotion( 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();
}
}
}

View file

@ -0,0 +1,35 @@
using System;
using Server;
namespace Server.Items
{
public class LesserHealPotion : BaseHealPotion
{
public override int MinHeal { get { return 3; } }
public override int MaxHeal { get { return 10; } }
public override double Delay{ get{ return 10.0; } }
[Constructable]
public LesserHealPotion() : base( PotionEffect.HealLesser )
{
}
public LesserHealPotion( 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();
}
}
}