Resource icon

Squire System, Added Bushido and Necro Spells 2020-03-31

No permission to download

unblest

Citizen
May 20, 2016
30
8
8
40
This is incredible! gonna test it out asap
Post automatically merged:

in SquireTargets.cs, it needs to be
change Contains to ContainsKey:
else if ( Discordance.m_Table.ContainsKey( targ ) )
 
Last edited:

Tukaram

Squire
Jan 4, 2015
350
50
28
56
It crashes my server on startup. I will try to figure why it crashes. As it tries to load, the red errors popup and ServUO crashes. There is not chance to see the errors, and it does not make a crash log. Which is the same thing the old squire system files do...
 

unblest

Citizen
May 20, 2016
30
8
8
40
Beware this version of squires are quite powerful compared from original version you might wanna tone it down if anyone's going to use it!
C#:
        [Constructable]
        public Squire() : base( AIType.AI_Paladin, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            SpeechHue = Utility.RandomDyedHue();
            Nickname = "Master";
            SNickname = "Squire";
            
            IsBonded = true;
            ControlSlots = 3;
            
            m_AutoUseHealthPotion = true;
            m_AutoUseCurePotion = true;
            m_AutoHealSelf = true;
            m_AutoHealMaster = true;
            m_AutoHealOther = true;
            m_AutoPickupAmmo = true;
            m_DesperateMasterRun = true;
            
            SetStr( 700, 800 );
            SetDex( 200, 250 );
            SetInt( 300, 350 );
            
            SetSkill( SkillName.Wrestling, 20.0, 30.0 );
            SetSkill( SkillName.Anatomy, 20.0, 30.0 );
            SetSkill( SkillName.Tactics, 20.0, 30.0 );
            SetSkill( SkillName.Swords, 20.0, 30.0 );
            SetSkill( SkillName.Macing, 20.0, 30.0 );
            SetSkill( SkillName.Fencing, 20.0, 30.0 );
            SetSkill( SkillName.Archery, 20.0, 30.0 );
            SetSkill( SkillName.MagicResist, 20.0, 30.0 );
            SetSkill( SkillName.Chivalry, 20.0, 30.0 );
            SetSkill( SkillName.Bushido, 20.0, 30.0 ); //Rafa Added
            SetSkill( SkillName.Necromancy, 20.0, 30.0 ); //Rafa Added

            SetResistance( ResistanceType.Physical,50, 60 );
            SetResistance( ResistanceType.Fire, 50, 60 );
            SetResistance( ResistanceType.Cold, 50, 60 );
            SetResistance( ResistanceType.Poison, 50, 60 );
            SetResistance( ResistanceType.Energy, 50, 60 );
            
            Skills.Cap = 50000;
            StatCap = 2000;
Post automatically merged:

Also be sure to override getter methods for HitsMax, StamMax, ManaMax if you're going to give them with these stat boosts
Post automatically merged:

and also add || item is BaseTalisman in squire.cs line if you're planning to give them
 
Last edited:

unblest

Citizen
May 20, 2016
30
8
8
40
Fixed some stuffs and added a functionality.

squiretargets.cs : changed Contains method to call ContainsKey so it compiles now
ss_innkeeper.cs and roomattendant.cs : they correctly take gold from bank
squiregump.cs : fixed where a text would overflow gump window
squire.cs :
added usable auto use vampiric embrace (only GMs can set this to true for now)
increased Ankh detect range from 2 to 8 (although Squires don't require any kind of reagent including tithe)
fixed bug where the squire was supposed to say amount of gold he tithed but didn't
 

Attachments

unblest

Citizen
May 20, 2016
30
8
8
40
Updated some stuffs on my own
with the addition to the above, added auto loot feature that loots stuffs from corpses and ground. See the pic below.
autoloot.gif
Auto loot only picks up gold and treasure maps
TODO: add pickup reagents option

and added option to only loot gold and treasure maps when looting with the command "loot all" and "grab all"

Also updated the gump
Cap 2020-03-31 02-55-26-773.jpg
Post automatically merged:

I also have a question to ask. I tried like code below so when the squire picks up stackable items they actually stack in squire's back pack, but couldn't get it done. Can anybody tell me how to do this?
C#:
if (item.Stackable)
{
    Drop(this, Point3D.Zero);
}
Post automatically merged:

Forgot to mention you have to modify corpses.cs to make auto loot from corpses work. Instruction is written in squire.cs file.
 

Attachments

Last edited:
  • Like
Reactions: sahisahi

sahisahi

Knight
Jan 13, 2016
832
79
28
Updated some stuffs on my own
with the addition to the above, added auto loot feature that loots stuffs from corpses and ground. See the pic below.
View attachment 14995
Auto loot only picks up gold and treasure maps
TODO: add pickup reagents option

and added option to only loot gold and treasure maps when looting with the command "loot all" and "grab all"

Also updated the gump
View attachment 14996
Post automatically merged:

I also have a question to ask. I tried like code below so when the squire picks up stackable items they actually stack in squire's back pack, but couldn't get it done. Can anybody tell me how to do this?
C#:
if (item.Stackable)
{
    Drop(this, Point3D.Zero);
}
Post automatically merged:

Forgot to mention you have to modify corpses.cs to make auto loot from corpses work. Instruction is written in squire.cs file.
good job unblest
 

unblest

Citizen
May 20, 2016
30
8
8
40
good job unblest
Thanks. I managed to make stackables to stack using TryDropItem method but it misses that awesome gold wiping visual effect.
I guess its either visual effect of gold being wiped or convenience that I'd have to choose between (which is clear)
 
  • Like
Reactions: sahisahi

unblest

Citizen
May 20, 2016
30
8
8
40
Updated and fixed some more bugs:
  • Inn keepers and room attendants finally correctly checks and withdraws from bank
  • Fixed auto casting of vampiric embrace, it now correctly calls TransformationSpellHelper.UnderTransformation method
  • Now you can specify the type of item a squire would loot, currently only supports gold, treasure maps and zoogi fungus
  • Changed Squire's AI that they would never flee. NEVER.
  • Turned SmartAI boolean true. Not sure what it does though.
  • Squires now correctly changes its AI if its given a ranged weapon, and correctly changes back to using melee.
  • Converted getter methods to use => because ServUO is doing this :D
  • Removed all the era checks for the same reason right above
 

Attachments

unblest

Citizen
May 20, 2016
30
8
8
40
Oh and forgot to add Convenient Stackables option is that if turned on, squire will try to stack stackable items in his backpack. If off, will just loot items pile by pile, without stacking it inside his backpack.
 

Tukaram

Squire
Jan 4, 2015
350
50
28
56
Love those looting changes. The stacking of gold is a big help.
I am having an issue with compiling the script (the original as well). The SquireTarget.cs is giving discord issues. I simply remarked out those lines and it works. Not sure what/why but my squire does not use discord, so did not really look into it. Anyone else having issues with these lines though?


Errors:
+ Customs/Mobiles/Squire System/Other/SquireTargets.cs:
CS0122: Line 911: 'Discordance.m_Table' is inaccessible due to its protectio
n level
CS0122: Line 990: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 990: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 991: 'Discordance.DiscordanceInfo.m_Timer' is inaccessible due
to its protection level
CS0122: Line 991: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 991: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 991: 'Discordance.ProcessDiscordance(Discordance.DiscordanceInf
o)' is inaccessible due to its protection level
CS0122: Line 993: 'Discordance.m_Table' is inaccessible due to its protectio
n level
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

unblest

Citizen
May 20, 2016
30
8
8
40
Love those looting changes. The stacking of gold is a big help.
I am having an issue with compiling the script (the original as well). The SquireTarget.cs is giving discord issues. I simply remarked out those lines and it works. Not sure what/why but my squire does not use discord, so did not really look into it. Anyone else having issues with these lines though?


Errors:
+ Customs/Mobiles/Squire System/Other/SquireTargets.cs:
CS0122: Line 911: 'Discordance.m_Table' is inaccessible due to its protectio
n level
CS0122: Line 990: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 990: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 991: 'Discordance.DiscordanceInfo.m_Timer' is inaccessible due
to its protection level
CS0122: Line 991: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 991: 'Discordance.DiscordanceInfo' is inaccessible due to its p
rotection level
CS0122: Line 991: 'Discordance.ProcessDiscordance(Discordance.DiscordanceInf
o)' is inaccessible due to its protection level
CS0122: Line 993: 'Discordance.m_Table' is inaccessible due to its protectio
n level
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
You need to edit Scripts/Skills/Discordance.cs to make it work with Squire mod
1.
private to public:
namespace Server.SkillHandlers
{
    public class Discordance
    {
        public static Dictionary<Mobile, DiscordanceInfo> m_Table = new Dictionary<Mobile, DiscordanceInfo>();
2.
private to public:
        public static void ProcessDiscordance(DiscordanceInfo info)
        {
            Mobile from = info.m_From;
            Mobile targ = info.m_Target;
3.
private to public:
        public class DiscordanceInfo
        {
            public readonly Mobile m_From;
            public readonly Mobile m_Target;

These changes should make it compile
Post automatically merged:

also to enable auto loot and looting from corpses in general modify following method in items/corpses/corpses.cs
add highlighted lines in that function:
public bool IsCriminalAction(Mobile from)
        {
            if (from == m_Owner || from.AccessLevel >= AccessLevel.GameMaster)
            {
                return false;
            }

            if (!GetFlag(CorpseFlag.LootCriminal))
                return false;

            Party p = Party.Get(m_Owner);           

            if (p != null && p.Contains(from))
            {
                PartyMemberInfo pmi = p[m_Owner];

                if (pmi != null && pmi.CanLoot)
                {
                    return false;
                }
            }

            // Pet gets looting rights starts here
            if (from is BaseCreature && ((BaseCreature)from).Controlled
             && !IsCriminalAction(((BaseCreature)from).ControlMaster))
                return false;
            // Pet gets looting rights ends here

            return (NotorietyHandlers.CorpseNotoriety(from, this) == Notoriety.Innocent);
 
Last edited:
  • Like
Reactions: mythos

almucantar

Citizen
May 26, 2019
5
0
1
hello, sorry but if I wanted to put it down or leave it as I do? if I do the release, the server crashes.

also, I had to remove the whole section of the LightningStrike otherwise the server would go wrong with the following message.

+ added / Squire System / Mobiles / Squire.cs:
CS0104: Line 1889: 'LightningStrike' is an ambiguous reference between 'Server.Spells.Bushido.LightningStrike' and 'Server.Items.LightningStrike'
Scripts: One or more scripts failed to compile or no script files were found.

Thanks
Post automatically merged:

hello unblest,
when i release the NPC , the server crash and report:
Exception:
System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto.
in Server.Mobiles.Squire.OnThink() in C:\EXE\ServUO-master4\Scripts\aggiunti\Squire System\Mobiles\Squire.cs:riga 3228
in Server.Mobiles.BaseAI.AITimer.OnTick() in C:\EXE\ServUO-master4\Scripts\Mobiles\AI\BaseAI.cs:riga 3082
in Server.Timer.Slice() in C:\EXE\ServUO-master4\Server\Timer.cs:riga 409
in Server.Core.Main(String[] args) in C:\EXE\ServUO-master4\Server\Main.cs:riga 673
 
Last edited:

unblest

Citizen
May 20, 2016
30
8
8
40
hello, sorry but if I wanted to put it down or leave it as I do? if I do the release, the server crashes.

also, I had to remove the whole section of the LightningStrike otherwise the server would go wrong with the following message.

+ added / Squire System / Mobiles / Squire.cs:
CS0104: Line 1889: 'LightningStrike' is an ambiguous reference between 'Server.Spells.Bushido.LightningStrike' and 'Server.Items.LightningStrike'
Scripts: One or more scripts failed to compile or no script files were found.

Thanks
Post automatically merged:

hello unblest,
when i release the NPC , the server crash and report:
Exception:
System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto.
in Server.Mobiles.Squire.OnThink() in C:\EXE\ServUO-master4\Scripts\aggiunti\Squire System\Mobiles\Squire.cs:riga 3228
in Server.Mobiles.BaseAI.AITimer.OnTick() in C:\EXE\ServUO-master4\Scripts\Mobiles\AI\BaseAI.cs:riga 3082
in Server.Timer.Slice() in C:\EXE\ServUO-master4\Server\Timer.cs:riga 409
in Server.Core.Main(String[] args) in C:\EXE\ServUO-master4\Server\Main.cs:riga 673
Are you using custom items called LightningStrike? If that's the case try specifying new LightningStrike() in 1895 to something like new Bushido.LightningStrike()
There is no item called LightningStrike in Servuo distro AFAIK so this must be a namespace conflict coming from your custom item

And for that crash when released here's the fixed script.
Also fixed squire auto casting Vampiric Embrace and auto looting when not alive
 

Attachments

Cody

Rookie
May 28, 2016
91
8
8
29
Iowa
doomsdayreturns.webs.com
Shard Name
Doom's Day Returns
```
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.Squire.OnThink() in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Scripts\Custom\New Systems\Squire System\Mobiles\Squire.cs:line 3224
at Server.Mobiles.BaseAI.AITimer.OnTick() in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Scripts\Mobiles\AI\BaseAI.cs:line 3082
at Server.Timer.Slice() in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Server\Timer.cs:line 409
at Server.Core.Main(String[] args) in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Server\Main.cs:line 673```
 

Cody

Rookie
May 28, 2016
91
8
8
29
Iowa
doomsdayreturns.webs.com
Shard Name
Doom's Day Returns
last couple days been searching high and low for a fix and even have tried seeking some help maybe someone here that has worked on this can help me


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.Squire.OnThink() in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Scripts\Custom\New Systems\Squire System\Mobiles\Squire.cs:line 3228
at Server.Mobiles.BaseAI.AITimer.OnTick() in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Scripts\Mobiles\AI\BaseAI.cs:line 3082
at Server.Timer.Slice() in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Server\Timer.cs:line 409
at Server.Core.Main(String[] args) in C:\Users\codya\Desktop\DoomsDayUpdateFinal\Server\Main.cs:line 673


line 3228 : Item healthPotion = Backpack.FindItemByType(typeof(BaseHealPotion));