Something wrong about this "ArrayList" wich give me an error compiling script.

Code:
            #region FS:ATS Edits
            if ( FSATS.EnablePetLeveling == true )
            {
                ArrayList toCheck = new ArrayList();
                List<DamageEntry> rights = this.DamageEntries;

                foreach ( DamageEntry entry in rights )
                {
                    if ( entry.Damager is BaseCreature )
                    {
                        BaseCreature bc = (BaseCreature)entry.Damager;

                        if ( bc.Controlled == true && bc.ControlMaster != null )
                            toCheck.Add( entry.Damager );      
                    }
                }

                foreach ( Mobile mob in toCheck )
                {
                    if ( mob is BaseCreature )
                    {
                        BaseCreature bc = (BaseCreature)mob;
                        PetLeveling.CheckLevel( this, bc, toCheck.Count );
                    }
                }
            }
            #endregion

This is the error i am getting while loading, my Windows is in french, maybe why some texts are in french.
Code:
------------------------------------------------------------------------------------------------------------------------
ServUO - [https://www.servuo.com] Version 0.5, Build 6537.17055
Core: Optimizing for 4 64-bit processors
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 1 warnings
Warnings:
+ Services/Revamped Dungeons/Covetous Void Spawn/Creatures/CovetousCreature.cs:
    CS0108: Line 13: 'Server.Mobiles.CovetousCreature.Level' masque le membre hérité 'Server.Mobiles.BaseCreature.Level'. Utilisez le mot clé new si le masquage est intentionnel.
Errors:
+ Mobiles/Normal/BaseCreature.cs:
    CS0246: Line 6004: Le type ou le nom d'espace de noms 'ArrayList' est introuvable (une directive using ou une référence d'assembly est-elle manquante ?)
    CS0246: Line 6004: Le type ou le nom d'espace de noms 'ArrayList' est introuvable (une directive using ou une référence d'assembly est-elle manquante ?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Thanks for any help!
 
You are missing the using statement for ArrayLists.

I think its time to update that part a little anyway. Therefor you wouldnt need ArrayLists anymore anyway

Code:
            #region FS:ATS Edits
            if ( FSATS.EnablePetLeveling )
            {
                List<BaseCreature> toCheck = new List<BaseCreature>();
                List<DamageEntry> rights = this.DamageEntries;
                foreach ( DamageEntry entry in rights )
                {
                    if ( entry.Damager is BaseCreature )
                    {
                        BaseCreature bc = (BaseCreature)entry.Damager;
                        if ( bc.Controlled && bc.ControlMaster != null )
                            toCheck.Add( bc );     
                    }
                }
                foreach ( BaseCreature mob in toCheck )
                {
                    PetLeveling.CheckLevel( this, mob, toCheck.Count );
                }
            }
            #endregion
 
Thanks a lot, it compile now, just need to delete all mobiles since they have a sex now.

I have a question and will provide my BaseCreature.cs but is it possible to create a new category of creatures "like" to make only tamables male or female. That way other NPC's could remain normal or is this impossible to realize ?

And maybe you could take a look at other "ATS" region and tell me if there is better updates?

Thanks again, you are surely better than me at Scripting :D
 

Attachments

  • BaseCreature.cs
    263.1 KB · Views: 2
Here is an slightly updated version

Also I am not sure about your "only tamables male or female. ". If it is about displaying the gender under the name when you move your cursor over them? Then that should already be the case.

Also make sure that you test it and see if you find any issues
 

Attachments

  • BaseCreature.cs
    193.6 KB · Views: 6
Here is an slightly updated version

Also I am not sure about your "only tamables male or female. ". If it is about displaying the gender under the name when you move your cursor over them? Then that should already be the case.

Also make sure that you test it and see if you find any issues

Well what i was expecting is only tamables have a sex, what does it change if a healer or a boss monster does have one since we're not going to tame and breed one anyway :)
 
Well even by default without the system there were genders. Since the gender is hidden when its not tamable I dont really see much of an issue.

So unless you run into an actual issue because of that (doubt it ;) ) you are good
 
Well even by default without the system there were genders. Since the gender is hidden when its not tamable I dont really see much of an issue.

So unless you run into an actual issue because of that (doubt it ;) ) you are good

Yes i am all good! you know any way to hide max level ? I loaded it yesterday and we can see the max level but i would prefer players to tame2see :D
 
If you open the basecreature.cs and search for "Level" I think you will find it. It would be in GetProperties.
 
If you open the basecreature.cs and search for "Level" I think you will find it. It would be in GetProperties.

Code:
            #region FS:ATS Edits
            if (Tamable && FSATS.EnablePetBreeding)
            {
                bool nolevel = false;
                Type typ = GetType();
                string nam = typ.Name;

                foreach (string check in FSATS.NoLevelCreatures)
                {
                    if (check == nam)
                    {
                        nolevel = true;
                        break;
                    }
                }

                if (!nolevel)
                {
                    if (Female)
                        list.Add(1060658, "Gender\tFemale");
                    else
                        list.Add(1060658, "Gender\tMale");

                    if (!Controlled)
                        list.Add(1060659, "Max Level\t{0}", MaxLevel);
                }
            }
            #endregion

I think it's from this part, but it's not supposed to show only when controled? and even there, if i just comment it will never show right?

Code:
                  	/if (!Controlled)
                       /list.Add(1060659, "Max Level\t{0}", MaxLevel);
 
Back