fix: Fixes random bias & Adds back champion arties for UOML (#1235)
* Fixes RNG bias, we should never do `Utility.RandomDouble() <=` * Adds back champion artifacts behind UOML flag.
This commit is contained in:
parent
810061db8c
commit
8e01db8555
60 changed files with 289 additions and 335 deletions
|
|
@ -191,18 +191,12 @@ namespace Server.Mobiles
|
|||
}
|
||||
|
||||
var luck = LootPack.GetLuckChanceForKiller(boss);
|
||||
int chance;
|
||||
|
||||
if (boss is DemonKnight)
|
||||
return boss switch
|
||||
{
|
||||
chance = 1500 + luck / 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
chance = 750 + luck / 10;
|
||||
}
|
||||
|
||||
return chance;
|
||||
DemonKnight => 1500 + luck / 5,
|
||||
_ => 750 + luck / 10
|
||||
};
|
||||
}
|
||||
|
||||
public static bool CheckArtifactChance(Mobile boss) => GetArtifactChance(boss) > Utility.Random(100000);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Server.Mobiles
|
|||
public override bool Unprovokable => Core.SE;
|
||||
public override bool AreaPeaceImmune => Core.SE;
|
||||
public override Poison PoisonImmune => Poison.Lethal;
|
||||
public override Poison HitPoison => Utility.RandomDouble() <= 0.8 ? Poison.Greater : Poison.Deadly;
|
||||
public override Poison HitPoison => Utility.RandomDouble() < 0.8 ? Poison.Greater : Poison.Deadly;
|
||||
|
||||
public override int TreasureMapLevel => 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Server.Mobiles
|
|||
|
||||
SolenHelper.PackPicnicBasket(this);
|
||||
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 5 : 25));
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.95 ? 5 : 25));
|
||||
|
||||
if (Utility.RandomDouble() < 0.05)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Mobiles
|
|||
|
||||
SolenHelper.PackPicnicBasket(this);
|
||||
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 4 : 16));
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.95 ? 4 : 16));
|
||||
}
|
||||
|
||||
public RedSolenInfiltratorQueen(Serial serial) : base(serial)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Mobiles
|
|||
|
||||
SolenHelper.PackPicnicBasket(this);
|
||||
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 3 : 13));
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.95 ? 3 : 13));
|
||||
}
|
||||
|
||||
public RedSolenInfiltratorWarrior(Serial serial) : base(serial)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Server.Mobiles
|
|||
|
||||
SolenHelper.PackPicnicBasket(this);
|
||||
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 5 : 25));
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.95 ? 5 : 25));
|
||||
|
||||
if (Utility.RandomDouble() < 0.05)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Mobiles
|
|||
VirtualArmor = 35;
|
||||
|
||||
SolenHelper.PackPicnicBasket(this);
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 3 : 13));
|
||||
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.95 ? 3 : 13));
|
||||
|
||||
if (Utility.RandomDouble() < 0.05)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ namespace Server.Mobiles
|
|||
|
||||
m_Thrown++;
|
||||
|
||||
if (Utility.RandomDouble() <= 0.75 && m_Thrown % 2 == 1) // 75% chance to quickly throw another bomb
|
||||
if (m_Thrown % 2 == 1 && Utility.RandomDouble() < 0.75) // 75% chance to quickly throw another bomb
|
||||
{
|
||||
m_NextBomb = Core.Now + TimeSpan.FromSeconds(3.0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Server.Mobiles
|
|||
AddItem(new BoneArms());
|
||||
AddItem(new BoneLegs());
|
||||
|
||||
if (Utility.RandomDouble() < 0.5)
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
AddItem(new SavageMask());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() > 0.2)
|
||||
if (Utility.RandomDouble() < 0.80)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.1)
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ namespace Server.Mobiles
|
|||
|
||||
public void AreaPeace()
|
||||
{
|
||||
if (Combatant == null || Deleted || !Alive || m_NextPeace > Core.Now || Utility.RandomDouble() > 0.1)
|
||||
if (Combatant == null || Deleted || !Alive || m_NextPeace > Core.Now || Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ namespace Server.Mobiles
|
|||
|
||||
public void AreaUndress()
|
||||
{
|
||||
if (Combatant == null || Deleted || !Alive || m_NextUndress > Core.Now || Utility.RandomDouble() > 0.005)
|
||||
if (Combatant == null || Deleted || !Alive || m_NextUndress > Core.Now || Utility.RandomDouble() >= 0.005)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Server.Mobiles
|
|||
|
||||
public void Peace(Mobile target)
|
||||
{
|
||||
if (target == null || Deleted || !Alive || m_NextPeace > Core.Now || Utility.RandomDouble() > 0.1)
|
||||
if (target == null || Deleted || !Alive || m_NextPeace > Core.Now || Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ namespace Server.Mobiles
|
|||
public void Suppress(Mobile target)
|
||||
{
|
||||
if (target == null || m_Suppressed.ContainsKey(target) || Deleted || !Alive ||
|
||||
m_NextSuppress > Core.Now || Utility.RandomDouble() > 0.1)
|
||||
m_NextSuppress > Core.Now || Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ namespace Server.Mobiles
|
|||
|
||||
public void Undress(Mobile target)
|
||||
{
|
||||
if (target == null || Deleted || !Alive || m_NextUndress > Core.Now || Utility.RandomDouble() > 0.005)
|
||||
if (target == null || Deleted || !Alive || m_NextUndress > Core.Now || Utility.RandomDouble() >= 0.005)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ namespace Server.Mobiles
|
|||
|
||||
public void Provoke(Mobile target)
|
||||
{
|
||||
if (target == null || Deleted || !Alive || m_NextProvoke > Core.Now || Utility.RandomDouble() > 0.05)
|
||||
if (target == null || Deleted || !Alive || m_NextProvoke > Core.Now || Utility.RandomDouble() < 0.95)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() <= 0.2)
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
Earthquake();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace Server.Mobiles
|
|||
|
||||
public override void AlterDamageScalarFrom(Mobile caster, ref double scalar)
|
||||
{
|
||||
if (Utility.RandomDouble() <= 0.1)
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
SpawnPixies(caster);
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGotMeleeAttack(attacker, damage);
|
||||
|
||||
if (Utility.RandomDouble() <= 0.1)
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
SpawnPixies(attacker);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.1)
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,16 +122,16 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGotMeleeAttack(attacker, damage);
|
||||
|
||||
if (Hits > HitsMax / 4)
|
||||
if (Utility.RandomDouble() < 0.25)
|
||||
{
|
||||
if (Utility.RandomDouble() <= 0.25)
|
||||
if (Hits > HitsMax / 4)
|
||||
{
|
||||
SpawnBogling(attacker);
|
||||
}
|
||||
}
|
||||
else if (Utility.RandomDouble() <= 0.25)
|
||||
{
|
||||
EatBoglings();
|
||||
else
|
||||
{
|
||||
EatBoglings();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Server.Mobiles
|
|||
PackReg(3);
|
||||
PackItem(new FertileDirt(Utility.RandomMinMax(1, 10)));
|
||||
|
||||
if (Utility.RandomDouble() <= 0.2)
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
PackItem(new ExecutionersCap());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Server.Mobiles
|
|||
public override FoodType FavoriteFood => FoodType.Meat;
|
||||
public override PackInstinct PackInstinct => PackInstinct.Arachnid;
|
||||
public override Poison PoisonImmune => Poison.Greater;
|
||||
public override Poison HitPoison => Utility.RandomDouble() <= 0.8 ? Poison.Greater : Poison.Deadly;
|
||||
public override Poison HitPoison => Utility.RandomDouble() < 0.8 ? Poison.Greater : Poison.Deadly;
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.1)
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Server.Mobiles
|
|||
|
||||
AddItem(new Tessen());
|
||||
|
||||
if (Utility.RandomDouble() <= 0.02)
|
||||
if (Utility.RandomDouble() < 0.02)
|
||||
{
|
||||
PackItem(new OrigamiPaper());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.1)
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.1 || m_Table.Contains(defender))
|
||||
if (Utility.RandomDouble() < 0.9 || m_Table.Contains(defender))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Server.Mobiles
|
|||
break;
|
||||
}
|
||||
|
||||
if (Utility.RandomDouble() > .2)
|
||||
if (Utility.RandomDouble() < 0.80)
|
||||
{
|
||||
AddItem(new NoDachi());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.05)
|
||||
if (Utility.RandomDouble() < 0.95)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
|
||||
if (Utility.RandomDouble() >= 0.1)
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue