v0.0.1-Alpha (#42)
This commit is contained in:
parent
d30f93c454
commit
a36796c2c1
3552 changed files with 2476 additions and 15223 deletions
|
|
@ -0,0 +1,100 @@
|
|||
using Server.Engines.ConPVP;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Necromancy;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CureLevelInfo
|
||||
{
|
||||
public CureLevelInfo(Poison poison, double chance)
|
||||
{
|
||||
Poison = poison;
|
||||
Chance = chance;
|
||||
}
|
||||
|
||||
public Poison Poison{ get; }
|
||||
|
||||
public double Chance{ get; }
|
||||
}
|
||||
|
||||
public abstract class BaseCurePotion : BasePotion
|
||||
{
|
||||
public BaseCurePotion(PotionEffect effect) : base(0xF07, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseCurePotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract CureLevelInfo[] LevelInfo{ get; }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(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(VampiricEmbraceSpell)))
|
||||
{
|
||||
from.SendLocalizedMessage(1061652); // The garlic in the potion would surely kill you.
|
||||
}
|
||||
else if (from.Poisoned)
|
||||
{
|
||||
DoCure(from);
|
||||
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
|
||||
from.PlaySound(0x1E0);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042000); // You are not poisoned.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class CurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo =
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
private static CureLevelInfo[] m_AosLevelInfo =
|
||||
{
|
||||
new CureLevelInfo(Poison.Lesser, 1.00),
|
||||
new CureLevelInfo(Poison.Regular, 0.95),
|
||||
new CureLevelInfo(Poison.Greater, 0.75),
|
||||
new CureLevelInfo(Poison.Deadly, 0.50),
|
||||
new CureLevelInfo(Poison.Lethal, 0.25)
|
||||
};
|
||||
|
||||
[Constructible]
|
||||
public CurePotion() : base(PotionEffect.Cure)
|
||||
{
|
||||
}
|
||||
|
||||
public CurePotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class GreaterCurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo =
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
private static CureLevelInfo[] m_AosLevelInfo =
|
||||
{
|
||||
new CureLevelInfo(Poison.Lesser, 1.00),
|
||||
new CureLevelInfo(Poison.Regular, 1.00),
|
||||
new CureLevelInfo(Poison.Greater, 1.00),
|
||||
new CureLevelInfo(Poison.Deadly, 0.95),
|
||||
new CureLevelInfo(Poison.Lethal, 0.75)
|
||||
};
|
||||
|
||||
[Constructible]
|
||||
public GreaterCurePotion() : base(PotionEffect.CureGreater)
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterCurePotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class LesserCurePotion : BaseCurePotion
|
||||
{
|
||||
private static CureLevelInfo[] m_OldLevelInfo =
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
private static CureLevelInfo[] m_AosLevelInfo =
|
||||
{
|
||||
new CureLevelInfo(Poison.Lesser, 0.75),
|
||||
new CureLevelInfo(Poison.Regular, 0.50),
|
||||
new CureLevelInfo(Poison.Greater, 0.25)
|
||||
};
|
||||
|
||||
[Constructible]
|
||||
public LesserCurePotion() : base(PotionEffect.CureLesser)
|
||||
{
|
||||
}
|
||||
|
||||
public LesserCurePotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(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