Mmorpg Maker 2D
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Mmorpg Maker 2D

Forum sobre as principais engines de Mmorpgs.
 
InícioÚltimas imagensProcurarRegistarEntrar

 

 Spell Buff

Ir para baixo 
AutorMensagem
Del Piero
Admin
Del Piero


Mensagens : 153
Data de inscrição : 23/07/2008
Idade : 30
Localização : Rio de Janeiro

Spell Buff Empty
MensagemAssunto: Spell Buff   Spell Buff Icon_minitimeQua Jul 23, 2008 8:46 pm

1) Abra o seu main.txt e no final dele ponha:
Código:

Sub Buff(index, stat, amount, duration)
  If GetVar("Buff.ini", GetPlayerName(index), CStr(stat)) = "" Then
    Select Case stat
        Case 0
          Call SetPlayerStr(index, GetPlayerStr(index) + Int(Amount))
        Case 1
          Call SetPlayerDef(index, GetPlayerDef(index) + Int(Amount))
        Case 2
          Call SetPlayerMagi(index, GetPlayerMagi(index) + Int(Amount))
        Case 3
          Call SetPlayerSpeed(index, GetPlayerSpeed(index) + Int(Amount))
        Case Else
          Exit Sub
    End Select
    Call SendStats(index)
    Call PutVar("Buff.ini", GetPlayerName(index), CStr(stat), Cstr(amount))
    duration = duration * 1000
    Call SetTimer("Debuff " & index & ", " & CStr(stat), duration)
    Call SendHP(index)
    Call SendMP(index)
    Call SendSP(index)
  End If
End Sub
 
Sub Debuff(index, stat)
Amount = GetVar("Buff.ini", GetPlayerName(index), CStr(stat))
  Select Case stat
      Case "0"
        Call SetPlayerStr(index, GetPlayerStr(index) - Int(Amount))
      Case "1"
        Call SetPlayerDef(index, GetPlayerDef(index) - Int(Amount))
      Case "2"
        Call SetPlayerMagi(index, GetPlayerMagi(index) - Int(Amount))
      Case "3"
        Call SetPlayerSpeed(index, GetPlayerSpeed(index) - Int(Amount))
  End Select
Call SendStats(index)
Call PutVar("Buff.ini", GetPlayerName(index), CStr(stat), "")
Call RemoveTimer("Debuff " & index & ", " & CStr(stat))
Call SendHP(index)
Call SendMP(index)
Call SendSP(index)
End Sub

2) Procure no Main.txt por:

Código:
Sub LeftGame(Index)
   If GetPlayerAccess(Index) = 0 Then
      Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY)
   Else
      Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW)
   End If
End Sub

3) substitua por:

Código:
Sub LeftGame(Index)
   If GetPlayerAccess(Index) = 0 Then
      Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY)
   Else
      Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW)
   End If
        If GetVar("Buff.ini", GetPlayerName(index), "0") <> "" Then
    Call Debuff(index, "0")
End If
If GetVar("Buff.ini", GetPlayerName(index), "1") <> "" Then
    Call Debuff(index, "1")
End If
If GetVar("Buff.ini", GetPlayerName(index), "2") <> "" Then
    Call Debuff(index, "2")
End If
If GetVar("Buff.ini", GetPlayerName(index), "3") <> "" Then
    Call Debuff(index, "3")
End If
End Sub


Você poderá adicionar buff chamando-o por:

Código:
Call Buff(index, stat, amount, duration)

index = alvo
stat = Número do Stat(0 é strength, 1 é defense, 2 é magic, e 3 é speed)
amount = quanto
duration = duração em segundos

Para quem não sabe como chamar faça assim:

Código:
Case x
If GetPlayerTarget(index) > 0 Then
Call Buff(GetPlayerTarget(index), 0, 5, 10)
End If

PS: Substitua x pelo numero da case.

P.S.2: Caso queira de um modo mais proficional, espere até que eu faça por Hard Code.
Ir para o topo Ir para baixo
https://mmorpgmaker.forumeiros.com
 
Spell Buff
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» [PEDIDO]Buff Spell
» AJUDA NA SPELL
» [Pedido] Spell Npc
» SPELL NUM FAUNFA AJUDEMMMMMMMMM
» AJUDEM SPELL NUM FUNFA

Permissões neste sub-fórumNão podes responder a tópicos
Mmorpg Maker 2D :: Eclipse :: Scripts e Programação :: Banco de Dados-
Ir para: