Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
255
Scripts/Services/Revamped Dungeons/Shame Revamped/Generate.cs
Normal file
255
Scripts/Services/Revamped Dungeons/Shame Revamped/Generate.cs
Normal file
@@ -0,0 +1,255 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Commands;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Engines.ShameRevamped
|
||||
{
|
||||
public static class ShameGenerator
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("GenerateNewShame", AccessLevel.Administrator, Generate);
|
||||
CommandSystem.Register("DeleteShame", AccessLevel.Administrator, Delete);
|
||||
}
|
||||
|
||||
private static void Delete(CommandEventArgs e)
|
||||
{
|
||||
WeakEntityCollection.Delete("newshame");
|
||||
ResetOldSpawners(false);
|
||||
}
|
||||
|
||||
public static void Generate(CommandEventArgs e)
|
||||
{
|
||||
if (!Core.ML)
|
||||
return;
|
||||
|
||||
RemoveItems();
|
||||
|
||||
CommandSystem.Handle(e.Mobile, Server.Commands.CommandSystem.Prefix + "XmlLoad RevampedSpawns/ShameRevamped.xml");
|
||||
|
||||
// Level 1
|
||||
Point3D altarLoc = new Point3D(5403, 43, 30);
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Trammel))
|
||||
{
|
||||
var altar = new ShameAltar(typeof(QuartzElemental), new Point3D(5490, 19, -25), new Point3D(5514, 10, 5), new Point3D(5387, 11, 30), 10);
|
||||
WeakEntityCollection.Add("newshame", altar);
|
||||
altar.MoveToWorld(altarLoc, Map.Trammel);
|
||||
}
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Felucca))
|
||||
{
|
||||
var altar = new ShameAltar(typeof(QuartzElemental), new Point3D(5490, 19, -25), new Point3D(5514, 10, 5), new Point3D(5387, 11, 30), 10);
|
||||
WeakEntityCollection.Add("newshame", altar);
|
||||
altar.MoveToWorld(altarLoc, Map.Felucca);
|
||||
}
|
||||
|
||||
// Level 2
|
||||
altarLoc = new Point3D(5577, 54, 2);
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Trammel))
|
||||
{
|
||||
var altar = new ShameAltar(typeof(FlameElemental), new Point3D(5604, 102, 5), new Point3D(5514, 147, 25), new Point3D(5571, 115, 3), 20);
|
||||
WeakEntityCollection.Add("newshame", altar);
|
||||
altar.MoveToWorld(altarLoc, Map.Trammel);
|
||||
}
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Felucca))
|
||||
{
|
||||
var altar = new ShameAltar(typeof(FlameElemental), new Point3D(5604, 102, 5), new Point3D(5514, 147, 25), new Point3D(5571, 115, 3), 20);
|
||||
WeakEntityCollection.Add("newshame", altar);
|
||||
altar.MoveToWorld(altarLoc, Map.Felucca);
|
||||
}
|
||||
|
||||
// Level 3
|
||||
altarLoc = new Point3D(5390, 145, 20);
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Trammel))
|
||||
{
|
||||
var altar = new ShameAltar(typeof(WindElemental), new Point3D(5538, 170, 5), new Point3D(5513, 176, 5), new Point3D(5618, 223, 0), 30);
|
||||
WeakEntityCollection.Add("newshame", altar);
|
||||
altar.MoveToWorld(altarLoc, Map.Trammel);
|
||||
}
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Felucca))
|
||||
{
|
||||
var altar = new ShameAltar(typeof(WindElemental), new Point3D(5538, 170, 5), new Point3D(5513, 176, 5), new Point3D(5618, 223, 0), 30);
|
||||
WeakEntityCollection.Add("newshame", altar);
|
||||
altar.MoveToWorld(altarLoc, Map.Felucca);
|
||||
}
|
||||
|
||||
// Wall 1
|
||||
Dictionary<Point3D, int> dictionary = null;
|
||||
altarLoc = new Point3D(5403, 82, 10);
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Trammel))
|
||||
{
|
||||
dictionary = new Dictionary<Point3D, int>();
|
||||
dictionary[new Point3D(-1, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(2, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(1, 0, 0)] = 2272;
|
||||
|
||||
var wall = new ShameWall(dictionary, altarLoc, new Point3D(5405, 90, 10), Map.Trammel);
|
||||
WeakEntityCollection.Add("newshame", wall);
|
||||
wall.MoveToWorld(altarLoc, Map.Trammel);
|
||||
ShameWall.AddTeleporters(wall);
|
||||
}
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Felucca))
|
||||
{
|
||||
dictionary = new Dictionary<Point3D, int>();
|
||||
dictionary[new Point3D(-1, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(2, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(1, 0, 0)] = 2272;
|
||||
|
||||
var wall = new ShameWall(dictionary, altarLoc, new Point3D(5405, 90, 10), Map.Felucca);
|
||||
WeakEntityCollection.Add("newshame", wall);
|
||||
wall.MoveToWorld(altarLoc, Map.Felucca);
|
||||
ShameWall.AddTeleporters(wall);
|
||||
}
|
||||
|
||||
// Wall 2
|
||||
altarLoc = new Point3D(5465, 26, -10);
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Trammel))
|
||||
{
|
||||
dictionary = new Dictionary<Point3D, int>();
|
||||
dictionary[new Point3D(0, -1, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 1, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 2, 0)] = 2272;
|
||||
|
||||
var wall = new ShameWall(dictionary, altarLoc, new Point3D(5472, 26, -30), Map.Trammel);
|
||||
WeakEntityCollection.Add("newshame", wall);
|
||||
wall.MoveToWorld(altarLoc, Map.Trammel);
|
||||
ShameWall.AddTeleporters(wall);
|
||||
}
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Felucca))
|
||||
{
|
||||
dictionary = new Dictionary<Point3D, int>();
|
||||
dictionary[new Point3D(0, -1, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 0, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 1, 0)] = 2272;
|
||||
dictionary[new Point3D(0, 2, 0)] = 2272;
|
||||
|
||||
var wall = new ShameWall(dictionary, altarLoc, new Point3D(5472, 26, -30), Map.Felucca);
|
||||
WeakEntityCollection.Add("newshame", wall);
|
||||
wall.MoveToWorld(altarLoc, Map.Felucca);
|
||||
ShameWall.AddTeleporters(wall);
|
||||
}
|
||||
|
||||
// Wall 3
|
||||
altarLoc = new Point3D(5619, 57, 0);
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Trammel))
|
||||
{
|
||||
dictionary = new Dictionary<Point3D, int>();
|
||||
dictionary[new Point3D(-1, 0, 0)] = 1059;
|
||||
dictionary[new Point3D(0, 0, 0)] = 1059;
|
||||
dictionary[new Point3D(1, 0, 0)] = 1059;
|
||||
|
||||
var wall = new ShameWall(dictionary, altarLoc, new Point3D(5621, 43, 0), Map.Trammel);
|
||||
WeakEntityCollection.Add("newshame", wall);
|
||||
wall.MoveToWorld(altarLoc, Map.Trammel);
|
||||
ShameWall.AddTeleporters(wall);
|
||||
}
|
||||
|
||||
if (!CheckForAltar(altarLoc, Map.Felucca))
|
||||
{
|
||||
dictionary = new Dictionary<Point3D, int>();
|
||||
dictionary[new Point3D(-1, 0, 0)] = 1059;
|
||||
dictionary[new Point3D(0, 0, 0)] = 1059;
|
||||
dictionary[new Point3D(1, 0, 0)] = 1059;
|
||||
|
||||
var wall = new ShameWall(dictionary, altarLoc, new Point3D(5621, 43, 0), Map.Felucca);
|
||||
WeakEntityCollection.Add("newshame", wall);
|
||||
wall.MoveToWorld(altarLoc, Map.Felucca);
|
||||
ShameWall.AddTeleporters(wall);
|
||||
}
|
||||
|
||||
e.Mobile.SendMessage("Shame Revamped setup!");
|
||||
}
|
||||
|
||||
public static void RemoveItems()
|
||||
{
|
||||
RemoveItem(new Point3D(5490, 19, -25), Map.Trammel, typeof(Teleporter));
|
||||
RemoveItem(new Point3D(5490, 19, -25), Map.Felucca, typeof(Teleporter));
|
||||
|
||||
RemoveItem(new Point3D(5604, 102, 5), Map.Trammel, typeof(Teleporter));
|
||||
RemoveItem(new Point3D(5604, 102, 5), Map.Felucca, typeof(Teleporter));
|
||||
|
||||
RemoveItem(new Point3D(5538, 170, 5), Map.Trammel, typeof(Teleporter));
|
||||
RemoveItem(new Point3D(5538, 170, 5), Map.Felucca, typeof(Teleporter));
|
||||
|
||||
ResetOldSpawners();
|
||||
}
|
||||
|
||||
public static void ResetOldSpawners(bool reset = true)
|
||||
{
|
||||
Region r = Region.Find(new Point3D(5538, 170, 5), Map.Trammel);
|
||||
foreach (var spawner in r.GetEnumeratedItems().OfType<XmlSpawner>())
|
||||
{
|
||||
if (spawner.Name.ToLower() != "shame_revamped" && spawner.Name.ToLower() != "shame_chest")
|
||||
{
|
||||
if (reset)
|
||||
spawner.DoReset = true;
|
||||
else
|
||||
spawner.DoRespawn = true;
|
||||
}
|
||||
}
|
||||
|
||||
r = Region.Find(new Point3D(5538, 170, 5), Map.Felucca);
|
||||
foreach (var spawner in r.GetEnumeratedItems().OfType<XmlSpawner>())
|
||||
{
|
||||
if (spawner.Name.ToLower() != "shame_revamped" && spawner.Name.ToLower() != "shame_chest")
|
||||
{
|
||||
if (reset)
|
||||
spawner.DoReset = true;
|
||||
else
|
||||
spawner.DoRespawn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool RemoveItem(Point3D p, Map map, Type t)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetItemsInRange(p, 0);
|
||||
|
||||
foreach (Item i in eable)
|
||||
{
|
||||
if (i.GetType() == t)
|
||||
{
|
||||
i.Delete();
|
||||
eable.Free();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CheckForAltar(Point3D p, Map map)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetItemsInRange(p, 0);
|
||||
|
||||
foreach (Item i in eable)
|
||||
{
|
||||
if (i is ShameAltar || i is ShameWall)
|
||||
{
|
||||
eable.Free();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorrosiveAsh : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1151809; } } // Corrosive Ash
|
||||
|
||||
[Constructable]
|
||||
public CorrosiveAsh()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CorrosiveAsh(int amount) : base(0x423A)
|
||||
{
|
||||
this.Hue = 1360;
|
||||
this.Weight = 1;
|
||||
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
else if (from.Backpack.GetAmount(typeof(QuartzGrit)) == 0)
|
||||
from.SendLocalizedMessage(1151813, "#1151808"); // You do not have a required component: ~1_val~
|
||||
else if (from.Backpack.GetAmount(typeof(CursedOilstone)) == 0)
|
||||
from.SendLocalizedMessage(1151813, "#1151810"); // You do not have a required component: ~1_val~
|
||||
else
|
||||
{
|
||||
from.Backpack.ConsumeTotal(new Type[] { typeof(CursedOilstone), typeof(QuartzGrit) },
|
||||
new int[] { 1, 1 });
|
||||
|
||||
this.Consume();
|
||||
|
||||
from.AddToBackpack(new WhetstoneOfEnervation());
|
||||
from.SendLocalizedMessage(1151812); // You have managed to form the items into a rancid smelling, crag covered, hardened lump. In a moment of prescience, you realize what it must be named. The Whetstone of Enervation!
|
||||
}
|
||||
}
|
||||
|
||||
public CorrosiveAsh(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CursedOilstone : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1151810; } } // Cursed Oilstone
|
||||
|
||||
[Constructable]
|
||||
public CursedOilstone()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CursedOilstone(int amount) : base(0x0F8B)
|
||||
{
|
||||
this.Weight = 1;
|
||||
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
else if (from.Backpack.GetAmount(typeof(QuartzGrit)) == 0)
|
||||
from.SendLocalizedMessage(1151813, "#1151808"); // You do not have a required component: ~1_val~
|
||||
else if (from.Backpack.GetAmount(typeof(CorrosiveAsh)) == 0)
|
||||
from.SendLocalizedMessage(1151813, "#1151809"); // You do not have a required component: ~1_val~
|
||||
else
|
||||
{
|
||||
from.Backpack.ConsumeTotal(new Type[] { typeof(QuartzGrit), typeof(CorrosiveAsh) },
|
||||
new int[] { 1, 1 });
|
||||
|
||||
this.Consume();
|
||||
|
||||
from.AddToBackpack(new WhetstoneOfEnervation());
|
||||
from.SendLocalizedMessage(1151812); // You have managed to form the items into a rancid smelling, crag covered, hardened lump. In a moment of prescience, you realize what it must be named. The Whetstone of Enervation!
|
||||
}
|
||||
}
|
||||
|
||||
public CursedOilstone(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class QuartzGrit : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1151808; } } // Quartz Grit
|
||||
|
||||
[Constructable]
|
||||
public QuartzGrit()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public QuartzGrit(int amount) : base(0x423A)
|
||||
{
|
||||
this.Hue = 1151;
|
||||
this.Weight = 1;
|
||||
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
else if (from.Backpack.GetAmount(typeof(CursedOilstone)) == 0)
|
||||
from.SendLocalizedMessage(1151813, "#1151810"); // You do not have a required component: ~1_val~
|
||||
else if (from.Backpack.GetAmount(typeof(CorrosiveAsh)) == 0)
|
||||
from.SendLocalizedMessage(1151813, "#1151809"); // You do not have a required component: ~1_val~
|
||||
else
|
||||
{
|
||||
from.Backpack.ConsumeTotal(new Type[] { typeof(CursedOilstone), typeof(CorrosiveAsh) },
|
||||
new int[] { 1, 1 });
|
||||
|
||||
this.Consume();
|
||||
|
||||
from.AddToBackpack(new WhetstoneOfEnervation());
|
||||
from.SendLocalizedMessage(1151812); // You have managed to form the items into a rancid smelling, crag covered, hardened lump. In a moment of prescience, you realize what it must be named. The Whetstone of Enervation!
|
||||
}
|
||||
}
|
||||
|
||||
public QuartzGrit(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WhetstoneOfEnervation : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1151811; } } // Whetstone of Enervation
|
||||
|
||||
[Constructable]
|
||||
public WhetstoneOfEnervation()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WhetstoneOfEnervation(int amount) : base(0x1368)
|
||||
{
|
||||
this.Hue = 1458;
|
||||
this.Weight = 1;
|
||||
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.BeginTarget(-1, false, TargetFlags.None, (m, targeted) =>
|
||||
{
|
||||
if (!IsChildOf(m.Backpack))
|
||||
m.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
else if (targeted is BaseWeapon)
|
||||
{
|
||||
BaseWeapon wep = targeted as BaseWeapon;
|
||||
|
||||
if(!wep.IsChildOf(m.Backpack))
|
||||
m.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
else if (wep.TimesImbued > 0 || wep.Quality != ItemQuality.Exceptional)
|
||||
m.SendLocalizedMessage(1046439); // Invalid target.
|
||||
else if (wep.Attributes.WeaponDamage > 0)
|
||||
{
|
||||
wep.Attributes.WeaponDamage = 0;
|
||||
m.SendLocalizedMessage(1151814); // You have removed the damage increase from this weapon.
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
else
|
||||
m.SendLocalizedMessage(1046439); // Invalid target.
|
||||
}
|
||||
else
|
||||
m.SendLocalizedMessage(1046439); // Invalid target.
|
||||
});
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public WhetstoneOfEnervation(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (ItemID != 0x1368)
|
||||
ItemID = 0x1368;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Engines.ShameRevamped;
|
||||
using Server.Engines.PartySystem;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class ShameGuardian : BaseCreature
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ShameAltar Altar { get; set; }
|
||||
|
||||
public ShameGuardian(AIType type)
|
||||
: base(type, FightMode.Aggressor, 10, 1, .4, .2)
|
||||
{
|
||||
Title = "the guardian";
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
if (Altar != null)
|
||||
Altar.OnGuardianKilled();
|
||||
|
||||
c.DropItem(new ShameCrystal(Utility.RandomMinMax(3, 5)));
|
||||
|
||||
Altar = null;
|
||||
}
|
||||
|
||||
public override int Damage(int amount, Mobile from, bool informMount, bool checkfizzle)
|
||||
{
|
||||
if (from == null)
|
||||
return 0;
|
||||
|
||||
if (Altar == null || Altar.Summoner == null)
|
||||
amount = base.Damage(amount, from, informMount, checkfizzle);
|
||||
else
|
||||
{
|
||||
bool good = false;
|
||||
|
||||
if (from == Altar.Summoner || (Altar.DeadLine > DateTime.UtcNow &&
|
||||
Altar.DeadLine - DateTime.UtcNow < TimeSpan.FromMinutes(10)))
|
||||
good = true;
|
||||
else if (from is BaseCreature && ((BaseCreature)from).GetMaster() == Altar.Summoner)
|
||||
good = true;
|
||||
else if (ShameAltar.AllowParties)
|
||||
{
|
||||
Server.Engines.PartySystem.Party p = Server.Engines.PartySystem.Party.Get(from);
|
||||
|
||||
foreach (PartyMemberInfo info in p.Members)
|
||||
{
|
||||
if (info.Mobile == from)
|
||||
{
|
||||
good = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (good)
|
||||
amount = base.Damage(amount, from, informMount, checkfizzle);
|
||||
else
|
||||
{
|
||||
amount = 0;
|
||||
from.SendLocalizedMessage(1151633); // You did not summon this champion, so you may not attack it at this time.
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public override bool AutoDispel { get { return true; } }
|
||||
public override bool AlwaysMurderer { get { return true; } }
|
||||
public override Poison PoisonImmune { get { return Poison.Lethal; } }
|
||||
|
||||
public ShameGuardian(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[CorpseName("a quartz elemental corpse")]
|
||||
public class QuartzElemental : ShameGuardian
|
||||
{
|
||||
[Constructable]
|
||||
public QuartzElemental()
|
||||
: base(AIType.AI_Melee)
|
||||
{
|
||||
Name = "a quartz elemental";
|
||||
Body = 14;
|
||||
BaseSoundID = 268;
|
||||
Hue = 2575;
|
||||
|
||||
SetStr(240, 260);
|
||||
SetDex(70, 80);
|
||||
SetInt(100, 110);
|
||||
|
||||
SetHits(1000, 1100);
|
||||
|
||||
SetDamage(14, 21);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 60);
|
||||
SetDamageType(ResistanceType.Energy, 40);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 30, 35);
|
||||
SetResistance(ResistanceType.Fire, 20, 30);
|
||||
SetResistance(ResistanceType.Cold, 20, 30);
|
||||
SetResistance(ResistanceType.Poison, 20, 30);
|
||||
SetResistance(ResistanceType.Energy, 15, 25);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 110, 120);
|
||||
SetSkill(SkillName.Tactics, 100, 110.0);
|
||||
SetSkill(SkillName.Wrestling, 110, 120);
|
||||
|
||||
Fame = 4500;
|
||||
Karma = -4500;
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
this.AddLoot(LootPack.UltraRich, 1);
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
if ((c.Map != null && c.Map.Rules == MapRules.FeluccaRules) || 0.5 > Utility.RandomDouble())
|
||||
c.DropItem(new QuartzGrit());
|
||||
}
|
||||
|
||||
public QuartzElemental(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int TreasureMapLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[CorpseName("a flame elemental corpse")]
|
||||
public class FlameElemental : ShameGuardian, IAuraCreature
|
||||
{
|
||||
[Constructable]
|
||||
public FlameElemental()
|
||||
: base(AIType.AI_Mage)
|
||||
{
|
||||
Name = "a flame elemental";
|
||||
Body = 15;
|
||||
BaseSoundID = 838;
|
||||
Hue = 1161;
|
||||
|
||||
SetStr(420, 460);
|
||||
SetDex(160, 210);
|
||||
SetInt(120, 190);
|
||||
|
||||
SetHits(700, 800);
|
||||
SetMana(1000, 1300);
|
||||
|
||||
SetDamage(13, 15);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 25);
|
||||
SetDamageType(ResistanceType.Fire, 75);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 40, 60);
|
||||
SetResistance(ResistanceType.Fire, 100);
|
||||
SetResistance(ResistanceType.Cold, 30, 40);
|
||||
SetResistance(ResistanceType.Poison, 60, 70);
|
||||
SetResistance(ResistanceType.Energy, 60, 70);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 90, 140);
|
||||
SetSkill(SkillName.Tactics, 90, 130.0);
|
||||
SetSkill(SkillName.Wrestling, 90, 120);
|
||||
SetSkill(SkillName.Magery, 100, 145);
|
||||
SetSkill(SkillName.EvalInt, 90, 140);
|
||||
SetSkill(SkillName.Meditation, 80, 120);
|
||||
SetSkill(SkillName.Parry, 100, 120);
|
||||
|
||||
Fame = 4500;
|
||||
Karma = -4500;
|
||||
|
||||
PackItem(new SulfurousAsh(5));
|
||||
|
||||
SetSpecialAbility(SpecialAbility.DragonBreath);
|
||||
SetAreaEffect(AreaEffect.AuraDamage);
|
||||
}
|
||||
|
||||
public void AuraEffect(Mobile m)
|
||||
{
|
||||
m.SendLocalizedMessage(1008112); // The intense heat is damaging you!
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
this.AddLoot(LootPack.UltraRich, 1);
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
if ((c.Map != null && c.Map.Rules == MapRules.FeluccaRules) || 0.5 > Utility.RandomDouble())
|
||||
c.DropItem(new CorrosiveAsh());
|
||||
}
|
||||
|
||||
public FlameElemental(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[CorpseName("a wind elemental corpse")]
|
||||
public class WindElemental : ShameGuardian
|
||||
{
|
||||
[Constructable]
|
||||
public WindElemental()
|
||||
: base(AIType.AI_Mage)
|
||||
{
|
||||
Name = "a wind elemental";
|
||||
Body = 13;
|
||||
BaseSoundID = 655;
|
||||
Hue = 33765;
|
||||
|
||||
SetStr(370, 460);
|
||||
SetDex(160, 250);
|
||||
SetInt(150, 220);
|
||||
|
||||
SetHits(2500, 2600);
|
||||
SetMana(1000, 1300);
|
||||
|
||||
SetDamage(15, 17);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 20);
|
||||
SetDamageType(ResistanceType.Cold, 40);
|
||||
SetDamageType(ResistanceType.Energy, 40);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 65, 75);
|
||||
SetResistance(ResistanceType.Fire, 55, 65);
|
||||
SetResistance(ResistanceType.Cold, 55, 65);
|
||||
SetResistance(ResistanceType.Poison, 100);
|
||||
SetResistance(ResistanceType.Energy, 60, 75);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 60, 80);
|
||||
SetSkill(SkillName.Tactics, 60, 80.0);
|
||||
SetSkill(SkillName.Wrestling, 60, 80);
|
||||
SetSkill(SkillName.Magery, 60, 80);
|
||||
SetSkill(SkillName.EvalInt, 60, 80);
|
||||
|
||||
Fame = 4500;
|
||||
Karma = -4500;
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
this.AddLoot(LootPack.UltraRich, 1);
|
||||
this.AddLoot(LootPack.HighScrolls, Utility.RandomMinMax(3, 5));
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
if ((c.Map != null && c.Map.Rules == MapRules.FeluccaRules) || 0.5 > Utility.RandomDouble())
|
||||
c.DropItem(new CursedOilstone());
|
||||
}
|
||||
|
||||
public WindElemental(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
=============Setup for pre-existing shard===============
|
||||
You must setup the spawners first, then the new despise system itself. Use these commands:
|
||||
|
||||
[XmlLoad spawns/shamerevamped.xml
|
||||
[GenerateNewShame
|
||||
243
Scripts/Services/Revamped Dungeons/Shame Revamped/ShameAltar.cs
Normal file
243
Scripts/Services/Revamped Dungeons/Shame Revamped/ShameAltar.cs
Normal file
@@ -0,0 +1,243 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Points;
|
||||
using Server.Items;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Engines.ShameRevamped
|
||||
{
|
||||
public class ShameAltar : Item
|
||||
{
|
||||
public static readonly int CoolDown = 10;
|
||||
public static readonly bool AllowParties = false;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Active { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int SummonCost { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D TeleporterLocation { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D TeleporterDestination { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D SpawnLocation { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type GuardianType { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Summoner { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ShameGuardian Guardian { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime DeadLine { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime NextSummon { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ShameTeleporter Teleporter { get; set; }
|
||||
|
||||
public Timer DeadLineTimer { get; set; }
|
||||
|
||||
public override int LabelNumber { get { return 1151636; } } // Guardian's Altar
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public ShameAltar(Type type, Point3D teleLoc, Point3D teleDest, Point3D spawnLoc, int cost, bool active = true)
|
||||
: base(13801)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 2619;
|
||||
|
||||
GuardianType = type;
|
||||
TeleporterLocation = teleLoc;
|
||||
TeleporterDestination = teleDest;
|
||||
SpawnLocation = spawnLoc;
|
||||
SummonCost = cost;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), SpawnTeleporter);
|
||||
|
||||
Active = active;
|
||||
DeadLine = DateTime.MinValue;
|
||||
NextSummon = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Teleporter != null)
|
||||
Teleporter.Map = this.Map;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Active && from.InRange(this.Location, 3))
|
||||
CheckSummon(from);
|
||||
}
|
||||
|
||||
public void CheckSummon(Mobile from)
|
||||
{
|
||||
if (PointsSystem.ShameCrystals.GetPoints(from) < SummonCost)
|
||||
from.SendLocalizedMessage(1151623); // You are not yet worthy of challenging the champion.
|
||||
else if (Guardian != null)
|
||||
from.SendLocalizedMessage(1151621); // The champion for this dungeon level has already been summoned.
|
||||
else if (NextSummon > DateTime.UtcNow)
|
||||
from.SendLocalizedMessage(1151622); // The champion has recently been defeated, and cannot be summoned again for a few minutes.
|
||||
else
|
||||
{
|
||||
SpawnGuardian();
|
||||
Summoner = from;
|
||||
|
||||
PointsSystem.ShameCrystals.DeductPoints(from, SummonCost);
|
||||
|
||||
if (Teleporter == null || Teleporter.Deleted)
|
||||
SpawnTeleporter();
|
||||
|
||||
from.SendLocalizedMessage(1151620); // The champion accepts your challenge. You have one hour to find and defeat him!
|
||||
from.SendLocalizedMessage(1151625, SummonCost.ToString()); // Summoning the dungeon level's champion costs you ~1_COST~ Crystals of Shame.
|
||||
StartDeadlineTimer();
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnGuardian()
|
||||
{
|
||||
Guardian = Activator.CreateInstance(GuardianType) as ShameGuardian;
|
||||
Guardian.Altar = this;
|
||||
Guardian.MoveToWorld(SpawnLocation, this.Map);
|
||||
|
||||
Guardian.Home = SpawnLocation;
|
||||
Guardian.RangeHome = 8;
|
||||
|
||||
DeadLine = DateTime.UtcNow + TimeSpan.FromHours(1);
|
||||
}
|
||||
|
||||
public void OnGuardianKilled()
|
||||
{
|
||||
Guardian = null;
|
||||
|
||||
EndDeadLineTimer();
|
||||
NextSummon = DateTime.UtcNow + TimeSpan.FromMinutes(CoolDown);
|
||||
Summoner = null;
|
||||
}
|
||||
|
||||
public void CheckDeadLine()
|
||||
{
|
||||
if (DeadLine < DateTime.UtcNow)
|
||||
EndDeadLineTimer();
|
||||
}
|
||||
|
||||
public void StartDeadlineTimer()
|
||||
{
|
||||
if(DeadLineTimer != null)
|
||||
DeadLineTimer.Stop();
|
||||
|
||||
DeadLineTimer = Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), CheckDeadLine);
|
||||
DeadLineTimer.Start();
|
||||
}
|
||||
|
||||
public void EndDeadLineTimer()
|
||||
{
|
||||
if (DeadLineTimer != null)
|
||||
{
|
||||
DeadLineTimer.Stop();
|
||||
DeadLineTimer = null;
|
||||
}
|
||||
|
||||
if (Guardian != null && Guardian.Alive) // Failed
|
||||
{
|
||||
Guardian.Delete();
|
||||
|
||||
if (Summoner != null)
|
||||
Summoner.SendLocalizedMessage(1151628); // You failed to defeat the champion in time.
|
||||
|
||||
NextSummon = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
private void SpawnTeleporter()
|
||||
{
|
||||
if (Teleporter != null)
|
||||
Teleporter.Delete();
|
||||
|
||||
if (this.Map == null || this.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
IPooledEnumerable eable = this.Map.GetItemsInRange(TeleporterLocation, 0);
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item is ShameTeleporter)
|
||||
item.Delete();
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
Teleporter = new ShameTeleporter(TeleporterDestination, this.Map);
|
||||
Teleporter.MoveToWorld(TeleporterLocation, this.Map);
|
||||
}
|
||||
|
||||
public ShameAltar(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Teleporter);
|
||||
writer.Write(TeleporterLocation);
|
||||
writer.Write(TeleporterDestination);
|
||||
writer.Write(SpawnLocation);
|
||||
writer.Write(Guardian);
|
||||
writer.Write(GuardianType.Name);
|
||||
writer.Write(Active);
|
||||
writer.Write(DeadLine);
|
||||
writer.Write(SummonCost);
|
||||
writer.Write(Summoner);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Teleporter = reader.ReadItem() as ShameTeleporter;
|
||||
TeleporterLocation = reader.ReadPoint3D();
|
||||
TeleporterDestination = reader.ReadPoint3D();
|
||||
SpawnLocation = reader.ReadPoint3D();
|
||||
Guardian = reader.ReadMobile() as ShameGuardian;
|
||||
GuardianType = ScriptCompiler.FindTypeByName(reader.ReadString());
|
||||
Active = reader.ReadBool();
|
||||
DeadLine = reader.ReadDateTime();
|
||||
SummonCost = reader.ReadInt();
|
||||
Summoner = reader.ReadMobile();
|
||||
|
||||
if (DeadLine > DateTime.UtcNow)
|
||||
{
|
||||
if (Guardian != null)
|
||||
{
|
||||
Guardian.Altar = this;
|
||||
StartDeadlineTimer();
|
||||
}
|
||||
else
|
||||
DeadLine = DateTime.MinValue;
|
||||
}
|
||||
else if (Guardian != null)
|
||||
{
|
||||
Guardian.Delete();
|
||||
Guardian = null;
|
||||
|
||||
NextSummon = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Points;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ShameCrystal : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1151624; } } // Crystal of Shame
|
||||
|
||||
[Constructable]
|
||||
public ShameCrystal() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ShameCrystal(int amount) : base(16395)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
|
||||
Hue = 2611;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if(IsChildOf(from.Backpack))
|
||||
{
|
||||
PointsSystem.ShameCrystals.AwardPoints(from, this.Amount);
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public ShameCrystal(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.ShameRevamped
|
||||
{
|
||||
public class ShameTeleporter : Teleporter
|
||||
{
|
||||
public ShameTeleporter(Point3D dest, Map map) : base(dest, map, true)
|
||||
{
|
||||
}
|
||||
|
||||
public ShameTeleporter(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
reader.ReadMobile();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ShameWallTeleporter : Teleporter
|
||||
{
|
||||
public ShameWallTeleporter(Point3D dest, Map map)
|
||||
: base(dest, map, true)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CanTeleport(Mobile m)
|
||||
{
|
||||
if(Deleted || Map == null || Map == Map.Internal)
|
||||
return false;
|
||||
|
||||
IPooledEnumerable eable = Map.GetItemsInRange(Location, 1);
|
||||
bool active = false;
|
||||
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item is AddonComponent && ((AddonComponent)item).Addon is ShameWall && ((AddonComponent)item).Addon.Visible)
|
||||
{
|
||||
active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
return active;
|
||||
}
|
||||
|
||||
public override void DoTeleport(Mobile m)
|
||||
{
|
||||
m.SendLocalizedMessage(1072790); // The wall becomes transparent, and you push your way through it.
|
||||
|
||||
base.DoTeleport(m);
|
||||
}
|
||||
|
||||
public ShameWallTeleporter(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
reader.ReadMobile();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
165
Scripts/Services/Revamped Dungeons/Shame Revamped/ShameWall.cs
Normal file
165
Scripts/Services/Revamped Dungeons/Shame Revamped/ShameWall.cs
Normal file
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Points;
|
||||
using Server.Items;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.ShameRevamped
|
||||
{
|
||||
public class ShameWall : BaseAddon
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CaveTroll Troll { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D StartSpot { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Map StartMap { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D TrollSpawnLoc { get; set; }
|
||||
|
||||
public ShameWall(Dictionary<Point3D, int> details, Point3D startSpot, Point3D trollSpawnLoc, Map map)
|
||||
{
|
||||
foreach(KeyValuePair<Point3D, int> kvp in details)
|
||||
{
|
||||
AddComponent(new AddonComponent(kvp.Value), kvp.Key.X, kvp.Key.Y, kvp.Key.Z);
|
||||
}
|
||||
|
||||
StartSpot = startSpot;
|
||||
StartMap = map;
|
||||
TrollSpawnLoc = trollSpawnLoc;
|
||||
|
||||
SpawnTroll();
|
||||
}
|
||||
|
||||
public void OnTrollKilled()
|
||||
{
|
||||
this.Z -= 50;
|
||||
this.Visible = false;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(2), Reset);
|
||||
|
||||
Troll = null;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
MoveToWorld(StartSpot, StartMap);
|
||||
Visible = true;
|
||||
SpawnTroll();
|
||||
}
|
||||
|
||||
private void SpawnTroll()
|
||||
{
|
||||
if(Troll == null || Troll.Deleted || !Troll.Alive)
|
||||
{
|
||||
Troll = new CaveTroll(this);
|
||||
Troll.MoveToWorld(TrollSpawnLoc, StartMap);
|
||||
|
||||
Troll.Home = TrollSpawnLoc;
|
||||
Troll.RangeHome = 8;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComponentUsed(AddonComponent component, Mobile from)
|
||||
{
|
||||
base.OnComponentUsed(component, from);
|
||||
|
||||
if (Troll == null || Troll.Deleted || !Troll.Alive)
|
||||
Reset();
|
||||
}
|
||||
|
||||
public static void AddTeleporters(ShameWall wall)
|
||||
{
|
||||
Map map = wall.Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
return;
|
||||
|
||||
foreach (var component in wall.Components)
|
||||
{
|
||||
foreach (Point3D[] pnts in _TeleportLocs)
|
||||
{
|
||||
if (component.Location == pnts[0])
|
||||
{
|
||||
var oldtele = map.FindItem<ConditionTeleporter>(new Point3D(pnts[1]));
|
||||
|
||||
if (oldtele != null)
|
||||
{
|
||||
WeakEntityCollection.Remove("newshame", oldtele);
|
||||
oldtele.Delete();
|
||||
}
|
||||
|
||||
var teleporter = new ShameWallTeleporter(pnts[2], map);
|
||||
teleporter.MoveToWorld(pnts[1], map);
|
||||
|
||||
WeakEntityCollection.Add("newshame", teleporter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Point3D[][] _TeleportLocs =
|
||||
{
|
||||
new Point3D[] { new Point3D(5402, 82, 10), new Point3D(5402, 81, 10), new Point3D(5402, 83, 10) },
|
||||
new Point3D[] { new Point3D(5403, 82, 10), new Point3D(5403, 81, 10), new Point3D(5403, 83, 10) },
|
||||
new Point3D[] { new Point3D(5404, 82, 10), new Point3D(5404, 81, 10), new Point3D(5404, 83, 10) },
|
||||
new Point3D[] { new Point3D(5405, 82, 10), new Point3D(5405, 81, 10), new Point3D(5405, 83, 10) },
|
||||
|
||||
new Point3D[] { new Point3D(5465, 25, -10), new Point3D(5464, 25, -10), new Point3D(5466, 25, -10) },
|
||||
new Point3D[] { new Point3D(5465, 26, -10), new Point3D(5464, 26, -10), new Point3D(5466, 26, -10) },
|
||||
new Point3D[] { new Point3D(5465, 27, -10), new Point3D(5464, 27, -10), new Point3D(5466, 27, -10) },
|
||||
new Point3D[] { new Point3D(5465, 28, -10), new Point3D(5464, 28, -10), new Point3D(5466, 28, -10) },
|
||||
|
||||
new Point3D[] { new Point3D(5618, 57, 0), new Point3D(5618, 58, 0), new Point3D(5618, 56, 0) },
|
||||
new Point3D[] { new Point3D(5619, 57, 0), new Point3D(5619, 58, 0), new Point3D(5619, 56, 0) },
|
||||
new Point3D[] { new Point3D(5620, 57, 0), new Point3D(5620, 58, 0), new Point3D(5620, 56, 0) },
|
||||
};
|
||||
|
||||
public ShameWall(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)3);
|
||||
|
||||
writer.Write(Troll);
|
||||
writer.Write(StartSpot);
|
||||
writer.Write(StartMap);
|
||||
writer.Write(TrollSpawnLoc);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Troll = reader.ReadMobile() as CaveTroll;
|
||||
StartSpot = reader.ReadPoint3D();
|
||||
StartMap = reader.ReadMap();
|
||||
TrollSpawnLoc = reader.ReadPoint3D();
|
||||
|
||||
if (Troll != null)
|
||||
Troll.Wall = this;
|
||||
|
||||
if (this.Location != StartSpot || Troll == null || Troll.Deleted || !Troll.Alive)
|
||||
Reset();
|
||||
|
||||
if (version == 2)
|
||||
Timer.DelayCall(() => AddTeleporters(this));
|
||||
|
||||
if (version == 1 && StartSpot == new Point3D(5619, 57, 0) && StartMap == Map.Felucca)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(20), () =>
|
||||
{
|
||||
ShameWall.AddTeleporters(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user