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,38 @@
using System;
using Server.Engines.PartySystem;
namespace Server.ContextMenus
{
public class AddToPartyEntry : ContextMenuEntry
{
private readonly Mobile m_From;
private readonly Mobile m_Target;
public AddToPartyEntry(Mobile from, Mobile target)
: base(0197, 12)
{
this.m_From = from;
this.m_Target = target;
}
public override void OnClick()
{
Party p = Party.Get(this.m_From);
Party mp = Party.Get(this.m_Target);
if (this.m_From == this.m_Target)
this.m_From.SendLocalizedMessage(1005439); // You cannot add yourself to a party.
else if (p != null && p.Leader != this.m_From)
this.m_From.SendLocalizedMessage(1005453); // You may only add members to the party if you are the leader.
else if (p != null && (p.Members.Count + p.Candidates.Count) >= Party.Capacity)
this.m_From.SendLocalizedMessage(1008095); // You may only have 10 in your party (this includes candidates).
else if (!this.m_Target.Player)
this.m_From.SendLocalizedMessage(1005444); // The creature ignores your offer.
else if (mp != null && mp == p)
this.m_From.SendLocalizedMessage(1005440); // This person is already in your party!
else if (mp != null)
this.m_From.SendLocalizedMessage(1005441); // This person is already in a party!
else
Party.Invite(this.m_From, this.m_Target);
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using Server.Items;
using Server.Targeting;
namespace Server.ContextMenus
{
public class AddToSpellbookEntry : ContextMenuEntry
{
public AddToSpellbookEntry()
: base(6144, 3)
{
}
public override void OnClick()
{
if (this.Owner.From.CheckAlive() && this.Owner.Target is SpellScroll)
this.Owner.From.Target = new InternalTarget((SpellScroll)this.Owner.Target);
}
private class InternalTarget : Target
{
private readonly SpellScroll m_Scroll;
public InternalTarget(SpellScroll scroll)
: base(3, false, TargetFlags.None)
{
this.m_Scroll = scroll;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Spellbook)
{
if (from.CheckAlive() && !this.m_Scroll.Deleted && this.m_Scroll.Movable && this.m_Scroll.Amount >= 1 && this.m_Scroll.CheckItemUse(from))
{
Spellbook book = (Spellbook)targeted;
SpellbookType type = Spellbook.GetTypeForSpell(this.m_Scroll.SpellID);
if (type != book.SpellbookType)
{
}
else if (book.HasSpell(this.m_Scroll.SpellID))
{
from.SendLocalizedMessage(500179); // That spell is already present in that spellbook.
}
else
{
int val = this.m_Scroll.SpellID - book.BookOffset;
if (val >= 0 && val < book.BookCount)
{
book.Content |= (ulong)1 << val;
this.m_Scroll.Consume();
from.Send(new Network.PlaySound(0x249, book.GetWorldLocation()));
}
}
}
}
}
}
}
}

View File

@@ -0,0 +1,23 @@
using System;
using Server.Items;
namespace Server.ContextMenus
{
public class EatEntry : ContextMenuEntry
{
private readonly Mobile m_From;
private readonly Food m_Food;
public EatEntry(Mobile from, Food food)
: base(6135, 1)
{
m_From = from;
m_Food = food;
}
public override void OnClick()
{
m_Food.TryEat(m_From);
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using Server.Multis;
namespace Server.ContextMenus
{
public class EjectPlayerEntry : ContextMenuEntry
{
private readonly Mobile m_From;
private readonly Mobile m_Target;
private readonly BaseHouse m_TargetHouse;
public EjectPlayerEntry(Mobile from, Mobile target)
: base(6206, 12)
{
this.m_From = from;
this.m_Target = target;
this.m_TargetHouse = BaseHouse.FindHouseAt(this.m_Target);
}
public override void OnClick()
{
if (!this.m_From.Alive || this.m_TargetHouse.Deleted || !this.m_TargetHouse.IsFriend(this.m_From))
return;
if (this.m_Target is Mobile)
{
this.m_TargetHouse.Kick(this.m_From, (Mobile)this.m_Target);
}
}
}
}

View File

@@ -0,0 +1,39 @@
using System;
using Server.Gumps;
using Server.Mobiles;
namespace Server.ContextMenus
{
public class OpenBankEntry : ContextMenuEntry
{
private readonly Mobile m_Banker;
public OpenBankEntry(Mobile banker)
: base(6105, 12)
{
m_Banker = banker;
}
public override void OnClick()
{
if (!Owner.From.CheckAlive())
return;
if (Owner.From.Criminal)
{
m_Banker.Say(500378); // Thou art a criminal and cannot access thy bank box.
}
else
{
Owner.From.BankBox.Open();
if (Core.TOL && Owner.From is PlayerMobile)
{
Owner.From.CloseGump(typeof (BankerGump));
Owner.From.SendGump(new BankerGump((PlayerMobile)Owner.From));
}
}
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using Server.Items;
namespace Server.ContextMenus
{
public class SimpleContextMenuEntry : ContextMenuEntry
{
public Mobile From { get; private set; }
public Action<Mobile> Callback { get; set; }
public SimpleContextMenuEntry( Mobile from, int localization, Action<Mobile> callback = null, int range = -1, bool enabled = true ) : base( localization, range )
{
From = from;
Callback = callback;
Enabled = enabled;
}
public override void OnClick()
{
if (Callback != null)
Callback(From);
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using Server.Mobiles;
namespace Server.ContextMenus
{
public class TeachEntry : ContextMenuEntry
{
private readonly SkillName m_Skill;
private readonly BaseCreature m_Mobile;
private readonly Mobile m_From;
public TeachEntry(SkillName skill, BaseCreature m, Mobile from, bool enabled)
: base(6000 + (int)skill)
{
this.m_Skill = skill;
this.m_Mobile = m;
this.m_From = from;
if (!enabled)
this.Flags |= Network.CMEFlags.Disabled;
}
public override void OnClick()
{
if (!this.m_From.CheckAlive())
return;
this.m_Mobile.Teach(this.m_Skill, this.m_From, 0, false);
}
}
}