Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unbreakable items
#1
Allow the dur scrollbar to go to -1

You might have to change the way dur is dimmed somewhere, but yeah, this works. And you don't need another var to increase the size of the item file.
Code:
Sub DamageEquipment(ByVal Index As Long, ByVal EquipmentSlot As Equipment)
Dim Slot As Long
    
    Slot = GetPlayerEquipmentSlot(Index, EquipmentSlot)
    
    If Slot > 0 And GetPlayerInvItemDur(Index, Slot) > -1 Then
        Call SetPlayerInvItemDur(Index, Slot, GetPlayerInvItemDur(Index, Slot) - 1)
            
        If GetPlayerInvItemDur(Index, Slot) = 0 Then
            Call PlayerMsg(Index, "Your " & Trim$(Item(GetPlayerInvItemNum(Index, Slot)).Name) & " has broken.", Yellow)
            Call TakeItem(Index, GetPlayerInvItemNum(Index, Slot), 0)
        Else
            If GetPlayerInvItemDur(Index, Slot)  0 Then
                Call PlayerMsg(Index, "Your " & Trim$(Item(GetPlayerInvItemNum(Index, Slot)).Name) & " is about to break!", Yellow)
            End If
        End If
    End If
Reply
#2
Can't you just remove the code? Well, I suppose if you want perfect and imperfect items then you would use something like this..
Reply
#3
Yer, this is for both breakable and unbreakable items. If you want every item to be unbreakable, just remove that part.
Reply
#4
All items with 0 durability are supposed to be unbreakable, right?
If I set their durability to 0, they never break.
Reply
#5
Looks like unbreakable items have a dur of -1
Reply
#6
If GetPlayerInvItemDur(Index, Slot) = 0 Then
Call PlayerMsg(Index, "Your " & Trim$(Item(GetPlayerInvItemNum(Index, Slot)).Name) & " has broken.", Yellow)
Call TakeItem(Index, GetPlayerInvItemNum(Index, Slot), 0)
Else


So judging from this part of the code, I'd say they do break.


Use this code and set dur to -1 to make it infinite
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)