Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
- Fixed Soul Charge, now shows Effects
- Soul Charge now shows as properties on shields
- Spirit Speak no longer drops current spell. For this, it had to be converted from a spell to a timer. The only other option was several core edits.
- Shadow Spell now gives appropriate bonus to being revealed (not being revealed)
- Added update range check to BaseHouse. Keep an eye on this one.
- Added Security context entries to Crystal Portals and Davies Locker
- Fixed imbuing resistances on armor. It is not 15 + base resists.
- White Tiger Form now shows proper cast Effects
- White Tiger Form now can be activated by animal form when moving as last animal form
  • Loading branch information
kevin-10 committed Oct 14, 2017
1 parent 54e5ded commit f09fcc4
Show file tree
Hide file tree
Showing 18 changed files with 346 additions and 188 deletions.
6 changes: 5 additions & 1 deletion Scripts/Abilities/SAPropEffects.cs
Expand Up @@ -179,7 +179,7 @@ public class SoulChargeContext : PropertyEffect
private bool m_Active;

public SoulChargeContext(Mobile from, Item item)
: base(from, null, item, EffectsType.SoulCharge, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15))
: base(from, null, item, EffectsType.SoulCharge, TimeSpan.FromSeconds(40), TimeSpan.FromSeconds(40))
{
m_Active = true;
}
Expand All @@ -191,13 +191,17 @@ public override void OnDamaged(int damage)
double mod = BaseFishPie.IsUnderEffects(this.Mobile, FishPieEffect.SoulCharge) ? .50 : .30;
this.Mobile.Mana += (int)Math.Min(this.Mobile.ManaMax, damage * mod);
m_Active = false;

Server.Effects.SendTargetParticles(this.Mobile, 0x375A, 0x1, 0xA, 0x71, 0x2, 0x1AE9, (EffectLayer)0, 0);

this.Mobile.SendLocalizedMessage(1113636); //The soul charge effect converts some of the damage you received into mana.
}
}

