Skip to content

Commit

Permalink
* Config Updates:
Browse files Browse the repository at this point in the history
- Changes 'emblem_woe_change' to 'disable_change_emblem' & added some options
- Added 'create_guild' to enable/disable guild creation by player.
- Added 'break_guild' to enable/disable break a guild by player.
- Added 'disable_invite' to enable/disable guild invitation by player.
- Added 'disable_expel' to enable/disable guild expulsion by player.

* Script Command Updates:
- Added 'guild_info' to retrieve specified guild information from a given guild (name or ID)
- Added 'guild_create' to create a new guild. (Ignore 'create_guild' config value)
- Added 'guild_addmember' to add new member to a guild. (Ignore 'disable_invite' config value)
- Added 'guild_delmember' to remove/kick/expel a guild member from a guild. (Ignore 'guild_expel' config value)
- Added 'guild_changegm' to change guild master from a guild.
- Added 'guild_break' to break a guild. Like @breakguild or /breakguild, guild must be empty first. (Ignore 'break_guild' config value)

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
  • Loading branch information
cydh committed Aug 31, 2014
1 parent ea1a247 commit 4832808
Show file tree
Hide file tree
Showing 12 changed files with 592 additions and 83 deletions.
9 changes: 7 additions & 2 deletions conf/battle/client.conf
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,13 @@ client_reshuffle_dice: yes
// NOTE: Enabling this option degrades performance.
client_sort_storage: no

// Do we allow to change guilde emblem during woe_time?
emblem_woe_change: yes
// Disable guild emblem changes? (bitmask)
// 0: Enable
// 1: Disable on WOE time
// 2: Disable at GVG map (mapflag gvg)
// 4: Disable at Castle (mapflag gvg_castle)
// 8: Disable when not WOE, outside GVG, & Castle
disable_change_emblem: no

// How many transparent pixel can be found in emblem before detected as invalid? (Note 2)
emblem_transparency_limit: 80
Expand Down
32 changes: 32 additions & 0 deletions conf/battle/guild.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,35 @@ max_guild_alliance: 3
// Upon changing maps: 1
// Do not re-display: 0 (disabled)
guild_notice_changemap: 2

// Allow to create a new guild (bitmask)
// 0: Disable
// 1: Enable via client
// 2: Enable via atcommand
create_guild: 3

// Allow to break guild (bitmask)
// 0: Disable
// 1: Enable via client
// 2: Enable via atcommand
break_guild: 3

// Disable guild invitation?
// -1: (default) Disable when inside the castle during WOE time
// 0: Enable
// or bitmask of
// 1: Disable during WOE time
// 2: Disable at GVG map (mapflag gvg)
// 4: Disable at Castle (mapflag gvg_castle)
// 8: Disable when not WOE, outside GVG, & Castle
disable_invite: -1

// Disable expel member?
// -1: (default) Disable when inside the castle during WOE time
// 0: Enable
// or bitmask of
// 1: Disable during WOE time
// 2: Disable at GVG map (mapflag gvg)
// 4: Disable at Castle (mapflag gvg_castle)
// 8: Disable when not WOE, outside GVG, & Castle
disable_expel: -1
13 changes: 12 additions & 1 deletion conf/msg_conf/map_msg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,18 @@
737: '%s' (%d) cannot be cloned, limit (%d).
738: Clone '%s' is done.

//739-899 free
// @who. Show party/Guild ID
739: (ID: %d)

// Guild Config
740: Guild creation is disabled.
741: Guild cannot be disbanded.
742: Guild invitation is disabled.
743: Cannot expel guild member in current state.
744: Not allowed to change guild emblem in current state.
745: You have been joined to guild [%s].

//746-899 free

//------------------------------------
// More atcommands message
Expand Down
13 changes: 12 additions & 1 deletion conf/msg_conf/map_msg_idn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,18 @@
737: Status '%s' (%d) tidak dapat ditiru, batas status (%d).
738: Kloning '%s' selesai.

//739-899 kosong
// @who. Menampilkan ID Guild/Party
739: (ID: %d)

// Guild Config
740: Tidak dapat membuat guild baru.
741: Tidak dapat membubarkan guild.
742: Tidak dapat mengajak seseorang bergabung.
743: Tidak dapat mengeluarkan anggota dari guild.
744: Tidak dapat memngubah lambang guild saat ini.
745: Kamu telah dimasukkan ke dalam guild [%s].

