1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Paragon drop in different group.

Discussion in 'Script Support' started by Opywang, May 18, 2018.

  1. Opywang
    Offline

    Opywang Member

    Joined:
    Jan 16, 2017
    Messages:
    130
    Likes Received:
    2
    Hi I am trying to make paragon monster drop in a few setting like common, rare, epic, and legendary.

    I wonder if there is a way I want to set it how the drop rate like common be normal, and rare less drop rate, epic even less, and legendary very rare.

    What I am trying to do is set more than 1 type that you can make a setting like 5% drop rate for one set, and 1% drop rate for other set then so on like more than one type of set.

    I found the scripts if somebody want to get involve, and help then awesome I'd appreciated it very much!

    I know the drop rate is also in basecreature.cs I think, but I will go ahead post paragon.cs

    Code (C#):
    1. using System;
    2. using Server.Items;
    3.  
    4. namespace Server.Mobiles
    5. {
    6.     public class Paragon
    7.     {
    8.         public static double ChestChance = .10;// Chance that a paragon will carry a paragon chest
    9.         public static double ChocolateIngredientChance = .20;// Chance that a paragon will drop a chocolatiering ingredient
    10.         public static Map[] Maps = new Map[]                   // Maps that paragons will spawn on
    11.         {
    12.             Map.Ilshenar
    13.         };
    14.         public static Type[] Artifacts = new Type[]
    15.         {
    16.             typeof(GoldBricks), typeof(PhillipsWoodenSteed),
    17.             typeof(AlchemistsBauble), typeof(ArcticDeathDealer),
    18.             typeof(BlazeOfDeath), typeof(BowOfTheJukaKing),
    19.             typeof(BurglarsBandana), typeof(CavortingClub),
    20.             typeof(EnchantedTitanLegBone), typeof(GwennosHarp),
    21.             typeof(IolosLute), typeof(LunaLance),
    22.             typeof(NightsKiss), typeof(NoxRangersHeavyCrossbow),
    23.             typeof(OrcishVisage), typeof(PolarBearMask),
    24.             typeof(ShieldOfInvulnerability), typeof(StaffOfPower),
    25.             typeof(VioletCourage), typeof(HeartOfTheLion),
    26.             typeof(WrathOfTheDryad), typeof(PixieSwatter),
    27.             typeof(GlovesOfThePugilist)
    28.         };
    29.         public static int Hue = 0x501;// Paragon hue
    30.  
    31.         // Buffs
    32.         public static double HitsBuff = 5.0;
    33.         public static double StrBuff = 1.05;
    34.         public static double IntBuff = 1.20;
    35.         public static double DexBuff = 1.20;
    36.         public static double SkillsBuff = 1.20;
    37.         public static double SpeedBuff = 1.20;
    38.         public static double FameBuff = 1.40;
    39.         public static double KarmaBuff = 1.40;
    40.         public static int DamageBuff = 5;
    41.         public static void Convert(BaseCreature bc)
    42.         {
    43.             if (bc.IsParagon ||
    44.                 !bc.CanBeParagon)
    45.                 return;
    46.  
    47.             bc.Hue = Hue;
    48.  
    49.             if (bc.HitsMaxSeed >= 0)
    50.                 bc.HitsMaxSeed = (int)(bc.HitsMaxSeed * HitsBuff);
    51.  
    52.             bc.RawStr = (int)(bc.RawStr * StrBuff);
    53.             bc.RawInt = (int)(bc.RawInt * IntBuff);
    54.             bc.RawDex = (int)(bc.RawDex * DexBuff);
    55.  
    56.             bc.Hits = bc.HitsMax;
    57.             bc.Mana = bc.ManaMax;
    58.             bc.Stam = bc.StamMax;
    59.  
    60.             for (int i = 0; i < bc.Skills.Length; i++)
    61.             {
    62.                 Skill skill = (Skill)bc.Skills[i];
    63.  
    64.                 if (skill.Base > 0.0)
    65.                     skill.Base *= SkillsBuff;
    66.             }
    67.  
    68.             bc.PassiveSpeed /= SpeedBuff;
    69.             bc.ActiveSpeed /= SpeedBuff;
    70.             bc.CurrentSpeed = bc.PassiveSpeed;
    71.  
    72.             bc.DamageMin += DamageBuff;
    73.             bc.DamageMax += DamageBuff;
    74.  
    75.             if (bc.Fame > 0)
    76.                 bc.Fame = (int)(bc.Fame * FameBuff);
    77.  
    78.             if (bc.Fame > 32000)
    79.                 bc.Fame = 32000;
    80.  
    81.             // TODO: Mana regeneration rate = Sqrt( buffedFame ) / 4
    82.  
    83.             if (bc.Karma != 0)
    84.             {
    85.                 bc.Karma = (int)(bc.Karma * KarmaBuff);
    86.  
    87.                 if (Math.Abs(bc.Karma) > 32000)
    88.                     bc.Karma = 32000 * Math.Sign(bc.Karma);
    89.             }
    90.         }
    91.  
    92.         public static void UnConvert(BaseCreature bc)
    93.         {
    94.             if (!bc.IsParagon)
    95.                 return;
    96.  
    97.             bc.Hue = 0;
    98.  
    99.             if (bc.HitsMaxSeed >= 0)
    100.                 bc.HitsMaxSeed = (int)(bc.HitsMaxSeed / HitsBuff);
    101.  
    102.             bc.RawStr = (int)(bc.RawStr / StrBuff);
    103.             bc.RawInt = (int)(bc.RawInt / IntBuff);
    104.             bc.RawDex = (int)(bc.RawDex / DexBuff);
    105.  
    106.             bc.Hits = bc.HitsMax;
    107.             bc.Mana = bc.ManaMax;
    108.             bc.Stam = bc.StamMax;
    109.  
    110.             for (int i = 0; i < bc.Skills.Length; i++)
    111.             {
    112.                 Skill skill = (Skill)bc.Skills[i];
    113.  
    114.                 if (skill.Base > 0.0)
    115.                     skill.Base /= SkillsBuff;
    116.             }
    117.  
    118.             bc.PassiveSpeed *= SpeedBuff;
    119.             bc.ActiveSpeed *= SpeedBuff;
    120.             bc.CurrentSpeed = bc.PassiveSpeed;
    121.  
    122.             bc.DamageMin -= DamageBuff;
    123.             bc.DamageMax -= DamageBuff;
    124.  
    125.             if (bc.Fame > 0)
    126.                 bc.Fame = (int)(bc.Fame / FameBuff);
    127.             if (bc.Karma != 0)
    128.                 bc.Karma = (int)(bc.Karma / KarmaBuff);
    129.         }
    130.  
    131.         public static bool CheckConvert(BaseCreature bc)
    132.         {
    133.             return CheckConvert(bc, bc.Location, bc.Map);
    134.         }
    135.  
    136.         public static bool CheckConvert(BaseCreature bc, Point3D location, Map m)
    137.         {
    138.             if (!Core.AOS)
    139.                 return false;
    140.  
    141.             if (Array.IndexOf(Maps, m) == -1)
    142.                 return false;
    143.  
    144.             if (bc is BaseChampion || bc is Harrower || bc is BaseVendor || bc is BaseEscortable || bc is Clone || bc.IsParagon)
    145.                 return false;
    146.  
    147.             int fame = bc.Fame;
    148.  
    149.             if (fame > 32000)
    150.                 fame = 32000;
    151.  
    152.             double chance = 1 / Math.Round(20.0 - (fame / 3200));
    153.  
    154.             return (chance > Utility.RandomDouble());
    155.         }
    156.  
    157.         public static bool CheckArtifactChance(Mobile m, BaseCreature bc)
    158.         {
    159.             if (!Core.AOS)
    160.                 return false;
    161.  
    162.             double fame = (double)bc.Fame;
    163.  
    164.             if (fame > 32000)
    165.                 fame = 32000;
    166.  
    167.             double chance = 1 / (Math.Max(10, 100 * (0.83 - Math.Round(Math.Log(Math.Round(fame / 6000, 3) + 0.001, 10), 3))) * (100 - Math.Sqrt(m.Luck)) / 100.0);
    168.  
    169.             return chance > Utility.RandomDouble();
    170.         }
    171.  
    172.         public static void GiveArtifactTo(Mobile m)
    173.         {
    174.             Item item = (Item)Activator.CreateInstance(Artifacts[Utility.Random(Artifacts.Length)]);
    175.  
    176.             if (m.AddToBackpack(item))
    177.                 m.SendMessage("As a reward for slaying the mighty paragon, an artifact has been placed in your backpack.");
    178.             else
    179.                 m.SendMessage("As your backpack is full, your reward for destroying the legendary paragon has been placed at your feet.");
    180.         }
    181.     }
    182. }
     
  2. Opywang
    Offline

    Opywang Member

    Joined:
    Jan 16, 2017
    Messages:
    130
    Likes Received:
    2
    O.K. I found a possibility I notice Champ spawn has many different variety of drops that drop at a different chance, and rate.

    This is from Barracoon.cs
    Code (C#):
    1. public override Type[] UniqueList
    2.         {
    3.             get
    4.             {
    5.                 return new Type[] { typeof(FangOfRactus) };
    6.             }
    7.         }
    8.         public override Type[] SharedList
    9.         {
    10.             get
    11.             {
    12.                 return new Type[]
    13.                 {
    14.                     typeof(EmbroideredOakLeafCloak),
    15.                     typeof(DjinnisRing),
    16.                     typeof(DetectiveBoots),
    17.                     typeof(GauntletsOfAnger)
    18.                 };
    19.             }
    20.         }
    Now the problem is adding this to paragon to make it effect on paragon.

    Here this is from Base Champion.cs

    Code (C#):
    1.  public virtual Item GetArtifact()
    2.         {
    3.             double random = Utility.RandomDouble();
    4.             if (0.05 >= random)
    5.                 return this.CreateArtifact(this.UniqueList);
    6.             else if (0.15 >= random)
    7.                 return this.CreateArtifact(this.SharedList);
    8.             else if (0.30 >= random)
    9.                 return this.CreateArtifact(this.DecorativeList);
    10.             return null;
    11.         }
    Alright we'll looks like I've made progress, but it looks like it will take a lot of work to change it into paragons. If anybody want to join me for the project it'll be great, and rewarding I believe.
    --- Double Post Merged, May 19, 2018 ---
    O.K. I got a better idea how to make it work maybe I've already got one custom mob that drop artifacts in backpack, and I figure if I can make this work with more than 1 type of drop rate like for an example artifacts rarity 11, and artifacts rarity 12 in two separate group, and if I successfully make this work I could probably put that in paragon.cs to make it work some how.

    Code (C#):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Server;
    5. using Server.Items;
    6. namespace Server.Mobiles
    7. {
    8.     [CorpseName("a Deed Collectors corpse")]
    9.     public class DeedCollectors : BaseCreature
    10.     {
    11.        
    12.          public override bool CanFlee { get { return false; } }
    13.        
    14.         private static Type[] m_ArtifactRarity11 = new Type[]
    15.             {
    16.                  typeof( WeaponSpeedIncreaseDeed ),
    17.                 typeof( WeaponDamageIncreaseDeed ),
    18.                 typeof( UseBestSkillIncreaseDeed ),
    19.                 typeof( SpellDamageIncreaseDeed ),
    20.                 typeof( SpellChannelingIncreaseDeed ),
    21.                 typeof( RegenStamIncreaseDeed ),
    22.                 typeof( RegenManaIncreaseDeed ),
    23.                 typeof( RegenHitsIncreaseDeed ),
    24.                 typeof( ReflectPhysicalIncreaseDeed ),
    25.                 typeof( MageWeaponIncreaseDeed ),
    26.                 typeof( LuckIncreaseDeed ),
    27.                 typeof( LowerRegCostIncreaseDeed ),
    28.                 typeof( LowerManaCostIncreaseDeed ),
    29.                 typeof( HitPoisonAreaIncreaseDeed ),
    30.                 typeof( HitPhysicalAreaIncreaseDeed ),
    31.                 typeof( HitMagicArrowIncreaseDeed ),
    32.                 typeof( HitLowerDefendIncreaseDeed ),
    33.                 typeof( HitLowerAttackIncreaseDeed ),
    34.                 typeof( HitLightningIncreaseDeed ),
    35.                 typeof( HitLeechStamIncreaseDeed ),
    36.                 typeof( HitLeechManaIncreaseDeed ),
    37.                 typeof( HitLeechHitsIncreaseDeed ),
    38.                 typeof( HitHarmIncreaseDeed ),
    39.                 typeof(SelfRepairDeed),
    40.                 typeof( HitFireballIncreaseDeed ),
    41.                 typeof( HitFireAreaIncreaseDeed ),
    42.                 typeof( HitEnergyAreaIncreaseDeed ),
    43.                 typeof( HitDispelIncreaseDeed ),
    44.                 typeof( HitColdAreaIncreaseDeed ),
    45.                 typeof( DefendChanceIncreaseDeed ),
    46.                 typeof( CastSpeedIncreaseDeed ),
    47.                 typeof( BonusStrIncreaseDeed ),
    48.                 typeof( BonusStamIncreaseDeed ),
    49.                 typeof( BonusManaIncreaseDeed ),
    50.                 typeof( BonusIntIncreaseDeed ),
    51.                 typeof( BonusHitsIncreaseDeed ),
    52.                 typeof( BonusDexIncreaseDeed ),
    53.                 typeof( AttackChanceIncreaseDeed ),
    54.                 typeof( PetColdlResistanceBonusPotion ),
    55.                 typeof( PetControlSlotsBonusPotion ),
    56.                 typeof( PetDamageMaxBonusPotion ),
    57.                 typeof( PetDamageMinBonusPotion ),
    58.                 typeof( PetEnergyResistanceBonusPotion ),
    59.                 typeof( PetFireResistanceBonusPotion ),
    60.                 typeof( PetHitsPointBonusPotion ),
    61.                 typeof( PetManaPointBonusPotion ),
    62.                 typeof( PetPhysicalResistanceBonusPotion ),
    63.                 typeof( PetPoisonResistanceBonusPotion ),
    64.                 typeof( PetStamPointBonusPotion )
    65.             };
    66.         public override WeaponAbility GetWeaponAbility()
    67.         {
    68.             switch (Utility.Random(3))
    69.             {
    70.                 default:
    71.                 case 0: return WeaponAbility.DoubleStrike;
    72.                 case 1: return WeaponAbility.WhirlwindAttack;
    73.                 case 2: return WeaponAbility.CrushingBlow;
    74.             }
    75.         }
    76.         public override void OnDeath(Container c)
    77.         {
    78.             base.OnDeath(c);
    79.             Mobile mobile = DemonKnight.FindRandomPlayer(this);
    80. if (mobile != null)
    81. {
    82.             double chance = Utility.RandomDouble();
    83.             if (chance < 0.5) // 5% chance for drop
    84.             {
    85.                 mobile.AddToBackpack(Loot.Construct(m_ArtifactRarity11[Utility.Random(m_ArtifactRarity11.Length)]));
    86.                 mobile.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special reward has been bestowed on you.
    87.             }
    88. }
    89.         }
    90.         [Constructable]
    91.         public DeedCollectors() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
    92.         {
    93.             Name = "the Deed Collectors";
    94.             Body = 318;
    95.             BaseSoundID = 0x165;
    96.             SetStr(500);
    97.             SetDex(100);
    98.             SetInt(1000);
    99.             SetHits(200000);
    100.             SetMana(5000);
    101.             SetDamage(20, 30);
    102.             SetDamageType(ResistanceType.Physical, 20);
    103.             SetDamageType(ResistanceType.Fire, 20);
    104.             SetDamageType(ResistanceType.Cold, 20);
    105.             SetDamageType(ResistanceType.Poison, 20);
    106.             SetDamageType(ResistanceType.Energy, 20);
    107.             SetResistance(ResistanceType.Physical, 30);
    108.             SetResistance(ResistanceType.Fire, 30);
    109.             SetResistance(ResistanceType.Cold, 30);
    110.             SetResistance(ResistanceType.Poison, 30);
    111.             SetResistance(ResistanceType.Energy, 30);
    112.             SetSkill(SkillName.Necromancy, 120, 120.0);
    113.             SetSkill(SkillName.SpiritSpeak, 120.0, 120.0);
    114.             SetSkill(SkillName.DetectHidden, 80.0);
    115.             SetSkill(SkillName.EvalInt, 100.0);
    116.             SetSkill(SkillName.Magery, 100.0);
    117.             SetSkill(SkillName.Meditation, 120.0);
    118.             SetSkill(SkillName.MagicResist, 150.0);
    119.             SetSkill(SkillName.Tactics, 100.0);
    120.             SetSkill(SkillName.Wrestling, 120.0);
    121.             Fame = 10000;
    122.             Karma = -12000;
    123.             VirtualArmor = 64;
    124.         }
    125.         public override void GenerateLoot()
    126.         {
    127.             AddLoot(LootPack.SuperBoss, 10);
    128.             this.PackItem(new Gold(50000));
    129.            
    130.             AddLoot(LootPack.HighScrolls, Utility.RandomMinMax(0, 1));
    131.         }
    132.         public override bool BardImmune { get { return !Core.SE; } }
    133.         public override bool Unprovokable { get { return Core.SE; } }
    134.         public override bool AreaPeaceImmune { get { return Core.SE; } }
    135.         public override Poison PoisonImmune { get { return Poison.Lethal; } }
    136.         public override int TreasureMapLevel { get { return 1; } }
    137.         private static bool m_InHere;
    138.         public override void OnDamage(int amount, Mobile from, bool willKill)
    139.         {
    140.             if (from != null && from != this && !m_InHere)
    141.             {
    142.                 m_InHere = true;
    143.                 AOS.Damage(from, this, Utility.RandomMinMax(0, 0), 100, 0, 0, 0, 0);
    144.                 MovingEffect(from, 0xECA, 10, 0, false, false, 0, 0);
    145.                 PlaySound(0x491);
    146.                 if (0.05 > Utility.RandomDouble())
    147.                     Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(CreateBones_Callback), from);
    148.                 m_InHere = false;
    149.             }
    150.         }
    151.         public virtual void CreateBones_Callback(object state)
    152.         {
    153.             Mobile from = (Mobile)state;
    154.             Map map = from.Map;
    155.             if (map == null)
    156.                 return;
    157.             int count = Utility.RandomMinMax(0, 0);
    158.             for (int i = 0; i < count; ++i)
    159.             {
    160.                 int x = from.X + Utility.RandomMinMax(-1, 1);
    161.                 int y = from.Y + Utility.RandomMinMax(-1, 1);
    162.                 int z = from.Z;
    163.                 if (!map.CanFit(x, y, z, 16, false, true))
    164.                 {
    165.                     z = map.GetAverageZ(x, y);
    166.                     if (z == from.Z || !map.CanFit(x, y, z, 16, false, true))
    167.                         continue;
    168.                 }
    169.                 UnholyBone bone = new UnholyBone();
    170.                 bone.Hue = 0;
    171.                 bone.Name = "unholy bones";
    172.                 bone.ItemID = Utility.Random(0xECA, 9);
    173.                 bone.MoveToWorld(new Point3D(x, y, z), map);
    174.             }
    175.         }
    176.         public DeedCollectors(Serial serial) : base(serial)
    177.         {
    178.         }
    179.         public override void Serialize(GenericWriter writer)
    180.         {
    181.             base.Serialize(writer);
    182.             writer.Write((int)0);
    183.         }
    184.         public override void Deserialize(GenericReader reader)
    185.         {
    186.             base.Deserialize(reader);
    187.             int version = reader.ReadInt();
    188.         }
    189.     }
    190. }
     
Similar Threads: Paragon drop
Forum Title Date
Script Support paragon artifact drop rate Apr 6, 2016
Script Support Aggggh Paragon Aug 4, 2017
ServUO Discussion how do I use MLParagon.cs? Jun 14, 2017
Script Support paragon monsters May 30, 2017
Archived Bug Reports Paragon chest items doesn't created via Random Magic Item Generator Jan 8, 2017
ServUO Discussion Trying to limit the amount of paragon spawns Sep 19, 2016
ServUO Discussion Question about Paragon loot. Aug 3, 2016