public static void CheckHit(Mobile attacker, Mobile defender, int damage)
{
BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield;

if (shield != null && shield.ArmorAttributes.SoulCharge > 0 && shield.ArmorAttributes.SoulCharge > Utility.Random(100))
{
SoulChargeContext sc = PropertyEffect.GetContext<SoulChargeContext>(defender, EffectsType.SoulCharge);
Expand Down
9 changes: 6 additions & 3 deletions Scripts/Items/Equipment/Armor/BaseArmor.cs
Expand Up @@ -2891,6 +2891,9 @@ public override void GetProperties(ObjectPropertyList list)
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%

if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
list.Add(1113630, prop.ToString()); // Soul Charge ~1_val~%

if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%

Expand Down Expand Up @@ -2924,12 +2927,12 @@ public override void GetProperties(ObjectPropertyList list)
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%

if((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
list.Add(1112364); // reactive paralyze

if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%

if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
list.Add(1113630, prop.ToString()); // Soul Charge ~1_val~%

if (this is SurgeShield && ((SurgeShield)this).Surge > SurgeType.None)
list.Add(1153098, ((SurgeShield)this).Charges.ToString());

Expand Down
4 changes: 0 additions & 4 deletions Scripts/Items/Equipment/Weapons/BaseWeapon.cs
Expand Up @@ -2557,10 +2557,6 @@ public virtual void OnHit(Mobile attacker, IDamageable damageable, double damage
false,
ranged ? Server.DamageType.Ranged : Server.DamageType.Melee);

#region Stygian Abyss
SoulChargeContext.CheckHit(attacker, defender, damageGiven);
#endregion

if (sparks)
{
int mana = attacker.Mana + damageGiven;
Expand Down
4 changes: 4 additions & 0 deletions Scripts/Misc/AOS.cs
Expand Up @@ -312,6 +312,8 @@ public static int Damage(IDamageable damageable, Mobile from, int damage, bool i

m.Damage(totalDamage, from, true, false);

SpiritSpeak.CheckDisrupt(m);

#region Skill Mastery Spells
ManaShieldSpell.CheckManaShield(m, ref totalDamage);
SkillMasterySpell.OnDamaged(m, from, ref totalDamage);
Expand All @@ -326,6 +328,8 @@ public static int Damage(IDamageable damageable, Mobile from, int damage, bool i
if (ManaPhasingOrb.IsInManaPhase(m))
ManaPhasingOrb.RemoveFromTable(m);

SoulChargeContext.CheckHit(from, m, totalDamage);

Spells.Mysticism.SleepSpell.OnDamage(m);
Spells.Mysticism.PurgeMagicSpell.OnMobileDoDamage(from);
#endregion
Expand Down
1 change: 1 addition & 0 deletions Scripts/Mobiles/AI/BaseAI.cs
Expand Up @@ -3012,6 +3012,7 @@ public virtual void DetectHidden()
}

chance /= 100;
double shadow = Server.Spells.SkillMasteries.ShadowSpell.GetDifficultyFactor(trg);

if (chance > Utility.RandomDouble())
{
Expand Down
17 changes: 16 additions & 1 deletion Scripts/Multis/BaseHouse.cs
Expand Up @@ -628,7 +628,19 @@ public bool HasActiveAuction

public override int GetUpdateRange(Mobile m)
{
return Core.GlobalMaxUpdateRange;
int min = m.NetState != null ? m.NetState.UpdateRange : 18;
int max = Core.GlobalMaxUpdateRange;

int w = Components.Width;
int h = Components.Height - 1;
int v = min + ((w > h ? w : h) / 2);

if (v > max)
v = max;
else if (v < min)
v = min;

return v;
}

public List<Mobile> AvailableVendorsFor(Mobile m)
Expand Down Expand Up @@ -4597,6 +4609,9 @@ public static ISecurable GetSecurable(Mobile from, Item item)
if (!isOwned)
isOwned = house.IsLockedDown(item);

if (!isOwned)
isOwned = item is BaseAddon;

if (isOwned)
sec = (ISecurable)item;
}
Expand Down
@@ -1,12 +1,15 @@
#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
Expand Down Expand Up @@ -39,17 +42,36 @@ 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)
{
if (Movable)
{
if (message)
{
m.SendMessage("This must be locked down in a house to use!");
}

return false;
}
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))
{
Expand Down
10 changes: 10 additions & 0 deletions Scripts/Services/VeteranRewards/CrystalPortals/CrystalPortal.cs
@@ -1,12 +1,15 @@
#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
Expand Down Expand Up @@ -39,6 +42,13 @@ 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);
Expand Down
15 changes: 12 additions & 3 deletions Scripts/Services/VeteranRewards/DaviesLocker.cs
Expand Up @@ -71,10 +71,17 @@ public DaviesLockerAddon(bool south, List<DaviesLockerEntry> list)

public override void OnComponentUsed(AddonComponent component, Mobile from)
{
if (from.InRange(component.Location, 2) && CanUse(from))
if (from.InRange(component.Location, 2))
{
from.CloseGump(typeof(DaviesLockerGump));
from.SendGump(new DaviesLockerGump(from, this));
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.
}
}
}

Expand Down Expand Up @@ -194,6 +201,8 @@ public override void Deserialize(GenericReader reader)

public class DaviesLockerComponent : LocalizedAddonComponent
{
public override bool ForceShowProperties { get { return true; } }

public DaviesLockerComponent(int id)
: base(id, 1153534) // Davies' Locker
{
Expand Down
3 changes: 2 additions & 1 deletion Scripts/Skills/DetectHidden.cs
Expand Up @@ -79,8 +79,9 @@ protected override void OnTarget(Mobile src, object targ)
{
double ss = srcSkill + Utility.Random(21) - 10;
double ts = trg.Skills[SkillName.Hiding].Value + Utility.Random(21) - 10;
double shadow = Server.Spells.SkillMasteries.ShadowSpell.GetDifficultyFactor(trg);

if (src.AccessLevel >= trg.AccessLevel && (ss >= ts || (inHouse && house.IsInside(trg))))
if (src.AccessLevel >= trg.AccessLevel && (ss >= ts || (inHouse && house.IsInside(trg))) && Utility.RandomDouble() > shadow)
{
if (trg is ShadowKnight && (trg.X != p.X || trg.Y != p.Y))
continue;
Expand Down
59 changes: 43 additions & 16 deletions Scripts/Skills/Imbuing/Core/Imbuing.cs
Expand Up @@ -145,8 +145,8 @@ public static bool IsSpecialItem(Item item)
if (RunicReforging.GetArtifactRarity(item) > 0)
return true;

if (item.GetType() == typeof(SilverRing) || item.GetType() == typeof(SilverBracelet))
return false;
if (NonCraftableImbuable(item))
return false;

foreach (CraftSystem system in CraftSystem.Systems)
{
Expand Down Expand Up @@ -176,6 +176,27 @@ private static bool IsSpecialImbuable(Item item)
typeof(ClockworkLeggings), typeof(GargishClockworkLeggings)
};

private static Type[] _NonCraftables =
{
typeof(SilverRing), typeof(SilverBracelet)
};

public static bool NonCraftableImbuable(Item item)
{
if (item is BaseWand)
return true;

Type type = item.GetType();

foreach (var t in _NonCraftables)
{
if (t == type)
return true;
}

return false;
}

public static double GetSuccessChance(Mobile from, Item item, int totalItemWeight, int propWeight, out double dif)
{
double suc = 0; // display difficulty
Expand Down Expand Up @@ -711,11 +732,6 @@ public static int GetMaxIntensity(Item item, ImbuingDefinition def)
return GetPropRange(item, attr)[1];
}

if ((item is BaseArmor || item is BaseHat) && def.Attribute is AosElementAttribute)
{
return GetPropRange(item, (AosElementAttribute)def.Attribute)[1];
}

return def.MaxIntensity;
}

Expand Down Expand Up @@ -1767,10 +1783,6 @@ public static int GetIntensityForAttribute(Item item, object attr, int checkMod,
{
max = GetPropRange((BaseWeapon)item, (AosWeaponAttribute)attr)[1];
}
else if(item is BaseArmor && attr is AosElementAttribute)
{
max = GetPropRange((BaseArmor)item, (AosElementAttribute)attr)[1];
}
else if (item is BaseJewel && attr is AosAttribute && (AosAttribute)attr == AosAttribute.WeaponDamage)
{
max = 25;
Expand Down Expand Up @@ -2179,11 +2191,26 @@ public static int[] GetPropRange(AosElementAttribute attr)
return new int[] { 1, 15 };
}

public static int[] GetPropRange(Item item, AosElementAttribute attr)
/*public static int[] GetPropRange(Item item, AosElementAttribute attr)
{
return new int[] { 1, 15 };
int index = GetArmorIndex(item);
if (index < 0 || index > _MaxResistArmorTable.Length) // Default Value
if (item is BaseArmor)
{
BaseArmor ar = item as BaseArmor;
switch (attr)
{
default:
case AosElementAttribute.Physical: return new int[] { ar.BasePhysicalResistance + 1, ar.BasePhysicalResistance + 15 };
case AosElementAttribute.Fire: return new int[] { ar.BaseFireResistance + 1, ar.BaseFireResistance + 15 };
case AosElementAttribute.Cold: return new int[] { ar.BaseColdResistance + 1, ar.BaseColdResistance + 15 };
case AosElementAttribute.Poison: return new int[] { ar.BasePoisonResistance + 1, ar.BasePoisonResistance + 15 };
case AosElementAttribute.Energy: return new int[] { ar.BaseEnergyResistance + 1, ar.BaseEnergyResistance + 15 };
}
}*/
/*if (index < 0 || index > _MaxResistArmorTable.Length) // Default Value
return new int[] { 1, 15 };
int attrIndex;
Expand All @@ -2199,7 +2226,7 @@ public static int[] GetPropRange(Item item, AosElementAttribute attr)
}
return new int[] { 1, _MaxResistArmorTable[index][attrIndex] };
}
}*/

public static int[] GetPropRange(Item item, ExtendedWeaponAttribute attr)
{
Expand All @@ -2213,7 +2240,7 @@ public static int[] GetPropRange(Item item, ExtendedWeaponAttribute attr)
}
}

private static int GetArmorIndex(Item item)
/*private static int GetArmorIndex(Item item)
{
if (item is BaseHat)
return 0;
Expand Down Expand Up @@ -2283,7 +2310,7 @@ private static int GetArmorIndex(Item item)
new int[] { 18, 18, 18, 18, 18 }, // dragon
new int[] { 22, 17, 17, 17, 17 }, // helmets
};
};*/
#endregion
}
}
19 changes: 18 additions & 1 deletion Scripts/Skills/Imbuing/Gumps/ImbuingC.cs
Expand Up @@ -203,7 +203,24 @@ public ImbuingGumpC(Mobile from, Item item, int mod, int value) : base(520, 340)
else if (maxInt <= 8 || m_Mod == 21 || m_Mod == 17) // - Show Property Value as just Number ( i.e [Mana Regen 2] )
AddHtml(240, 368, 40, 20, String.Format("<CENTER><BASEFONT COLOR=#CCCCFF> {0}</CENTER>", m_Value), false, false);
else // - Show Property Value as % ( i.e [Hit Fireball 25%] )
AddHtml(240, 368, 40, 20, String.Format("<CENTER><BASEFONT COLOR=#CCCCFF> {0}%</CENTER>", m_Value), false, false);
{
int val = m_Value;

if (m_Mod >= 51 && m_Mod <= 55 && item is BaseArmor)
{
var armor = (BaseArmor)item;
switch (m_Mod)
{
case 51: val += armor.BasePhysicalResistance; break;
case 52: val += armor.BaseFireResistance; break;
case 53: val += armor.BaseColdResistance; break;
case 54: val += armor.BasePoisonResistance; break;
case 55: val += armor.BaseEnergyResistance; break;
}
}

AddHtml(240, 368, 40, 20, String.Format("<CENTER><BASEFONT COLOR=#CCCCFF> {0}%</CENTER>", val), false, false);
}

// == Buttons ==
AddButton(180, 370, 5230, 5230, 10053, GumpButtonType.Reply, 0); // To Minimum Value
Expand Down

0 comments on commit f09fcc4

Please sign in to comment.