2020-03-02 08:03:50 -06:00
|
|
|
using System;
|
|
|
|
|
|
2018-02-15 21:20:38 -06:00
|
|
|
using ACE.Entity;
|
2020-03-02 08:03:50 -06:00
|
|
|
using ACE.Entity.Models;
|
2020-06-10 23:47:17 -04:00
|
|
|
using ACE.Server.Network.GameMessages.Messages;
|
2020-03-02 08:03:50 -06:00
|
|
|
|
2018-02-16 07:13:43 -06:00
|
|
|
namespace ACE.Server.WorldObjects
|
2018-02-14 12:06:26 -06:00
|
|
|
{
|
|
|
|
|
public class GenericObject : WorldObject
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2018-02-15 21:20:38 -06:00
|
|
|
/// A new biota be created taking all of its values from weenie.
|
2018-02-14 12:06:26 -06:00
|
|
|
/// </summary>
|
2018-02-15 21:20:38 -06:00
|
|
|
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()
|
2018-02-14 12:06:26 -06:00
|
|
|
{
|
2019-04-26 12:06:57 -05:00
|
|
|
//StackSize = null;
|
|
|
|
|
//StackUnitEncumbrance = null;
|
|
|
|
|
//StackUnitValue = null;
|
2019-06-21 03:16:05 -05:00
|
|
|
//MaxStackSize = null;
|
|
|
|
|
|
|
|
|
|
// Linkable Item Generator (linkitemgen2minutes) fix
|
|
|
|
|
if (WeenieClassId == 4142)
|
|
|
|
|
{
|
|
|
|
|
MaxGeneratedObjects = 0;
|
|
|
|
|
InitGeneratedObjects = 0;
|
|
|
|
|
}
|
2019-03-28 00:26:16 -04:00
|
|
|
}
|
2019-06-09 17:45:20 -05:00
|
|
|
|
2020-06-10 23:47:17 -04:00
|
|
|
public override void ActOnUse(WorldObject activator)
|
2019-06-09 17:45:20 -05:00
|
|
|
{
|
2020-06-10 23:47:17 -04:00
|
|
|
if (!(activator is Player player))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (UseSound > 0)
|
|
|
|
|
player.Session.Network.EnqueueSend(new GameMessageSound(player.Guid, UseSound));
|
2019-06-09 17:45:20 -05:00
|
|
|
}
|
2018-02-14 12:06:26 -06:00
|
|
|
}
|
|
|
|
|
}
|