1 [All]Perdendo itens ao morrer 22/2/2013, 08:43
Matheus
Membro V
~Server Side~
Sistema : Perder itens ao morrer
Ache:
- Código:
Sub OnDeath(ByVal Index As Long)
- Código:
Dim Rate As Long
Dim DropNum As Long
- Código:
' 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
- Código:
Rate = 75
If Rand(1, 100) >= Rate Then
DropNum = Rand(1, 4)
Select Case DropNum
Case 1
If GetPlayerEquipment(index, Weapon) > 0 Then
PlayerMapDropItem index, GetPlayerEquipment(index, Weapon), 0
End If
GiveInvItem index, GetPlayerEquipment(index, Weapon), 0
SetPlayerEquipment index, 0, Weapon
Case 2
If GetPlayerEquipment(index, Helmet) > 0 Then
PlayerMapDropItem index, GetPlayerEquipment(index, Helmet), 0
End If
GiveInvItem index, GetPlayerEquipment(index, Helmet), 0
SetPlayerEquipment index, 0, Helmet
Case 3
If GetPlayerEquipment(index, Armor) > 0 Then
PlayerMapDropItem index, GetPlayerEquipment(index, Armor), 0
End If
GiveInvItem index, GetPlayerEquipment(index, Armor), 0
SetPlayerEquipment index, 0, Armor
Case 4
If GetPlayerEquipment(index, Shield) > 0 Then
PlayerMapDropItem index, GetPlayerEquipment(index, Shield), 0
End If
GiveInvItem index, GetPlayerEquipment(index, Shield), 0
SetPlayerEquipment index, 0, Shield
End Select
End If
Rate = 90
If Rand(1, 100) >= Rate Then
For i = 1 To MAX_INV
If Item(i).Type <> ITEM_TYPE_CURRENCY Then
PlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)
End If
Next
End If
Ache e delete :
- Código:
' 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
Explicações:os itens equipados n caem no chao e sim vao para o seu inventário depois
se vc morrer de novo podem cair no chao. Sim, itens tipo currency tbm
podem ser dropados, e as vezes vc pode perder todos os itens ao invés de
um só...
Ótimo sistema para um jogo medieval (:
Créditos: Katekyo , Justin ,Ruffy