Jump to content

Harvest dup

Pending 1.7.12

DRALDEN
DRALDEN

Posted

I saw how the player digs a plant (I think it's done through the skill of three), but I didn't understand exactly how (I don't have any other mechanics for interacting with plants) He collects the plant endlessly (he did not explain exactly how he does it

image.png

DRALDEN

Posted

In general.. We found the problem. When interacting with the tria skill and the monument owner plugin (you can occupy rt).  If you upgrade the collection of wild plants-go to the RT occupied by another player, then it does not allow you to collect plants (but experience and loot from the plant fall into the inventory anyway). I asked the AI to add hooks to fix this-here's a working version. I will be grateful if you fix it.
void OnCollectiblePickup(CollectibleEntity entity, BasePlayer player)
{
    if (player == null || entity == null || player.IsNpc || !player.userID.IsSteamId() || entity.itemList == null) return;

    var monumentOwnerPlugin = plugins.Find("MonumentOwner");
    if (monumentOwnerPlugin != null)
    {
        Vector3 entityPos = entity.transform.position;

        bool hasZone = (bool)monumentOwnerPlugin.Call("HasZone", entityPos);
        if (hasZone)
        {
            bool hasOwner = (bool)monumentOwnerPlugin.Call("HasOwner", entityPos);
            
            if (hasOwner)
            {
                BasePlayer owner = monumentOwnerPlugin.Call("GetOwner", entityPos) as BasePlayer;
                
                if (owner != null && owner != player)
                {
                    return;
                }
            }
        }
    }
    
    if (config.base_yield_settings.adjust_base_yield)
    {
        foreach (var item in entity.itemList)
        {
            item.amount = GetMultipliedItemAmount(item.itemDef.shortname, item.amount);
        }
    }

imthenewguy

Posted

The Monument Owner dev needs to use the hooks I have to prevent it.

object STCanReceiveYield(BasePlayer player, CollectibleEntity entity);
object CanGainXp(BasePlayer player, BaseEntity source, double value, string source_string);

 

DRALDEN

Posted

from the point of view of logic, it is probably more correct to edit skilltree, since the initiator of the issue of the item is skilltree. there are many plugins on privat rt, for each one it is sad to manually write fixes using AI in each update.

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.7m
Total downloads
Customers
11.6k
Customers served
Files Sold
165.1k
Total sales
Payments
3.6m
Processed total
×
×
  • 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.