TheGodfather

If I wanted to have a specific monster spawn with rarity hues. With a percentage random spawn very low and an extra addition to it's name like "Epic" "Legendary" etc. How would I got about adding that?

I.e. 1 out of every 200 dragons that spawns is purple and has A Dragon [Legendary] as it's name.

Let's take the dragon file as an example:

Code:
using System;

namespace Server.Mobiles
{
    [CorpseName("a dragon corpse")]
    public class Dragon : BaseCreature
    {
        [Constructable]
        public Dragon()
            : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            this.Name = "a dragon";
            this.Body = Utility.RandomList(12, 59);
            this.BaseSoundID = 362;

            this.SetStr(796, 825);
            this.SetDex(86, 105);
            this.SetInt(436, 475);

            this.SetHits(672, 710);

            this.SetDamage(16, 22);

            this.SetDamageType(ResistanceType.Physical, 100);

            this.SetResistance(ResistanceType.Physical, 55, 65);
            this.SetResistance(ResistanceType.Fire, 60, 70);
            this.SetResistance(ResistanceType.Cold, 30, 40);
            this.SetResistance(ResistanceType.Poison, 25, 35);
            this.SetResistance(ResistanceType.Energy, 35, 45);

            this.SetSkill(SkillName.EvalInt, 30.1, 40.0);
            this.SetSkill(SkillName.Magery, 30.1, 40.0);
            this.SetSkill(SkillName.MagicResist, 99.1, 100.0);
            this.SetSkill(SkillName.Tactics, 97.6, 100.0);
            this.SetSkill(SkillName.Wrestling, 90.1, 92.5);

            this.Fame = 15000;
            this.Karma = -15000;

            this.VirtualArmor = 60;

            this.Tamable = true;
            this.ControlSlots = 3;
            this.MinTameSkill = 93.9;
        }

        public Dragon(Serial serial)
            : base(serial)
        {
        }

        public override bool ReacquireOnMovement
        {
            get
            {
                return !this.Controlled;
            }
        }
        public override bool HasBreath
        {
            get
            {
                return true;
            }
        }// fire breath enabled
        public override bool AutoDispel
        {
            get
            {
                return !this.Controlled;
            }
        }
        public override int TreasureMapLevel
        {
            get
            {
                return 4;
            }
        }
        public override int Meat
        {
            get
            {
                return 19;
            }
        }
        public override int DragonBlood
        {
            get
            {
                return 8;
            }
        }
        public override int Hides
        {
            get
            {
                return 20;
            }
        }
        public override HideType HideType
        {
            get
            {
                return HideType.Barbed;
            }
        }
        public override int Scales
        {
            get
            {
                return 7;
            }
        }
        public override ScaleType ScaleType
        {
            get
            {
                return (this.Body == 12 ? ScaleType.Yellow : ScaleType.Red);
            }
        }
        public override FoodType FavoriteFood
        {
            get
            {
                return FoodType.Meat;
            }
        }
        public override bool CanAngerOnTame
        {
            get
            {
                return true;
            }
        }
        public override bool CanFly
        {
            get
            {
                return true;
            }
        }
        public override void GenerateLoot()
        {
            this.AddLoot(LootPack.FilthyRich, 2);
            this.AddLoot(LootPack.AosRich, 1);
            this.AddLoot(LootPack.Gems, 8);
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }
}
 
For the creature hue bit... look at cusidhe or hiryu.
As far as the name goes, id have to tinker around with it. But the way paragons work is similar...
 
@tr1age Using Xmlspawner's XmlParagon system, you could copy that entire system and change it to say XmlParaBeastie or something. Then just attach that on any Xmlspawner (instead of by facet, it would then be only on those Xmlspawners you attached it to).

Alternatively, you could actually code the rare spawn right on the Xmlspawner.
 
hmm that is interesting @tass23 if I did that though can I do it by percentage rather than spawn time?
[doublepost=1475430121][/doublepost]
Alternatively, you could actually code the rare spawn right on the Xmlspawner.
[doublepost=1475430545][/doublepost]
@tr1age Using Xmlspawner's XmlParagon system, you could copy that entire system and change it to say XmlParaBeastie or something. Then just attach that on any Xmlspawner (instead of by facet, it would then be only on those Xmlspawners you attached it to).

If I did that in the beginning of the code which one would I rename to "Beastie"
namespace Server.Engines.XmlSpawner2
{
public class XmlParagon : XmlAttachment
{
#region private properties
private double m_ChestChance; /

As well as throughout paragon is labeled. Do I change it all? I am not all that familiar with which is calling and which is defining.
 
Last edited by a moderator:
hmm that is interesting @tass23 if I did that though can I do it by percentage rather than spawn time?
You could, but that would involve using Condition and If statements on the Xmlspawner and while that works, in my case it usually works once, and then "breaks". You could, for, use two Xmlspawners: one to control the normal spawn and that triggers the second Xmlspawner, which is the one that spawns your "paragon". You could adjust the Min/Max delay on the second Xmlspawner, so while players are killing the normal spawn, the timer is "ticking" away on spawning the "paragon".


If I did that in the beginning of the code which one would I rename to "Beastie"
namespace Server.Engines.XmlSpawner2
{
public class XmlParagon : XmlAttachment
{
#region private properties
private double m_ChestChance; /

As well as throughout paragon is labeled. Do I change it all? I am not all that familiar with which is calling and which is defining.
It's been awhile since I made any changes to custom paragons, so I went back to take a look, you can just add the attachment and then make changes to that attachment on that Xmlspawner. So, no need to create a new script :)

You don't have any control over how often the creature will spawn as your new paragon (that percentage is controlled within the OSI-Paragon system), but you do have control over some other nice things. Look at the screenshot I attached. :) (Note: There is also a StrBuff on the second page you can't see lol)

XmlParagon.jpg
 
just put the code in OnSpawn function.

double rate = Utility.RandomDouble();
if ( rate <= 0.005 ) {
switch( Utility.Random(3) ) {
case 0:
this.Hue = blahblah..
this.title = "[Legendary]";
blah blah..
}
}
 
just put the code in OnSpawn function.

double rate = Utility.RandomDouble();
if ( rate <= 0.005 ) {
switch( Utility.Random(3) ) {
case 0:
this.Hue = blahblah..
this.title = "[Legendary]";
blah blah..
}
}

Are we talking paragon or the monster itself?
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back