Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -1,244 +1,242 @@
using System;
using Server.Ethics.Evil;
using Server.Ethics.Hero;
using Server.Items;
using Server.Mobiles;
namespace Server.Ethics
{
public abstract class Ethic
{
public static readonly bool Enabled = false;
public abstract class Ethic
{
public static readonly bool Enabled = false;
public static Ethic Find( Item item )
{
if ( ( item.SavedFlags & 0x100 ) != 0 )
{
if ( item.Hue == Hero.Definition.PrimaryHue )
return Hero;
public static readonly Ethic Hero = new HeroEthic();
public static readonly Ethic Evil = new EvilEthic();
item.SavedFlags &= ~0x100;
}
public static readonly Ethic[] Ethics =
{
Hero,
Evil
};
if ( ( item.SavedFlags & 0x200 ) != 0 )
{
if ( item.Hue == Evil.Definition.PrimaryHue )
return Evil;
protected EthicDefinition m_Definition;
item.SavedFlags &= ~0x200;
}
protected PlayerCollection m_Players;
return null;
}
public Ethic()
{
m_Players = new PlayerCollection();
}
public static bool CheckTrade( Mobile from, Mobile to, Mobile newOwner, Item item )
{
Ethic itemEthic = Find( item );
public EthicDefinition Definition => m_Definition;
if ( itemEthic == null || Find( newOwner ) == itemEthic )
return true;
public PlayerCollection Players => m_Players;
if ( itemEthic == Hero )
( from == newOwner ? to : from ).SendMessage( "Only heros may receive this item." );
else if ( itemEthic == Evil )
( from == newOwner ? to : from ).SendMessage( "Only the evil may receive this item." );
public static Ethic Find(Item item)
{
if ((item.SavedFlags & 0x100) != 0)
{
if (item.Hue == Hero.Definition.PrimaryHue)
return Hero;
return false;
}
item.SavedFlags &= ~0x100;
}
public static bool CheckEquip( Mobile from, Item item )
{
Ethic itemEthic = Find( item );
if ((item.SavedFlags & 0x200) != 0)
{
if (item.Hue == Evil.Definition.PrimaryHue)
return Evil;
if ( itemEthic == null || Find( from ) == itemEthic )
return true;
item.SavedFlags &= ~0x200;
}
if ( itemEthic == Hero )
from.SendMessage( "Only heros may wear this item." );
else if ( itemEthic == Evil )
from.SendMessage( "Only the evil may wear this item." );
return null;
}
return false;
}
public static bool CheckTrade(Mobile from, Mobile to, Mobile newOwner, Item item)
{
Ethic itemEthic = Find(item);
public static bool IsImbued( Item item )
{
return IsImbued( item, false );
}
if (itemEthic == null || Find(newOwner) == itemEthic)
return true;
public static bool IsImbued( Item item, bool recurse )
{
if ( Find( item ) != null )
return true;
if (itemEthic == Hero)
(from == newOwner ? to : from).SendMessage("Only heros may receive this item.");
else if (itemEthic == Evil)
(from == newOwner ? to : from).SendMessage("Only the evil may receive this item.");
if ( recurse )
{
foreach ( Item child in item.Items )
{
if ( IsImbued( child, true ) )
return true;
}
}
return false;
}
return false;
}
public static bool CheckEquip(Mobile from, Item item)
{
Ethic itemEthic = Find(item);
public static void Initialize()
{
if ( Enabled )
EventSink.Speech += EventSink_Speech;
}
if (itemEthic == null || Find(from) == itemEthic)
return true;
public static void EventSink_Speech( SpeechEventArgs e )
{
if ( e.Blocked || e.Handled )
return;
if (itemEthic == Hero)
from.SendMessage("Only heros may wear this item.");
else if (itemEthic == Evil)
from.SendMessage("Only the evil may wear this item.");
Player pl = Player.Find( e.Mobile );
return false;
}
if ( pl == null )
{
for ( int i = 0; i < Ethics.Length; ++i )
{
Ethic ethic = Ethics[i];
public static bool IsImbued(Item item)
{
return IsImbued(item, false);
}
if ( !ethic.IsEligible( e.Mobile ) )
continue;
public static bool IsImbued(Item item, bool recurse)
{
if (Find(item) != null)
return true;
if ( !Insensitive.Equals( ethic.Definition.JoinPhrase.String, e.Speech ) )
continue;
if (recurse)
foreach (Item child in item.Items)
if (IsImbued(child, true))
return true;
bool isNearAnkh = false;
return false;
}
foreach ( Item item in e.Mobile.GetItemsInRange( 2 ) )
{
if ( item is Items.AnkhNorth || item is Items.AnkhWest )
{
isNearAnkh = true;
break;
}
}
public static void Initialize()
{
if (Enabled)
EventSink.Speech += EventSink_Speech;
}
if ( !isNearAnkh )
continue;
public static void EventSink_Speech(SpeechEventArgs e)
{
if (e.Blocked || e.Handled)
return;
pl = new Player( ethic, e.Mobile );
Player pl = Player.Find(e.Mobile);
pl.Attach();
if (pl == null)
{
for (int i = 0; i < Ethics.Length; ++i)
{
Ethic ethic = Ethics[i];
e.Mobile.FixedEffect( 0x373A, 10, 30 );
e.Mobile.PlaySound( 0x209 );
if (!ethic.IsEligible(e.Mobile))
continue;
e.Handled = true;
break;
}
}
else
{
if ( e.Mobile is PlayerMobile mobile && mobile.DuelContext != null )
return;
if (!Insensitive.Equals(ethic.Definition.JoinPhrase.String, e.Speech))
continue;
Ethic ethic = pl.Ethic;
bool isNearAnkh = false;
for ( int i = 0; i < ethic.Definition.Powers.Length; ++i )
{
Power power = ethic.Definition.Powers[i];
foreach (Item item in e.Mobile.GetItemsInRange(2))
if (item is AnkhNorth || item is AnkhWest)
{
isNearAnkh = true;
break;
}
if ( !Insensitive.Equals( power.Definition.Phrase.String, e.Speech ) )
continue;
if (!isNearAnkh)
continue;
if ( !power.CheckInvoke( pl ) )
continue;
pl = new Player(ethic, e.Mobile);
power.BeginInvoke( pl );
e.Handled = true;
pl.Attach();
break;
}
}
}
e.Mobile.FixedEffect(0x373A, 10, 30);
e.Mobile.PlaySound(0x209);
protected EthicDefinition m_Definition;
e.Handled = true;
break;
}
}
else
{
if (e.Mobile is PlayerMobile mobile && mobile.DuelContext != null)
return;
protected PlayerCollection m_Players;
Ethic ethic = pl.Ethic;
public EthicDefinition Definition => m_Definition;
for (int i = 0; i < ethic.Definition.Powers.Length; ++i)
{
Power power = ethic.Definition.Powers[i];
public PlayerCollection Players => m_Players;
if (!Insensitive.Equals(power.Definition.Phrase.String, e.Speech))
continue;
public static Ethic Find( Mobile mob )
{
return Find( mob, false, false );
}
if (!power.CheckInvoke(pl))
continue;
public static Ethic Find( Mobile mob, bool inherit )
{
return Find( mob, inherit, false );
}
power.BeginInvoke(pl);
e.Handled = true;
public static Ethic Find( Mobile mob, bool inherit, bool allegiance )
{
Player pl = Player.Find( mob );
break;
}
}
}
if ( pl != null )
return pl.Ethic;
public static Ethic Find(Mobile mob)
{
return Find(mob, false, false);
}
if ( inherit && mob is BaseCreature bc )
{
if ( bc.Controlled )
return Find( bc.ControlMaster, false );
if ( bc.Summoned )
return Find( bc.SummonMaster, false );
if ( allegiance )
return bc.EthicAllegiance;
}
public static Ethic Find(Mobile mob, bool inherit)
{
return Find(mob, inherit, false);
}
return null;
}
public static Ethic Find(Mobile mob, bool inherit, bool allegiance)
{
Player pl = Player.Find(mob);
public Ethic()
{
m_Players = new PlayerCollection();
}
if (pl != null)
return pl.Ethic;
public abstract bool IsEligible( Mobile mob );
if (inherit && mob is BaseCreature bc)
{
if (bc.Controlled)
return Find(bc.ControlMaster, false);
if (bc.Summoned)
return Find(bc.SummonMaster, false);
if (allegiance)
return bc.EthicAllegiance;
}
public virtual void Deserialize( GenericReader reader )
{
int version = reader.ReadEncodedInt();
return null;
}
switch ( version )
{
case 0:
{
int playerCount = reader.ReadEncodedInt();
public abstract bool IsEligible(Mobile mob);
for ( int i = 0; i < playerCount; ++i )
{
Player pl = new Player( this, reader );
public virtual void Deserialize(GenericReader reader)
{
int version = reader.ReadEncodedInt();
if ( pl.Mobile != null )
Timer.DelayCall( TimeSpan.Zero, pl.CheckAttach );
}
switch (version)
{
case 0:
{
int playerCount = reader.ReadEncodedInt();
break;
}
}
}
for (int i = 0; i < playerCount; ++i)
{
Player pl = new Player(this, reader);
public virtual void Serialize( GenericWriter writer )
{
writer.WriteEncodedInt( 0 ); // version
if (pl.Mobile != null)
Timer.DelayCall(TimeSpan.Zero, pl.CheckAttach);
}
writer.WriteEncodedInt( m_Players.Count );
break;
}
}
}
for ( int i = 0; i < m_Players.Count; ++i )
m_Players[i].Serialize( writer );
}
public virtual void Serialize(GenericWriter writer)
{
writer.WriteEncodedInt(0); // version
public static readonly Ethic Hero = new Hero.HeroEthic();
public static readonly Ethic Evil = new Evil.EvilEthic();
writer.WriteEncodedInt(m_Players.Count);
public static readonly Ethic[] Ethics = {
Hero,
Evil
};
}
}
for (int i = 0; i < m_Players.Count; ++i)
m_Players[i].Serialize(writer);
}
}
}

View file

@ -1,59 +1,59 @@
namespace Server.Ethics
{
public class EthicsPersistance : Item
{
public static EthicsPersistance Instance { get; private set; }
public class EthicsPersistance : Item
{
[Constructible]
public EthicsPersistance()
: base(1)
{
Movable = false;
public override string DefaultName => "Ethics Persistance - Internal";
if (Instance == null || Instance.Deleted)
Instance = this;
else
base.Delete();
}
[Constructible]
public EthicsPersistance()
: base( 1 )
{
Movable = false;
public EthicsPersistance(Serial serial)
: base(serial)
{
Instance = this;
}
if ( Instance == null || Instance.Deleted )
Instance = this;
else
base.Delete();
}
public static EthicsPersistance Instance{ get; private set; }
public EthicsPersistance( Serial serial )
: base( serial )
{
Instance = this;
}
public override string DefaultName => "Ethics Persistance - Internal";
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
writer.Write(0); // version
for ( int i = 0; i < Ethic.Ethics.Length; ++i )
Ethic.Ethics[i].Serialize( writer );
}
for (int i = 0; i < Ethic.Ethics.Length; ++i)
Ethic.Ethics[i].Serialize(writer);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
for ( int i = 0; i < Ethic.Ethics.Length; ++i )
Ethic.Ethics[i].Deserialize( reader );
switch (version)
{
case 0:
{
for (int i = 0; i < Ethic.Ethics.Length; ++i)
Ethic.Ethics[i].Deserialize(reader);
break;
}
}
}
break;
}
}
}
public override void Delete()
{
}
}
}
public override void Delete()
{
}
}
}

