Universo Games
Ola , Convidado

Barra de HP e MP em cima do Player 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!

 

 Barra de HP e MP em cima do Player

Ir para baixo 
AutorMensagem
Convidado
Convidado
Anonymous



Barra de HP e MP em cima do Player Empty
MensagemAssunto: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player EmptyQui 03 Nov 2011, 19:53

no Client~Side procure por:

Código:
Public Sub BltPlayer(ByVal Index As Long)
Dim Anim As Byte, i As Long, X As Long, Y As Long
Dim Sprite As Long, spritetop As Long
Dim rec As DxVBLib.RECT
Dim attackspeed As Long
   
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    Sprite = GetPlayerSprite(Index)

    If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub
   
    CharacterTimer(Sprite) = GetTickCount + SurfaceTimerMax

    If DDS_Character(Sprite) Is Nothing Then
        Call InitDDSurf("characters" & Sprite, DDSD_Character(Sprite), DDS_Character(Sprite))
    End If

    ' speed from weapon
    If GetPlayerEquipment(Index, Weapon) > 0 Then
        attackspeed = Item(GetPlayerEquipment(Index, Weapon)).Speed
    Else
        attackspeed = 1000
    End If

    ' Reset frame
    If Player(Index).Step = 3 Then
        Anim = 0
    ElseIf Player(Index).Step = 1 Then
        Anim = 2
    End If
   
    ' Check for attacking animation
    If Player(Index).AttackTimer + (attackspeed / 2) > GetTickCount Then
        If Player(Index).Attacking = 1 Then
            Anim = 3
        End If
    Else
        ' If not attacking, walk normally
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset > 8) Then Anim = Player(Index).Step
            Case DIR_DOWN
                If (Player(Index).YOffset < -8) Then Anim = Player(Index).Step
            Case DIR_LEFT
                If (Player(Index).XOffset > 8) Then Anim = Player(Index).Step
            Case DIR_RIGHT
                If (Player(Index).XOffset < -8) Then Anim = Player(Index).Step
        End Select
    End If

    ' Check to see if we want to stop making him attack
    With Player(Index)
        If .AttackTimer + attackspeed < GetTickCount Then
            .Attacking = 0
            .AttackTimer = 0
        End If
    End With

    ' Set the left
    Select Case GetPlayerDir(Index)
        Case DIR_UP
            spritetop = 3
        Case DIR_RIGHT
            spritetop = 2
        Case DIR_DOWN
            spritetop = 0
        Case DIR_LEFT
            spritetop = 1
    End Select

    With rec
        .top = spritetop * (DDSD_Character(Sprite).lHeight / 4)
        .Bottom = .top + (DDSD_Character(Sprite).lHeight / 4)
        .Left = Anim * (DDSD_Character(Sprite).lWidth / 4)
        .Right = .Left + (DDSD_Character(Sprite).lWidth / 4)
    End With

    ' Calculate the X
    X = GetPlayerX(Index) * PIC_X + Player(Index).XOffset - ((DDSD_Character(Sprite).lWidth / 4 - 32) / 2)

    ' Is the player's height more than 32..?
    If (DDSD_Character(Sprite).lHeight) > 32 Then
        ' Create a 32 pixel offset for larger sprites
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - ((DDSD_Character(Sprite).lHeight / 4) - 32)
    Else
        ' Proceed as normal
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset
    End If

    ' render the actual sprite
    Call BltSprite(Sprite, X, Y, rec)
   
    ' check for paperdolling
    For i = 1 To UBound(PaperdollOrder)
        If GetPlayerEquipment(Index, PaperdollOrder(i)) > 0 Then
            If Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll > 0 Then
                Call BltPaperdoll(X, Y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
            End If
        End If
    Next
   
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "BltPlayer", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

em baixo adicione:

Código:
Public Sub BltPlayerHP(ByVal Index As Long)
    Dim X As Long, Y As Long, Sprite As Long
   
    X = GetPlayerX(Index) * PIC_X + Player(Index).XOffset
   
    Sprite = GetPlayerSprite(Index)
   
    If Sprite < 1 Or Sprite > NumCharacters Then
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - 25
    Else
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 149
    End If
   
    ' Draw the outside box
    Call DDS_BackBuffer.SetFillColor(RGB(0, 0, 0))
    Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + 35), ConvertMapY(Y + 4))
   
    ' Draw the HP bar
    Call DDS_BackBuffer.SetFillColor(RGB(0, 255, 0))
    Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + Int(((GetPlayerVital(Index, Vitals.HP) / 35) / (GetPlayerMaxVital(Index, Vitals.HP) / 35)) * 35)), ConvertMapY(Y + 4))
