Siga-nos em...
Follow us on Twitter Follow us on Facebook Watch us on YouTube
Registro

Alpha Servers
Resultados 1 a 6 de 6
  1. #1

    Avatar de slipkorn13
    Data de Ingresso
    Sep 2009
    Localização
    Pta Arenas, Chile
    Posts
    69
    Agradecido
    0
    Agradeceu
    0
    Peso da Avaliação
    15

    Padrão C++ Swamp Of Calmness Event - Season 5

    Bueno, mucho no hay que comentar sobre este aporte. No tuve la oportunidad de testearlo, ya que con suerte trabajo sobre una Season 4.5 xD.

    CalmnessEvent.cpp
    Código:
    //============================================================//
    //    Swamp Of Calmness Event Coded By M.E.S       //
    //                                                              //
    //============================================================//
    
    #include "StdAfx.h"
    #include "SwampEvent.h"
    #include "GameServer.h"
    #include "Message.h"
    #include "User.h"
    #include "Utilidades.h"
    
    int iSwampItemBugCount;
    SwampPeace Swamp;
    SwampBag g_SwampItemBag[255];
    // -------------------------------------------------------------
    SwampPeace::SwampPeace()
    {
        // ----
    }
    // -------------------------------------------------------------
    SwampPeace::~SwampPeace()
    {
        // ----
    }
    // -------------------------------------------------------------
    void SwampPeace::LoadSwampConfig()
    {
        Swamp.SwampEnabled                    = GetPrivateProfileInt("SwampOfPeace","SwampOfPeaceEventEnabled",1,EventFile);
        Swamp.SwampMinutes                    = GetPrivateProfileInt("SwampOfPeace","SwampOfPeaceEventDuration",10,EventFile)*60;
        if (Swamp.SwampEnabled == 1)
        {
            Swamp.LoadSwampEventItemBag();
        }
    }
    // -------------------------------------------------------------
    void SwampPeace::LoadSwampEventItemBag()
    {
        FILE * FilePath;
        char cLineText[255] = {0};
        int  iIndex         = 0;
        int  iNumber[9]     = {0};
        // ----
        fopen_s(&FilePath,SwampEventItemBag,"r");
        // ----
        while(fgets (cLineText , 255 , FilePath) != NULL)
        {
            if(cLineText[0] != '/' && cLineText[1] != '/' && strlen(cLineText) > 3)
            {
                sscanf_s(cLineText , "%d %d %d %d %d %d %d %d %d", &iNumber[0], &iNumber[1], &iNumber[2],&iNumber[3], &iNumber[4], &iNumber[5], &iNumber[6], &iNumber[7], &iNumber[8]);
                // ----
                g_SwampItemBag[iIndex].iType    = iNumber[0];
                g_SwampItemBag[iIndex].iIndex   = iNumber[1];
                g_SwampItemBag[iIndex].iLevel   = iNumber[2];
                g_SwampItemBag[iIndex].iDur        = iNumber[3];
                g_SwampItemBag[iIndex].iLuck    = iNumber[4];
                g_SwampItemBag[iIndex].iSkill   = iNumber[5];
                g_SwampItemBag[iIndex].iOption  = iNumber[6];
                g_SwampItemBag[iIndex].iExc    = iNumber[7];
                g_SwampItemBag[iIndex].iAnc    = iNumber[8];
                // ----
                iSwampItemBugCount++;
                iIndex++;
              }
        }
        // ---
        fclose(FilePath);
    }
    // -------------------------------------------------------------
    void SwampPeace::SwampMonsterManager(int aIndex,int MobIndex)
    {
        if (Swamp.SwampEnabled == 1 && Swamp.SwampIsRunning == 1)
        {
            OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
            OBJECTSTRUCT *gObjMob = (OBJECTSTRUCT*)OBJECT_POINTER(MobIndex);
            // ----
            if (MobIndex == Swamp.SwampBossIndex && Swamp.SwampBossKilled == 0)
            {
                int Random = rand()%iSwampItemBugCount;
                int RewardItem = ((g_SwampItemBag[Random].iType*512)+g_SwampItemBag[Random].iIndex);
                ItemSerialCreateSend(aIndex,gObjMob->MapNumber,gObjMob->X,gObjMob->Y,RewardItem,g_SwampItemBag[Random].iLevel,g_SwampItemBag[Random].iDur,g_SwampItemBag[Random].iLuck,g_SwampItemBag[Random].iSkill,g_SwampItemBag[Random].iOption,aIndex,g_SwampItemBag[Random].iExc,g_SwampItemBag[Random].iAnc);
                Swamp.SwampBossKilled = 1;
            }
        }
    }
    // -------------------------------------------------------------
    void SwampPeace::SwampAddMonster()
    {
        int RandomMapSwamp = rand()%4;
        if (RandomMapSwamp == 0)
        {
            Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,96,167);
        }
        else if (RandomMapSwamp == 1)
        {
            Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,60,77);
        }
        else if (RandomMapSwamp == 2)
        {
            Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,140,48);
        }
        else if (RandomMapSwamp == 3)
        {
            Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,204,114);
        }
        else
        {
            Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,96,167);
        }
    }
    // -------------------------------------------------------------
    void SwampPeace::SwampOfPeaceStart()
    {
        if (Swamp.SwampEnabled == 1 && Swamp.SwampIsRunning == 0)
        {
            m_Message.AllServerGold("[Swamp of Peace] Medusa has corrupted Swamp. Find her!!");
            Swamp.SwampTimer = Swamp.SwampMinutes;
            Swamp.SwampIsRunning = 1;
            Swamp.SwampBossKilled = 0;
            Swamp.SwampAddMonster();
            _beginthread(SwampOfPeaceTimer,0,NULL);
        }
    }
    // -------------------------------------------------------------
    void SwampOfPeaceTimer(void * lpParam)
    {
        while (true)
        {
            if (Swamp.SwampTimer == 0)
            {
                m_Message.AllServerGold("[Swamp of Peace] Medusa has taken Swamp");
                gObjDel(Swamp.SwampBossIndex);
                Swamp.SwampIsRunning = 0;
                _endthread();
            }
            if (Swamp.SwampBossKilled == 1)
            {
                m_Message.AllServerGold("[Swamp of Peace] Medusa has been defeated. Peace has returned");
                gObjDel(Swamp.SwampBossIndex);
                Swamp.SwampIsRunning = 0;
                _endthread();
            }
            Swamp.SwampTimer = Swamp.SwampTimer - 1;
            Sleep(1000);
        }
    }
    // ------------------------------------------------------------
    CalmnessEvent.h

    Código:
    //============================================================//
    //    Swamp Of Calmness Event Coded By M.E.S       //
    //                                                              //
    //============================================================//
    
    struct SwampBag
    {
        int iType;
        int iIndex;
        int iLevel;
        int iDur;
        int iLuck;
        int iSkill;
        int iOption;
        int iExc;
        int iAnc;
    };
    
    class SwampPeace
    {
    public:
        SwampPeace();
        ~SwampPeace();
        // ----
        void LoadSwampConfig();
        void LoadSwampEventItemBag();
        void SwampMonsterManager(int aIndex,int MobIndex);
        void SwampRewardItem(int aIndex);
        void SwampAddMonster();
        void SwampOfPeaceStart();
        // ----
        int SwampEnabled;
        int SwampIsRunning;
        int SwampMinutes;
        int SwampTimer;
        int SwampBossKilled;
        int SwampBossIndex;
        // ----
    }; extern SwampPeace Swamp;
    
    
    void SwampOfPeaceTimer(void * lpParam);
    Creditos:
    - M.E.S

  2. #2

    Avatar de Flint
    Data de Ingresso
    Sep 2009
    Localização
    frente do pc
    Posts
    138
    Agradecido
    27
    Agradeceu
    13
    Peso da Avaliação
    16

    Padrão

    boa improvisaçao cara...muito boa mesm...mais isso e simplesmente uma improvisaçao do skyevent pra um outro mapa^^
    bem criativo...muito bom mesm!!
    Me engravida @Renato. Hidden Content

  3. #3

    Avatar de Mr.TwoHam
    Data de Ingresso
    Sep 2009
    Localização
    Microsoft ®
    Idade
    30
    Posts
    628
    Agradecido
    36
    Agradeceu
    21
    Peso da Avaliação
    22

    Padrão

    Como funciona este evento :

    Swamp Of Calmness Event

    ??

  4. #4

    Avatar de slipkorn13
    Data de Ingresso
    Sep 2009
    Localização
    Pta Arenas, Chile
    Posts
    69
    Agradecido
    0
    Agradeceu
    0
    Peso da Avaliação
    15

    Padrão

    Como dijo Flint, es solamente una adaptacion.
    Nao es 100% original.

    PD: Flint, enviame tu MSN por MP please

  5. #5

    Avatar de [ADM]Night
    Data de Ingresso
    May 2010
    Localização
    Imperyus Games
    Idade
    28
    Posts
    114
    Agradecido
    2
    Agradeceu
    2
    Peso da Avaliação
    15

    Padrão

    ------ Build started: Project: BRSGS, Configuration: Debug Win32 ------
    Compiling...
    CalmnessEvent.cpp
    .\CalmnessEvent.cpp(35) : error C2065: 'SwampEventItemBag' : undeclared identifier
    .\CalmnessEvent.cpp(83) : error C3861: 'MonsterAddAndSpawn': identifier not found
    .\CalmnessEvent.cpp(87) : error C3861: 'MonsterAddAndSpawn': identifier not found
    .\CalmnessEvent.cpp(91) : error C3861: 'MonsterAddAndSpawn': identifier not found
    .\CalmnessEvent.cpp(95) : error C3861: 'MonsterAddAndSpawn': identifier not found
    .\CalmnessEvent.cpp(99) : error C3861: 'MonsterAddAndSpawn': identifier not found
    .\CalmnessEvent.cpp(107) : error C2065: 'm_Message' : undeclared identifier
    .\CalmnessEvent.cpp(107) : error C2228: left of '.AllServerGold' must have class/struct/union
    type is ''unknown-type''
    .\CalmnessEvent.cpp(122) : error C2065: 'm_Message' : undeclared identifier
    .\CalmnessEvent.cpp(122) : error C2228: left of '.AllServerGold' must have class/struct/union
    type is ''unknown-type''
    .\CalmnessEvent.cpp(129) : error C2065: 'm_Message' : undeclared identifier
    .\CalmnessEvent.cpp(129) : error C2228: left of '.AllServerGold' must have class/struct/union
    Deu esses erros aki poderia posta pq deu? minha source e uam base de uma outra mais respeito os creditos
    so queria testa esse evento so que deu esses erros quando deleto as .H e .CPP a dll compila certinha :S

  6. #6

    Avatar de hamiltontsz
    Data de Ingresso
    Jan 2010
    Localização
    Goiânia
    Posts
    307
    Agradecido
    5
    Agradeceu
    3
    Peso da Avaliação
    19

    Padrão

    cara no erro ja ta falano o nome que ta entre as ' e pq não ta declarado :s e so vc declara o que ele te de fase e pronto.

 

 

Informações de Tópico

Usuários Navegando neste Tópico

Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)

Tópicos Similares

  1. |8.6x| Cyra's Swamp Hunt
    Por Azhaurn no fórum Tibia | Mapas
    Respostas: 0
    Último Post: 03-02-2016, 02:54 AM
  2. |Desenvolvimento| Mu Event Logger
    Por SCOFIELD no fórum Clients
    Respostas: 0
    Último Post: 10-08-2014, 01:53 AM
  3. |Dúvida| Raklion Event
    Por Alex Faustino no fórum Dúvidas
    Respostas: 0
    Último Post: 28-05-2014, 07:08 PM
  4. [Guia] Double Goer Event (Preview) [Season 5]
    Por Poperon no fórum Tutoriais, dicas e macetes
    Respostas: 3
    Último Post: 27-10-2009, 01:39 PM

Marcadores

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •