#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "merc.h"
#include "interp.h"
#include "recycle.h"
#include "tables.h"
#include "lookup.h"
Include dependency graph for clan.c:

Go to the source code of this file.
Functions | |
| void | do_clan_guild (CHAR_DATA *ch, char *argument) |
| void | do_remove_leader (CHAR_DATA *ch, char *argument) |
| void | do_remove_recruiter (CHAR_DATA *ch, char *argument) |
| void | do_set_guild (CHAR_DATA *ch, char *argument) |
| void | do_set_leader (CHAR_DATA *ch, char *argument) |
| void | do_who_clan (CHAR_DATA *ch, char *argument) |
|
||||||||||||
|
Definition at line 141 of file clan.c. References char_data::clan, CLAN_REC, clan_table, get_char_world(), IS_NPC, IS_SET, clan_type::join_string, MAX_STRING_LENGTH, char_data::name, send_to_all(), and send_to_char(). 00142 {
00143
00144 if (IS_SET(ch->cclan, CLAN_REC ))
00145
00146 {
00147
00148
00149
00150
00151
00152 // char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
00153 char buf[MAX_STRING_LENGTH];
00154 CHAR_DATA *victim;
00155 //argument = one_argument (argument, arg1);
00156 //argument = one_argument (argument, arg2);
00157
00158
00159
00160 if (argument == '\0')
00161 {
00162 send_to_char ("Syntax: cguild <char> \n\r", ch);
00163 return;
00164 }
00165 if (ch->clan == 0)
00166 {
00167 send_to_char("You are not in a clan!\n\r",ch);
00168 return;
00169 }
00170
00171 if ((victim = get_char_world (ch, argument)) == NULL)
00172 {
00173 send_to_char ("They aren't playing.\n\r", ch);
00174 return;
00175 }
00176
00177 if (IS_NPC(victim))
00178 {
00179 send_to_char ("They aren't playing.\n\r",ch);
00180 return;
00181 }
00182
00183 if (victim->clan != 0)
00184 {
00185 send_to_char("They are already in a clan!\n\r",ch);
00186 return;
00187 }
00188
00189
00190
00191 /* if (!str_prefix (arg2, "none"))
00192 {
00193 send_to_char ("They are now clanless.\n\r", ch);
00194 send_to_char ("You are now a member of no clan!\n\r", victim);
00195 victim->clan = 0;
00196 return;
00197 }
00198
00199 */
00200 /*if (clan_table[clan].independent)
00201 {
00202 sprintf (buf, "They are now a %s.\n\r",ch->clan);
00203 send_to_char (buf, ch);
00204 sprintf (buf, "You are now a %s.\n\r", ch->clan);
00205 send_to_char (buf, victim);
00206 }
00207 else
00208 {
00209 sprintf (buf, "They are now a member of clan %s.\n\r",
00210 capitalize (ch->clan));
00211 send_to_char (buf, ch);
00212 sprintf (buf, "You are now a member of clan %s.\n\r",
00213 capitalize (ch->clan));
00214 }
00215 */
00216 /*sprintf (buf, "They are now a member of clan %s.\n\r",clan_table[ch->clan].who_name);
00217 send_to_char(buf,ch);
00218 sprintf (buf, "You have been guilded into %s by %s.\n\r", clan_table[ch->clan].who_name,ch->name);
00219 send_to_char(buf, victim);*/
00220 sprintf(buf, "%s %s\n\r", victim->name, clan_table[ch->clan].join_string);
00221 send_to_all("",buf);
00222
00223 victim->clan = ch->clan;
00224 return;
00225 }
00226 else
00227 {
00228 send_to_char("You are not recruiter.\n\r",ch);
00229 return;
00230 }
00231 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 320 of file clan.c. References char_data::cclan, char_data::clan, CLAN_LEADER, CLAN_REC, clan_table, get_char_world(), IS_SET, MAX_STRING_LENGTH, char_data::name, REMOVE_BIT, and send_to_char(). 00321 {
00322 CHAR_DATA *victim;
00323 char buf[MAX_STRING_LENGTH];
00324 if (ch->level < 58)
00325 {
00326 send_to_char("You must be atleast level 59 to accomplish this.\n\r",ch);
00327 return;
00328 }
00329
00330 if (argument[0]== '\0')
00331 {
00332 send_to_char("Argument - 'removeleader <who>'\n\r",ch);
00333 return;
00334 }
00335 if ((victim = get_char_world (ch, argument)) == NULL)
00336 {
00337 send_to_char("They are not playing at the moment.\n\r",ch);
00338 return;
00339 }
00340 if (victim->clan == 0)
00341 {
00342 send_to_char("They are not in a clan.\n\r",ch);
00343 return;
00344 }
00345 if (!IS_SET(victim->cclan, CLAN_LEADER))
00346 {
00347 send_to_char("They are not a clan leader.\n\r",ch);
00348 return;
00349 }
00350 if (IS_SET(victim->cclan, CLAN_LEADER))
00351 {
00352 sprintf(buf,"You are no longer a leader of %s.\n\r", clan_table[victim->clan].who_name);
00353 send_to_char(buf,victim);
00354 sprintf(buf, "%s is no longer the leader of %s.\n\r", victim->name, clan_table[victim->clan].who_name);
00355 send_to_char(buf,ch);
00356 REMOVE_BIT(victim->cclan, CLAN_LEADER);
00357 REMOVE_BIT(victim->cclan, CLAN_REC);
00358 }
00359 return;
00360 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 361 of file clan.c. References char_data::cclan, char_data::clan, CLAN_REC, clan_table, get_char_world(), IS_SET, MAX_STRING_LENGTH, char_data::name, REMOVE_BIT, and send_to_char(). 00362 {
00363 CHAR_DATA *victim;
00364 char buf[MAX_STRING_LENGTH];
00365
00366 if (ch->level < 58)
00367 {
00368 send_to_char("You must be atleast level 59 to do this.\n\r",ch);
00369 return;
00370 }
00371 if (argument[0]== '\0')
00372 {
00373 send_to_char("Argument - 'removerecruiter <who>'\n\r",ch);
00374 return;
00375 }
00376 if ((victim = get_char_world (ch, argument)) == NULL)
00377 {
00378 send_to_char("They are not playing at the moment.\n\r", ch);
00379 return;
00380 }
00381 if (!IS_SET(victim->cclan, CLAN_REC))
00382 {
00383 send_to_char("They are not a recruiter.\n\r",ch);
00384 return;
00385 }
00386 if (IS_SET(victim->cclan, CLAN_REC))
00387 {
00388 sprintf(buf, "You are no longer a recruiter for %s.\n\r", clan_table[victim->clan].who_name);
00389 send_to_char(buf,victim);
00390 sprintf(buf, "%s is not longer a recruiter for %s.\n\r", victim->name, clan_table[victim->clan].who_name);
00391 send_to_char(buf,ch);
00392 REMOVE_BIT(victim->cclan, CLAN_REC);
00393 }
00394 return;
00395
00396
00397 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 232 of file clan.c. References char_data::cclan, char_data::clan, CLAN_LEADER, CLAN_REC, clan_table, get_char_world(), IS_SET, MAX_STRING_LENGTH, char_data::name, send_to_char(), SET_BIT, and clan_type::who_name. 00233 {
00234 CHAR_DATA *victim;
00235 char buf[MAX_STRING_LENGTH];
00236 if (IS_SET(ch->cclan, CLAN_LEADER) || ch->level > 52)
00237 {
00238 if(argument == '\0')
00239 {
00240 send_to_char("Who would you like to set recruiter status to?\n\r",ch);
00241 return;
00242 }
00243 if(argument == ch->name)
00244 {
00245 send_to_char("But you can already guild!\n\r",ch);
00246 return;
00247 }
00248 if ((victim = get_char_world (ch, argument)) == NULL)
00249 {
00250 send_to_char ("They aren't playing.\n\r", ch);
00251 return;
00252 }
00253 if (victim->clan != ch->clan)
00254 {
00255 send_to_char("They are not a member of your clan.\n\r",ch);
00256 return;
00257 }
00258 SET_BIT (victim->cclan, CLAN_REC);
00259 sprintf(buf, "You are now set to guild in %s.\n\r",clan_table[ch->clan].who_name);
00260 send_to_char(buf,victim);
00261 sprintf(buf, "%s is now set to guild in %s.\n\r",victim->name, clan_table[ch->clan].who_name);
00262 send_to_char(buf,ch);
00263 }
00264 else
00265 {
00266 send_to_char("You must be a clan leader to set guild status.\n\r",ch);
00267 return;
00268 }
00269
00270
00271
00272
00273
00274
00275 return;
00276 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 277 of file clan.c. References char_data::cclan, CLAN_LEADER, clan_lookup(), CLAN_REC, clan_table, get_char_world(), MAX_INPUT_LENGTH, MAX_STRING_LENGTH, char_data::name, one_argument(), send_to_char(), SET_BIT, and clan_type::who_name. 00278 {
00279 char buf[MAX_STRING_LENGTH];
00280 CHAR_DATA *victim;
00281 char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
00282 int clan;
00283 argument = one_argument (argument, arg1);
00284 argument = one_argument (argument, arg2);
00285
00286 if (arg1[0] == '\0' || arg2[0] == '\0')
00287 {
00288 send_to_char("Syntax -- 'setleader <char> <clan>\n\r",ch);
00289 return;
00290 }
00291
00292
00293 if (ch->level < 58)
00294
00295 {
00296 send_to_char("You must be a level 58 or above immortal to accomplish this task. Sorry.\n\r",ch);
00297 return;
00298 }
00299 if ((victim = get_char_world (ch, arg1)) == NULL)
00300 {
00301 send_to_char ("They are not playing at the moment.\n\r",ch);
00302 return;
00303 }
00304 if ((clan = clan_lookup(arg2)) == 0)
00305 {
00306 send_to_char("There is no such clan.\n\r",ch);
00307 return;
00308 }
00309
00310 sprintf(buf, "You are now the leader of %s.\n\r",clan_table[clan].who_name);
00311 send_to_char(buf,victim);
00312 sprintf(buf, "%s is now the leader of %s.\n\r",victim->name, clan_table[clan].who_name);
00313 send_to_char(buf, ch);
00314 SET_BIT(victim->cclan, CLAN_LEADER);
00315 SET_BIT(victim->cclan, CLAN_REC);
00316
00317
00318 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 19 of file clan.c. References add_buf(), buf_string(), can_see(), char_data::cclan, descriptor_data::character, char_data::clan, CLAN_LEADER, clan_lookup(), CLAN_REC, clan_table, CON_PLAYING, descriptor_data::connected, descriptor_list, FALSE, free_buf(), is_number(), IS_SET, char_data::level, MAX_CLAN, MAX_LEVEL, MAX_PC_RACE, MAX_STRING_LENGTH, char_data::name, new_buf(), descriptor_data::next, one_argument(), descriptor_data::original, page_to_char(), pc_race_table, char_data::race, send_to_char(), str_prefix(), and TRUE. 00020 {
00021 DESCRIPTOR_DATA *d;
00022 char buf[MAX_STRING_LENGTH];
00023 char buf2[MAX_STRING_LENGTH];
00024 CHAR_DATA *victim;
00025 BUFFER *buffer;
00026 int numchar;
00027 bool rgfClan[MAX_CLAN];
00028 register int iClan;
00029 bool fClanRestrict = FALSE;
00030 int nNumber;
00031 int iLevelLower;
00032 int iLevelUpper;
00033 bool fLeader;
00034 bool fRecruiter;
00035 int clan;
00036 int space;
00037 iLevelLower = 0;
00038 iLevelUpper = MAX_LEVEL;
00039 fLeader = FALSE;
00040 fRecruiter = FALSE;
00041 for (iClan = 0; iClan < MAX_CLAN; iClan++)
00042 rgfClan[iClan] = FALSE;
00043
00044 nNumber = 0;
00045 for ( ;; )
00046 {
00047 char arg[MAX_STRING_LENGTH];
00048
00049 argument = one_argument( argument, arg );
00050 if ( arg[0] == '\0' )
00051 break;
00052
00053 if ( is_number( arg ) )
00054 {
00055 switch ( ++nNumber )
00056 {
00057 case 1: iLevelLower = atoi( arg ); break;
00058 case 2: iLevelUpper = atoi( arg ); break;
00059 default:
00060 send_to_char( "Only two level numbers allowed.\n\r", ch );
00061 return;
00062 }
00063 }
00064 else
00065 {
00066 if (!str_prefix(arg,"leader"))
00067 fLeader = TRUE;
00068 else if (!str_prefix(arg, "recruiter"))
00069 fRecruiter = TRUE;
00070 else
00071 {
00072 iClan = clan_lookup(arg);
00073
00074 if (iClan)
00075 {
00076 fClanRestrict = TRUE;
00077 rgfClan[iClan] = TRUE;
00078 }
00079 else
00080 {
00081 send_to_char("That's not a valid race, class, clan, or kingdom.\n\r",ch);
00082 return;
00083 }
00084 }
00085 }
00086 }
00087
00088 buffer = new_buf();
00089 numchar=0;
00090 for (d=descriptor_list;d;d=d->next)
00091 {
00092
00093 if ( d->connected != CON_PLAYING || !can_see( ch, d->character ) )
00094 continue;
00095
00096 victim = ( d->original != NULL ) ? d->original : d->character;
00097
00098
00099 if (victim->clan == 0)
00100 {
00101 continue;
00102 }
00103
00104 clan = victim->clan;
00105 buf[0] = '\0';
00106 buf2[0] = '\0';
00107 sprintf(buf, "[%2d %6s] ",
00108 victim->level,
00109 victim->race < MAX_PC_RACE ? pc_race_table[victim->race].who_name: "");
00110
00111
00112 sprintf(buf2,"%-16s", clan_table[victim->clan].who_name);
00113 space = (20 - strlen(buf2));
00114 for( ; space > 0;space--)
00115 {
00116 strcat(buf2, " ");
00117 }
00118 strcat(buf,buf2);
00119 sprintf(buf2,"%-11s %-9s%-9s\n\r",
00120 victim->name, IS_SET (victim->cclan, CLAN_LEADER) ? "({WLEADER{x) " : " ",
00121 IS_SET (victim->cclan, CLAN_REC) ? "({WRECRUITER{x) " : "");
00122 strcat(buf,buf2);
00123
00124 add_buf(buffer,buf);
00125 numchar++;
00126
00127 }
00128
00129 sprintf(buf, "Total: %d.\n\r",numchar);
00130 add_buf(buffer,buf);
00131 page_to_char(buf_string(buffer),ch);
00132 free_buf(buffer);
00133 return;
00134 }
|
Here is the call graph for this function:

1.4.0