Makers Brasil
Bem Vindos a Maker´s Brasil (um forum para criação de servidores 2D e 3D)Nos desejamos boa sorte no seu projeto!

Spell Basiado em Stats

Ir em baixo

Spell Basiado em Stats Empty Spell Basiado em Stats

Mensagem por thales12 em Qua Dez 21, 2011 8:22 am

Spell Basiado em tal Stats

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:

lblBaseStat
Stat:Nenhum
dps de 2 clicks na scrlbasestat e adicione:

Código:
 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
thales12
thales12
Moderador
Moderador

Mensagens : 184
Estrelas Makers : 406
Creditos : 55
Data de inscrição : 22/03/2011
Idade : 24
Localização : Rio de Janeiro

http://www.rdmgames.tk

Voltar ao Topo Ir em baixo

Voltar ao Topo


 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum