Aldeia RPG

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

Suporte ao desenvolvimento de jogos


    Correção de heal MP em magias de tempo (Buff)

    Valentine
    Valentine
    Administrador
    Administrador


    Medalhas : Correção de heal MP em magias de tempo (Buff) ZgLkiRU
    Mensagens : 5336
    Créditos : 1163

    Correção de heal MP em magias de tempo (Buff) Empty Correção de heal MP em magias de tempo (Buff)

    Mensagem por Valentine Qui maio 31, 2012 10:06 am

    Soul:
    Parece que o código para HoTs apenas assume que você deseja para curar HP. Portanto, mesmo definindo um Heal MP o feitiço vai curar HP, independentemente do tipo de magia. Pontos não são afectados por este erro. Aqui está uma correção (não é elegante, mas eu tentei tocar código existente tão pouco quanto possível):

    Valentine:
    Além do bug citado a cima existe um outro, quando o jogador é curado não é enviado para o cliente o novo HP ou MP, então acrescentei um código para corrigir isso.

    Tudo é do lado do servidor.

    Correção para os jogadores

    Pesquisar:
    Código:
    SendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32
    Player(index).Vital(Vitals.HP) = Player(index).Vital(Vitals.HP) + Spell(.Spell).Vital

    e substituí-lo:
    Código:
    If Spell(.Spell).Type = SPELL_TYPE_HEALHP Then
        SendActionMsg Player(Index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(Index).x * 32, Player(Index).y * 32
        SetPlayerVital Index, Vitals.HP, GetPlayerVital(Index, Vitals.HP) + Spell(.Spell).Vital
        Call SendVital(Index, Vitals.HP)
    Else
        SendActionMsg Player(Index).Map, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, Player(Index).x * 32, Player(Index).y * 32
        SetPlayerVital Index, Vitals.MP, GetPlayerVital(Index, Vitals.MP) + Spell(.Spell).Vital
        Call SendVital(Index, Vitals.MP)
    End If

    Correção para NPCs

    Pesquisar:
    Código:
    SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32
    MapNpc(mapNum).Npc(index).Vital(Vitals.HP) = MapNpc(mapNum).Npc(index).Vital(Vitals.HP) + Spell(.Spell).Vital

    e substituí-lo:
    Código:
    If Spell(.Spell).Type = SPELL_TYPE_HEALHP Then
        SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32
        MapNpc(mapNum).Npc(index).Vital(Vitals.HP) = MapNpc(mapNum).Npc(index).Vital(Vitals.HP) + Spell(.Spell).Vital
    Else
        SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32
        MapNpc(mapNum).Npc(index).Vital(Vitals.MP) = MapNpc(mapNum).Npc(index).Vital(Vitals.MP) + Spell(.Spell).Vital
    End If

    Créditos:
    Soul e Valentine (Pelas correções)

      Data/hora atual: Sex Mar 29, 2024 4:29 am