Logging of staff crafting items, Fixes for the OSI client changes The potion stacking stuff BaseWeapon fix, so that damage increase things don't multiply themselves. admin gump fixes for Firewall Various display tweaks for weight SoS no longer spawn in Tokuno Hiryu hues happified to OSI standards staff now see alliance chat correctly Play barkeeper text increased per OSI Various other OSI skill requirement changes Various unimplemented features of the SE moves EventSink for when the client version is received from client. Client validation moved out of the core. Client version validation now has options to ignore/kick/warn/annoy. Automagically tries to detect current client. Reverted the delayeddamagecontext back to OSI standards. Can no longer use bags of sending in jail. MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em. TransformationSpellHelper now implemented. Things moved around for this. Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle. Circle doesn't make sense for non-Magery spells! Alot of the spellweaving spells added to OSI standards.
108 lines
No EOL
2.2 KiB
C#
108 lines
No EOL
2.2 KiB
C#
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 ( TransformationSpellHelper.UnderTransformation( from, typeof( Spells.Necromancy.VampiricEmbraceSpell ) ) )
|
|
{
|
|
from.SendLocalizedMessage( 1061652 ); // The garlic in the potion would surely kill you.
|
|
}
|
|
else 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.
|
|
}
|
|
}
|
|
}
|
|
} |