Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
1679
Scripts/Items/Equipment/Talismans/BaseTalisman.cs
Normal file
1679
Scripts/Items/Equipment/Talismans/BaseTalisman.cs
Normal file
File diff suppressed because it is too large
Load Diff
41
Scripts/Items/Equipment/Talismans/BloodwoodSpirit.cs
Normal file
41
Scripts/Items/Equipment/Talismans/BloodwoodSpirit.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BloodwoodSpirit : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1075034; } }// Bloodwood Spirit
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public BloodwoodSpirit()
|
||||
: base(0x2F5A)
|
||||
{
|
||||
Hue = 0x27;
|
||||
MaxChargeTime = 1200;
|
||||
Removal = TalismanRemoval.Damage;
|
||||
Blessed = GetRandomBlessed();
|
||||
Protection = GetRandomProtection(false);
|
||||
SkillBonuses.SetValues(0, SkillName.SpiritSpeak, 10.0);
|
||||
SkillBonuses.SetValues(1, SkillName.Necromancy, 5.0);
|
||||
}
|
||||
|
||||
public BloodwoodSpirit(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TreatiseonAlchemyTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1073353; } }// Library Talisman - Treatise on Alchemy
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public TreatiseonAlchemyTalisman()
|
||||
: base(0x2F58)
|
||||
{
|
||||
Skill = TalismanSkill.Alchemy;
|
||||
SuccessBonus = GetRandomSuccessful();
|
||||
Blessed = GetRandomBlessed();
|
||||
Attributes.EnhancePotions = 15;
|
||||
SkillBonuses.SetValues(0, SkillName.Magery, 5.0);
|
||||
}
|
||||
|
||||
public TreatiseonAlchemyTalisman(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 class PrimerOnArmsTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1073354; } }// Library Talisman - A Primer on Arms
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public PrimerOnArmsTalisman()
|
||||
: base(0x2F59)
|
||||
{
|
||||
Blessed = GetRandomBlessed();
|
||||
Attributes.BonusStr = 1;
|
||||
Attributes.RegenHits = 2;
|
||||
Attributes.WeaponDamage = 20;
|
||||
Removal = TalismanRemoval.Damage;
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
|
||||
public PrimerOnArmsTalisman(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 class MyBookTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1073355; } }// Library Talisman - My Book
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public MyBookTalisman()
|
||||
: base(0x2F5A)
|
||||
{
|
||||
Blessed = GetRandomBlessed();
|
||||
Skill = TalismanSkill.Inscription;
|
||||
SuccessBonus = GetRandomSuccessful();
|
||||
ExceptionalBonus = GetRandomExceptional();
|
||||
Attributes.BonusInt = 5;
|
||||
Attributes.BonusMana = 2;
|
||||
}
|
||||
|
||||
public MyBookTalisman(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 class TalkingtoWispsTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1073356; } }// Library Talisman - Talking to Wisps
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public TalkingtoWispsTalisman()
|
||||
: base(0x2F5B)
|
||||
{
|
||||
Blessed = GetRandomBlessed();
|
||||
SkillBonuses.SetValues(0, SkillName.SpiritSpeak, 3.0);
|
||||
SkillBonuses.SetValues(1, SkillName.EvalInt, 5.0);
|
||||
Removal = TalismanRemoval.Ward;
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
|
||||
public TalkingtoWispsTalisman(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 class GrammarOfOrchishTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1073358; } }// Library Talisman - a Grammar of Orchish (Summoner)
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public GrammarOfOrchishTalisman()
|
||||
: base(0x2F59)
|
||||
{
|
||||
Blessed = GetRandomBlessed();
|
||||
Protection = GetRandomProtection();
|
||||
Summoner = new TalismanAttribute(typeof(SummonedOrcBrute), 0, 1072414);
|
||||
SkillBonuses.SetValues(0, SkillName.MagicResist, 5.0);
|
||||
SkillBonuses.SetValues(1, SkillName.Anatomy, 7.0);
|
||||
MaxChargeTime = 1800;
|
||||
}
|
||||
|
||||
public GrammarOfOrchishTalisman(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 class BirdsofBritanniaTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1074892; } }// Library Talisman - Birds of Britannia Random Summoner
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
public override Type GetSummoner() { return GetRandomSummonType(); }
|
||||
|
||||
[Constructable]
|
||||
public BirdsofBritanniaTalisman()
|
||||
: base(0x2F5A)
|
||||
{
|
||||
Blessed = GetRandomBlessed();
|
||||
Slayer = TalismanSlayerName.Bird;
|
||||
SkillBonuses.SetValues(0, SkillName.AnimalTaming, 5.0);
|
||||
SkillBonuses.SetValues(1, SkillName.AnimalLore, 5.0);
|
||||
MaxChargeTime = 1800;
|
||||
}
|
||||
|
||||
public BirdsofBritanniaTalisman(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 class TheLifeOfTravelingMinstrelTalisman : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1073360; } }// Library Talisman - The Life of a Traveling Minstrel
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public TheLifeOfTravelingMinstrelTalisman()
|
||||
: base(0x2F5B)
|
||||
{
|
||||
Blessed = GetRandomBlessed();
|
||||
Protection = GetRandomProtection();
|
||||
SkillBonuses.SetValues(0, SkillName.Provocation, 5.0);
|
||||
SkillBonuses.SetValues(1, SkillName.Musicianship, 5.0);
|
||||
Removal = TalismanRemoval.Curse;
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
|
||||
public TheLifeOfTravelingMinstrelTalisman(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Scripts/Items/Equipment/Talismans/ManaPhasingOrb.cs
Normal file
123
Scripts/Items/Equipment/Talismans/ManaPhasingOrb.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ManaPhasingOrb : BaseTalisman, Server.Engines.Craft.IRepairable
|
||||
{
|
||||
public override int LabelNumber { get { return 1116230; } }
|
||||
public Server.Engines.Craft.CraftSystem RepairSystem { get { return Server.Engines.Craft.DefTinkering.CraftSystem; } }
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public ManaPhasingOrb() : base(4246)
|
||||
{
|
||||
MaxChargeTime = 30;
|
||||
Charges = 50;
|
||||
MaxCharges = Charges;
|
||||
Hue = 1165;
|
||||
Attributes.Brittle = 1;
|
||||
Attributes.LowerManaCost = 6;
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: Attributes.RegenHits = 1; break;
|
||||
case 1: Attributes.RegenMana = 1; break;
|
||||
case 2: Attributes.RegenStam = 1; break;
|
||||
}
|
||||
|
||||
if (Utility.RandomBool())
|
||||
Attributes.DefendChance = 5;
|
||||
else
|
||||
Attributes.AttackChance = 5;
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: Attributes.LowerRegCost = 10; break;
|
||||
case 1: Attributes.WeaponDamage = 15; break;
|
||||
case 2: Attributes.SpellDamage = 5; break;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInManaPhase(Mobile from)
|
||||
{
|
||||
return _ManaPhaseTable != null && _ManaPhaseTable.Contains(from);
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
if (parent is Mobile && IsInManaPhase((Mobile)parent))
|
||||
RemoveFromTable((Mobile)parent);
|
||||
|
||||
base.OnRemoved(parent);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.Talisman != this)
|
||||
from.SendLocalizedMessage(502641); // You must equip this item to use it.
|
||||
else
|
||||
{
|
||||
if (ChargeTime > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1116163); //You must wait a few seconds before attempting to phase mana again.
|
||||
return;
|
||||
}
|
||||
|
||||
if (Charges > 0 && !IsInManaPhase(from))
|
||||
{
|
||||
AddToTable(from);
|
||||
OnAfterUse(from);
|
||||
|
||||
BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.ManaPhase, 1116158, 1153816));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
private static void AddToTable(Mobile from)
|
||||
{
|
||||
if (_ManaPhaseTable == null)
|
||||
_ManaPhaseTable = new List<Mobile>();
|
||||
|
||||
_ManaPhaseTable.Add(from);
|
||||
|
||||
from.SendLocalizedMessage(1116164); //Your next use of magical energy will draw its power from the void.
|
||||
}
|
||||
|
||||
public static void RemoveFromTable(Mobile from)
|
||||
{
|
||||
if (_ManaPhaseTable != null && _ManaPhaseTable.Contains(from))
|
||||
_ManaPhaseTable.Remove(from);
|
||||
|
||||
BuffInfo.RemoveBuff(from, BuffIcon.ManaPhase);
|
||||
|
||||
from.SendLocalizedMessage(1116165); //You will no longer attempt to draw magical energy from the void.
|
||||
}
|
||||
|
||||
public static List<Mobile> _ManaPhaseTable { get; set; }
|
||||
|
||||
public ManaPhasingOrb(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
60
Scripts/Items/Equipment/Talismans/RandomTalisman.cs
Normal file
60
Scripts/Items/Equipment/Talismans/RandomTalisman.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RandomTalisman : BaseTalisman
|
||||
{
|
||||
[Constructable]
|
||||
public RandomTalisman()
|
||||
: base(GetRandomItemID())
|
||||
{
|
||||
Summoner = BaseTalisman.GetRandomSummoner();
|
||||
|
||||
if (Summoner.IsEmpty)
|
||||
{
|
||||
Removal = BaseTalisman.GetRandomRemoval();
|
||||
|
||||
if (Removal != TalismanRemoval.None)
|
||||
{
|
||||
MaxCharges = BaseTalisman.GetRandomCharges();
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxCharges = Utility.RandomMinMax(10, 50);
|
||||
|
||||
if (Summoner.IsItem)
|
||||
MaxChargeTime = 60;
|
||||
else
|
||||
MaxChargeTime = 1800;
|
||||
}
|
||||
|
||||
Blessed = BaseTalisman.GetRandomBlessed();
|
||||
Slayer = BaseTalisman.GetRandomSlayer();
|
||||
Protection = BaseTalisman.GetRandomProtection();
|
||||
Killer = BaseTalisman.GetRandomKiller();
|
||||
Skill = BaseTalisman.GetRandomSkill();
|
||||
ExceptionalBonus = BaseTalisman.GetRandomExceptional();
|
||||
SuccessBonus = BaseTalisman.GetRandomSuccessful();
|
||||
Charges = MaxCharges;
|
||||
}
|
||||
|
||||
public RandomTalisman(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Equipment/Talismans/Slither.cs
Normal file
38
Scripts/Items/Equipment/Talismans/Slither.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Slither : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get{return 1114782;} }// Slither
|
||||
|
||||
[Constructable]
|
||||
public Slither()
|
||||
: base(0x2F5B)
|
||||
{
|
||||
Hue = 0x587;
|
||||
Blessed = RandomTalisman.GetRandomBlessed();
|
||||
Attributes.BonusHits = 10;
|
||||
Attributes.RegenHits = 2;
|
||||
Attributes.DefendChance = 10;
|
||||
}
|
||||
|
||||
public Slither(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); //version
|
||||
}
|
||||
}
|
||||
}
|
||||
183
Scripts/Items/Equipment/Talismans/TalismanAttribute.cs
Normal file
183
Scripts/Items/Equipment/Talismans/TalismanAttribute.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface ITalismanProtection
|
||||
{
|
||||
TalismanAttribute Protection { get; set; }
|
||||
void SetProtection(Type type, TextDefinition name, int amount);
|
||||
}
|
||||
|
||||
public interface ITalismanKiller
|
||||
{
|
||||
TalismanAttribute Killer { get; set; }
|
||||
void SetKiller(Type type, TextDefinition name, int amount);
|
||||
}
|
||||
|
||||
[PropertyObject]
|
||||
public class TalismanAttribute
|
||||
{
|
||||
private Type m_Type;
|
||||
private TextDefinition m_Name;
|
||||
private int m_Amount;
|
||||
public TalismanAttribute()
|
||||
: this(null, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public TalismanAttribute(TalismanAttribute copy)
|
||||
{
|
||||
if (copy != null)
|
||||
{
|
||||
this.m_Type = copy.Type;
|
||||
this.m_Name = copy.Name;
|
||||
this.m_Amount = copy.Amount;
|
||||
}
|
||||
}
|
||||
|
||||
public TalismanAttribute(Type type, TextDefinition name)
|
||||
: this(type, name, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public TalismanAttribute(Type type, TextDefinition name, int amount)
|
||||
{
|
||||
this.m_Type = type;
|
||||
this.m_Name = name;
|
||||
this.m_Amount = amount;
|
||||
}
|
||||
|
||||
public TalismanAttribute(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.Type))
|
||||
this.m_Type = ScriptCompiler.FindTypeByFullName(reader.ReadString(), false);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.Name))
|
||||
this.m_Name = TextDefinition.Deserialize(reader);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.Amount))
|
||||
this.m_Amount = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
[Flags]
|
||||
private enum SaveFlag
|
||||
{
|
||||
None = 0x00000000,
|
||||
Type = 0x00000001,
|
||||
Name = 0x00000002,
|
||||
Amount = 0x00000004,
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Type = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TextDefinition Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Name = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Amount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Amount;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Amount = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type == null;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type != null && this.m_Type.Namespace.Equals("Server.Items");
|
||||
}
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
if (this.m_Type != null)
|
||||
return this.m_Type.Name;
|
||||
|
||||
return "None";
|
||||
}
|
||||
|
||||
public virtual void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)0); // version
|
||||
|
||||
SaveFlag flags = SaveFlag.None;
|
||||
|
||||
SetSaveFlag(ref flags, SaveFlag.Type, this.m_Type != null);
|
||||
SetSaveFlag(ref flags, SaveFlag.Name, this.m_Name != null);
|
||||
SetSaveFlag(ref flags, SaveFlag.Amount, this.m_Amount != 0);
|
||||
|
||||
writer.WriteEncodedInt((int)flags);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.Type))
|
||||
writer.Write(this.m_Type.FullName);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.Name))
|
||||
TextDefinition.Serialize(writer, this.m_Name);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.Amount))
|
||||
writer.WriteEncodedInt(this.m_Amount);
|
||||
}
|
||||
|
||||
public int DamageBonus(Mobile to)
|
||||
{
|
||||
if (to != null && to.GetType() == this.m_Type)
|
||||
return this.m_Amount;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int ScaleDamage(Mobile from, int damage)
|
||||
{
|
||||
if (from != null && (from.GetType() == m_Type || (m_Type != null && from.GetType().IsSubclassOf(m_Type))))
|
||||
return (int)(damage * (1 - m_Amount / 100.0));
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
private static void SetSaveFlag(ref SaveFlag flags, SaveFlag toSet, bool setIf)
|
||||
{
|
||||
if (setIf)
|
||||
flags |= toSet;
|
||||
}
|
||||
|
||||
private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet)
|
||||
{
|
||||
return ((flags & toGet) != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
187
Scripts/Items/Equipment/Talismans/TalismanSlayer.cs
Normal file
187
Scripts/Items/Equipment/Talismans/TalismanSlayer.cs
Normal file
@@ -0,0 +1,187 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum TalismanSlayerName
|
||||
{
|
||||
None,
|
||||
Bear,
|
||||
Vermin,
|
||||
Bat,
|
||||
Mage,
|
||||
Beetle,
|
||||
Bird,
|
||||
Ice,
|
||||
Flame,
|
||||
Bovine,
|
||||
Wolf,
|
||||
Undead,
|
||||
Goblin,
|
||||
Repond,
|
||||
Elemental,
|
||||
Demon,
|
||||
Arachnid,
|
||||
Reptile,
|
||||
Fey,
|
||||
}
|
||||
|
||||
public static class TalismanSlayer
|
||||
{
|
||||
private static readonly Dictionary<TalismanSlayerName, Type[]> m_Table = new Dictionary<TalismanSlayerName, Type[]>();
|
||||
public static void Initialize()
|
||||
{
|
||||
m_Table[TalismanSlayerName.Bear] = new Type[]
|
||||
{
|
||||
typeof(GrizzlyBear), typeof(BlackBear),
|
||||
typeof(BrownBear), typeof(PolarBear),
|
||||
typeof(Grobu), typeof(GrizzlyBear),
|
||||
typeof(RagingGrizzlyBear)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Vermin] = new Type[]
|
||||
{
|
||||
typeof(RatmanMage), typeof(RatmanMage),
|
||||
typeof(RatmanArcher), typeof(Barracoon),
|
||||
typeof(Ratman), typeof(Sewerrat),
|
||||
typeof(Rat), typeof(GiantRat),
|
||||
typeof(Chiikkaha), typeof(ClanRibbonPlagueRat),
|
||||
typeof(ClanRS), typeof(ClanRC),
|
||||
typeof(VitaviRenowned), typeof(ClanCA),
|
||||
typeof(ClanCT), typeof(RakktaviRenowned),
|
||||
typeof(ClanSH), typeof(ClanSS),
|
||||
typeof(TikitaviRenowned)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Bat] = new Type[]
|
||||
{
|
||||
typeof(Mongbat), typeof(StrongMongbat),
|
||||
typeof(VampireBat)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Mage] = new Type[]
|
||||
{
|
||||
typeof(EvilMage), typeof(EvilMageLord),
|
||||
typeof(AncientLich), typeof(Lich),
|
||||
typeof(LichLord), typeof(SkeletalMage),
|
||||
typeof(BoneMagi), typeof(OrcishMage),
|
||||
typeof(KhaldunZealot), typeof(JukaMage),
|
||||
typeof(KhaldunSummoner), typeof(MasterTheophilus),
|
||||
typeof(GrayGoblinMage), typeof(MeerMage)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Beetle] = new Type[]
|
||||
{
|
||||
typeof(Beetle), typeof(RuneBeetle),
|
||||
typeof(FireBeetle), typeof(DeathwatchBeetle),
|
||||
typeof(DeathwatchBeetleHatchling), typeof(IronBeetle)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Bird] = new Type[]
|
||||
{
|
||||
typeof(Bird), typeof(TropicalBird),
|
||||
typeof(Chicken), typeof(Crane),
|
||||
typeof(DesertOstard), typeof(Eagle),
|
||||
typeof(ForestOstard), typeof(FrenziedOstard),
|
||||
typeof(Phoenix), typeof(Pyre),
|
||||
typeof(Swoop), typeof(Saliva)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Ice] = new Type[]
|
||||
{
|
||||
typeof(ArcticOgreLord), typeof(IceElemental),
|
||||
typeof(SnowElemental), typeof(FrostOoze),
|
||||
typeof(IceFiend), typeof(UnfrozenMummy),
|
||||
typeof(FrostSpider), typeof(LadyOfTheSnow),
|
||||
typeof(FrostTroll), typeof(IceSnake),
|
||||
typeof(SnowLeopard), typeof(PolarBear),
|
||||
typeof(IceSerpent), typeof(GiantIceWorm),
|
||||
typeof(IceHound), typeof(Wight)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Flame] = new Type[]
|
||||
{
|
||||
typeof(FireBeetle), typeof(HellHound),
|
||||
typeof(LavaSerpent), typeof(FireElemental),
|
||||
typeof(PredatorHellCat), typeof(Phoenix),
|
||||
typeof(FireGargoyle), typeof(HellCat),
|
||||
typeof(Pyre), typeof(FireSteed),
|
||||
typeof(LavaLizard), typeof(LavaSnake),
|
||||
typeof(FireRabbit)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Bovine] = new Type[]
|
||||
{
|
||||
typeof(Cow), typeof(Bull),
|
||||
typeof(Gaman), typeof(MinotaurCaptain),
|
||||
typeof(MinotaurScout), typeof(Minotaur),
|
||||
typeof(TormentedMinotaur), typeof(LowlandBoura),
|
||||
typeof(RuddyBoura), typeof(HighPlainsBoura),
|
||||
typeof(Meraktus)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Wolf] = new Type[]
|
||||
{
|
||||
typeof(CuSidhe), typeof(Gnaw),
|
||||
typeof(TimberWolf), typeof(DireWolf),
|
||||
typeof(GreyWolf), typeof(TsukiWolf),
|
||||
typeof(Dog), typeof(HellHound),
|
||||
typeof(IceHound), typeof(WhiteWolf),
|
||||
typeof(BakeKitsune), typeof(ClanSSW),
|
||||
typeof(CuSidhe)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Goblin] = new Type[]
|
||||
{
|
||||
typeof(EnslavedGoblinScout), typeof(EnslavedGoblinKeeper),
|
||||
typeof(EnslavedGreenGoblin), typeof(EnslavedGreenGoblinAlchemist),
|
||||
typeof(EnslavedGoblinMage), typeof(EnslavedGreenGoblinAlchemist),
|
||||
typeof(EnslavedGrayGoblin), typeof(GreenGoblinScout),
|
||||
typeof(GreenGoblinAlchemist), typeof(GreenGoblin),
|
||||
typeof(GrayGoblinMage), typeof(GrayGoblinKeeper),
|
||||
typeof(GrayGoblin), typeof(GreenGoblinAlchemistRenowned),
|
||||
typeof(GrayGoblinMageRenowned)
|
||||
};
|
||||
|
||||
m_Table[TalismanSlayerName.Repond] = SlayerGroup.Groups[0].Super.Types;
|
||||
m_Table[TalismanSlayerName.Undead] = SlayerGroup.Groups[1].Super.Types;
|
||||
m_Table[TalismanSlayerName.Elemental] = SlayerGroup.Groups[2].Super.Types;
|
||||
m_Table[TalismanSlayerName.Demon] = SlayerGroup.Groups[3].Super.Types;
|
||||
m_Table[TalismanSlayerName.Arachnid] = SlayerGroup.Groups[4].Super.Types;
|
||||
m_Table[TalismanSlayerName.Reptile] = SlayerGroup.Groups[5].Super.Types;
|
||||
m_Table[TalismanSlayerName.Fey] = SlayerGroup.Groups[6].Super.Types;
|
||||
}
|
||||
|
||||
public static bool Slays(TalismanSlayerName name, Mobile m)
|
||||
{
|
||||
|
||||
if (m.SpecialSlayerMechanics)
|
||||
{
|
||||
if (m.SlayerVulnerabilities.Contains(name.ToString()))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (!m_Table.ContainsKey(name))
|
||||
return false;
|
||||
|
||||
Type[] types = m_Table[name];
|
||||
|
||||
if (types == null || m == null)
|
||||
return false;
|
||||
|
||||
Type type = m.GetType();
|
||||
|
||||
for (int i = 0; i < types.Length; i++)
|
||||
{
|
||||
if (types[i].IsAssignableFrom(type))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
1100
Scripts/Items/Equipment/Talismans/TalismanSummons.cs
Normal file
1100
Scripts/Items/Equipment/Talismans/TalismanSummons.cs
Normal file
File diff suppressed because it is too large
Load Diff
35
Scripts/Items/Equipment/Talismans/TalismanofGoblinSlaying.cs
Normal file
35
Scripts/Items/Equipment/Talismans/TalismanofGoblinSlaying.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TalismanofGoblinSlaying : BaseTalisman
|
||||
{
|
||||
public override int LabelNumber { get { return 1095011; } }//Talisman of Goblin Slaying
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public TalismanofGoblinSlaying()
|
||||
: base(0x2F58)
|
||||
{
|
||||
Slayer = TalismanSlayerName.Goblin;
|
||||
MaxChargeTime = 1200;
|
||||
}
|
||||
|
||||
public TalismanofGoblinSlaying(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
187
Scripts/Items/Equipment/Talismans/Talismans.cs
Normal file
187
Scripts/Items/Equipment/Talismans/Talismans.cs
Normal file
@@ -0,0 +1,187 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells.Ninjitsu;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum TalismanForm
|
||||
{
|
||||
Ferret = 1031672,
|
||||
Squirrel = 1031671,
|
||||
CuSidhe = 1031670,
|
||||
Reptalon = 1075202
|
||||
}
|
||||
|
||||
public class BaseFormTalisman : Item
|
||||
{
|
||||
public BaseFormTalisman()
|
||||
: base(0x2F59)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Layer = Layer.Talisman;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public BaseFormTalisman(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual TalismanForm Form { get { return TalismanForm.Squirrel; } }
|
||||
|
||||
public static bool EntryEnabled(Mobile m, Type type)
|
||||
{
|
||||
if (type == typeof(Squirrel))
|
||||
return m.Talisman is SquirrelFormTalisman;
|
||||
else if (type == typeof(Ferret))
|
||||
return m.Talisman is FerretFormTalisman;
|
||||
else if (type == typeof(CuSidhe))
|
||||
return m.Talisman is CuSidheFormTalisman;
|
||||
else if (type == typeof(Reptalon))
|
||||
return m.Talisman is ReptalonFormTalisman;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1075200, String.Format("#{0}", (int)this.Form));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); //version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
base.OnRemoved(parent);
|
||||
|
||||
if (parent is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)parent;
|
||||
|
||||
AnimalForm.RemoveContext(m, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FerretFormTalisman : BaseFormTalisman
|
||||
{
|
||||
public override TalismanForm Form { get { return TalismanForm.Ferret; } }
|
||||
|
||||
[Constructable]
|
||||
public FerretFormTalisman()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public FerretFormTalisman(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); //version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SquirrelFormTalisman : BaseFormTalisman
|
||||
{
|
||||
public override TalismanForm Form { get { return TalismanForm.Squirrel; } }
|
||||
|
||||
[Constructable]
|
||||
public SquirrelFormTalisman()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public SquirrelFormTalisman(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); //version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CuSidheFormTalisman : BaseFormTalisman
|
||||
{
|
||||
public override TalismanForm Form { get { return TalismanForm.CuSidhe; } }
|
||||
|
||||
[Constructable]
|
||||
public CuSidheFormTalisman()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public CuSidheFormTalisman(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); //version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ReptalonFormTalisman : BaseFormTalisman
|
||||
{
|
||||
public override TalismanForm Form { get { return TalismanForm.Reptalon; } }
|
||||
|
||||
[Constructable]
|
||||
public ReptalonFormTalisman()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public ReptalonFormTalisman(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.WriteEncodedInt(0); //version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Equipment/Talismans/TotemOfVoid.cs
Normal file
46
Scripts/Items/Equipment/Talismans/TotemOfVoid.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TotemOfVoid : BaseTalisman
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1075035; } }// Totem of the Void
|
||||
public override bool ForceShowName { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public TotemOfVoid()
|
||||
: base(0x2F5B)
|
||||
{
|
||||
Hue = 0x2D0;
|
||||
MaxChargeTime = 1800;
|
||||
Blessed = GetRandomBlessed();
|
||||
Protection = GetRandomProtection(false);
|
||||
Attributes.RegenHits = 2;
|
||||
Attributes.LowerManaCost = 10;
|
||||
}
|
||||
|
||||
public TotemOfVoid(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type GetSummoner()
|
||||
{
|
||||
return Utility.RandomBool() ? typeof(SummonedSkeletalKnight) : typeof(SummonedSheep);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user