Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undropable Items
#1
It has not been tested, so backup your source.

Since there are not many new tutorials being created, I thought I should share one.

Difficulty 1/5
By William

Explanation
This will make it so a item can either:
  • 0 Be dropable always
  • 1 Cant be dropped from inventory
  • 2 Cant be dropped from inventory or enemy
This could be good for quests and the like.

Client Side
In frmItemEditor add a txt box named: txtDropable

You may only enter a number between 0 and 2, see the numbers above to know what they do.

Now in:
Code:
Public Sub ItemEditorInit()
Add:
Code:
frmItemEditor.txtDropable.Text = Item(EditorIndex).DropAble

In:
Code:
Public Sub ItemEditorOk()
Inside this if statement:
[code]If (frmItemEditor.cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (frmItemEditor.cmbType.ListIndex = ITEM_TYPE_POTIONADDHP) And (frmItemEditor.cmbType.ListIndex
Reply
#2
EDIT: Nevermind, added an extra line on accident xD.

I decided to change the Subs on UpdateItemToAll, UpdateItemTo, and EditItemTo...
To use ElseIf's to make it just 1 If Wink.

But im wandering if I did it right like to read if after the first if.

Code:
' Drop all worn items by victim
        If GetPlayerWeaponSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerWeaponSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerWeaponSlot(Victim), 0)
        End If
        If GetPlayerArmorSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerArmorSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerArmorSlot(Victim), 0)
        End If
        If GetPlayerHelmetSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerHelmetSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerHelmetSlot(Victim), 0)
        End If
        If GetPlayerShieldSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerShieldSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerShieldSlot(Victim), 0)
        End If
Reply
#3
isn't 'not droppable from inventory or enemy' rather self defeating? If you don't want an NPC to drop the item... don't assign it to them...?

and if it can't be dropped from inventory (the #1), then an enemy combatant shouldn't drop it anyways.
Reply
#4
it was in tut idk :p

I guess so like Player or NPC cant Drop, npc cant drop but player can if have, npc drop but player cant... i guess xD
Reply
#5
I mean it cant be dropped if killed by a enemy or dropped by from the inventory by the drop button. lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)