//746-899 kosong

//------------------------------------
// Pesan dalam perintah atcommand
Expand Down
58 changes: 58 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,64 @@ Example:

mes "You have "+getMapGuildUsers("prontera",getcharid(2))+" guild members in Prontera.";

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

*guild_info(<guild_id>,<type>)
*guild_info("<guild_id>",<type>)

Get guild information by given 'type':
0: If guild_id used, returns "guild name" or "" if not found.
If "guild name" used, returns guild_id or -1 if not found
1: Guild level
2: Connected member
3: Max members
4: Average member level
5: Allies number. Also $@guildallies_id[] & $@guildallies_name$[] array for Ally IDs & Names
6: Enemy number. Also $@guildenemies_id[] & $@guildenemies_name$[] array for Enemy IDs & Names
7: Castles. Also $@guildcastles_id[] & $@guildcastles_name$[] array for Castle IDs & Names

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

*guild_create("<name>"{,<char_id>})

Create a new guild and makes 'char_id' or invoker as guild master.
Return 1 if attempt to creates new guild is success, 0 otherwise.

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

*guild_addmember(<guild_id>{,<char_id>})

Attempt to add new member to guild with 'guild_id'. If 'char_id' is not given
it will adds invoker to the guild.
Return 1 if attempt to adds new member is success, 0 otherwise.

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

*guild_delmember <char_id>{,"<message>"{,<guild_id>,<account_id>}}

Expel player from a guild. If player is currently online, 'guild_id' and 'account_id'
value will be ignored. If player is currenly offline, 'guild_id' and 'account_id'
must be filled and valid.

Return 1 if attempt to removes player from a guild is success, 0 otherwise.

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

*guild_changegm(<guild_id>,<char_id>)

Changes guild master to 'char_id'. The player must be online and in same guild.
Return 1 if attempt to changes guild master is success, 0 otherwise.

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

*guild_break({<guild_id>})

Breaks a guild by given 'guild_id' or invoker's guild.
Guild members must be removed first like breaking a guild by using /breakguild
or @breakguild.
Return 1 if attempt to breaks guild is success, 0 otherwise.


---------------------------------------
//
2,2.- End of guild-related commands
Expand Down
19 changes: 17 additions & 2 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,16 @@ ACMD_FUNC(who) {
StringBuf_Printf(&buf, msg_txt(sd,343), pl_sd->status.name); // "Name: %s "
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
StringBuf_Printf(&buf, msg_txt(sd,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
if (p != NULL)
if (p != NULL) {
StringBuf_Printf(&buf, msg_txt(sd,345), p->party.name); // " | Party: '%s'"
if (g != NULL)
if (pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
StringBuf_Printf(&buf, msg_txt(sd,739), pl_sd->status.party_id); // " (ID:)"
}
if (g != NULL) {
StringBuf_Printf(&buf, msg_txt(sd,346), g->name); // " | Guild: '%s'"
if (pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
StringBuf_Printf(&buf, msg_txt(sd,739), pl_sd->status.guild_id); // " (ID:)"
}
break;
}
}
Expand Down Expand Up @@ -3360,6 +3366,11 @@ ACMD_FUNC(guild)

memset(guild, '\0', sizeof(guild));

if (!(battle_config.guild_create&2)) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd, 740));
return -1;
}

if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) {
clif_displaymessage(fd, msg_txt(sd,1030)); // Please enter a guild name (usage: @guild <guild_name>).
return -1;
Expand All @@ -3379,6 +3390,10 @@ ACMD_FUNC(breakguild)

if (sd->status.guild_id) { // Check if the player has a guild
struct guild *g;
if (!(battle_config.guild_break&2)) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd, 741));
return -1;
}
g = sd->guild; // Search the guild
if (g) { // Check if guild was found
if (sd->state.gmaster_flag) { // Check if player is guild master
Expand Down
9 changes: 7 additions & 2 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -7719,6 +7719,7 @@ static const struct _battle_data {
{ "bg_magic_attack_damage_rate", &battle_config.bg_magic_damage_rate, 60, 0, INT_MAX, },
{ "bg_misc_attack_damage_rate", &battle_config.bg_misc_damage_rate, 60, 0, INT_MAX, },
{ "bg_flee_penalty", &battle_config.bg_flee_penalty, 20, 0, INT_MAX, },

/**
* rAthena
**/
Expand Down Expand Up @@ -7761,8 +7762,12 @@ static const struct _battle_data {
{ "vip_gemstone", &battle_config.vip_gemstone, 0, 0, 1, },
{ "vip_disp_rate", &battle_config.vip_disp_rate, 1, 0, 1, },
{ "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, },
{ "homunculus_S_growth_level", &battle_config.hom_S_growth_level, 99, 0, MAX_LEVEL, },
{ "emblem_woe_change", &battle_config.emblem_woe_change, 0, 0, 1, },
{ "homunculus_S_growth_level", &battle_config.hom_S_growth_level, 99, 0, MAX_LEVEL, },
{ "create_guild", &battle_config.guild_create, 3, 0, 3, },
{ "break_guild", &battle_config.guild_break, 3, 0, 3, },
{ "disable_invite", &battle_config.guild_disable_invite, -1, -1, 15, },
{ "disable_expel", &battle_config.guild_disable_expel, -1, -1, 15, },
{ "disable_change_emblem", &battle_config.guild_disable_change_emblem, 0, 0, 15, },
{ "emblem_transparency_limit", &battle_config.emblem_transparency_limit, 80, 0, 100, },
{ "discount_item_point_shop", &battle_config.discount_item_point_shop, 0, 0, 3, },
{ "update_enemy_position", &battle_config.update_enemy_position, 0, 0, 1, },
Expand Down
6 changes: 5 additions & 1 deletion src/map/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,11 @@ extern struct Battle_Config
int vip_exp_penalty_job;
int vip_disp_rate;
int mon_trans_disable_in_gvg;
int emblem_woe_change;
int guild_disable_change_emblem;
int guild_create;
int guild_break;
int guild_disable_invite;
int guild_disable_expel;
int emblem_transparency_limit;
int discount_item_point_shop;
int update_enemy_position;
Expand Down
27 changes: 23 additions & 4 deletions src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -12490,11 +12490,16 @@ void clif_parse_CreateGuild(int fd,struct map_session_data *sd){
char* name = (char*)RFIFOP(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
name[NAME_LENGTH-1] = '\0';

if(map[sd->bl.m].flag.guildlock) { //Guild locked.
if (map[sd->bl.m].flag.guildlock) { //Guild locked.
clif_displaymessage(fd, msg_txt(sd,228));
return;
}

if (!(battle_config.guild_create&1)) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd, 740));
return;
}

guild_create(sd, name);
}

Expand Down Expand Up @@ -12640,9 +12645,19 @@ void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd){
if( !emblem_len || !sd->state.gmaster_flag )
return;

if(!(battle_config.emblem_woe_change) && (agit_flag || agit2_flag) ){
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,385)); //"You not allowed to change emblem during woe"
return;
if (battle_config.guild_disable_change_emblem) {
if (battle_config.guild_disable_change_emblem&1 && (agit_flag || agit2_flag) ){
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,385)); //"You not allowed to change emblem during woe"
return;
}
if ( (battle_config.guild_disable_change_emblem&2 && map[sd->bl.m].flag.gvg) // Disable at GVG
|| (battle_config.guild_disable_change_emblem&4 && map[sd->bl.m].flag.gvg_castle) // Disable at Castle
|| (battle_config.guild_disable_change_emblem&8 && (!map[sd->bl.m].flag.gvg ||!map[sd->bl.m].flag.gvg_castle || !(agit_flag || agit2_flag))) // Disable at normal condition
)
{
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,744));
return;
}
}
emb_val = clif_validate_emblem(emblem, emblem_len);
if(emb_val ==-1 ){
Expand Down Expand Up @@ -12906,6 +12921,10 @@ void clif_parse_GuildBreak(int fd, struct map_session_data *sd)
clif_displaymessage(fd, msg_txt(sd,228));
return;
}
if (!(battle_config.guild_break&1)) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd, 741));
return;
}
guild_break(sd,(char*)RFIFOP(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]));
}

Expand Down

0 comments on commit 4832808

Please sign in to comment.