### Set Points Per Kill (Array)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Example of how points awarded per kill are configured. This involves changing values within an integer array, likely found in a configuration or spawn script.
```C#
new int[] {50, 70, 80, 100}
```
--------------------------------
### Configure Monster Spawn Groups (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Indicates the 'MonstersBashSpawnInfo.cs' script for configuring groups of monsters that can spawn within the Gauntlet. This allows for customization of enemy encounters.
```C#
// Look in MonstersBashSpawnInfo.cs
```
--------------------------------
### Modify Reward Box Configuration (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Points to the 'MBRewardBox.cs' script where reward configurations for the Gauntlet can be set or changed. This file controls what players receive upon completing challenges.
```C#
// Look in MBRewardBox.cs
```
--------------------------------
### C# - Initialize Custom Game System and Register Events
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
Initializes 'MyCustomSystem' by registering event handlers for various game events like world load, save, player login/logout, and deaths. It also starts a recurring timer for periodic tasks. Dependencies include the 'Server.Custom.Systems' namespace and various event classes.
```csharp
// File: Scripts/Custom/Systems/MyCustomSystem.cs
// Example: Initializing a custom system on server startup
namespace Server.Custom.Systems
{
public class MyCustomSystem
{
private static Timer m_Timer;
// Called during server initialization
public static void Initialize()
{
// Register event handlers
EventSink.WorldLoad += OnWorldLoad;
EventSink.WorldSave += OnWorldSave;
EventSink.Login += OnLogin;
EventSink.Logout += OnLogout;
EventSink.PlayerDeath += OnPlayerDeath;
EventSink.CreatureDeath += OnCreatureDeath;
EventSink.Speech += OnSpeech;
// Start periodic timer
m_Timer = Timer.DelayCall(
TimeSpan.FromMinutes(1), // Initial delay
TimeSpan.FromMinutes(5), // Interval
new TimerCallback(OnTick) // Callback
);
Console.WriteLine("MyCustomSystem: Initialized");
}
private static void OnWorldLoad()
{
Console.WriteLine("MyCustomSystem: World loaded");
// Load custom data from files
}
private static void OnWorldSave(WorldSaveEventArgs e)
{
Console.WriteLine("MyCustomSystem: Saving data...");
// Save custom data to files
}
private static void OnLogin(LoginEventArgs e)
{
Mobile m = e.Mobile;
m.SendMessage("Welcome to Ultima Adventures!");
// Check for first-time login
PlayerMobile pm = m as PlayerMobile;
if (pm != null && pm.Created + TimeSpan.FromMinutes(5) > DateTime.UtcNow)
{
m.SendMessage("This appears to be your first login. Type [help for commands.");
}
}
private static void OnLogout(LogoutEventArgs e)
{
Mobile m = e.Mobile;
// Save player-specific data on logout
}
private static void OnPlayerDeath(PlayerDeathEventArgs e)
{
Mobile m = e.Mobile;
m.SendMessage("You have died! Your items remain on your corpse.");
// Apply death penalties for soulbound characters
if (HasPhylactery(m))
{
ApplyDeathPenalty(m);
}
}
private static void OnCreatureDeath(CreatureDeathEventArgs e)
{
BaseCreature creature = e.Creature;
Mobile killer = e.Killer;
// Award essence to soulbound killers
if (killer != null && HasPhylactery(killer))
{
AwardEssence(killer, creature);
}
}
private static void OnSpeech(SpeechEventArgs e)
{
Mobile m = e.Mobile;
string speech = e.Speech.ToLower();
// Custom speech triggers
if (speech.Contains("vendor buy"))
{
m.SendMessage("Say 'vendor sell' to sell items.");
}
}
private static void OnTick()
{
// Periodic maintenance tasks
Console.WriteLine("MyCustomSystem: Periodic tick at {0}", DateTime.UtcNow);
}
private static bool HasPhylactery(Mobile m)
{
return m.Backpack != null &&
m.Backpack.FindItemByType(typeof(Phylactery)) != null;
}
private static void ApplyDeathPenalty(Mobile m)
{
// Reduce skill caps or apply other penalties
m.SendMessage(0x22, "Your death has consequences for your soul...");
}
private static void AwardEssence(Mobile killer, BaseCreature victim)
{
// Award essence based on creature difficulty
int essenceAmount = (int)(victim.Fame / 100);
killer.SendMessage("You extract {0} essence from {1}.",
essenceAmount, victim.Name);
}
}
}
```
--------------------------------
### Define Gauntlet Spawn Area
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Instructions for defining the spawn area for the Gauntlet, specifying the NW (start) and SE (finish) points to form a square. Arena markers should appear after this setup.
```game command
spawnarea
(start) NW point
(finish) SE point
```
--------------------------------
### C#: Managing Multiple Abilities with Cooldowns
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
Illustrates using multiple custom abilities with individual cooldowns in C#. The IceMage example shows how to implement cooldown timers for IcePrison and Geyser abilities, ensuring they are not spammed. It includes setting ability durations, damage, and knockback effects.
```csharp
// File: Scripts/Custom/Custom Abilities/CustomAbility.cs
// Available abilities: FlameStrikeTargeted, FlameStrikeAoe, Charge, Firebolt,
// Ambush, Geyser, IcePrison, WalkingBomb, MeteorStrike, MeteorShower,
// Thunderstorm, ThrowBoulder, Zap, ToxicRain, ToxicSpores, ImpaleAoe
namespace Server.Mobiles
{
// Example: Using multiple abilities with cooldowns
public class IceMage : BaseCreature
{
private DateTime m_NextIcePrison;
private DateTime m_NextGeyser;
public override void OnThink()
{
base.OnThink();
if (Combatant == null || !Alive)
return;
// Ice Prison ability (30 second cooldown)
if (DateTime.UtcNow >= m_NextIcePrison && Utility.RandomDouble() < 0.15)
{
IcePrison ip = new IcePrison();
ip.SetDuration(5); // 5 second freeze
CustomAbility.CheckTrigger(this, ip);
m_NextIcePrison = DateTime.UtcNow + TimeSpan.FromSeconds(30);
}
// Geyser ability (15 second cooldown)
if (DateTime.UtcNow >= m_NextGeyser && Utility.RandomDouble() < 0.2)
{
Geyser geyser = new Geyser();
geyser.SetDamage(20, 30);
geyser.SetKnockback(5); // Knockback distance
CustomAbility.CheckTrigger(this, geyser);
m_NextGeyser = DateTime.UtcNow + TimeSpan.FromSeconds(15);
}
}
}
}
```
--------------------------------
### Modify Harvest Tool Configuration (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/DeepMiningSystem/install.txt
Updates the harvest system declaration for tools like PickAxe.cs. This change redirects the harvest system to the DeepMine system, enabling advanced mining functionalities.
```csharp
public override HarvestSystem HarvestSystem{ get{ return DeepMine.DeepMining.GetSystem(this); } }
```
--------------------------------
### C# Battle Mage Spellcasting AI Configuration
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
Illustrates a BattleMage class, a specialized creature using AI_Mage type with a focus on spellcasting. It defines high intelligence, mana reserves, and proficiency in magery skills. This example highlights the setup for a magic-user NPC, including spell reagents and equipment.
```csharp
// Example: Custom mage AI with spell preferences
public class BattleMage : BaseCreature
{
[Constructable]
public BattleMage() : base(AIType.AI_Mage, FightMode.Closest, 10, 5, 0.2, 0.4)
{
Name = "a battle mage";
Body = 0x190;
SetStr(150, 200);
SetDex(100, 125);
SetInt(400, 500);
SetHits(300, 400);
SetMana(1000, 1200);
SetDamage(8, 15);
// High magery and eval int for powerful spells
SetSkill(SkillName.Magery, 100.0, 120.0);
SetSkill(SkillName.EvalInt, 100.0, 120.0);
SetSkill(SkillName.Meditation, 100.0, 120.0);
SetSkill(SkillName.MagicResist, 100.0, 120.0);
SetSkill(SkillName.Wrestling, 60.0, 80.0);
// Resistances for survivability
SetResistance(ResistanceType.Physical, 40, 50);
SetResistance(ResistanceType.Fire, 50, 60);
SetResistance(ResistanceType.Cold, 50, 60);
SetResistance(ResistanceType.Poison, 50, 60);
SetResistance(ResistanceType.Energy, 60, 70);
Fame = 8000;
Karma = -8000;
VirtualArmor = 50;
// Mage equipment
AddItem(new Robe(Utility.RandomNondyedHue()));
AddItem(new WizardsHat());
AddItem(new Sandals());
// Spell scrolls for casting
PackItem(new BlackPearl(Utility.RandomMinMax(50, 100)));
PackItem(new Bloodmoss(Utility.RandomMinMax(50, 100)));
PackItem(new MandrakeRoot(Utility.RandomMinMax(50, 100)));
PackItem(new SulfurousAsh(Utility.RandomMinMax(50, 100)));
}
public override void GenerateLoot()
{
AddLoot(LootPack.Rich);
AddLoot(LootPack.MedScrolls, 2);
AddLoot(LootPack.Reagents, 3);
}
public BattleMage(Serial serial) : base(serial) { }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
```
--------------------------------
### Configure Maximum Wave Kills (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Locates and modifies the maximum number of kills required per wave in the Gauntlet. This is done by editing the 'm_MaxWaveKills' variable in the 'gauntletmaster.cs' script.
```C#
m_MaxWaveKills = 100 / (m_Wave == 0 ? 1 : m_Wave);
```
--------------------------------
### C# Elite Guard AI Configuration
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
Example of an EliteGuard class inheriting from BaseCreature, configured for melee combat against evil targets. It specifies combat stats, skills, equipment, and AI parameters like AI type and fight mode. This demonstrates how to create a specific type of NPC with defined combat roles.
```csharp
// File: Scripts/Mobiles/BaseCreature.cs
// Example: Advanced AI configuration
public class EliteGuard : BaseCreature
{
[Constructable]
public EliteGuard() : base(
AIType.AI_Melee, // AI type
FightMode.Evil, // Only attacks evil players/monsters
10, // Perception range
1, // Fight range (melee)
0.15, // Active speed (faster when in combat)
0.3) // Passive speed (slower when wandering)
{
Name = "an elite guard";
Body = 0x190;
Hue = 0x83EA;
SetStr(250, 300);
SetDex(150, 175);
SetInt(100, 125);
SetDamage(15, 25);
SetSkill(SkillName.Swords, 95.0, 110.0);
SetSkill(SkillName.Tactics, 95.0, 110.0);
SetSkill(SkillName.MagicResist, 80.0, 100.0);
SetSkill(SkillName.Anatomy, 80.0, 95.0);
SetSkill(SkillName.Parry, 90.0, 105.0);
Fame = 5000;
Karma = 5000; // Positive karma for good alignment
// Equipment
AddItem(new PlateChest());
AddItem(new PlateLegs());
AddItem(new PlateArms());
AddItem(new PlateGloves());
AddItem(new PlateHelm());
AddItem(new Longsword());
AddItem(new MetalKiteShield());
}
public EliteGuard(Serial serial) : base(serial) { }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
```
--------------------------------
### Register Black Maps in DeepMining (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/DeepMiningSystem/install.txt
Configures the DeepMining system by registering black maps. This array defines the map ID, the number of mines per map, and the number of levels within each mine.
```csharp
public static MapRegister[] MapEntries = new MapRegister[]
{
new MapRegister(34,10,10)//Map.MapID, number of mines, number of levels
};
```
--------------------------------
### C#: Triggering Targeted Abilities like FlameStrike
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
Demonstrates how to use the FlameStrikeTargeted ability in C#. This example shows a FireMage creature casting FlameStrike on its Combatant, setting the damage range and element type. It relies on the CustomAbility.CheckTrigger method to initiate the ability.
```csharp
// File: Scripts/Custom/Custom Abilities/CustomAbility.cs
// Available abilities: FlameStrikeTargeted, FlameStrikeAoe, Charge, Firebolt,
// Ambush, Geyser, IcePrison, WalkingBomb, MeteorStrike, MeteorShower,
// Thunderstorm, ThrowBoulder, Zap, ToxicRain, ToxicSpores, ImpaleAoe
namespace Server.Mobiles
{
// Example: Using FlameStrikeTargeted
public class FireMage : BaseCreature
{
public override void OnThink()
{
base.OnThink();
if (Combatant != null && Alive && Utility.RandomDouble() < 0.1)
{
FlameStrikeTargeted fst = new FlameStrikeTargeted();
fst.SetDamage(14, 21); // Set damage range
fst.Type = FlameStrikeTargeted.StrikeType.Fire; // Set element type
CustomAbility.CheckTrigger(this, fst);
}
}
}
}
```
--------------------------------
### XML Mobile Spawning Example
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/RandomEncounters/ReadMe.txt
This XML snippet demonstrates how to define mobile spawning with specific quantities, picking lists, and nested mobile definitions. It illustrates hierarchical spawning where sub-mobiles are associated with parent mobiles.
```xml
```
--------------------------------
### AddMenu
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Documentation/RunUO Documentation - Commands.html
Opens an add menu, with an optional initial search string.
```APIDOC
## AddMenu
### Description
Opens an add menu, with an optional initial search string. This menu allows you to search for Items or Mobiles and add them interactively.
### Method
N/A (Game Master Command)
### Endpoint
AddMenu [searchString]
### Parameters
- **searchString** (string) - Optional - An initial search string to filter the add menu.
### Request Example
N/A
### Response
N/A
```
--------------------------------
### Set Gauntlet Area Properties
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Commands to set essential properties for the Gauntlet arena, including spawn area, player respawn points, and player start points. These define the playable space and respawn locations.
```game command
[props him
spawnarea
playerrespoint
playerstartpoint
```
--------------------------------
### Place Gauntlet Master NPC
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Command to place the 'gauntletmaster' NPC in the game world. This is the initial step for setting up a Gauntlet.
```game command
[premiumspawner gauntletmaster
```
--------------------------------
### Delete Gauntlet Arena Markers
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Commands to remove arena markers if they were set incorrectly. Use these commands to clean up unwanted markers.
```game command
[area delete where blocker name != null
```
```game command
[area delete where losblocker name != null
```
--------------------------------
### Configure Basic Server Settings
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
This C# code snippet defines fundamental server settings such as the server name, client file path, auto-save interval, and character progression caps. It provides default values and comments explaining each setting's purpose.
```csharp
// File: Scripts/MyServerSettings.cs
namespace Server.Misc
{
class MyServerSettings
{
// Basic server configuration
public static string ServerName()
{
return "Ultima Adventures";
}
// Client files location - must point to Files folder
public static string FilesPath()
{
return @"./Files";
}
// Auto-save interval in minutes (default: 20)
public static double ServerSaveMinutes()
{
return 20.0;
}
// Character progression caps
public static int skillcap()
{
return 25000; // 250.0 skill cap
}
public static int newstatcap()
{
return 250; // Starting stat cap
}
}
}
```
--------------------------------
### Add
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Documentation/RunUO Documentation - Commands.html
Adds an item or npc by name to a targeted location. Optional constructor parameters. Optional set property list.
```APIDOC
## Add
### Description
Adds an item or npc by name to a targeted location. Optional constructor parameters. Optional set property list. If no arguments are specified, this brings up a categorized add menu.
### Method
N/A (Game Master Command)
### Endpoint
Add [ [params] [set { ...}]]
### Parameters
- **name** (string) - Required - The name of the item or NPC to add.
- **params** (string) - Optional - Constructor parameters for the item or NPC.
- **set** (object) - Optional - A list of properties to set on the added item or NPC.
### Request Example
N/A
### Response
N/A
```
--------------------------------
### Registering Game Commands (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Server Functions/Regions/_Region_Info.txt
Registers various administrative and game master commands within the CommandSystem. Each command has an associated access level and an event handler to execute its logic. These commands manage region respawns and artifact stealing.
```csharp
CommandSystem.Register( "RespawnAllRegions", AccessLevel.Administrator, new CommandEventHandler( RespawnAllRegions_OnCommand ) );
CommandSystem.Register( "RespawnRegion", AccessLevel.GameMaster, new CommandEventHandler( RespawnRegion_OnCommand ) );
CommandSystem.Register( "DelAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( DelAllRegionSpawns_OnCommand ) );
CommandSystem.Register( "DelRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( DelRegionSpawns_OnCommand ) );
CommandSystem.Register( "StartAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( StartAllRegionSpawns_OnCommand ) );
CommandSystem.Register( "StartRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( StartRegionSpawns_OnCommand ) );
CommandSystem.Register( "StopAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( StopAllRegionSpawns_OnCommand ) );
CommandSystem.Register( "StopRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( StopRegionSpawns_OnCommand ) );
CommandSystem.Register( "GenStealArties", AccessLevel.Administrator, new CommandEventHandler( GenStealArties_OnCommand ) );
CommandSystem.Register( "RemoveStealArties", AccessLevel.Administrator, new CommandEventHandler( RemoveStealArties_OnCommand ) );
```
--------------------------------
### Register Custom Commands (C#)
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
This C# code snippet demonstrates how to register custom commands within the Ultima Adventures server. It shows how to map command names to specific event handlers and set the required access levels for each command. Dependencies include the `Server.Commands` namespace and the `CommandSystem` class.
```csharp
// File: Scripts/Custom/Commands/CustomCommands.cs
using Server.Commands;
namespace Server.Custom.Commands
{
public class CustomCommands
{
public static void Initialize()
{
// Register command with CommandSystem
CommandSystem.Register(
"SpawnBoss", // Command name
AccessLevel.GameMaster, // Required access level
new CommandEventHandler(SpawnBoss_OnCommand)
);
CommandSystem.Register(
"GiveEssence",
AccessLevel.GameMaster,
new CommandEventHandler(GiveEssence_OnCommand)
);
CommandSystem.Register(
"SetDifficulty",
AccessLevel.Administrator,
new CommandEventHandler(SetDifficulty_OnCommand)
);
}
[Usage("SpawnBoss ")]
[Description("Spawns a boss creature at the target location.")]
public static void SpawnBoss_OnCommand(CommandEventArgs e)
{
if (e.Length < 1)
{
e.Mobile.SendMessage("Usage: SpawnBoss ");
return;
}
string bossName = e.GetString(0).ToLower();
e.Mobile.SendMessage("Target a location to spawn the boss...");
e.Mobile.Target = new SpawnBossTarget(bossName);
}
[Usage("GiveEssence ")]
[Description("Gives essence to your phylactery.")]
public static void GiveEssence_OnCommand(CommandEventArgs e)
{
if (e.Length < 2)
{
e.Mobile.SendMessage("Usage: GiveEssence ");
e.Mobile.SendMessage("Types: fire, cold, poison, energy, sage, titan");
return;
}
Mobile from = e.Mobile;
string essenceType = e.GetString(0).ToLower();
int amount = e.GetInt32(1);
// Find phylactery in backpack
Phylactery phylactery = from.Backpack.FindItemByType(typeof(Phylactery)) as Phylactery;
if (phylactery == null)
{
from.SendMessage("You don't have a phylactery!");
return;
}
switch (essenceType)
{
case "fire":
phylactery.FireEssenceMax += amount;
from.SendMessage("Added {0} fire essence.", amount);
break;
case "cold":
phylactery.ColdEssenceMax += amount;
from.SendMessage("Added {0} cold essence.", amount);
break;
case "sage":
phylactery.SageEssenceMax += amount;
from.SendMessage("Added {0} sage essence (Int bonus).", amount);
break;
case "titan":
phylactery.TitanEssenceMax += amount;
from.SendMessage("Added {0} titan essence (Str bonus).", amount);
break;
default:
from.SendMessage("Invalid essence type!");
break;
}
}
[Usage("SetDifficulty <0-4>")]
[Description("Sets the server difficulty level (0=Easy, 4=Very Hard).")]
public static void SetDifficulty_OnCommand(CommandEventArgs e)
{
if (e.Length < 1)
{
e.Mobile.SendMessage("Usage: SetDifficulty <0-4>");
e.Mobile.SendMessage("0=Easy, 1=Below Normal, 2=Normal, 3=Hard, 4=Very Hard");
return;
}
int difficulty = e.GetInt32(0);
if (difficulty < 0 || difficulty > 4)
{
e.Mobile.SendMessage("Difficulty must be between 0 and 4.");
return;
}
// Update server settings
MyServerSettings.SetDifficultyLevel(difficulty);
double hpMod = MyServerSettings.AdditionalHitPoints();
e.Mobile.SendMessage("Difficulty set to level {0}.", difficulty);
e.Mobile.SendMessage("Monster HP modifier: {0}%", (int)(hpMod * 100));
}
private class SpawnBossTarget : Target
{
private string m_BossName;
public SpawnBossTarget(string bossName) : base(12, true, TargetFlags.None)
{
m_BossName = bossName;
}
protected override void OnTarget(Mobile from, object targeted)
{
IPoint3D location = targeted as IPoint3D;
if (location == null)
{
from.SendMessage("Invalid target.");
return;
}
Point3D loc = new Point3D(location);
BaseCreature boss = null;
```
--------------------------------
### Register Map in Server Scripts (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/DeepMiningSystem/install.txt
Registers a new map definition within the server's configuration files. This involves specifying map ID, dimensions, and rules. It is a prerequisite for using custom maps.
```csharp
RegisterMap( 34, 34, 34, 7168, 4096, 1, "MapNoire", MapRules.TrammelRules );
```
--------------------------------
### AI Mobile Abilities: Healing, Bard Skills, and Aura (C#)
Source: https://context7.com/finaltwist/ultima-adventures/llms.txt
Demonstrates AI logic for creatures using C#. Includes a SmartHealer that self-heals, a BardCreature that uses discord, peace, or provoke skills, and an AuraCreature that applies passive fire damage. These abilities rely on the 'Ability' class for their effects.
```csharp
using Server.Items;
namespace Server.Mobiles
{
public class SmartHealer : BaseCreature
{
public override void OnThink()
{
base.OnThink();
// Self-healing when below 60% health
if (Hits < (HitsMax * 0.6) && Utility.RandomDouble() < 0.3)
{
Ability.UseBandage(this);
}
}
}
public class BardCreature : BaseCreature
{
private DateTime m_NextBardSkill;
public override void OnThink()
{
base.OnThink();
if (Combatant != null && DateTime.UtcNow >= m_NextBardSkill)
{
int choice = Utility.Random(3);
switch (choice)
{
case 0:
// Discord target to reduce stats
Ability.UseDiscord(this);
break;
case 1:
// Peacemaking to calm nearby enemies
Ability.UsePeace(this);
break;
case 2:
// Provoke enemies to fight each other
if (Combatant is Mobile)
Ability.UseProvoke(this, (Mobile)Combatant);
break;
}
m_NextBardSkill = DateTime.UtcNow + TimeSpan.FromSeconds(20);
}
}
}
public class AuraCreature : BaseCreature
{
public override void OnThink()
{
base.OnThink();
// Passive damage aura every 2 seconds
if (Utility.RandomDouble() < 0.5)
{
// Parameters: caster, minDamage, maxDamage, damageType, range, poison, message
Ability.Aura(
this, // Caster
5, // Minimum damage
15, // Maximum damage
ResistanceType.Fire, // Damage type
3, // Range in tiles
null, // Optional poison
"You are burned by the aura!" // Message to victim
);
}
}
}
}
```
--------------------------------
### Add New Gauntlet Waves (C# Enum)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Explains that new Gauntlet wave types must be added to the 'MonstersBashType' enum within the 'MonstersBashEventNPC.cs' script. This is necessary for expanding the Gauntlet's progression.
```C#
public enum MonstersBashType
```
--------------------------------
### Register Map for Ultima Live Use (C#)
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/DeepMiningSystem/install.txt
Registers a map for use with the Ultima Live system. This function links the map ID to its specific coordinates and is essential for Ultima Live's map management.
```csharp
AddMapDefinition(34, 34, new Point2D(7168, 4096), new Point2D(5120, 4096));
```
--------------------------------
### Adjust Arena Marker Height
Source: https://github.com/finaltwist/ultima-adventures/blob/main/Scripts/Engines and systems/Pvm Gauntlet/instructions.txt
Commands to move arena markers to a specific Z-level (e.g., 20). This is useful if markers are not appearing at the correct ground level. Select an area wider than the gauntlet arena for these commands.
```game command
[area set z 20 where losblocker name != null
```
```game command
[area set z 20 where blocker name != null
```