|
@@ -597,7 +597,7 @@ ACMD_FUNC(who)
|
|
}
|
|
}
|
|
default: {
|
|
default: {
|
|
struct party_data *p = party_search(pl_sd->status.party_id);
|
|
struct party_data *p = party_search(pl_sd->status.party_id);
|
|
- struct guild *g = guild_search(pl_sd->status.guild_id);
|
|
|
|
|
|
+ struct guild *g = pl_sd->guild;
|
|
|
|
|
|
StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s "
|
|
StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s "
|
|
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
|
|
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
|
|
@@ -700,7 +700,7 @@ ACMD_FUNC(whogm)
|
|
clif_displaymessage(fd, atcmd_output);
|
|
clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
p = party_search(pl_sd->status.party_id);
|
|
p = party_search(pl_sd->status.party_id);
|
|
- g = guild_search(pl_sd->status.guild_id);
|
|
|
|
|
|
+ g = pl_sd->guild;
|
|
|
|
|
|
sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s'
|
|
sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s'
|
|
p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None.
|
|
p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None.
|
|
@@ -3244,7 +3244,7 @@ ACMD_FUNC(breakguild)
|
|
|
|
|
|
if (sd->status.guild_id) { // Check if the player has a guild
|
|
if (sd->status.guild_id) { // Check if the player has a guild
|
|
struct guild *g;
|
|
struct guild *g;
|
|
- g = guild_search(sd->status.guild_id); // Search the guild
|
|
|
|
|
|
+ g = sd->guild; // Search the guild
|
|
if (g) { // Check if guild was found
|
|
if (g) { // Check if guild was found
|
|
if (sd->state.gmaster_flag) { // Check if player is guild master
|
|
if (sd->state.gmaster_flag) { // Check if player is guild master
|
|
int ret = 0;
|
|
int ret = 0;
|
|
@@ -5246,7 +5246,7 @@ ACMD_FUNC(cleargstorage)
|
|
struct guild_storage *gstorage;
|
|
struct guild_storage *gstorage;
|
|
nullpo_retr(-1, sd);
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- g = guild_search(sd->status.guild_id);
|
|
|
|
|
|
+ g = sd->guild;
|
|
|
|
|
|
if (g == NULL) {
|
|
if (g == NULL) {
|
|
clif_displaymessage(fd, msg_txt(43));
|
|
clif_displaymessage(fd, msg_txt(43));
|
|
@@ -6163,7 +6163,7 @@ ACMD_FUNC(npctalk)
|
|
snprintf(temp, sizeof(temp), "%s : %s", name, mes);
|
|
snprintf(temp, sizeof(temp), "%s : %s", name, mes);
|
|
|
|
|
|
if(ifcolor) clif_messagecolor(&nd->bl,color,temp);
|
|
if(ifcolor) clif_messagecolor(&nd->bl,color,temp);
|
|
- else clif_message(&nd->bl, temp);
|
|
|
|
|
|
+ else clif_disp_overhead(&nd->bl, temp);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -6227,7 +6227,7 @@ ACMD_FUNC(pettalk)
|
|
}
|
|
}
|
|
|
|
|
|
snprintf(temp, sizeof temp ,"%s : %s", pd->pet.name, mes);
|
|
snprintf(temp, sizeof temp ,"%s : %s", pd->pet.name, mes);
|
|
- clif_message(&pd->bl, temp);
|
|
|
|
|
|
+ clif_disp_overhead(&pd->bl, temp);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -7017,7 +7017,7 @@ ACMD_FUNC(homtalk)
|
|
}
|
|
}
|
|
|
|
|
|
snprintf(temp, sizeof temp ,"%s : %s", sd->hd->homunculus.name, mes);
|
|
snprintf(temp, sizeof temp ,"%s : %s", sd->hd->homunculus.name, mes);
|
|
- clif_message(&sd->hd->bl, temp);
|
|
|
|
|
|
+ clif_disp_overhead(&sd->hd->bl, temp);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -7399,7 +7399,7 @@ ACMD_FUNC(me)
|
|
}
|
|
}
|
|
|
|
|
|
sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s*
|
|
sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s*
|
|
- clif_disp_overhead(sd, atcmd_output);
|
|
|
|
|
|
+ clif_disp_overhead(&sd->bl, atcmd_output);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
@@ -7944,58 +7944,6 @@ ACMD_FUNC(clone)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-/*===================================
|
|
|
|
- * Main chat [LuzZza]
|
|
|
|
- * Usage: @main <on|off|message>
|
|
|
|
- *-----------------------------------*/
|
|
|
|
-ACMD_FUNC(main)
|
|
|
|
-{
|
|
|
|
- if( message[0] ) {
|
|
|
|
-
|
|
|
|
- if(strcmpi(message, "on") == 0) {
|
|
|
|
- if(!sd->state.mainchat) {
|
|
|
|
- sd->state.mainchat = 1;
|
|
|
|
- clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
|
|
|
|
- } else {
|
|
|
|
- clif_displaymessage(fd, msg_txt(381)); // Main chat already activated.
|
|
|
|
- }
|
|
|
|
- } else if(strcmpi(message, "off") == 0) {
|
|
|
|
- if(sd->state.mainchat) {
|
|
|
|
- sd->state.mainchat = 0;
|
|
|
|
- clif_displaymessage(fd, msg_txt(382)); // Main chat has been disabled.
|
|
|
|
- } else {
|
|
|
|
- clif_displaymessage(fd, msg_txt(383)); // Main chat already disabled.
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if(!sd->state.mainchat) {
|
|
|
|
- sd->state.mainchat = 1;
|
|
|
|
- clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
|
|
|
|
- }
|
|
|
|
- if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) {
|
|
|
|
- clif_displaymessage(fd, msg_txt(387));
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if ( battle_config.min_chat_delay ) {
|
|
|
|
- if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 )
|
|
|
|
- return 0;
|
|
|
|
- sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // send the message using inter-server system
|
|
|
|
- intif_main_message( sd, message );
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- if(sd->state.mainchat)
|
|
|
|
- clif_displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
|
|
|
|
- else
|
|
|
|
- clif_displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
|
|
|
|
- }
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*=====================================
|
|
/*=====================================
|
|
* Autorejecting Invites/Deals [LuzZza]
|
|
* Autorejecting Invites/Deals [LuzZza]
|
|
* Usage: @noask
|
|
* Usage: @noask
|
|
@@ -8796,6 +8744,300 @@ ACMD_FUNC(cart) {
|
|
#undef MC_CART_MDFY
|
|
#undef MC_CART_MDFY
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* Channel System [Ind] */
|
|
|
|
+ACMD_FUNC(join) {
|
|
|
|
+ struct raChSysCh *channel;
|
|
|
|
+ char name[RACHSYS_NAME_LENGTH], pass[RACHSYS_NAME_LENGTH];
|
|
|
|
+ DBMap* channel_db = clif_get_channel_db();
|
|
|
|
+
|
|
|
|
+ if( !message || !*message || sscanf(message, "%s %s", name, pass) < 1 ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1399),command); // Unknown Channel (usage: %s <#channel_name>)
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ if( raChSys.local && strcmpi(name + 1, raChSys.local_name) == 0 ) {
|
|
|
|
+ if( !map[sd->bl.m].channel ) {
|
|
|
|
+ clif_chsys_mjoin(sd);
|
|
|
|
+ return 0;
|
|
|
|
+ } else
|
|
|
|
+ channel = map[sd->bl.m].channel;
|
|
|
|
+ } else if( raChSys.ally && sd->status.guild_id && strcmpi(name + 1, raChSys.ally_name) == 0 ) {
|
|
|
|
+ struct guild *g = sd->guild;
|
|
|
|
+ if( !g ) return -1;/* unlikely, but we wont let it crash anyway. */
|
|
|
|
+ channel = (struct raChSysCh *)g->channel;
|
|
|
|
+ } else if( !( channel = strdb_get(channel_db, name + 1) ) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>)
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( idb_exists(channel->users, sd->status.char_id) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1434),name); // You're already in the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ if( channel->pass[0] != '\0' && strcmp(channel->pass,pass) != 0 ) {
|
|
|
|
+ if( pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ) {
|
|
|
|
+ sd->stealth = true;
|
|
|
|
+ } else {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1401),name,command); // '%s' Channel is password protected (usage: %s <#channel_name> <password>)
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( !( channel->opt & raChSys_OPT_ANNOUNCE_JOIN ) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1403),name); // You're now in the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ clif_chsys_join(channel,sd);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+inline void atcmd_channel_help(int fd, const char *command, bool can_create) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1414));// ---- Available options:
|
|
|
|
+ if( can_create ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1415),command);// * %s create <#channel_name> <channel_password>
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1416));// -- Creates a new channel.
|
|
|
|
+ }
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1417),command);// * %s list
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1418));// -- Lists all public channels.
|
|
|
|
+ if( can_create ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1419),command);// * %s list colors
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1420));// -- Lists all available colors for custom channels.
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1421),command);// * %s setcolor <#channel_name> <color_name>
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1422));// -- Changes channel text to the specified color (channel owners only).
|
|
|
|
+ }
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1423),command);// * %s leave <#channel_name>
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1424));// -- Leaves the specified channel.
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1427),command);// * %s bindto <#channel_name>
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1428));// -- Binds your global chat to the specified channel, sending all global messages to that channel.
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1429),command);// * %s unbind
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1430));// -- Unbinds your global chat from the attached channel, if any.
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1404),command); // %s failed.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+ACMD_FUNC(channel) {
|
|
|
|
+ struct raChSysCh *channel;
|
|
|
|
+ char key[RACHSYS_NAME_LENGTH], sub1[RACHSYS_NAME_LENGTH], sub2[RACHSYS_NAME_LENGTH], sub3[RACHSYS_NAME_LENGTH];
|
|
|
|
+ unsigned char k = 0;
|
|
|
|
+ DBMap* channel_db = clif_get_channel_db();
|
|
|
|
+ sub1[0] = sub2[0] = sub3[0] = '\0';
|
|
|
|
+
|
|
|
|
+ if( !message || !*message || sscanf(message, "%s %s %s %s", key, sub1, sub2, sub3) < 1 ) {
|
|
|
|
+ atcmd_channel_help(fd,command,( raChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ));
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( strcmpi(key,"create") == 0 && ( raChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ) ) {
|
|
|
|
+ if( sub1[0] != '#' ) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1405));// Channel name must start with '#'.
|
|
|
|
+ return -1;
|
|
|
|
+ } else if ( strlen(sub1) < 3 || strlen(sub1) > RACHSYS_NAME_LENGTH ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1406), RACHSYS_NAME_LENGTH);// Channel length must be between 3 and %d.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ } else if ( sub3[0] != '\0' ) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1408)); // Channel password may not contain spaces.
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ if( strcmpi(sub1 + 1,raChSys.local_name) == 0 || strcmpi(sub1 + 1,raChSys.ally_name) == 0 || strdb_exists(channel_db, sub1 + 1) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ CREATE( channel, struct raChSysCh, 1 );
|
|
|
|
+
|
|
|
|
+ clif_chsys_create(channel,sub1 + 1,sub2,0);
|
|
|
|
+
|
|
|
|
+ channel->owner = sd->status.char_id;
|
|
|
|
+ channel->type = raChSys_PRIVATE;
|
|
|
|
+
|
|
|
|
+ if( !( channel->opt & raChSys_OPT_ANNOUNCE_JOIN ) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1403),sub1); // You're now in the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ clif_chsys_join(channel,sd);
|
|
|
|
+
|
|
|
|
+ } else if ( strcmpi(key,"list") == 0 ) {
|
|
|
|
+ if( sub1[0] != '\0' && strcmpi(sub1,"colors") == 0 ) {
|
|
|
|
+ char mout[40];
|
|
|
|
+ for( k = 0; k < raChSys.colors_count; k++ ) {
|
|
|
|
+ unsigned short msg_len = 1;
|
|
|
|
+ msg_len += sprintf(mout, "[ %s list colors ] : %s",command,raChSys.colors_name[k]);
|
|
|
|
+
|
|
|
|
+ WFIFOHEAD(fd,msg_len + 12);
|
|
|
|
+ WFIFOW(fd,0) = 0x2C1;
|
|
|
|
+ WFIFOW(fd,2) = msg_len + 12;
|
|
|
|
+ WFIFOL(fd,4) = 0;
|
|
|
|
+ WFIFOL(fd,8) = raChSys.colors[k];
|
|
|
|
+ safestrncpy((char*)WFIFOP(fd,12), mout, msg_len);
|
|
|
|
+ WFIFOSET(fd, msg_len + 12);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ DBIterator *iter = db_iterator(channel_db);
|
|
|
|
+ bool show_all = pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ? true : false;
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1410)); // ---- Public Channels ----
|
|
|
|
+ if( raChSys.local ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1409), raChSys.local_name, map[sd->bl.m].channel ? db_size(map[sd->bl.m].channel->users) : 0);// - #%s ( %d users )
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ }
|
|
|
|
+ if( raChSys.ally && sd->status.guild_id ) {
|
|
|
|
+ struct guild *g = sd->guild;
|
|
|
|
+ if( !g ) return -1;
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1409), raChSys.ally_name, db_size(((struct raChSysCh *)g->channel)->users));// - #%s ( %d users )
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ }
|
|
|
|
+ for(channel = dbi_first(iter); dbi_exists(iter); channel = dbi_next(iter)) {
|
|
|
|
+ if( show_all || channel->type == raChSys_PUBLIC ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1409), channel->name, db_size(channel->users));// - #%s (%d users)
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dbi_destroy(iter);
|
|
|
|
+ }
|
|
|
|
+ } else if ( strcmpi(key,"setcolor") == 0 ) {
|
|
|
|
+
|
|
|
|
+ if( sub1[0] != '#' ) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1405));// Channel name must start with '#'.
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( !(channel = strdb_get(channel_db, sub1 + 1)) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for( k = 0; k < raChSys.colors_count; k++ ) {
|
|
|
|
+ if( strcmpi(sub2,raChSys.colors_name[k]) == 0 )
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if( k == raChSys.colors_count ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1411), sub2);// Unknown color '%s'.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ channel->color = k;
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1413),sub1,raChSys.colors_name[k]);// '%s' channel color updated to '%s'.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ } else if ( strcmpi(key,"leave") == 0 ) {
|
|
|
|
+
|
|
|
|
+ if( sub1[0] != '#' ) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1405));// Channel name must start with '#'.
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for(k = 0; k < sd->channel_count; k++) {
|
|
|
|
+ if( strcmpi(sub1+1,sd->channels[k]->name) == 0 )
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if( k == sd->channel_count ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1425),sub1);// You're not part of the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ clif_chsys_left(sd->channels[k],sd);
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1426),sub1); // You've left the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ } else if ( strcmpi(key,"bindto") == 0 ) {
|
|
|
|
+
|
|
|
|
+ if( sub1[0] != '#' ) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1405));// Channel name must start with '#'.
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for(k = 0; k < sd->channel_count; k++) {
|
|
|
|
+ if( strcmpi(sub1+1,sd->channels[k]->name) == 0 )
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if( k == sd->channel_count ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1425),sub1);// You're not part of the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sd->gcbind = sd->channels[k];
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1431),sub1); // Your global chat is now binded to the '%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ } else if ( strcmpi(key,"unbind") == 0 ) {
|
|
|
|
+
|
|
|
|
+ if( sd->gcbind == NULL ) {
|
|
|
|
+ clif_displaymessage(fd, msg_txt(1432));// Your global chat is not binded to any channel.
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1433),sd->gcbind->name); // Your global chat is now unbinded from the '#%s' channel.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+
|
|
|
|
+ sd->gcbind = NULL;
|
|
|
|
+ } else {
|
|
|
|
+ atcmd_channel_help(fd,command,( raChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+/* debug only, delete after */
|
|
|
|
+ACMD_FUNC(fontcolor) {
|
|
|
|
+ unsigned char k;
|
|
|
|
+
|
|
|
|
+ if( !message || !*message ) {
|
|
|
|
+ char mout[40];
|
|
|
|
+ for( k = 0; k < raChSys.colors_count; k++ ) {
|
|
|
|
+ unsigned short msg_len = 1;
|
|
|
|
+ msg_len += sprintf(mout, "[ %s ] : %s",command,raChSys.colors_name[k]);
|
|
|
|
+
|
|
|
|
+ WFIFOHEAD(fd,msg_len + 12);
|
|
|
|
+ WFIFOW(fd,0) = 0x2C1;
|
|
|
|
+ WFIFOW(fd,2) = msg_len + 12;
|
|
|
|
+ WFIFOL(fd,4) = 0;
|
|
|
|
+ WFIFOL(fd,8) = raChSys.colors[k];
|
|
|
|
+ safestrncpy((char*)WFIFOP(fd,12), mout, msg_len);
|
|
|
|
+ WFIFOSET(fd, msg_len + 12);
|
|
|
|
+ }
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( message[0] == '0' ) {
|
|
|
|
+ sd->fontcolor = 0;
|
|
|
|
+ pc_disguise(sd,0);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for( k = 0; k < raChSys.colors_count; k++ ) {
|
|
|
|
+ if( strcmpi(message,raChSys.colors_name[k]) == 0 )
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if( k == raChSys.colors_count ) {
|
|
|
|
+ sprintf(atcmd_output, msg_txt(1411), message);// Unknown color '%s'.
|
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sd->fontcolor = k + 1;
|
|
|
|
+ pc_disguise(sd,sd->status.class_);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Fills the reference of available commands in atcommand DBMap
|
|
* Fills the reference of available commands in atcommand DBMap
|
|
**/
|
|
**/
|
|
@@ -9008,7 +9250,6 @@ void atcommand_basecommands(void) {
|
|
ACMD_DEF(leave),
|
|
ACMD_DEF(leave),
|
|
ACMD_DEF(accept),
|
|
ACMD_DEF(accept),
|
|
ACMD_DEF(reject),
|
|
ACMD_DEF(reject),
|
|
- ACMD_DEF(main),
|
|
|
|
ACMD_DEF(clone),
|
|
ACMD_DEF(clone),
|
|
ACMD_DEF2("slaveclone", clone),
|
|
ACMD_DEF2("slaveclone", clone),
|
|
ACMD_DEF2("evilclone", clone),
|
|
ACMD_DEF2("evilclone", clone),
|
|
@@ -9056,7 +9297,10 @@ void atcommand_basecommands(void) {
|
|
ACMD_DEF2("rmvperm", addperm),
|
|
ACMD_DEF2("rmvperm", addperm),
|
|
ACMD_DEF(unloadnpcfile),
|
|
ACMD_DEF(unloadnpcfile),
|
|
ACMD_DEF(cart),
|
|
ACMD_DEF(cart),
|
|
- ACMD_DEF(mount2)
|
|
|
|
|
|
+ ACMD_DEF(mount2),
|
|
|
|
+ ACMD_DEF(join),
|
|
|
|
+ ACMD_DEF(channel),
|
|
|
|
+ ACMD_DEF(fontcolor)
|
|
};
|
|
};
|
|
AtCommandInfo* atcommand;
|
|
AtCommandInfo* atcommand;
|
|
int i;
|
|
int i;
|