View file

@ -1,159 +1,160 @@
using System;
using System.Collections.ObjectModel;
using Server.Mobiles;
namespace Server.Ethics
{
public class PlayerCollection : System.Collections.ObjectModel.Collection<Player>
{
}
public class PlayerCollection : Collection<Player>
{
}
[PropertyObject]
public class Player
{
public static Player Find( Mobile mob )
{
return Find( mob, false );
}
[PropertyObject]
public class Player
{
private DateTime m_Shield;
public static Player Find( Mobile mob, bool inherit )
{
PlayerMobile pm = mob as PlayerMobile;
public Player(Ethic ethic, Mobile mobile)
{
Ethic = ethic;
Mobile = mobile;
if ( pm == null )
{
if ( inherit && mob is BaseCreature bc )
{
if ( bc.Controlled )
pm = bc.ControlMaster as PlayerMobile;
else if ( bc.Summoned )
pm = bc.SummonMaster as PlayerMobile;
}
Power = 5;
History = 5;
}
if ( pm == null )
return null;
}
public Player(Ethic ethic, GenericReader reader)
{
Ethic = ethic;
Player pl = pm.EthicPlayer;
int version = reader.ReadEncodedInt();
if ( pl != null && !pl.Ethic.IsEligible( pl.Mobile ) )
pm.EthicPlayer = pl = null;
switch (version)
{
case 0:
{
Mobile = reader.ReadMobile();
return pl;
}
Power = reader.ReadEncodedInt();
History = reader.ReadEncodedInt();
private DateTime m_Shield;
Steed = reader.ReadMobile();
Familiar = reader.ReadMobile();
public Ethic Ethic { get; }
m_Shield = reader.ReadDeltaTime();
public Mobile Mobile { get; }
break;
}
}
}
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public int Power { get; set; }
public Ethic Ethic{ get; }
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public int History { get; set; }
public Mobile Mobile{ get; }
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public Mobile Steed { get; set; }
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public int Power{ get; set; }
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public Mobile Familiar { get; set; }
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public int History{ get; set; }
[CommandProperty( AccessLevel.GameMaster )]
public bool IsShielded
{
get
{
if ( m_Shield == DateTime.MinValue )
return false;
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public Mobile Steed{ get; set; }
if ( DateTime.UtcNow < ( m_Shield + TimeSpan.FromHours( 1.0 ) ) )
return true;
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public Mobile Familiar{ get; set; }
FinishShield();
return false;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public bool IsShielded
{
get
{
if (m_Shield == DateTime.MinValue)
return false;
public void BeginShield()
{
m_Shield = DateTime.UtcNow;
}
if (DateTime.UtcNow < m_Shield + TimeSpan.FromHours(1.0))
return true;
public void FinishShield()
{
m_Shield = DateTime.MinValue;
}
FinishShield();
return false;
}
}
public Player( Ethic ethic, Mobile mobile )
{
Ethic = ethic;
Mobile = mobile;
public static Player Find(Mobile mob)
{
return Find(mob, false);
}
Power = 5;
History = 5;
}
public static Player Find(Mobile mob, bool inherit)
{
PlayerMobile pm = mob as PlayerMobile;
public void CheckAttach()
{
if ( Ethic.IsEligible( Mobile ) )
Attach();
}
if (pm == null)
{
if (inherit && mob is BaseCreature bc)
{
if (bc.Controlled)
pm = bc.ControlMaster as PlayerMobile;
else if (bc.Summoned)
pm = bc.SummonMaster as PlayerMobile;
}
public void Attach()
{
if ( Mobile is PlayerMobile mobile )
mobile.EthicPlayer = this;
if (pm == null)
return null;
}
Ethic.Players.Add( this );
}
Player pl = pm.EthicPlayer;
public void Detach()
{
if ( Mobile is PlayerMobile mobile )
mobile.EthicPlayer = null;
if (pl != null && !pl.Ethic.IsEligible(pl.Mobile))
pm.EthicPlayer = pl = null;
Ethic.Players.Remove( this );
}
return pl;
}
public Player( Ethic ethic, GenericReader reader )
{
Ethic = ethic;
public void BeginShield()
{
m_Shield = DateTime.UtcNow;
}
int version = reader.ReadEncodedInt();
public void FinishShield()
{
m_Shield = DateTime.MinValue;
}
switch ( version )
{
case 0:
{
Mobile = reader.ReadMobile();
public void CheckAttach()
{
if (Ethic.IsEligible(Mobile))
Attach();
}
Power = reader.ReadEncodedInt();
History = reader.ReadEncodedInt();
public void Attach()
{
if (Mobile is PlayerMobile mobile)
mobile.EthicPlayer = this;
Steed = reader.ReadMobile();
Familiar = reader.ReadMobile();
Ethic.Players.Add(this);
}
m_Shield = reader.ReadDeltaTime();
public void Detach()
{
if (Mobile is PlayerMobile mobile)
mobile.EthicPlayer = null;
break;
}
}
}
Ethic.Players.Remove(this);
}
public void Serialize( GenericWriter writer )
{
writer.WriteEncodedInt( 0 ); // version
public void Serialize(GenericWriter writer)
{
writer.WriteEncodedInt(0); // version
writer.Write( Mobile );
writer.Write(Mobile);
writer.WriteEncodedInt( Power );
writer.WriteEncodedInt( History );
writer.WriteEncodedInt(Power);
writer.WriteEncodedInt(History);
writer.Write( Steed );
writer.Write( Familiar );
writer.Write(Steed);
writer.Write(Familiar);
writer.WriteDeltaTime( m_Shield );
}
}
}
writer.WriteDeltaTime(m_Shield);
}
}
}

View file

@ -1,30 +1,33 @@
using Server.Network;
namespace Server.Ethics
{
public abstract class Power
{
protected PowerDefinition m_Definition;
public abstract class Power
{
protected PowerDefinition m_Definition;
public PowerDefinition Definition => m_Definition;
public PowerDefinition Definition => m_Definition;
public virtual bool CheckInvoke( Player from )
{
if ( !from.Mobile.CheckAlive() )
return false;
public virtual bool CheckInvoke(Player from)
{
if (!from.Mobile.CheckAlive())
return false;
if ( from.Power < m_Definition.Power )
{
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You lack the power to invoke this ability." );
return false;
}
if (from.Power < m_Definition.Power)
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false,
"You lack the power to invoke this ability.");
return false;
}
return true;
}
return true;
}
public abstract void BeginInvoke( Player from );
public abstract void BeginInvoke(Player from);
public virtual void FinishInvoke( Player from )
{
from.Power -= m_Definition.Power;
}
}
}
public virtual void FinishInvoke(Player from)
{
from.Power -= m_Definition.Power;
}
}
}

View file

@ -1,27 +1,28 @@
namespace Server.Ethics
{
public class EthicDefinition
{
public int PrimaryHue { get; }
public class EthicDefinition
{
public EthicDefinition(int primaryHue, TextDefinition title, TextDefinition adjunct, TextDefinition joinPhrase,
Power[] powers)
{
PrimaryHue = primaryHue;
public TextDefinition Title { get; }
Title = title;
Adjunct = adjunct;
public TextDefinition Adjunct { get; }
JoinPhrase = joinPhrase;
public TextDefinition JoinPhrase { get; }
Powers = powers;
}
public Power[] Powers { get; }
public int PrimaryHue{ get; }
public EthicDefinition( int primaryHue, TextDefinition title, TextDefinition adjunct, TextDefinition joinPhrase, Power[] powers )
{
PrimaryHue = primaryHue;
public TextDefinition Title{ get; }
Title = title;
Adjunct = adjunct;
public TextDefinition Adjunct{ get; }
JoinPhrase = joinPhrase;
public TextDefinition JoinPhrase{ get; }
Powers = powers;
}
}
}
public Power[] Powers{ get; }
}
}

View file

@ -1,22 +1,22 @@
namespace Server.Ethics
{
public class PowerDefinition
{
public int Power { get; }
public class PowerDefinition
{
public PowerDefinition(int power, TextDefinition name, TextDefinition phrase, TextDefinition description)
{
Power = power;
public TextDefinition Name { get; }
Name = name;
Phrase = phrase;
Description = description;
}
public TextDefinition Phrase { get; }
public int Power{ get; }
public TextDefinition Description { get; }
public TextDefinition Name{ get; }
public PowerDefinition( int power, TextDefinition name, TextDefinition phrase, TextDefinition description )
{
Power = power;
public TextDefinition Phrase{ get; }
Name = name;
Phrase = phrase;
Description = description;
}
}
}
public TextDefinition Description{ get; }
}
}

View file

@ -2,33 +2,33 @@ 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 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 );
public override bool IsEligible(Mobile mob)
{
Faction fac = Faction.Find(mob);
return ( fac is Minax || fac is Shadowlords );
}
}
return fac is Minax || fac is Shadowlords;
}
}
}

View file

@ -1,84 +1,83 @@
using System;
using Server.Ethics;
namespace Server.Mobiles
{
public class UnholyFamiliar : BaseCreature
{
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 class UnholyFamiliar : BaseCreature
{
[Constructible]
public UnholyFamiliar()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Body = 99;
BaseSoundID = 0xE5;
[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);
SetStr( 96, 120 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetHits(58, 72);
SetMana(0);
SetHits( 58, 72 );
SetMana( 0 );
SetDamage(11, 17);
SetDamage( 11, 17 );
SetDamageType(ResistanceType.Physical, 100);
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);
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);
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;
Fame = 2500;
Karma = 2500;
VirtualArmor = 22;
VirtualArmor = 22;
Tamable = false;
ControlSlots = 1;
}
Tamable = false;
ControlSlots = 1;
}
public UnholyFamiliar(Serial serial)
: base(serial)
{
}
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 CorpseName => "an evil corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public override string DefaultName => "a dark wolf";
public UnholyFamiliar( Serial serial )
: base( serial )
{
}
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 );
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 );
}
return base.ApplyNameSuffix(suffix);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -1,89 +1,88 @@
using System;
using Server.Ethics;
namespace Server.Mobiles
{
public class UnholySteed : BaseMount
{
public override string CorpseName => "an unholy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
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);
public override bool HasBreath => true;
public override bool CanBreath => true;
SetHits(298, 315);
[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 );
SetDamage(16, 22);
SetHits( 298, 315 );
SetDamageType(ResistanceType.Physical, 40);
SetDamageType(ResistanceType.Fire, 40);
SetDamageType(ResistanceType.Energy, 20);
SetDamage( 16, 22 );
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);
SetDamageType( ResistanceType.Physical, 40 );
SetDamageType( ResistanceType.Fire, 40 );
SetDamageType( ResistanceType.Energy, 20 );
SetSkill(SkillName.MagicResist, 25.1, 30.0);
SetSkill(SkillName.Tactics, 97.6, 100.0);
SetSkill(SkillName.Wrestling, 80.5, 92.5);
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 );
Fame = 14000;
Karma = -14000;
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 80.5, 92.5 );
VirtualArmor = 60;
Fame = 14000;
Karma = -14000;
Tamable = false;
ControlSlots = 1;
}
VirtualArmor = 60;
public UnholySteed(Serial serial)
: base(serial)
{
}
Tamable = false;
ControlSlots = 1;
}
public override string CorpseName => "an unholy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
public override bool HasBreath => true;
public override bool CanBreath => true;
public UnholySteed( Serial serial )
: base( serial )
{
}
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 );
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 );
}
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 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 );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -1,76 +1,78 @@
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 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, Targeting.TargetFlags.None, new TargetStateCallback( Power_OnTarget ), from );
from.Mobile.SendMessage( "Where do you wish to blight?" );
}
public override void BeginInvoke(Player from)
{
from.Mobile.BeginTarget(12, true, TargetFlags.None, new TargetStateCallback(Power_OnTarget), from);
from.Mobile.SendMessage("Where do you wish to blight?");
}
private void Power_OnTarget( Mobile fromMobile, object obj, object state )
{
Player from = state as Player;
private void Power_OnTarget(Mobile fromMobile, object obj, object state)
{
Player from = state as Player;
if ( !(obj is IPoint3D p) )
return;
if (!(obj is IPoint3D p))
return;
if ( !CheckInvoke( from ) )
return;
if (!CheckInvoke(from))
return;
bool powerFunctioned = false;
bool powerFunctioned = false;
SpellHelper.GetSurfaceTop( ref p );
SpellHelper.GetSurfaceTop(ref p);
foreach ( Mobile mob in from.Mobile.GetMobilesInRange( 6 ) )
{
if ( mob == from.Mobile || !SpellHelper.ValidIndirectTarget( from.Mobile, mob ) )
continue;
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 (mob.GetStatMod("Holy Curse") != null)
continue;
if ( !from.Mobile.CanBeHarmful( mob, false ) )
continue;
if (!from.Mobile.CanBeHarmful(mob, false))
continue;
from.Mobile.DoHarmful( mob, true );
from.Mobile.DoHarmful(mob, true);
mob.AddStatMod( new StatMod( StatType.All, "Holy Curse", -10, TimeSpan.FromMinutes( 30.0 ) ) );
mob.AddStatMod(new StatMod(StatType.All, "Holy Curse", -10, TimeSpan.FromMinutes(30.0)));
mob.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist );
mob.PlaySound( 0x1FB );
mob.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
mob.PlaySound(0x1FB);
powerFunctioned = true;
}
powerFunctioned = true;
}
if ( powerFunctioned )
{
SpellHelper.Turn( from.Mobile, p );
if (powerFunctioned)
{
SpellHelper.Turn(from.Mobile, p);
Effects.PlaySound( p, from.Mobile.Map, 0x1FB );
Effects.PlaySound(p, from.Mobile.Map, 0x1FB);
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You curse the area." );
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You curse the area.");
FinishInvoke( from );
}
else
{
from.Mobile.FixedEffect( 0x3735, 6, 30 );
from.Mobile.PlaySound( 0x5C );
}
}
}
}
FinishInvoke(from);
}
else
{
from.Mobile.FixedEffect(0x3735, 6, 30);
from.Mobile.PlaySound(0x5C);
}
}
}
}

View file

@ -1,45 +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 sealed class SummonFamiliar : Power
{
public SummonFamiliar()
{
m_Definition = new PowerDefinition(
5,
"Summon Familiar",
"Trubechs Vingir",
""
);
}
public override void BeginInvoke( Player from )
{
if ( from.Familiar != null && from.Familiar.Deleted )
from.Familiar = null;
public override void BeginInvoke(Player from)
{
if (from.Familiar != null && from.Familiar.Deleted)
from.Familiar = null;
if ( from.Familiar != null )
{
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You already have an unholy familiar." );
return;
}
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;
}
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();
UnholyFamiliar familiar = new UnholyFamiliar();
if ( BaseCreature.Summon( familiar, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours( 1.0 ) ) )
{
from.Familiar = familiar;
if (BaseCreature.Summon(familiar, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours(1.0)))
{
from.Familiar = familiar;
FinishInvoke( from );
}
}
}
}
FinishInvoke(from);
}
}
}
}

View file

@ -1,67 +1,71 @@
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 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, Targeting.TargetFlags.None, new TargetStateCallback( Power_OnTarget ), from );
from.Mobile.SendMessage( "Which item do you wish to imbue?" );
}
public override void BeginInvoke(Player from)
{
from.Mobile.BeginTarget(12, false, TargetFlags.None, new TargetStateCallback(Power_OnTarget), from);
from.Mobile.SendMessage("Which item do you wish to imbue?");
}
private void Power_OnTarget( Mobile fromMobile, object obj, object state )
{
if (!(state is Player from))
return;
private void Power_OnTarget(Mobile fromMobile, object obj, object state)
{
if (!(state is Player from))
return;
if ( !(obj is Item item) )
{
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You may not imbue that." );
return;
}
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( Network.MessageType.Regular, 0x3B2, false, "You may only imbue items you are wearing." );
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( Network.MessageType.Regular, 0x3B2, false, "That has already beem imbued." );
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 );
bool canImbue = (item is Spellbook || item is BaseClothing || item is BaseArmor || item is BaseWeapon) &&
item.Name == null;
if ( canImbue )
{
if ( !CheckInvoke( from ) )
return;
if (canImbue)
{
if (!CheckInvoke(from))
return;
item.Hue = Ethic.Evil.Definition.PrimaryHue;
item.SavedFlags |= 0x200;
item.Hue = Ethic.Evil.Definition.PrimaryHue;
item.SavedFlags |= 0x200;
from.Mobile.FixedEffect( 0x375A, 10, 20 );
from.Mobile.PlaySound( 0x209 );
from.Mobile.FixedEffect(0x375A, 10, 20);
from.Mobile.PlaySound(0x209);
FinishInvoke( from );
}
else
{
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You may not imbue that." );
}
}
}
}
FinishInvoke(from);
}
else
{
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may not imbue that.");
}
}
}
}

View file

@ -1,93 +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 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;
public override void BeginInvoke(Player from)
{
Ethic opposition = Ethic.Hero;
int enemyCount = 0;
int enemyCount = 0;
int maxRange = 18 + from.Power;
int maxRange = 18 + from.Power;
Player primary = null;
Player primary = null;
foreach ( Player pl in opposition.Players )
{
Mobile mob = pl.Mobile;
foreach (Player pl in opposition.Players)
{
Mobile mob = pl.Mobile;
if ( mob == null || mob.Map != from.Mobile.Map || !mob.Alive )
continue;
if (mob == null || mob.Map != from.Mobile.Map || !mob.Alive)
continue;
if ( !mob.InRange( from.Mobile, Math.Max( 18, maxRange - pl.Power ) ) )
continue;
if (!mob.InRange(from.Mobile, Math.Max(18, maxRange - pl.Power)))
continue;
if ( primary == null || pl.Power > primary.Power )
primary = pl;
if (primary == null || pl.Power > primary.Power)
primary = pl;
++enemyCount;
}
++enemyCount;
}
StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
sb.Append( "You sense " );
sb.Append( enemyCount == 0 ? "no" : enemyCount.ToString() );
sb.Append( enemyCount == 1 ? " enemy" : " enemies" );
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" );
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;
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( '.' );
}
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( Network.MessageType.Regular, 0x59, false, sb.ToString() );
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x59, false, sb.ToString());
FinishInvoke( from );
}
}
}
FinishInvoke(from);
}
}
}

View file

@ -1,30 +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 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( Network.MessageType.Regular, 0x3B2, false, "You are already under the protection of an unholy shield." );
return;
}
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.BeginShield();
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You are now under the protection of an unholy shield." );
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false,
"You are now under the protection of an unholy shield.");
FinishInvoke( from );
}
}
}
FinishInvoke(from);
}
}
}

View file

@ -1,44 +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 sealed class UnholySteed : Power
{
public UnholySteed()
{
m_Definition = new PowerDefinition(
30,
"Unholy Steed",
"Trubechs Yeliab",
""
);
}
public override void BeginInvoke( Player from )
{
if ( from.Steed != null && from.Steed.Deleted )
from.Steed = null;
public override void BeginInvoke(Player from)
{
if (from.Steed != null && from.Steed.Deleted)
from.Steed = null;
if ( from.Steed != null )
{
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You already have an unholy steed." );
return;
}
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;
}
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();
Mobiles.UnholySteed steed = new Mobiles.UnholySteed();
if ( Mobiles.BaseCreature.Summon( steed, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours( 1.0 ) ) )
{
from.Steed = steed;
if (BaseCreature.Summon(steed, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours(1.0)))
{
from.Steed = steed;
FinishInvoke( from );
}
}
}
}
FinishInvoke(from);
}
}
}
}

View file

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

View file

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

View file

@ -2,36 +2,36 @@ using Server.Factions;
namespace Server.Ethics.Hero
{
public sealed class HeroEthic : Ethic
{
public HeroEthic()
{
m_Definition = new EthicDefinition(
0x482,
"Hero", "(Hero)",
"I will defend the virtues",
new Power[]
{
new HolySense(),
new HolyItem(),
new SummonFamiliar(),
new HolyBlade(),
new Bless(),
new HolyShield(),
new HolySteed(),
new HolyWord()
}
);
}
public sealed class HeroEthic : Ethic
{
public HeroEthic()
{
m_Definition = new EthicDefinition(
0x482,
"Hero", "(Hero)",
"I will defend the virtues",
new Power[]
{
new HolySense(),
new HolyItem(),
new SummonFamiliar(),
new HolyBlade(),
new Bless(),
new HolyShield(),
new HolySteed(),
new HolyWord()
}
);
}
public override bool IsEligible( Mobile mob )
{
if ( mob.Kills >= 5 )
return false;
public override bool IsEligible(Mobile mob)
{
if (mob.Kills >= 5)
return false;
Faction fac = Faction.Find( mob );
Faction fac = Faction.Find(mob);
return ( fac is TrueBritannians || fac is CouncilOfMages );
}
}
return fac is TrueBritannians || fac is CouncilOfMages;
}
}
}

View file

