KySoto

consume item function

Apr 8th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.60 KB | None | 0 0
  1. Private Function ConsumeItem(ByVal argPartyslot As Integer, ByVal argInventoryIndex As Integer) As Boolean 'using atk for hp and magic for mp to save on space.
  2.         If argPartyslot >= 0 And argPartyslot <= 3 Then
  3.             If Inventory(argInventoryIndex).index > 0 Then
  4.                 If Inventory(argInventoryIndex).consumable Then
  5.                     If Party(argPartyslot).dead Then
  6.                         If Inventory(argInventoryIndex).handed2 Then
  7.                             If InsertItemInToInventory(Inventory(argInventoryIndex).index, -1) Then
  8.                                 Party(argPartyslot).dead = False
  9.                                 Party(argPartyslot).hp += Inventory(argInventoryIndex).atk
  10.                                 Party(argPartyslot).mp += Inventory(argInventoryIndex).magic
  11.                                 Return True
  12.                             Else
  13.                                 Return False
  14.                             End If
  15.  
  16.                         Else
  17.                             Return False
  18.                         End If
  19.                     Else
  20.                         If Inventory(argInventoryIndex).atk > 0 Then
  21.                             If Party(argPartyslot).hp < Party(argPartyslot).maxhp Then
  22.                                 If InsertItemInToInventory(Inventory(argInventoryIndex).index, -1) Then
  23.                                     Party(argPartyslot).hp += Inventory(argInventoryIndex).atk
  24.                                     Return True
  25.                                 Else
  26.                                     Return False
  27.                                 End If
  28.                             Else
  29.                                 Return False
  30.                             End If
  31.  
  32.                         Else
  33.                             If Party(argPartyslot).mp < Party(argPartyslot).maxmp Then
  34.                                 If InsertItemInToInventory(Inventory(argInventoryIndex).index, -1) Then
  35.                                     Party(argPartyslot).mp += Inventory(argInventoryIndex).magic
  36.                                     Return True
  37.                                 Else
  38.                                     Return False
  39.                                 End If
  40.  
  41.                             Else
  42.                                 Return False
  43.                             End If
  44.                         End If
  45.                     End If
  46.                 Else
  47.                     Return False
  48.                 End If
  49.             Else
  50.                 Return False
  51.             End If
  52.         Else
  53.             Return False
  54.         End If
  55.     End Function
Advertisement
Add Comment
Please, Sign In to add comment