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

WebRPG


 
InícioInício  PortalPortal  Últimas imagensÚltimas imagens  ProcurarProcurar  RegistarRegistar  EntrarEntrar  

 

 Sistema De Buff

Ir para baixo 
AutorMensagem
FuckStyle

FuckStyle


Mensagens : 23
Data de inscrição : 07/12/2011

Sistema De Buff Empty
MensagemAssunto: Sistema De Buff   Sistema De Buff I_icon_minitimeSex Dez 09, 2011 12:28 pm

Coloque isso no final do seu Main.txt:
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

Depois coloque isso na Sub LeftGame:
Código:
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

Pronto! Sistema adicionado...
Agora para lançar o buff, adicione a seguinte case na Sub ScriptedSpell:
Código:
Case X
Call Buff(index, N° Stats, Quantidade, Duração)
Exit Sub

Legenda:
- X = Número da case
- N° Stats = É o número do stats (Logo abaixo estão os números).
- Quantidade = Quantidade que será adicionada no stats selecionado.
- Duração = Tempo em que o stats ficará buffado.
PS: Duração é em Segundos

Numeros de Stats:
• 0 = STR
• 1 = DEF
• 2 = MAGI
• 3 = SPEED

Créditos: Ballie , FuckStyle
Ir para o topo Ir para baixo
 
Sistema De Buff
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» Sistema De VIP
» Sistema De Cash
» Sistema De Suicidio..
» Sistema De Clima
» Sistema De Spell Linear

Permissões neste sub-fórumNão podes responder a tópicos
WebRPG :: Eclipse Engine :: Tutoriais Eclipse Engine-
Ir para: