Reorganizes Project (#41)

This commit is contained in:
Kamron Batman 2019-08-02 18:13:40 -07:00 committed by GitHub
parent 08bf44af9a
commit 3614a66aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3499 changed files with 79 additions and 55 deletions

View file

@ -0,0 +1,34 @@
using Server.Factions;
namespace Server.Ethics.Evil
{
public sealed class EvilEthic : Ethic
{
public EvilEthic()
{
m_Definition = new EthicDefinition(
0x455,
"Evil", "(Evil)",
"I am evil incarnate",
new Power[]
{
new UnholySense(),
new UnholyItem(),
new SummonFamiliar(),
new VileBlade(),
new Blight(),
new UnholyShield(),
new UnholySteed(),
new UnholyWord()
}
);
}
public override bool IsEligible(Mobile mob)
{
Faction fac = Faction.Find(mob);
return fac is Minax || fac is Shadowlords;
}
}
}

View file

@ -0,0 +1,83 @@
using Server.Ethics;
namespace Server.Mobiles
{
public class UnholyFamiliar : BaseCreature
{
[Constructible]
public UnholyFamiliar()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Body = 99;
BaseSoundID = 0xE5;
SetStr(96, 120);
SetDex(81, 105);
SetInt(36, 60);
SetHits(58, 72);
SetMana(0);
SetDamage(11, 17);
SetDamageType(ResistanceType.Physical, 100);
SetResistance(ResistanceType.Physical, 20, 25);
SetResistance(ResistanceType.Fire, 10, 20);
SetResistance(ResistanceType.Cold, 5, 10);
SetResistance(ResistanceType.Poison, 5, 10);
SetResistance(ResistanceType.Energy, 10, 15);
SetSkill(SkillName.MagicResist, 57.6, 75.0);
SetSkill(SkillName.Tactics, 50.1, 70.0);
SetSkill(SkillName.Wrestling, 60.1, 80.0);
Fame = 2500;
Karma = 2500;
VirtualArmor = 22;
Tamable = false;
ControlSlots = 1;
}
public UnholyFamiliar(Serial serial)
: base(serial)
{
}
public override string CorpseName => "an evil corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public override string DefaultName => "a dark wolf";
public override int Meat => 1;
public override int Hides => 7;
public override FoodType FavoriteFood => FoodType.Meat;
public override PackInstinct PackInstinct => PackInstinct.Canine;
public override string ApplyNameSuffix(string suffix)
{
if (suffix.Length == 0)
suffix = Ethic.Evil.Definition.Adjunct.String;
else
suffix = string.Concat(suffix, " ", Ethic.Evil.Definition.Adjunct.String);
return base.ApplyNameSuffix(suffix);
}
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();
}
}
}

View file

@ -0,0 +1,88 @@
using Server.Ethics;
namespace Server.Mobiles
{
public class UnholySteed : BaseMount
{
[Constructible]
public UnholySteed()
: base("a dark steed", 0x74, 0x3EA7, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
SetStr(496, 525);
SetDex(86, 105);
SetInt(86, 125);
SetHits(298, 315);
SetDamage(16, 22);
SetDamageType(ResistanceType.Physical, 40);
SetDamageType(ResistanceType.Fire, 40);
SetDamageType(ResistanceType.Energy, 20);
SetResistance(ResistanceType.Physical, 55, 65);
SetResistance(ResistanceType.Fire, 30, 40);
SetResistance(ResistanceType.Cold, 30, 40);
SetResistance(ResistanceType.Poison, 30, 40);
SetResistance(ResistanceType.Energy, 20, 30);
SetSkill(SkillName.MagicResist, 25.1, 30.0);
SetSkill(SkillName.Tactics, 97.6, 100.0);
SetSkill(SkillName.Wrestling, 80.5, 92.5);
Fame = 14000;
Karma = -14000;
VirtualArmor = 60;
Tamable = false;
ControlSlots = 1;
}
public UnholySteed(Serial serial)
: base(serial)
{
}
public override string CorpseName => "an unholy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public override bool HasBreath => true;
public override bool CanBreath => true;
public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
public override string ApplyNameSuffix(string suffix)
{
if (suffix.Length == 0)
suffix = Ethic.Evil.Definition.Adjunct.String;
else
suffix = string.Concat(suffix, " ", Ethic.Evil.Definition.Adjunct.String);
return base.ApplyNameSuffix(suffix);
}
public override void OnDoubleClick(Mobile from)
{
if (Ethic.Find(from) != Ethic.Evil)
from.SendMessage("You may not ride this steed.");
else
base.OnDoubleClick(from);
}
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();
}
}
}

