• Registrarse
otserv

otserv


No estás conectado. Conéctate o registrate


Anti-Push Bot (Lo en contre en Mi server ni me acordaba que estaba aqui D:) Spacer10Anti-Push Bot (Lo en contre en Mi server ni me acordaba que estaba aqui D:) Spacer10
Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje [Página 1 de 1.]

Mafia.-»ENZO«Back

Mafia.-»ENZO«Back

Miembro
Funciona con TFS 0.4.| No se ha probado con TFS 0.3.x ni 0.2.X!

¿Que Es Esto?
Detecta si se está moviendo un objeto / objeto con un identificador que se encuentra en config.lua (configurable), entonces se añade un agotamiento de los X ms
(configurable). Si intenta mover un "anti-push item" (sé cómo llamarlo), entonces se dirá un mensaje de error si está agotado. Básicamente lo que hace es hacer que no funciona Anti-Push característica de bot.
Se ha añadido por defecto los siguientes items:

- 2148 (Gold Coin)
- 2152 (Platinum Coin)
- 2160 (Crystal Coin)
- 3976 (Worms)

Seguramente nadie va a tirar monedas de cristal, mientras que el empuje anti-está trabajando, pero se ha añadido por defecto, puede eliminarlo si lo desea, o añadir otros elementos, como usted prefiera.

Ok Empezemos:
Vamos a la linea 1440~ de game.cpp y remplaza esto:



       ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL);
       if(ret == RET_NOERROR)
               return true;

       player->sendCancelMessage(ret);
       return false;  


---------------------------------------


Por esto:

// Anti-Push feature Prevention System by Xampy //
   if(g_config.getBool(ConfigManager::ANTI_PUSH))
   {
       int16_t indexItem = toIndex;
       std::string antiPushItems = g_config.getString(ConfigManager::ANTI_PUSH_ITEMS);
       if(antiPushItems.size())
       {
           IntegerVec tmpVec = vectorAtoi(explodeString(antiPushItems, ","));
           if(tmpVec[0] != 0)
           {                    
               int i;
               int arraySize = tmpVec.size();
               i = 0;
               for(IntegerVec::iterator it = tmpVec.begin(); it != tmpVec.end(); ++it)
               {
                   i++;
                   if(item->getID() == uint32_t(*it) && indexItem < 1 && mapFromPos == mapToPos)
                   {
                       if(player->hasCondition(CONDITION_EXHAUST, EXHAUST_MOVE_ITEMS))
                       {
                           player->sendTextMessage(MSG_INFO_DESCR, "You cannot move this object.\nAnti-Push prevention.");
                           return false;
                       }
                       else
                       {
                           ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL);
                           if(ret == RET_NOERROR)
                           {
                                int32_t ticks = g_config.getNumber(ConfigManager::ANTI_PUSH_DELAY);
                               player->addExhaust(ticks, EXHAUST_MOVE_ITEMS);
                               return true;
                           }  
                           player->sendCancelMessage(ret);
                           return false;
                       }
                   }
                   else
                   {
                       if(arraySize == i)
                       {
                           ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL);
                           if(ret == RET_NOERROR)
                               return true;
                           player->sendCancelMessage(ret);
                           return false;
                       }
                   }
               }
           }
       }
      }
      else
      {
       ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL);
       if(ret == RET_NOERROR)
           return true;  
       player->sendCancelMessage(ret);
       return false;
   }

   return false;
// Anti-Push feature Prevention System by Xampy //  


-------------------------------------


abrimos player.h y remplazamos esto :


enum Exhaust_t
{
   EXHAUST_COMBAT = 1,
   EXHAUST_HEALING = 2
};  


--------------------



por esto


enum Exhaust_t
{
   EXHAUST_COMBAT = 1,
   EXHAUST_HEALING = 2,
   EXHAUST_MOVE_ITEMS = 3
};  


-----------------------


abirmos configmanager.ccp y despues de esto:



m_confBool[ADDONS_PREMIUM] = getGlobalBool("addonsOnlyPremium", true);


-------------------------------


Pegamos esto :


m_confBool[ANTI_PUSH] = getGlobalBool("useAntiPush", true);
   m_confNumber[ANTI_PUSH_DELAY] = getGlobalNumber("antiPushDelay", 3000);
   m_confString[ANTI_PUSH_ITEMS] = getGlobalString("antiPushItems", "");


--------------------------------}



por ultimo abrimos configmanager.h y luego de esto


ADDONS_PREMIUM,  


---------------------


Ponemso esto


ANTI_PUSH,  


-------------------------


Luego de esto :}



STAMINA_DESTROY_LOOT,  


------------------


Pegamos esto


ANTI_PUSH_DELAY,


-------------------


Luego de esto


ADMIN_ENCRYPTION_DATA,


-----------------


Ponemso esto


ANTI_PUSH_ITEMS,


--------------------


Ahora copilen su server y pegamos esto en config.lua


-- Anti-Push Prevention System by Xampy
useAntiPush = true --// enabled = true or disabled = false
antiPushDelay = 3000 --// default is 3000 (3 seconds)
antiPushItems = "2148,2152,2160,3976" --// add as much items as you want separated by comma  


-------------------------



Ahora ejecuta tu server y ya!
Estesistema está activado por defecto con 3000 ms de agotamiento.
Se ha probado, y no se encuentran errores (Nunca me dio error en mi servidor y ahora menos que loe stoy provando de neuvo)


Creditos :

Mis archivos por tener tanta tonteria que ya ni se quien me los paso :/

http://darkorbitfanart.foroactivo.mx/

Arkham

Arkham

Moderador
Se ve bueno ;)
Deberías hacer un tutorial para aprender a compilar. Para aquellos que no sepan como se hace. :D Sería una buena idea ^^

Saludos :)

Mafia.-»ENZO«Back

Mafia.-»ENZO«Back

Miembro
Hahaha Mas adelante Mi Amigo Mas adelante !

http://darkorbitfanart.foroactivo.mx/

Contenido patrocinado



Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje [Página 1 de 1.]

Permisos de este foro:
No puedes responder a temas en este foro.