Spell Basiado em tal Stats
no client~Side vai na frmEditor_spell crie uma frm chamada:
dentro dela adicione:
uma hscrolbar com name:
scrlBaseStat
em cima adicione uma label com name e caption:
na private type spell rec adicione:
dps na spelleditorinit procure por:
em baixo adicione:
agora no server~side na private type spell rec adicione:
na castspell procure por:
mude para:
dps procure por:
e mude para:
agora procuure por:
e mude para:
no final da modgamelogic adicione:
fim, credits ao titio thales
no client~Side vai na frmEditor_spell crie uma frm chamada:
fraBaseStat
Basiado em Stat
dentro dela adicione:
uma hscrolbar com name:
scrlBaseStat
em cima adicione uma label com name e caption:
dps de 2 clicks na scrlbasestat e adicione:lblBaseStat
Stat:Nenhum
- Código:
Select Case scrlBaseStat.Value
Case 0
lblBaseStat.Caption = "Stat:Nenhum"
Case 1
lblBaseStat.Caption = "Stat:Strength"
Case 2
lblBaseStat.Caption = "Stat:Intelligence"
Case 3
lblBaseStat.Caption = "Stat:Agillity"
Case 4
lblBaseStat.Caption = "Stat:Endurance"
Case 5
lblBaseStat.Caption = "Stat:WillPower"
End Select
Spell(EditorIndex).BaseStat = scrlBaseStat.Value
na private type spell rec adicione:
- Código:
BaseStat As Byte
dps na spelleditorinit procure por:
- Código:
.scrlStun.Value = Spell(EditorIndex).StunDuration
em baixo adicione:
- Código:
.scrlBaseStat.Value = Spell(EditorIndex).BaseStat
agora no server~side na private type spell rec adicione:
- Código:
BaseStat As Byte
na castspell procure por:
- Código:
' set the vital
Vital = Spell(spellnum).Vital
AoE = Spell(spellnum).AoE
range = Spell(spellnum).range
mude para:
- Código:
' set the vital
Vital = GetSpellBaseStat(index, SpellNum)
AoE = Spell(SpellNum).AoE
Range = Spell(SpellNum).Range
dps procure por:
- Código:
Public Sub HandleDoT_Player(ByVal Index As Long, ByVal dotNum As Long)
With TempPlayer(Index).DoT(dotNum)
If .Used And .Spell > 0 Then
' time to tick?
If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) Then
If CanPlayerAttackPlayer(.Caster, Index, True) Then
PlayerAttackPlayer .Caster, Index, Spell(.Spell).Vital
End If
.Timer = GetTickCount
' check if DoT is still active - if player died it'll have been purged
If .Used And .Spell > 0 Then
' destroy DoT if finished
If GetTickCount - .StartTime >= (Spell(.Spell).duration * 1000) Then
.Used = False
.Spell = 0
.Timer = 0
.Caster = 0
.StartTime = 0
End If
End If
End If
End If
End With
End Sub
e mude para:
- Código:
Public Sub HandleDoT_Player(ByVal index As Long, ByVal dotNum As Long)
With TempPlayer(index).DoT(dotNum)
If .Used And .Spell > 0 Then
' time to tick?
If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) Then
If CanPlayerAttackPlayer(.Caster, index, True) Then
PlayerAttackPlayer .Caster, index, RAND(1, GetSpellBaseStat(.Caster, .Spell))
End If
.Timer = GetTickCount
' check if DoT is still active - if player died it'll have been purged
If .Used And .Spell > 0 Then
' destroy DoT if finished
If GetTickCount - .StartTime >= (Spell(.Spell).Duration * 1000) Then
.Used = False
.Spell = 0
.Timer = 0
.Caster = 0
.StartTime = 0
End If
End If
End If
End If
End With
End Sub
agora procuure por:
- Código:
Public Sub HandleDoT_Npc(ByVal mapNum As Long, ByVal Index As Long, ByVal dotNum As Long)
With MapNpc(mapNum).NPC(Index).DoT(dotNum)
If .Used And .Spell > 0 Then
' time to tick?
If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) Then
If CanPlayerAttackNpc(.Caster, Index, True) Then
PlayerAttackNpc .Caster, Index, Spell(.Spell).Vital, , True
End If
.Timer = GetTickCount
' check if DoT is still active - if NPC died it'll have been purged
If .Used And .Spell > 0 Then
' destroy DoT if finished
If GetTickCount - .StartTime >= (Spell(.Spell).duration * 1000) Then
.Used = False
.Spell = 0
.Timer = 0
.Caster = 0
.StartTime = 0
End If
End If
End If
End If
End With
End Sub
e mude para:
- Código:
Public Sub HandleDoT_Npc(ByVal MapNum As Long, ByVal index As Long, ByVal dotNum As Long)
With MapNpc(MapNum).Npc(index).DoT(dotNum)
If .Used And .Spell > 0 Then
' time to tick?
If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) Then
If CanPlayerAttackNpc(.Caster, index, True) Then
PlayerAttackNpc .Caster, index, RAND(1, GetSpellBaseStat(.Caster, .Spell)), , True
End If
.Timer = GetTickCount
' check if DoT is still active - if NPC died it'll have been purged
If .Used And .Spell > 0 Then
' destroy DoT if finished
If GetTickCount - .StartTime >= (Spell(.Spell).Duration * 1000) Then
.Used = False
.Spell = 0
.Timer = 0
.Caster = 0
.StartTime = 0
End If
End If
End If
End If
End With
End Sub
no final da modgamelogic adicione:
- Código:
Public Function GetSpellBaseStat(ByVal index As Long, ByVal SpellNum As Long) As Long
If SpellNum > 0 Then
Select Case Spell(SpellNum).BaseStat
Case 1
GetSpellBaseStat = GetPlayerStat(index, Stats.strength) * 1.5 + GetPlayerLevel(index) / 6.2 + Spell(SpellNum).Vital
Case 2
GetSpellBaseStat = GetPlayerStat(index, Stats.Intelligence) * 1.5 + GetPlayerLevel(index) / 6.2 + Spell(SpellNum).Vital
Case 3
GetSpellBaseStat = GetPlayerStat(index, Stats.Agility) * 1.5 + GetPlayerLevel(index) / 6.2 + Spell(SpellNum).Vital
Case 4
GetSpellBaseStat = GetPlayerStat(index, Stats.Endurance) * 1.5 + GetPlayerLevel(index) / 6.2 + Spell(SpellNum).Vital
Case 5
GetSpellBaseStat = GetPlayerStat(index, Stats.Willpower) * 1.5 + GetPlayerLevel(index) / 6.2 + Spell(SpellNum).Vital
End Select
End If
End Function
fim, credits ao titio thales
Última edição por thales12 em Dom Mar 18, 2012 5:25 pm, editado 2 vez(es)