End Sub

Public Sub BltPlayerMP(ByVal Index As Long)
    Dim X As Long, Y As Long, Sprite As Long
   
    X = GetPlayerX(Index) * PIC_X + Player(Index).XOffset
   
    Sprite = GetPlayerSprite(Index)
   
    If Sprite < 1 Or Sprite > NumCharacters Then
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - 20
    Else
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 155
    End If
   
    ' Draw the outside box
    Call DDS_BackBuffer.SetFillColor(RGB(0, 0, 0))
    Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + 35), ConvertMapY(Y + 4))
   
    ' Draw the HP bar
    Call DDS_BackBuffer.SetFillColor(RGB(50, 30, 300))
    Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + Int(((GetPlayerVital(Index, Vitals.MP) / 35) / (GetPlayerMaxVital(Index, Vitals.MP) / 35)) * 35)), ConvertMapY(Y + 4))
End Sub

dps na modDirectDraw7 procure por:

Código:
' Players
            For i = 1 To Player_HighIndex
                If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                    If Player(i).Y = Y Then
                        Call BltPlayer(i)
                    End If
                End If
            Next

e mude para:

Código:
' Players
            For i = 1 To Player_HighIndex
                If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                    If Player(i).Y = Y Then
            Call BltPlayerHP(i)
                        Call BltPlayerMP(i)
                        Call BltPlayer(i)
                    End If
                End If
            Next

Demonstração de como vai ficar:

Spoiler:

Créditos: a mim Thales12
Ir para o topo Ir para baixo
Convidado
Convidado
Anonymous



Barra de HP e MP em cima do Player Empty
MensagemAssunto: Re: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player EmptySex 04 Nov 2011, 14:26

Muito bom e Simples.
Obrigado por Disponibilizar +1Créd.
Ir para o topo Ir para baixo
Lucas Roberto
Administrador
Administrador
Lucas Roberto


Mensagens : 711

Barra de HP e MP em cima do Player Empty
MensagemAssunto: Re: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player EmptySex 04 Nov 2011, 20:31

Obrigado por Disponibilizar +1Créd.
Ir para o topo Ir para baixo
https://universogamesmmo.forumeiros.com
Convidado
Convidado
Anonymous



Barra de HP e MP em cima do Player Empty
MensagemAssunto: Re: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player EmptyDom 17 Jun 2012, 19:53

Não achei essa pasta em lugar nenhum no meu eclipse pq?
Ir para o topo Ir para baixo
Convidado
Convidado
Anonymous



Barra de HP e MP em cima do Player Empty
MensagemAssunto: Re: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player EmptySeg 02 Jul 2012, 16:20

tem como em baixo do personagem ?
Ir para o topo Ir para baixo
Convidado
Convidado
Anonymous



Barra de HP e MP em cima do Player Empty
MensagemAssunto: Re: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player EmptySeg 23 Jul 2012, 08:44

obrigado! ¬¬

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

É meu Fan? Gosta de Min? Então use:
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
Ir para o topo Ir para baixo
Conteúdo patrocinado





Barra de HP e MP em cima do Player Empty
MensagemAssunto: Re: Barra de HP e MP em cima do Player   Barra de HP e MP em cima do Player Empty

Ir para o topo Ir para baixo
 
Barra de HP e MP em cima do Player
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» Player Atravessando Player
» [EO] Colocando barra de HP nos NPC
» BARRA DE CODIGO
» Deixando o Player Mudo
» Player Kick por ausencia

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