Resource icon

Updated Champ Spawns w/ Advance + Bonus Skulls 1.0

No permission to download
I've always wondered why stock RunUO or ServUO never included a accurate champ spawn system.

On OSI, champ spawns used to give a random 2-4 skulls when you started them (with Knight of Valor)

You were also allowed to advance the spawn one time.

Well, I finally took it upon myself to create it.
So I share it will all of you.

Requirements:
1. Either download my Valor.cs copy or manually change it from below
2. You will need to make edits to your ChampionSpawn.cs
3. I'm not going to tell you which lines to edit out and input stuff. I moved around a bunch of things and its easier to just post the final product. You can scan through and see what has changed if your server already has edits for it, or just take mine.

NOTICE: I didn't serialize this because I really didn't care if it saved or not, you can. Totally up to you.

In Valor.cs
Code:
		public static void Valor( Mobile from, object targ )
		{
			IdolOfTheChampion idol = targ as IdolOfTheChampion;
            VirtueLevel vl = VirtueHelper.GetLevel(from, VirtueName.Valor);
			if( idol == null || idol.Deleted || idol.Spawn == null || idol.Spawn.Deleted )
				from.SendLocalizedMessage( 1054035 ); // You must target a Champion Idol to challenge the Champion's spawn!
			else if( from.Hidden )
				from.SendLocalizedMessage( 1052015 ); // You cannot do that while hidden.
            else if (idol.Spawn.OneAdvance == true)
            {
                from.SendMessage("You have already advanced this Champion Spawn!");
            }
            else if (idol.Spawn.OneAdvance == false && idol.Spawn.Active)
            {
                if (vl == VirtueLevel.Follower)
                {
                    VirtueHelper.Atrophy(from, VirtueName.Valor, 5000);
                    idol.Spawn.AdvanceLevel();
                    idol.Spawn.OneAdvance = true;
                }
                else
                    from.SendMessage("You must be a Follower of Valor to advance this Champ Spawn any further.");

            }
            else if (idol.Spawn.HasBeenAdvanced)
                from.SendLocalizedMessage(1054038); // The Champion of this region has already been challenged!
            else
            {

                if (idol.Spawn.Active)
                {
                    if (idol.Spawn.Champion != null)	//TODO: Message?
                        return;

                    int needed, consumed;
                    switch (idol.Spawn.GetSubLevel())
                    {
                        case 0:
                            {
                                needed = consumed = 2500;
                                break;
                            }
                        case 1:
                            {
                                needed = consumed = 5000;
                                break;
                            }
                        case 2:
                            {
                                needed = 10000;
                                consumed = 7500;
                                break;
                            }
                        default:
                            {
                                needed = 20000;
                                consumed = 10000;
                                break;
                            }
                    }

                    if (from.Virtues.GetValue((int)VirtueName.Valor) >= needed)
                    {
                        VirtueHelper.Atrophy(from, VirtueName.Valor, consumed);
                        from.SendLocalizedMessage(1054037); // Your challenge is heard by the Champion of this region! Beware its wrath!
                        idol.Spawn.HasBeenAdvanced = true;
                        idol.Spawn.AdvanceLevel();
                        int skulls = Utility.RandomMinMax(1, 3);
                        Console.WriteLine("Random Was = " + skulls);
                        while (skulls <= 3)
                        {
                            idol.Spawn.AdvanceLevel();
                            skulls++;
                        }
                    }
                    else
                        from.SendLocalizedMessage(1054039); // The Champion of this region ignores your challenge. You must further prove your valor.
                }
                else
                {
                    if (vl == VirtueLevel.Knight)
                    {
                        VirtueHelper.Atrophy(from, VirtueName.Valor, 11000);
                        from.SendLocalizedMessage(1054037); // Your challenge is heard by the Champion of this region! Beware its wrath!
                        idol.Spawn.EndRestart();
                        idol.Spawn.HasBeenAdvanced = true;
                        idol.Spawn.AdvanceLevel();
                        int skulls = Utility.RandomMinMax(1, 3);
                        while (skulls <= 3)
                        {
                            idol.Spawn.AdvanceLevel();
                            skulls++;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1054036); // You must be a Knight of Valor to summon the champion's spawn in this manner!
                    }
                }
            }

		}
Inside ChampionSpawn.cs

Under:
private bool m_HasBeenAdvanced;
Add:
private bool m_OneAdvance;

Under:
Code:
[CommandProperty( AccessLevel.GameMaster )]
		public bool HasBeenAdvanced
		{
			get { return m_HasBeenAdvanced; }
			set { m_HasBeenAdvanced = value; }
		}
Add:
Code:
[CommandProperty(AccessLevel.GameMaster)]
        public bool OneAdvance
        {
            get { return m_OneAdvance; }
            set { m_OneAdvance = value; }
        }
Search For:
m_HasBeenAdvanced = false;

Under Each One, Add:
m_OneAdvance = false;

(There should only be 3)

**You can also add OneAdvance to serialize and deserialize, however I did not really need to save it, so it's really up to you.


That's it.
Enjoy!
  • Like
Reactions: Mr. T and Kilra Yan
Author
Punkte
Downloads
45
Views
62
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Punkte