Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
173
Scripts/Services/Factions/Items/Equipment/CollectionBox.cs
Normal file
173
Scripts/Services/Factions/Items/Equipment/CollectionBox.cs
Normal file
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Engines.VvV;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class FactionCollectionBox : BaseCollectionItem
|
||||
{
|
||||
public Collection FactionCollection { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Faction Faction
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (FactionCollection)
|
||||
{
|
||||
case Collection.Minax: return Minax.Instance;
|
||||
case Collection.TrueBritannians: return TrueBritannians.Instance;
|
||||
case Collection.Shadowlords: return Shadowlords.Instance;
|
||||
case Collection.CouncilOfMages: return CouncilOfMages.Instance;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public FactionCollectionBox(Faction faction)
|
||||
: base(0xE7D)
|
||||
{
|
||||
if (faction == Minax.Instance)
|
||||
FactionCollection = Collection.Minax;
|
||||
else if (faction == TrueBritannians.Instance)
|
||||
FactionCollection = Collection.TrueBritannians;
|
||||
else if (faction == Shadowlords.Instance)
|
||||
FactionCollection = Collection.Shadowlords;
|
||||
else
|
||||
FactionCollection = Collection.CouncilOfMages;
|
||||
|
||||
Hue = 0x48D;
|
||||
StartTier = 10000000;
|
||||
NextTier = 5000000;
|
||||
DailyDecay = 100000;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.Alive)
|
||||
{
|
||||
if (from.NetState == null || !from.NetState.SupportsExpansion(Expansion.ML))
|
||||
{
|
||||
from.SendLocalizedMessage(1073651); // You must have Mondain's Legacy before proceeding...
|
||||
return;
|
||||
}
|
||||
else if (!Factions.Settings.Enabled && from.AccessLevel < AccessLevel.GameMaster)
|
||||
{
|
||||
from.SendLocalizedMessage(1042753, "Factions"); // ~1_SOMETHING~ has been temporarily disabled.
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.InRange(Location, 2) && from is PlayerMobile && CanDonate((PlayerMobile)from))
|
||||
{
|
||||
from.CloseGump(typeof(CommunityCollectionGump));
|
||||
from.SendGump(new CommunityCollectionGump((PlayerMobile)from, this, Location));
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanDonate(PlayerMobile player)
|
||||
{
|
||||
Faction faction = Faction.Find(player);
|
||||
|
||||
if (faction == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return faction == this.Faction;
|
||||
}
|
||||
|
||||
public FactionCollectionBox(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1073436;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public override Collection CollectionID
|
||||
{
|
||||
get
|
||||
{
|
||||
return FactionCollection;
|
||||
}
|
||||
}
|
||||
|
||||
public override int MaxTier
|
||||
{
|
||||
get
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
Donations.Add(new CollectionItem(typeof(Silver), 0xEF2, 1017384, 0x0, 1));
|
||||
|
||||
Rewards.Add(new FactionCollectionItem(typeof(StrongholdRune), 0x1F14, 1094700, 0, this.Faction, 150, 0));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(ShrineGem), 0x1EA7, 1094711, 0, this.Faction, 100, 0));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(SupernovaPotion), 3849, 1094718, 13, this.Faction, 100, 0));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(GreaterStaminaPotion), 3849, 1094764, 437, this.Faction, 50, 0));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(EnchantedBandage), 0xE21, 1094712, 0, this.Faction, 100, 0));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(PowderOfPerseverance), 4102, 1094712, 2419, this.Faction, 300, 0));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(MorphEarrings), 0x1087, 1094746, 0, this.Faction, 1000, 0));
|
||||
|
||||
Rewards.Add(new FactionCollectionItem(typeof(PrimerOnArmsTalisman), 12121, 1094704, 0, this.Faction, 3000, 7));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(ClaininsSpellbook), 3834, 1094705, 0x84D, this.Faction, 4000, 9));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(CrimsonCincture), 5435, 1075043, 0x485, this.Faction, 2000, 4));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(CrystallineRing), 4234, 1075096, 1152, this.Faction, 4000, 9));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(HumanFeyLeggings), 5054, 1075041, 0, this.Faction, 1000, 1));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(FoldedSteelGlasses), 12216, 1073380, 1150, this.Faction, 4000, 9));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(HeartOfTheLion), 5141, 1070817, 1281, this.Faction, 2000, 4));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(HuntersHeaddress), 5447, 1061595, 1428, this.Faction, 2000, 4));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(KasaOfTheRajin), 10136, 1070969, 0, this.Faction, 1000, 1));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(MaceAndShieldGlasses), 12216, 1073381, 477, this.Faction, 5000, 10));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(VesperOrderShield), 7108, 1073258, 0, this.Faction, 4000, 9));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(OrnamentOfTheMagician), 4230, 1061105, 1364, this.Faction, 5000, 10));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(RingOfTheVile), 4234, 1061102, 1271, this.Faction, 2000, 4));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(RuneBeetleCarapace), 10109, 1070968, 0, this.Faction, 1000, 1));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(SpiritOfTheTotem), 5445, 1061599, 1109, this.Faction, 3000, 7));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(Stormgrip), 10130, 1070970, 0, this.Faction, 1000, 1));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(InquisitorsResolution), 5140, 1060206, 1266, this.Faction, 5000, 10));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(TomeOfLostKnowledge), 3834, 1070971, 1328, this.Faction, 3000, 7));
|
||||
Rewards.Add(new FactionCollectionItem(typeof(WizardsCrystalGlasses), 4102, 1094756, 0, this.Faction, 3000, 7));
|
||||
}
|
||||
|
||||
public override void IncreaseTier()
|
||||
{
|
||||
base.IncreaseTier();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((int)FactionCollection);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
FactionCollection = (Collection)reader.ReadInt();
|
||||
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
}
|
||||
199
Scripts/Services/Factions/Items/Equipment/EnhanctedBandage.cs
Normal file
199
Scripts/Services/Factions/Items/Equipment/EnhanctedBandage.cs
Normal file
@@ -0,0 +1,199 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Spells.First;
|
||||
using Server.Spells.Fourth;
|
||||
using Server.Spells.Necromancy;
|
||||
using Server.Spells.Mysticism;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class EnchantedBandage : Item, IFactionItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1094712; } } // Enchanted Bandage
|
||||
|
||||
#region Factions
|
||||
private FactionItem m_FactionState;
|
||||
|
||||
public FactionItem FactionItemState
|
||||
{
|
||||
get { return m_FactionState; }
|
||||
set
|
||||
{
|
||||
m_FactionState = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public EnchantedBandage()
|
||||
: base(0xE21)
|
||||
{
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
FactionEquipment.AddFactionProperties(this, list);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
if (FactionEquipment.CanUse(this, from))
|
||||
{
|
||||
from.RevealingAction();
|
||||
|
||||
from.SendLocalizedMessage(500948); // Who will you use the bandages on?
|
||||
|
||||
from.BeginTarget(-1, false, Server.Targeting.TargetFlags.Beneficial, (healer, targeted) =>
|
||||
{
|
||||
Mobile patient = targeted as Mobile;
|
||||
|
||||
if (patient != null)
|
||||
{
|
||||
if (EnchantedApple.GetTotalCurses(patient) == 0)
|
||||
{
|
||||
healer.SendLocalizedMessage(500955); // That being is not damaged!
|
||||
}
|
||||
else if (!Deleted && healer.CanBeBeneficial(patient, true, true))
|
||||
{
|
||||
healer.DoBeneficial(patient);
|
||||
|
||||
bool onSelf = (healer == patient);
|
||||
int dex = healer.Dex;
|
||||
|
||||
double seconds;
|
||||
double resDelay = (patient.Alive ? 0.0 : 5.0);
|
||||
|
||||
if (onSelf)
|
||||
{
|
||||
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = Math.Ceiling((double)4 - healer.Dex / 60);
|
||||
seconds = Math.Max(seconds, 2);
|
||||
}
|
||||
|
||||
if (Context.ContainsKey(healer))
|
||||
{
|
||||
Context[healer].Stop();
|
||||
}
|
||||
|
||||
Context[healer] = new InternalTimer(this, patient, healer, seconds);
|
||||
|
||||
if (!onSelf)
|
||||
{
|
||||
patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you.
|
||||
}
|
||||
|
||||
healer.SendLocalizedMessage(500956); // You begin applying the bandages.
|
||||
|
||||
if (healer.NetState != null && healer.NetState.IsEnhancedClient)
|
||||
{
|
||||
healer.NetState.Send(new BandageTimerPacket((int)(seconds)));
|
||||
}
|
||||
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500295); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<Mobile, Timer> Context = new Dictionary<Mobile, Timer>();
|
||||
|
||||
public class InternalTimer : Timer
|
||||
{
|
||||
public EnchantedBandage Bandage { get; set; }
|
||||
public Mobile Patient { get; set; }
|
||||
public Mobile Healer { get; set; }
|
||||
|
||||
public long Expires { get; set; }
|
||||
|
||||
public InternalTimer(EnchantedBandage bandage, Mobile patient, Mobile healer, double seconds)
|
||||
: base(TimeSpan.FromMilliseconds(250), TimeSpan.FromMilliseconds(250))
|
||||
{
|
||||
Bandage = bandage;
|
||||
Patient = patient;
|
||||
Healer = healer;
|
||||
|
||||
Expires = Core.TickCount + (long)(seconds * 1000);
|
||||
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (Core.TickCount >= Expires)
|
||||
{
|
||||
EndHeal();
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void EndHeal()
|
||||
{
|
||||
if (Context.ContainsKey(Healer))
|
||||
Context.Remove(Healer);
|
||||
|
||||
if (Patient != Healer && Patient.InRange(Healer.Location, 2))
|
||||
{
|
||||
Healer.PlaySound(0x57);
|
||||
|
||||
if (EnchantedApple.GetTotalCurses(Patient) == 0)
|
||||
Healer.SendLocalizedMessage(500968); // You apply the bandages, but they barely help.
|
||||
else
|
||||
Healer.SendLocalizedMessage(500969); // You finish applying the bandages.
|
||||
|
||||
EvilOmenSpell.TryEndEffect(Patient);
|
||||
StrangleSpell.RemoveCurse(Patient);
|
||||
CorpseSkinSpell.RemoveCurse(Patient);
|
||||
WeakenSpell.RemoveEffects(Patient);
|
||||
FeeblemindSpell.RemoveEffects(Patient);
|
||||
ClumsySpell.RemoveEffects(Patient);
|
||||
CurseSpell.RemoveEffect(Patient);
|
||||
MortalStrike.EndWound(Patient);
|
||||
BloodOathSpell.RemoveCurse(Patient);
|
||||
MindRotSpell.ClearMindRotScalar(Patient);
|
||||
SpellPlagueSpell.RemoveFromList(Patient);
|
||||
SleepSpell.EndSleep(Patient);
|
||||
|
||||
BuffInfo.RemoveBuff(Patient, BuffIcon.MassCurse);
|
||||
}
|
||||
else
|
||||
{
|
||||
Healer.SendLocalizedMessage(500295); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EnchantedBandage(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
279
Scripts/Services/Factions/Items/Equipment/FactionEquipment.cs
Normal file
279
Scripts/Services/Factions/Items/Equipment/FactionEquipment.cs
Normal file
@@ -0,0 +1,279 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public static class FactionEquipment
|
||||
{
|
||||
public static bool CanUse(IFactionItem item, Mobile m, int failmessage = 500294)
|
||||
{
|
||||
if (item == null)
|
||||
return true;
|
||||
|
||||
var state = PlayerState.Find(m);
|
||||
|
||||
if (state != null && state.Faction == item.FactionItemState.Faction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (failmessage > 0)
|
||||
{
|
||||
m.SendLocalizedMessage(failmessage); // You cannot use that.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool AddFactionProperties(IFactionItem item, ObjectPropertyList list)
|
||||
{
|
||||
if (item.FactionItemState != null)
|
||||
{
|
||||
list.Add(1041350); // faction item
|
||||
|
||||
if (item.FactionItemState.MinRank > 0)
|
||||
list.Add(1094805, item.FactionItemState.MinRank.ToString()); // Faction Rank: ~1_VALUE~
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void CheckProperties(Item item)
|
||||
{
|
||||
if (item is PrimerOnArmsTalisman && ((PrimerOnArmsTalisman)item).Attributes.AttackChance != 10)
|
||||
{
|
||||
((PrimerOnArmsTalisman)item).Attributes.AttackChance = 10;
|
||||
}
|
||||
|
||||
if (item is ClaininsSpellbook && ((ClaininsSpellbook)item).Attributes.LowerManaCost != 10)
|
||||
{
|
||||
((ClaininsSpellbook)item).Attributes.LowerManaCost = 10;
|
||||
}
|
||||
|
||||
if (item is CrimsonCincture && ((CrimsonCincture)item).Attributes.BonusDex != 10)
|
||||
{
|
||||
((CrimsonCincture)item).Attributes.BonusDex = 10;
|
||||
}
|
||||
|
||||
if (item is CrystallineRing && ((CrystallineRing)item).Attributes.CastRecovery != 3)
|
||||
{
|
||||
((CrystallineRing)item).Attributes.CastRecovery = 3;
|
||||
}
|
||||
|
||||
if (item is FeyLeggings)
|
||||
{
|
||||
if (((FeyLeggings)item).PhysicalBonus != 3)
|
||||
((FeyLeggings)item).PhysicalBonus = 3;
|
||||
|
||||
if (((FeyLeggings)item).FireBonus != 3)
|
||||
((FeyLeggings)item).FireBonus = 3;
|
||||
|
||||
if (((FeyLeggings)item).ColdBonus != 3)
|
||||
((FeyLeggings)item).ColdBonus = 3;
|
||||
|
||||
if (((FeyLeggings)item).EnergyBonus != 3)
|
||||
((FeyLeggings)item).EnergyBonus = 3;
|
||||
}
|
||||
|
||||
if (item is FoldedSteelGlasses && ((FoldedSteelGlasses)item).Attributes.DefendChance != 25)
|
||||
{
|
||||
((FoldedSteelGlasses)item).Attributes.DefendChance = 25;
|
||||
}
|
||||
|
||||
if (item is HeartOfTheLion)
|
||||
{
|
||||
if (((HeartOfTheLion)item).PhysicalBonus != 5)
|
||||
((HeartOfTheLion)item).PhysicalBonus = 5;
|
||||
|
||||
if (((HeartOfTheLion)item).FireBonus != 5)
|
||||
((HeartOfTheLion)item).FireBonus = 5;
|
||||
|
||||
if (((HeartOfTheLion)item).ColdBonus != 5)
|
||||
((HeartOfTheLion)item).ColdBonus = 5;
|
||||
|
||||
if (((HeartOfTheLion)item).PoisonBonus != 5)
|
||||
((HeartOfTheLion)item).PoisonBonus = 5;
|
||||
|
||||
if (((HeartOfTheLion)item).EnergyBonus != 5)
|
||||
((HeartOfTheLion)item).EnergyBonus = 5;
|
||||
}
|
||||
|
||||
if (item is HuntersHeaddress)
|
||||
{
|
||||
if (((HuntersHeaddress)item).Resistances.Physical != 8)
|
||||
((HuntersHeaddress)item).Resistances.Physical = 8;
|
||||
|
||||
if (((HuntersHeaddress)item).Resistances.Fire != 4)
|
||||
((HuntersHeaddress)item).Resistances.Fire = 4;
|
||||
|
||||
if (((HuntersHeaddress)item).Resistances.Cold != -8)
|
||||
((HuntersHeaddress)item).Resistances.Cold = -8;
|
||||
|
||||
if (((HuntersHeaddress)item).Resistances.Poison != 9)
|
||||
((HuntersHeaddress)item).Resistances.Poison = 9;
|
||||
|
||||
if (((HuntersHeaddress)item).Resistances.Energy != 3)
|
||||
((HuntersHeaddress)item).Resistances.Energy = 3;
|
||||
}
|
||||
|
||||
if (item is KasaOfTheRajin && ((KasaOfTheRajin)item).Attributes.DefendChance != 10)
|
||||
{
|
||||
((KasaOfTheRajin)item).Attributes.DefendChance = 10;
|
||||
}
|
||||
|
||||
if (item is MaceAndShieldGlasses && ((MaceAndShieldGlasses)item).Attributes.WeaponDamage != 10)
|
||||
{
|
||||
((MaceAndShieldGlasses)item).Attributes.WeaponDamage = 10;
|
||||
}
|
||||
|
||||
if (item is VesperOrderShield && ((VesperOrderShield)item).Attributes.CastSpeed != 0)
|
||||
{
|
||||
((VesperOrderShield)item).Attributes.CastSpeed = 0;
|
||||
|
||||
if (item.Name != "Order Shield")
|
||||
item.Name = "Order Shield";
|
||||
}
|
||||
|
||||
if (item is OrnamentOfTheMagician && ((OrnamentOfTheMagician)item).Attributes.RegenMana != 3)
|
||||
{
|
||||
((OrnamentOfTheMagician)item).Attributes.RegenMana = 3;
|
||||
}
|
||||
|
||||
if (item is RingOfTheVile && ((RingOfTheVile)item).Attributes.AttackChance != 25)
|
||||
{
|
||||
((RingOfTheVile)item).Attributes.AttackChance = 25;
|
||||
}
|
||||
|
||||
if (item is RuneBeetleCarapace)
|
||||
{
|
||||
if (((RuneBeetleCarapace)item).PhysicalBonus != 3)
|
||||
((RuneBeetleCarapace)item).PhysicalBonus = 3;
|
||||
|
||||
if (((RuneBeetleCarapace)item).FireBonus != 3)
|
||||
((RuneBeetleCarapace)item).FireBonus = 3;
|
||||
|
||||
if (((RuneBeetleCarapace)item).ColdBonus != 3)
|
||||
((RuneBeetleCarapace)item).ColdBonus = 3;
|
||||
|
||||
if (((RuneBeetleCarapace)item).PoisonBonus != 3)
|
||||
((RuneBeetleCarapace)item).PoisonBonus = 3;
|
||||
|
||||
if (((RuneBeetleCarapace)item).EnergyBonus != 3)
|
||||
((RuneBeetleCarapace)item).EnergyBonus = 3;
|
||||
}
|
||||
|
||||
if (item is SpiritOfTheTotem)
|
||||
{
|
||||
if (((SpiritOfTheTotem)item).Resistances.Fire != 7)
|
||||
((SpiritOfTheTotem)item).Resistances.Fire = 7;
|
||||
|
||||
if (((SpiritOfTheTotem)item).Resistances.Cold != 2)
|
||||
((SpiritOfTheTotem)item).Resistances.Cold = 2;
|
||||
|
||||
if (((SpiritOfTheTotem)item).Resistances.Poison != 6)
|
||||
((SpiritOfTheTotem)item).Resistances.Poison = 6;
|
||||
|
||||
if (((SpiritOfTheTotem)item).Resistances.Energy != 6)
|
||||
((SpiritOfTheTotem)item).Resistances.Energy = 6;
|
||||
}
|
||||
|
||||
if (item is Stormgrip && ((Stormgrip)item).Attributes.AttackChance != 10)
|
||||
{
|
||||
((Stormgrip)item).Attributes.AttackChance = 10;
|
||||
}
|
||||
|
||||
if (item is InquisitorsResolution)
|
||||
{
|
||||
if (((InquisitorsResolution)item).PhysicalBonus != 5)
|
||||
((InquisitorsResolution)item).PhysicalBonus = 5;
|
||||
|
||||
if (((InquisitorsResolution)item).FireBonus != 7)
|
||||
((InquisitorsResolution)item).FireBonus = 7;
|
||||
|
||||
if (((InquisitorsResolution)item).ColdBonus != -2)
|
||||
((InquisitorsResolution)item).ColdBonus = -2;
|
||||
|
||||
if (((InquisitorsResolution)item).PoisonBonus != 7)
|
||||
((InquisitorsResolution)item).PoisonBonus = 7;
|
||||
|
||||
if (((InquisitorsResolution)item).EnergyBonus != -7)
|
||||
((InquisitorsResolution)item).EnergyBonus = -7;
|
||||
}
|
||||
|
||||
if (item is TomeOfLostKnowledge && ((TomeOfLostKnowledge)item).Attributes.RegenMana != 3)
|
||||
{
|
||||
((TomeOfLostKnowledge)item).Attributes.RegenMana = 3;
|
||||
}
|
||||
|
||||
if (item is WizardsCrystalGlasses)
|
||||
{
|
||||
if (((WizardsCrystalGlasses)item).PhysicalBonus != 5)
|
||||
((WizardsCrystalGlasses)item).PhysicalBonus = 5;
|
||||
|
||||
if (((WizardsCrystalGlasses)item).FireBonus != 5)
|
||||
((WizardsCrystalGlasses)item).FireBonus = 5;
|
||||
|
||||
if (((WizardsCrystalGlasses)item).ColdBonus != 5)
|
||||
((WizardsCrystalGlasses)item).ColdBonus = 5;
|
||||
|
||||
if (((WizardsCrystalGlasses)item).PoisonBonus != 5)
|
||||
((WizardsCrystalGlasses)item).PoisonBonus = 5;
|
||||
|
||||
if (((WizardsCrystalGlasses)item).EnergyBonus != 5)
|
||||
((WizardsCrystalGlasses)item).EnergyBonus = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FactionCollectionItem : CollectionItem
|
||||
{
|
||||
public int MinRank { get; private set; }
|
||||
public Faction Faction { get; private set; }
|
||||
|
||||
public FactionCollectionItem(Type type, int id, int tooltip, int hue, Faction faction, double points, int minRank)
|
||||
: base(type, id, tooltip, hue, points)
|
||||
{
|
||||
Faction = faction;
|
||||
MinRank = minRank;
|
||||
}
|
||||
|
||||
public override void OnGiveReward(PlayerMobile to, Item item, IComunityCollection collection, int hue)
|
||||
{
|
||||
if(this.Faction != null)
|
||||
{
|
||||
FactionEquipment.CheckProperties(item);
|
||||
FactionItem.Imbue(item, Faction, false, -1, MinRank);
|
||||
|
||||
if (!(item is Spellbook || item is ShrineGem))
|
||||
item.LootType = LootType.Regular;
|
||||
|
||||
if (item is IWearableDurability)
|
||||
{
|
||||
((IWearableDurability)item).MaxHitPoints = 255;
|
||||
((IWearableDurability)item).HitPoints = 255;
|
||||
}
|
||||
|
||||
if (item is IOwnerRestricted)
|
||||
{
|
||||
((IOwnerRestricted)item).Owner = to;
|
||||
to.SendLocalizedMessage(1094803); // This faction reward is bound to you, and cannot be traded.
|
||||
}
|
||||
|
||||
item.InvalidateProperties();
|
||||
}
|
||||
|
||||
base.OnGiveReward(to, item, collection, hue);
|
||||
}
|
||||
|
||||
public override bool CanSelect(PlayerMobile from)
|
||||
{
|
||||
PlayerState state = PlayerState.Find(from);
|
||||
|
||||
|
||||
return from.AccessLevel > AccessLevel.Player || (state != null && state.Rank.Rank >= MinRank);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class PowderOfPerseverance : Item, IFactionItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1094756; } } // Powder of Perseverance
|
||||
|
||||
#region Factions
|
||||
private FactionItem m_FactionState;
|
||||
|
||||
public FactionItem FactionItemState
|
||||
{
|
||||
get { return m_FactionState; }
|
||||
set
|
||||
{
|
||||
m_FactionState = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public PowderOfPerseverance()
|
||||
: base(4102)
|
||||
{
|
||||
Hue = 2419;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if(IsChildOf(from.Backpack))
|
||||
{
|
||||
if (FactionEquipment.CanUse(this, from))
|
||||
{
|
||||
from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
|
||||
{
|
||||
if (targeted is IFactionItem && targeted is IWearableDurability)
|
||||
{
|
||||
IWearableDurability durability = targeted as IWearableDurability;
|
||||
|
||||
if (durability.HitPoints >= durability.MaxHitPoints)
|
||||
{
|
||||
m.SendLocalizedMessage(1094761); // This item is already in perfect condition.
|
||||
}
|
||||
else if (durability.MaxHitPoints <= 125)
|
||||
{
|
||||
m.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (durability.MaxHitPoints == 255)
|
||||
{
|
||||
durability.MaxHitPoints = 225;
|
||||
}
|
||||
else
|
||||
{
|
||||
durability.MaxHitPoints -= 25;
|
||||
}
|
||||
|
||||
durability.HitPoints = durability.MaxHitPoints;
|
||||
|
||||
m.SendLocalizedMessage(1049084); // You successfully use the powder on the item.
|
||||
m.SendLocalizedMessage(1094760); // You have used up your Powder of Perseverance.
|
||||
m.PlaySound(0x247);
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060584, "1"); // uses remaining: ~1_val~
|
||||
|
||||
FactionEquipment.AddFactionProperties(this, list);
|
||||
}
|
||||
|
||||
public PowderOfPerseverance(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
125
Scripts/Services/Factions/Items/Equipment/ShrineGem.cs
Normal file
125
Scripts/Services/Factions/Items/Equipment/ShrineGem.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class ShrineGem : Item, IFactionItem
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.PlayerDeath += OnPlayerDeath;
|
||||
}
|
||||
|
||||
public static void OnPlayerDeath(PlayerDeathEventArgs e)
|
||||
{
|
||||
if (e.Mobile is PlayerMobile && e.Mobile.Backpack != null)
|
||||
{
|
||||
var state = PlayerState.Find(e.Mobile);
|
||||
|
||||
if(state != null)
|
||||
{
|
||||
ShrineGem gem = null;
|
||||
|
||||
foreach (var item in e.Mobile.Backpack.Items)
|
||||
{
|
||||
if (item is ShrineGem && ((ShrineGem)item).FactionItemState.Faction == state.Faction)
|
||||
{
|
||||
gem = (ShrineGem)item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("Gem: {0}", gem);
|
||||
if (gem != null)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2.5), () =>
|
||||
{
|
||||
BaseGump.SendGump(new ConfirmCallbackGump((PlayerMobile)e.Mobile, 1094715, 1094716, gem, null,
|
||||
(m, obj) =>
|
||||
{
|
||||
ShrineGem g = obj as ShrineGem;
|
||||
|
||||
if (g != null && !g.Deleted && g.IsChildOf(m.Backpack))
|
||||
{
|
||||
Point3D p = _ShrineLocs[Utility.Random(_ShrineLocs.Length)];
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
|
||||
{
|
||||
m.PlaySound(0x1FC);
|
||||
m.MoveToWorld(p, m.Map);
|
||||
m.PlaySound(0x1FC);
|
||||
|
||||
g.Delete();
|
||||
});
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly Point3D[] _ShrineLocs = new Point3D[]
|
||||
{
|
||||
new Point3D(1470, 843, 0),
|
||||
new Point3D(1857, 865, -1),
|
||||
new Point3D(4220, 563, 36),
|
||||
new Point3D(1732, 3528, 0),
|
||||
new Point3D(1300, 644, 8),
|
||||
new Point3D(3355, 302, 9),
|
||||
new Point3D(1606, 2490, 5),
|
||||
new Point3D(2500, 3931, 3),
|
||||
new Point3D(4264, 3707, 0)
|
||||
};
|
||||
|
||||
public override int LabelNumber { get { return 1094711; } } // Shrine Gem
|
||||
|
||||
#region Factions
|
||||
private FactionItem m_FactionState;
|
||||
|
||||
public FactionItem FactionItemState
|
||||
{
|
||||
get { return m_FactionState; }
|
||||
set
|
||||
{
|
||||
m_FactionState = value;
|
||||
|
||||
Hue = m_FactionState != null ? m_FactionState.Faction.Definition.HuePrimary : 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public ShrineGem()
|
||||
: base(0x1EA7)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
FactionEquipment.AddFactionProperties(this, list);
|
||||
}
|
||||
|
||||
public ShrineGem(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
154
Scripts/Services/Factions/Items/Equipment/StrongholdRune.cs
Normal file
154
Scripts/Services/Factions/Items/Equipment/StrongholdRune.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class StrongholdRune : Item, IFactionItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1094700; } } // Faction Stronghold Rune
|
||||
|
||||
#region Factions
|
||||
private FactionItem m_FactionState;
|
||||
|
||||
public FactionItem FactionItemState
|
||||
{
|
||||
get { return m_FactionState; }
|
||||
set
|
||||
{
|
||||
m_FactionState = value;
|
||||
|
||||
Hue = m_FactionState != null ? m_FactionState.Faction.Definition.HuePrimary : 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public StrongholdRune()
|
||||
: base(0x1F14)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
if (FactionEquipment.CanUse(this, m))
|
||||
{
|
||||
if (!IsInCooldown(m))
|
||||
{
|
||||
Timer.DelayCall<Mobile>(TimeSpan.FromSeconds(1), Warp, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(501789); // You must wait before trying again.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage("You are not the proper faction to use this item.");
|
||||
//TODO: Message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
FactionEquipment.AddFactionProperties(this, list);
|
||||
}
|
||||
|
||||
private void Warp(Mobile m)
|
||||
{
|
||||
Point3D p = GetStoneLocation();
|
||||
Map map = Faction.Facet;
|
||||
|
||||
int x = p.X;
|
||||
int y = p.Y;
|
||||
int z = p.Z;
|
||||
|
||||
if (p != Point3D.Zero)
|
||||
{
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
x = p.X + Utility.RandomMinMax(-4, 4);
|
||||
y = p.Y + Utility.RandomMinMax(-4, 4);
|
||||
z = map.GetAverageZ(x, y);
|
||||
|
||||
Point3D temp = new Point3D(x, y, z);
|
||||
|
||||
if (map.CanSpawnMobile(temp))
|
||||
{
|
||||
p = temp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m.PlaySound(0x1FC);
|
||||
m.MoveToWorld(p, map);
|
||||
m.PlaySound(0x1FC);
|
||||
|
||||
m.SendLocalizedMessage(1094706); // Your faction stronghold rune has disappeared.
|
||||
|
||||
if (m.AccessLevel == AccessLevel.Player)
|
||||
Delete();
|
||||
|
||||
AddToCooldown(m);
|
||||
}
|
||||
}
|
||||
|
||||
private Point3D GetStoneLocation()
|
||||
{
|
||||
if (FactionItemState == null)
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
return FactionItemState.Faction.Definition.Stronghold.FactionStone;
|
||||
}
|
||||
|
||||
public static List<Mobile> Cooldown = new List<Mobile>();
|
||||
|
||||
public static bool IsInCooldown(Mobile m)
|
||||
{
|
||||
return Cooldown.Contains(m);
|
||||
}
|
||||
|
||||
public static void AddToCooldown(Mobile m)
|
||||
{
|
||||
Cooldown.Add(m);
|
||||
|
||||
int minutes = 30;
|
||||
|
||||
PlayerState ps = PlayerState.Find(m);
|
||||
|
||||
if(ps != null)
|
||||
minutes = 30 - (ps.Rank.Rank * 2);
|
||||
|
||||
Timer.DelayCall<Mobile>(TimeSpan.FromMinutes(minutes), mob =>
|
||||
{
|
||||
Cooldown.Remove(mob);
|
||||
}, m);
|
||||
}
|
||||
|
||||
public StrongholdRune(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user