Ir para conteúdo
Entre para seguir isso  
punkndisaster

Anti-Lure System (7.9)

Recommended Posts

punkndisaster    0
punkndisaster

Não fui eu, quem fez o code, foi o betinhobageston do otfans, só coloquei ele configurável por sqm (raio), se quiserem eu coloco também configurável por andar.

 

O svn que utilizei foi o 27/12/2006

 

vamos ao code:

 

procure por:

 

m_confInteger[OTSERV_DB_ENABLED] = getGlobalNumber(L, "otserv_db_enabled", 0);

abaixo adicione:

 

#ifdef __BB_ANTI_LURE__

    m_confInteger[SQM_LURE] = getGlobalNumber(L, "sqm", 50);

    #endif

agora procure em configmanager.h :

 

KICK_TIME,

e abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__

        SQM_LURE,

        #endif

agora em game.cpp procure por isto:

 

if(corpse){

                internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);

    creature->dropLoot(corpse->getContainer());

    startDecay(corpse);     

  	}



  	creature->die();

  	removeCreature(creature, false);

  }

abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

        if(Monster* monster = creature->getMonster())

        {

            if(monster->spawned)

            {

                monster->CheckLured();

            }

        }

        #endif

agora em monster.cpp, procure:

 

toLowerCaseString(strDescription);

abaixo adicione:

 

#ifdef __BB_ANTI_LURE__

    spawned = false;

    #endif

agora no fim do mosnter.cpp adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

bool Monster::CheckLured()

{

     int32_t antiLure;

     Player* player;

     antiLure = g_config.getNumber(ConfigManager::SQM_LURE);

     int32_t deltax = std::abs(masterPos.x - getPosition().x);

     int32_t deltay = std::abs(masterPos.y - getPosition().y);

     int32_t deltaz = std::abs(masterPos.z - getPosition().z);

     if(deltax > antiLure || deltay > antiLure || deltaz > 2)

     {//modify here the monster max distance from spawn (x, y, z)

        g_game.removeCreature(this);

        return true;

     }

return false;

}

#endif

agora em mosnter.h, em public, procure por:

 

bool canPushItems() const {return mType->canPushItems;}

e abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

    bool spawned;

    bool CheckLured();

    #endif

agora vá em spawn.cpp e procure:

 

Monster* monster = Monster::createMonster(name);

	if(monster){  

e abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

        monster->spawned = true;

        #endif

o code acabou, pra configurar vá em: Project-> Project Options(Alt+P)-> Parameters -> C++ Compiler

 

e adicione isto:

 

-D__BB_ANTI_LURE__

agora para finalizar abra seu config.lua e adicione isso em qualquer lugar:

 

--SQM spawn from luring a monster

sqm = 50

E isso o code, qualquer coisa só posta que eu tento te ajudar.

Compartilhar este post


Link para o post
punkndisaster    0
punkndisaster

Não fui eu, quem fez o code, foi o betinhobageston do otfans, só coloquei ele configurável por sqm (raio), se quiserem eu coloco também configurável por andar.

 

O svn que utilizei foi o 27/12/2006

 

vamos ao code:

 

procure por:

 

m_confInteger[OTSERV_DB_ENABLED] = getGlobalNumber(L, "otserv_db_enabled", 0);

abaixo adicione:

 

#ifdef __BB_ANTI_LURE__

    m_confInteger[SQM_LURE] = getGlobalNumber(L, "sqm", 50);

    #endif

agora procure em configmanager.h :

 

KICK_TIME,

e abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__

        SQM_LURE,

        #endif

agora em game.cpp procure por isto:

 

if(corpse){

                internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);

    creature->dropLoot(corpse->getContainer());

    startDecay(corpse);     

  	}



  	creature->die();

  	removeCreature(creature, false);

  }

abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

        if(Monster* monster = creature->getMonster())

        {

            if(monster->spawned)

            {

                monster->CheckLured();

            }

        }

        #endif

agora em monster.cpp, procure:

 

toLowerCaseString(strDescription);

abaixo adicione:

 

#ifdef __BB_ANTI_LURE__

    spawned = false;

    #endif

agora no fim do mosnter.cpp adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

bool Monster::CheckLured()

{

     int32_t antiLure;

     Player* player;

     antiLure = g_config.getNumber(ConfigManager::SQM_LURE);

     int32_t deltax = std::abs(masterPos.x - getPosition().x);

     int32_t deltay = std::abs(masterPos.y - getPosition().y);

     int32_t deltaz = std::abs(masterPos.z - getPosition().z);

     if(deltax > antiLure || deltay > antiLure || deltaz > 2)

     {//modify here the monster max distance from spawn (x, y, z)

        g_game.removeCreature(this);

        return true;

     }

return false;

}

#endif

agora em mosnter.h, em public, procure por:

 

bool canPushItems() const {return mType->canPushItems;}

e abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

    bool spawned;

    bool CheckLured();

    #endif

agora vá em spawn.cpp e procure:

 

Monster* monster = Monster::createMonster(name);

	if(monster){  

e abaixo disso adicione:

 

#ifdef __BB_ANTI_LURE__//anti-lure

        monster->spawned = true;

        #endif

o code acabou, pra configurar vá em: Project-> Project Options(Alt+P)-> Parameters -> C++ Compiler

 

e adicione isto:

 

-D__BB_ANTI_LURE__

agora para finalizar abra seu config.lua e adicione isso em qualquer lugar:

 

--SQM spawn from luring a monster

sqm = 50

E isso o code, qualquer coisa só posta que eu tento te ajudar.

Compartilhar este post


Link para o post
Jackson Zani    1
Jackson Zani

muito bom!

funcionou 100%

valeu ;)

Compartilhar este post


Link para o post
Jackson Zani    1
Jackson Zani

muito bom!

funcionou 100%

valeu ;)

Compartilhar este post


Link para o post
Nishimura    0
Nishimura

Ficou bom mesmo.

Vlw velho

 

 

50 sqm's é muito?

Compartilhar este post


Link para o post
Nishimura    0
Nishimura

Ficou bom mesmo.

Vlw velho

 

 

50 sqm's é muito?

Compartilhar este post


Link para o post
punkndisaster    0
punkndisaster

vc pode mudar no config.lua o qts sqm vc quiser, coloquei 50 sqm pra fika igual ao tibia, mas concordo q é muito mesmo.

Compartilhar este post


Link para o post
punkndisaster    0
punkndisaster

vc pode mudar no config.lua o qts sqm vc quiser, coloquei 50 sqm pra fika igual ao tibia, mas concordo q é muito mesmo.

Compartilhar este post


Link para o post
Suboras    0
Suboras

@topic

Nuss mt bom msm, vlws por tarzer para k ;)

e poderia configurar por andar e postar aki ?!?!

 

Vlws ;)

 

//Suboras

Compartilhar este post


Link para o post
punkndisaster    0
punkndisaster

ai vai o code pra andar:

 

em configmanager.cpp, depois de:

 


m_confInteger[SQM_LURE] = getGlobalNumber(L, "sqm", 50);

adicione:

 


m_confInteger[LVL_LURE] = getGlobalNumber(L, "lvl", 2);

agora em configmanager.h, depois de:

 


SQM_LURE, 

adicione:

 


LVL_LURE,

agora substitua essa função bool Monster::CheckLured(), por esta:

 


#ifdef __BB_ANTI_LURE__//anti-lure 

bool Monster::CheckLured() 

{ 

     int32_t antiLure; 

     int32_t antiLevel;

     Player* player; 

     antiLure = g_config.getNumber(ConfigManager::SQM_LURE); 

     antiLevel = g_config.getNumber(ConfigManager::LVL_LURE);

     int32_t deltax = std::abs(masterPos.x - getPosition().x); 

     int32_t deltay = std::abs(masterPos.y - getPosition().y); 

     int32_t deltaz = std::abs(masterPos.z - getPosition().z); 

     if(deltax > antiLure || deltay > antiLure || deltaz > antiLevel) 

     {//modify here the monster max distance from spawn (x, y, z) 

        g_game.removeCreature(this); 

        return true; 

     } 

return false; 

} 

#endif

agora em qualquer lugar no config.lua, adicione:

 


--Level spawn from luring a monster 

lvl = 2

Agora dê Rebuild All.

Compartilhar este post


Link para o post
Toninho    0
Toninho

aki funfou tambem 50 sqm nen axo muito e o limite do rl

bom 1 vez que eu vim nessa sessao e to muito satisfeito incremetando muita coisa no meu ot xD

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×