@ -1,85 +1,84 @@
using System;
using Server.Ethics;
namespace Server.Mobiles
{
public class HolyFamiliar : BaseCreature
{
public override string CorpseName => "a holy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public class HolyFamiliar : BaseCreature
{
[Constructible]
public HolyFamiliar()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Body = 100;
BaseSoundID = 0xE5;
public override string DefaultName => "a silver wolf";
SetStr(96, 120);
SetDex(81, 105);
SetInt(36, 60);
[Constructible]
public HolyFamiliar()
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Body = 100;
BaseSoundID = 0xE5;
SetHits(58, 72);
SetMana(0);
SetStr( 96, 120 );
SetDex( 81, 105 );
SetInt( 36, 60 );
SetDamage(11, 17);
SetHits( 58, 72 );
SetMana( 0 );
SetDamageType(ResistanceType.Physical, 100);
SetDamage( 11, 17 );
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);
SetDamageType( ResistanceType.Physical, 100 );
SetSkill(SkillName.MagicResist, 57.6, 75.0);
SetSkill(SkillName.Tactics, 50.1, 70.0);
SetSkill(SkillName.Wrestling, 60.1, 80.0);
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 );
Fame = 2500;
Karma = 2500;
SetSkill( SkillName.MagicResist, 57.6, 75.0 );
SetSkill( SkillName.Tactics, 50.1, 70.0 );
SetSkill( SkillName.Wrestling, 60.1, 80.0 );
VirtualArmor = 22;
Fame = 2500;
Karma = 2500;
Tamable = false;
ControlSlots = 1;
}
VirtualArmor = 22;
public HolyFamiliar(Serial serial)
: base(serial)
{
}
Tamable = false;
ControlSlots = 1;
}
public override string CorpseName => "a holy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
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 DefaultName => "a silver wolf";
public HolyFamiliar( Serial serial )
: base( serial )
{
}
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.Hero.Definition.Adjunct.String;
else
suffix = string.Concat( suffix, " ", Ethic.Hero.Definition.Adjunct.String );
public override string ApplyNameSuffix(string suffix)
{
if (suffix.Length == 0)
suffix = Ethic.Hero.Definition.Adjunct.String;
else
suffix = string.Concat(suffix, " ", Ethic.Hero.Definition.Adjunct.String);
return base.ApplyNameSuffix( suffix );
}
return base.ApplyNameSuffix(suffix);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -1,89 +1,88 @@
using System;
using Server.Ethics;
namespace Server.Mobiles
{
public class HolySteed : BaseMount
{
public override string CorpseName => "a holy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public class HolySteed : BaseMount
{
[Constructible]
public HolySteed()
: base("a silver steed", 0x75, 0x3EA8, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
SetStr(496, 525);
SetDex(86, 105);
SetInt(86, 125);
public override bool HasBreath => true;
public override bool CanBreath => true;
SetHits(298, 315);
[Constructible]
public HolySteed()
: base( "a silver steed", 0x75, 0x3EA8, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
SetStr( 496, 525 );
SetDex( 86, 105 );
SetInt( 86, 125 );
SetDamage(16, 22);
SetHits( 298, 315 );
SetDamageType(ResistanceType.Physical, 40);
SetDamageType(ResistanceType.Fire, 40);
SetDamageType(ResistanceType.Energy, 20);
SetDamage( 16, 22 );
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);
SetDamageType( ResistanceType.Physical, 40 );
SetDamageType( ResistanceType.Fire, 40 );
SetDamageType( ResistanceType.Energy, 20 );
SetSkill(SkillName.MagicResist, 25.1, 30.0);
SetSkill(SkillName.Tactics, 97.6, 100.0);
SetSkill(SkillName.Wrestling, 80.5, 92.5);
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 );
Fame = 14000;
Karma = 14000;
SetSkill( SkillName.MagicResist, 25.1, 30.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 80.5, 92.5 );
VirtualArmor = 60;
Fame = 14000;
Karma = 14000;
Tamable = false;
ControlSlots = 1;
}
VirtualArmor = 60;
public HolySteed(Serial serial)
: base(serial)
{
}
Tamable = false;
ControlSlots = 1;
}
public override string CorpseName => "a holy corpse";
public override bool IsDispellable => false;
public override bool IsBondable => false;
public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
public override bool HasBreath => true;
public override bool CanBreath => true;
public HolySteed( Serial serial )
: base( serial )
{
}
public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
public override string ApplyNameSuffix( string suffix )
{
if ( suffix.Length == 0 )
suffix = Ethic.Hero.Definition.Adjunct.String;
else
suffix = string.Concat( suffix, " ", Ethic.Hero.Definition.Adjunct.String );
public override string ApplyNameSuffix(string suffix)
{
if (suffix.Length == 0)
suffix = Ethic.Hero.Definition.Adjunct.String;
else
suffix = string.Concat(suffix, " ", Ethic.Hero.Definition.Adjunct.String);
return base.ApplyNameSuffix( suffix );
}
return base.ApplyNameSuffix(suffix);
}
public override void OnDoubleClick( Mobile from )
{
if ( Ethic.Find( from ) != Ethic.Hero )
from.SendMessage( "You may not ride this steed." );
else
base.OnDoubleClick( from );
}
public override void OnDoubleClick(Mobile from)
{
if (Ethic.Find(from) != Ethic.Hero)
from.SendMessage("You may not ride this steed.");
else
base.OnDoubleClick(from);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -1,77 +1,79 @@
using System;
using Server.Network;
using Server.Spells;
using Server.Targeting;
namespace Server.Ethics.Hero
{
public sealed class Bless : Power
{
public Bless()
{
m_Definition = new PowerDefinition(
15,
"Bless",
"Erstok Ontawl",
""
);
}
public sealed class Bless : Power
{
public Bless()
{
m_Definition = new PowerDefinition(
15,
"Bless",
"Erstok Ontawl",
""
);
}
public override void BeginInvoke( Player from )
{
from.Mobile.BeginTarget( 12, true, Targeting.TargetFlags.None, new TargetStateCallback( Power_OnTarget ), from );
from.Mobile.SendMessage( "Where do you wish to bless?" );
}
public override void BeginInvoke(Player from)
{
from.Mobile.BeginTarget(12, true, TargetFlags.None, new TargetStateCallback(Power_OnTarget), from);
from.Mobile.SendMessage("Where do you wish to bless?");
}
private void Power_OnTarget( Mobile fromMobile, object obj, object state )
{
if (!(state is Player from))
return;
private void Power_OnTarget(Mobile fromMobile, object obj, object state)
{
if (!(state is Player from))
return;
if ( !(obj is IPoint3D p) )
return;
if (!(obj is IPoint3D p))
return;
if ( !CheckInvoke( from ) )
return;
if (!CheckInvoke(from))
return;
bool powerFunctioned = false;
bool powerFunctioned = false;
SpellHelper.GetSurfaceTop( ref p );
SpellHelper.GetSurfaceTop(ref p);
foreach ( Mobile mob in from.Mobile.GetMobilesInRange( 6 ) )
{
if ( mob != from.Mobile && SpellHelper.ValidIndirectTarget( from.Mobile, mob ) )
continue;
foreach (Mobile mob in from.Mobile.GetMobilesInRange(6))
{
if (mob != from.Mobile && SpellHelper.ValidIndirectTarget(from.Mobile, mob))
continue;
if ( mob.GetStatMod( "Holy Bless" ) != null )
continue;
if (mob.GetStatMod("Holy Bless") != null)
continue;
if ( !from.Mobile.CanBeBeneficial( mob, false ) )
continue;
if (!from.Mobile.CanBeBeneficial(mob, false))
continue;
from.Mobile.DoBeneficial( mob );
from.Mobile.DoBeneficial(mob);
mob.AddStatMod( new StatMod( StatType.All, "Holy Bless", 10, TimeSpan.FromMinutes( 30.0 ) ) );
mob.AddStatMod(new StatMod(StatType.All, "Holy Bless", 10, TimeSpan.FromMinutes(30.0)));
mob.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
mob.PlaySound( 0x1EA );
mob.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
mob.PlaySound(0x1EA);
powerFunctioned = true;
}
powerFunctioned = true;
}
if ( powerFunctioned )
{
SpellHelper.Turn( from.Mobile, p );
if (powerFunctioned)
{
SpellHelper.Turn(from.Mobile, p);
Effects.PlaySound( p, from.Mobile.Map, 0x299 );
Effects.PlaySound(p, from.Mobile.Map, 0x299);
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You consecrate the area." );
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You consecrate the area.");
FinishInvoke( from );
}
else
{
from.Mobile.FixedEffect( 0x3735, 6, 30 );
from.Mobile.PlaySound( 0x5C );
}
}
}
}
FinishInvoke(from);
}
else
{
from.Mobile.FixedEffect(0x3735, 6, 30);
from.Mobile.PlaySound(0x5C);
}
}
}
}

View file

@ -1,19 +1,19 @@
namespace Server.Ethics.Hero
{
public sealed class HolyBlade : Power
{
public HolyBlade()
{
m_Definition = new PowerDefinition(
10,
"Holy Blade",
"Erstok Reyam",
""
);
}
public sealed class HolyBlade : Power
{
public HolyBlade()
{
m_Definition = new PowerDefinition(
10,
"Holy Blade",
"Erstok Reyam",
""
);
}
public override void BeginInvoke( Player from )
{
}
}
}
public override void BeginInvoke(Player from)
{
}
}
}

