Dougan Ironfist
Sorceror
Slayer Title System for RunUO 2.1+
Version 1.6
Using these scripts will allow shard administrators to create fun kill-based titles that players can earn.
This is a simple system that allows you to create as many slayer title systems as you want. An example system is included. The system uses attachments to track slayer title progression.
In the example system, the player is awarded to following titles:
Changelog:
I sincerely hope these scripts will help someone out there.
Dougan Ironfist
Version 1.6
Using these scripts will allow shard administrators to create fun kill-based titles that players can earn.
This is a simple system that allows you to create as many slayer title systems as you want. An example system is included. The system uses attachments to track slayer title progression.
In the example system, the player is awarded to following titles:
- Hunter of Mutton after 50 sheep kills.
- Master of the Feast after 100 sheep kills.
- Mammoth of the Wool after 250 sheep kills.
Changelog:
- Added a virtual routine, OnTitleAwarded, to BaseSlayerTitle.cs. This routine is called when the player is assigned a new title. This routine can be overridden to allow custom title systems to reward players with more than just titles when a new title is awarded. (v1.6)
- Updated the example system to award a trophy to the player when the title of 'Collector of Wool' is obtained. (v1.6)
- Updated the system to work with both RunUO 2.1 and 2.2. (v1.5)
- Changed the example system slightly. (v1.5)
- Changed the core modification for BaseCreature.cs to a generic event driven hook usable by any system. (v1.5)
- Added a core modification to PlayerMobile.cs that implements a generic event driven hook usable by any system. (v1.5)
- Alters the method that the slayer title is displayed. (v1.5)
- Added a gump interface to allow players to select the title to be displayed. (v1.5)
- Added the command [titles that players can use to select the title to be displayed. (v1.5)
- If you do not want the persistent gump displayed and prefer to have your players only use the [titles command, then comment out the following line from the SlayerTitleSystem.cs script. (v1.5)
- #define SHOW_PERSISTENT_GUMP
To modify the system to allow tracking of kills, open the BaseCreature.cs script and locate the following code.
Code:
public virtual void OnKilledBy( Mobile mob )
{
.
. [Existing Code]
.
}
Change the code block to the following:
Code:
public delegate void CreatureKilledByEventHandler(CreatureKilledByEventArgs e);
public static event CreatureKilledByEventHandler CreatureKilledBy;
public class CreatureKilledByEventArgs : EventArgs
{
public BaseCreature CreatureKilled = null;
public PlayerMobile Player = null;
public CreatureKilledByEventArgs(BaseCreature creatureKilled, PlayerMobile player)
{
CreatureKilled = creatureKilled;
Player = player;
}
}
public virtual void OnKilledBy( Mobile mob )
{
.
. [Existing Code]
.
if (CreatureKilledBy != null && mob is PlayerMobile)
CreatureKilledBy(new CreatureKilledByEventArgs(this, ((PlayerMobile)mob)));
}
To modify the system to display a custom title under the player's name on mouse-over, open the PlayerMobile.cs script and locate the following code:
Code:
public override void GetProperties(ObjectPropertyList list)
{
.
. [Existing Code]
.
}
Change the code block to the following:
Code:
public delegate void PlayerPropertiesEventHandler(PlayerPropertiesEventArgs e);
public static event PlayerPropertiesEventHandler PlayerProperties;
public class PlayerPropertiesEventArgs : EventArgs
{
public PlayerMobile Player = null;
public ObjectPropertyList PropertyList = null;
public PlayerPropertiesEventArgs(PlayerMobile player, ObjectPropertyList list)
{
Player = player;
PropertyList = list;
}
}
public override void GetProperties(ObjectPropertyList list)
{
.
. [Existing Code]
.
if (PlayerProperties != null)
PlayerProperties(new PlayerPropertiesEventArgs(this, list));
}
Disclaimer:There are two core changes required to implement these scripts.
This script requires the use of XmlAttachments.
This script has been tested with both RunUO 2.1 and 2.2.
The current version of this script and all prior versions can be downloaded from the project page listed in my signature.
I sincerely hope these scripts will help someone out there.
Dougan Ironfist