Назад

Отмена Альянса у гильдий

Автор: JaneAir: Дата: 01.23.2010

Англо-Руский.Ясно что не мой гайдик , но может кому-то пригодиться.
Что б неперепутали там где написано "строчку string" string - это строчка с англ)

У многих возникает такой вопрос. Как убрать альянсы вообще? Так как может кому-то на маленьком сервере они и не нужны, а кому-то на большом очень даже и нужны. Так вот напишу как можно сделать так чтоб через конфиг их можно было включать/отключать. emotionless.gif

Many have such question "How to On/Off guild alliances in general?" Because if someone have a little server it's useful, for large servers it is not needed . So, I just added to the battle config option that can On/Off guild alliance any time you want and i think it's easy way...



Пункт 1. Итак, берем в руки Notepad.exe (или что-то помощнее smile.gif ) и приступаем к редактированию сорсов.
So, take in hands Notepad.exe (or something better) and let's just modify the sources.

Пункт 2. Редактируем сорсы.
Editing sources.


Исчем:
Find:
...\src\map\guild.c

int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
{
struct guild *g[2];
int i;

if(agit_flag) { // Disable alliance creation during woe [Valaris]
clif_displaymessage(sd->fd,"Alliances cannot be made during Guild Wars!");
return 0;
} // end addition [Valaris]


nullpo_retr(0, sd);

if(tsd==NULL || tsd->status.guild_id<=0)
return 0;

g[0]=guild_search(sd->status.guild_id);
g[1]=guild_search(tsd->status.guild_id);

if(g[0]==NULL || g[1]==NULL)
return 0;

// Prevent creation alliance with same guilds [LuzZza]
if(sd->status.guild_id == tsd->status.guild_id)
return 0;

if( guild_get_alliance_count(g[0],0)>=3 ) {
clif_guild_allianceack(sd,4);
return 0;
}
if( guild_get_alliance_count(g[1],0)>=3 ) {
clif_guild_allianceack(sd,3);
return 0;
}

if( tsd->guild_alliance>0 ){
clif_guild_allianceack(sd,1);
return 0;
}

for(i=0;i if( g[0]->alliance.guild_id==tsd->status.guild_id &&
g[0]->alliance.opposition==0){
clif_guild_allianceack(sd,0);
return 0;
}
}

tsd->guild_alliance=sd->status.guild_id;
tsd->guild_alliance_account=sd->status.account_id;

clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
return 0;
}

Заменяем на: And replace by this:

int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
{
struct guild *g[2];
int i;
if(battle_config.guild_alliance_option != 0) // Enable/Disable alliance check [OH.UA]
{
if(agit_flag) { // Disable alliance creation during woe [Valaris]
clif_displaymessage(sd->fd,"Alliances cannot be made during Guild Wars!");
return 0;
} // end addition [Valaris]


nullpo_retr(0, sd);

if(tsd==NULL || tsd->status.guild_id<=0)
return 0;

g[0]=guild_search(sd->status.guild_id);
g[1]=guild_search(tsd->status.guild_id);

if(g[0]==NULL || g[1]==NULL)
return 0;

// Prevent creation alliance with same guilds [LuzZza]
if(sd->status.guild_id == tsd->status.guild_id)
return 0;

if( guild_get_alliance_count(g[0],0)>=3 ) {
clif_guild_allianceack(sd,4);
return 0;
}
if( guild_get_alliance_count(g[1],0)>=3 ) {
clif_guild_allianceack(sd,3);
return 0;
}

if( tsd->guild_alliance>0 ){
clif_guild_allianceack(sd,1);
return 0;
}

for(i=0;i if( g[0]->alliance.guild_id==tsd->status.guild_id &&
g[0]->alliance.opposition==0){
clif_guild_allianceack(sd,0);
return 0;
}
}

tsd->guild_alliance=sd->status.guild_id;
tsd->guild_alliance_account=sd->status.account_id;

clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
return 0;
}
else
{
clif_displaymessage(sd->fd,"Alliances cannot be made on this server!");
return 0;
} // end addition [OH.UA]
}

Далее находим в Find:
...\src\map\battle.h
строчку string
int homunculus_friendly_rate;

Пишем после нее такое: Add after it:
int guild_alliance_option; // [OH.UA]

Далее находим в Then find:
...\src\map\battle.c
строчку string
{ "vending_tax",                       &battle_config.vending_tax },

Пишем после нее такое: Add after it:
{ "guild_alliance_option",                    &battle_config.guild_alliance_option }, // added by [OH.UA]

Далее находим в Then find:
...\src\map\battle.c
строчку string
battle_config.homunculus_friendly_rate = 100;

Пишем после нее такое: Add afer it:
battle_config.guild_alliance_option = 1; // [OH.UA]

Далее находим в Then find:
...\conf-tmpl\battle\guild.conf
строчки
// Can the 'Glory of Guild' skill be learnt in the Guild window,
// and does changing emblems require it? (Note 1)
// P.S: This new guild skill only appears for 2004-10-25aSakexe or newer
// P.S 2: This skill is not implemented on official servers, so its only optional
require_glory_guild: no

Пишем после них такое: Add after them:
// Enable/Disable guild alliances on the server (Note 1) [OH.UA]
guild_alliance_option: 1


Пункт 3. Компилим все это дело и результат готов.

Автор: : Дата: 01.01.1970