Bom sei que e cansativo cria npcs cria status e etc..com esse tutorial voce vai coloca os status automáticos baseado no nvl do NPC
1° Abra o sourcer do Cliente
Na frmEditor_NPC crie:
1 Button
Nome: Genstats
Caption: Generate Stats
1 CheckBox
Nome: chkBossName
Caption: Boss
2° Abra o Button e adicione:
- Código:
Dim High As Long
Dim Low As Long
Dim HighExp
Dim LowExp
Dim HighHP
Dim LowHP
Dim HighDam
Dim LowDam
'If not a Boss set stats as normal. This is where you change the equations for stats.
If chkBossName.Value = 0 Then
High = (txtLevel + 4)
Low = (txtLevel - 4)
HighExp = (txtLevel * 5 + 2)
LowExp = (txtLevel * 5 - 2)
HighHP = (txtLevel * 10 + 3)
LowHP = (txtLevel * 10 - 3)
HighDam = (txtLevel + 4)
LowDam = (txtLevel - 4)
End If
' Is a Boss set stats a bit higher then normal. This is where you change the equations for stats.
If chkBossName.Value = 1 Then
High = (txtLevel + 10)
Low = (txtLevel + 4)
HighExp = (txtLevel * 8 +
LowExp = (txtLevel * 8 + 2)
HighHP = (txtLevel * 15 + 3)
LowHP = (txtLevel * 15 - 3)
HighDam = (txtLevel + 4)
LowDam = (txtLevel - 4)
End If
' Check so there are no stats below 0\. Then sets stats based on NPC Level.
If Low <= 0 Then
scrlStat(1).Value = RandomNumber(High, 0)
scrlStat(2).Value = RandomNumber(High, 0)
scrlStat(3).Value = RandomNumber(High, 0)
scrlStat(4).Value = RandomNumber(High, 0)
txtHP.Text = RandomNumber(HighHP, LowHP)
txtDamage.Text = RandomNumber(HighDam, 2)
txtLevel.Text = RandomNumber(HighDam, 2)
End If
' Sets stats based on NPC Level.
If Low >= 0 Then
scrlStat(1).Value = RandomNumber(High, Low)
scrlStat(2).Value = RandomNumber(High, Low)
scrlStat(3).Value = RandomNumber(High, Low)
scrlStat(4).Value = RandomNumber(High, Low)
txtHP.Text = RandomNumber(HighHP, LowHP)
txtDamage.Text = RandomNumber(HighDam, LowDam)
txtLevel.Text = RandomNumber(HighDam, 2)
End If
2° Depois de End Sub adicione:
- Código:
Private Sub chkIsBoss_Click()
NPC(EditorIndex).isBoss = chkIsBoss.Value
End Sub
3° agora coloque:
- Código:
Public Function RandomNumber(ByVal MaxValue As Long, Optional _
ByVal MinValue As Long = 0)
Randomize timer
RandomNumber = Int((MaxValue - MinValue + 1) * Rnd) + MinValue
End Function
Bom e isso ai...
Créditos
Alenaldo por cria o tutorial
Outros (achei esse sistema em uma engine nao sei quem fez rs.)
espero que gostem e meu primeiro tutorial rs..