Autor Tema: [Sources] Announce Chaos Mix (v2)  (Leído 7175 veces)

Applayo

  • Newbie
  • *
  • Mensajes: 40
  • : 2
  • Applayo
    • Ver Perfil
[Sources] Announce Chaos Mix (v2)
« en: Abril 02, 2021, 12:27:25 pm »


Season 6

[hide post=2 login=1]Find in ServerInfo.h

long m_AnnounceChaosMix;
char m_AnnounceChaosMixText[50];


Replace to:

long m_AnnounceChaosMix10;
   long m_AnnounceChaosMix11;
   long m_AnnounceChaosMix12;
   long m_AnnounceChaosMix13;
   long m_AnnounceChaosMix14;
   long m_AnnounceChaosMix15;
   char m_AnnounceChaosMix10Text[50];
   char m_AnnounceChaosMix11Text[50];
   char m_AnnounceChaosMix12Text[50];
   char m_AnnounceChaosMix13Text[50];
   char m_AnnounceChaosMix14Text[50];
   char m_AnnounceChaosMix15Text[50];


Find in ServerInfo.cpp

this->m_AnnounceChaosMix   = GetPrivateProfileInt(section,"AnnounceChaosMix",0,path);


and replace to:


   this->m_AnnounceChaosMix10   = GetPrivateProfileInt(section,"AnnounceChaosMix10",0,path);
   this->m_AnnounceChaosMix11   = GetPrivateProfileInt(section,"AnnounceChaosMix11",0,path);
   this->m_AnnounceChaosMix12   = GetPrivateProfileInt(section,"AnnounceChaosMix12",0,path);
   this->m_AnnounceChaosMix13   = GetPrivateProfileInt(section,"AnnounceChaosMix13",0,path);
   this->m_AnnounceChaosMix14   = GetPrivateProfileInt(section,"AnnounceChaosMix14",0,path);
   this->m_AnnounceChaosMix15   = GetPrivateProfileInt(section,"AnnounceChaosMix15",0,path);


do the same as GetPrivateProfileString(section,"AnnounceChaosMixText","",this->m_AnnounceChaosMixText,sizeof(this->m_AnnounceChaosMixText),path);

   GetPrivateProfileString(section,"AnnounceChaosMix10Text","",this->m_AnnounceChaosMix10Text,sizeof(this->m_AnnounceChaosMix10Text),path);
   GetPrivateProfileString(section,"AnnounceChaosMix11Text","",this->m_AnnounceChaosMix11Text,sizeof(this->m_AnnounceChaosMix11Text),path);
   GetPrivateProfileString(section,"AnnounceChaosMix12Text","",this->m_AnnounceChaosMix12Text,sizeof(this->m_AnnounceChaosMix12Text),path);
   GetPrivateProfileString(section,"AnnounceChaosMix13Text","",this->m_AnnounceChaosMix13Text,sizeof(this->m_AnnounceChaosMix13Text),path);
   GetPrivateProfileString(section,"AnnounceChaosMix14Text","",this->m_AnnounceChaosMix14Text,sizeof(this->m_AnnounceChaosMix14Text),path);
   GetPrivateProfileString(section,"AnnounceChaosMix15Text","",this->m_AnnounceChaosMix15Text,sizeof(this->m_AnnounceChaosMix15Text),path);


Find void gObjCustomLogPlusChaosMix(LPOBJ lpObj,int type,int index); in User.h and replace to:


void gObjCustomLogPlusChaosMix10(LPOBJ lpObj,int type,int index);
void gObjCustomLogPlusChaosMix11(LPOBJ lpObj,int type,int index);
void gObjCustomLogPlusChaosMix12(LPOBJ lpObj,int type,int index);
void gObjCustomLogPlusChaosMix13(LPOBJ lpObj,int type,int index);
void gObjCustomLogPlusChaosMix14(LPOBJ lpObj,int type,int index);
void gObjCustomLogPlusChaosMix15(LPOBJ lpObj,int type,int index);


