Universo Games
Ola , Convidado

Sistema de Buff Logo1110

Você ainda não e cadastrado então cadastre-se e veja todas as atualizações no Mundo RPG!!!
Universo Games
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Universo Games

Suporte e Desenvolvimento só no Universo Games
 
InícioInício  PortalPortal  EventosEventos  PublicaçõesPublicações  Últimas imagensÚltimas imagens  RegistarRegistar  EntrarEntrar  
Ola Convidado, Seja Bem vindo a equipe lhe deseja boa sorte no seu projeto!

 

 Sistema de Buff

Ir para baixo 
AutorMensagem
Lucas Roberto
Administrador
Administrador
Lucas Roberto


Mensagens : 711

Sistema de Buff Empty
MensagemAssunto: Sistema de Buff   Sistema de Buff EmptySex 30 Set 2011, 20:49

Um ótimo sistema de buff. Não é necessario criar muitas SUBs, por isso deixa o Main.txt mais organizado.
Vamos ao tuto...

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
Ir para o topo Ir para baixo
https://universogamesmmo.forumeiros.com
 
Sistema de Buff
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» Sistema De Vip
» [ALL]Sistema VIP
» [EO]Sistema de Pet
» Sistema Noticias
» Sistema de Amigos

Permissões neste sub-fórumNão podes responder a tópicos
Universo Games :: Criação de Jogos :: Eclipse :: Tutoriais :: Scripts-
Ir para: