Jump to content

OnEntityEnteredAbandonedBase

Pending 2.2.5

IIIaKa
IIIaKa

Posted (edited)

Hello, is it possible to add the hooks "OnEntityEnteredAbandonedBase" and "OnEntityExitAbandonedBase"?
Or at least an API method that can be used to check whether an entity is a participant in a base raid or not(I think API will be better).

The issue is that in vanilla, when item containers(storage boxes and etc.) are destroyed, the OwnerID of created DroppedItemContainer is not inherited from them and is always set to 0, even if the parent entity had a player's userID as OwnerID. This creates problems for PvE plugins.
Because of this, my plugin uses Harmony(method ModDroppedContainer2 in RealPVE) to fix this oversight by inheriting the OwnerID for DroppedItemContainer from their parents.
As I understand from your plugin, during the event all OwnerIDs are reset to 0 to avoid conflicts with PvE plugins. But, after entities die, you restore their OwnerIDs, and therefore my plugin also inherits a non-zero OwnerID for the DroppedItemContainer instead of 0, and players can't loot them.
That's why it would be useful to have an API or a hook to know whether inheritance is needed for this DroppedItemContainer.

Edited by IIIaKa
nivex

Posted

hi, not sure how I missed this ticket, but I added the OnEntityEnteredAbandonedBase hook already after it was suggested by others. you didn't implement it, and I'm still getting reports about this issue. an exit hook isn't necessary.

my hooks are in the bottom documentation. start and ended might be more suitable if you want to track more than just this.


            void OnAbandonedBaseStart(Vector3 center, float radius, bool allowPVP, List<BasePlayer> intruders, List<ulong> intruderIds, List<BaseEntity> entities, bool canDropBackpack, bool automatedEvent, bool attackEvent, Guid uniqueID)
            {

            }

            void OnAbandonedBaseEnded(Vector3 center, float radius, bool allowPVP, List<BasePlayer> participants, List<ulong> participantIds, List<BaseEntity> entities, List<BuildingPrivlidge> privs, bool canDropBackpack, bool automatedEvent, bool attackEvent, Guid uniqueID)
            {

            }

api

bool isAbandoned(BaseEntity entity)

bool EventTerritory(Vector3 pos, float x) where x is addition to the current event radius. if the current radius is 50, and you specify x as 15 then the radius check will be 65

bool EventTerritoryAny(Vector3[] positions, float x)

bool EventTerritoryAll(Vector3[] positions, float x)

 

 

2.2m

Downloads

Total number of downloads.

10.2k

Customers

Total customers served.

147.1k

Files Sold

Total number of files sold.

3.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.