FOnline Development > Questions and Answers

Fonline 2238 Power armor drop, how to turn on?

(1/1)

Peter86A:
Hi

How to turn on Enclave, Brotherhood power armor drop after death like other critters like raiders etc?

For now they drop only weapons and PAs dissapears.

I have a fresh Fonline 2238 SDK installation.


John Porno:
I dont know how the normal encounter system works and if 2238 even uses the build in bags function, but basically, each npcs should have some kind of bag that you can define in server/data/bags. You can easily specify these bags in the mapper but for encounters, I don't know. There's probably soem random encoutner script somewhere with an array of all the encounters and heac npcs has a bag specified or smth.

Peter86A:
I'm sure there are armors in their bags but some script destroy those items upon death.

I commented out those code from main.fos:


--- Quote ---    // remove armor/helmet/trophies on following death types
    if((isArmor || isHelmet || isTrophy) &&
       (cr.Anim2Dead == ANIM2_DEAD_FUSED || cr.Anim2Dead == ANIM2_DEAD_PULSE_DUST || cr.Anim2Dead == ANIM2_DEAD_EXPLODE) &&
       _CritCanDropItemsOnDead(cr))
    {
        if(isArmor)
        {
            DeleteItem(armor);
            isArmor = false;
        }
        if(isHelmet)
        {
            DeleteItem(helmet);
            isHelmet = false;
        }
        if(isTrophy && cr.Anim2Dead == ANIM2_DEAD_EXPLODE)
        {
            DeleteItems(trophies);
            isTrophy = false;
        }
    }
--- End quote ---

and


--- Quote ---    // move all armor items to inventory of npc. delete it if no drop.
    if(cr.Stat[ST_REPLICATION_TIME] < 0 && cr.IsNpc())
    {
        for(uint i = 0, j = items.length(); i < j; i++)
            if(items.GetType() == ITEM_TYPE_ARMOR && items.CritSlot != SLOT_INV)
            {
                if(FLAG(items.Flags, ITEM_NO_STEAL) || FLAG(items.Flags, ITEM_NO_LOOT))
                    DeleteItem(items);
                else
                    cr.MoveItem(items.Id, 1, SLOT_INV);
            }
    }
--- End quote ---

And now they drop armor (on the ground) only when their body explodes. After "normal" death there is no armors in inventory or ground.

Any idea?

Wipe:
Just remove NoLoot and NoSteal flags from items in ObjectEditor. No code changes needed.

Peter86A:
It's working!! thanks Mate for answer :)

Navigation

[0] Message Index

Go to full version