ace/Source/ACE.Server/WorldObjects/GenericObject.cs

52 lines
1.3 KiB
C#
Raw Permalink Normal View History

using System;
using ACE.Entity;
using ACE.Entity.Models;
using ACE.Server.Network.GameMessages.Messages;
namespace ACE.Server.WorldObjects
{
public class GenericObject : WorldObject
{
/// <summary>
/// A new biota be created taking all of its values from weenie.
/// </summary>
public GenericObject(Weenie weenie, ObjectGuid guid) : base(weenie, guid)
{
SetEphemeralValues();
}
/// <summary>
/// Restore a WorldObject from the database.
/// </summary>
public GenericObject(Biota biota) : base(biota)
{
SetEphemeralValues();
}
private void SetEphemeralValues()
{
//StackSize = null;
//StackUnitEncumbrance = null;
//StackUnitValue = null;
Generator system revamp (#1964) * Add Landblock_Tick_GeneratorRegeneration * Split up Generator Regeneration and Heartbeats * Stop saving Gateway portals to Shard DB * Add IsGateway to Portal * Add default sound to Pressure Plates * Notify Geneator of Pickup of Landblock Stackable * Add RegenerationTimestamp and GeneratedTreasureItem properties * Generators 3.0 * Add InitializeGenerator * Remove IsLinked * Change SelectProfilesInit to use GetMaxObjects * Change SelectProfilesMax to use GetMaxObjects * Update GetMaxObjects - -1 MaxCreate == Fill up all slots * Renamed HandleStatus to HandleStatusStaged * Restore previous HandleStatus * Update StartGenerator - GeneratorInitialDelay > 0: offset NextGeneratorRegenerationTime - else if InitCreate > 0: Regen * Add GetNextRegenerationTime - If generator isn't previously loaded, skip delay * Update DisableGenerator - Add ProcessGeneratorDestructionDirective - Support GeneratorDestructionType and GeneratorEndDestructionType * Update AddGeneratorLinks - Increate InitCreate and MaxCreate per profile template spec, per each link added * Update Generator_HeartBeat - Starts/Stops Generator, checks event status * Add Generator_Regeneration - Queues for Respawn and/or/both Spawns objects * Add ResetGenerator * Update GetSpawnTime to always return UtcNow * Update Spawn - If TreasureGenerator is used, set GeneratedTreasureItem - If profile PaletteId and/or/both Shade have value, use it * Wire up `@regen` command * Add `@generatordump` command * Change EmoteType.Generate to use Generator_Regeneration * Update OnDeath to call OnGeneratorDeath for Generators * Update OnActivate * Move default action to last action to allow other actions to start before * Change OnGenerate to use Generator_Regeneration * Update Chests * Remove ResetGenerator * If Locked disable timed regen of contents * Update Reset * Override ResetGenerator * cleanup * Rename Generator to GeneratorProfile * Rename Generator.cs to GeneratorProfile.cs * Update GeneratorProfile.cs * Update WorldObject_Generators.cs * Skip PlaceHolder object profiles * Change ProcessGeneratorDestructionDirective to not affect dead/dying creatures * more cleanup * Update WorldObject_Generators.cs Bad data protection * Update WorldObject_Generators.cs * Update GeneratorProfile.cs Catch for bad profile data * Update WorldObject_Generators.cs log error for generators with Max < Init * Update Corpse Logs * Attempt to curb generator sprawl * Update WorldObject_Generators.cs * Update GetRNGInitToMaxObjects * Update WorldObject_Generators.cs * Code fix for linkitemgen2minutes Bad Init/Max for linkable * Fix issue with spawning treasureDID profiles * Add GeneratorUpdateTimestamp * GeneratorHeartbeat renamed to GeneratorUpdate This matches property found in enum * Update debug output * Update Landblock.cs * Update WorldObject_Generators.cs * Update DeveloperCommands.cs * Update ResetInterval resetting * Update SortedGeneratorRegenerationList when already spawned generator is re-enabled * More changes * Container updates * More Debug Info Added * Do not change default icon unless Shade or Palette was defined * Wire up `trophies` command * Add corpse_decay_tick_logging option * Add NpcInteractsSilently handling for EmoteType.Give * Update EmoteManager.cs * Master change fixes * Update DeveloperCommands.cs * Update ServerPerformanceMonitor.cs * Update DeveloperCommands.cs * Update changelog.md
2019-06-21 03:16:05 -05:00
//MaxStackSize = null;
// Linkable Item Generator (linkitemgen2minutes) fix
if (WeenieClassId == 4142)
{
MaxGeneratedObjects = 0;
InitGeneratedObjects = 0;
}
}
public override void ActOnUse(WorldObject activator)
{
if (!(activator is Player player))
return;
if (UseSound > 0)
player.Session.Network.EnqueueSend(new GameMessageSound(player.Guid, UseSound));
}
}
}