#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
104
Scripts/Items/Skill Items/Potions/Cure Potions/BaseCurePotion.cs
Normal file
104
Scripts/Items/Skill Items/Potions/Cure Potions/BaseCurePotion.cs
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CureLevelInfo
|
||||
{
|
||||
private Poison m_Poison;
|
||||
private double m_Chance;
|
||||
|
||||
public Poison Poison
|
||||
{
|
||||
get{ return m_Poison; }
|
||||
}
|
||||
|
||||
public double Chance
|
||||
{
|
||||
get{ return m_Chance; }
|
||||
}
|
||||
|
||||
public CureLevelInfo( Poison poison, double chance )
|
||||
{
|
||||
m_Poison = poison;
|
||||
m_Chance = chance;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseCurePotion : BasePotion
|
||||
{
|
||||
public abstract CureLevelInfo[] LevelInfo{ get; }
|
||||
|
||||
public BaseCurePotion( PotionEffect effect ) : base( 0xF07, effect )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseCurePotion( 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 DoCure( Mobile from )
|
||||
{
|
||||
bool cure = false;
|
||||
|
||||
CureLevelInfo[] info = LevelInfo;
|
||||
|
||||
for ( int i = 0; i < info.Length; ++i )
|
||||
{
|
||||
CureLevelInfo li = info[i];
|
||||
|
||||
if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
|
||||
{
|
||||
cure = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( cure && from.CurePoison( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500231 ); // You feel cured of poison!
|
||||
|
||||
from.FixedEffect( 0x373A, 10, 15 );
|
||||
from.PlaySound( 0x1E0 );
|
||||
}
|
||||
else if ( !cure )
|
||||
{
|
||||
from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment!
|
||||
}
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( from.Poisoned )
|
||||
{
|
||||
DoCure( from );
|
||||
|
||||
BasePotion.PlayDrinkEffect( from );
|
||||
|
||||
from.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
|
||||
from.PlaySound( 0x1E0 );
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042000 ); // You are not poisoned.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Skill Items/Potions/Cure Potions/CurePotion.cs
Normal file
41
Scripts/Items/Skill Items/Potions/Cure Potions/CurePotion.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo( Poison.Lesser, 1.00 ), // 100% chance to cure lesser poison
|
||||
new CureLevelInfo( Poison.Regular, 0.75 ), // 75% chance to cure regular poison
|
||||
new CureLevelInfo( Poison.Greater, 0.50 ), // 50% chance to cure greater poison
|
||||
new CureLevelInfo( Poison.Deadly, 0.15 ) // 15% chance to cure deadly poison
|
||||
};
|
||||
|
||||
public override CureLevelInfo[] LevelInfo{ get{ return m_OldLevelInfo; } }
|
||||
|
||||
[Constructable]
|
||||
public CurePotion() : base( PotionEffect.Cure )
|
||||
{
|
||||
}
|
||||
|
||||
public CurePotion( 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,42 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterCurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo( Poison.Lesser, 1.00 ), // 100% chance to cure lesser poison
|
||||
new CureLevelInfo( Poison.Regular, 1.00 ), // 100% chance to cure regular poison
|
||||
new CureLevelInfo( Poison.Greater, 1.00 ), // 100% chance to cure greater poison
|
||||
new CureLevelInfo( Poison.Deadly, 0.75 ), // 75% chance to cure deadly poison
|
||||
new CureLevelInfo( Poison.Lethal, 0.25 ) // 25% chance to cure lethal poison
|
||||
};
|
||||
|
||||
public override CureLevelInfo[] LevelInfo{ get{ return m_OldLevelInfo; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterCurePotion() : base( PotionEffect.CureGreater )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterCurePotion( 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,40 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LesserCurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo( Poison.Lesser, 0.75 ), // 75% chance to cure lesser poison
|
||||
new CureLevelInfo( Poison.Regular, 0.50 ), // 50% chance to cure regular poison
|
||||
new CureLevelInfo( Poison.Greater, 0.15 ) // 15% chance to cure greater poison
|
||||
};
|
||||
|
||||
public override CureLevelInfo[] LevelInfo{ get{ return m_OldLevelInfo; } }
|
||||
|
||||
[Constructable]
|
||||
public LesserCurePotion() : base( PotionEffect.CureLesser )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserCurePotion( 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