View file

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

View file

@ -1,93 +1,94 @@
using System;
using System.Text;
using Server.Network;
namespace Server.Ethics.Hero
{
public sealed class HolySense : Power
{
public HolySense()
{
m_Definition = new PowerDefinition(
0,
"Holy Sense",
"Drewrok Erstok",
""
);
}
public sealed class HolySense : Power
{
public HolySense()
{
m_Definition = new PowerDefinition(
0,
"Holy Sense",
"Drewrok Erstok",
""
);
}
public override void BeginInvoke( Player from )
{
Ethic opposition = Ethic.Evil;
public override void BeginInvoke(Player from)
{
Ethic opposition = Ethic.Evil;
int enemyCount = 0;
int enemyCount = 0;
int maxRange = 18 + from.Power;
int maxRange = 18 + from.Power;
Player primary = null;
Player primary = null;
foreach ( Player pl in opposition.Players )
{
Mobile mob = pl.Mobile;
foreach (Player pl in opposition.Players)
{
Mobile mob = pl.Mobile;
if ( mob == null || mob.Map != from.Mobile.Map || !mob.Alive )
continue;
if (mob == null || mob.Map != from.Mobile.Map || !mob.Alive)
continue;
if ( !mob.InRange( from.Mobile, Math.Max( 18, maxRange - pl.Power ) ) )
continue;
if (!mob.InRange(from.Mobile, Math.Max(18, maxRange - pl.Power)))
continue;
if ( primary == null || pl.Power > primary.Power )
primary = pl;
if (primary == null || pl.Power > primary.Power)
primary = pl;
++enemyCount;
}
++enemyCount;
}
StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
sb.Append( "You sense " );
sb.Append( enemyCount == 0 ? "no" : enemyCount.ToString() );
sb.Append( enemyCount == 1 ? " enemy" : " enemies" );
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" );
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;
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( '.' );
}
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( Network.MessageType.Regular, 0x59, false, sb.ToString() );
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x59, false, sb.ToString());
FinishInvoke( from );
}
}
}
FinishInvoke(from);
}
}
}

View file

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

View file

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

View file

@ -1,19 +1,19 @@
namespace Server.Ethics.Hero
{
public sealed class HolyWord : Power
{
public HolyWord()
{
m_Definition = new PowerDefinition(
100,
"Holy Word",
"Erstok Oostrac",
""
);
}
public sealed class HolyWord : Power
{
public HolyWord()
{
m_Definition = new PowerDefinition(
100,
"Holy Word",
"Erstok Oostrac",
""
);
}
public override void BeginInvoke( Player from )
{
}
}
}
public override void BeginInvoke(Player from)
{
}
}
}

View file

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