Before I begin, a couple things I need to get out there:
This was inspired by Xanthos' Evo System's Mercenaries. I saw those a long time ago, and loved playing with them on my server when it was a casual server. That being said, I wanted something similar that didn't involve evolving or leveling or any sort for the 'mercs' and I wanted something that felt a little more organic in the Ultima Online world.
Credits for the inspiring code go to Xanthos, as well as parts of the Squire code which are taken from his Mercenary script, these used to be a bulk of the existing commands, however things have changed since the system's launch.
You can find Xanthos' Evo Scripts here:
http://www.runuo.com/community/threads/runuo-2-0-rc1-xanthos-evo-system.73488/
What this is: (I'll improve this paragraph later, hasn't changed since launch)
Squires are just basic player-like mobiles in the world which gain skills and stats the way regular players would! They can be dressed, undressed, loot bodies, eat on their own, bandage themselves, grow and develop along with you. They start as the basic Melee AI, and will switch to Archer AI if equipped with a bow and arrow. They will also always be sold Bonded (this was put in place to disallow them to be lost to my players, makes it worth the 100k). They also begin with combat skills that range between 20 and 30, and their starting stats I feel spawn in with a nice small range.
Out of the box:
The only way to obtain Squires is to hire them for 100k from the Squire Representative.
Squires have a Skill Cap of 1200.0
Squires have a Stat Cap of 300
ANOTHER IMPORTANT NOTE: I've discovered a server crashing bug in the system. The crash occurs when you demolish house and happens because the BaseHouse.cs attempts to convert Room Attendants into PlayerBarkeeps when demolishing. This only occurs when a Room Attendant is in the house being demolished. THERE IS A FIX, and it's a very mild one too, go into BaseHouse.cs
Find:
Code:
foreach ( PlayerBarkeeper barkeeper in list )
barkeeper.Delete();
Change it to:
Code:
foreach ( Mobile barkeeper in list )
barkeeper.Delete();
And it's fixed. This change, as I've tested, doesn't break the existing house code, Barkeeps, Room Attendants, and Vendors all disappear as they should upon house delete, it all works fine. Players inside, monsters inside, squires inside, pets too, all fine. I've tested it with Public and Private housing as well, and all works fine. Let me know if something else happens otherwise.
Click to expand...
IMPORTANT NOTE: THIS NOW REQUIRES A MODIFICATION TO THE SKILL FILE: Discordance.cs (packaged with the rest of the system now, see the Modified folder)
It's actually a very simple modification, and I've included the file in the package this is offered in. It's the Discordance.cs file, and modifies the following lines...
Code:
private class DiscordanceInfo
to
Code:
public class DiscordanceInfo
Code:
private static Hashtable m_Table = new Hashtable();
to
Code:
public static Hashtable m_Table = new Hashtable();
and
Code:
private static void ProcessDiscordance( DiscordanceInfo info )
to
Code:
public static void ProcessDiscordance( DiscordanceInfo info )
The reason this needed to be done was to allow the Discordance Target to access the necessary methods within Discordance to check for beings already under the effects of the skill. My file, the one included in this package, belongs to RunUO 2.4.1, I don't know if the future RunUO updates have changed the skill or not, that's why I'm posting the changes I've made within the file here.
Click to expand...
Notes:
Updated to better method suggested by
RomeoV007!
By default they are not able to be stabled, to change this find in AnimalTrainer.cs:
Code:
public void EndStable(Mobile from, BaseCreature pet)
{
if (Deleted || !from.CheckAlive())
{
return;
}
and add after it
Code:
//START REGION FOR SQUIRE!!!!!!!!
#region squire
if ( pet is Squire )
{
if ( (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
{
SayTo( from, "You need to unload your squire." ); // You need to unload your squire.
}
else if (pet.ControlMaster != from)
{
SayTo(from, "You do not own that squire!"); // You do not own that squire!
}
else if ( pet.Mounted == true)
{
SayTo(from, "Your squire must dismount first!"); // Your squire must dismount first!
}
else if (pet.IsDeadPet)
{
SayTo(from, "Living squire only, please."); // Living squire only, please.
}
else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
{
SayTo(from, "I'm sorry. Your squire seems to be busy."); // I'm sorry. Your squire seems to be busy.
}
else if ((from.Backpack != null && from.Backpack.ConsumeTotal(typeof(Gold), 30)) || Banker.Withdraw(from, 30))
{
pet.ControlTarget = null;
pet.ControlOrder = OrderType.Stay;
pet.Internalize();
pet.SetControlMaster(null);
pet.SummonMaster = null;
pet.IsStabled = true;
pet.StabledBy = from;
if (Core.SE)
{
pet.Loyalty = MaxLoyalty; // Wonderfully happy
}
from.Stabled.Add(pet);
SayTo(from, "Your squire has been stabled!");
}
else
{
SayTo(from, 502677); // But thou hast not the funds in thy bank account!
}
return;
}
#endregion
I admit that this isn't a pretty way to go about stabling them.
Click to expand...
Squires will not be able to consume arrows and will shoot infinite arrows by default, to change this find in BaseRanged.cs:
Code:
public virtual bool OnFired( Mobile attacker, Mobile defender )
{
if ( attacker.Player )
{
BaseQuiver quiver = attacker.FindItemOnLayer( Layer.Cloak ) as BaseQuiver;
Container pack = attacker.Backpack;
if ( quiver == null || Utility.Random( 100 ) >= quiver.LowerAmmoCost )
{
// consume ammo
if ( quiver != null && quiver.ConsumeTotal( AmmoType, 1 ) )
quiver.InvalidateWeight();
else if ( pack == null || !pack.ConsumeTotal( AmmoType, 1 ) )
return false;
}
else if ( quiver.FindItemByType( AmmoType ) == null && ( pack == null || pack.FindItemByType( AmmoType ) == null ) )
{
// lower ammo cost should not work when we have no ammo at all
return false;
}
}
attacker.MovingEffect( defender, EffectID, 18, 1, false, false );
return true;
}
and change
Code:
if ( attacker.Player )
to
Code:
if ( attacker.Player || attacker is Squire )
And also, you'd like the Squire's ammo to act like the player's ammo (if you'd like it to stay on an animal's or monster's body)
find:
Code:
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
{
if ( attacker.Player && !defender.Player && (defender.Body.IsAnimal || defender.Body.IsMonster) && 0.4 >= Utility.RandomDouble() )
defender.AddToBackpack( Ammo );
and change
Code:
if ( attacker.Player && !defender.Player && (defender.Body.IsAnimal || defender.Body.IsMonster) && 0.4 >= Utility.RandomDouble() )
to
Code:
if ( (attacker.Player || attacker is Squire) && !defender.Player && (defender.Body.IsAnimal || defender.Body.IsMonster) && 0.4 >= Utility.RandomDouble() )
Also to make sure the arrow stays on the ground if the squire misses
find:
Code:
public override void OnMiss( Mobile attacker, Mobile defender )
{
if ( attacker.Player && 0.4 >= Utility.RandomDouble() )
{
if ( Core.SE )
{
PlayerMobile p = attacker as PlayerMobile;
if ( p != null )
{
Type ammo = AmmoType;
if ( p.RecoverableAmmo.ContainsKey( ammo ) )
p.RecoverableAmmo[ ammo ]++;
else
p.RecoverableAmmo.Add( ammo, 1 );
if ( !p.Warmode )
{
if ( m_RecoveryTimer == null )
m_RecoveryTimer = Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( p.RecoverAmmo ) );
if ( !m_RecoveryTimer.Running )
m_RecoveryTimer.Start();
}
}
} else {
Ammo.MoveToWorld( new Point3D( defender.X + Utility.RandomMinMax( -1, 1 ), defender.Y + Utility.RandomMinMax( -1, 1 ), defender.Z ), defender.Map );
}
}
and add this afterwards
Code:
else if ( attacker is Squire && 0.4 >= Utility.RandomDouble() )
{
Ammo.MoveToWorld( new Point3D( defender.X + Utility.RandomMinMax( -1, 1 ), defender.Y + Utility.RandomMinMax( -1, 1 ), defender.Z ), defender.Map );
}
Click to expand...
On Squires Snowballs can be thrown at 1 second intervals, this isn't the same for all servers in regards to Players, so to change it to whatever your server's delay timer is...
Note: On my server the Snowball Delay Timer is at 1 second. By Default with RunUO files, Snowpiles delay timers are naturally 5 seconds. To change how often Squires can throw snowballs to match RunUO files, go to SquirTargets.cs and find:
Code:
squire.m_ThrowDelay
and change
Code:
TimeSpan.FromSeconds( 1 )
to whatever your snowball delay timer is, by default again, this is 5.
Click to expand...
Questions? Comments? Concerns?
Please reply below!
Version History Archive:
V1.0
- Initial Release
V1.1 (4/19/16)
- Squires start off with a max skillcap of 12000 (my server's norm for players)
- Squires start off with a max statcap of 300 (balancing for their lack of manuverability)
- Squires can now heal their masters
- Squires can now cure poison of their masters (granting anatomy 60+ and healing 60+)
- Squires can now resurrect their masters (granting anatomy and healing 80+)
- Players can now view the contents of their squire's backpacks without it being considered snooping, and move things around, assuming the squire is theirs.
- New Squire Command: Backpack, the squire upon hearing this will open their backpack to their master.
V1.2 (4/20/16 12:11AM Eastern)
- New Squire Command: Hide
- Squires can now hide!
- New Squire Command: Restyle
- New Squire Gump - Restyle (essentially stolen from PlayerVendors)
- Squires now accept you restyling their hair and coloring it.
- You can now interact with a squire's gear through their paperdoll, only to take things off, not put them on.
V1.3 (4/21/16)
- New Item, Squire Death Shroud (allows me to call upon and create a new death shroud onto the squire upon death)
- Squires will no longer be naked ghosts, they will be respectable adults like the rest of society and wear death shrouds upon death.
- Squires will now act concerned when they can't find you and will no longer be able to heal their master when the master is hidden.
- Squires will now let their masters know when they attempt to hide again too soon that it's too soon for them to attempt hiding again instead of complaining that they failed to hide.
- Squires will now be revealed when healing themselves and their masters instead of being healing ninjas.
- Squires when originally hired will be wearing a ChainChest, ChainLegs, and boots instead of a robe.
V1.3.1
- Squires will no longer attempt to heal their master if they're too far away to complete the heal.
- New Squire Gump File (to better sort all these gumps out without cluttering the Squire file)
- New Squire Gump "SquireLoreGump" (a modified animal lore gump that displays additional skills on additional pages)
- New Background to Restyle gump, looks a little nicer
V1.4 (4/22/16)
- New Mobile SS_InnKeeper, which you can use to replace InnKeepers
- New Item Carrier Pigeon, used to call your Squire from their room
- New Mobile Room Attendant, SS_InnKeeper but able to be placed in your house
- New Item RoomAttendantContract, used to employ Room Attendants, priced at 50k on sale by SS_InnKeepers
-New system in place to 'Room' your squire using an SS_InnKeeper or a RoomAttendant
- Fixed Crash Bug where creating a Squire without a master crashed test server ( Existent in 1.3.1 where Masterless Squires would attempt to pull a location for reference that did not exist. ) For those spawning Squires in without masters, do edit the line where they ask if there's an admin around otherwise it might break immersion.
- SS_InnKeepers and RoomAttendants both contain a Context Menu Entry titled Customer, since I could not manually add one that says room (it runs off the cliloc file, oh well!)
V1.5 (4/23/16)
- New Squire Command Loot All - have your squire loot all bodies within a range of two from them
- New Squire Command Grab All - have your squire grab all items off the round within a range of two from them
- Tweaked Squire Command Loot - now presents a target so you can identify the body you want them to loot
- Tweaked Squire Command Grab - now presents a target so you can identify the item you want them to grab
- Squires now have a 1 in 5 chance to be born Elf
- Modified Squire Hairstyle Gump to include Elf Hairstyles for Elf Squires
- Squires can now play instruments! (ToDo: Make instruments use up their uses.) (Laying in the groundwork for letting Squires use the skills Provocation, Peacemaking, and Discordance, for now though, Musicianship is an option.)
- New Squire Command "Play Music"
- Squires will let you know if it is too soon for them to play their instruments when you have them play music and they need to wait.
- Squires will now move to your side to heal you if they see that you're below 50% health and they are further than 2 distance away, but will not move if they were told to stay.
- Squire Lore Gump updated to include Musicianship, Provocation, Peacemaking, and Discordance.
V1.5.3 (4/25/16)
- New Squire Command: Heal - present's a targetting opportunity for the owner to select a healing target
- Squires can now learn Veterinary and Animal Lore
- Animal Lore and Veterinary added as entries on Squire Lore Gump
- Added Nickname variable to Squire's, no function to this currently. (Working on a nickname change command for my players who do not feel comfortable being called 'master'.)
V1.5.5 (4/26/16)
- New Squire Command "Change Nickname" - Causes Squire to prompt you with what you would like them to call you from now on.
- Squire's Targeting is now pulled from SquireTargets.cs file
- Squire's external functions are pulled from the SquireFunctions.cs file
- Sorted Squire System Folder into multiple sub folders, since now the script is getting complicated enough
- Prettied up the Squire System Resource post a bit, added section to of tweaks to BaseRanged.cs to make Squires use arrows/bolts.
Recommended: Run the command "[global set nickname master where squire" after installing this update so that existing Squires don't have weird sentences.
V1.6 (4/27/16)
- New Squire Command: Throw - squires can now throw snowballs too!
Note: On my server the Snowball Delay Timer is at 1 second. By Default with RunUO files, Snowpiles delay timers are naturally 5 seconds. To change how often Squires can throw snowballs to match RunUO files, go to SquirTargets.cs and find:
Code:
squire.m_ThrowDelay
and change
Code:
TimeSpan.FromSeconds( 1 )
to whatever your snowball delay timer is, by default again, this is 5.
- New Item Squire Deed - hire the squire through a squire contract as opposed to hiring them and it handling like an animal trainer.
- Squires now come with a name as opposed to being born as "a squire"
- Squire Contract is now on sale at the Squire Representative instead of Squires themselves
- New Item Squire Care Book - a book containing squire commands and care tips
- Added Squire Care Book to be sold by Squire Representative
- Removed Squire Help Command
- Added Squire Command Guard, GuardMe, and Kill - will still maintain base commands for regular pets, just NOW the squires will utilize their weapon abilities.
V1.6.2 (4/28/16)
- New Squire Lore Gump Look - Better Appearence, removed unnecessary info, organized info properly, two pages
- New Squire Variable - Squire Nickname
- New Squire Command: "Change Your Nickname" - allows owner to change Squire's nickname.
- Tweaked Squire Command: "change nickname" now triggers on "Change My Nickname"
- Squire's Nickname is used as an additional trigger for commands. Example:
Squire Name: Thomas
Squire Nickname: Tom
Answers commands like "all come", "thomas kill", and "tom backpack"
- New GameMaster Level Command: [squirestats - Presents a target to the user to select a BaseCreature and displays their abilities and stats in the Squire Lore Gump window.
- Updated Squire Book to reflect update to commands
V1.6.8 (4/29/16)
Massive update (at least on my end), here we go...
- Squires will now listen to regular order commands when coupled with their nicknames. (Stop, Stay, Come, Follow, Follow Me)
- Added checks to each normal command for if the command comes from their SNickname so they don't get ordered twice for one command.
- Squires will now pick up Bolts and Arrows from the ground.
- New Item Squire Inspection Spyglass - pulls up the Squire Stats gump when used on a Squire.
- SS_InnKeepers now sell Squire Care Book and Squire Inspection Spyglass
- Squire Representatives now sell Squire Inspection Spyglass
- Room Attendants now have their own SB Script instead of piggybacking off PlayerBarkeeps
- Room Attendants now sell Squire Inspection Spyglass and Squire Care Book
- Squire Masters and Staff (GameMaster and Up) will be able to edit Squire Skill Locks (up, down, locked) from the Squire Lore Gump
- Added Barding Section, moving all barding skills from Misc section to Barding
- Added Skill Parrying to the list (Squire Lore Gump)
- Added Skill Focus to the list (Squire Lore Gump)
- New Squire Variable - Inspectable - used to allow other players with Squire Inspection Spyglasses to see your squire's lore grump.
- Inspectable Variable and Control added to Squire Lore Gump
V1.7 (4/29/16)
This list will seem a little short, because it was primarily a lot of footwork, and most of the other larger chunks of the update were posted in 1.6.2 and 1.6.8. Here we go...
- Added Backwards Compatibility - looks like whoever is running UO currently has copied and pasted older clilocs in recent updates and that was what the Squire System used for the two context menu entries in it. These have been changed to the old clilocs to make the system more user friendly with older clients.
- Added a buttload of new dialog options for Squires. Seriously, I limited myself to 6 dialog options per reason for them to speak, but wow, I didn't realize just how many different things that would have ended up being. If you have dialog options you would like to add to the Squire System and don't mind them becoming official, post your dialog ideas in the discussion section and I'll see what's appropriate to add.
V1.7.5 (5/1/16)
- 4 New Targeting Methods Have Been Added and are explained below.
- New Squire Command: "Make Peace" - orders Squire to use their instrument to play a song of peace.
- New Squire Command: "Provoke" - orders Squire to use their instrument to provoke two creatures.
- New Squire Command: "Discord" - orders Squire to use their instrument to play a song of discord at a target.
- Updated Squire Care Book
IMPORTANT NOTE: THIS UPDATE REQUIRES A MODIFICATION TO A SKILL FILE
It's actually a very simple modification, and I've included the file in the package this is offered in. It's the Discordance.cs file, and modifies the following lines...
Code:
private class DiscordanceInfo
to
Code:
public class DiscordanceInfo
Code:
private static Hashtable m_Table = new Hashtable();
to
Code:
public static Hashtable m_Table = new Hashtable();
and
Code:
private static void ProcessDiscordance( DiscordanceInfo info )
to
Code:
public static void ProcessDiscordance( DiscordanceInfo info )
The reason this needed to be done was to allow the Discordance Target to access the necessary methods within Discordance to check for beings already under the effects of the skill. My file, the one included in this package, belongs to RunUO 2.4.1, I don't know if the future RunUO updates have changed the skill or not, that's why I'm posting the changes I've made within the file here.
V1.7.7 (5/2/16)
ALRIGHT! I just finished my presentations for college today, I have very little left to do outside of just taking three remaining finals. Sorry for the slow, smaller updates, but these will definitely pick back up once I am finally done with school all together this next week.
That being said, here's the update:
- Squires will no longer wear armor that requires their strength to be higher. ( Small bug, I actually need a little help figuring out how to get past this, but when a weapon or armor piece has Lower Requirements, I can't seem to figure out how to get that number. So for right now, they will turn that equipment down now too. I promise to fix this before 1.8 )
- Squires will now thank their master for giving them equipment, clothing, and weapons they can wear.
- To balance for Squires no longer allowing this bypass that used to exist to get them to wear heavier equipment, I have increased the starting Strength by 20. ( Making them spawn with between 45 and 55 strength. )
**If you'd like to balance this to existing Squires, the command you're looking for is "[global inc str 20 where Squire"**
- By request of RomeoV007, I've decreased the Control Slots a Squire takes up from 5 to 4.
**If you'd like to change this for existing Squires, the command you're looking for is "[global set controlslots 4 where Squire"**
- Also since Squires can no longer wear Chainmail in the beginning, they now spawn with full Ringmail Gear when they're born.
V1.7.8 (5/4/16)
This one is something I've been working on methods for for quite a while. Now I can finally distribute it now that it's (as much as I've tested it) free of any bugs that I've been able to create!
- Squires will now heal allied creatures they are within two spaces of. Allied Creatures refers to creatures also controlled by the same person as the squire.
- Fixed Calculatory Bug that resulted in Equipment being sent to inventory IF the Squire's Strength was Equal To the Required Strength.
- New Squire Variable s_HealAnimals - determines whether you want your Squire to heal an allied animal or not automatically.
- Updated SquireGump with new Variable Control (placed next to Inspectable)
Note: s_HealAnimals controls AUTO Healing Animals, not Healing Animals in general, so using the Heal Command and targeting an animal will not result in your Squire refusing to heal it just because their s_HealAnimals is set to false.
As was requested by aremihca and suggested by pooka01 I have also included a new folder in the package, Changelog Notes, inside here, from this point forward, you'll find a text document that details the changes I have made in each file. So now it includes a text document named 1.7.8 that outlines these changes and what exactly was added where. On top of this, I have also included comments that will point you to where these changes were made in their respective files. For instance, with this update Squire.cs and SquireGump.cs now have comments that label certain methods and lines of code as //Added 1.7.8 or //Changed 1.7.8 or //Begin 1.7.8 Edit. So if your Squire System is modified for your server, simply search for 1.7.8 in those two files, and you'll find what is different. That being said, these comments will be removed each version, my next planned version will be 1.8 for instance, so 1.7.8's comments will not be included in the next version. Of course, a record of these changes will remain inside the Changelog Notes folder for exactly that reason.
As always, I hope you continue to enjoy the Squire System, please post comments, suggestions, ideas, etc in the discussion forum! I look forward to hearing from all of you!
ALSO, I've been hoping to include a new method insert for drinking potions, but I've been wrestling with how to implement it.
My ideas are...
Including drinking potions as a command. Something like Squire Drink Healing to drink a healing potion.
Including drinking potions as an automated response. Perhaps, for instance, a Squire defaulting to drinking a cure potion if they're poisoned and if they don't have one, Apply A Bandage. Or perhaps a Squire only drinking a healing potion as a precaution if their health drops below 50%.
Please help me work out which ways you'd like to see potions implemented in the discussion forum. I'd really like to know your thoughts, it would help out a great deal to have you guys tell me what you think.
V1.8 (5/6/16)
Alright, this one is a pretty huge one, lots of back-end changes, especially in how Squires handle Dialog. In my version map, all I had for this update was simply Drinking Potions, but a lot more got accomplished.
Here's what's new and changed;
- New Squire Variable s_BeQuiet - Handles what I'm about to tell you next.
- New Squire Command "Be Quiet" - tells your squire to shut up and stop talking/emoting. Was requested as a way to get squires to be quiet is someone was attempting to hide from a PK during intense PVP.
- New Squire Command "Talk Again" - essentially the on-switch for the be quiet command.
- Rewrote all Squire Dialog calls to check for if the Squire needs to s_BeQuiet.
- Massive Reconstruction of the Squire Dialog Options. They're no longer housed within Squire.cs and now have their own file, SquireDialog.cs which handles a comprehensive list of SquireDialog calls, as well as the class that handles transferring these calls to the Squire.
- Updated the InRange check for Squires during healing methods to ask Bandage.cs if they are on a PreAOS server or a more modern server. This was done to make the Squire System more friendly to older servers.
- Renamed the Commands enum list within Squire.cs to SquireCommands
- Renamed the Commands enum list within SS_InnKeeper to SS_InnKeeperCommands
- Renamed the Commands enum list within RoomKeeper to RoomKeeperCommands
- Smaller General Code Cleanup in the Squire System has also occurred.
- New Squire Command: "Drink Agility" - tells your squire to drink an agility potion (Delay 2 Minutes Between Drinks)
- New Squire Command: "Drink Strength" - above but to strength (Delay 2 Minutes Between Drinks)
- New Squire Command: "Drink Refresh" - above, refresh
- New Squire Command: "Drink Health" - above, heal potion (Delay 10 Seconds Between Drinks) (Will not drink if current health is not below max health.)
- New Squire Command: "Drink Poison" - above, poison
- New Squire Command: "Drink Cure" - above, cure (Will not drink if not poisoned.)
- Squires will now drink Heal Potions automatically when below 50% health (Delay 10 Seconds)
- Squires will now drink Cure Potions automatically when poisoned (Delay 4 Seconds)
- Updated Squire Book with new commands.
V1.8.2 (5/7/16)
- Added a bunch of new Squire Variables, AutoUseHealthPotion, AutoUseCurePotion, AutoHealSelf, AutoHealMaster, AutoHealOther, AutoPickupAmmo, and DesperateMasterHeal
- Added these new controls, moved Inspectable and Auto Heal Animals controls to new Squire Lore Gump page
- New Squire Lore Gump Page; Switches, contains controls
- Added Be Quiet variable control to Switches page.
This update introduces a bunch of variables that by default once the server reboots with this update, sets these variables to False. To make sure your players have a smooth introduction to Squire System 1.8.2, I suggest performing the following commands immediately upon server startup...
[global set autohealmaster true where squire
[global set autohealother true where squire
[global set autohealself true where squire
[global set autopickupammo true where squire
[global set autousecurepotion true where squire
[global set autousehealthpotion true where squire
[global set desperatemasterrun true where squire
V1.8.3 (5/8/16)
Small update today, just an additional small feature.
- Squires will now accept Power Scrolls and will apply them to themselves upon being handed a Power Scroll.
- New Squire Variable - m_AutoUsePowerScroll which is set to false by default.
- Updated Squire Lore Gump to contain the controller for m_AutoUsePowerScroll in the Switches page
- Added two additional dialog sets to the SquireDialog.cs script relating to Power Scrolls.
I have a few ideas on what to work out next for the system...
- Magic (A chore since I need to research the spell system and determine how I might effectively include it as a viable option, this will have to wait for my graduation from college in less than a week before I bother beginning.)
- A 'Squire Controller' Gump (Really, I need to just sit down and spend a few hours working out the gump's design and how I can get it set up in a manageable way. Something that will also have to wait till I graduate since I'm down to the wire with three remaining finals.)
- 'Squire Types' (Something I've been practicing to implement with a few other systems I worked out, such as my modification to the Ankhs.cs script you can check out over in my other release, Virtue and Vice Tapestries. The idea behind this was originally to create types of Squires to add some personalization to your Squire. One of my players requested I make a Waifu Script so they might pretend they're married to their Waifu, and I can't think of a better way to implement this than through the Squire System since I would essentially be reinventing the Squire System renaming it the Waifu System. Waste of code, so it would be a variable that switches the different dialog options out while creating different options for priorities, like a Devoted Wife type Squire would dote on you more than they would prioritize their own healing, and a Selfish Husband type Squire would focus on themselves, stuff like that. This would take A LOT of additional alterations to the existing code, so I'd rather ALSO put this off till after graduation.)
- Squires Kiting Enemies when equipped with ranged weapons. (I'll have to get into ArcherAI and create a new one for
So aside from those three things I'm planning on adding to the Squire System, what else would you guys like to see? I'm a little distracted, focusing primarily on studies and such, so I've sort of run out of steam on coming up with ideas for the Squires and how I could improve them. Please let me know in the discussion section! I look forward to reading about it all!
V1.8.5 (5/9/16)
- Squires are now maxed at 80% resistance, where as apparently before you could reach above 100% resistance and have them only receive 1 damage. With the exception of Elf Squires who will have 85% Max Energy Resist.
- New Squire Command: "Lockpick" - tells your squire to lockpick an item. - New Squire Command: "Steal" - tells your squire to steal an item.
- Squires now begin with between 20 and 30 Lockpicking as well, this is a hopefully temporary fix for a SMALL bug that exists. I'll detail it below.
To do this for existing squires the command is "[global set skills.lockpicking.base 20 where squire" DO THE COMMAND IF YOU WANT PEOPLE USING SQUIRES WITH LOCKPICKING
- IMPORTANT ADDITIONAL SCRIPT MODIFICATION If you haven't already seen the addon to the main post I had made, or the announcement in the Discussion section, I found a bug relating to BaseHouses casting Room Attendants as PlayerBarkeepers, the fix is simple, in BaseHouse.cs find:
Code:
foreach ( PlayerBarkeeper barkeeper in list )
barkeeper.Delete();
Replace with:
Code:
foreach ( Mobile barkeeper in list )
barkeeper.Delete();
This is to prevent a crash related to attempting to demolish a house with a Room Attendant inside that occurs when the server attempts to cast the RoomAttendant as a PlayerBarkeeper because it was added to the PlayerBarkeeper list. This code you'll be replacing essentially reads that PlayerBarkeeper list, and deletes all barkeepers it finds. Changing PlayerBarkeeper to Mobile prevents the crash because both as read as mobiles, and no other mobiles should be on that list regardless, so it's harmless. To be safe, I've tested this on my own server with players, squires, RoomAttendants, Barkeepers, and Vendors inside to make sure it acts as it should, and it does.
Aside from all that, there was a major addition to SquireDialog.cs because of the two additional commands, specifically Stealing which forced me to create a large number of additional dialogs.
Why is Lockpicking set to a starting 20 to 30? For one reason or another, I can't seem to get Squires to learn Lockpicking when I was testing out the command UNLESS they had at least 1 full point of Lockpicking. I set the chests to lock level 1 and 2, 0 is supposed to make it not unlockable. I'm assuming what I need to do is what is done to Players, from what I remember, where certain skills have 'fake' skill levels that disappear as they earn skills, but I can't find where to go when I attempt to discover this. If you CAN help and have an answer on how I might incorporate 'fake' skills or know what scripts I need to study that handle it, let me know!
V1.8.8 (5/12/16)-just past midnight
- Fixed range issue with Stealing and Lockpicking, the owner of the Squire is no longer required to be next to the target being stolen or lockpicked.
- Added a Racial Skill Bonus of 20 to Squires, meaning that like Human Player Characters, Squires have an invisible 20 skill in each of their abilities, correcting the issue I had with having to force Lockpicking forward.
- Changed Squire Lore Gump Skill's screen from displaying Skill.Value to Skill.Base to avoid confusion with this change in Skill Bonus.
- Added a New Dialog Set for Squires
- 22 New Items, Training Contracts
- 4 New Vendor NPCs who sell these Training Contracts
- 4 New Sell/Buy Scripts for those Vendor NPCs
New Inclusion: RunUO 2.2 Folder
-This simply includes files that needed to be modified to include support for RunUO 2.2, maybeshewill's kind of files are the regular folders within this folder, and there's a second set with - Jayates at the end of them as a second type of RunUO 2.2 folders, in case you're running RunUO 2.2 and the first set don't work for you.
- Important Note Regarding These: Only install them if you're running RunUO 2.2, and also they DO NOT include files that are not contained within them that have been updated, first update your Squire files using the regular set, THEN overwrite them with the ones inside of the RunUO 2.2 folder and you should be fine.
V1.8.8.1 (5/12/16)-early morning
The only difference between 1.8.8 and 1.8.8.1 is this:
- Added a check to TrainingContracts to make sure you're the owner of the Squire you're attempting to train.
Seems I forgot to check and make sure you were the owner of the Squire before allowing you to train it, woops! I had a player running around training everyone's Squires in everything, lol!
V1.9 (5/12/16)-late night
- Added specific checks for BaseShield within Dress and DragDrop
- Added Dialog for Squire Equipping a shield over a twohanded weapon
- Squires will now refuse to loot from a player's corpse.
- Added Dialog for Squire refusing to loot a player's corpse.
- Added BaseShield to the Squire Arm command
- Added Six New Squire Variables - each pertaining to three possible weapon sets, and two slots for each set.
- New Squire Command: "Unarm" - tells your squire to put their weapons away in their backpack.
- New Squire Commands: "Create Set One", "Create Set Two", "Create Set Three" - uses whatever they're currently holding as weapons, and saves them for later use with the next new commands.
- New Squire Commands: "Equip Set One", "Equip Set Two", "Equip Set Three" - recalls the equipment they were told to save, and equips them as weapons.
- Added Dialog for Missing the Item you'd told them to save for an equipment set. (One for First Hand, one for Second Hand.)
- Added Dialog for Squires being told to memorize a equipment set, but not holding anything.
- Added Dialog for Successful Set Creation
- Added Dialog for Unarming themselves.
- Updated Squire Care Book with new commands.
V1.9.1 (5/16/16)
My goal for the next set of updates is to tighten up our current functions while slowly adding new stuff in (since I'm also working on Spells, which take a lot of tweaking, and are in no way ready to be added) so if you have any suggestions on things that exist currently and ways you would like them sort of tightened up, please speak up in Discussions and I'll read up on it.
Here's the changelog!
- Corrected small bug in Switches Window that based AutoUsePowerscroll's State on AutoUseHealthPotion's state.
- Adjusted AutoUseCurePotion up because I rushed that update out and misaligned the other half of the screen.
- Squires will no longer auto-equip items from bodies that aren't theirs. (Unless Auto Equip Loot is on)
- New Squire Variable: "Auto Equip Loot" - sets whether or not to auto equip loot from monsters bodies.
- New Squire Variable: "Auto Use Training Contract" - sets whether or not the Squire will use the training contract you hand them automatically or not.
- Added New Functions to OnDoubleClick method of Training Contracts that checks whether or not the user is a Squire or a Player, if Squire they will apply themselves assuming the Squire needs training.
- Added new check to Looting in Squires that makes sure the corpse owner isn't null before checking if they're a player, this was done to avoid a nullexception crash that would occur if the server rebooted (nullifying the corpse's owner) and a squire was told to loot it.
V1.9.2 (5/17/16)
The second update where I slowly add new functions while tightening existing functions of the system based on feedback! I need more ideas! If you have functions you'd like tightened up, or things you'd like corrected or set a different way in the system, let me know and I'll consider it!
Here's the changelog!
- New Squire Variable - Auto Use Spirit Speak
- New Squire Variable - Auto Rez Master
- New Squire Variable - Auto Rez Ally
- New Squire Command - "spirit speak" - Tells your squire to perform Spirit Speak, which would allow them to listen to commands from the dead.
- New Check When Master Dead OnThink, now checks for AutoUseSpiritSpeak, if true it will automatically have the Squire perform Spirit Speak when master is dead so they can hear their command.
- Added Check For Auto Rez Master when master is dead to determine if the Squire will ressurrect them.
- Added Checks For Auto Rez Ally when allied creature is dead to determine if the Squire will ressurrect them.
- New Squire Dialog Options - Two new Timers in Squire Functions (for Spirit Speak)
- Spirit Speak added to Squire Lore Gump
- New Variables added to Squire Lore Gump
- Squire Book Updated with new command.
- Added Spirit Speak Training Contract
- Added spirit speak's training contract to Healer Instructor's Sell/Buy
V1.9.3 (5/19/16)
- New Squire Command: "Change Title" - allows the user to pick from a list of titles the squire is eligable for.
- New Squire File, SquireTitle.cs, holds information regarding the new Title Gump
- Updated Squire Care Book with new command.
About Squire Titles:
Out-Of-The-Box I've compiled a list of 120(Technically +) titles for use with Squires. 22 of which pertain to simply Skills themselves and become available after 30 of each skill (excluding evaluate intelligence because that gives the title of Mage which we're not prepared for) the other 98 titles are all custom made by myself and hold various requirements to be 'unlocked' which changes them from grey question marks to the titles themselves with a button to make the change. I hope you enjoy this addition to the system. Both current pages of the title's gump feature a None option that will reset the Squire to no title.
In the future: I will be adding more pages to this file.
Further in the future (unknown exactly when):
One such page will be a Server Specific Page that will contain detailed directions that will lead you through adding your own titles.
V1.9.4 (5/24/16)
- New Squire Command "Quiver" - Acts like "Backpack" in that a Squire will attempt to open their Quiver to you.
- New Check In OnDragDrop for Squries - Now Squires will Equip a Quiver when dropped on them, and will unequip whatever is on their back to make room.
- Two New Additional Squire Dialog Options pertaining to Quiver Use
- New Function - SquireQuiver - basically checks to make sure if the master is allowed to open the squire's quiver.
- Updated Undress and Dress commands to account for Quivers.
- Corrected Room Attendants giving an incorrect message when using the Context Menu Entry "Customer" to 'Room' Squires and the player not having enough money. They will now let the player know when using the context menu entry that they do not have enough money.
- Added new Squire Variable - m_HungerDecay - used in the OnThink method to cause Squires to actually lose hunger. This triggers every five minutes (same as FoodDecay on Players) and removes 1 from their hunger, causing them to actually get hungry which causes them to actually eat. Upon reaching 0 hunger, the Squire will groan and their stomach will growl, indicating their hunger to their master.
- Updated Squire Care Book with new command.
V1.9.5 (5/26/16)
- New Squire Command: "Poison" - allows the master to have their squire apply poison to a food item, drink item, or certain bladed items.
- New Squire Target - SquirePoisonTarget - allows squires to poison items.
- New Training Contract - Poisoning
- Expanded Squire Lore Gump Window downwards
- Added Poisoning Training Contract to Thieving Instructor
- New Titles Page: Page Three - 60 new titles available
- Adjusted the None button on Titles Pages, and switched it with the Change Page button.
- New Squire Command: Skills - opens skills gump
- New Squire Command: Switches - opens switches gump
- Updated Squire Care Book
- New GameMaster Command: [SquireRoom - allows GMs to force Squires to their room.
V1.9.6 (5/28/16)
This one's a biggun!
- Added 2 new Squire Delay Variables
- Added 2 new Boolean Variables - AutoCastCloseWounds and AutoCastCleanseByFire
- New Squire Command: "Tithe" - Allows a squire to Tithe Gold.
- New Squire Command: "Meditate" - Instructs a squire to Meditate.
- New Squire Command: "Consecrate Weapon" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Divine Fury" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Dispel Evil" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Enemy Of One" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Holy Light" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Noble Sacrifice" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Cleanse By Fire" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Close Wounds" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Remove Curse" - Tells a Squire to use the Chivalry Skill.
- New Squire Command: "Throw Explosion" - Tells a Squire to throw an explosion potion from their inventory.
- New OnThink Auto Cast methods for Cleanse By Fire and Close Wounds.
- Close Wounds will have the Squire checking if their health is One Third below max health, then they'll attempt to cast.
- Cleanse By Fire will check for the Squire being Poisoned and Above Two Thirds of their Max Health (due to the damaging nature of Cleanse By Fire), then they'll attempt to cast.
- New Squire Tithing Method - Handles searching for an ankh and tithing gold.
- New Dialog Options for all of the above.
- Chivalry has been added to Squire Skills Page.
- AutoCastCloseWounds and AutoCastCleanseByFire have been added to Squire Switches Page (Only in effect for targeting themselves.)
- New Training Contract - Chivalry
- Chivalry Training Contract added to Combat Instructor Sell/Buy
- New Timers and Targeting methods for each of the targeting Chivalry Skills.
- New GM Command "[squireskills" - Opens up the Skills page of the Squire's Lore Gump.
- New GM Command "[squireswitches" - Opens up the Switches page of the Squire's Lore Gump.
- Updated Squire Care Book
V1.9.6.1 Hotfix
maybeshewill found a crash relating to Squires having Auto Close Wounds turned on, and being dead. This is because the requirements by the call OnThink are all met since Chivalry Books don't leave their inventories.
This update includes:
- A new Delay variable, m_ResurrectionDelay
- A new call OnAfterResurrect to set this delay
- Checks within the AutoCast calls in OnThink that will make sure the Squire waits for the delay, makes sure they have the mana to cast, and makes sure they have the tithing points to cast.
V1.9.6.3 Mini-Bug-Fixing-Update
Alright, the bug regarding the NullReferenceException has been squashed in regards to Squires crashing the server when receiving a target when they don't have a target open on their end. Here's the rest of what's included.
- Implemented permanent fix for server crashing bug relating to Squires receiving targets when they don't have one to receive.
- New Squire Command: Weapon Ability - Assigns either the Primary or the Secondary
- New Squire Command: Weapon Ability One - Assigns the Primary weapon ability.
- New Squire Command: Weapon Ability Two - Assigns the Secondary weapon ability.
- Removed Squire m_ResurrectionDelay variable and all associated calls to it, left the Mana and TithingPoints check in place for AutoCast methods.
- Updated Squire Care Book.
V1.9.7 (6/2/16)
- New Squire Variables for Close Wounds and Cleanse Fire Auto Cast pertaining to Master and Ally.
- New Squire Variable for Team
- New Squire Command: Check Tithing Points - has your squire tell you how many tithing points they have
- New Squire Command: Set Team - assigns your Squire to a Squire Team allowing for better coordination and control when giving commands.
- Squires will now Auto Cast Close Wounds on their Master given the variable is set to true
- Squires will now Auto Cast Cleanse By Fire on their Master given the variable is set to true
- Same applies each for Allys.
- New check for Arrows and Bolts that displays a proper message when the squire is given one or the other
- New check for Team Name in the command method
- New Squire Timers for the new Auto Cast variables
- Squire Lore Gump, each page will now have different background sizes
- Moved Damage and Resistance on the Squire Lore Gump Stats page down a bit, for more space
- Added Tithing Points to the Squire Stats Page
- Added Squire Team to the Squire Stats Page
- Expanded Squire Switches Page downwards
- Added the new Auto Cast Controls to Squire Switches Page
- Renamed old Auto Cast Controls to be more legible
- Added a New Squire Title Page ( 60 new titles, totaling 240 titles )
- Updated Squire Care Book
Note: There is a method to Automatically Apply Weapon Abilities to a squire every 30 seconds given that m_AutoUseWeaponAbility is true, but I haven't gotten to test this yet, the variable is there and can be manipulated with [props, but I haven't put a control for it on the Switches Page yet, so until I get the chance to test it, it's there just disabled.