View file

@ -0,0 +1,76 @@
using System;
using Server.Network;
using Server.Spells;
using Server.Targeting;
namespace Server.Ethics.Evil
{
public sealed class Blight : Power
{
public Blight()
{
m_Definition = new PowerDefinition(
15,
"Blight",
"Velgo Ontawl",
""
);
}
public override void BeginInvoke(Player from)
{
from.Mobile.BeginTarget(12, true, TargetFlags.None, Power_OnTarget, from);
from.Mobile.SendMessage("Where do you wish to blight?");
}
private void Power_OnTarget(Mobile fromMobile, object obj, Player from)
{
if (!(obj is IPoint3D p))
return;
if (!CheckInvoke(from))
return;
bool powerFunctioned = false;
SpellHelper.GetSurfaceTop(ref p);
foreach (Mobile mob in from.Mobile.GetMobilesInRange(6))
{
if (mob == from.Mobile || !SpellHelper.ValidIndirectTarget(from.Mobile, mob))
continue;
if (mob.GetStatMod("Holy Curse") != null)
continue;
if (!from.Mobile.CanBeHarmful(mob, false))
continue;
from.Mobile.DoHarmful(mob, true);
mob.AddStatMod(new StatMod(StatType.All, "Holy Curse", -10, TimeSpan.FromMinutes(30.0)));
mob.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
mob.PlaySound(0x1FB);
powerFunctioned = true;
}
if (powerFunctioned)
{
SpellHelper.Turn(from.Mobile, p);
Effects.PlaySound(p, from.Mobile.Map, 0x1FB);
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You curse the area.");
FinishInvoke(from);
}
else
{
from.Mobile.FixedEffect(0x3735, 6, 30);
from.Mobile.PlaySound(0x5C);
}
}
}
}

View file

@ -0,0 +1,46 @@
using System;
using Server.Mobiles;
using Server.Network;
namespace Server.Ethics.Evil
{
public sealed class SummonFamiliar : Power
{
public SummonFamiliar()
{
m_Definition = new PowerDefinition(
5,
"Summon Familiar",
"Trubechs Vingir",
""
);
}
public override void BeginInvoke(Player from)
{
if (from.Familiar?.Deleted == true)
from.Familiar = null;
if (from.Familiar != null)
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You already have an unholy familiar.");
return;
}
if (from.Mobile.Followers + 1 > from.Mobile.FollowersMax)
{
from.Mobile.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
return;
}
UnholyFamiliar familiar = new UnholyFamiliar();
if (BaseCreature.Summon(familiar, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours(1.0)))
{
from.Familiar = familiar;
FinishInvoke(from);
}
}
}
}

View file

@ -0,0 +1,68 @@
using Server.Items;
using Server.Network;
using Server.Targeting;
namespace Server.Ethics.Evil
{
public sealed class UnholyItem : Power
{
public UnholyItem()
{
m_Definition = new PowerDefinition(
5,
"Unholy Item",
"Vidda K'balc",
""
);
}
public override void BeginInvoke(Player from)
{
from.Mobile.BeginTarget(12, false, TargetFlags.None, Power_OnTarget, from);
from.Mobile.SendMessage("Which item do you wish to imbue?");
}
private void Power_OnTarget(Mobile fromMobile, object obj, Player from)
{
if (!(obj is Item item))
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may not imbue that.");
return;
}
if (item.Parent != from.Mobile)
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false,
"You may only imbue items you are wearing.");
return;
}
if ((item.SavedFlags & 0x300) != 0)
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "That has already beem imbued.");
return;
}
bool canImbue = (item is Spellbook || item is BaseClothing || item is BaseArmor || item is BaseWeapon) &&
item.Name == null;
if (canImbue)
{
if (!CheckInvoke(from))
return;
item.Hue = Ethic.Evil.Definition.PrimaryHue;
item.SavedFlags |= 0x200;
from.Mobile.FixedEffect(0x375A, 10, 20);
from.Mobile.PlaySound(0x209);
FinishInvoke(from);
}
else
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may not imbue that.");
}
}
}
}

