Full Version : Paragon Pains
xmlspawner >>Troubleshooting >>Paragon Pains


<< Prev | Next >>

DrussRob- 01-26-2006
Firstly let me say again that I'm using RunUO Beta 36.

Before using the xmlspawner system I used megaspawner and for paragon handling I used the fix created by Wyatt inserted into my megaspawner.cs in the "SpawnEntry" method:
CODE
//
      if( 0.02 >= Utility.RandomDouble() && Map == Map.Ilshenar && !SpellHelper.IsTown( creature.Location, creature ) )
      {
       if ( !( creature is BaseEscortable || creature is BaseVendor ) )
         creature.Paragon = true;
      }
//end

Which worked fine.

After installing xmlspawner I also inserted the fix Wyatt created for xmlspwaner:
CODE
/*+Wyatt+*/
if ( 0.05 >= Utility.RandomDouble() && Map == Map.Ilshenar )
{
c.Paragon = true;
}
/*-Wyatt-*/

into the "Spawn" method and when that didn't work, into a newly created "OnSpawned" method in basecreature. But to no avail. Paragons would not spawn in Ilshenar (or anywhere for that matter) under any circumstances.


I have since tried various variations of this in different methods that would be relative to this attribute upon creature creation with no success. I am now totally out of ideas as to what to try next. Anyone have any ideas? thx for any help smile.gif

ArteGordon- 01-26-2006
actually, you dont need to make those changes in the xmlspawner scripts. Just add an OnBeforeSpawn method to your B36 Basecreature.cs like this

CODE

 public virtual void OnBeforeSpawn( Point3D location, Map m )
 {
  if( 0.02 >= Utility.RandomDouble() && m == Map.Ilshenar && !SpellHelper.IsTown( location, this) )
     {
      if ( !( this is BaseEscortable || this is BaseVendor ) )
        this.Paragon = true;
     }
 }


and make sure that you havent commented out the call to OnBeforeSpawn in xmlspawner.cs

DrussRob- 01-27-2006
I'm getting this error:

CODE
- Error: Scripts\XMLSpawner\XmlSpawner2.cs: CS0117: (line 8077, column 37) 'Ser
ver.Mobile' does not contain a definition for 'OnBeforeSpawn'


I believe part of fixing xmlspawner for beta 36 was to efit out the onbefore and onafterspawn because it didnt support those functions.

ArteGordon- 01-27-2006
try this modification

CODE

       if(!smartspawn && m is BaseCreature)
       {
        ((BaseCreature)m).OnBeforeSpawn(loc, map);
       }


along with the addition of the OnBeforeSpawn method to your BaseCreature class

DrussRob- 01-27-2006
ok, that compiled beautifully.

Now to let this sucker finish loading and try to make us some paragons wink.gif

thx again for the help kind sir

ArteGordon- 01-27-2006
right. In xmlspawner2 around that line that it is complaining about (line 8077) you will see something like

CODE

       if(!smartspawn)
       {
        m.OnBeforeSpawn(loc, map);
       }


just replace it with what I posted

DrussRob- 01-27-2006
And we have paragon mongbats in Ilshenar. Because that's what paragons are all about... being mongbats. woohoo!

thx ArteGordon. Once again you're my hero of the day lol smile.gif