Turbo - Hirelings
Posted: Sat Jul 08, 2023 4:22 pm
This script is a beast, so much so, it is 5 times the size permitted to post to the forum.
This is a work in progress and you'll need the UOX3 RC6 pr server for it because it relies on some server functionality that needed to be patched.
so here's the header info: script is attached.
support scripts for stealing corpses and secure loot chests are included in the attachment.
This is a work in progress and you'll need the UOX3 RC6 pr server for it because it relies on some server functionality that needed to be patched.
so here's the header info: script is attached.
Code: Select all
// Turbo Hirelings, by Humility, based on the true story by Xuri (xuri@uox3.org)
// Version: 0.99.9.9.9.2.1
// Last Updated: Jun/04/2023
//
// Mercenery integration: 5/16/2023
//
// For context menu support, hireling needs to be setup with a HIRELING tag in the DFNs
//
// NPC Manager Properties
// <object>.npc The npc managed by this object
// <object>.Owner (pointer)<object>.npc.owner
// <object>.pSock (pointer)<object>.npc.owner.socket | The owners socket
// <object>.npcPack (pointer)<object>.npc.pack
// <object>.other <object> | item or character of focus
// NPC Manager Functions and Methods
// <object>.FalseTag(tagNameString) Sets managed npc's tag false [npc target self assumed]
// <object>.Freeze(selfTarget <boolean>) Freeze Character (targettable via setting self.other to desired target if not selftargetted)
// <object>.InTag(tagNameString) Gets managed npc's tag value [npc target self assumed]
// <object>.TrueTag(tagNameString) Sets managed npc's tag true [npc target self assumed]
// <object>.NullTag(tagNameString) Sets managed npc's tag null [npc target self assumed]
// <object>.Tag(tagString,value,optional verify bool) Sets the tag and then immediately returns a read value to verify it with.
// <object>.Rng(mValue) Returns a random number with max given
// <object>.ValidateIdentity(pChar) Validates that owner exists and that pChar is the owner
// <object>.Unfreeze(selfTarget <boolean>) Unfreeze Character (targettable via setting self.other to desired target if not selftargetted)
// <object>.UseFound () Unimplemented 'Use located Item''
// <object>.UseKnown(iUse) Use provided Item
// <object>.Command
// |
// o-----o.Stay() Performs "Stay" operation and clears action variables.
//
// <object>.Emission
// |
// o------o.Corpse() Creates an empty corpse that replicates managed npc.
// o------o.CorpseMount() Creates an empty corpse that replicates npc's mount.
// o------o.Item(a, b, c, d, e, f, g, h, i, j) Create item (see function for variable names)
// o------o.SoundEffect(effct 0xh) Plays chosen sound effect
// | o--------------------o SP<SpellName>() Plays Spell Sound effect.
// o------o.StaticEffect(trgt, effct, spd, loop) Generates static effect at target.
// |
// <object>.Gear
// |
// o--o
// |
// <object>.Inventory
// |
// o-------oCollectChest()
// o-------oDrop()
// o-------oMove(iMove, dContainer)
// o-------oMoveAll(dContainer)
// o-------oMoveC2C(sContainer, dContainer)
// |
// <object>.Language
// |
// o------oBanter(context#, objtrg) Selects contextual quips and banter for npc to say
// o------oDictionary(entry#) Gets and says dictionary entry
// o------oEmote(string) Managed npc emotes
// o------oGhostMessage(string) Managed NPC speaks in Spirit Speak.
// o------oLog(string) Managed npc sends console message
// o------oSysMsg(string) Managed npc send system message using owners socket
// o------oSay(string) Managed npc speaks openly in game
// o------oProcessInput(string) Processes speech for triggers
// |
// <object>.Magic
// |
// o---o
// |
// <object>.Misc
// |
// o--o.NineSquare() returns an unblocked tile if available, from target or it's 8 surrounding tiles.
// |
// <object>.Skills
// |
// o----o
// |
// Supported commands:
// NPC Manager Supplied Commands
// "<name> doubletime" Cause your patrolling hireling to run.
// "<name> march" Bring your running hireling to a walk.
// "<name> mount" Will autoselect a random mount for your NPC and assign it to them, they will then mount that npc anytime the mount command is used.
// "<name> dismount" Will cause your minion to stow their mount and use their own proud foots.
/* "<name> patrol" Based on Xuri's patrol, patrol now uses serialized tags to store multiple locations for complex pathing.
Issuing the patrol command will clear any existing patrol orders and begin a new pathing sequence.
Issuing the stop command also cancels the patrol without beginning a new sequence.
Clicking a location on the terrain will create a temporary beacon to help visualize your bot path, the beacons decay in 30 seconds by default.
*/
// "<name> post" Will stop what they are doing, bring up a selection cursor for the player to select a post, and man they will then man the selected post from target. (auto-faces away from west and north walls)
// "<name> return" Will attempt to return to either their post or their patrol whichever was interrupted.
// "<name> resume" (see return)^
// "<name> rollcall" will give you the coordinates of your hirelings.
// Standard Commands
/* "(Name) come" Summons the hireling to your location.
"(Name) drop" Drops everything they're carrying to the ground
"(Name) fetch"
"(Name) get"
"(Name) bring" npc will pickup an item for you, if npc has stealing skill, they will attempt to steal the item if need be, to get it.
Fetch also used to recover loot chest before timer expires to force items back into npc inventory
"(Name) follow" Follows targeted being.
"(Name) follow me" Follows you.
"(Name) friend" Treats targeted player as another owner.
"(Name) guard" Will guard you.
"(Name) hire" Responds with how much it will cost to hire them.
"(Name) kill",
"(Name) attack" Attacks targeted being.
"(Name) move" Makes the hireling move away so you can pass.
"(Name) report" Responds with how they feel about their job.
"(Name) stay" Stops and stays in current spot.
"(Name) stop" Cancels any current orders to guard or follow.
"(Name) transfer" Transfers complete ownership to targeted player.
"all come" All followers come to owner
"all follow me" All followers follows to owner
"all follow" All followers follow a specific target
"all attack" All followers attack a specified target
"all guard (me)" All followers guard the owner
"all stop" All followers stop patrolling, fighting or guarding
"all stay" All followers stay where they