View file

@ -0,0 +1,94 @@
using System;
using System.Text;
using Server.Network;
namespace Server.Ethics.Evil
{
public sealed class UnholySense : Power
{
public UnholySense()
{
m_Definition = new PowerDefinition(
0,
"Unholy Sense",
"Drewrok Velgo",
""
);
}
public override void BeginInvoke(Player from)
{
Ethic opposition = Ethic.Hero;
int enemyCount = 0;
int maxRange = 18 + from.Power;
Player primary = null;
foreach (Player pl in opposition.Players)
{
Mobile mob = pl.Mobile;
if (mob == null || mob.Map != from.Mobile.Map || !mob.Alive)
continue;
if (!mob.InRange(from.Mobile, Math.Max(18, maxRange - pl.Power)))
continue;
if (primary == null || pl.Power > primary.Power)
primary = pl;
++enemyCount;
}
StringBuilder sb = new StringBuilder();
sb.Append("You sense ");
sb.Append(enemyCount == 0 ? "no" : enemyCount.ToString());
sb.Append(enemyCount == 1 ? " enemy" : " enemies");
if (primary != null)
{
sb.Append(", and a strong presense");
switch (from.Mobile.GetDirectionTo(primary.Mobile))
{
case Direction.West:
sb.Append(" to the west.");
break;
case Direction.East:
sb.Append(" to the east.");
break;
case Direction.North:
sb.Append(" to the north.");
break;
case Direction.South:
sb.Append(" to the south.");
break;
case Direction.Up:
sb.Append(" to the north-west.");
break;
case Direction.Down:
sb.Append(" to the south-east.");
break;
case Direction.Left:
sb.Append(" to the south-west.");
break;
case Direction.Right:
sb.Append(" to the north-east.");
break;
}
}
else
{
sb.Append('.');
}
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x59, false, sb.ToString());
FinishInvoke(from);
}
}
}

View file

@ -0,0 +1,34 @@
using Server.Network;
namespace Server.Ethics.Evil
{
public sealed class UnholyShield : Power
{
public UnholyShield()
{
m_Definition = new PowerDefinition(
20,
"Unholy Shield",
"Velgo K'blac",
""
);
}
public override void BeginInvoke(Player from)
{
if (from.IsShielded)
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false,
"You are already under the protection of an unholy shield.");
return;
}
from.BeginShield();
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false,
"You are now under the protection of an unholy shield.");
FinishInvoke(from);
}
}
}

View file

@ -0,0 +1,46 @@
using System;
using Server.Mobiles;
using Server.Network;
namespace Server.Ethics.Evil
{
public sealed class UnholySteed : Power
{
public UnholySteed()
{
m_Definition = new PowerDefinition(
30,
"Unholy Steed",
"Trubechs Yeliab",
""
);
}
public override void BeginInvoke(Player from)
{
if (from.Steed?.Deleted == true)
from.Steed = null;
if (from.Steed != null)
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You already have an unholy steed.");
return;
}
if (from.Mobile.Followers + 1 > from.Mobile.FollowersMax)
{
from.Mobile.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
return;
}
Mobiles.UnholySteed steed = new Mobiles.UnholySteed();
if (BaseCreature.Summon(steed, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours(1.0)))
{
from.Steed = steed;
FinishInvoke(from);
}
}
}
}

View file

@ -0,0 +1,19 @@
namespace Server.Ethics.Evil
{
public sealed class UnholyWord : Power
{
public UnholyWord()
{
m_Definition = new PowerDefinition(
100,
"Unholy Word",
"Velgo Oostrac",
""
);
}
public override void BeginInvoke(Player from)
{
}
}
}

View file

@ -0,0 +1,19 @@
namespace Server.Ethics.Evil
{
public sealed class VileBlade : Power
{
public VileBlade()
{
m_Definition = new PowerDefinition(
10,
"Vile Blade",
"Velgo Reyam",
""
);
}
public override void BeginInvoke(Player from)
{
}
}
}