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

Updated Champ Spawns w/ Advance + Bonus Skulls 1.0

Finally fixed champ spawns not allowing an advancement and not spawning bonus skulls on challenge

  1. Punkte
    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 (C#):
    1.         public static void Valor( Mobile from, object targ )
    2.         {
    3.             IdolOfTheChampion idol = targ as IdolOfTheChampion;
    4.             VirtueLevel vl = VirtueHelper.GetLevel(from, VirtueName.Valor);
    5.             if( idol == null || idol.Deleted || idol.Spawn == null || idol.Spawn.Deleted )
    6.                 from.SendLocalizedMessage( 1054035 ); // You must target a Champion Idol to challenge the Champion's spawn!
    7.             else if( from.Hidden )
    8.                 from.SendLocalizedMessage( 1052015 ); // You cannot do that while hidden.
    9.             else if (idol.Spawn.OneAdvance == true)
    10.             {
    11.                 from.SendMessage("You have already advanced this Champion Spawn!");
    12.             }
    13.             else if (idol.Spawn.OneAdvance == false && idol.Spawn.Active)
    14.             {
    15.                 if (vl == VirtueLevel.Follower)
    16.                 {
    17.                     VirtueHelper.Atrophy(from, VirtueName.Valor, 5000);
    18.                     idol.Spawn.AdvanceLevel();
    19.                     idol.Spawn.OneAdvance = true;
    20.                 }
    21.                 else
    22.                     from.SendMessage("You must be a Follower of Valor to advance this Champ Spawn any further.");
    23.  
    24.             }
    25.             else if (idol.Spawn.HasBeenAdvanced)
    26.                 from.SendLocalizedMessage(1054038); // The Champion of this region has already been challenged!
    27.             else
    28.             {
    29.  
    30.                 if (idol.Spawn.Active)
    31.                 {
    32.                     if (idol.Spawn.Champion != null)    //TODO: Message?
    33.                         return;
    34.  
    35.                     int needed, consumed;
    36.                     switch (idol.Spawn.GetSubLevel())
    37.                     {
    38.                         case 0:
    39.                             {
    40.                                 needed = consumed = 2500;
    41.                                 break;
    42.                             }
    43.                         case 1:
    44.                             {
    45.                                 needed = consumed = 5000;
    46.                                 break;
    47.                             }
    48.                         case 2:
    49.                             {
    50.                                 needed = 10000;
    51.                                 consumed = 7500;
    52.                                 break;
    53.                             }
    54.                         default:
    55.                             {
    56.                                 needed = 20000;
    57.                                 consumed = 10000;
    58.                                 break;
    59.                             }
    60.                     }
    61.  
    62.                     if (from.Virtues.GetValue((int)VirtueName.Valor) >= needed)
    63.                     {
    64.                         VirtueHelper.Atrophy(from, VirtueName.Valor, consumed);
    65.                         from.SendLocalizedMessage(1054037); // Your challenge is heard by the Champion of this region! Beware its wrath!
    66.                         idol.Spawn.HasBeenAdvanced = true;
    67.                         idol.Spawn.AdvanceLevel();
    68.                         int skulls = Utility.RandomMinMax(1, 3);
    69.                         Console.WriteLine("Random Was = " + skulls);
    70.                         while (skulls <= 3)
    71.                         {
    72.                             idol.Spawn.AdvanceLevel();
    73.                             skulls++;
    74.                         }
    75.                     }
    76.                     else
    77.                         from.SendLocalizedMessage(1054039); // The Champion of this region ignores your challenge. You must further prove your valor.
    78.                 }
    79.                 else
    80.                 {
    81.                     if (vl == VirtueLevel.Knight)
    82.                     {
    83.                         VirtueHelper.Atrophy(from, VirtueName.Valor, 11000);
    84.                         from.SendLocalizedMessage(1054037); // Your challenge is heard by the Champion of this region! Beware its wrath!
    85.                         idol.Spawn.EndRestart();
    86.                         idol.Spawn.HasBeenAdvanced = true;
    87.                         idol.Spawn.AdvanceLevel();
    88.                         int skulls = Utility.RandomMinMax(1, 3);
    89.                         while (skulls <= 3)
    90.                         {
    91.                             idol.Spawn.AdvanceLevel();
    92.                             skulls++;
    93.                         }
    94.                     }
    95.                     else
    96.                     {
    97.                         from.SendLocalizedMessage(1054036); // You must be a Knight of Valor to summon the champion's spawn in this manner!
    98.                     }
    99.                 }
    100.             }
    101.  
    102.         }
    Inside ChampionSpawn.cs

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

    Under:
    Code (C#):
    1. [CommandProperty( AccessLevel.GameMaster )]
    2.         public bool HasBeenAdvanced
    3.         {
    4.             get { return m_HasBeenAdvanced; }
    5.             set { m_HasBeenAdvanced = value; }
    6.         }
    Add:
    Code (C#):
    1. [CommandProperty(AccessLevel.GameMaster)]
    2.         public bool OneAdvance
    3.         {
    4.             get { return m_OneAdvance; }
    5.             set { m_OneAdvance = value; }
    6.         }
    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!
    Kilra Yan likes this.