Find function void gObjCustomLogPlusChaosMix(LPOBJ lpObj,int type,int index) in User.cpp and replace to:


void gObjCustomLogPlusChaosMix10(LPOBJ lpObj,int type,int index)
{
   #if(GAMESERVER_UPDATE>=501)

   if(type != 0)
   {
      return;
   }

   #else

   if(type != 3)
   {
      return;
   }

   #endif

   if(gServerInfo.m_AnnounceChaosMix10 != 0)
   {
      ITEM_INFO ItemInfo;

      if(gItemManager.GetInfo(index,&ItemInfo) != 0)
      {
         char buff[256];

         wsprintf(buff,gServerInfo.m_AnnounceChaosMix10Text,lpObj->Name,ItemInfo.Name);

         if(gServerInfo.m_AnnounceChaosMix10 == 1)
         {
            gNotice.GCNoticeSendToAll(0,0,0,0,0,0,buff);
         }
         else
         {
            GDGlobalNoticeSend(gMapServerManager.GetMapServerGroup(),0,0,0,0,0,0,buff);
         }
      }
   }
}

void gObjCustomLogPlusChaosMix11(LPOBJ lpObj,int type,int index)
{
   #if(GAMESERVER_UPDATE>=501)

   if(type != 1)
   {
      return;
   }

   #else

   if(type != 3)
   {
      return;
   }

   #endif

   if(gServerInfo.m_AnnounceChaosMix11 != 0)
   {
      ITEM_INFO ItemInfo;

      if(gItemManager.GetInfo(index,&ItemInfo) != 0)
      {
         char buff[256];

         wsprintf(buff,gServerInfo.m_AnnounceChaosMix11Text,lpObj->Name,ItemInfo.Name);

         if(gServerInfo.m_AnnounceChaosMix11 == 1)
         {
            gNotice.GCNoticeSendToAll(0,0,0,0,0,0,buff);
         }
         else
         {
            GDGlobalNoticeSend(gMapServerManager.GetMapServerGroup(),0,0,0,0,0,0,buff);
         }
      }
   }
}

void gObjCustomLogPlusChaosMix12(LPOBJ lpObj,int type,int index)
{
   #if(GAMESERVER_UPDATE>=501)

   if(type != 2)
   {
      return;
   }

   #else

   if(type != 3)
   {
      return;
   }

   #endif

   if(gServerInfo.m_AnnounceChaosMix12 != 0)
   {
      ITEM_INFO ItemInfo;

      if(gItemManager.GetInfo(index,&ItemInfo) != 0)
      {
         char buff[256];

         wsprintf(buff,gServerInfo.m_AnnounceChaosMix12Text,lpObj->Name,ItemInfo.Name);

         if(gServerInfo.m_AnnounceChaosMix12 == 1)
         {
            gNotice.GCNoticeSendToAll(0,0,0,0,0,0,buff);
         }
         else
         {
            GDGlobalNoticeSend(gMapServerManager.GetMapServerGroup(),0,0,0,0,0,0,buff);
         }
      }
   }
}

void gObjCustomLogPlusChaosMix13(LPOBJ lpObj,int type,int index)
{
   #if(GAMESERVER_UPDATE>=501)

   if(type != 3)
   {
      return;
   }

   #else

   if(type != 3)
   {
      return;
   }

   #endif

   if(gServerInfo.m_AnnounceChaosMix13 != 0)
   {
      ITEM_INFO ItemInfo;

      if(gItemManager.GetInfo(index,&ItemInfo) != 0)
      {
         char buff[256];

         wsprintf(buff,gServerInfo.m_AnnounceChaosMix13Text,lpObj->Name,ItemInfo.Name);

         if(gServerInfo.m_AnnounceChaosMix13 == 1)
         {
            gNotice.GCNoticeSendToAll(0,0,0,0,0,0,buff);
         }
         else
         {
            GDGlobalNoticeSend(gMapServerManager.GetMapServerGroup(),0,0,0,0,0,0,buff);
         }
      }
   }
}

