Adding pet rarities can be a bit tricky, but once again still straight forward.
Step 1 - Descriptors
Go in db > data and open descriptors.cs .
Next, scroll down a little until you see 'public enum Rarity : uint' with all the egg rarities.
Now, add a comma to the last rarity (divine) and add your new rarity's name to the bottom.
It should look something like this:
Step 2 - Change the pet's xml rarity
Go to the pet's xml in server AND client and change BOTH pet's xml rarity to your new rarity.
It should look something like this:
(As you can see the rarity is set to admin)
Step 3 - Pet rarity client work
In intellij double press shift and search for 'petrarityenum'. Open the first result.
Add this under 'public static const DIVINE:PetRarityEnum = new PetRarityEnum("Pets.divine", 4);' :
Code:
public static const RARITYNAME:PetRarityEnum = new PetRarityEnum("Rarity Name", 5);
Be sure to replace the 'rarityname' by your rarity name.
It should look something like this:
Next scroll a little bit until you find 'public static function get list():Array {'.
Add your new rarity after divine.
It should look something like this:
WARNING! The next instructions in step 3 only apply to people adding 16x16 pets. If your pet is 8x8, skip to step 4.
If you have tested your pet yet, you may have noticed this error:
This is easily fixable.
Double press shift and search for 'petvo'. Open the first result.
Scroll down until you see 'public function getSkin():Bitmap {'.
Replace the 'var _local_2' line with:
Code:
var _local_2:int = (((this.rarity == PetRarityEnum.DIVINE.value)) || ((this.rarity == PetRarityEnum.YOURRARITY.value)) ? 40 : 80);
Be sure to replace the 'YOURRARITY' with your rarity's name in all caps.
Step 4 - Rarity settings
Go back in server and go in wServer > realm > entities and open pet.cs
In pet.cs, look for 'switch (item.Rarity)'. Once you found it, go to case 4, copy it, and paste that under it. Change the 4 to a 5.
It should look something like this:
After that, simply edit the 'item.MaxAbilityPower = 100;' , 'item.Abilities[0].Power = 100;' , ' item.Abilities[1].Power = 100;' and
'item.Abilities[2].Power = 100;' to change the max level that the pet can have, and the base level for all three abilities.
The is now added!
Example end product:
As you can see the pet spawned with 100, 100, 100 on his abilities and his rarity is admin.