Ir para conteúdo
Faça parte da equipe! (2024) ×

marcotozx

Membro
  • Total de Posts

    14
  • Registro em

  • Última visita

  • WCoins

    0

Posts postados por marcotozx

  1. Fala Galera, alguém poderia me ajudar nessa parada?

    O Player derruba a torre e somente aparece a mensagem, player tal derrubou a torre e nada de ir fama para a guild do mesmo.

    Abaixo os dois códigos que encontrei na source.

    Guerra_de_torres.cpp

    Citar

    #include "stdafx.h"

    void cGuerraTorre::ProcessTimer()
    {

        time_t rawnow = time(NULL);

        struct tm *now = localtime(&rawnow);
        auto cDiaDaSem = now->tm_wday;
        auto cHor = now->tm_hour;
        auto cMin = now->tm_min;
        auto cSeg = now->tm_sec;

        auto cTorreA = &gameServer.guerraTorre.Action;
        auto cTorre = &gameServer.guerraTorre;

        if (cDiaDaSem >= 1 && cDiaDaSem <= 5 || cTorre->Action.start)
        {
            if (!cTorre->Action.happening && cHor == cTorre->hora || !cTorre->Action.happening && cTorre->Action.start)
            {
                if (cMin >= 00 && cMin <= 02 || cTorre->Action.start)
                {
                    if (cSeg >= 0 && cSeg <= 5 || cTorre->Action.start)
                    {
                        CreateMob("Torre_Nordica", 2507, 1873, "Banco_Mobs/Quests", 0);
                        cTorre->Action.happening = true;
                        cTorre->Action.torre = TRUE;
                        SendNotice("![SERVIDOR] - GUERRA DE TORRES COMEÇOU.");
                    }
                }
            }
            if (cTorre->Action.happening && cHor == cTorre->hora || cTorre->Action.happening && cTorre->Action.fim)
            {
                if (cMin >= 50 && cMin <= 52 || cTorre->Action.happening && cTorre->Action.fim)
                {
                    if (cSeg >= 0 && cSeg <= 5 || cTorre->Action.happening && cTorre->Action.fim)
                    {
                        memset(cTorreA, 0, sizeof(gameConfig::_guerraTorre::_Action));

                        SendNotice("[SERVIDOR] - NÃO HOUVE GANHADORES NA GUERRA DE TORRES.");
                        auto mobInArea = Func::getMobsInAreaStr({ 2466, 1857 }, { 2538, 1910 }, { 120 });
                        for (auto& i : mobInArea)
                        {
                            GetMobFromIndex(i)->Mob.CurrentStatus.curHP = 0;
                            for (int client = 0; client < 1000; client++)
                            {
                                DeleteMob(client, i, 5, 0);
                            }
                        }
                    }
                }
            }
        }
    }

    bool cGuerraTorre::setPositionAltar(const int32_t client, p36Ch* const packet)
    {
        auto mob = GetMobFromIndex(client);
        auto userData = &Global::userData[client].Ingame;

        if (mob->Mob.Equip[12].Index == 509)
        {
            userData->timerAltar = 62;
            AltarID = client;
        }
        return true;
    }

    bool cGuerraTorre::PlayerDeath(const int32_t client, const int32_t killer)
    {
        auto dead = GetMobFromIndex(client);

        dead->Mob.CurrentStatus.curHP = dead->Mob.CurrentStatus.maxHP;

        dead->Mob.CurrentStatus.curMP = dead->Mob.CurrentStatus.maxMP;

        GetHpMp(&dead->Mob);

        Func::GetCurrentScore(client);

        SendScore(client);

        SendSetHpMp(client);

        DoTeleport(client, 2460 + rand() % 2, 2002 + rand() % 2, 0);

        return true;
    }

    void WINAPI playerAltarTorre()
    {
        auto servidor = &gameServer;

        while (1)
        {
            if (servidor->guerraTorre.Action.torre == 2)
            {
                towerMsCounter_++;

                if (towerMsCounter_ >= 1)
                {
                    towerMsCounter_ = 0;

                    towersecCounter_++;
                    if (!(towersecCounter_ % 2)) // um segundo 
                    {
                        uint16_t cID = AltarID;

                        if (AltarID > 0 || AltarID < 1000)
                        {
                            auto mob = GetMobFromIndex(cID);

                            if (mob->PosX == 2507 && mob->PosY == 1873)
                            {
                                auto cTorre = &gameServer.guerraTorre.Action;
                                auto gUser = &Global::uGuild[cID];
                                auto userData = &Global::userData[cID].Ingame;
                                auto user = Func::GetUserFromIndex(cID);

                                #pragma region SendErionDeath
                                if (mob->Mob.CurrentStatus.curHP <= 0)
                                {
                                    mob->Mob.CurrentStatus.curHP = mob->Mob.CurrentStatus.maxHP;

                                    mob->Mob.CurrentStatus.curMP = mob->Mob.CurrentStatus.maxMP;

                                    GetHpMp(&mob->Mob);

                                    Func::GetCurrentScore(cID);

                                    SendScore(cID);

                                    SendSetHpMp(cID);

                                    DoTeleport(cID, 2460 + rand() % 2, 2002 + rand() % 2, 0);
                                }
                                #pragma endregion

                                if (mob->Mob.Equip[12].Index == 509 && mob->Mob.CurrentStatus.curHP > 0)
                                {
                                    if (userData->timerAltar == 62)
                                    {
                                        Logs::sendLog(Global::systemLog, "Conta: [%s] Char: [%s] Mac: [%s] Guild:[%s] Tentou dominar o Altar de Erion", user->AccountName, mob->Mob.Name, userData->MacAdress, gUser->GuildName);
                                        SendNotice(Language::instance().getStringFormat(ConquistandoErion, gUser->GuildName));
                                        userData->timerAltar--;
                                        Func::sendMobCount(cID, userData->timerAltar, 60, AllChars);
                                    }

                                    if (userData->timerAltar >= 2 && userData->timerAltar <= 61)
                                    {
                                        userData->timerAltar--;
                                        Func::sendMobCount(cID, userData->timerAltar, 60, AllChars);
                                    }

                                    if (userData->timerAltar == 1)
                                    {
                                        Logs::sendLog(Global::systemLog, "Conta: [%s] Char: [%s] Mac: [%s] Guild:[%s] Dominou o Altar de Erion FameGuild: [%d] Antes dos Pontos", user->AccountName, mob->Mob.Name, userData->MacAdress, gUser->GuildName, gUser->Fama);
                                        SetFameGuild(mob->Mob.GuildIndex, 100);
                                        SendNotice(Language::instance().getStringFormat(ConquistouErion, gUser->GuildName));
                                        Logs::sendLog(Global::systemLog, "Conta: [%s] Char: [%s] Mac: [%s] Guild:[%s] Dominou o Altar de Erion FameGuild: [%d] Depois dos Pontos", user->AccountName, mob->Mob.Name, userData->MacAdress, gUser->GuildName, gUser->Fama);
                                        Func::sendMobCount(cID, 0, 0, AllChars);
                                        memset(cTorre, 0, sizeof(gameConfig::_guerraTorre::_Action));
                                    }
                                }

                            }

                        }
                        towersecCounter_ = 0;
                    }
                }
            }
            Sleep(500);
        }
    }

    Guerra_de_torres_2.cpp

    Citar

    #include "stdafx.h"

    void cGuerraTorre::ProcessTimer2()
    {
        time_t rawnow = time(NULL);

        struct tm *now = localtime(&rawnow);
        auto cDiaDaSem = now->tm_wday;
        auto cHor = now->tm_hour;
        auto cMin = now->tm_min;
        auto cSeg = now->tm_sec;

        auto game = &gameServer.Tower;
        auto cTorre = &gameServer.guerraTorre;

        if (cDiaDaSem >= 1 && cDiaDaSem <= 5 || game->admin)
        {
            if (!game->happening && cHor == cTorre->hora || !game->happening && game->admin)
            {
                if (cMin >= 00 && cMin <= 02 || game->admin)
                {
                    if (cSeg >= 0 && cSeg <= 5 || game->admin)
                    {
                        ClearArea(2466, 1857, 2538, 1910);

                        CreateMob("Torre", 2507, 1873, "Banco_Mobs/Quests", 0);

                        auto tower = Func::getMobsInAreaStr({ 2466, 1857 }, { 2538, 1910 }, { 120 });

                        /*for (auto& i : tower)
                            Func::CreateMobSend(i, cGuild.City[2].Id);

                        game->guild = cGuild.City[2].Id;*/
                            
                        game->happening = true;

                        game->tower = true;

                        SendNotice("[SERVIDOR] - Guerra de Torre começou.");
                    }
                }
            }

            if (game->happening && !game->tower)
            {
                game->tower = true;

                CreateMob("Torre", 2507, 1873, "Banco_Mobs/Quests", 0);

                auto tower = Func::getMobsInAreaStr({ 2466, 1857 }, { 2538, 1910 }, { 120 });

                for (auto& i : tower)
                    Func::CreateMobSend(i, game->guild);
            }

            if (game->happening && cHor == cTorre->hora || game->happening && game->end)
            {
                if (cMin >= 30 && cMin <= 32 || game->end)
                {

                    if (cSeg >= 0 && cSeg <= 5 || game->end)
                    {

                        if (game->guild != 0)
                        {
                            Func::LoadGuildID(game->guild);
                            auto guildWinner = &Global::idGuild[game->guild];
                            SendNotice(Language::instance().getStringFormat(ConquistouErion, guildWinner->GuildName));
                            SetFameGuild(game->guild, 100); 0x4D9960;
                        }

                        if (game->guild == 0) SendNotice("[SERVIDOR] - Guerra de Torre começou.");

                        auto tower = Func::getMobsInAreaStr({ 2466, 1857 }, { 2538, 1910 }, { 120 });
                        for (auto& i : tower)
                            GetMobFromIndex(i)->Mob.CurrentStatus.curHP = 0;

                        memset(game, 0, sizeof(gameConfig::_Tower));
                    }
                }
            }

        }
    }

    bool cGuerraTorre::TorreNordica(const uint16_t mobId, const uint16_t clientId)
    {
        if (clientId <= NULL || clientId >= 1000)
            return false;


        //auto game = &gameServer.guerraTorre.Action;
        //if (game->torre == TRUE)
        //{
        //    SendNotice(Language::instance().getStringFormat(torreNordica, GetMobFromIndex(clientId)->Mob.Name));
        //    game->torre = 2;
        //}


        auto mob = GetMobFromIndex(clientId);
        auto game = &gameServer.Tower;

        game->guild = mob->Mob.GuildIndex;
        game->tower = false;
        SendNotice(Language::instance().getStringFormat(torreNordica, GetMobFromIndex(clientId)->Mob.Name));

        ClearArea(2466, 1857, 2538, 1910);


        return false;
    }

     

  2. 1 hora atrás, marcotozx disse:

    Ao autor obrigado por disponibilizar o servidor.

    Só estou com problema no cliente, quero só abrir o servidor para brincar com meu amigos e o cliente fica apresentando erro no wyd.exe: Clients will need to update.

    e no laucher aparece a msg: Can't connect to download server.

    Veriquei respostas anteriores e o amigo informou para alterar no settings.txt colocando o meu ip, mas sem sucesso.

    Alguem pode me ajudar como resolver isso?

     

     

    Galera eu consegui abrir colocando o xampp, só que quando coloco a acc aparece esta mensagem:

    image.png.ab7492ccaa195e9c6b40a4161abe5764.png

     

    Onde está este diacho de atualização para eu colocar no patch?

    • Curtir 7
  3. Ao autor obrigado por disponibilizar o servidor.

    Só estou com problema no cliente, quero só abrir o servidor para brincar com meu amigos e o cliente fica apresentando erro no wyd.exe: Clients will need to update.

    e no laucher aparece a msg: Can't connect to download server.

    Veriquei respostas anteriores e o amigo informou para alterar no settings.txt colocando o meu ip, mas sem sucesso.

    Alguem pode me ajudar como resolver isso?

     

     

×
×
  • Criar Novo...

Informação Importante

Nós fazemos uso de cookies no seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies , caso contrário, vamos supor que você está bem para continuar.