Status
Not open for further replies.
gametec submitted a new resource:

Hireable Mercenaries - Follower, Hireable

1 Distro Edit To BaseAI - Install Directions Included In Package

What Are Hireable Mercenaries?

A while back I was toying with the idea of creating a pvp server, but then one of my developers said he wouldn't play on it if there were no pvp-free zones. So I compromised and I created npc Bodyguards which aimed to protect blue players from red players. Well I hope you all enjoy the second installment of the script formally known as Bodyguards_Rv2......

Read more about this resource...
 
You can probably avoid that edit to BaseAI by adding this line into your BaseMilitia mobile:

public override bool CanDrop { get { return false; } }
 
I don't have time at the moment to repackage the system, however thanks to zerodowned and the efforts of frankieowns I have narrowed down the fix that will prevent Gold from being duped on your server by exploiting the mobiles in this script. The file below can replace the original file of the same name in the downloadable package.

I had an issue with the bonded pets dead grayed-out gray body not showing up, but that was also fixed with this edit. The issue of them not showing up after they get killed is a mystery to me still, but by fixing the gold issue I also fixed the militia so the bonding is back to normal and works just like any other bonded BaseCreature.

What I did to fix the issue:
(in the OnBeforeDeath method I commented out these lines in the BaseHire_Militia section)

Code:
Item[] AllGold = this.Backpack.FindItemsByType(typeof(Gold), true);
if (AllGold != null)
{
      foreach (Gold g in AllGold)
              this.m_GoldOnDeath += g.Amount;
}
 

Attachments

  • BaseMilitia_Core.cs
    27.2 KB · Views: 11
Last edited:
gametec updated Hireable Mercenaries with a new update entry:

Hireable Mercenaries

So What's New In This Update:
  • Fixed gold dupe bug in the BaseMilitia_Core.cs
  • Added 3 new hireables:
    • Militia_Healer
    • Militia_Healer_K9Handler
    • Militia_Healer_Rider
Have you ever been in a dungeon where you either died by accident, or an evil red player decided to have his way with you?

Well then this addition is for you! I decided that finding healers might actually be difficult on some servers so I created one you can hire!

These...

Read the rest of this update entry...
 
Have these errors with new Hireables

Code:
Errors:
+ Customs/AAA Testing/HirableMercenaries/Mobiles/npcActor/Militia_Healer.cs:
    CS0115: Line 326: 'Server.Mobiles.Militia_Healer.CheckResurrect(Server.Mobil
e)': no suitable method found to override
+ Customs/AAA Testing/HirableMercenaries/Mobiles/npcActor/Militia_Healer_K9Hand
ler.cs:
    CS0115: Line 391: 'Server.Mobiles.Militia_Healer_K9Handler.CheckResurrect(Se
rver.Mobile)': no suitable method found to override
+ Customs/AAA Testing/HirableMercenaries/Mobiles/npcActor/Militia_Healer_Rider.
cs:
    CS0115: Line 350: 'Server.Mobiles.Militia_Healer_Rider.CheckResurrect(Server
.Mobile)': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.

also have this error
Code:
Errors:
+ Customs/AAA Testing/HirableMercenaries/BaseMilitia_Core.cs:
    CS0122: Line 805: 'Server.Items.Bola.BolaTarget' is inaccessible due to its
protection level
    CS1061: Line 824: 'Server.Mobiles.PlayerMobile' does not contain a definitio
n for 'MountBlockReason' and no extension method 'MountBlockReason' accepting a
first argument of type 'Server.Mobiles.PlayerMobile' could be found (are you mis
sing a using directive or an assembly reference?)
    CS1061: Line 826: 'Server.Mobiles.PlayerMobile' does not contain a definitio
n for 'MountBlockReason' and no extension method 'MountBlockReason' accepting a
first argument of type 'Server.Mobiles.PlayerMobile' could be found (are you mis
sing a using directive or an assembly reference?)
    CS0246: Line 348: The type or namespace name 'PromotionalDeed_GM' could not
be found (are you missing a using directive or an assembly reference?)
 
Last edited:
any solution for this error ??



Code:
----------------------------------------------------------------------------
ServUO - [http://www.servuo.com] Version 0.5, Build 5580.27617
Publish 54
Core: Optimizing for 4 64-bit processors
RandomImpl: CSPRandom (Software)
OpenUO Error: Client files not found.
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Custom/HirableMercenaries/BaseMilitia_Core.cs:
    CS0122: Line 687: 'Server.Items.Bola.BolaTarget' no es accesible debido a su
nivel de protección
    CS1061: Line 706: 'Server.Mobiles.PlayerMobile' no contiene una definición d
e 'MountBlockReason' ni se encontró ningún método de extensión 'MountBlockReason
' que acepte un primer argumento de tipo 'Server.Mobiles.PlayerMobile' (¿falta u
na directiva using o una referencia de ensamblado?)
    CS1061: Line 708: 'Server.Mobiles.PlayerMobile' no contiene una definición d
e 'MountBlockReason' ni se encontró ningún método de extensión 'MountBlockReason
' que acepte un primer argumento de tipo 'Server.Mobiles.PlayerMobile' (¿falta u
na directiva using o una referencia de ensamblado?)
    CS0246: Line 324: No se puede encontrar el tipo o el nombre de espacio de no
mbres 'PromotionalDeed_GM' (¿falta una directiva using o una referencia de ensam
blado?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 
Well after looking for a little while I came across this link http://core.vita-nex.com/index.php/topic,28.msg55.html#msg55
The code snippet had the MountBlockReason in it so I just copy and pasted that part into my playermobiles.cs This seems to take the errors away for the MountBlockReason.

Find
Code:
        private static void CheckPets()
        {
            foreach (Mobile m in World.Mobiles.Values)
            {
                if (m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;

                    if (((!pm.Mounted || (pm.Mount != null && pm.Mount is EtherealMount)) &&
                         (pm.AllFollowers.Count > pm.AutoStabled.Count)) ||
                        (pm.Mounted && (pm.AllFollowers.Count > (pm.AutoStabled.Count + 1))))
                    {
                        pm.AutoStablePets(); /* autostable checks summons, et al: no need here */
                    }
                }
            }
        }

Under that add
Code:
        private MountBlock m_MountBlock;

        public BlockMountType MountBlockReason
        {
            get
            {
                return (CheckBlock(m_MountBlock)) ? m_MountBlock.m_Type : BlockMountType.None;
            }
        }

        private static bool CheckBlock(MountBlock block)
        {
            return ((block is MountBlock) && block.m_Timer.Running);
        }

        private class MountBlock
        {
            public BlockMountType m_Type;
            public Timer m_Timer;

            public MountBlock(TimeSpan duration, BlockMountType type, Mobile mobile)
            {
                m_Type = type;

                m_Timer = Timer.DelayCall(duration, new TimerStateCallback<Mobile>(RemoveBlock), mobile);
            }

            private void RemoveBlock(Mobile mobile)
            {
                (mobile as PlayerMobile).m_MountBlock = null;
            }
        }

For the BolaTarget error I went into the Bola.cs and changed:
Code:
        private class BolaTarget : Target
To
Code:
        public class BolaTarget : Target

Finally, to get rid of the PromotionalDeed_GM error. This seems to be an item that was never scripted. So just comment out this line.
Change
Code:
                    m_Hire.AddToBackpack(new PromotionalDeed_GM());
To
Code:
//                    m_Hire.AddToBackpack(new PromotionalDeed_GM());

Errors seem to be gone, I haven't tested anything though. Server loaded that is as far as I went with it.
 
Status
Not open for further replies.
Back