Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,720 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Accounting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public enum StatueType
|
||||
{
|
||||
Marble,
|
||||
Jade,
|
||||
Bronze
|
||||
}
|
||||
|
||||
public enum StatuePose
|
||||
{
|
||||
Ready,
|
||||
Casting,
|
||||
Salute,
|
||||
AllPraiseMe,
|
||||
Fighting,
|
||||
HandsOnHips
|
||||
}
|
||||
|
||||
public enum StatueMaterial
|
||||
{
|
||||
Antique,
|
||||
Dark,
|
||||
Medium,
|
||||
Light
|
||||
}
|
||||
|
||||
public class CharacterStatue : Mobile, IRewardItem
|
||||
{
|
||||
private StatueType m_Type;
|
||||
private StatuePose m_Pose;
|
||||
private StatueMaterial m_Material;
|
||||
private Mobile m_SculptedBy;
|
||||
private DateTime m_SculptedOn;
|
||||
private CharacterStatuePlinth m_Plinth;
|
||||
private bool m_IsRewardItem;
|
||||
private int m_Animation;
|
||||
private int m_Frames;
|
||||
public CharacterStatue(Mobile from, StatueType type)
|
||||
: base()
|
||||
{
|
||||
this.m_Type = type;
|
||||
this.m_Pose = StatuePose.Ready;
|
||||
this.m_Material = StatueMaterial.Antique;
|
||||
|
||||
this.Direction = Direction.South;
|
||||
this.AccessLevel = AccessLevel.Counselor;
|
||||
this.Hits = this.HitsMax;
|
||||
this.Blessed = true;
|
||||
this.Frozen = true;
|
||||
|
||||
this.CloneBody(from);
|
||||
this.CloneClothes(from);
|
||||
this.InvalidateHues();
|
||||
}
|
||||
|
||||
public CharacterStatue(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public StatueType StatueType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Type = value;
|
||||
this.InvalidateHues();
|
||||
this.InvalidatePose();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public StatuePose Pose
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Pose;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Pose = value;
|
||||
this.InvalidatePose();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public StatueMaterial Material
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Material;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Material = value;
|
||||
this.InvalidateHues();
|
||||
this.InvalidatePose();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile SculptedBy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_SculptedBy;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_SculptedBy = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime SculptedOn
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_SculptedOn;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_SculptedOn = value;
|
||||
}
|
||||
}
|
||||
public CharacterStatuePlinth Plinth
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Plinth;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Plinth = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
this.DisplayPaperdollTo(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_SculptedBy != null)
|
||||
{
|
||||
if (this.m_SculptedBy.ShowFameTitle && (this.m_SculptedBy.Player || this.m_SculptedBy.Body.IsHuman) && this.m_SculptedBy.Fame >= 10000)
|
||||
list.Add(1076202, String.Format("{0} {1}", this.m_SculptedBy.Female ? "Lady" : "Lord", this.m_SculptedBy.Name)); // Sculpted by ~1_Name~
|
||||
else
|
||||
list.Add(1076202, this.m_SculptedBy.Name); // Sculpted by ~1_Name~
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive && this.m_SculptedBy != null)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if ((house != null && house.IsCoOwner(from)) || (int)from.AccessLevel > (int)AccessLevel.Counselor)
|
||||
list.Add(new DemolishEntry(this));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (this.m_Plinth != null && !this.m_Plinth.Deleted)
|
||||
this.m_Plinth.Delete();
|
||||
}
|
||||
|
||||
public override bool CanBeRenamedBy(Mobile from)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanBeDamaged()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void OnRequestedAnimation(Mobile from)
|
||||
{
|
||||
from.Send(new UpdateStatueAnimation(this, 1, this.m_Animation, this.m_Frames));
|
||||
}
|
||||
|
||||
public override void OnAosSingleClick(Mobile from)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.Write((int)this.m_Type);
|
||||
writer.Write((int)this.m_Pose);
|
||||
writer.Write((int)this.m_Material);
|
||||
|
||||
writer.Write((Mobile)this.m_SculptedBy);
|
||||
writer.Write((DateTime)this.m_SculptedOn);
|
||||
|
||||
writer.Write((Item)this.m_Plinth);
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Type = (StatueType)reader.ReadInt();
|
||||
this.m_Pose = (StatuePose)reader.ReadInt();
|
||||
this.m_Material = (StatueMaterial)reader.ReadInt();
|
||||
|
||||
this.m_SculptedBy = reader.ReadMobile();
|
||||
this.m_SculptedOn = reader.ReadDateTime();
|
||||
|
||||
this.m_Plinth = reader.ReadItem() as CharacterStatuePlinth;
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
|
||||
this.InvalidatePose();
|
||||
|
||||
this.Frozen = true;
|
||||
|
||||
if (this.m_SculptedBy == null || this.Map == Map.Internal) // Remove preview statues
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));
|
||||
}
|
||||
}
|
||||
|
||||
public void Sculpt(Mobile by)
|
||||
{
|
||||
this.m_SculptedBy = by;
|
||||
this.m_SculptedOn = DateTime.UtcNow;
|
||||
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
|
||||
public bool Demolish(Mobile by)
|
||||
{
|
||||
CharacterStatueDeed deed = new CharacterStatueDeed(null);
|
||||
|
||||
if (by.PlaceInBackpack(deed))
|
||||
{
|
||||
this.Delete();
|
||||
|
||||
deed.Statue = this;
|
||||
deed.StatueType = this.m_Type;
|
||||
deed.IsRewardItem = this.m_IsRewardItem;
|
||||
|
||||
if (this.m_Plinth != null)
|
||||
this.m_Plinth.Delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
by.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
|
||||
deed.Delete();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Restore(CharacterStatue from)
|
||||
{
|
||||
this.m_Material = from.Material;
|
||||
this.m_Pose = from.Pose;
|
||||
|
||||
this.Direction = from.Direction;
|
||||
|
||||
this.CloneBody(from);
|
||||
this.CloneClothes(from);
|
||||
|
||||
this.InvalidateHues();
|
||||
this.InvalidatePose();
|
||||
}
|
||||
|
||||
public void CloneBody(Mobile from)
|
||||
{
|
||||
this.Name = from.Name;
|
||||
this.BodyValue = from.BodyValue;
|
||||
this.Female = from.Female;
|
||||
this.HairItemID = from.HairItemID;
|
||||
this.FacialHairItemID = from.FacialHairItemID;
|
||||
}
|
||||
|
||||
public void CloneClothes(Mobile from)
|
||||
{
|
||||
for (int i = this.Items.Count - 1; i >= 0; i --)
|
||||
this.Items[i].Delete();
|
||||
|
||||
for (int i = from.Items.Count - 1; i >= 0; i --)
|
||||
{
|
||||
Item item = from.Items[i];
|
||||
|
||||
if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
|
||||
this.AddItem(this.CloneItem(item));
|
||||
}
|
||||
}
|
||||
|
||||
public Item CloneItem(Item item)
|
||||
{
|
||||
Item cloned = new Item(item.ItemID);
|
||||
cloned.Layer = item.Layer;
|
||||
cloned.Name = item.Name;
|
||||
cloned.Hue = item.Hue;
|
||||
cloned.Weight = item.Weight;
|
||||
cloned.Movable = false;
|
||||
|
||||
return cloned;
|
||||
}
|
||||
|
||||
public void InvalidateHues()
|
||||
{
|
||||
this.Hue = 0xB8F + (int)this.m_Type * 4 + (int)this.m_Material;
|
||||
|
||||
this.HairHue = this.Hue;
|
||||
|
||||
if (this.FacialHairItemID > 0)
|
||||
this.FacialHairHue = this.Hue;
|
||||
|
||||
for (int i = this.Items.Count - 1; i >= 0; i --)
|
||||
this.Items[i].Hue = this.Hue;
|
||||
|
||||
if (this.m_Plinth != null)
|
||||
this.m_Plinth.InvalidateHue();
|
||||
}
|
||||
|
||||
public void InvalidatePose()
|
||||
{
|
||||
switch ( this.m_Pose )
|
||||
{
|
||||
case StatuePose.Ready:
|
||||
this.m_Animation = 4;
|
||||
this.m_Frames = 0;
|
||||
break;
|
||||
case StatuePose.Casting:
|
||||
this.m_Animation = 16;
|
||||
this.m_Frames = 2;
|
||||
break;
|
||||
case StatuePose.Salute:
|
||||
this.m_Animation = 33;
|
||||
this.m_Frames = 1;
|
||||
break;
|
||||
case StatuePose.AllPraiseMe:
|
||||
this.m_Animation = 17;
|
||||
this.m_Frames = 4;
|
||||
break;
|
||||
case StatuePose.Fighting:
|
||||
this.m_Animation = 31;
|
||||
this.m_Frames = 5;
|
||||
break;
|
||||
case StatuePose.HandsOnHips:
|
||||
this.m_Animation = 6;
|
||||
this.m_Frames = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.Map != null)
|
||||
{
|
||||
this.ProcessDelta();
|
||||
|
||||
Packet p = null;
|
||||
|
||||
IPooledEnumerable eable = this.Map.GetClientsInRange(this.Location);
|
||||
|
||||
foreach (NetState state in eable)
|
||||
{
|
||||
state.Mobile.ProcessDelta();
|
||||
|
||||
if (p == null)
|
||||
p = Packet.Acquire(new UpdateStatueAnimation(this, 1, this.m_Animation, this.m_Frames));
|
||||
|
||||
state.Send(p);
|
||||
}
|
||||
|
||||
Packet.Release(p);
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMapChange(Map oldMap)
|
||||
{
|
||||
this.InvalidatePose();
|
||||
|
||||
if (this.m_Plinth != null)
|
||||
this.m_Plinth.Map = this.Map;
|
||||
}
|
||||
|
||||
protected override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
this.InvalidatePose();
|
||||
|
||||
if (this.m_Plinth != null)
|
||||
this.m_Plinth.Location = new Point3D(this.X, this.Y, this.Z - 5);
|
||||
}
|
||||
|
||||
private class DemolishEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly CharacterStatue m_Statue;
|
||||
public DemolishEntry(CharacterStatue statue)
|
||||
: base(6275, 2)
|
||||
{
|
||||
this.m_Statue = statue;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (this.m_Statue.Deleted)
|
||||
return;
|
||||
|
||||
this.m_Statue.Demolish(this.Owner.From);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CharacterStatueDeed : Item, IRewardItem
|
||||
{
|
||||
private CharacterStatue m_Statue;
|
||||
private StatueType m_Type;
|
||||
private bool m_IsRewardItem;
|
||||
public CharacterStatueDeed(CharacterStatue statue)
|
||||
: base(0x14F0)
|
||||
{
|
||||
this.m_Statue = statue;
|
||||
|
||||
if (statue != null)
|
||||
{
|
||||
this.m_Type = statue.StatueType;
|
||||
this.m_IsRewardItem = statue.IsRewardItem;
|
||||
}
|
||||
|
||||
this.LootType = LootType.Blessed;
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public CharacterStatueDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
StatueType t = this.m_Type;
|
||||
|
||||
if (this.m_Statue != null)
|
||||
{
|
||||
t = this.m_Statue.StatueType;
|
||||
}
|
||||
|
||||
switch ( t )
|
||||
{
|
||||
case StatueType.Marble:
|
||||
return 1076189;
|
||||
case StatueType.Jade:
|
||||
return 1076188;
|
||||
case StatueType.Bronze:
|
||||
return 1076190;
|
||||
default:
|
||||
return 1076173;
|
||||
}
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CharacterStatue Statue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Statue;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Statue = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public StatueType StatueType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.m_Statue != null)
|
||||
return this.m_Statue.StatueType;
|
||||
|
||||
return this.m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Type = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1076222); // 6th Year Veteran Reward
|
||||
|
||||
if (this.m_Statue != null)
|
||||
list.Add(1076231, this.m_Statue.Name); // Statue of ~1_Name~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
Account acct = from.Account as Account;
|
||||
|
||||
if (acct != null && from.IsPlayer())
|
||||
{
|
||||
TimeSpan time = TimeSpan.FromDays(RewardSystem.RewardInterval.TotalDays * 6) - (DateTime.UtcNow - acct.Created);
|
||||
|
||||
if (time > TimeSpan.Zero)
|
||||
{
|
||||
from.SendLocalizedMessage(1008126, true, Math.Ceiling(time.TotalDays / RewardSystem.RewardInterval.TotalDays).ToString()); // Your account is not old enough to use this item. Months until you can use this item :
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
if (!from.IsBodyMod)
|
||||
{
|
||||
from.SendLocalizedMessage(1076194); // Select a place where you would like to put your statue.
|
||||
from.Target = new CharacterStatueTarget(this, this.StatueType);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
if (this.m_Statue != null)
|
||||
this.m_Statue.Delete();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)1); // version
|
||||
|
||||
writer.Write((int)this.m_Type);
|
||||
|
||||
writer.Write((Mobile)this.m_Statue);
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if (version >= 1)
|
||||
{
|
||||
this.m_Type = (StatueType)reader.ReadInt();
|
||||
}
|
||||
|
||||
this.m_Statue = reader.ReadMobile() as CharacterStatue;
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public class CharacterStatueTarget : Target
|
||||
{
|
||||
private readonly Item m_Maker;
|
||||
private readonly StatueType m_Type;
|
||||
public CharacterStatueTarget(Item maker, StatueType type)
|
||||
: base(-1, true, TargetFlags.None)
|
||||
{
|
||||
this.m_Maker = maker;
|
||||
this.m_Type = type;
|
||||
}
|
||||
|
||||
public static AddonFitResult CouldFit(Point3D p, Map map, Mobile from, ref BaseHouse house)
|
||||
{
|
||||
if (!map.CanFit(p.X, p.Y, p.Z, 20, true, true, true))
|
||||
return AddonFitResult.Blocked;
|
||||
else if (!BaseAddon.CheckHouse(from, p, map, 20, ref house))
|
||||
return AddonFitResult.NotInHouse;
|
||||
else
|
||||
return CheckDoors(p, 20, house);
|
||||
}
|
||||
|
||||
public static AddonFitResult CheckDoors(Point3D p, int height, BaseHouse house)
|
||||
{
|
||||
List<Item> doors = house.Doors;
|
||||
|
||||
for (int i = 0; i < doors.Count; i ++)
|
||||
{
|
||||
BaseDoor door = doors[i] as BaseDoor;
|
||||
|
||||
Point3D doorLoc = door.GetWorldLocation();
|
||||
int doorHeight = door.ItemData.CalcHeight;
|
||||
|
||||
if (Utility.InRange(doorLoc, p, 1) && (p.Z == doorLoc.Z || ((p.Z + height) > doorLoc.Z && (doorLoc.Z + doorHeight) > p.Z)))
|
||||
return AddonFitResult.DoorTooClose;
|
||||
}
|
||||
|
||||
return AddonFitResult.Valid;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
Map map = from.Map;
|
||||
|
||||
if (p == null || map == null || this.m_Maker == null || this.m_Maker.Deleted)
|
||||
return;
|
||||
|
||||
if (this.m_Maker.IsChildOf(from.Backpack))
|
||||
{
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
BaseHouse house = null;
|
||||
Point3D loc = new Point3D(p);
|
||||
|
||||
if (targeted is Item && !((Item)targeted).IsLockedDown && !((Item)targeted).IsSecure && !(targeted is AddonComponent))
|
||||
{
|
||||
from.SendLocalizedMessage(1076191); // Statues can only be placed in houses.
|
||||
return;
|
||||
}
|
||||
else if (from.IsBodyMod)
|
||||
{
|
||||
from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
|
||||
return;
|
||||
}
|
||||
|
||||
AddonFitResult result = CouldFit(loc, map, from, ref house);
|
||||
|
||||
if (result == AddonFitResult.Valid)
|
||||
{
|
||||
CharacterStatue statue = new CharacterStatue(from, this.m_Type);
|
||||
CharacterStatuePlinth plinth = new CharacterStatuePlinth(statue);
|
||||
|
||||
house.Addons[plinth] = from;
|
||||
|
||||
if (this.m_Maker is IRewardItem)
|
||||
statue.IsRewardItem = ((IRewardItem)this.m_Maker).IsRewardItem;
|
||||
|
||||
statue.Plinth = plinth;
|
||||
plinth.MoveToWorld(loc, map);
|
||||
statue.InvalidatePose();
|
||||
|
||||
/*
|
||||
* TODO: Previously the maker wasn't deleted until after statue
|
||||
* customization, leading to redeeding issues. Exact OSI behavior
|
||||
* needs looking into.
|
||||
*/
|
||||
this.m_Maker.Delete();
|
||||
statue.Sculpt(from);
|
||||
|
||||
from.CloseGump(typeof(CharacterStatueGump));
|
||||
from.SendGump(new CharacterStatueGump(this.m_Maker, statue, from));
|
||||
}
|
||||
else if (result == AddonFitResult.Blocked)
|
||||
from.SendLocalizedMessage(500269); // You cannot build that there.
|
||||
else if (result == AddonFitResult.NotInHouse)
|
||||
from.SendLocalizedMessage(1076192); // Statues can only be placed in houses where you are the owner or co-owner.
|
||||
else if (result == AddonFitResult.DoorTooClose)
|
||||
from.SendLocalizedMessage(500271); // You cannot build near the door.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
using System;
|
||||
using Server.Engines.VeteranRewards;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CharacterStatueMaker : Item, IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
private StatueType m_Type;
|
||||
|
||||
[Constructable]
|
||||
public CharacterStatueMaker(StatueType type)
|
||||
: base(0x32F0)
|
||||
{
|
||||
this.m_Type = type;
|
||||
|
||||
this.InvalidateHue();
|
||||
|
||||
this.LootType = LootType.Blessed;
|
||||
this.Weight = 5.0;
|
||||
}
|
||||
|
||||
public CharacterStatueMaker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076173;
|
||||
}
|
||||
}// Character Statue Maker
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public StatueType StatueType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Type = value;
|
||||
this.InvalidateHue();
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, new object[] { this.m_Type }))
|
||||
return;
|
||||
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
if (!from.IsBodyMod)
|
||||
{
|
||||
from.SendLocalizedMessage(1076194); // Select a place where you would like to put your statue.
|
||||
from.Target = new CharacterStatueTarget(this, this.m_Type);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_IsRewardItem)
|
||||
list.Add(1076222); // 6th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
writer.Write((int)this.m_Type);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
this.m_Type = (StatueType)reader.ReadInt();
|
||||
}
|
||||
|
||||
public void InvalidateHue()
|
||||
{
|
||||
this.Hue = 0xB8F + (int)this.m_Type * 4;
|
||||
}
|
||||
}
|
||||
|
||||
public class MarbleStatueMaker : CharacterStatueMaker
|
||||
{
|
||||
[Constructable]
|
||||
public MarbleStatueMaker()
|
||||
: base(StatueType.Marble)
|
||||
{
|
||||
}
|
||||
|
||||
public MarbleStatueMaker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class JadeStatueMaker : CharacterStatueMaker
|
||||
{
|
||||
[Constructable]
|
||||
public JadeStatueMaker()
|
||||
: base(StatueType.Jade)
|
||||
{
|
||||
}
|
||||
|
||||
public JadeStatueMaker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BronzeStatueMaker : CharacterStatueMaker
|
||||
{
|
||||
[Constructable]
|
||||
public BronzeStatueMaker()
|
||||
: base(StatueType.Bronze)
|
||||
{
|
||||
}
|
||||
|
||||
public BronzeStatueMaker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CharacterStatuePlinth : Static, IAddon
|
||||
{
|
||||
private CharacterStatue m_Statue;
|
||||
public CharacterStatuePlinth(CharacterStatue statue)
|
||||
: base(0x32F2)
|
||||
{
|
||||
this.m_Statue = statue;
|
||||
|
||||
this.InvalidateHue();
|
||||
}
|
||||
|
||||
public CharacterStatuePlinth(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public Item Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CharacterStatueDeed(this.m_Statue);
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1076201;
|
||||
}
|
||||
}// Character Statue
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (this.m_Statue != null && !this.m_Statue.Deleted)
|
||||
this.m_Statue.Delete();
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (this.m_Statue != null)
|
||||
this.m_Statue.Map = this.Map;
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (this.m_Statue != null)
|
||||
this.m_Statue.Location = new Point3D(this.X, this.Y, this.Z + 5);
|
||||
}
|
||||
|
||||
void IChopable.OnChop(Mobile user)
|
||||
{
|
||||
OnDoubleClick(user);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_Statue != null)
|
||||
from.SendGump(new CharacterPlinthGump(this.m_Statue));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.Write((Mobile)this.m_Statue);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Statue = reader.ReadMobile() as CharacterStatue;
|
||||
|
||||
if (this.m_Statue == null || this.m_Statue.SculptedBy == null || this.Map == Map.Internal)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));
|
||||
}
|
||||
}
|
||||
|
||||
public void InvalidateHue()
|
||||
{
|
||||
if (this.m_Statue != null)
|
||||
this.Hue = 0xB8F + (int)this.m_Statue.StatueType * 4 + (int)this.m_Statue.Material;
|
||||
}
|
||||
|
||||
public virtual bool CouldFit(IPoint3D p, Map map)
|
||||
{
|
||||
Point3D point = new Point3D(p.X, p.Y, p.Z);
|
||||
|
||||
if (map == null || !map.CanFit(point, 20))
|
||||
return false;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(point, map, 20);
|
||||
|
||||
if (house == null)
|
||||
return false;
|
||||
|
||||
AddonFitResult result = CharacterStatueTarget.CheckDoors(point, 20, house);
|
||||
|
||||
if (result == AddonFitResult.Valid)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private class CharacterPlinthGump : Gump
|
||||
{
|
||||
public CharacterPlinthGump(CharacterStatue statue)
|
||||
: base(60, 30)
|
||||
{
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
this.Resizable = false;
|
||||
|
||||
this.AddPage(0);
|
||||
this.AddImage(0, 0, 0x24F4);
|
||||
this.AddHtml(55, 50, 150, 20, statue.Name, false, false);
|
||||
this.AddHtml(55, 75, 150, 20, statue.SculptedOn.ToString(), false, false);
|
||||
this.AddHtmlLocalized(55, 100, 150, 20, this.GetTypeNumber(statue.StatueType), 0, false, false);
|
||||
}
|
||||
|
||||
public int GetTypeNumber(StatueType type)
|
||||
{
|
||||
switch ( type )
|
||||
{
|
||||
case StatueType.Marble:
|
||||
return 1076181;
|
||||
case StatueType.Jade:
|
||||
return 1076180;
|
||||
case StatueType.Bronze:
|
||||
return 1076230;
|
||||
default:
|
||||
return 1076181;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class CharacterStatueGump : Gump
|
||||
{
|
||||
private readonly Item m_Maker;
|
||||
private readonly CharacterStatue m_Statue;
|
||||
private readonly Mobile m_Owner;
|
||||
public CharacterStatueGump(Item maker, CharacterStatue statue, Mobile owner)
|
||||
: base(60, 36)
|
||||
{
|
||||
this.m_Maker = maker;
|
||||
this.m_Statue = statue;
|
||||
this.m_Owner = owner;
|
||||
|
||||
if (this.m_Statue == null)
|
||||
return;
|
||||
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
this.Resizable = false;
|
||||
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(0, 0, 327, 324, 0x13BE);
|
||||
this.AddImageTiled(10, 10, 307, 20, 0xA40);
|
||||
this.AddImageTiled(10, 40, 307, 244, 0xA40);
|
||||
this.AddImageTiled(10, 294, 307, 20, 0xA40);
|
||||
this.AddAlphaRegion(10, 10, 307, 304);
|
||||
this.AddHtmlLocalized(14, 12, 327, 20, 1076156, 0x7FFF, false, false); // Character Statue Maker
|
||||
|
||||
// pose
|
||||
this.AddHtmlLocalized(133, 41, 120, 20, 1076168, 0x7FFF, false, false); // Choose Pose
|
||||
this.AddHtmlLocalized(133, 61, 120, 20, 1076208 + (int)this.m_Statue.Pose, 0x77E, false, false);
|
||||
this.AddButton(163, 81, 0xFA5, 0xFA7, (int)Buttons.PoseNext, GumpButtonType.Reply, 0);
|
||||
this.AddButton(133, 81, 0xFAE, 0xFB0, (int)Buttons.PosePrev, GumpButtonType.Reply, 0);
|
||||
|
||||
// direction
|
||||
this.AddHtmlLocalized(133, 126, 120, 20, 1076170, 0x7FFF, false, false); // Choose Direction
|
||||
this.AddHtmlLocalized(133, 146, 120, 20, this.GetDirectionNumber(this.m_Statue.Direction), 0x77E, false, false);
|
||||
this.AddButton(163, 167, 0xFA5, 0xFA7, (int)Buttons.DirNext, GumpButtonType.Reply, 0);
|
||||
this.AddButton(133, 167, 0xFAE, 0xFB0, (int)Buttons.DirPrev, GumpButtonType.Reply, 0);
|
||||
|
||||
// material
|
||||
this.AddHtmlLocalized(133, 211, 120, 20, 1076171, 0x7FFF, false, false); // Choose Material
|
||||
this.AddHtmlLocalized(133, 231, 120, 20, this.GetMaterialNumber(this.m_Statue.StatueType, this.m_Statue.Material), 0x77E, false, false);
|
||||
this.AddButton(163, 253, 0xFA5, 0xFA7, (int)Buttons.MatNext, GumpButtonType.Reply, 0);
|
||||
this.AddButton(133, 253, 0xFAE, 0xFB0, (int)Buttons.MatPrev, GumpButtonType.Reply, 0);
|
||||
|
||||
// cancel
|
||||
this.AddButton(10, 294, 0xFB1, 0xFB2, (int)Buttons.Close, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(45, 294, 80, 20, 1006045, 0x7FFF, false, false); // Cancel
|
||||
|
||||
// sculpt
|
||||
this.AddButton(234, 294, 0xFB7, 0xFB9, (int)Buttons.Sculpt, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(269, 294, 80, 20, 1076174, 0x7FFF, false, false); // Sculpt
|
||||
|
||||
// restore
|
||||
if (this.m_Maker is CharacterStatueDeed)
|
||||
{
|
||||
this.AddButton(107, 294, 0xFAB, 0xFAD, (int)Buttons.Restore, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(142, 294, 80, 20, 1076193, 0x7FFF, false, false); // Restore
|
||||
}
|
||||
}
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Close,
|
||||
Sculpt,
|
||||
PosePrev,
|
||||
PoseNext,
|
||||
DirPrev,
|
||||
DirNext,
|
||||
MatPrev,
|
||||
MatNext,
|
||||
Restore
|
||||
}
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (this.m_Statue == null || this.m_Statue.Deleted)
|
||||
return;
|
||||
|
||||
bool sendGump = false;
|
||||
|
||||
if (info.ButtonID == (int)Buttons.Sculpt)
|
||||
{
|
||||
if (this.m_Maker is CharacterStatueDeed)
|
||||
{
|
||||
CharacterStatue backup = ((CharacterStatueDeed)this.m_Maker).Statue;
|
||||
|
||||
if (backup != null)
|
||||
backup.Delete();
|
||||
}
|
||||
|
||||
if (this.m_Maker != null)
|
||||
this.m_Maker.Delete();
|
||||
|
||||
this.m_Statue.Sculpt(state.Mobile);
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.PosePrev)
|
||||
{
|
||||
this.m_Statue.Pose = (StatuePose)(((int)this.m_Statue.Pose + 5) % 6);
|
||||
sendGump = true;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.PoseNext)
|
||||
{
|
||||
this.m_Statue.Pose = (StatuePose)(((int)this.m_Statue.Pose + 1) % 6);
|
||||
sendGump = true;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.DirPrev)
|
||||
{
|
||||
this.m_Statue.Direction = (Direction)(((int)this.m_Statue.Direction + 7) % 8);
|
||||
this.m_Statue.InvalidatePose();
|
||||
sendGump = true;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.DirNext)
|
||||
{
|
||||
this.m_Statue.Direction = (Direction)(((int)this.m_Statue.Direction + 1) % 8);
|
||||
this.m_Statue.InvalidatePose();
|
||||
sendGump = true;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.MatPrev)
|
||||
{
|
||||
this.m_Statue.Material = (StatueMaterial)(((int)this.m_Statue.Material + 3) % 4);
|
||||
sendGump = true;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.MatNext)
|
||||
{
|
||||
this.m_Statue.Material = (StatueMaterial)(((int)this.m_Statue.Material + 1) % 4);
|
||||
sendGump = true;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.Restore)
|
||||
{
|
||||
if (this.m_Maker is CharacterStatueDeed)
|
||||
{
|
||||
CharacterStatue backup = ((CharacterStatueDeed)this.m_Maker).Statue;
|
||||
|
||||
if (backup != null)
|
||||
this.m_Statue.Restore(backup);
|
||||
}
|
||||
|
||||
sendGump = true;
|
||||
}
|
||||
else // Close
|
||||
{
|
||||
sendGump = !this.m_Statue.Demolish(state.Mobile);
|
||||
}
|
||||
|
||||
if (sendGump)
|
||||
state.Mobile.SendGump(new CharacterStatueGump(this.m_Maker, this.m_Statue, this.m_Owner));
|
||||
}
|
||||
|
||||
private int GetMaterialNumber(StatueType type, StatueMaterial material)
|
||||
{
|
||||
switch ( material )
|
||||
{
|
||||
case StatueMaterial.Antique:
|
||||
|
||||
switch ( type )
|
||||
{
|
||||
case StatueType.Bronze:
|
||||
return 1076187;
|
||||
case StatueType.Jade:
|
||||
return 1076186;
|
||||
case StatueType.Marble:
|
||||
return 1076182;
|
||||
}
|
||||
|
||||
return 1076187;
|
||||
case StatueMaterial.Dark:
|
||||
|
||||
if (type == StatueType.Marble)
|
||||
return 1076183;
|
||||
|
||||
return 1076182;
|
||||
case StatueMaterial.Medium:
|
||||
return 1076184;
|
||||
case StatueMaterial.Light:
|
||||
return 1076185;
|
||||
default:
|
||||
return 1076187;
|
||||
}
|
||||
}
|
||||
|
||||
private int GetDirectionNumber(Direction direction)
|
||||
{
|
||||
switch ( direction )
|
||||
{
|
||||
case Direction.North:
|
||||
return 1075389;
|
||||
case Direction.Right:
|
||||
return 1075388;
|
||||
case Direction.East:
|
||||
return 1075387;
|
||||
case Direction.Down:
|
||||
return 1076204;
|
||||
case Direction.South:
|
||||
return 1075386;
|
||||
case Direction.Left:
|
||||
return 1075391;
|
||||
case Direction.West:
|
||||
return 1075390;
|
||||
case Direction.Up:
|
||||
return 1076205;
|
||||
default:
|
||||
return 1075386;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Network
|
||||
{
|
||||
public class UpdateStatueAnimation : Packet
|
||||
{
|
||||
public UpdateStatueAnimation(Mobile m, int status, int animation, int frame)
|
||||
: base(0xBF, 17)
|
||||
{
|
||||
this.m_Stream.Write((short)0x11);
|
||||
this.m_Stream.Write((short)0x19);
|
||||
this.m_Stream.Write((byte)0x5);
|
||||
this.m_Stream.Write((int)m.Serial);
|
||||
this.m_Stream.Write((byte)0);
|
||||
this.m_Stream.Write((byte)0xFF);
|
||||
this.m_Stream.Write((byte)status);
|
||||
this.m_Stream.Write((byte)0);
|
||||
this.m_Stream.Write((byte)animation);
|
||||
this.m_Stream.Write((byte)0);
|
||||
this.m_Stream.Write((byte)frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,499 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorruptedCrystalPortal : Item, ISecurable
|
||||
{
|
||||
public override int LabelNumber { get { return 1150074; } } // Corrupted Crystal Portal
|
||||
|
||||
private SecureLevel m_Level;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; }
|
||||
}
|
||||
|
||||
public override bool HandlesOnSpeech { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public CorruptedCrystalPortal()
|
||||
: base(0x468A)
|
||||
{
|
||||
Hue = 2601;
|
||||
Weight = 1.0;
|
||||
Movable = true;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CorruptedCrystalPortal(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse(Mobile m, bool message)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house == null || !IsLockedDown)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendMessage("This must be locked down in a house to use!");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!house.HasSecureAccess(m, m_Level))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(503301, "", 0x22); // You don't have permission to do that.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Sigil.ExistsOn(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (WeightOverloading.IsOverloaded(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m.Criminal)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SpellHelper.CheckCombat(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m.Spell != null)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Server.Engines.CityLoyalty.CityTradeSystem.HasTrade(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!m.InRange(Location, 3))
|
||||
{
|
||||
m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (ValidateUse(m, true))
|
||||
{
|
||||
m.SendGump(new CorruptedCrystalPortalGump(m));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnTeleport(Mobile m, Point3D loc, Map map)
|
||||
{
|
||||
if (m == null || loc == Point3D.Zero || map == null || map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x1FE);
|
||||
|
||||
BaseCreature.TeleportPets(m, loc, map);
|
||||
m.MoveToWorld(loc, map);
|
||||
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x1FE);
|
||||
}
|
||||
|
||||
public override void OnSpeech(SpeechEventArgs e)
|
||||
{
|
||||
if (e.Handled || e.Blocked || !e.Mobile.InRange(Location, 2))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D loc = Point3D.Zero;
|
||||
Map map = null;
|
||||
|
||||
ResolveDest(e.Mobile, e.Speech.Trim(), ref loc, ref map);
|
||||
|
||||
if (loc == Point3D.Zero || map == null || map == Map.Internal || (Siege.SiegeShard && map == Map.Trammel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SpellHelper.RestrictRedTravel && !Siege.SiegeShard && e.Mobile.Murderer && map != Map.Felucca)
|
||||
{
|
||||
e.Mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
|
||||
return;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
|
||||
if (ValidateUse(e.Mobile, true))
|
||||
{
|
||||
OnTeleport(e.Mobile, loc, map);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.WriteEncodedInt((int)m_Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Level = (SecureLevel)reader.ReadEncodedInt();
|
||||
|
||||
if (version < 1)
|
||||
{
|
||||
ItemID = 0x468A;
|
||||
Hue = 2601;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResolveDest(Mobile m, string name, ref Point3D loc, ref Map map)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (name.Trim().ToLower())
|
||||
{
|
||||
case "dungeon covetous":
|
||||
{
|
||||
loc = new Point3D( 2498, 921, 0 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon deceit":
|
||||
{
|
||||
loc = new Point3D( 4111, 434, 5 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon despise":
|
||||
{
|
||||
loc = new Point3D( 1301, 1080, 0 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon destard":
|
||||
{
|
||||
loc = new Point3D( 1176, 2640, 2 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon ice":
|
||||
{
|
||||
loc = new Point3D( 1999, 81, 4 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon fire":
|
||||
{
|
||||
loc = new Point3D( 2923, 3409, 8 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon hythloth":
|
||||
{
|
||||
loc = new Point3D( 4721, 3824, 0 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon orc":
|
||||
{
|
||||
loc = new Point3D( 1017, 1429, 0 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon shame":
|
||||
{
|
||||
loc = new Point3D( 511, 1565, 0 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon wrong":
|
||||
{
|
||||
loc = new Point3D( 2043, 238, 10 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon wind":
|
||||
{
|
||||
loc = new Point3D( 1361, 895, 0 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon doom":
|
||||
{
|
||||
loc = new Point3D( 2368, 1267, -85 );
|
||||
map = Map.Malas;
|
||||
}
|
||||
break;
|
||||
|
||||
// is this the right citadel? uoguide.com says it is
|
||||
case "dungeon citadel":
|
||||
{
|
||||
loc = new Point3D( 1345, 769, 19 );
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
case "dungeon fandancer":
|
||||
{
|
||||
loc = new Point3D( 970, 222, 23 );
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
case "dungeon mines":
|
||||
{
|
||||
loc = new Point3D( 257, 786, 63 );
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
case "dungeon bedlam":
|
||||
{
|
||||
loc = new Point3D( 2068, 1372, -75 );
|
||||
map = Map.Malas;
|
||||
}
|
||||
break;
|
||||
case "dungeon labyrinth":
|
||||
{
|
||||
loc = new Point3D( 1732, 975, -75 );
|
||||
map = Map.Malas;
|
||||
}
|
||||
break;
|
||||
case "dungeon prism":
|
||||
{
|
||||
loc = new Point3D(3786, 1095, 18);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon sanctuary":
|
||||
{
|
||||
loc = new Point3D(761, 1644, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon palace":
|
||||
{
|
||||
loc = new Point3D(5624, 3040, 13);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon grove":
|
||||
{
|
||||
loc = new Point3D(580, 1655, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon caves":
|
||||
{
|
||||
loc = new Point3D(1717, 2991, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon blackthorn":
|
||||
{
|
||||
loc = new Point3D(1482, 1474, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon underworld":
|
||||
{
|
||||
loc = new Point3D( 4195, 3263, 5 );
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "dungeon abyss":
|
||||
{
|
||||
PlayerMobile pm = m as PlayerMobile;
|
||||
|
||||
if (!pm.AbyssEntry)
|
||||
{
|
||||
m.SendLocalizedMessage(1112226);
|
||||
break;
|
||||
}
|
||||
|
||||
loc = new Point3D( 946, 71, 72 );
|
||||
map = Map.TerMur;
|
||||
}
|
||||
break;
|
||||
// fel
|
||||
case "fel dungeon covetous":
|
||||
{
|
||||
loc = new Point3D( 2498, 921, 0 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon deceit":
|
||||
{
|
||||
loc = new Point3D( 4111, 434, 5 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon despise":
|
||||
{
|
||||
loc = new Point3D( 1301, 1080, 0 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon destard":
|
||||
{
|
||||
loc = new Point3D( 1176, 2640, 2 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon fire":
|
||||
{
|
||||
loc = new Point3D( 2923, 3409, 8 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon hythloth":
|
||||
{
|
||||
loc = new Point3D( 4721, 3824, 0 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon ice":
|
||||
{
|
||||
loc = new Point3D( 1999, 81, 4 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon orc":
|
||||
{
|
||||
loc = new Point3D( 1017, 1429, 0 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon shame":
|
||||
{
|
||||
loc = new Point3D( 511, 1565, 0 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon wrong":
|
||||
{
|
||||
loc = new Point3D( 2043, 238, 10 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon wind":
|
||||
{
|
||||
loc = new Point3D( 1361, 895, 0 );
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon prism":
|
||||
{
|
||||
loc = new Point3D(3786, 1095, 18);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon sanctuary":
|
||||
{
|
||||
loc = new Point3D(761, 1644, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon palace":
|
||||
{
|
||||
loc = new Point3D(5624, 3040, 13);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon grove":
|
||||
{
|
||||
loc = new Point3D(580, 1655, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon caves":
|
||||
{
|
||||
loc = new Point3D(1717, 2991, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel dungeon blackthorn":
|
||||
{
|
||||
loc = new Point3D(1520, 1418, 15);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class CorruptedCrystalPortalGump : Gump
|
||||
{
|
||||
public override int GetTypeID()
|
||||
{
|
||||
return 0x237B;
|
||||
}
|
||||
|
||||
public CorruptedCrystalPortalGump(Mobile from)
|
||||
: base(25, 25)
|
||||
{
|
||||
from.CloseGump(typeof(CorruptedCrystalPortalGump));
|
||||
|
||||
AddImage(0, 0, 0x1FE);
|
||||
AddPage(1);
|
||||
AddHtmlLocalized(40, 30, 150, 48, 1150074, 0, false, false); // Corrupted Crystal Portal
|
||||
AddHtmlLocalized(40, 160, 150, 16, 1113300, 0, false, false); // by
|
||||
AddHtmlLocalized(40, 180, 150, 32, 1113299, 0, false, false); // <center>(unknown)</center>
|
||||
AddHtmlLocalized(230, 30, 145, 160, 1150076, 0, false, false); // This corrupted portal allows you to teleport directly to a dungeon.<br><br>For
|
||||
// Trammel ruleset, say "dungeon" followed by the name of the dungeon (e.g. "dungeon shame").
|
||||
|
||||
AddLabel(250, 200, 0, "1"); // todo: get
|
||||
|
||||
AddButton(356, 0, 0x200, 0x200, 0, GumpButtonType.Page, 2);
|
||||
|
||||
AddPage(2);
|
||||
|
||||
AddHtmlLocalized(40, 35, 150, 160, 1150077, 0, false, false); // For Felucca, say "fel" then same rules as above. So "fel dungeon shame".
|
||||
|
||||
AddHtmlLocalized(230, 30, 145, 160, 1150075, 0, false, false); // DUNGEON NAMES:<br>covetous, deceit, despise, destard, ice, fire, hythloth,
|
||||
// orc, shame, wrong, wind, doom, citadel, fandancer, mines, bedlam, labyrinth,
|
||||
//underworld, abyss, grove, caves, palace, prism,
|
||||
|
||||
AddLabel(90, 200, 0, "2"); // toto: get
|
||||
AddLabel(250, 200, 0, "3"); // todo : get
|
||||
|
||||
AddButton(0, 0, 0x1FF, 0x1FF, 0, GumpButtonType.Page, 1);
|
||||
AddButton(356, 0, 0x200, 0x200, 0, GumpButtonType.Page, 3);
|
||||
|
||||
AddPage(3);
|
||||
|
||||
AddHtmlLocalized(40, 35, 150, 160, 1155586, 0, false, false); // sanctuary, blackthorn.
|
||||
AddHtmlLocalized(230, 30, 145, 160, 1150078, 0, false, false); // The same teleportation rules apply regarding criminal flagging, weight, etc.
|
||||
|
||||
AddLabel(90, 200, 0, "4"); // todo: get
|
||||
AddLabel(250, 200, 0, "5"); // todo: get
|
||||
|
||||
AddButton(0, 0, 0x1FF, 0x1FF, 0, GumpButtonType.Page, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
694
Scripts/Services/VeteranRewards/CrystalPortals/CrystalPortal.cs
Normal file
694
Scripts/Services/VeteranRewards/CrystalPortals/CrystalPortal.cs
Normal file
@@ -0,0 +1,694 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CrystalPortal : Item, ISecurable
|
||||
{
|
||||
public override int LabelNumber { get { return 1113945; } } // Crystal Portal
|
||||
|
||||
private SecureLevel m_Level;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; }
|
||||
}
|
||||
|
||||
public override bool HandlesOnSpeech { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public CrystalPortal()
|
||||
: base(0x468B)
|
||||
{
|
||||
Weight = 5.0;
|
||||
Movable = true;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CrystalPortal(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse(Mobile m, bool message)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house == null || !IsLockedDown)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendMessage("This must be locked down in a house to use!");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!house.HasSecureAccess(m, m_Level))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(503301, "", 0x22); // You don't have permission to do that.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Sigil.ExistsOn(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (WeightOverloading.IsOverloaded(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m.Criminal)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SpellHelper.CheckCombat(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m.Spell != null)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Server.Engines.CityLoyalty.CityTradeSystem.HasTrade(m))
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
m.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!m.InRange(Location, 3))
|
||||
{
|
||||
m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (ValidateUse(m, true))
|
||||
{
|
||||
m.SendGump(new CrystalPortalGump(m));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnTeleport(Mobile m, Point3D loc, Map map)
|
||||
{
|
||||
if (m == null || loc == Point3D.Zero || map == null || map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x1FE);
|
||||
|
||||
BaseCreature.TeleportPets(m, loc, map);
|
||||
m.MoveToWorld(loc, map);
|
||||
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x1FE);
|
||||
}
|
||||
|
||||
public override void OnSpeech(SpeechEventArgs e)
|
||||
{
|
||||
if (e.Handled || e.Blocked || !e.Mobile.InRange(Location, 2))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D loc = Point3D.Zero;
|
||||
Map map = null;
|
||||
|
||||
ResolveDest(e.Mobile, e.Speech.Trim(), ref loc, ref map);
|
||||
|
||||
if (loc == Point3D.Zero || map == null || map == Map.Internal || (Siege.SiegeShard && map == Map.Trammel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SpellHelper.RestrictRedTravel && !Siege.SiegeShard && e.Mobile.Murderer && map != Map.Felucca)
|
||||
{
|
||||
e.Mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
|
||||
return;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
|
||||
if (ValidateUse(e.Mobile, true))
|
||||
{
|
||||
if (SpellHelper.CheckTravel(e.Mobile, map, loc, TravelCheckType.RecallTo))
|
||||
{
|
||||
OnTeleport(e.Mobile, loc, map);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.LocalOverheadMessage(MessageType.Regular, 0x4F1, 502360); // You cannot teleport into that area.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1); // version
|
||||
writer.WriteEncodedInt((int)m_Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Level = (SecureLevel)reader.ReadEncodedInt();
|
||||
|
||||
if (version < 1)
|
||||
{
|
||||
ItemID = 0x468B;
|
||||
Hue = 0;
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResolveDest(Mobile from, string name, ref Point3D loc, ref Map map)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (name.Trim().ToLower())
|
||||
{
|
||||
// tram banks
|
||||
case "britain mint":
|
||||
{
|
||||
loc = new Point3D(1434, 1699, 2);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "bucs mint":
|
||||
{
|
||||
loc = new Point3D(2724, 2192, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "cove mint":
|
||||
{
|
||||
loc = new Point3D(2238, 1195, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "delucia mint":
|
||||
{
|
||||
loc = new Point3D(5274, 3991, 37);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
//osi lists new haven listed as simply 'haven'. probably because there's no bank in 'old haven'
|
||||
case "haven mint":
|
||||
{
|
||||
loc = new Point3D(3500, 2571, 14);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "jhelom mint":
|
||||
{
|
||||
loc = new Point3D(1417, 3821, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "magincia mint":
|
||||
{
|
||||
loc = new Point3D(3728, 2164, 20);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "minoc mint":
|
||||
{
|
||||
loc = new Point3D(2498, 561, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "moonglow mint":
|
||||
{
|
||||
loc = new Point3D(4471, 1177, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "nujelm mint":
|
||||
{
|
||||
loc = new Point3D(3770, 1308, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "papua mint":
|
||||
{
|
||||
loc = new Point3D(5675, 3144, 12);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "serpent mint":
|
||||
{
|
||||
loc = new Point3D(2895, 3479, 15);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "skara mint":
|
||||
{
|
||||
loc = new Point3D(596, 2138, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "trinsic mint":
|
||||
{
|
||||
loc = new Point3D(1823, 2821, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "vesper mint":
|
||||
{
|
||||
loc = new Point3D(2899, 676, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "wind mint":
|
||||
{
|
||||
loc = new Point3D(5345, 93, 15);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "luna mint":
|
||||
{
|
||||
loc = new Point3D(1015, 527, -65);
|
||||
map = Map.Malas;
|
||||
}
|
||||
break;
|
||||
case "zento mint":
|
||||
{
|
||||
loc = new Point3D(741, 1261, 30);
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
case "ilshenar mint":
|
||||
{
|
||||
loc = new Point3D(1232, 557, -19);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
|
||||
case "yew mint":
|
||||
{
|
||||
loc = new Point3D(643, 858, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
|
||||
// fel banks
|
||||
case "fel papua mint":
|
||||
{
|
||||
loc = new Point3D(5675, 3144, 12);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel delucia mint":
|
||||
{
|
||||
loc = new Point3D(5274, 3991, 37);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel britain mint":
|
||||
{
|
||||
loc = new Point3D(1434, 1699, 2);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel bucs mint":
|
||||
{
|
||||
loc = new Point3D(2724, 2192, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel cove mint":
|
||||
{
|
||||
loc = new Point3D(2238, 1195, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel ocllo mint":
|
||||
{
|
||||
loc = new Point3D(3687, 2523, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
|
||||
case "fel jhelom mint":
|
||||
{
|
||||
loc = new Point3D(1417, 3821, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel magincia mint":
|
||||
{
|
||||
loc = new Point3D(3728, 2164, 20);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel minoc mint":
|
||||
{
|
||||
loc = new Point3D(2498, 561, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel moonglow mint":
|
||||
{
|
||||
loc = new Point3D(4471, 1177, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel nujelm mint":
|
||||
{
|
||||
loc = new Point3D(3770, 1308, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
|
||||
case "fel serpent mint":
|
||||
{
|
||||
loc = new Point3D(2895, 3479, 15);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel skara mint":
|
||||
{
|
||||
loc = new Point3D(596, 2138, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel trinsic mint":
|
||||
{
|
||||
loc = new Point3D(1823, 2821, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel vesper mint":
|
||||
{
|
||||
loc = new Point3D(2899, 676, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel wind mint":
|
||||
{
|
||||
loc = new Point3D(1361, 895, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
|
||||
case "fel yew mint":
|
||||
{
|
||||
loc = new Point3D(643, 858, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
|
||||
// tram moongates
|
||||
|
||||
case "britain moongate":
|
||||
{
|
||||
loc = new Point3D(1336, 1997, 5);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "haven moongate":
|
||||
{
|
||||
loc = new Point3D(3763, 2771, 50);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "jhelom moongate":
|
||||
{
|
||||
loc = new Point3D(1495, 3773, 0);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "magincia moongate":
|
||||
{
|
||||
loc = new Point3D(3563, 2139, 34);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "minoc moongate":
|
||||
{
|
||||
loc = new Point3D(2701, 692, 5);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "moonglow moongate":
|
||||
{
|
||||
loc = new Point3D(4467, 1283, 5);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "skara moongate":
|
||||
{
|
||||
loc = new Point3D(643, 2067, 5);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
case "trinsic moongate":
|
||||
{
|
||||
loc = new Point3D(1828, 2948, -20);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
// vesper doesn't have it's own moongate, it shares one with minoc.
|
||||
// but osi has an entry for one, clilocs confirm this.
|
||||
case "vesper moongate":
|
||||
{
|
||||
loc = new Point3D(2701, 692, 5);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
// yew moongate not included in osi, but i'm adding it.
|
||||
case "yew moongate":
|
||||
{
|
||||
loc = new Point3D(771, 752, 5);
|
||||
map = Map.Trammel;
|
||||
}
|
||||
break;
|
||||
|
||||
case "compassion moongate":
|
||||
{
|
||||
loc = new Point3D(1215, 467, -13);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "honesty moongate":
|
||||
{
|
||||
loc = new Point3D(722, 1366, -60);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "honor moongate":
|
||||
{
|
||||
loc = new Point3D(744, 724, -28);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "humility moongate":
|
||||
{
|
||||
loc = new Point3D(281, 1016, 0);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "justice moongate":
|
||||
{
|
||||
loc = new Point3D(987, 1011, -32);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "sacrifice moongate":
|
||||
{
|
||||
loc = new Point3D(1174, 1286, -30);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "spirituality moongate":
|
||||
{
|
||||
loc = new Point3D(1532, 1340, -3);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "valor moongate":
|
||||
{
|
||||
loc = new Point3D(528, 216, -45);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
case "chaos moongate":
|
||||
{
|
||||
loc = new Point3D(1721, 218, 96);
|
||||
map = Map.Ilshenar;
|
||||
}
|
||||
break;
|
||||
|
||||
case "luna moongate":
|
||||
{
|
||||
loc = new Point3D(1015, 527, -65);
|
||||
map = Map.Malas;
|
||||
}
|
||||
break;
|
||||
case "umbra moongate":
|
||||
{
|
||||
loc = new Point3D(1997, 1386, -85);
|
||||
map = Map.Malas;
|
||||
}
|
||||
break;
|
||||
case "termur moongate":
|
||||
{
|
||||
loc = new Point3D(851, 3526, 0);
|
||||
map = Map.TerMur;
|
||||
}
|
||||
break;
|
||||
case "isamu moongate":
|
||||
{
|
||||
loc = new Point3D(1169, 998, 41);
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
case "makoto moongate":
|
||||
{
|
||||
loc = new Point3D(802, 1204, 25);
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
case "homare moongate":
|
||||
{
|
||||
loc = new Point3D(270, 628, 15);
|
||||
map = Map.Tokuno;
|
||||
}
|
||||
break;
|
||||
|
||||
// fel moongates
|
||||
|
||||
case "fel britain moongate":
|
||||
{
|
||||
loc = new Point3D(1336, 1997, 5);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel bucs moongate":
|
||||
{
|
||||
loc = new Point3D(2711, 2234, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel jhelom moongate":
|
||||
{
|
||||
loc = new Point3D(1495, 3773, 0);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel magincia moongate":
|
||||
{
|
||||
loc = new Point3D(3563, 2139, 34);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel minoc moongate":
|
||||
{
|
||||
loc = new Point3D(2701, 692, 5);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel moonglow moongate":
|
||||
{
|
||||
loc = new Point3D(4467, 1283, 5);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel skara moongate":
|
||||
{
|
||||
loc = new Point3D(643, 2067, 5);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel trinsic moongate":
|
||||
{
|
||||
loc = new Point3D(1828, 2948, -20);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel yew moongate":
|
||||
{
|
||||
loc = new Point3D(771, 752, 5);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
case "fel vesper moongate":
|
||||
{
|
||||
loc = new Point3D(2701, 692, 5);
|
||||
map = Map.Felucca;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class CrystalPortalGump : Gump
|
||||
{
|
||||
public override int GetTypeID()
|
||||
{
|
||||
return 0x237B;
|
||||
}
|
||||
|
||||
public CrystalPortalGump(Mobile from)
|
||||
: base(245, 200)
|
||||
{
|
||||
from.CloseGump(typeof(CrystalPortalGump));
|
||||
|
||||
AddImage(0, 0, 0x1FE);
|
||||
AddPage(1);
|
||||
AddHtmlLocalized(40, 30, 150, 48, 1113945, 0, false, false); // Crystal Portal
|
||||
AddHtmlLocalized(40, 160, 150, 16, 1113300, 0, false, false); // by
|
||||
AddHtmlLocalized(40, 180, 150, 32, 1113299, 0, false, false); // <center>(unknown)</center>
|
||||
AddHtmlLocalized(230, 30, 145, 160, 1113946, 0, false, false); // This crystal portal allows you to teleport directly to a bank
|
||||
// or a moongate.<br><br>For Trammel ruleset, say the city's name
|
||||
// followed by "mint" (e.g. "minoc mint"). For a
|
||||
|
||||
AddLabel(250, 200, 0, "1"); // todo: get
|
||||
|
||||
AddButton(356, 0, 0x200, 0x200, 0, GumpButtonType.Page, 2);
|
||||
|
||||
AddPage(2);
|
||||
|
||||
AddHtmlLocalized(40, 35, 150, 160, 1113947, 0, false, false); // moongate, say the gate's name and "moongate" (eg. "minoc moongate").
|
||||
// <br><br>For Felucca, say "fel" then same rules as above. So "fel minoc mint"
|
||||
// or "fel minoc moongate".
|
||||
|
||||
AddHtmlLocalized(230, 30, 145, 160, 1113948, 0, false, false); // CITY NAMES:<br>britain, bucs, cove, delucia, haven, jhelom, magincia, minoc,
|
||||
// moonglow, nujelm, ocllo, papua, serpent, skara, trinsic, vesper, wind, yew, luna,
|
||||
// umbra, zento, termur, ilshenar
|
||||
|
||||
AddLabel(90, 200, 0, "2"); // toto: get
|
||||
AddLabel(250, 200, 0, "3"); // todo : get
|
||||
|
||||
AddButton(0, 0, 0x1FF, 0x1FF, 0, GumpButtonType.Page, 1);
|
||||
AddButton(356, 0, 0x200, 0x200, 0, GumpButtonType.Page, 3);
|
||||
|
||||
AddPage(3);
|
||||
|
||||
AddHtmlLocalized(40, 35, 150, 160, 1113949, 0, false, false); // MOONGATE NAMES<br>moonglow, britain, jhelom, yew, minoc, trinsic, skara,
|
||||
// magincia, haven, bucs, vesper, compassion, honesty, honor, humility, justice,
|
||||
// sacrifice, spirituality, valor, chaos,
|
||||
|
||||
AddHtmlLocalized(230, 30, 145, 160, 1113950, 0, false, false); // luna, umbra, isamu, makoto, homare, termur, eodon<br><br><br>The same teleportation
|
||||
// rules apply regarding criminal flagging, weight, etc.
|
||||
|
||||
AddLabel(90, 200, 0, "4"); // todo: get
|
||||
AddLabel(250, 200, 0, "5"); // todo: get
|
||||
|
||||
AddButton(0, 0, 0x1FF, 0x1FF, 0, GumpButtonType.Page, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
858
Scripts/Services/VeteranRewards/DaviesLocker.cs
Normal file
858
Scripts/Services/VeteranRewards/DaviesLocker.cs
Normal file
@@ -0,0 +1,858 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class DaviesLockerAddon : BaseAddon, ISecurable
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DaviesLockerAddonDeed(m_Entries); } }
|
||||
|
||||
private List<DaviesLockerEntry> m_Entries = new List<DaviesLockerEntry>();
|
||||
public List<DaviesLockerEntry> Entries { get { return m_Entries; } }
|
||||
|
||||
private bool m_South;
|
||||
private SecureLevel m_Level;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool South
|
||||
{
|
||||
get { return m_South; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DaviesLockerAddon(bool south, List<DaviesLockerEntry> list)
|
||||
{
|
||||
m_South = south;
|
||||
m_Entries = list;
|
||||
m_Level = SecureLevel.CoOwners;
|
||||
|
||||
if (south)
|
||||
{
|
||||
AddComponent(new DaviesLockerComponent(19455), 0, 0, 0);
|
||||
AddComponent(new DaviesLockerComponent(19456), 1, 0, 0);
|
||||
AddComponent(new DaviesLockerComponent(19457), 2, 0, 0);
|
||||
AddComponent(new DaviesLockerComponent(19453), 0, 1, 0);
|
||||
AddComponent(new DaviesLockerComponent(19452), 1, 1, 0);
|
||||
AddComponent(new DaviesLockerComponent(19454), 2, 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new DaviesLockerComponent(19449), 0, 0, 0);
|
||||
AddComponent(new DaviesLockerComponent(19448), 1, 0, 0);
|
||||
AddComponent(new DaviesLockerComponent(19450), 0, 1, 0);
|
||||
AddComponent(new DaviesLockerComponent(19447), 1, 1, 0);
|
||||
AddComponent(new DaviesLockerComponent(19451), 0, 2, 0);
|
||||
AddComponent(new DaviesLockerComponent(19446), 1, 2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*public override void OnChop(Mobile from)
|
||||
{
|
||||
if (m_Entries.Count == 0)
|
||||
base.OnChop(from);
|
||||
else
|
||||
from.SendMessage("You cannot re-deed this addon unless it is emtpy!");
|
||||
}*/
|
||||
|
||||
public override void OnComponentUsed(AddonComponent component, Mobile from)
|
||||
{
|
||||
if (from.InRange(component.Location, 2))
|
||||
{
|
||||
if (CanUse(from))
|
||||
{
|
||||
from.CloseGump(typeof(DaviesLockerGump));
|
||||
from.SendGump(new DaviesLockerGump(from, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(503301, "", 0x22); // You don't have permission to do that.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanUse(Mobile from)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
return house != null && house.HasSecureAccess(from, m_Level);
|
||||
}
|
||||
|
||||
public void TryAddEntry(Item item, Mobile from)
|
||||
{
|
||||
if (!CanUse(from) || item == null)
|
||||
return;
|
||||
|
||||
if (!CheckRange(from))
|
||||
from.SendLocalizedMessage(3000268); // that is too far away.
|
||||
else if (!(item is TreasureMap || item is SOS || item is MessageInABottle))
|
||||
from.SendLocalizedMessage(1153564); // That is not a treasure map or message in a bottle.
|
||||
else if (!item.IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1054107); // This item must be in your backpack.
|
||||
else if (m_Entries.Count >= 500)
|
||||
from.SendLocalizedMessage(1153565); // The locker is full
|
||||
else
|
||||
{
|
||||
DaviesLockerEntry entry = null;
|
||||
|
||||
if (item is TreasureMap)
|
||||
entry = new TreasureMapEntry((TreasureMap)item);
|
||||
else if (item is SOS)
|
||||
entry = new SOSEntry((SOS)item);
|
||||
else if (item is MessageInABottle)
|
||||
entry = new SOSEntry((MessageInABottle)item);
|
||||
|
||||
if (entry != null)
|
||||
{
|
||||
m_Entries.Add(entry);
|
||||
from.CloseGump(typeof(DaviesLockerGump));
|
||||
from.SendGump(new DaviesLockerGump(from, this));
|
||||
|
||||
item.Delete();
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckRange(Mobile m)
|
||||
{
|
||||
if (Components == null || m.Map != this.Map)
|
||||
return false;
|
||||
|
||||
foreach (AddonComponent c in Components)
|
||||
{
|
||||
if (m.InRange(c.Location, 2))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public DaviesLockerAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // Version
|
||||
|
||||
writer.Write(m_South);
|
||||
writer.Write((int)m_Level);
|
||||
|
||||
writer.Write(m_Entries.Count);
|
||||
foreach (DaviesLockerEntry entry in m_Entries)
|
||||
{
|
||||
if (entry is SOSEntry)
|
||||
writer.Write((int)0);
|
||||
else if (entry is TreasureMapEntry)
|
||||
writer.Write((int)1);
|
||||
else
|
||||
{
|
||||
writer.Write((int)2);
|
||||
continue;
|
||||
}
|
||||
|
||||
entry.Serialize(writer);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Entries = new List<DaviesLockerEntry>();
|
||||
|
||||
m_South = reader.ReadBool();
|
||||
m_Level = (SecureLevel)reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
switch (reader.ReadInt())
|
||||
{
|
||||
case 0:
|
||||
m_Entries.Add(new SOSEntry(reader));
|
||||
break;
|
||||
case 1:
|
||||
m_Entries.Add(new TreasureMapEntry(reader));
|
||||
break;
|
||||
case 2: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DaviesLockerComponent : LocalizedAddonComponent
|
||||
{
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public DaviesLockerComponent(int id)
|
||||
: base(id, 1153534) // Davies' Locker
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (this.Addon is DaviesLockerAddon && (dropped is SOS || dropped is TreasureMap))
|
||||
((DaviesLockerAddon)this.Addon).TryAddEntry(dropped as Item, from);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if(Addon is DaviesLockerAddon)
|
||||
SetSecureLevelEntry.AddTo(from, (DaviesLockerAddon)Addon, list);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Addon is DaviesLockerAddon)
|
||||
{
|
||||
list.Add(1153648, ((DaviesLockerAddon)Addon).Entries.Count.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public DaviesLockerComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DaviesLockerAddonDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new DaviesLockerAddon(m_South, m_Entries); } }
|
||||
public override int LabelNumber { get { return 1153535; } } // deed to davies' locker
|
||||
|
||||
private List<DaviesLockerEntry> m_Entries;
|
||||
public List<DaviesLockerEntry> Entries { get { return m_Entries; } }
|
||||
|
||||
private bool m_South;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool South
|
||||
{
|
||||
get { return m_South; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DaviesLockerAddonDeed() : this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public DaviesLockerAddonDeed(List<DaviesLockerEntry> list)
|
||||
{
|
||||
if (list == null)
|
||||
m_Entries = new List<DaviesLockerEntry>();
|
||||
else
|
||||
m_Entries = list;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1153648, m_Entries.Count.ToString()); // ~1_COUNT~ maps
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1116332); // South
|
||||
list.Add(1, 1116333); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_South = choice == 0;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public DaviesLockerAddonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // Version
|
||||
|
||||
writer.Write(m_South);
|
||||
|
||||
writer.Write(m_Entries.Count);
|
||||
foreach (DaviesLockerEntry entry in m_Entries)
|
||||
{
|
||||
if (entry is SOSEntry)
|
||||
writer.Write((int)0);
|
||||
else if (entry is TreasureMapEntry)
|
||||
writer.Write((int)1);
|
||||
else
|
||||
{
|
||||
writer.Write((int)2);
|
||||
continue;
|
||||
}
|
||||
|
||||
entry.Serialize(writer);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Entries = new List<DaviesLockerEntry>();
|
||||
m_South = reader.ReadBool();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
switch (reader.ReadInt())
|
||||
{
|
||||
case 0:
|
||||
m_Entries.Add(new SOSEntry(reader));
|
||||
break;
|
||||
case 1:
|
||||
m_Entries.Add(new TreasureMapEntry(reader));
|
||||
break;
|
||||
case 2: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DaviesLockerEntry
|
||||
{
|
||||
public Map Map { get; set; }
|
||||
public Point3D Location { get; set; }
|
||||
public int Level { get; set; }
|
||||
public bool QuestItem { get; set; }
|
||||
|
||||
public DaviesLockerEntry(Map map, Point3D location, int level)
|
||||
{
|
||||
Map = map;
|
||||
Location = location;
|
||||
Level = level;
|
||||
}
|
||||
|
||||
public DaviesLockerEntry(GenericReader reader)
|
||||
{
|
||||
int v = reader.ReadInt();
|
||||
|
||||
switch (v)
|
||||
{
|
||||
case 1:
|
||||
QuestItem = reader.ReadBool();
|
||||
goto case 0;
|
||||
case 0:
|
||||
Map = reader.ReadMap();
|
||||
Location = reader.ReadPoint3D();
|
||||
Level = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(QuestItem);
|
||||
|
||||
writer.Write(Map);
|
||||
writer.Write(Location);
|
||||
writer.Write(Level);
|
||||
}
|
||||
}
|
||||
|
||||
public class SOSEntry : DaviesLockerEntry
|
||||
{
|
||||
public bool IsAncient { get; set; }
|
||||
public int MessageIndex { get; set; }
|
||||
public bool Opened { get; set; }
|
||||
|
||||
public SOSEntry(MessageInABottle mib) : base(mib.TargetMap, Point3D.Zero, mib.Level)
|
||||
{
|
||||
Opened = false;
|
||||
IsAncient = false;
|
||||
MessageIndex = -1;
|
||||
|
||||
if (mib is SaltySeaMIB)
|
||||
QuestItem = true;
|
||||
}
|
||||
|
||||
public SOSEntry(SOS sos) : base(sos.TargetMap, sos.TargetLocation, sos.Level)
|
||||
{
|
||||
Opened = true;
|
||||
IsAncient = sos.IsAncient;
|
||||
MessageIndex = sos.MessageIndex;
|
||||
|
||||
if (sos is SaltySeaSOS)
|
||||
QuestItem = true;
|
||||
}
|
||||
|
||||
public SOSEntry(GenericReader reader) : base(reader)
|
||||
{
|
||||
int v = reader.ReadInt();
|
||||
|
||||
IsAncient = reader.ReadBool();
|
||||
MessageIndex = reader.ReadInt();
|
||||
Opened = reader.ReadBool();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(IsAncient);
|
||||
writer.Write(MessageIndex);
|
||||
writer.Write(Opened);
|
||||
}
|
||||
}
|
||||
|
||||
public class TreasureMapEntry : DaviesLockerEntry
|
||||
{
|
||||
public bool Completed { get; set; }
|
||||
public Mobile CompletedBy { get; set; }
|
||||
public Mobile Decoder { get; set; }
|
||||
public DateTime NextReset { get; set; }
|
||||
public TreasurePackage Package { get; set; }
|
||||
|
||||
public TreasureMapEntry(TreasureMap map) : base(map.Facet, new Point3D(map.ChestLocation.X, map.ChestLocation.Y, 0), map.Level)
|
||||
{
|
||||
Completed = map.Completed;
|
||||
CompletedBy = map.CompletedBy;
|
||||
Decoder = map.Decoder;
|
||||
NextReset = map.NextReset;
|
||||
Package = map.Package;
|
||||
|
||||
if (map is HiddenTreasuresTreasureMap)
|
||||
QuestItem = true;
|
||||
}
|
||||
|
||||
public TreasureMapEntry(GenericReader reader) : base(reader)
|
||||
{
|
||||
int v = reader.ReadInt();
|
||||
|
||||
switch (v)
|
||||
{
|
||||
case 1:
|
||||
Package = (TreasurePackage)reader.ReadInt();
|
||||
goto case 0;
|
||||
case 0:
|
||||
Completed = reader.ReadBool();
|
||||
CompletedBy = reader.ReadMobile();
|
||||
Decoder = reader.ReadMobile();
|
||||
NextReset = reader.ReadDateTime();
|
||||
break;
|
||||
}
|
||||
|
||||
if (v == 0)
|
||||
{
|
||||
Package = (TreasurePackage)Utility.RandomMinMax(0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write((int)Package);
|
||||
|
||||
writer.Write(Completed);
|
||||
writer.Write(CompletedBy);
|
||||
writer.Write(Decoder);
|
||||
writer.Write(NextReset);
|
||||
}
|
||||
}
|
||||
|
||||
public class DaviesLockerGump : Gump
|
||||
{
|
||||
private readonly int Blue = 0x99FF;
|
||||
private readonly int AquaGreen = 0x03EF;
|
||||
private readonly int Yellow = 0xFFE0;
|
||||
|
||||
private List<DaviesLockerEntry> m_List = new List<DaviesLockerEntry>();
|
||||
private int m_Page;
|
||||
private DaviesLockerAddon m_Addon;
|
||||
|
||||
public DaviesLockerGump(Mobile from, DaviesLockerAddon addon) : this(from, addon, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public DaviesLockerGump(Mobile from, DaviesLockerAddon addon, int page) : base(50, 50)
|
||||
{
|
||||
if (addon == null || addon.Deleted)
|
||||
return;
|
||||
|
||||
AddImage(0, 0, 0x5C1);
|
||||
m_List = addon.Entries;
|
||||
m_Addon = addon;
|
||||
|
||||
AddHtmlLocalized(0, 10, 600, 20, 1153552, AquaGreen, false, false); // <DIV ALIGN="CENTER">Davies' Locker</DIV>
|
||||
|
||||
AddHtmlLocalized(30, 35, 40, 20, 1153554, Blue, false, false); // <DIV ALIGN="CENTER">Get</DIV>
|
||||
AddHtmlLocalized(75, 35, 90, 20, 1153555, Blue, false, false); // <DIV ALIGN="CENTER">Facet</DIV>
|
||||
AddHtmlLocalized(170, 35, 200, 20, 1153556, Blue, false, false); // <DIV ALIGN="CENTER">Level</DIV>
|
||||
AddHtmlLocalized(365, 35, 105, 20, 1153557, Blue, false, false); // <DIV ALIGN="CENTER">Coords</DIV>
|
||||
AddHtmlLocalized(470, 35, 120, 20, 1153558, Blue, false, false); // <DIV ALIGN="CENTER">Status</DIV>
|
||||
|
||||
int perPage = 10;
|
||||
int totalPages = (int)Math.Ceiling((double)m_List.Count / 10.0);
|
||||
|
||||
if (totalPages < 1) totalPages = 1;
|
||||
|
||||
if(page < 0) page = 0;
|
||||
if(page + 1 > totalPages) page = totalPages - 1;
|
||||
m_Page = page;
|
||||
|
||||
int start = page * perPage;
|
||||
|
||||
AddHtmlLocalized(40, 428, 200, 20, 1153560, String.Format("{0}\t{1}", m_List.Count, "500"), Blue, false, false); // Maps: ~1_NUM~ of ~2_MAX~
|
||||
AddHtmlLocalized(40, 450, 200, 20, 1153561, String.Format("{0}\t{1}", (page + 1).ToString(), (totalPages).ToString()), Blue, false, false); // Page ~1_CUR~ of ~2_MAX~
|
||||
|
||||
AddHtmlLocalized(380, 427, 72, 20, 1153553, Yellow, false, false); // <DIV ALIGN="CENTER">ADD MAPS</DIV>
|
||||
AddButton(340, 428, 4011, 4013, 1, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtmlLocalized(377, 450, 40, 20, 1153562, Yellow, false, false); // <DIV ALIGN="CENTER">PAGE</DIV>
|
||||
AddButton(340, 450, 4014, 4016, 2, GumpButtonType.Reply, 0);
|
||||
AddButton(502, 450, 4005, 4007, 3, GumpButtonType.Reply, 0);
|
||||
AddImage(320, 455, 5603);
|
||||
AddImage(537, 455, 5601);
|
||||
|
||||
int y = 72;
|
||||
int index = 0;
|
||||
|
||||
for (int i = start; i >= 0 && i < m_List.Count && index < perPage; i++)
|
||||
{
|
||||
DaviesLockerEntry entry = m_List[i];
|
||||
|
||||
if (entry == null)
|
||||
continue;
|
||||
|
||||
if(addon.CanUse(from))
|
||||
AddButton(45, y + 3, 1209, 1210, 5 + i, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtml(80, y, 100, 20, String.Format("<basefont color=yellow>{0}", GetFacet(entry)), false, false);
|
||||
|
||||
if (TreasureMapInfo.NewSystem && entry is TreasureMapEntry)
|
||||
{
|
||||
AddHtmlLocalized(175, y, 220, 20, 1060847, String.Format("{0}\t{1}", "#" + GetPackage((TreasureMapEntry)entry), "#" + GetLevel((TreasureMapEntry)entry)), Yellow, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(175, y, 220, 20, GetLevel(entry), Yellow, false, false);
|
||||
}
|
||||
|
||||
if ((entry is TreasureMapEntry && ((TreasureMapEntry)entry).Decoder == null) || (entry is SOSEntry && !((SOSEntry)entry).Opened))
|
||||
AddHtmlLocalized(370, y, 100, 20, 1153569, Yellow, false, false); // Unknown
|
||||
else
|
||||
AddHtmlLocalized(370, y, 100, 20, 1060847, String.Format("{0}\t{1}", entry.Location.X.ToString(), entry.Location.Y.ToString()), Yellow, false, false); // ~1_val~ ~2_val~
|
||||
|
||||
AddHtmlLocalized(475, y, 100, 20, GetStatus(entry), Yellow, false, false);
|
||||
|
||||
y += 35;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if (!m_Addon.CanUse(from))
|
||||
return;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0: return;
|
||||
case 1: // ADD MAPS
|
||||
{
|
||||
from.Target = new InternalTarget(from, m_Addon, m_Page);
|
||||
from.SendLocalizedMessage(1153563); // Target maps in your backpack or a sub-container to add them to the Locker. When done, press ESC.
|
||||
return;
|
||||
}
|
||||
case 2: // PAGE BACK
|
||||
m_Page--;
|
||||
break;
|
||||
case 3: // PAGE FORWARD
|
||||
m_Page++;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
int index = info.ButtonID - 5;
|
||||
|
||||
if (index >= 0 && index < m_List.Count)
|
||||
{
|
||||
DaviesLockerEntry entry = m_List[index];
|
||||
|
||||
if (entry != null)
|
||||
ConstructEntry(from, entry);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
from.SendGump(new DaviesLockerGump(from, m_Addon, m_Page));
|
||||
}
|
||||
|
||||
private string GetPackage(TreasureMapEntry entry)
|
||||
{
|
||||
switch (entry.Package)
|
||||
{
|
||||
default:
|
||||
case TreasurePackage.Artisan: return "1159000";
|
||||
case TreasurePackage.Assassin: return "1158998";
|
||||
case TreasurePackage.Mage: return "1158997";
|
||||
case TreasurePackage.Ranger: return "1159002";
|
||||
case TreasurePackage.Warrior: return "1158999";
|
||||
}
|
||||
}
|
||||
|
||||
private string GetLevel(TreasureMapEntry entry)
|
||||
{
|
||||
return (1158992 + Math.Min(4, entry.Level)).ToString();
|
||||
}
|
||||
|
||||
private string GetFacet(DaviesLockerEntry entry)
|
||||
{
|
||||
if (entry is TreasureMapEntry && Server.Spells.SpellHelper.IsEodon(entry.Map, entry.Location))
|
||||
{
|
||||
return "Eodon";
|
||||
}
|
||||
|
||||
return entry.Map.ToString();
|
||||
}
|
||||
|
||||
private void ConstructEntry(Mobile from, DaviesLockerEntry entry)
|
||||
{
|
||||
Item item = null;
|
||||
|
||||
if (entry is SOSEntry)
|
||||
item = Construct((SOSEntry)entry);
|
||||
else if (entry is TreasureMapEntry)
|
||||
item = Construct((TreasureMapEntry)entry);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if (pack == null || !pack.TryDropItem(from, item, false))
|
||||
item.Delete();
|
||||
else
|
||||
{
|
||||
if (m_List.Contains(entry))
|
||||
m_List.Remove(entry);
|
||||
//TODO: Message?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Item Construct(SOSEntry entry)
|
||||
{
|
||||
if (entry == null)
|
||||
return null;
|
||||
|
||||
if (entry.Opened)
|
||||
{
|
||||
SOS sos;
|
||||
|
||||
if (entry.QuestItem)
|
||||
sos = new SaltySeaSOS(entry.Map, entry.Level);
|
||||
else
|
||||
sos = new SOS(entry.Map, entry.Level);
|
||||
|
||||
sos.MessageIndex = entry.MessageIndex;
|
||||
sos.TargetLocation = entry.Location;
|
||||
return sos;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageInABottle mib;
|
||||
|
||||
if (entry.QuestItem)
|
||||
mib = new SaltySeaMIB(entry.Map, entry.Level);
|
||||
else
|
||||
mib = new MessageInABottle(entry.Map, entry.Level);
|
||||
|
||||
return mib;
|
||||
}
|
||||
}
|
||||
|
||||
private TreasureMap Construct(TreasureMapEntry entry)
|
||||
{
|
||||
if (entry == null)
|
||||
return null;
|
||||
|
||||
|
||||
TreasureMap map;
|
||||
|
||||
if (entry.QuestItem)
|
||||
map = new HiddenTreasuresTreasureMap(entry.Level, entry.Map, new Point2D(entry.Location.X, entry.Location.Y));
|
||||
else
|
||||
{
|
||||
map = new TreasureMap();
|
||||
|
||||
map.Facet = entry.Map;
|
||||
map.Level = entry.Level;
|
||||
map.Package = (TreasurePackage)entry.Package;
|
||||
map.ChestLocation = new Point2D(entry.Location.X, entry.Location.Y);
|
||||
}
|
||||
|
||||
bool eodon = map.TreasureFacet == TreasureFacet.Eodon;
|
||||
|
||||
map.Completed = entry.Completed;
|
||||
map.CompletedBy = entry.CompletedBy;
|
||||
map.Decoder = entry.Decoder;
|
||||
map.NextReset = entry.NextReset;
|
||||
|
||||
map.Width = 300;
|
||||
map.Height = 300;
|
||||
int x = entry.Location.X;
|
||||
int y = entry.Location.Y;
|
||||
int width, height;
|
||||
Map facet = entry.Map;
|
||||
|
||||
map.GetWidthAndHeight(facet, out width, out height);
|
||||
|
||||
int x1 = x - Utility.RandomMinMax(width / 4, (width / 4) * 3);
|
||||
int y1 = y - Utility.RandomMinMax(height / 4, (height / 4) * 3);
|
||||
|
||||
if (x1 < 0) x1 = 0;
|
||||
if (y1 < 0) y1 = 0;
|
||||
|
||||
int x2, y2;
|
||||
|
||||
map.AdjustMap(facet, out x2, out y2, x1, y1, width, height, eodon);
|
||||
|
||||
x1 = x2 - width;
|
||||
y1 = y2 - height;
|
||||
|
||||
map.Bounds = new Rectangle2D(x1, y1, width, height);
|
||||
map.Protected = true;
|
||||
|
||||
map.AddWorldPin(x, y);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private int GetLevel(DaviesLockerEntry entry)
|
||||
{
|
||||
if (entry is SOSEntry)
|
||||
return 1153568; // S-O-S
|
||||
else if(entry is TreasureMapEntry)
|
||||
return 1153572 + entry.Level;
|
||||
|
||||
return 1153569; // Unknown
|
||||
}
|
||||
|
||||
private int GetStatus(DaviesLockerEntry entry)
|
||||
{
|
||||
if (entry is SOSEntry)
|
||||
{
|
||||
SOSEntry sosEntry = (SOSEntry)entry;
|
||||
|
||||
if (!sosEntry.Opened)
|
||||
return 1153570; // Unopened
|
||||
|
||||
if (sosEntry.IsAncient)
|
||||
return 1153572; // Ancient
|
||||
|
||||
return 1153571; // Opened
|
||||
}
|
||||
else if (entry is TreasureMapEntry)
|
||||
{
|
||||
TreasureMapEntry mapEntry = (TreasureMapEntry)entry;
|
||||
|
||||
if (mapEntry.Completed)
|
||||
return 1153582; // Completed
|
||||
else if (mapEntry.Decoder != null)
|
||||
return 1153581; // Decoded
|
||||
else
|
||||
return 1153580; // Not Decoded
|
||||
}
|
||||
|
||||
return 1153569; // Unknown
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private DaviesLockerAddon m_Addon;
|
||||
private int m_Page;
|
||||
|
||||
public InternalTarget(Mobile from, DaviesLockerAddon addon, int page) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Addon = addon;
|
||||
m_Page = page;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Addon != null && !m_Addon.Deleted && targeted is Item)
|
||||
{
|
||||
m_Addon.TryAddEntry(targeted as Item, from);
|
||||
from.Target = new InternalTarget(from, m_Addon, m_Page);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
|
||||
{
|
||||
if (m_Addon != null && !m_Addon.Deleted)
|
||||
{
|
||||
from.CloseGump(typeof(DaviesLockerGump));
|
||||
from.SendGump(new DaviesLockerGump(from, m_Addon, m_Page));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Services/VeteranRewards/RewardCategory.cs
Normal file
45
Scripts/Services/VeteranRewards/RewardCategory.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardCategory
|
||||
{
|
||||
private readonly int m_Name;
|
||||
private readonly string m_NameString;
|
||||
private readonly List<RewardEntry> m_Entries;
|
||||
public RewardCategory(int name)
|
||||
{
|
||||
this.m_Name = name;
|
||||
this.m_Entries = new List<RewardEntry>();
|
||||
}
|
||||
|
||||
public RewardCategory(string name)
|
||||
{
|
||||
this.m_NameString = name;
|
||||
this.m_Entries = new List<RewardEntry>();
|
||||
}
|
||||
|
||||
public int Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Name;
|
||||
}
|
||||
}
|
||||
public string NameString
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_NameString;
|
||||
}
|
||||
}
|
||||
public List<RewardEntry> Entries
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Entries;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
197
Scripts/Services/VeteranRewards/RewardChoiceGump.cs
Normal file
197
Scripts/Services/VeteranRewards/RewardChoiceGump.cs
Normal file
@@ -0,0 +1,197 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardChoiceGump : Gump
|
||||
{
|
||||
private readonly Mobile m_From;
|
||||
public RewardChoiceGump(Mobile from)
|
||||
: base(0, 0)
|
||||
{
|
||||
this.m_From = from;
|
||||
|
||||
from.CloseGump(typeof(RewardChoiceGump));
|
||||
|
||||
this.RenderBackground();
|
||||
this.RenderCategories();
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
int buttonID = info.ButtonID - 1;
|
||||
|
||||
if (buttonID == 0)
|
||||
{
|
||||
int cur, max;
|
||||
|
||||
RewardSystem.ComputeRewardInfo(this.m_From, out cur, out max);
|
||||
|
||||
if (cur < max)
|
||||
this.m_From.SendGump(new RewardNoticeGump(this.m_From));
|
||||
}
|
||||
else
|
||||
{
|
||||
--buttonID;
|
||||
|
||||
int type = (buttonID % 20);
|
||||
int index = (buttonID / 20);
|
||||
|
||||
RewardCategory[] categories = RewardSystem.Categories;
|
||||
|
||||
if (type >= 0 && type < categories.Length)
|
||||
{
|
||||
RewardCategory category = categories[type];
|
||||
|
||||
if (index >= 0 && index < category.Entries.Count)
|
||||
{
|
||||
RewardEntry entry = category.Entries[index];
|
||||
|
||||
if (!RewardSystem.HasAccess(this.m_From, entry))
|
||||
return;
|
||||
|
||||
this.m_From.SendGump(new RewardConfirmGump(this.m_From, entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RenderBackground()
|
||||
{
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(10, 10, 600, 450, 2600);
|
||||
|
||||
this.AddButton(530, 415, 4017, 4019, 0, GumpButtonType.Reply, 0);
|
||||
|
||||
this.AddButton(60, 415, 4014, 4016, 0, GumpButtonType.Page, 1);
|
||||
this.AddHtmlLocalized(95, 415, 200, 20, 1049755, false, false); // Main Menu
|
||||
}
|
||||
|
||||
private void RenderCategories()
|
||||
{
|
||||
TimeSpan rewardInterval = RewardSystem.RewardInterval;
|
||||
|
||||
string intervalAsString;
|
||||
|
||||
if (rewardInterval == TimeSpan.FromDays(30.0))
|
||||
intervalAsString = "month";
|
||||
else if (rewardInterval == TimeSpan.FromDays(60.0))
|
||||
intervalAsString = "two months";
|
||||
else if (rewardInterval == TimeSpan.FromDays(90.0))
|
||||
intervalAsString = "three months";
|
||||
else if (rewardInterval == TimeSpan.FromDays(365.0))
|
||||
intervalAsString = "year";
|
||||
else
|
||||
intervalAsString = String.Format("{0} day{1}", rewardInterval.TotalDays, rewardInterval.TotalDays == 1 ? "" : "s");
|
||||
|
||||
this.AddPage(1);
|
||||
|
||||
this.AddHtml(60, 35, 500, 70, "<B>Ultima Online Rewards Program</B><BR>" +
|
||||
"Thank you for being a part of the Ultima Online community for a full " + intervalAsString + ". " +
|
||||
"As a token of our appreciation, you may select from the following in-game reward items listed below. " +
|
||||
"The gift items will be attributed to the character you have logged-in with on the shard you are on when you chose the item(s). " +
|
||||
"The number of rewards you are entitled to are listed below and are for your entire account. " +
|
||||
"To read more about these rewards before making a selection, feel free to visit the uo.com site at " +
|
||||
"<A HREF=\"http://www.uo.com/rewards\">http://www.uo.com/rewards</A>.", true, true);
|
||||
|
||||
int cur, max;
|
||||
|
||||
RewardSystem.ComputeRewardInfo(this.m_From, out cur, out max);
|
||||
|
||||
this.AddHtmlLocalized(60, 105, 300, 35, 1006006, false, false); // Your current total of rewards to choose:
|
||||
this.AddLabel(370, 107, 50, (max - cur).ToString());
|
||||
|
||||
this.AddHtmlLocalized(60, 140, 300, 35, 1006007, false, false); // You have already chosen:
|
||||
this.AddLabel(370, 142, 50, cur.ToString());
|
||||
|
||||
RewardCategory[] categories = RewardSystem.Categories;
|
||||
|
||||
int page = 2;
|
||||
|
||||
for (int i = 0; i < categories.Length; ++i)
|
||||
{
|
||||
if (!RewardSystem.HasAccess(this.m_From, categories[i]))
|
||||
{
|
||||
page += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
this.AddButton(100, 180 + (i * 40), 4005, 4005, 0, GumpButtonType.Page, page);
|
||||
|
||||
page += this.PagesPerCategory(categories[i]);
|
||||
|
||||
if (categories[i].NameString != null)
|
||||
this.AddHtml(135, 180 + (i * 40), 300, 20, categories[i].NameString, false, false);
|
||||
else
|
||||
this.AddHtmlLocalized(135, 180 + (i * 40), 300, 20, categories[i].Name, false, false);
|
||||
}
|
||||
|
||||
page = 2;
|
||||
|
||||
for (int i = 0; i < categories.Length; ++i)
|
||||
this.RenderCategory(categories[i], i, ref page);
|
||||
}
|
||||
|
||||
private int PagesPerCategory(RewardCategory category)
|
||||
{
|
||||
List<RewardEntry> entries = category.Entries;
|
||||
int j = 0, i = 0;
|
||||
|
||||
for (j = 0; j < entries.Count; j++)
|
||||
{
|
||||
if (RewardSystem.HasAccess(this.m_From, entries[j]))
|
||||
i++;
|
||||
}
|
||||
|
||||
return (int)Math.Ceiling(i / 24.0);
|
||||
}
|
||||
|
||||
private int GetButtonID(int type, int index)
|
||||
{
|
||||
return 2 + (index * 20) + type;
|
||||
}
|
||||
|
||||
private void RenderCategory(RewardCategory category, int index, ref int page)
|
||||
{
|
||||
this.AddPage(page);
|
||||
|
||||
List<RewardEntry> entries = category.Entries;
|
||||
|
||||
int i = 0;
|
||||
|
||||
for (int j = 0; j < entries.Count; ++j)
|
||||
{
|
||||
RewardEntry entry = entries[j];
|
||||
|
||||
if (!RewardSystem.HasAccess(this.m_From, entry))
|
||||
continue;
|
||||
|
||||
if (i == 24)
|
||||
{
|
||||
this.AddButton(305, 415, 0xFA5, 0xFA7, 0, GumpButtonType.Page, ++page);
|
||||
this.AddHtmlLocalized(340, 415, 200, 20, 1011066, false, false); // Next page
|
||||
|
||||
this.AddPage(page);
|
||||
|
||||
this.AddButton(270, 415, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1);
|
||||
this.AddHtmlLocalized(185, 415, 200, 20, 1011067, false, false); // Previous page
|
||||
|
||||
i = 0;
|
||||
}
|
||||
|
||||
this.AddButton(55 + ((i / 12) * 250), 80 + ((i % 12) * 25), 5540, 5541, this.GetButtonID(index, j), GumpButtonType.Reply, 0);
|
||||
|
||||
if (entry.NameString != null)
|
||||
this.AddHtml(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.NameString, false, false);
|
||||
else
|
||||
this.AddHtmlLocalized(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.Name, false, false);
|
||||
++i;
|
||||
}
|
||||
|
||||
page += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
87
Scripts/Services/VeteranRewards/RewardConfirmGump.cs
Normal file
87
Scripts/Services/VeteranRewards/RewardConfirmGump.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardConfirmGump : Gump
|
||||
{
|
||||
private readonly Mobile m_From;
|
||||
private readonly RewardEntry m_Entry;
|
||||
public RewardConfirmGump(Mobile from, RewardEntry entry)
|
||||
: base(0, 0)
|
||||
{
|
||||
this.m_From = from;
|
||||
this.m_Entry = entry;
|
||||
|
||||
from.CloseGump(typeof(RewardConfirmGump));
|
||||
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(10, 10, 500, 300, 2600);
|
||||
|
||||
this.AddHtmlLocalized(30, 55, 300, 35, 1006000, false, false); // You have selected:
|
||||
|
||||
if (entry.NameString != null)
|
||||
this.AddHtml(335, 55, 150, 35, entry.NameString, false, false);
|
||||
else
|
||||
this.AddHtmlLocalized(335, 55, 150, 35, entry.Name, false, false);
|
||||
|
||||
this.AddHtmlLocalized(30, 95, 300, 35, 1006001, false, false); // This will be assigned to this character:
|
||||
this.AddLabel(335, 95, 0, from.Name);
|
||||
|
||||
this.AddHtmlLocalized(35, 160, 450, 90, 1006002, true, true); // Are you sure you wish to select this reward for this character? You will not be able to transfer this reward to another character on another shard. Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.
|
||||
|
||||
this.AddButton(60, 265, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(95, 266, 150, 35, 1006044, false, false); // Ok
|
||||
|
||||
this.AddButton(295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(330, 266, 150, 35, 1006045, false, false); // Cancel
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
if (!RewardSystem.HasAccess(this.m_From, this.m_Entry))
|
||||
return;
|
||||
|
||||
Item item = this.m_Entry.Construct();
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
if (item is Server.Items.RedSoulstone)
|
||||
((Server.Items.RedSoulstone)item).Account = this.m_From.Account.Username;
|
||||
|
||||
if (item is Server.Items.LighthouseAddonDeed)
|
||||
((Server.Items.LighthouseAddonDeed)item).Account = this.m_From.Account.Username;
|
||||
|
||||
if (RewardSystem.ConsumeRewardPoint(this.m_From))
|
||||
{
|
||||
#region TOL
|
||||
if (item is Server.Engines.Auction.AuctionSafeDeed)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Item it = m_Entry.Construct();
|
||||
m_From.AddToBackpack(it);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
this.m_From.AddToBackpack(item);
|
||||
}
|
||||
else
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
int cur, max;
|
||||
|
||||
RewardSystem.ComputeRewardInfo(this.m_From, out cur, out max);
|
||||
|
||||
if (cur < max)
|
||||
this.m_From.SendGump(new RewardNoticeGump(this.m_From));
|
||||
}
|
||||
}
|
||||
}
|
||||
71
Scripts/Services/VeteranRewards/RewardDemolitionGump.cs
Normal file
71
Scripts/Services/VeteranRewards/RewardDemolitionGump.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class RewardDemolitionGump : Gump
|
||||
{
|
||||
private readonly IAddon m_Addon;
|
||||
public RewardDemolitionGump(IAddon addon, int question)
|
||||
: base(150, 50)
|
||||
{
|
||||
m_Addon = addon;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddBackground(0, 0, 220, 170, 0x13BE);
|
||||
AddBackground(10, 10, 200, 150, 0xBB8);
|
||||
|
||||
AddHtmlLocalized(20, 30, 180, 60, question, false, false); // Do you wish to re-deed this decoration?
|
||||
|
||||
AddHtmlLocalized(55, 100, 150, 25, 1011011, false, false); // CONTINUE
|
||||
AddButton(20, 100, 0xFA5, 0xFA7, (int)Buttons.Confirm, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtmlLocalized(55, 125, 150, 25, 1011012, false, false); // CANCEL
|
||||
AddButton(20, 125, 0xFA5, 0xFA7, (int)Buttons.Cancel, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
private enum Buttons
|
||||
{
|
||||
Cancel,
|
||||
Confirm,
|
||||
}
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Item item = m_Addon as Item;
|
||||
|
||||
if (item == null || item.Deleted)
|
||||
return;
|
||||
|
||||
if (info.ButtonID == (int)Buttons.Confirm)
|
||||
{
|
||||
Mobile m = sender.Mobile;
|
||||
BaseHouse house = BaseHouse.FindHouseAt(m);
|
||||
|
||||
if (house != null && (house.IsOwner(m) || (house.Addons.ContainsKey(item) && house.Addons[item] == m)))
|
||||
{
|
||||
if (m.InRange(item.Location, 2))
|
||||
{
|
||||
Item deed = m_Addon.Deed;
|
||||
|
||||
if (deed != null)
|
||||
{
|
||||
m.AddToBackpack(deed);
|
||||
house.Addons.Remove(item);
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
else
|
||||
m.SendLocalizedMessage(1049784); // You can only re-deed this decoration if you are the house owner or originally placed the decoration.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
125
Scripts/Services/VeteranRewards/RewardEntry.cs
Normal file
125
Scripts/Services/VeteranRewards/RewardEntry.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardEntry
|
||||
{
|
||||
private readonly RewardCategory m_Category;
|
||||
private readonly Type m_ItemType;
|
||||
private readonly Expansion m_RequiredExpansion;
|
||||
private readonly int m_Name;
|
||||
private readonly string m_NameString;
|
||||
private readonly object[] m_Args;
|
||||
private RewardList m_List;
|
||||
public RewardEntry(RewardCategory category, int name, Type itemType, params object[] args)
|
||||
{
|
||||
this.m_Category = category;
|
||||
this.m_ItemType = itemType;
|
||||
this.m_RequiredExpansion = Expansion.None;
|
||||
this.m_Name = name;
|
||||
this.m_Args = args;
|
||||
category.Entries.Add(this);
|
||||
}
|
||||
|
||||
public RewardEntry(RewardCategory category, string name, Type itemType, params object[] args)
|
||||
{
|
||||
this.m_Category = category;
|
||||
this.m_ItemType = itemType;
|
||||
this.m_RequiredExpansion = Expansion.None;
|
||||
this.m_NameString = name;
|
||||
this.m_Args = args;
|
||||
category.Entries.Add(this);
|
||||
}
|
||||
|
||||
public RewardEntry(RewardCategory category, int name, Type itemType, Expansion requiredExpansion, params object[] args)
|
||||
{
|
||||
this.m_Category = category;
|
||||
this.m_ItemType = itemType;
|
||||
this.m_RequiredExpansion = requiredExpansion;
|
||||
this.m_Name = name;
|
||||
this.m_Args = args;
|
||||
category.Entries.Add(this);
|
||||
}
|
||||
|
||||
public RewardEntry(RewardCategory category, string name, Type itemType, Expansion requiredExpansion, params object[] args)
|
||||
{
|
||||
this.m_Category = category;
|
||||
this.m_ItemType = itemType;
|
||||
this.m_RequiredExpansion = requiredExpansion;
|
||||
this.m_NameString = name;
|
||||
this.m_Args = args;
|
||||
category.Entries.Add(this);
|
||||
}
|
||||
|
||||
public RewardList List
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_List;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_List = value;
|
||||
}
|
||||
}
|
||||
public RewardCategory Category
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Category;
|
||||
}
|
||||
}
|
||||
public Type ItemType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_ItemType;
|
||||
}
|
||||
}
|
||||
public Expansion RequiredExpansion
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_RequiredExpansion;
|
||||
}
|
||||
}
|
||||
public int Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Name;
|
||||
}
|
||||
}
|
||||
public string NameString
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_NameString;
|
||||
}
|
||||
}
|
||||
public object[] Args
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Args;
|
||||
}
|
||||
}
|
||||
public Item Construct()
|
||||
{
|
||||
try
|
||||
{
|
||||
Item item = Activator.CreateInstance(this.m_ItemType, this.m_Args) as Item;
|
||||
|
||||
if (item is IRewardItem)
|
||||
((IRewardItem)item).IsRewardItem = true;
|
||||
|
||||
return item;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Services/VeteranRewards/RewardList.cs
Normal file
33
Scripts/Services/VeteranRewards/RewardList.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardList
|
||||
{
|
||||
private readonly TimeSpan m_Age;
|
||||
private readonly RewardEntry[] m_Entries;
|
||||
public RewardList(TimeSpan interval, int index, RewardEntry[] entries)
|
||||
{
|
||||
this.m_Age = TimeSpan.FromDays(interval.TotalDays * index);
|
||||
this.m_Entries = entries;
|
||||
|
||||
for (int i = 0; i < entries.Length; ++i)
|
||||
entries[i].List = this;
|
||||
}
|
||||
|
||||
public TimeSpan Age
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Age;
|
||||
}
|
||||
}
|
||||
public RewardEntry[] Entries
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Entries;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Services/VeteranRewards/RewardNoticeGump.cs
Normal file
39
Scripts/Services/VeteranRewards/RewardNoticeGump.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardNoticeGump : Gump
|
||||
{
|
||||
private readonly Mobile m_From;
|
||||
public RewardNoticeGump(Mobile from)
|
||||
: base(0, 0)
|
||||
{
|
||||
this.m_From = from;
|
||||
|
||||
from.CloseGump(typeof(RewardNoticeGump));
|
||||
|
||||
this.AddPage(0);
|
||||
|
||||
this.AddBackground(10, 10, 500, 135, 2600);
|
||||
|
||||
/* You have reward items available.
|
||||
* Click 'ok' below to get the selection menu or 'cancel' to be prompted upon your next login.
|
||||
*/
|
||||
this.AddHtmlLocalized(52, 35, 420, 55, 1006046, true, true);
|
||||
|
||||
this.AddButton(60, 95, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(95, 96, 150, 35, 1006044, false, false); // Ok
|
||||
|
||||
this.AddButton(285, 95, 4017, 4019, 0, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(320, 96, 150, 35, 1006045, false, false); // Cancel
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
this.m_From.SendGump(new RewardChoiceGump(this.m_From));
|
||||
}
|
||||
}
|
||||
}
|
||||
176
Scripts/Services/VeteranRewards/RewardOptionGump.cs
Normal file
176
Scripts/Services/VeteranRewards/RewardOptionGump.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public interface IRewardOption
|
||||
{
|
||||
void GetOptions(RewardOptionList list);
|
||||
void OnOptionSelected(Mobile from, int choice);
|
||||
}
|
||||
|
||||
public class RewardOptionGump : Gump
|
||||
{
|
||||
private readonly RewardOptionList m_Options = new RewardOptionList();
|
||||
private readonly IRewardOption m_Option;
|
||||
|
||||
public RewardOptionGump(IRewardOption option)
|
||||
: this(option, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public RewardOptionGump(IRewardOption option, int title)
|
||||
: base(60, 36)
|
||||
{
|
||||
m_Option = option;
|
||||
|
||||
if (m_Option != null)
|
||||
m_Option.GetOptions(m_Options);
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 273, 324, 0x13BE);
|
||||
AddImageTiled(10, 10, 253, 20, 0xA40);
|
||||
AddImageTiled(10, 40, 253, 244, 0xA40);
|
||||
AddImageTiled(10, 294, 253, 20, 0xA40);
|
||||
AddAlphaRegion(10, 10, 253, 304);
|
||||
|
||||
AddButton(10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
|
||||
if (title > 0)
|
||||
AddHtmlLocalized(14, 12, 273, 20, title, 0x7FFF, false, false);
|
||||
else
|
||||
AddHtmlLocalized(14, 12, 273, 20, 1080392, 0x7FFF, false, false); // Select your choice from the menu below.
|
||||
|
||||
AddPage(1);
|
||||
|
||||
for (int i = 0; i < m_Options.Count; i++)
|
||||
{
|
||||
AddButton(19, 49 + i * 24, 0x845, 0x846, m_Options[i].ID, GumpButtonType.Reply, 0);
|
||||
|
||||
if(m_Options[i].Cliloc.Number > 0)
|
||||
AddHtmlLocalized(44, 47 + i * 24, 213, 20, m_Options[i].Cliloc.Number, 0x7FFF, false, false);
|
||||
else
|
||||
AddHtml(44, 47 + i * 24, 213, 20, String.Format("<basefont color=#FFFFFF>{0}", m_Options[i].Text), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Option != null && Contains(info.ButtonID))
|
||||
m_Option.OnOptionSelected(sender.Mobile, info.ButtonID);
|
||||
}
|
||||
|
||||
private bool Contains(int chosen)
|
||||
{
|
||||
if (m_Options == null)
|
||||
return false;
|
||||
|
||||
foreach (RewardOption option in m_Options)
|
||||
{
|
||||
if (option.ID == chosen)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class AddonOptionGump : Gump
|
||||
{
|
||||
private readonly RewardOptionList m_Options = new RewardOptionList();
|
||||
private readonly IRewardOption m_Option;
|
||||
|
||||
public AddonOptionGump(IRewardOption option)
|
||||
: this(option, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public AddonOptionGump(IRewardOption option, int title)
|
||||
: this(option, title, 300, 80)
|
||||
{
|
||||
}
|
||||
|
||||
public AddonOptionGump(IRewardOption option, int title, int bgw, int bgh)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Option = option;
|
||||
|
||||
if (m_Option != null)
|
||||
m_Option.GetOptions(m_Options);
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, bgw, bgh, 0xA28);
|
||||
|
||||
if (title > 0)
|
||||
AddHtmlLocalized(30, 30, 240, 20, 1113302, String.Format("#{0}", title), 0x0, false, false); // <CENTER>~1_VAL~</CENTER>
|
||||
else
|
||||
AddHtmlLocalized(30, 30, 240, 20, 1113302, "#1080392", 0x0, false, false); // Select your choice from the menu below.
|
||||
|
||||
for (int i = 0; i < m_Options.Count; i++)
|
||||
{
|
||||
AddButton(30, 70 + i * 20, 0xFA5, 0xFA7, m_Options[i].ID, GumpButtonType.Reply, 0);
|
||||
|
||||
if (m_Options[i].Cliloc.Number > 0)
|
||||
AddHtmlLocalized(70, 70 + i * 20, 150, 20, m_Options[i].Cliloc.Number, 0x0, false, false);
|
||||
else
|
||||
AddHtml(70, 70 + i * 20, 150, 20, String.Format("<basefont color=#000000>{0}", m_Options[i].Text), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Option != null && Contains(info.ButtonID))
|
||||
m_Option.OnOptionSelected(sender.Mobile, info.ButtonID);
|
||||
}
|
||||
|
||||
private bool Contains(int chosen)
|
||||
{
|
||||
if (m_Options == null)
|
||||
return false;
|
||||
|
||||
foreach (RewardOption option in m_Options)
|
||||
{
|
||||
if (option.ID == chosen)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class RewardOption
|
||||
{
|
||||
public RewardOption(int id, TextDefinition cliloc, string text)
|
||||
{
|
||||
ID = id;
|
||||
Cliloc = cliloc;
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public int ID { get; set; }
|
||||
public TextDefinition Cliloc { get; set; }
|
||||
public string Text { get; set; }
|
||||
}
|
||||
|
||||
public class RewardOptionList : List<RewardOption>
|
||||
{
|
||||
public RewardOptionList()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public void Add(int id, TextDefinition cliloc)
|
||||
{
|
||||
Add(new RewardOption(id, cliloc, null));
|
||||
}
|
||||
|
||||
public void Add(int id, string text)
|
||||
{
|
||||
Add(new RewardOption(id, 0, text));
|
||||
}
|
||||
}
|
||||
}
|
||||
685
Scripts/Services/VeteranRewards/RewardSystem.cs
Normal file
685
Scripts/Services/VeteranRewards/RewardSystem.cs
Normal file
@@ -0,0 +1,685 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Accounting;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public interface IRewardItem
|
||||
{
|
||||
bool IsRewardItem { get; set; }
|
||||
}
|
||||
|
||||
public class RewardSystem
|
||||
{
|
||||
public static bool Enabled = Config.Get("VetRewards.Enabled", true);
|
||||
public static bool SkillCapRewards = Config.Get("VetRewards.SkillCapRewards", true);
|
||||
public static int SkillCap = Config.Get("PlayerCaps.TotalSkillCap", 7000);
|
||||
public static int SkillCapBonus = Config.Get("VetRewards.SkillCapBonus", 200);
|
||||
public static int SkillCapBonusLevels = Config.Get("VetRewards.SkillCapBonusLevels", 4);
|
||||
public static float SkillCapBonusIncrement = SkillCapBonus / SkillCapBonusLevels;
|
||||
public static TimeSpan RewardInterval = Config.Get("VetRewards.RewardInterval", TimeSpan.FromDays(30.0d));
|
||||
public static int StartingLevel = Config.Get("VetRewards.StartingLevel", 0);
|
||||
|
||||
private static RewardCategory[] m_Categories;
|
||||
private static RewardList[] m_Lists;
|
||||
public static RewardCategory[] Categories
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Categories == null)
|
||||
SetupRewardTables();
|
||||
|
||||
return m_Categories;
|
||||
}
|
||||
}
|
||||
public static RewardList[] Lists
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Lists == null)
|
||||
SetupRewardTables();
|
||||
|
||||
return m_Lists;
|
||||
}
|
||||
}
|
||||
public static bool HasAccess(Mobile mob, RewardCategory category)
|
||||
{
|
||||
List<RewardEntry> entries = category.Entries;
|
||||
|
||||
for (int j = 0; j < entries.Count; ++j)
|
||||
{
|
||||
//RewardEntry entry = entries[j];
|
||||
if (RewardSystem.HasAccess(mob, entries[j]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasAccess(Mobile mob, RewardEntry entry)
|
||||
{
|
||||
if (Core.Expansion < entry.RequiredExpansion)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TimeSpan ts;
|
||||
return HasAccess(mob, entry.List, out ts);
|
||||
}
|
||||
|
||||
public static bool HasAccess(Mobile mob, RewardList list, out TimeSpan ts)
|
||||
{
|
||||
if (list == null)
|
||||
{
|
||||
ts = TimeSpan.Zero;
|
||||
return false;
|
||||
}
|
||||
|
||||
Account acct = mob.Account as Account;
|
||||
|
||||
if (acct == null)
|
||||
{
|
||||
ts = TimeSpan.Zero;
|
||||
return false;
|
||||
}
|
||||
|
||||
TimeSpan totalTime = (DateTime.UtcNow - acct.Created) + TimeSpan.FromDays(RewardInterval.TotalDays * StartingLevel);
|
||||
|
||||
ts = (list.Age - totalTime);
|
||||
|
||||
|
||||
if (ts <= TimeSpan.Zero)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetRewardLevel(Mobile mob)
|
||||
{
|
||||
Account acct = mob.Account as Account;
|
||||
|
||||
if (acct == null)
|
||||
return 0;
|
||||
|
||||
return GetRewardLevel(acct);
|
||||
}
|
||||
|
||||
public static int GetRewardLevel(Account acct)
|
||||
{
|
||||
TimeSpan totalTime = (DateTime.UtcNow - acct.Created);
|
||||
TimeSpan ositotalTime = (DateTime.UtcNow - new DateTime(1997, 9, 24));
|
||||
|
||||
int level = (int)(totalTime.TotalDays / RewardInterval.TotalDays);
|
||||
int levelosi = (int)(ositotalTime.TotalDays / 365);
|
||||
|
||||
if (level < 0)
|
||||
level = 0;
|
||||
|
||||
level += StartingLevel;
|
||||
|
||||
return Math.Min(level, levelosi);
|
||||
}
|
||||
|
||||
public static bool HasHalfLevel(Mobile mob)
|
||||
{
|
||||
Account acct = mob.Account as Account;
|
||||
|
||||
if (acct == null)
|
||||
return false;
|
||||
|
||||
TimeSpan totalTime = (DateTime.UtcNow - acct.Created);
|
||||
|
||||
Double level = (totalTime.TotalDays / RewardInterval.TotalDays);
|
||||
|
||||
return level >= 0.5;
|
||||
}
|
||||
|
||||
public static bool ConsumeRewardPoint(Mobile mob)
|
||||
{
|
||||
int cur, max;
|
||||
|
||||
ComputeRewardInfo(mob, out cur, out max);
|
||||
|
||||
if (cur >= max)
|
||||
return false;
|
||||
|
||||
Account acct = mob.Account as Account;
|
||||
|
||||
if (acct == null)
|
||||
return false;
|
||||
|
||||
//if ( mob.AccessLevel < AccessLevel.GameMaster )
|
||||
acct.SetTag("numRewardsChosen", (cur + 1).ToString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void ComputeRewardInfo(Mobile mob, out int cur, out int max)
|
||||
{
|
||||
int level;
|
||||
|
||||
ComputeRewardInfo(mob, out cur, out max, out level);
|
||||
}
|
||||
|
||||
public static void ComputeRewardInfo(Mobile mob, out int cur, out int max, out int level)
|
||||
{
|
||||
Account acct = mob.Account as Account;
|
||||
|
||||
if (acct == null)
|
||||
{
|
||||
cur = max = level = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
level = GetRewardLevel(acct);
|
||||
|
||||
if (level == 0)
|
||||
{
|
||||
cur = max = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
string tag = acct.GetTag("numRewardsChosen");
|
||||
|
||||
if (String.IsNullOrEmpty(tag))
|
||||
cur = 0;
|
||||
else
|
||||
cur = Utility.ToInt32(tag);
|
||||
|
||||
if (level >= 6)
|
||||
max = 9 + ((level - 6) * 2);
|
||||
else
|
||||
max = 2 + level;
|
||||
}
|
||||
|
||||
public static bool CheckIsUsableBy(Mobile from, Item item, object[] args)
|
||||
{
|
||||
if (from.AccessLevel > AccessLevel.GameMaster || UseableByAnyone(item.GetType()))
|
||||
return true;
|
||||
|
||||
if (m_Lists == null)
|
||||
SetupRewardTables();
|
||||
|
||||
Type type = item.GetType();
|
||||
|
||||
for (int i = 0; i < m_Lists.Length; ++i)
|
||||
{
|
||||
RewardList list = m_Lists[i];
|
||||
RewardEntry[] entries = list.Entries;
|
||||
TimeSpan ts;
|
||||
|
||||
for (int j = 0; j < entries.Length; ++j)
|
||||
{
|
||||
if (entries[j].ItemType == type)
|
||||
{
|
||||
if (args == null && entries[j].Args.Length == 0)
|
||||
{
|
||||
if (i > 0 && !HasAccess(from, list, out ts))
|
||||
{
|
||||
from.SendLocalizedMessage(1008126, true, Math.Ceiling(ts.TotalDays / 30.0).ToString()); // Your account is not old enough to use this item. Months until you can use this item :
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.Length == entries[j].Args.Length)
|
||||
{
|
||||
bool match = true;
|
||||
|
||||
for (int k = 0; match && k < args.Length; ++k)
|
||||
match = (args[k].Equals(entries[j].Args[k]));
|
||||
|
||||
if (match)
|
||||
{
|
||||
if (i > 0 && !HasAccess(from, list, out ts))
|
||||
{
|
||||
from.SendLocalizedMessage(1008126, true, Math.Ceiling(ts.TotalDays / 30.0).ToString()); // Your account is not old enough to use this item. Months until you can use this item :
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no entry?
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool UseableByAnyone(Type type)
|
||||
{
|
||||
foreach (Type t in _AnyoneTypes)
|
||||
{
|
||||
if (t == type || type.IsSubclassOf(t))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static Type[] _AnyoneTypes =
|
||||
{
|
||||
typeof(DyeTub), typeof(MonsterStatuette)
|
||||
};
|
||||
|
||||
public static int GetRewardYearLabel(Item item, object[] args)
|
||||
{
|
||||
int level = GetRewardYear(item, args);
|
||||
|
||||
return 1076216 + ((level < 10) ? level : (level < 12) ? ((level - 9) + 4240) : ((level - 11) + 37585));
|
||||
}
|
||||
|
||||
public static int GetRewardYear(Item item, object[] args)
|
||||
{
|
||||
if (m_Lists == null)
|
||||
SetupRewardTables();
|
||||
|
||||
Type type = item.GetType();
|
||||
|
||||
for (int i = 0; i < m_Lists.Length; ++i)
|
||||
{
|
||||
RewardList list = m_Lists[i];
|
||||
RewardEntry[] entries = list.Entries;
|
||||
|
||||
for (int j = 0; j < entries.Length; ++j)
|
||||
{
|
||||
if (entries[j].ItemType == type)
|
||||
{
|
||||
if (args == null && entries[j].Args.Length == 0)
|
||||
return i + 1;
|
||||
|
||||
if (args.Length == entries[j].Args.Length)
|
||||
{
|
||||
bool match = true;
|
||||
|
||||
for (int k = 0; match && k < args.Length; ++k)
|
||||
match = (args[k].Equals(entries[j].Args[k]));
|
||||
|
||||
if (match)
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no entry?
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void SetupRewardTables()
|
||||
{
|
||||
RewardCategory monsterStatues = new RewardCategory(1049750);
|
||||
RewardCategory cloaksAndRobes = new RewardCategory(1049752);
|
||||
RewardCategory etherealSteeds = new RewardCategory(1049751);
|
||||
RewardCategory specialDyeTubs = new RewardCategory(1049753);
|
||||
RewardCategory houseAddOns = new RewardCategory(1049754);
|
||||
RewardCategory miscellaneous = new RewardCategory(1078596);
|
||||
|
||||
m_Categories = new RewardCategory[]
|
||||
{
|
||||
monsterStatues,
|
||||
cloaksAndRobes,
|
||||
etherealSteeds,
|
||||
specialDyeTubs,
|
||||
houseAddOns,
|
||||
miscellaneous
|
||||
};
|
||||
|
||||
const int Bronze = 0x972;
|
||||
const int Copper = 0x96D;
|
||||
const int Golden = 0x8A5;
|
||||
const int Agapite = 0x979;
|
||||
const int Verite = 0x89F;
|
||||
const int Valorite = 0x8AB;
|
||||
const int IceGreen = 0x47F;
|
||||
const int IceBlue = 0x482;
|
||||
const int DarkGray = 0x497;
|
||||
const int Fire = 0x489;
|
||||
const int IceWhite = 0x47E;
|
||||
const int JetBlack = 0x001;
|
||||
const int Pink = 0x490;
|
||||
const int Crimson = 0x485;
|
||||
const int GreenForest = 0x4A9;
|
||||
const int RoyalBlue = 0x538;
|
||||
|
||||
m_Lists = new RewardList[]
|
||||
{
|
||||
new RewardList(RewardInterval, 1, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(specialDyeTubs, 1006008, typeof(RewardBlackDyeTub)),
|
||||
new RewardEntry(specialDyeTubs, 1006013, typeof(FurnitureDyeTub)),
|
||||
new RewardEntry(specialDyeTubs, 1006047, typeof(SpecialDyeTub)),
|
||||
|
||||
new RewardEntry(cloaksAndRobes, 1006009, typeof(RewardCloak), Bronze, 1041286),
|
||||
new RewardEntry(cloaksAndRobes, 1006010, typeof(RewardRobe), Bronze, 1041287),
|
||||
new RewardEntry(cloaksAndRobes, 1113874, typeof(RewardGargishFancyRobe), Expansion.SA, Bronze, 1113874),
|
||||
new RewardEntry(cloaksAndRobes, 1113875, typeof(RewardGargishRobe), Expansion.SA, Bronze, 1113875),
|
||||
new RewardEntry(cloaksAndRobes, 1080366, typeof(RewardDress), Expansion.ML, Bronze, 1080366),
|
||||
new RewardEntry(cloaksAndRobes, 1006011, typeof(RewardCloak), Copper, 1041288),
|
||||
new RewardEntry(cloaksAndRobes, 1006012, typeof(RewardRobe), Copper, 1041289),
|
||||
new RewardEntry(cloaksAndRobes, 1113876, typeof(RewardGargishFancyRobe), Expansion.SA, Copper, 1113876),
|
||||
new RewardEntry(cloaksAndRobes, 1113877, typeof(RewardGargishRobe), Expansion.SA, Copper, 1113877),
|
||||
new RewardEntry(cloaksAndRobes, 1080367, typeof(RewardDress), Expansion.ML, Copper, 1080367),
|
||||
|
||||
new RewardEntry(monsterStatues, 1006024, typeof(MonsterStatuette), MonsterStatuetteType.Crocodile),
|
||||
new RewardEntry(monsterStatues, 1006025, typeof(MonsterStatuette), MonsterStatuetteType.Daemon),
|
||||
new RewardEntry(monsterStatues, 1006026, typeof(MonsterStatuette), MonsterStatuetteType.Dragon),
|
||||
new RewardEntry(monsterStatues, 1006027, typeof(MonsterStatuette), MonsterStatuetteType.EarthElemental),
|
||||
new RewardEntry(monsterStatues, 1006028, typeof(MonsterStatuette), MonsterStatuetteType.Ettin),
|
||||
new RewardEntry(monsterStatues, 1006029, typeof(MonsterStatuette), MonsterStatuetteType.Gargoyle),
|
||||
new RewardEntry(monsterStatues, 1006030, typeof(MonsterStatuette), MonsterStatuetteType.Gorilla),
|
||||
new RewardEntry(monsterStatues, 1006031, typeof(MonsterStatuette), MonsterStatuetteType.Lich),
|
||||
new RewardEntry(monsterStatues, 1006032, typeof(MonsterStatuette), MonsterStatuetteType.Lizardman),
|
||||
new RewardEntry(monsterStatues, 1006033, typeof(MonsterStatuette), MonsterStatuetteType.Ogre),
|
||||
new RewardEntry(monsterStatues, 1006034, typeof(MonsterStatuette), MonsterStatuetteType.Orc),
|
||||
new RewardEntry(monsterStatues, 1006035, typeof(MonsterStatuette), MonsterStatuetteType.Ratman),
|
||||
new RewardEntry(monsterStatues, 1006036, typeof(MonsterStatuette), MonsterStatuetteType.Skeleton),
|
||||
new RewardEntry(monsterStatues, 1006037, typeof(MonsterStatuette), MonsterStatuetteType.Troll),
|
||||
new RewardEntry(monsterStatues, 1155746, typeof(MonsterStatuette), MonsterStatuetteType.FleshRenderer),
|
||||
new RewardEntry(monsterStatues, 1156367, typeof(MonsterStatuette), Expansion.TOL, MonsterStatuetteType.DragonTurtle),
|
||||
new RewardEntry(monsterStatues, 1158875, typeof(MonsterStatuette), Expansion.EJ, MonsterStatuetteType.Krampus),
|
||||
new RewardEntry(monsterStatues, 1159417, typeof(MonsterStatuette), Expansion.EJ, MonsterStatuetteType.Pig),
|
||||
|
||||
new RewardEntry(etherealSteeds, 1006019, typeof(EtherealHorse)),
|
||||
|
||||
new RewardEntry(houseAddOns, 1062692, typeof(ContestMiniHouseDeed), Expansion.AOS, MiniHouseType.MalasMountainPass),
|
||||
new RewardEntry(houseAddOns, 1072216, typeof(ContestMiniHouseDeed), Expansion.SE, MiniHouseType.ChurchAtNight),
|
||||
|
||||
new RewardEntry(miscellaneous, 1076155, typeof(RedSoulstone), Expansion.ML),
|
||||
new RewardEntry(miscellaneous, 1080523, typeof(CommodityDeedBox), Expansion.ML),
|
||||
new RewardEntry(miscellaneous, 1113945, typeof(CrystalPortal), Expansion.SA),
|
||||
new RewardEntry(miscellaneous, 1150074, typeof(CorruptedCrystalPortal), Expansion.SA),
|
||||
|
||||
new RewardEntry(miscellaneous, 1123603, typeof(CoralTheOwl), Expansion.ML),
|
||||
new RewardEntry(miscellaneous, 1151769, typeof(GreaterBraceletOfBinding), Expansion.ML),
|
||||
new RewardEntry(miscellaneous, 1156371, typeof(Auction.AuctionSafeDeed), Expansion.TOL),
|
||||
}),
|
||||
new RewardList(RewardInterval, 2, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(specialDyeTubs, 1006052, typeof(LeatherDyeTub)),
|
||||
|
||||
new RewardEntry(cloaksAndRobes, 1006014, typeof(RewardCloak), Agapite, 1041290),
|
||||
new RewardEntry(cloaksAndRobes, 1006015, typeof(RewardRobe), Agapite, 1041291),
|
||||
new RewardEntry(cloaksAndRobes, 1113878, typeof(RewardGargishFancyRobe), Expansion.SA, Agapite, 1113878),
|
||||
new RewardEntry(cloaksAndRobes, 1113879, typeof(RewardGargishRobe), Expansion.SA, Agapite, 1113879),
|
||||
new RewardEntry(cloaksAndRobes, 1080369, typeof(RewardDress), Expansion.ML, Agapite, 1080369),
|
||||
new RewardEntry(cloaksAndRobes, 1006016, typeof(RewardCloak), Golden, 1041292),
|
||||
new RewardEntry(cloaksAndRobes, 1006017, typeof(RewardRobe), Golden, 1041293),
|
||||
new RewardEntry(cloaksAndRobes, 1113880, typeof(RewardGargishFancyRobe), Expansion.SA, Golden, 1113880),
|
||||
new RewardEntry(cloaksAndRobes, 1113881, typeof(RewardGargishRobe), Expansion.SA, Golden, 1113881),
|
||||
new RewardEntry(cloaksAndRobes, 1080368, typeof(RewardDress), Expansion.ML, Golden, 1080368),
|
||||
|
||||
new RewardEntry(monsterStatues, 1155747, typeof(MonsterStatuette), MonsterStatuetteType.CrystalElemental),
|
||||
new RewardEntry(monsterStatues, 1157078, typeof(MonsterStatuette), Expansion.TOL, MonsterStatuetteType.TRex),
|
||||
new RewardEntry(monsterStatues, 1158877, typeof(MonsterStatuette), Expansion.EJ, MonsterStatuetteType.KhalAnkur),
|
||||
new RewardEntry(monsterStatues, 1159418, typeof(MonsterStatuette), Expansion.EJ, MonsterStatuetteType.Goat),
|
||||
|
||||
new RewardEntry(houseAddOns, 1006048, typeof(BannerDeed)),
|
||||
new RewardEntry(houseAddOns, 1006049, typeof(FlamingHeadDeed)),
|
||||
new RewardEntry(houseAddOns, 1080409, typeof(MinotaurStatueDeed), Expansion.ML)
|
||||
}),
|
||||
new RewardList(RewardInterval, 3, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(cloaksAndRobes, 1006020, typeof(RewardCloak), Verite, 1041294),
|
||||
new RewardEntry(cloaksAndRobes, 1006021, typeof(RewardRobe), Verite, 1041295),
|
||||
new RewardEntry(cloaksAndRobes, 1113882, typeof(RewardGargishFancyRobe), Expansion.SA, Verite, 1113882),
|
||||
new RewardEntry(cloaksAndRobes, 1113883, typeof(RewardGargishRobe), Expansion.SA, Verite, 1113883),
|
||||
new RewardEntry(cloaksAndRobes, 1080370, typeof(RewardDress), Expansion.ML, Verite, 1080370),
|
||||
new RewardEntry(cloaksAndRobes, 1006022, typeof(RewardCloak), Valorite, 1041296),
|
||||
new RewardEntry(cloaksAndRobes, 1113884, typeof(RewardGargishFancyRobe), Expansion.SA, Valorite, 1113884),
|
||||
new RewardEntry(cloaksAndRobes, 1113885, typeof(RewardGargishRobe), Expansion.SA, Valorite, 1113885),
|
||||
new RewardEntry(cloaksAndRobes, 1006023, typeof(RewardRobe), Valorite, 1041297),
|
||||
new RewardEntry(cloaksAndRobes, 1080371, typeof(RewardDress), Expansion.ML, Valorite, 1080371),
|
||||
|
||||
new RewardEntry(monsterStatues, 1006038, typeof(MonsterStatuette), MonsterStatuetteType.Cow),
|
||||
new RewardEntry(monsterStatues, 1006039, typeof(MonsterStatuette), MonsterStatuetteType.Zombie),
|
||||
new RewardEntry(monsterStatues, 1006040, typeof(MonsterStatuette), MonsterStatuetteType.Llama),
|
||||
new RewardEntry(monsterStatues, 1155748, typeof(MonsterStatuette), MonsterStatuetteType.DarkFather),
|
||||
new RewardEntry(monsterStatues, 1157079, typeof(MonsterStatuette), Expansion.TOL, MonsterStatuetteType.Zipactriotal),
|
||||
new RewardEntry(monsterStatues, 1158876, typeof(MonsterStatuette), Expansion.EJ, MonsterStatuetteType.KrampusMinion),
|
||||
new RewardEntry(monsterStatues, 1159419, typeof(MonsterStatuette), Expansion.EJ, MonsterStatuetteType.IceFiend),
|
||||
|
||||
|
||||
new RewardEntry(etherealSteeds, 1006051, typeof(EtherealLlama)),
|
||||
new RewardEntry(etherealSteeds, 1006050, typeof(EtherealOstard)),
|
||||
|
||||
new RewardEntry(houseAddOns, 1080407, typeof(PottedCactusDeed), Expansion.ML)
|
||||
}),
|
||||
new RewardList(RewardInterval, 4, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(specialDyeTubs, 1049740, typeof(RunebookDyeTub)),
|
||||
|
||||
new RewardEntry(cloaksAndRobes, 1049725, typeof(RewardCloak), DarkGray, 1049757),
|
||||
new RewardEntry(cloaksAndRobes, 1049726, typeof(RewardRobe), DarkGray, 1049756),
|
||||
new RewardEntry(cloaksAndRobes, 1113886, typeof(RewardGargishFancyRobe), Expansion.SA, DarkGray, 1113886),
|
||||
new RewardEntry(cloaksAndRobes, 1113887, typeof(RewardGargishRobe), Expansion.SA, DarkGray, 1113887),
|
||||
new RewardEntry(cloaksAndRobes, 1080374, typeof(RewardDress), Expansion.ML, DarkGray, 1080374),
|
||||
new RewardEntry(cloaksAndRobes, 1049727, typeof(RewardCloak), IceGreen, 1049759),
|
||||
new RewardEntry(cloaksAndRobes, 1049728, typeof(RewardRobe), IceGreen, 1049758),
|
||||
new RewardEntry(cloaksAndRobes, 1113888, typeof(RewardGargishFancyRobe), Expansion.SA, IceGreen, 1113888),
|
||||
new RewardEntry(cloaksAndRobes, 1113889, typeof(RewardGargishRobe), Expansion.SA, IceGreen, 1113889),
|
||||
new RewardEntry(cloaksAndRobes, 1080372, typeof(RewardDress), Expansion.ML, IceGreen, 1080372),
|
||||
new RewardEntry(cloaksAndRobes, 1049729, typeof(RewardCloak), IceBlue, 1049761),
|
||||
new RewardEntry(cloaksAndRobes, 1049730, typeof(RewardRobe), IceBlue, 1049760),
|
||||
new RewardEntry(cloaksAndRobes, 1113890, typeof(RewardGargishFancyRobe), Expansion.SA, IceBlue, 1113890),
|
||||
new RewardEntry(cloaksAndRobes, 1113891, typeof(RewardGargishRobe), Expansion.SA, IceBlue, 1113891),
|
||||
new RewardEntry(cloaksAndRobes, 1080373, typeof(RewardDress), Expansion.ML, IceBlue, 1080373),
|
||||
|
||||
new RewardEntry(monsterStatues, 1049742, typeof(MonsterStatuette), MonsterStatuetteType.Ophidian),
|
||||
new RewardEntry(monsterStatues, 1049743, typeof(MonsterStatuette), MonsterStatuetteType.Reaper),
|
||||
new RewardEntry(monsterStatues, 1049744, typeof(MonsterStatuette), MonsterStatuetteType.Mongbat),
|
||||
new RewardEntry(monsterStatues, 1155745, typeof(MonsterStatuette), MonsterStatuetteType.PlatinumDragon),
|
||||
new RewardEntry(monsterStatues, 1157993, typeof(MonsterStatuette), MonsterStatuetteType.Pyros),
|
||||
new RewardEntry(monsterStatues, 1157994, typeof(MonsterStatuette), MonsterStatuetteType.Lithos),
|
||||
new RewardEntry(monsterStatues, 1157992, typeof(MonsterStatuette), MonsterStatuetteType.Hydros),
|
||||
new RewardEntry(monsterStatues, 1157991, typeof(MonsterStatuette), MonsterStatuetteType.Stratos),
|
||||
|
||||
new RewardEntry(etherealSteeds, 1049746, typeof(EtherealKirin)),
|
||||
new RewardEntry(etherealSteeds, 1049745, typeof(EtherealUnicorn)),
|
||||
new RewardEntry(etherealSteeds, 1049747, typeof(EtherealRidgeback)),
|
||||
|
||||
new RewardEntry(houseAddOns, 1049737, typeof(DecorativeShieldDeed)),
|
||||
new RewardEntry(houseAddOns, 1049738, typeof(HangingSkeletonDeed)),
|
||||
|
||||
new RewardEntry(miscellaneous, 1098160, typeof(Plants.SeedBox)),
|
||||
new RewardEntry(miscellaneous, 1158880, typeof(EmbroideryTool), Expansion.EJ),
|
||||
}),
|
||||
new RewardList(RewardInterval, 5, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(specialDyeTubs, 1049741, typeof(StatuetteDyeTub)),
|
||||
new RewardEntry(specialDyeTubs, 1153495, typeof(MetallicLeatherDyeTub)),
|
||||
new RewardEntry(specialDyeTubs, 1150067, typeof(MetallicDyeTub)),
|
||||
new RewardEntry(cloaksAndRobes, 1049731, typeof(RewardCloak), JetBlack, 1049763),
|
||||
new RewardEntry(cloaksAndRobes, 1049732, typeof(RewardRobe), JetBlack, 1049762),
|
||||
new RewardEntry(cloaksAndRobes, 1113892, typeof(RewardGargishFancyRobe), Expansion.SA, JetBlack, 1113892),
|
||||
new RewardEntry(cloaksAndRobes, 1113893, typeof(RewardGargishRobe), Expansion.SA, JetBlack, 1113893),
|
||||
new RewardEntry(cloaksAndRobes, 1080377, typeof(RewardDress), Expansion.ML, JetBlack, 1080377),
|
||||
new RewardEntry(cloaksAndRobes, 1049733, typeof(RewardCloak), IceWhite, 1049765),
|
||||
new RewardEntry(cloaksAndRobes, 1049734, typeof(RewardRobe), IceWhite, 1049764),
|
||||
new RewardEntry(cloaksAndRobes, 1113894, typeof(RewardGargishFancyRobe), Expansion.SA, IceWhite, 1113894),
|
||||
new RewardEntry(cloaksAndRobes, 1113895, typeof(RewardGargishRobe), Expansion.SA, IceWhite, 1113895),
|
||||
new RewardEntry(cloaksAndRobes, 1080376, typeof(RewardDress), Expansion.ML, IceWhite, 1080376),
|
||||
new RewardEntry(cloaksAndRobes, 1049735, typeof(RewardCloak), Fire, 1049767),
|
||||
new RewardEntry(cloaksAndRobes, 1049736, typeof(RewardRobe), Fire, 1049766),
|
||||
new RewardEntry(cloaksAndRobes, 1113896, typeof(RewardGargishFancyRobe), Expansion.SA, Fire, 1113896),
|
||||
new RewardEntry(cloaksAndRobes, 1113897, typeof(RewardGargishRobe), Expansion.SA, Fire, 1113897),
|
||||
new RewardEntry(cloaksAndRobes, 1080375, typeof(RewardDress), Expansion.ML, Fire, 1080375),
|
||||
|
||||
new RewardEntry(monsterStatues, 1049768, typeof(MonsterStatuette), MonsterStatuetteType.Gazer),
|
||||
new RewardEntry(monsterStatues, 1049769, typeof(MonsterStatuette), MonsterStatuetteType.FireElemental),
|
||||
new RewardEntry(monsterStatues, 1049770, typeof(MonsterStatuette), MonsterStatuetteType.Wolf),
|
||||
new RewardEntry(monsterStatues, 1157080, typeof(MonsterStatuette), Expansion.TOL, MonsterStatuetteType.MyrmidexQueen),
|
||||
|
||||
new RewardEntry(etherealSteeds, 1049749, typeof(EtherealSwampDragon)),
|
||||
new RewardEntry(etherealSteeds, 1049748, typeof(EtherealBeetle)),
|
||||
new RewardEntry(houseAddOns, 1049739, typeof(StoneAnkhDeed)),
|
||||
new RewardEntry(houseAddOns, 1080384, typeof(BloodyPentagramDeed), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1154582, typeof(LighthouseAddonDeed), Expansion.HS),
|
||||
new RewardEntry(houseAddOns, 1158860, typeof(RepairBenchDeed), Expansion.EJ),
|
||||
}),
|
||||
new RewardList(RewardInterval, 6, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(houseAddOns, 1076188, typeof(CharacterStatueMaker), Expansion.ML, StatueType.Jade),
|
||||
new RewardEntry(houseAddOns, 1076189, typeof(CharacterStatueMaker), Expansion.ML, StatueType.Marble),
|
||||
new RewardEntry(houseAddOns, 1076190, typeof(CharacterStatueMaker), Expansion.ML, StatueType.Bronze),
|
||||
new RewardEntry(houseAddOns, 1080527, typeof(RewardBrazierDeed), Expansion.ML)
|
||||
}),
|
||||
new RewardList(RewardInterval, 7, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(houseAddOns, 1076157, typeof(CannonDeed), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1080550, typeof(TreeStumpDeed), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1151835, typeof(SheepStatueDeed), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1123504, typeof(SewingMachineDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1123577, typeof(SmithingPressDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1156369, typeof(SpinningLatheDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1156370, typeof(FletchingStationDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1157071, typeof(BBQSmokerDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1157070, typeof(AlchemyStationDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1157989, typeof(WritingDeskDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1125529, typeof(TinkerBenchDeed), Expansion.EJ),
|
||||
}),
|
||||
new RewardList(RewardInterval, 8, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(miscellaneous, 1076158, typeof(WeaponEngravingTool), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1153535, typeof(DaviesLockerAddonDeed), Expansion.SA),
|
||||
new RewardEntry(houseAddOns, 1154583, typeof(GadgetryTableAddonDeed), Expansion.HS),
|
||||
}),
|
||||
new RewardList(RewardInterval, 9, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(monsterStatues, 1153592, typeof(MonsterStatuette), Expansion.TOL, MonsterStatuetteType.Virtuebane),
|
||||
new RewardEntry(etherealSteeds, 1076159, typeof(RideablePolarBear), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1080549, typeof(WallBannerDeed), Expansion.ML)
|
||||
}),
|
||||
new RewardList(RewardInterval, 10, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(monsterStatues, 1080520, typeof(MonsterStatuette), Expansion.ML, MonsterStatuetteType.Harrower),
|
||||
new RewardEntry(monsterStatues, 1080521, typeof(MonsterStatuette), Expansion.ML, MonsterStatuetteType.Efreet),
|
||||
|
||||
new RewardEntry(cloaksAndRobes, 1080382, typeof(RewardCloak), Expansion.ML, Pink, 1080382),
|
||||
new RewardEntry(cloaksAndRobes, 1080380, typeof(RewardRobe), Expansion.ML, Pink, 1080380),
|
||||
new RewardEntry(cloaksAndRobes, 1113898, typeof(RewardGargishFancyRobe), Expansion.SA, Pink, 1113898),
|
||||
new RewardEntry(cloaksAndRobes, 1113899, typeof(RewardGargishRobe), Expansion.SA, Pink, 1113899),
|
||||
new RewardEntry(cloaksAndRobes, 1080378, typeof(RewardDress), Expansion.ML, Pink, 1080378),
|
||||
new RewardEntry(cloaksAndRobes, 1080383, typeof(RewardCloak), Expansion.ML, Crimson, 1080383),
|
||||
new RewardEntry(cloaksAndRobes, 1080381, typeof(RewardRobe), Expansion.ML, Crimson, 1080381),
|
||||
new RewardEntry(cloaksAndRobes, 1113900, typeof(RewardGargishFancyRobe), Expansion.SA, Crimson, 1113900),
|
||||
new RewardEntry(cloaksAndRobes, 1113901, typeof(RewardGargishRobe), Expansion.SA, Crimson, 1113901),
|
||||
new RewardEntry(cloaksAndRobes, 1080379, typeof(RewardDress), Expansion.ML, Crimson, 1080379),
|
||||
|
||||
new RewardEntry(etherealSteeds, 1080386, typeof(EtherealCuSidhe), Expansion.ML),
|
||||
|
||||
new RewardEntry(houseAddOns, 1080548, typeof(MiningCartDeed), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1080397, typeof(AnkhOfSacrificeDeed), Expansion.ML),
|
||||
new RewardEntry(houseAddOns, 1150120, typeof(SkullRugAddonDeed), Expansion.SA),
|
||||
new RewardEntry(houseAddOns, 1150121, typeof(RoseRugAddonDeed), Expansion.SA),
|
||||
new RewardEntry(houseAddOns, 1150122, typeof(DolphinRugAddonDeed), Expansion.SA),
|
||||
new RewardEntry(houseAddOns, 1157996, typeof(KoiPondDeed), Expansion.TOL),
|
||||
new RewardEntry(houseAddOns, 1158881, typeof(WaterWheelDeed), Expansion.EJ),
|
||||
}),
|
||||
new RewardList(RewardInterval, 11, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(etherealSteeds, 1113908, typeof(EtherealReptalon), Expansion.ML),
|
||||
|
||||
new RewardEntry(cloaksAndRobes, 1113902, typeof(RewardCloak), GreenForest, 1113902),
|
||||
new RewardEntry(cloaksAndRobes, 1113903, typeof(RewardDress), GreenForest, 1113903),
|
||||
new RewardEntry(cloaksAndRobes, 1113904, typeof(RewardRobe), GreenForest, 1113904),
|
||||
new RewardEntry(cloaksAndRobes, 1113905, typeof(RewardGargishFancyRobe), Expansion.SA, GreenForest, 1113905),
|
||||
new RewardEntry(cloaksAndRobes, 1113906, typeof(RewardGargishRobe), Expansion.SA, GreenForest, 1113906),
|
||||
|
||||
new RewardEntry(monsterStatues, 1113800, typeof(MonsterStatuette), MonsterStatuetteType.TerathanMatriarch),
|
||||
new RewardEntry(monsterStatues, 1153593, typeof(MonsterStatuette), MonsterStatuetteType.Navrey),
|
||||
|
||||
new RewardEntry(miscellaneous, 1113814, typeof(EtherealRetouchingTool), Expansion.SA),
|
||||
}),
|
||||
new RewardList(RewardInterval, 12, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(etherealSteeds, 1113813, typeof(EtherealHiryu), Expansion.ML),
|
||||
|
||||
new RewardEntry(cloaksAndRobes, 1113910, typeof(RewardCloak), RoyalBlue, 1113910),
|
||||
new RewardEntry(cloaksAndRobes, 1113911, typeof(RewardDress), RoyalBlue, 1113911),
|
||||
new RewardEntry(cloaksAndRobes, 1113912, typeof(RewardRobe), RoyalBlue, 1113912),
|
||||
new RewardEntry(cloaksAndRobes, 1113913, typeof(RewardGargishFancyRobe), Expansion.SA, RoyalBlue, 1113913),
|
||||
new RewardEntry(cloaksAndRobes, 1113914, typeof(RewardGargishRobe), Expansion.SA, RoyalBlue, 1113914),
|
||||
|
||||
new RewardEntry(monsterStatues, 1113801, typeof(MonsterStatuette), MonsterStatuetteType.FireAnt),
|
||||
|
||||
new RewardEntry(houseAddOns, 1113954, typeof(AllegiancePouch)),
|
||||
}),
|
||||
new RewardList(RewardInterval, 13, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(etherealSteeds, 1150006, typeof(EtherealBoura), Expansion.SA),
|
||||
new RewardEntry(monsterStatues, 1153594, typeof(MonsterStatuette), MonsterStatuetteType.Exodus),
|
||||
}),
|
||||
new RewardList(RewardInterval, 15, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(etherealSteeds, 1154589, typeof(EtherealTiger), Expansion.TOL),
|
||||
new RewardEntry(etherealSteeds, 1155723, typeof(EtherealAncientHellHound), Expansion.TOL),
|
||||
new RewardEntry(etherealSteeds, 1157081, typeof(EtherealTarantula), Expansion.TOL),
|
||||
new RewardEntry(etherealSteeds, 1157081, typeof(EtherealWarBoar), Expansion.EJ),
|
||||
|
||||
new RewardEntry(houseAddOns, 1153491, typeof(GardenShedDeed), Expansion.TOL),
|
||||
}),
|
||||
new RewardList(RewardInterval, 20, new RewardEntry[]
|
||||
{
|
||||
new RewardEntry(etherealSteeds, 1157995, typeof(EtherealSerpentineDragon), Expansion.TOL)
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (Enabled)
|
||||
EventSink.Login += new LoginEventHandler(EventSink_Login);
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
{
|
||||
if (!e.Mobile.Alive)
|
||||
return;
|
||||
|
||||
int cur, max, level;
|
||||
|
||||
ComputeRewardInfo(e.Mobile, out cur, out max, out level);
|
||||
|
||||
if (level > SkillCapBonusLevels)
|
||||
level = SkillCapBonusLevels;
|
||||
else if (level < 0)
|
||||
level = 0;
|
||||
|
||||
if (!Core.SA)
|
||||
{
|
||||
if (SkillCapRewards)
|
||||
{
|
||||
int newLevel = SkillCap + (int)((float)level * SkillCapBonusIncrement);
|
||||
if (newLevel > SkillCap + SkillCapBonus)
|
||||
{
|
||||
newLevel = SkillCap + SkillCapBonus;
|
||||
}
|
||||
e.Mobile.SkillsCap = newLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SkillsCap = SkillCap;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SkillsCap = SkillCap + SkillCapBonus;
|
||||
}
|
||||
|
||||
if (Core.ML && e.Mobile is PlayerMobile && !((PlayerMobile)e.Mobile).HasStatReward && HasHalfLevel(e.Mobile))
|
||||
{
|
||||
Server.Gumps.BaseGump.SendGump(new StatRewardGump((PlayerMobile)e.Mobile));
|
||||
}
|
||||
|
||||
if (cur < max)
|
||||
e.Mobile.SendGump(new RewardNoticeGump(e.Mobile));
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Services/VeteranRewards/StatRewardGump.cs
Normal file
46
Scripts/Services/VeteranRewards/StatRewardGump.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class StatRewardGump : BaseGump
|
||||
{
|
||||
public StatRewardGump(PlayerMobile from)
|
||||
: base(from, 200, 200)
|
||||
{
|
||||
from.CloseGump(typeof(StatRewardGump));
|
||||
TypeID = 0x193;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1015313, false, false); // <center></center>
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1015313, false, false); // <center></center>
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1076664, false, false); // <B>Ultima Online Rewards Program</B><BR>Thank you for being part of the Ultima Online community for over 6 months. As a token of our appreciation, your stat cap will be increased.
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1011036, false, false); // OKAY
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1011012, false, false); // CANCEL
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 291, 173, 0x13BE);
|
||||
AddImageTiled(5, 5, 280, 140, 0xA40);
|
||||
AddHtmlLocalized(9, 9, 272, 140, 1076664, 0x7FFF, false, false); // <B>Ultima Online Rewards Program</B><BR>Thank you for being part of the Ultima Online community for over 6 months. As a token of our appreciation, your stat cap will be increased.
|
||||
AddButton(160, 147, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(195, 149, 120, 20, 1006044, 0x7FFF, false, false); // OK
|
||||
AddButton(5, 147, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 149, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (!User.HasStatReward && info.ButtonID == 1)
|
||||
{
|
||||
User.HasStatReward = true;
|
||||
User.StatCap += 5;
|
||||
|
||||
User.SendLocalizedMessage(1062312); // Your stat cap has been increased.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user