ServersMU - Comunidad

Zona Programadores => Sources => Mensaje iniciado por: Applayo en Abril 02, 2021, 12:27:25 pm

Título: [Sources] Announce Chaos Mix (v2)
Publicado por: Applayo en Abril 02, 2021, 12:27:25 pm
(https://i.imgur.com/fHzK7gt.png)

Season 6

Find in [b]ServerInfo.h[/b]

long m_AnnounceChaosMix;
char m_AnnounceChaosMixText[50];


[s]Replace to[/s]:

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 [b]ServerInfo.cpp[/b]

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


and [s]replace to[/s]:


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 [b]User.h[/b] and [s]replace to[/s]:


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 [b]User.cpp[/b] and [s]replace to[/s]:


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 [b]ChaosBox.cpp[/b] and [s]replace to[/s]:


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 [b]GameServer - Custom.dat[/b] find these lines

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

and [s]replace to[/s]:

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


Good luck in your development!

Credits: Emershow
Título: Re: [Sources] Announce Chaos Mix (v2)
Publicado por: rototo en Abril 04, 2021, 10:10:37 pm
Justo lo que estaba buscando!
Título: Re: [Sources] Announce Chaos Mix (v2)
Publicado por: robins1998 en Mayo 27, 2021, 02:46:18 am
Very helpful, thanks for sharing.