Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,34 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarBag : ScrollBag
{
[Constructable]
public AvatarBag()
{
Hue = 1174;
PlaceItemIn( 30, 35, new AvatarHeavenlyLightScroll() );
PlaceItemIn( 50, 35, new AvatarHeavensGateScroll() );
PlaceItemIn( 70, 35, new AvatarMarkOfGodsScroll() );
}
public AvatarBag( 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();
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
using Server;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarInitializer : BaseInitializer
{
public static void Configure()
{
Register( typeof( AvatarHeavensGateSpell ), "Heaven's Gate", "Allows the Paladin to open a heavenly portal to another location.", null, "Tithe: 30; Skill: 80; Mana: 40", 2258, 9300, School.Avatar );
Register( typeof( AvatarMarkOfGodsSpell ), "Mark Of Gods", "Casts down a powerful bolt of lightning to mark a rune for the Palaidn", null, "Tithe: 10; Skill: 20; Mana: 10", 2269, 9300, School.Avatar );
Register( typeof( AvatarHeavenlyLightSpell ), "Heavenly Light", "Heaven lights the Paladin's way.", null, "Tithe: 10; Skill: 20; Mana: 10", 2245, 9300, School.Avatar );
}
}
}

View File

@@ -0,0 +1,146 @@
using System;
using Server;
using Server.Spells;
using Server.Network;
using Server.Mobiles;
namespace Server.ACC.CSS.Systems.Avatar
{
public abstract class AvatarSpell : CSpell
{
public override SkillName CastSkill { get { return SkillName.Chivalry; } }
public override SkillName DamageSkill { get { return SkillName.Focus; } }
public abstract SpellCircle Circle { get; }
public override bool ClearHandsOnCast { get { return false; } }
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
public override int CastRecoveryBase { get { return 7; } }
public override int CastRecoveryFastScalar { get { return 1; } }
public override int CastRecoveryPerSecond { get { return 4; } }
public override int CastRecoveryMinimum { get { return 0; } }
public AvatarSpell(Mobile caster, Item scroll, SpellInfo info)
: base(caster, scroll, info)
{
}
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
if (Caster.Skills[SkillName.Chivalry].Value < RequiredSkill)
{
Caster.SendLocalizedMessage(1060172, RequiredSkill.ToString("F1")); // You must have at least ~1_SKILL_REQUIREMENT~ Chivalry to use this ability,
return false;
}
else if (Caster.TithingPoints < RequiredTithing)
{
Caster.SendLocalizedMessage(1060173, RequiredTithing.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
else if (Caster.Mana < ScaleMana(RequiredMana))
{
Caster.SendLocalizedMessage(1060174, RequiredMana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
return true;
}
public override bool CheckFizzle()
{
int requiredTithing = this.RequiredTithing;
if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) > Utility.Random(100))
requiredTithing = 0;
int mana = ScaleMana(RequiredMana);
if (Caster.Skills[SkillName.Chivalry].Value < RequiredSkill)
{
Caster.SendLocalizedMessage(1060172, RequiredSkill.ToString("F1")); // You must have at least ~1_SKILL_REQUIREMENT~ Chivalry to use this ability,
return false;
}
else if (Caster.TithingPoints < requiredTithing)
{
Caster.SendLocalizedMessage(1060173, RequiredTithing.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
else if (Caster.Mana < mana)
{
Caster.SendLocalizedMessage(1060174, RequiredMana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
Caster.TithingPoints -= requiredTithing;
if (!base.CheckFizzle())
return false;
Caster.Mana -= mana;
return true;
}
public override void DoFizzle()
{
Caster.PlaySound(0x1D6);
Caster.NextSpellTime = Core.TickCount;
}
public override void DoHurtFizzle()
{
Caster.PlaySound(0x1D6);
}
public override void OnDisturb(DisturbType type, bool message)
{
base.OnDisturb(type, message);
if (message)
Caster.PlaySound(0x1D6);
}
public override void OnBeginCast()
{
base.OnBeginCast();
SendCastEffect();
}
public virtual void SendCastEffect()
{
Caster.FixedEffect(0x37C4, 10, 42, 4, 3);
}
public override void GetCastSkills(out double min, out double max)
{
min = RequiredSkill;
max = RequiredSkill + 50.0;
}
public override int GetMana()
{
return 0;
}
public int ComputePowerValue(int div)
{
return ComputePowerValue(Caster, div);
}
public static int ComputePowerValue(Mobile from, int div)
{
if (from == null)
return 0;
int v = (int)Math.Sqrt(from.Karma + 20000 + (from.Skills.Chivalry.Fixed * 10));
return v / div;
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using Server.Items;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarSpellbook : CSpellbook
{
public override School School{ get{ return School.Avatar; } }
[Constructable]
public AvatarSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
{
}
[Constructable]
public AvatarSpellbook( bool full ) : this( (ulong)0, full )
{
}
[Constructable]
public AvatarSpellbook( ulong content, bool full ) : base( content, 0xEFA, full )
{
Hue = 1174;
Name = "Avatar Spell Book";
}
public override void OnDoubleClick( Mobile from )
{
if ( from.AccessLevel == AccessLevel.Player )
{
Container pack = from.Backpack;
if( !(Parent == from || (pack != null && Parent == pack)) )
{
from.SendMessage( "The spellbook must be in your backpack [and not in a container within] to open." );
return;
}
else if( SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions( from, this.School ) )
{
return;
}
}
from.CloseGump( typeof( AvatarSpellbookGump ) );
from.SendGump( new AvatarSpellbookGump( this ) );
}
public AvatarSpellbook( 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();
}
}
}

View File

@@ -0,0 +1,19 @@
using System;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarSpellbookGump : CSpellbookGump
{
public override string TextHue { get{ return "CC3333"; } }
public override int BGImage { get{ return 2203; } }
public override int SpellBtn { get{ return 2362; } }
public override int SpellBtnP{ get{ return 2361; } }
public override string Label1 { get{ return "Avatar"; } }
public override string Label2 { get{ return "Spells"; } }
public override Type GumpType { get{ return typeof( AvatarSpellbookGump ); } }
public AvatarSpellbookGump( CSpellbook book ) : base( book )
{
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarHeavenlyLightScroll : CSpellScroll
{
[Constructable]
public AvatarHeavenlyLightScroll() : this( 1 )
{
}
[Constructable]
public AvatarHeavenlyLightScroll( int amount ) : base( typeof( AvatarHeavenlyLightSpell ), 0xE39, amount )
{
Name = "Heavenly Light";
Hue = 1174;
}
public AvatarHeavenlyLightScroll( 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();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarHeavensGateScroll : CSpellScroll
{
[Constructable]
public AvatarHeavensGateScroll() : this( 1 )
{
}
[Constructable]
public AvatarHeavensGateScroll( int amount ) : base( typeof( AvatarHeavensGateSpell ), 0xE39, amount )
{
Name = "Heaven's Gate";
Hue = 1174;
}
public AvatarHeavensGateScroll( 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();
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Server;
using Server.Items;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarMarkOfGodsScroll : CSpellScroll
{
[Constructable]
public AvatarMarkOfGodsScroll() : this( 1 )
{
}
[Constructable]
public AvatarMarkOfGodsScroll( int amount ) : base( typeof( AvatarMarkOfGodsSpell ), 0xE39, amount )
{
Name = "Mark of Gods";
Hue = 1174;
}
public AvatarMarkOfGodsScroll( 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();
}
}
}

View File

@@ -0,0 +1,83 @@
using System;
using Server;
using Server.Targeting;
using Server.Network;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarHeavenlyLightSpell : AvatarSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Heavenly Light", "He Ven In Lor",
// SpellCircle.First,
236,
9031,
Reagent.BatWing,
Reagent.NoxCrystal
);
public override SpellCircle Circle
{
get { return SpellCircle.First; }
}
public override double RequiredSkill{ get{ return 20; } }
public override int RequiredMana{ get{ return 10; } }
public override int RequiredTithing{ get{ return 10; } }
public AvatarHeavenlyLightSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new AvatarHeavenlyLightSpellTarget( this );
}
private class AvatarHeavenlyLightSpellTarget : Target
{
private Spell m_Spell;
public AvatarHeavenlyLightSpellTarget( Spell spell ) : base( 10, false, TargetFlags.None )
{
m_Spell = spell;
}
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Mobile && m_Spell.CheckSequence() )
{
Mobile targ = (Mobile)targeted;
SpellHelper.Turn( m_Spell.Caster, targ );
if ( targ.BeginAction( typeof( LightCycle ) ) )
{
new LightCycle.NightSightTimer( targ ).Start();
int level = (int)Math.Abs( LightCycle.DungeonLevel * ( m_Spell.Caster.Skills[SkillName.Necromancy].Base / 100 ) );
if ( level > 25 || level < 0 )
level = 25;
targ.LightLevel = level;
targ.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
targ.PlaySound( 0x1E3 );
}
else
{
from.SendMessage( "{0} already have heavenly light.", from == targ ? "You" : "They" );
}
}
m_Spell.FinishSequence();
}
protected override void OnTargetFinish( Mobile from )
{
m_Spell.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,293 @@
using System;
using Server.Network;
using Server.Multis;
using Server.Items;
using Server.Targeting;
using Server.Misc;
using Server.Regions;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarHeavensGateSpell : AvatarSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Heaven's Gate", "Hevs Grav Ohm Sepa",
//SpellCircle.Fifth,
-1,
9002
);
public override SpellCircle Circle
{
get { return SpellCircle.Fifth; }
}
public override double RequiredSkill{ get{ return 80.0; } }
public override int RequiredMana{ get{ return 40; } }
public override int RequiredTithing{ get{ return 30; } }
private RunebookEntry m_Entry;
public AvatarHeavensGateSpell( Mobile caster, Item scroll ) : this( caster, scroll, null )
{
}
public AvatarHeavensGateSpell( Mobile caster, Item scroll, RunebookEntry entry ) : base( caster, scroll, m_Info )
{
m_Entry = entry;
}
public override void OnCast()
{
if ( m_Entry == null )
Caster.Target = new InternalTarget( this );
else
Effect( m_Entry.Location, m_Entry.Map, true );
}
public override bool CheckCast()
{
if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
return SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom );
}
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( CheckSequence() )
{
Caster.SendMessage( "The clouds open a magical gate to another place" ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x482 );
int gravx;
int gravy;
int gravz;
InternalItem firstGatea = new InternalItem( loc, map ); //Top Middle item
gravx=Caster.X-1;
gravy=Caster.Y-1;
gravz=Caster.Z;
firstGatea.ItemID=14138;
firstGatea.Hue = 1174;
Point3D gravxyz = new Point3D(gravx,gravy,gravz);
firstGatea.MoveToWorld( gravxyz, Caster.Map );
InternalItem firstGateb = new InternalItem( loc, map );
gravx=Caster.X;
gravy=Caster.Y;
firstGateb.ItemID=6899; //Moongate
firstGateb.Hue=1153;
gravz=Caster.Z;
Point3D gravxyza = new Point3D(gravx,gravy,gravz);
firstGateb.MoveToWorld( gravxyza, Caster.Map );
InternalItem firstGatec = new InternalItem( loc, map );
gravx=Caster.X-1;
firstGatec.ItemID=14138;
firstGatec.Hue = 1174;
gravy=Caster.Y+1;
gravz=Caster.Z;
Point3D gravxyzb = new Point3D(gravx,gravy,gravz);
firstGatec.MoveToWorld( gravxyzb, Caster.Map );
InternalItem firstGateg = new InternalItem( loc, map );
gravx=Caster.X+1;
firstGateg.ItemID=14138;
firstGateg.Hue = 1174;
gravy=Caster.Y-1;
gravz=Caster.Z;
Point3D gravxyzf = new Point3D(gravx,gravy,gravz);
firstGateg.MoveToWorld( gravxyzf, Caster.Map );
InternalItem firstGatee = new InternalItem( loc, map );
gravx=Caster.X+1;
firstGatee.ItemID=14170;
firstGatee.Hue = 1174;
gravy=Caster.Y+1;
gravz=Caster.Z;
Point3D gravxyzd = new Point3D(gravx,gravy,gravz);
firstGatee.MoveToWorld( gravxyzd, Caster.Map );
//Effects.PlaySound( loc, map, 0x482 );
Caster.PlaySound( 0x212 );
Caster.PlaySound( 0x206 );
InternalItem secondGatea = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X-1;
gravy=loc.Y-1;
gravz=loc.Z;
secondGatea.ItemID=14138;
secondGatea.Hue = 1151;
Point3D gravaxyz = new Point3D(gravx,gravy,gravz);
secondGatea.MoveToWorld( gravaxyz, map);
InternalItem secondGateb = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X;
gravy=loc.Y;
secondGateb.ItemID=6899; //Moongate
secondGateb.Hue = 1153;
gravz=loc.Z;
Point3D gravaxyza = new Point3D(gravx,gravy,gravz);
secondGateb.MoveToWorld( gravaxyza, map);
InternalItem secondGatec = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X-1;
secondGatec.ItemID=14138;
secondGatec.Hue = 1151;
gravy=loc.Y+1;
gravz=loc.Z;
Point3D gravaxyzb = new Point3D(gravx,gravy,gravz);
secondGatec.MoveToWorld( gravaxyzb, map);
InternalItem secondGatee = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X+1;
gravy=loc.Y+1;
gravz=loc.Z;
secondGatee.ItemID=14138;
secondGatee.Hue = 1151;
Point3D gravaxyzd = new Point3D(gravx,gravy,gravz);
secondGatee.MoveToWorld( gravaxyzd, map);
InternalItem secondGateg = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X+1;
secondGateg.ItemID=14138;
secondGateg.Hue = 1151;
gravy=loc.Y-1;
gravz=loc.Z;
Point3D gravaxyzf = new Point3D(gravx,gravy,gravz);
secondGateg.MoveToWorld( gravaxyzf, map);
}
FinishSequence();
}
[DispellableField]
private class InternalItem : Moongate
{
public override bool ShowFeluccaWarning{ get{ return Core.AOS; } }
public InternalItem( Point3D target, Map map ) : base( target, map )
{
Map = map;
if ( ShowFeluccaWarning && map == Map.Felucca )
ItemID = 0xDDA;
Dispellable = true;
InternalTimer t = new InternalTimer( this );
t.Start();
}
public InternalItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
Delete();
}
private class InternalTimer : Timer
{
private Item m_Item;
public InternalTimer( Item item ) : base( TimeSpan.FromSeconds( 30.0 ) )
{
m_Item = item;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
private class InternalTarget : Target
{
private AvatarHeavensGateSpell m_Owner;
public InternalTarget( AvatarHeavensGateSpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item.
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is RecallRune )
{
RecallRune rune = (RecallRune)o;
if ( rune.Marked )
m_Owner.Effect( rune.Target, rune.TargetMap, true );
else
from.SendLocalizedMessage( 501803 ); // That rune is not yet marked.
}
else if ( o is Runebook )
{
RunebookEntry e = ((Runebook)o).Default;
if ( e != null )
m_Owner.Effect( e.Location, e.Map, true );
else
from.SendLocalizedMessage( 502354 ); // Target is not marked.
}
else
{
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object.
}
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}

View File

@@ -0,0 +1,100 @@
using System;
using Server.Items;
using Server.Targeting;
using Server.Network;
using Server.Regions;
using Server.Mobiles;
using Server.Spells;
namespace Server.ACC.CSS.Systems.Avatar
{
public class AvatarMarkOfGodsSpell : AvatarSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Mark Of Gods", "Britemus Por Ylemis",
//SpellCircle.Fifth,
-1,
9002
);
public override SpellCircle Circle
{
get { return SpellCircle.Fifth; }
}
public override double RequiredSkill{ get{ return 20; } }
public override int RequiredMana{ get{ return 10; } }
public override int RequiredTithing{ get{ return 10; } }
public AvatarMarkOfGodsSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public override bool CheckCast()
{
if ( !base.CheckCast() )
return false;
return SpellHelper.CheckTravel( Caster, TravelCheckType.Mark );
}
public void Target( RecallRune rune )
{
if ( !Caster.CanSee( rune ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
{
}
else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( !rune.IsChildOf( Caster.Backpack ) )
{
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
}
else if ( CheckSequence() )
{
rune.Mark( Caster );
Caster.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
Caster.PlaySound( 0x1FA );
}
FinishSequence();
}
private class InternalTarget : Target
{
private AvatarMarkOfGodsSpell m_Owner;
public InternalTarget( AvatarMarkOfGodsSpell owner ) : base( 12, false, TargetFlags.None )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is RecallRune )
{
m_Owner.Target( (RecallRune) o );
}
else
{
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501797, from.Name, "" ) ); // I cannot mark that object.
}
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}