fix: Fixes ignoring mobs, champions, party crash, slayer rarity, boat speedhack, etc (#1222)
* Movie ignore mobiles to Mobile class * Allow necromancer familiars to ignore mobiles * ChampionSpawn should not quietly fail when creating new spawn * Fix client party crash bug: 2 people partied, the leader logs out, other client is hung * Fix spellbooks creating with magery/meditation only and creating magery multiple times * Fix BaseRunicTool.GetRandomSlayer() creating more undead slayers than intended * Do not allow players to dismount each other whilst mounted * Fix AOS onwards damage increase tooltip and wrong formula in AOS * Fix monsters killing other monster revenants + animate dead should not attack player pets + other animates * Fix fire steed having loot pack added twice * Fix oaks spawn not able to create Unicorns + Kirins via Activator.CreateInstace() due to constructor having name as parametr * Fix ignoreMobiles flag not propagated to client for non-players. * Fix harrower tents not leeching from players * Fix boats speedhacking around the map * Fix bless, agility etc. not renewing duration * Fix reveal always worked * Fix empty constructor for steeds so they don't throw now.
This commit is contained in:
parent
910e06767b
commit
053dbcbad0
54 changed files with 871 additions and 454 deletions
|
|
@ -207,9 +207,10 @@ namespace Server.Items
|
|||
|
||||
private static void ApplySkillBonus(AosSkillBonuses attrs, int min, int max, int index, int low, int high)
|
||||
{
|
||||
var isSpellBook = attrs.Owner is Spellbook;
|
||||
var possibleSkills =
|
||||
new List<SkillName>(attrs.Owner is Spellbook ? m_PossibleSpellbookSkills : m_PossibleBonusSkills);
|
||||
var count = Core.SE ? possibleSkills.Count : possibleSkills.Count - 2;
|
||||
new List<SkillName>(isSpellBook ? m_PossibleSpellbookSkills : m_PossibleBonusSkills);
|
||||
var count = Core.SE || isSpellBook ? possibleSkills.Count : possibleSkills.Count - 2;
|
||||
|
||||
SkillName sk;
|
||||
bool found;
|
||||
|
|
@ -234,20 +235,30 @@ namespace Server.Items
|
|||
switch (res)
|
||||
{
|
||||
case ResistanceType.Physical:
|
||||
ar.PhysicalBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
{
|
||||
ar.PhysicalBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
}
|
||||
case ResistanceType.Fire:
|
||||
ar.FireBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
{
|
||||
ar.FireBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
}
|
||||
case ResistanceType.Cold:
|
||||
ar.ColdBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
{
|
||||
ar.ColdBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
}
|
||||
case ResistanceType.Poison:
|
||||
ar.PoisonBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
{
|
||||
ar.PoisonBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
}
|
||||
case ResistanceType.Energy:
|
||||
ar.EnergyBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
{
|
||||
ar.EnergyBonus += Scale(min, max, low, high);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -332,20 +343,30 @@ namespace Server.Items
|
|||
switch (Utility.Random(5))
|
||||
{
|
||||
case 0:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPhysicalArea, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPhysicalArea, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -355,17 +376,25 @@ namespace Server.Items
|
|||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -375,81 +404,129 @@ namespace Server.Items
|
|||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 50);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 50);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.WeaponSpeed, 5, 30, 5);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.WeaponSpeed, 5, 30, 5);
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitDispel, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitDispel, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechHits, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechHits, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLowerAttack, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLowerAttack, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLowerDefend, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLowerDefend, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechMana, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechMana, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechStam, 2, 50, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechStam, 2, 50, 2);
|
||||
break;
|
||||
}
|
||||
case 16:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.LowerStatReq, 10, 100, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.LowerStatReq, 10, 100, 10);
|
||||
break;
|
||||
}
|
||||
case 17:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistPhysicalBonus, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistPhysicalBonus, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 18:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistFireBonus, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistFireBonus, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 19:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistColdBonus, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistColdBonus, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 20:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistPoisonBonus, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistPoisonBonus, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 21:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistEnergyBonus, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistEnergyBonus, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 22:
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.DurabilityBonus, 10, 100, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosWeaponAttribute.DurabilityBonus, 10, 100, 10);
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
weapon.Slayer = GetRandomSlayer();
|
||||
break;
|
||||
{
|
||||
weapon.Slayer = GetRandomSlayer();
|
||||
break;
|
||||
}
|
||||
case 24:
|
||||
GetElementalDamages(weapon);
|
||||
break;
|
||||
{
|
||||
GetElementalDamages(weapon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -529,14 +606,14 @@ namespace Server.Items
|
|||
return SlayerName.None;
|
||||
}
|
||||
|
||||
// -1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
|
||||
var group = groups[Utility.Random(groups.Length - 1)];
|
||||
// 10% chance of a super - skip fey
|
||||
if (Utility.RandomDouble() < 0.10)
|
||||
{
|
||||
return groups[Utility.Random(groups.Length - 1)].Super.Name;
|
||||
}
|
||||
|
||||
// 10% chance for a super slayer
|
||||
var entry = group.Entries.Length == 0 || Utility.Random(10) == 0
|
||||
? group.Super : group.Entries.RandomElement();
|
||||
|
||||
return entry.Name;
|
||||
// Minor slayer - skip fey and undead
|
||||
return groups[Utility.Random(groups.Length - 2)].Entries.RandomElement().Name;
|
||||
}
|
||||
|
||||
public void ApplyAttributesTo(BaseArmor armor)
|
||||
|
|
@ -611,87 +688,135 @@ namespace Server.Items
|
|||
{
|
||||
/* Begin Shields */
|
||||
case 0:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
if (Core.ML)
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
}
|
||||
if (Core.ML)
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
}
|
||||
/* Begin Armor */
|
||||
case 4:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10);
|
||||
break;
|
||||
}
|
||||
/* End Shields */
|
||||
case 7:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.MageArmor, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.MageArmor, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2);
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5);
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 16:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
}
|
||||
case 17:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
}
|
||||
case 18:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 19:
|
||||
ApplyResistance(armor, min, max, ResistanceType.Physical, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyResistance(armor, min, max, ResistanceType.Physical, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 20:
|
||||
ApplyResistance(armor, min, max, ResistanceType.Fire, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyResistance(armor, min, max, ResistanceType.Fire, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 21:
|
||||
ApplyResistance(armor, min, max, ResistanceType.Cold, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyResistance(armor, min, max, ResistanceType.Cold, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 22:
|
||||
ApplyResistance(armor, min, max, ResistanceType.Poison, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyResistance(armor, min, max, ResistanceType.Poison, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
ApplyResistance(armor, min, max, ResistanceType.Energy, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyResistance(armor, min, max, ResistanceType.Energy, 1, 15);
|
||||
break;
|
||||
}
|
||||
/* End Armor */
|
||||
}
|
||||
}
|
||||
|
|
@ -728,62 +853,100 @@ namespace Server.Items
|
|||
switch (random)
|
||||
{
|
||||
case 0:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10);
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5);
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 16:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 17:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 18:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -819,77 +982,125 @@ namespace Server.Items
|
|||
switch (random)
|
||||
{
|
||||
case 0:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 25);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 25);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusStr, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusStr, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusDex, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusDex, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5);
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 3);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 3);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
}
|
||||
case 16:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
|
||||
break;
|
||||
}
|
||||
case 17:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12);
|
||||
break;
|
||||
}
|
||||
case 18:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 19:
|
||||
ApplySkillBonus(skills, min, max, 0, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 0, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 20:
|
||||
ApplySkillBonus(skills, min, max, 1, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 1, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 21:
|
||||
ApplySkillBonus(skills, min, max, 2, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 2, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 22:
|
||||
ApplySkillBonus(skills, min, max, 3, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 3, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
ApplySkillBonus(skills, min, max, 4, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 4, 1, 15);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -938,41 +1149,65 @@ namespace Server.Items
|
|||
break;
|
||||
}
|
||||
case 4:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 3);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 3);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
ApplySkillBonus(skills, min, max, 0, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 0, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
ApplySkillBonus(skills, min, max, 1, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 1, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
ApplySkillBonus(skills, min, max, 2, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 2, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
ApplySkillBonus(skills, min, max, 3, 1, 15);
|
||||
break;
|
||||
{
|
||||
ApplySkillBonus(skills, min, max, 3, 1, 15);
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2);
|
||||
break;
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2);
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
spellbook.Slayer = GetRandomSlayer();
|
||||
break;
|
||||
{
|
||||
spellbook.Slayer = GetRandomSlayer();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,11 +35,10 @@ namespace Server.Mobiles
|
|||
{
|
||||
public class GrizzledMare : HellSteed
|
||||
{
|
||||
private static readonly string m_Myname = "a grizzled mare";
|
||||
public override string DefaultName => "a grizzled mare";
|
||||
|
||||
[Constructible]
|
||||
public GrizzledMare()
|
||||
: base(m_Myname)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -49,18 +48,11 @@ namespace Server.Mobiles
|
|||
|
||||
public override bool DeleteOnRelease => true;
|
||||
|
||||
public virtual void OnAfterDeserialize_Callback()
|
||||
{
|
||||
SetStats(this);
|
||||
|
||||
Name = m_Myname;
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1); // version
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
|
|
@ -68,11 +60,6 @@ namespace Server.Mobiles
|
|||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
if (version < 1)
|
||||
{
|
||||
Timer.StartTimer(TimeSpan.FromSeconds(0), OnAfterDeserialize_Callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ public class Dismount : WeaponAbility
|
|||
return;
|
||||
}
|
||||
|
||||
ClearCurrentAbility(attacker);
|
||||
|
||||
if (defender is ChaosDragoon or ChaosDragoonElite)
|
||||
{
|
||||
return;
|
||||
|
|
@ -33,11 +35,10 @@ public class Dismount : WeaponAbility
|
|||
if (attacker.Weapon is not Lance || !defender.Mounted && !defender.Flying && defender.Weapon is not Lance)
|
||||
{
|
||||
attacker.SendLocalizedMessage(1061283); // You cannot perform that attack while mounted!
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ClearCurrentAbility(attacker);
|
||||
|
||||
var mount = defender.Mount;
|
||||
|
||||
if (mount == null && !AnimalForm.UnderTransformation(defender))
|
||||
|
|
|
|||
|
|
@ -18,6 +18,13 @@ namespace Server.Items
|
|||
|
||||
if (index >= 1 && index < WeaponAbility.Abilities.Length)
|
||||
{
|
||||
if (m.Mounted && index == 6) //dismount
|
||||
{
|
||||
WeaponAbility.ClearCurrentAbility(m);
|
||||
m.SendLocalizedMessage(1061283); // You cannot perform that attack while mounted!
|
||||
return;
|
||||
}
|
||||
|
||||
WeaponAbility.SetCurrentAbility(m, WeaponAbility.Abilities[index]);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -487,14 +487,7 @@ namespace Server.Items
|
|||
|
||||
if (Quality == WeaponQuality.Exceptional)
|
||||
{
|
||||
if (Attributes.WeaponDamage > 35)
|
||||
{
|
||||
Attributes.WeaponDamage -= 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
Attributes.WeaponDamage = 15;
|
||||
}
|
||||
Attributes.WeaponDamage = 35;
|
||||
|
||||
if (Core.ML)
|
||||
{
|
||||
|
|
@ -2385,27 +2378,8 @@ namespace Server.Items
|
|||
};
|
||||
}
|
||||
|
||||
public virtual int GetDamageBonus()
|
||||
{
|
||||
var quality = m_Quality switch
|
||||
{
|
||||
WeaponQuality.Low => -20,
|
||||
WeaponQuality.Exceptional => 20,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
var damageLevel = m_DamageLevel switch
|
||||
{
|
||||
WeaponDamageLevel.Ruin => 15,
|
||||
WeaponDamageLevel.Might => 20,
|
||||
WeaponDamageLevel.Force => 25,
|
||||
WeaponDamageLevel.Power => 30,
|
||||
WeaponDamageLevel.Vanq => 35,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
return VirtualDamageBonus + quality + damageLevel;
|
||||
}
|
||||
// Note: AOS quality/damage bonuses removed since they are incorporated into the crafting already
|
||||
public virtual int GetDamageBonus() => VirtualDamageBonus;
|
||||
|
||||
public virtual double ScaleDamageAOS(Mobile attacker, double damage, bool checkSkills)
|
||||
{
|
||||
|
|
@ -2477,10 +2451,9 @@ namespace Server.Items
|
|||
damageBonus = 100;
|
||||
}
|
||||
|
||||
var totalBonus = strengthBonus + anatomyBonus + tacticsBonus + lumberBonus +
|
||||
(GetDamageBonus() + damageBonus) / 100.0;
|
||||
var totalBonus = strengthBonus + anatomyBonus + tacticsBonus + lumberBonus + damageBonus + GetDamageBonus();
|
||||
|
||||
return damage + (int)(damage * totalBonus);
|
||||
return damage + damage * totalBonus / 100.0;
|
||||
}
|
||||
|
||||
public virtual int ComputeDamageAOS(Mobile attacker, Mobile defender) =>
|
||||
|
|
|
|||
|
|
@ -402,11 +402,13 @@ namespace Server.Items
|
|||
Groups = new[]
|
||||
{
|
||||
humanoid,
|
||||
undead,
|
||||
elemental,
|
||||
abyss,
|
||||
arachnid,
|
||||
reptilian,
|
||||
// Skip undead for minor slayers
|
||||
undead,
|
||||
// Skip fey for random slayer
|
||||
fey
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue