Mirage Source
Undropable Items - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Undropable Items (/showthread.php?tid=779)



Undropable Items - William - 02-03-2007

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


- Boo - 11-04-2007

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



- Obsidian - 11-04-2007

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.


- Boo - 11-04-2007

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


- William - 11-04-2007

I mean it cant be dropped if killed by a enemy or dropped by from the inventory by the drop button. lol