void gObjCustomLogPlusChaosMix14(LPOBJ lpObj,int type,int index)
{
   #if(GAMESERVER_UPDATE>=501)

   if(type != 4)
   {
      return;
   }

   #else

   if(type != 3)
   {
      return;
   }

   #endif

   if(gServerInfo.m_AnnounceChaosMix14 != 0)
   {
      ITEM_INFO ItemInfo;

      if(gItemManager.GetInfo(index,&ItemInfo) != 0)
      {
         char buff[256];

         wsprintf(buff,gServerInfo.m_AnnounceChaosMix14Text,lpObj->Name,ItemInfo.Name);

         if(gServerInfo.m_AnnounceChaosMix14 == 1)
         {
            gNotice.GCNoticeSendToAll(0,0,0,0,0,0,buff);
         }
         else
         {
            GDGlobalNoticeSend(gMapServerManager.GetMapServerGroup(),0,0,0,0,0,0,buff);
         }
      }
   }
}

void gObjCustomLogPlusChaosMix15(LPOBJ lpObj,int type,int index)
{
   #if(GAMESERVER_UPDATE>=501)

   if(type != 5)
   {
      return;
   }

   #else

   if(type != 3)
   {
      return;
   }

   #endif

   if(gServerInfo.m_AnnounceChaosMix15 != 0)
   {
      ITEM_INFO ItemInfo;

      if(gItemManager.GetInfo(index,&ItemInfo) != 0)
      {
         char buff[256];

         wsprintf(buff,gServerInfo.m_AnnounceChaosMix15Text,lpObj->Name,ItemInfo.Name);

         if(gServerInfo.m_AnnounceChaosMix15 == 1)
         {
            gNotice.GCNoticeSendToAll(0,0,0,0,0,0,buff);
         }
         else
         {
            GDGlobalNoticeSend(gMapServerManager.GetMapServerGroup(),0,0,0,0,0,0,buff);
         }
      }
   }
}


Find gObjCustomLogPlusChaosMix(lpObj,type,item.m_Index); in ChaosBox.cpp and replace to:


gObjCustomLogPlusChaosMix10(lpObj,type,item.m_Index);

      gObjCustomLogPlusChaosMix11(lpObj,type,item.m_Index);

      gObjCustomLogPlusChaosMix12(lpObj,type,item.m_Index);

      gObjCustomLogPlusChaosMix13(lpObj,type,item.m_Index);

      gObjCustomLogPlusChaosMix14(lpObj,type,item.m_Index);

      gObjCustomLogPlusChaosMix15(lpObj,type,item.m_Index);


Finnaly go to GameServer - Custom.dat find these lines

AnnounceChaosMix = 0
AnnounceChaosMixText = %s put the item %s +15

and replace to:

AnnounceChaosMix10 = 1
AnnounceChaosMix11 = 1
AnnounceChaosMix12 = 1
AnnounceChaosMix13 = 1
AnnounceChaosMix14 = 1
AnnounceChaosMix15 = 1
AnnounceChaosMix10Text = %s put the item %s +10
AnnounceChaosMix11Text = %s put the item %s +11
AnnounceChaosMix12Text = %s put the item %s +12
AnnounceChaosMix13Text = %s put the item %s +13
AnnounceChaosMix14Text = %s put the item %s +14
AnnounceChaosMix15Text = %s put the item %s +15
[/hide]

Good luck in your development!

Credits: Emershow
« Última modificación: Abril 02, 2021, 01:28:53 pm por Applayo »

rototo

  • Newbie
  • *
  • Mensajes: 7
  • : 2
    • Ver Perfil
Re: [Sources] Announce Chaos Mix (v2)
« Respuesta #1 en: Abril 04, 2021, 10:10:37 pm »
Justo lo que estaba buscando!

robins1998

  • Newbie
  • *
  • Mensajes: 40
  • : 0
    • Ver Perfil
Re: [Sources] Announce Chaos Mix (v2)
« Respuesta #2 en: Mayo 27, 2021, 02:46:18 am »
Very helpful, thanks for sharing.