Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Fully Functioning Drop on Death Modification


Elbereth
 Share

Recommended Posts

Hello everyone! I looked for a long time for one of these, but could not find one that functions properly. So, I made one myself. Thanks to Robin for explaining that pesky final piece of code. (he's awesome) Anyway, adding this in will cause all items in a players possession (equipped or otherwise) to be dropped on death.
Enjoy,
~Elbereth

**In Server:
modPlayer:
On Death:**

**REPLACE THIS:** (which does not work by the way)

>!   ' Drop all worn items
    For i = 1 To Equipment.Equipment_Count - 1
        If GetPlayerEquipment(index, i) > 0 Then
            PlayerMapDropItem index, GetPlayerEquipment(index, i), 0
        End If
    Next

With this.

**THE CODE:**

>!   'Drop inventory items
    For i = 1 To MAX_INV
    PlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)
    Next
>!     'Send all equiped items to the inventory to be dumped.
    For i = 1 To Equipment.Equipment_Count - 1
        If GetPlayerEquipment(index, i) > 0 Then
            PlayerMapDropItem index, GetPlayerEquipment(index, i), 0
        End If

        'Send Weapon
        GiveInvItem index, GetPlayerEquipment(index, Weapon), 0
        SetPlayerEquipment index, 0, Weapon
        'Send Armor
        GiveInvItem index, GetPlayerEquipment(index, Armor), 0
        SetPlayerEquipment index, 0, Armor
        'Send Shield
        GiveInvItem index, GetPlayerEquipment(index, Shield), 0
        SetPlayerEquipment index, 0, Shield
        'Send Helmet
        GiveInvItem index, GetPlayerEquipment(index, Helmet), 0
        SetPlayerEquipment index, 0, Helmet

    Next
>!     'Drop *equipped* inventory items
    For i = 1 To MAX_INV
        PlayerMapDropItem index, i, 0
    Next
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...