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

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Plants;
using Server.Engines.Quests;
using Server.Engines.Quests.Hag;
@ -808,24 +809,27 @@ namespace Server.Items
{
QuestSystem qs = player.Quest;
if (qs is WitchApprenticeQuest)
if (qs.FindObjective(typeof(FindIngredientObjective)) is FindIngredientObjective obj &&
!obj.Completed && obj.Ingredient == Ingredient.SwampWater)
if (!(qs is WitchApprenticeQuest))
return;
FindIngredientObjective obj = qs.FindObjective<FindIngredientObjective>();
if (obj?.Completed == true && obj.Ingredient == Ingredient.SwampWater)
{
bool contains = false;
for (int i = 0; !contains && i < m_SwampTiles.Length; i += 2)
contains = tileID >= m_SwampTiles[i] && tileID <= m_SwampTiles[i + 1];
if (contains)
{
bool contains = false;
Delete();
for (int i = 0; !contains && i < m_SwampTiles.Length; i += 2)
contains = tileID >= m_SwampTiles[i] && tileID <= m_SwampTiles[i + 1];
if (contains)
{
Delete();
player.SendLocalizedMessage(
1055035); // You dip the container into the disgusting swamp water, collecting enough for the Hag's vile stew.
obj.Complete();
}
player.SendLocalizedMessage(
1055035); // You dip the container into the disgusting swamp water, collecting enough for the Hag's vile stew.
obj.Complete();
}
}
}
}
}
@ -942,9 +946,9 @@ namespace Server.Items
if (from is PlayerMobile player)
if (player.Quest is SolenMatriarchQuest qs)
{
QuestObjective obj = qs.FindObjective(typeof(GatherWaterObjective));
QuestObjective obj = qs.FindObjective<GatherWaterObjective>();
if (obj != null && !obj.Completed)
if (obj?.Completed == false)
{
BaseAddon vat = component.Addon;
@ -1086,7 +1090,7 @@ namespace Server.Items
#region Effects of achohol
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public static void Initialize()
{
@ -1102,7 +1106,7 @@ namespace Server.Items
{
if (from.BAC > 0 && from.Map != Map.Internal && !from.Deleted)
{
Timer t = (Timer)m_Table[from];
Timer t = m_Table[from];
if (t == null)
{
@ -1117,7 +1121,7 @@ namespace Server.Items
}
else
{
Timer t = (Timer)m_Table[from];
Timer t = m_Table[from];
if (t != null)
{
@ -1189,4 +1193,4 @@ namespace Server.Items
#endregion
}
}
}

View file

@ -99,7 +99,7 @@ namespace Server.Items
if (IsHeatSource(targeted))
{
if (from.BeginAction(typeof(CookableFood)))
if (from.BeginAction<CookableFood>())
{
from.PlaySound(0x225);
@ -133,7 +133,7 @@ namespace Server.Items
protected override void OnTick()
{
m_From.EndAction(typeof(CookableFood));
m_From.EndAction<CookableFood>();
if (m_From.Map != m_Map || m_Point != null && m_From.GetDistanceToSqrt(m_Point) > 3)
{

View file

@ -548,7 +548,7 @@ namespace Server.Items
}
else if ( targeted is TribalBerry )
{
if ( from.Skills[SkillName.Cooking].Base >= 80.0 )
if ( from.Skills.Cooking.Base >= 80.0 )
{
m_Item.Delete();
((TribalBerry)targeted).Delete();