Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -43,11 +43,11 @@ namespace Server.Commands
return false;
}
public static Item TryCreateItem(int x, int y, int z, Item srcItem)
public static T TryCreateItem<T>(int x, int y, int z, T srcItem) where T : Item
{
IPooledEnumerable<Item> eable = Map.Felucca.GetItemsInBounds(new Rectangle2D(x, y, 1, 1));
IPooledEnumerable<T> eable = Map.Felucca.GetItemsInBounds<T>(new Rectangle2D(x, y, 1, 1));
foreach (Item item in eable)
foreach (T item in eable)
if (item.GetType() == srcItem.GetType())
{
eable.Free();
@ -191,15 +191,13 @@ namespace Server.Commands
// Generate Central Khaldun entrance
DisappearingRaiseSwitch sw =
TryCreateItem(5459, 1426, 10, new DisappearingRaiseSwitch()) as DisappearingRaiseSwitch;
RaiseSwitch lv = TryCreateItem(5403, 1359, 0, new RaiseSwitch()) as RaiseSwitch;
TryCreateItem(5459, 1426, 10, new DisappearingRaiseSwitch());
RaiseSwitch lv = TryCreateItem(5403, 1359, 0, new RaiseSwitch());
RaisableItem stone =
TryCreateItem(5403, 1360, 0, new RaisableItem(0x788, 10, 0x477, 0x475, TimeSpan.FromMinutes(1.5))) as
RaisableItem;
TryCreateItem(5403, 1360, 0, new RaisableItem(0x788, 10, 0x477, 0x475, TimeSpan.FromMinutes(1.5)));
RaisableItem door =
TryCreateItem(5524, 1367, 0, new RaisableItem(0x1D0, 20, 0x477, 0x475, TimeSpan.FromMinutes(5.0))) as
RaisableItem;
TryCreateItem(5524, 1367, 0, new RaisableItem(0x1D0, 20, 0x477, 0x475, TimeSpan.FromMinutes(5.0)));
sw.RaisableItem = stone;
lv.RaisableItem = door;

View file

@ -259,8 +259,8 @@ namespace Server.Items
solution = new PuzzleChestSolution(PuzzleChestCylinder.None, PuzzleChestCylinder.None,
PuzzleChestCylinder.None, PuzzleChestCylinder.None, PuzzleChestCylinder.None);
from.CloseGump(typeof(PuzzleGump));
from.CloseGump(typeof(StatusGump));
from.CloseGump<PuzzleGump>();
from.CloseGump<StatusGump>();
from.SendGump(new PuzzleGump(from, this, solution, 0));
return true;
@ -277,9 +277,7 @@ namespace Server.Items
public void SubmitSolution(Mobile m, PuzzleChestSolution solution)
{
int correctCylinders, correctColors;
if (solution.Matches(Solution, out correctCylinders, out correctColors))
if (solution.Matches(Solution, out int correctCylinders, out int correctColors))
{
LockPick(m);
@ -553,7 +551,7 @@ namespace Server.Items
m_Chest = chest;
m_Solution = solution;
Dragable = false;
Draggable = false;
AddBackground(25, 0, 500, 410, 0x53);