#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "merc.h"
#include "mob_cmds.h"
Include dependency graph for mob_cmds.c:

Go to the source code of this file.
Functions | |
| DECLARE_DO_FUN (do_look) | |
| void | do_mob (CHAR_DATA *ch, char *argument) |
| void | do_mpasound (CHAR_DATA *ch, char *argument) |
| void | do_mpassist (CHAR_DATA *ch, char *argument) |
| void | do_mpat (CHAR_DATA *ch, char *argument) |
| void | do_mpcall (CHAR_DATA *ch, char *argument) |
| void | do_mpcancel (CHAR_DATA *ch, char *argument) |
| void | do_mpcast (CHAR_DATA *ch, char *argument) |
| void | do_mpdamage (CHAR_DATA *ch, char *argument) |
| void | do_mpdelay (CHAR_DATA *ch, char *argument) |
| void | do_mpdump (CHAR_DATA *ch, char *argument) |
| void | do_mpecho (CHAR_DATA *ch, char *argument) |
| void | do_mpechoaround (CHAR_DATA *ch, char *argument) |
| void | do_mpechoat (CHAR_DATA *ch, char *argument) |
| void | do_mpflee (CHAR_DATA *ch, char *argument) |
| void | do_mpforce (CHAR_DATA *ch, char *argument) |
| void | do_mpforget (CHAR_DATA *ch, char *argument) |
| void | do_mpgecho (CHAR_DATA *ch, char *argument) |
| void | do_mpgforce (CHAR_DATA *ch, char *argument) |
| void | do_mpgoto (CHAR_DATA *ch, char *argument) |
| void | do_mpgtransfer (CHAR_DATA *ch, char *argument) |
| void | do_mpjunk (CHAR_DATA *ch, char *argument) |
| void | do_mpkill (CHAR_DATA *ch, char *argument) |
| void | do_mpmload (CHAR_DATA *ch, char *argument) |
| void | do_mpoload (CHAR_DATA *ch, char *argument) |
| void | do_mpotransfer (CHAR_DATA *ch, char *argument) |
| void | do_mppurge (CHAR_DATA *ch, char *argument) |
| void | do_mpremember (CHAR_DATA *ch, char *argument) |
| void | do_mpremove (CHAR_DATA *ch, char *argument) |
| void | do_mpstat (CHAR_DATA *ch, char *argument) |
| void | do_mptransfer (CHAR_DATA *ch, char *argument) |
| void | do_mpvforce (CHAR_DATA *ch, char *argument) |
| void | do_mpzecho (CHAR_DATA *ch, char *argument) |
| ROOM_INDEX_DATA * | find_location (CHAR_DATA *, char *) |
| void | mob_interpret (CHAR_DATA *ch, char *argument) |
| char * | mprog_type_to_name (int type) |
Variables | |
| const struct mob_cmd_type | mob_cmd_table [] |
|
|
|
|
||||||||||||
|
Definition at line 82 of file mob_cmds.c. References get_trust(), MAX_LEVEL, and mob_interpret(). 00083 {
00084 /*
00085 * Security check!
00086 */
00087 if (ch->desc != NULL && get_trust (ch) < MAX_LEVEL)
00088 return;
00089 mob_interpret (ch, argument);
00090 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 315 of file mob_cmds.c. References act, room_index_data::exit, FALSE, MOBtrigger, TO_ROOM, exit_data::to_room, TRUE, and exit_data::u1. 00316 {
00317
00318 ROOM_INDEX_DATA *was_in_room;
00319 int door;
00320
00321 if (argument[0] == '\0')
00322 return;
00323
00324 was_in_room = ch->in_room;
00325 for (door = 0; door < 10; door++)
00326 {
00327 EXIT_DATA *pexit;
00328
00329 if ((pexit = was_in_room->exit[door]) != NULL
00330 && pexit->u1.to_room != NULL && pexit->u1.to_room != was_in_room)
00331 {
00332 ch->in_room = pexit->u1.to_room;
00333 MOBtrigger = FALSE;
00334 act (argument, ch, NULL, NULL, TO_ROOM);
00335 MOBtrigger = TRUE;
00336 }
00337 }
00338 ch->in_room = was_in_room;
00339 return;
00340
00341 }
|
|
||||||||||||
|
Definition at line 380 of file mob_cmds.c. References char_data::fighting, get_char_room(), MAX_INPUT_LENGTH, multi_hit(), one_argument(), and TYPE_UNDEFINED. 00381 {
00382 char arg[MAX_INPUT_LENGTH];
00383 CHAR_DATA *victim;
00384
00385 one_argument (argument, arg);
00386
00387 if (arg[0] == '\0')
00388 return;
00389
00390 if ((victim = get_char_room (ch, arg)) == NULL)
00391 return;
00392
00393 if (victim == ch || ch->fighting != NULL || victim->fighting == NULL)
00394 return;
00395
00396 multi_hit (ch, victim->fighting, TYPE_UNDEFINED);
00397 return;
00398 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 719 of file mob_cmds.c. References bug(), char_from_room(), char_list, char_to_room(), find_location(), interpret(), IS_NPC, MAX_INPUT_LENGTH, char_data::next, obj_data::on, one_argument(), and original. 00720 {
00721 char arg[MAX_INPUT_LENGTH];
00722 ROOM_INDEX_DATA *location;
00723 ROOM_INDEX_DATA *original;
00724 CHAR_DATA *wch;
00725 OBJ_DATA *on;
00726
00727 argument = one_argument (argument, arg);
00728
00729 if (arg[0] == '\0' || argument[0] == '\0')
00730 {
00731 bug ("Mpat - Bad argument from vnum %d.",
00732 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00733 return;
00734 }
00735
00736 if ((location = find_location (ch, arg)) == NULL)
00737 {
00738 bug ("Mpat - No such location from vnum %d.",
00739 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00740 return;
00741 }
00742
00743 original = ch->in_room;
00744 on = ch->on;
00745 char_from_room (ch);
00746 char_to_room (ch, location);
00747 interpret (ch, argument);
00748
00749 /*
00750 * See if 'ch' still exists before continuing!
00751 * Handles 'at XXXX quit' case.
00752 */
00753 for (wch = char_list; wch != NULL; wch = wch->next)
00754 {
00755 if (wch == ch)
00756 {
00757 char_from_room (ch);
00758 char_to_room (ch, original);
00759 ch->on = on;
00760 break;
00761 }
00762 }
00763
00764 return;
00765 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1217 of file mob_cmds.c. References bug(), mprog_code::code, get_char_room(), get_mprog_index(), get_obj_here(), IS_NPC, MAX_INPUT_LENGTH, one_argument(), program_flow(), and mprog_code::vnum. 01218 {
01219 char arg[MAX_INPUT_LENGTH];
01220 CHAR_DATA *vch;
01221 OBJ_DATA *obj1, *obj2;
01222 MPROG_CODE *prg;
01223 extern void program_flow ( int vnum, char *, CHAR_DATA *, CHAR_DATA *,
01224 const void *, const void *);
01225
01226 argument = one_argument (argument, arg);
01227 if (arg[0] == '\0')
01228 {
01229 bug ("MpCall: missing arguments from vnum %d.",
01230 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01231 return;
01232 }
01233 if ((prg = get_mprog_index (atoi (arg))) == NULL)
01234 {
01235 bug ("MpCall: invalid prog from vnum %d.",
01236 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01237 return;
01238 }
01239 vch = NULL;
01240 obj1 = obj2 = NULL;
01241 argument = one_argument (argument, arg);
01242 if (arg[0] != '\0')
01243 vch = get_char_room (ch, arg);
01244 argument = one_argument (argument, arg);
01245 if (arg[0] != '\0')
01246 obj1 = get_obj_here (ch, arg);
01247 argument = one_argument (argument, arg);
01248 if (arg[0] != '\0')
01249 obj2 = get_obj_here (ch, arg);
01250 program_flow (prg->vnum, prg->code, ch, vch, (void *) obj1,
01251 (void *) obj2);
01252 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1202 of file mob_cmds.c. References char_data::mprog_delay. 01203 {
01204 ch->mprog_delay = -1;
01205 }
|
|
||||||||||||
|
Definition at line 1017 of file mob_cmds.c. References bug(), get_char_room(), get_obj_here(), IS_NPC, MAX_INPUT_LENGTH, one_argument(), skill_lookup(), skill_table, skill_type::spell_fun, TAR_CHAR_DEFENSIVE, TAR_CHAR_OFFENSIVE, TAR_CHAR_SELF, TAR_IGNORE, TAR_OBJ_CHAR_DEF, TAR_OBJ_CHAR_OFF, TAR_OBJ_INV, and skill_type::target. 01018 {
01019 CHAR_DATA *vch;
01020 OBJ_DATA *obj;
01021 void *victim = NULL;
01022 char spell[MAX_INPUT_LENGTH], target[MAX_INPUT_LENGTH];
01023 int sn;
01024
01025 argument = one_argument (argument, spell);
01026 one_argument (argument, target);
01027
01028 if (spell[0] == '\0')
01029 {
01030 bug ("MpCast - Bad syntax from vnum %d.",
01031 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01032 return;
01033 }
01034
01035 if ((sn = skill_lookup (spell)) < 0)
01036 {
01037 bug ("MpCast - No such spell from vnum %d.",
01038 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01039 return;
01040 }
01041 vch = get_char_room (ch, target);
01042 obj = get_obj_here (ch, target);
01043 switch (skill_table[sn].target)
01044 {
01045 default:
01046 return;
01047 case TAR_IGNORE:
01048 break;
01049 case TAR_CHAR_OFFENSIVE:
01050 if (vch == NULL || vch == ch)
01051 return;
01052 victim = (void *) vch;
01053 break;
01054 case TAR_CHAR_DEFENSIVE:
01055 victim = vch == NULL ? (void *) ch : (void *) vch;
01056 break;
01057 case TAR_CHAR_SELF:
01058 victim = (void *) ch;
01059 break;
01060 case TAR_OBJ_CHAR_DEF:
01061 case TAR_OBJ_CHAR_OFF:
01062 case TAR_OBJ_INV:
01063 if (obj == NULL)
01064 return;
01065 victim = (void *) obj;
01066 }
01067 (*skill_table[sn].spell_fun) (sn, ch->level, ch, victim,
01068 skill_table[sn].target);
01069 return;
01070 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1078 of file mob_cmds.c. References bug(), DAM_NONE, damage(), FALSE, get_char_room(), char_data::hit, char_data::in_room, IS_NPC, is_number(), MAX_INPUT_LENGTH, char_data::next_in_room, number_range(), one_argument(), room_index_data::people, str_cmp(), TRUE, TYPE_UNDEFINED, and UMIN. 01079 {
01080 CHAR_DATA *victim = NULL, *victim_next;
01081 char target[MAX_INPUT_LENGTH],
01082 min[MAX_INPUT_LENGTH], max[MAX_INPUT_LENGTH];
01083 int low, high;
01084 bool fAll = FALSE, fKill = FALSE;
01085
01086 argument = one_argument (argument, target);
01087 argument = one_argument (argument, min);
01088 argument = one_argument (argument, max);
01089
01090 if (target[0] == '\0')
01091 {
01092 bug ("MpDamage - Bad syntax from vnum %d.",
01093 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01094 return;
01095 }
01096 if (!str_cmp (target, "all"))
01097 fAll = TRUE;
01098 else if ((victim = get_char_room (ch, target)) == NULL)
01099 return;
01100
01101 if (is_number (min))
01102 low = atoi (min);
01103 else
01104 {
01105 bug ("MpDamage - Bad damage min vnum %d.",
01106 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01107 return;
01108 }
01109 if (is_number (max))
01110 high = atoi (max);
01111 else
01112 {
01113 bug ("MpDamage - Bad damage max vnum %d.",
01114 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01115 return;
01116 }
01117 one_argument (argument, target);
01118
01119 /*
01120 * If kill parameter is omitted, this command is "safe" and will not
01121 * kill the victim.
01122 */
01123
01124 if (target[0] != '\0')
01125 fKill = TRUE;
01126 if (fAll)
01127 {
01128 for (victim = ch->in_room->people; victim; victim = victim_next)
01129 {
01130 victim_next = victim->next_in_room;
01131 if (victim != ch)
01132 damage (victim, victim,
01133 fKill ?
01134 number_range (low, high) : UMIN (victim->hit,
01135 number_range (low,
01136 high)),
01137 TYPE_UNDEFINED, DAM_NONE, FALSE);
01138 }
01139 }
01140 else
01141 damage (victim, victim,
01142 fKill ?
01143 number_range (low, high) : UMIN (victim->hit,
01144 number_range (low, high)),
01145 TYPE_UNDEFINED, DAM_NONE, FALSE);
01146 return;
01147 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1183 of file mob_cmds.c. References bug(), IS_NPC, is_number(), MAX_INPUT_LENGTH, char_data::mprog_delay, and one_argument(). 01184 {
01185 char arg[MAX_INPUT_LENGTH];
01186
01187 one_argument (argument, arg);
01188 if (!is_number (arg))
01189 {
01190 bug ("MpDelay: invalid arg from vnum %d.",
01191 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01192 return;
01193 }
01194 ch->mprog_delay = atoi (arg);
01195 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 235 of file mob_cmds.c. References mprog_code::code, get_mprog_index(), MAX_INPUT_LENGTH, one_argument(), page_to_char(), and send_to_char(). 00236 {
00237 char buf[MAX_INPUT_LENGTH];
00238 MPROG_CODE *mprg;
00239
00240 one_argument (argument, buf);
00241 if ((mprg = get_mprog_index (atoi (buf))) == NULL)
00242 {
00243 send_to_char ("No such MOBprogram.\n\r", ch);
00244 return;
00245 }
00246 page_to_char (mprg->code, ch);
00247 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 496 of file mob_cmds.c. 00497 {
00498 if (argument[0] == '\0')
00499 return;
00500 act (argument, ch, NULL, NULL, TO_ROOM);
00501 }
|
|
||||||||||||
|
Definition at line 454 of file mob_cmds.c. References act, get_char_room(), MAX_INPUT_LENGTH, one_argument(), and TO_NOTVICT. 00455 {
00456 char arg[MAX_INPUT_LENGTH];
00457 CHAR_DATA *victim;
00458
00459 argument = one_argument (argument, arg);
00460
00461 if (arg[0] == '\0')
00462 return;
00463
00464 if ((victim = get_char_room (ch, arg)) == NULL)
00465 return;
00466
00467 act (argument, ch, NULL, victim, TO_NOTVICT);
00468 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 475 of file mob_cmds.c. References act, get_char_room(), MAX_INPUT_LENGTH, one_argument(), and TO_VICT. 00476 {
00477 char arg[MAX_INPUT_LENGTH];
00478 CHAR_DATA *victim;
00479
00480 argument = one_argument (argument, arg);
00481
00482 if (arg[0] == '\0' || argument[0] == '\0')
00483 return;
00484
00485 if ((victim = get_char_room (ch, arg)) == NULL)
00486 return;
00487
00488 act (argument, ch, NULL, victim, TO_VICT);
00489 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1260 of file mob_cmds.c. References EX_CLOSED, room_index_data::exit, exit_data::exit_info, FALSE, IS_NPC, IS_SET, move_char(), number_door(), room_index_data::room_flags, ROOM_NO_MOB, exit_data::to_room, and exit_data::u1. 01261 {
01262 ROOM_INDEX_DATA *was_in;
01263 EXIT_DATA *pexit;
01264 int door, attempt;
01265
01266 if (ch->fighting != NULL)
01267 return;
01268
01269 if ((was_in = ch->in_room) == NULL)
01270 return;
01271
01272 for (attempt = 0; attempt < 9; attempt++)
01273 {
01274 door = number_door ();
01275 if ((pexit = was_in->exit[door]) == 0
01276 || pexit->u1.to_room == NULL
01277 || IS_SET (pexit->exit_info, EX_CLOSED) || (IS_NPC (ch)
01278 && IS_SET (pexit->
01279 u1.to_room->room_flags,
01280 ROOM_NO_MOB)))
01281 continue;
01282
01283 move_char (ch, door, FALSE);
01284 if (ch->in_room != was_in)
01285 return;
01286 }
01287 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 886 of file mob_cmds.c. References bug(), can_see(), char_list, get_char_room(), get_trust(), char_data::in_room, interpret(), IS_NPC, MAX_INPUT_LENGTH, char_data::next, one_argument(), and str_cmp(). 00887 {
00888 char arg[MAX_INPUT_LENGTH];
00889
00890 argument = one_argument (argument, arg);
00891
00892 if (arg[0] == '\0' || argument[0] == '\0')
00893 {
00894 bug ("Mpforce - Bad syntax from vnum %d.",
00895 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00896 return;
00897 }
00898
00899 if (!str_cmp (arg, "all"))
00900 {
00901 CHAR_DATA *vch;
00902 CHAR_DATA *vch_next;
00903
00904 for (vch = char_list; vch != NULL; vch = vch_next)
00905 {
00906 vch_next = vch->next;
00907
00908 if (vch->in_room == ch->in_room
00909 && get_trust (vch) < get_trust (ch) && can_see (ch, vch))
00910 {
00911 interpret (vch, argument);
00912 }
00913 }
00914 }
00915 else
00916 {
00917 CHAR_DATA *victim;
00918
00919 if ((victim = get_char_room (ch, arg)) == NULL)
00920 return;
00921
00922 if (victim == ch)
00923 return;
00924
00925 interpret (victim, argument);
00926 }
00927
00928 return;
00929 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1171 of file mob_cmds.c. References char_data::mprog_target. 01172 {
01173 ch->mprog_target = NULL;
01174 }
|
|
||||||||||||
|
Definition at line 254 of file mob_cmds.c. References bug(), descriptor_data::character, CON_PLAYING, descriptor_data::connected, descriptor_list, IS_IMMORTAL, IS_NPC, descriptor_data::next, and send_to_char(). 00255 {
00256 DESCRIPTOR_DATA *d;
00257
00258 if (argument[0] == '\0')
00259 {
00260 bug ("MpGEcho: missing argument from vnum %d",
00261 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00262 return;
00263 }
00264
00265 for (d = descriptor_list; d; d = d->next)
00266 {
00267 if (d->connected == CON_PLAYING)
00268 {
00269 if (IS_IMMORTAL (d->character))
00270 send_to_char ("Mob echo> ", d->character);
00271 send_to_char (argument, d->character);
00272 send_to_char ("\n\r", d->character);
00273 }
00274 }
00275 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 936 of file mob_cmds.c. References bug(), get_char_room(), char_data::in_room, interpret(), IS_NPC, is_same_group(), MAX_INPUT_LENGTH, char_data::next_in_room, one_argument(), and room_index_data::people. 00937 {
00938 char arg[MAX_INPUT_LENGTH];
00939 CHAR_DATA *victim, *vch, *vch_next;
00940
00941 argument = one_argument (argument, arg);
00942
00943 if (arg[0] == '\0' || argument[0] == '\0')
00944 {
00945 bug ("MpGforce - Bad syntax from vnum %d.",
00946 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00947 return;
00948 }
00949
00950 if ((victim = get_char_room (ch, arg)) == NULL)
00951 return;
00952
00953 if (victim == ch)
00954 return;
00955
00956 for (vch = victim->in_room->people; vch != NULL; vch = vch_next)
00957 {
00958 vch_next = vch->next_in_room;
00959
00960 if (is_same_group (victim, vch))
00961 {
00962 interpret (vch, argument);
00963 }
00964 }
00965 return;
00966 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 685 of file mob_cmds.c. References bug(), char_from_room(), char_to_room(), find_location(), IS_NPC, MAX_INPUT_LENGTH, one_argument(), stop_fighting(), and TRUE. 00686 {
00687 char arg[MAX_INPUT_LENGTH];
00688 ROOM_INDEX_DATA *location;
00689
00690 one_argument (argument, arg);
00691 if (arg[0] == '\0')
00692 {
00693 bug ("Mpgoto - No argument from vnum %d.",
00694 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00695 return;
00696 }
00697
00698 if ((location = find_location (ch, arg)) == NULL)
00699 {
00700 bug ("Mpgoto - No such location from vnum %d.",
00701 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00702 return;
00703 }
00704
00705 if (ch->fighting != NULL)
00706 stop_fighting (ch, TRUE);
00707
00708 char_from_room (ch);
00709 char_to_room (ch, location);
00710
00711 return;
00712 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 848 of file mob_cmds.c. References bug(), do_mptransfer(), get_char_room(), char_data::in_room, IS_NPC, is_same_group(), MAX_INPUT_LENGTH, MAX_STRING_LENGTH, char_data::name, char_data::next_in_room, one_argument(), and room_index_data::people. 00849 {
00850 char arg1[MAX_INPUT_LENGTH];
00851 char arg2[MAX_INPUT_LENGTH];
00852 char buf[MAX_STRING_LENGTH];
00853 CHAR_DATA *who, *victim, *victim_next;
00854
00855 argument = one_argument (argument, arg1);
00856 argument = one_argument (argument, arg2);
00857
00858 if (arg1[0] == '\0')
00859 {
00860 bug ("Mpgtransfer - Bad syntax from vnum %d.",
00861 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00862 return;
00863 }
00864
00865 if ((who = get_char_room (ch, arg1)) == NULL)
00866 return;
00867
00868 for (victim = ch->in_room->people; victim; victim = victim_next)
00869 {
00870 victim_next = victim->next_in_room;
00871 if (is_same_group (who, victim))
00872 {
00873 sprintf (buf, "%s %s", victim->name, arg2);
00874 do_mptransfer (ch, buf);
00875 }
00876 }
00877 return;
00878 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 409 of file mob_cmds.c. References extract_obj(), get_obj_carry(), get_obj_wear(), is_name(), MAX_INPUT_LENGTH, obj_data::name, obj_data::next_content, one_argument(), str_cmp(), str_prefix(), unequip_char(), obj_data::wear_loc, and WEAR_NONE. 00410 {
00411 char arg[MAX_INPUT_LENGTH];
00412 OBJ_DATA *obj;
00413 OBJ_DATA *obj_next;
00414
00415 one_argument (argument, arg);
00416
00417 if (arg[0] == '\0')
00418 return;
00419
00420 if (str_cmp (arg, "all") && str_prefix ("all.", arg))
00421 {
00422 if ((obj = get_obj_wear (ch, arg)) != NULL)
00423 {
00424 unequip_char (ch, obj);
00425 extract_obj (obj);
00426 return;
00427 }
00428 if ((obj = get_obj_carry (ch, arg, ch)) == NULL)
00429 return;
00430 extract_obj (obj);
00431 }
00432 else
00433 for (obj = ch->carrying; obj != NULL; obj = obj_next)
00434 {
00435 obj_next = obj->next_content;
00436 if (arg[3] == '\0' || is_name (&arg[4], obj->name))
00437 {
00438 if (obj->wear_loc != WEAR_NONE)
00439 unequip_char (ch, obj);
00440 extract_obj (obj);
00441 }
00442 }
00443
00444 return;
00445
00446 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 348 of file mob_cmds.c. References AFF_CHARM, bug(), get_char_room(), IS_AFFECTED, IS_NPC, MAX_INPUT_LENGTH, multi_hit(), one_argument(), POS_FIGHTING, char_data::position, and TYPE_UNDEFINED. 00349 {
00350 char arg[MAX_INPUT_LENGTH];
00351 CHAR_DATA *victim;
00352
00353 one_argument (argument, arg);
00354
00355 if (arg[0] == '\0')
00356 return;
00357
00358 if ((victim = get_char_room (ch, arg)) == NULL)
00359 return;
00360
00361 if (victim == ch || IS_NPC (victim) || ch->position == POS_FIGHTING)
00362 return;
00363
00364 if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
00365 {
00366 bug ("MpKill - Charmed mob attacking master from vnum %d.",
00367 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00368 return;
00369 }
00370
00371 multi_hit (ch, victim, TYPE_UNDEFINED);
00372 return;
00373 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 508 of file mob_cmds.c. References bug(), char_to_room(), create_mobile(), get_mob_index(), char_data::in_room, IS_NPC, is_number(), MAX_INPUT_LENGTH, and one_argument(). 00509 {
00510 char arg[MAX_INPUT_LENGTH];
00511 MOB_INDEX_DATA *pMobIndex;
00512 CHAR_DATA *victim;
00513 int vnum;
00514
00515 one_argument (argument, arg);
00516
00517 if (ch->in_room == NULL || arg[0] == '\0' || !is_number (arg))
00518 return;
00519
00520 vnum = atoi (arg);
00521 if ((pMobIndex = get_mob_index (vnum)) == NULL)
00522 {
00523 sprintf (arg, "Mpmload: bad mob index (%d) from mob %d",
00524 vnum, IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00525 bug (arg, 0);
00526 return;
00527 }
00528 victim = create_mobile (pMobIndex);
00529 char_to_room (victim, ch->in_room);
00530 return;
00531 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 538 of file mob_cmds.c. References bug(), CAN_WEAR, create_object(), FALSE, get_obj_index(), get_trust(), IS_NPC, is_number(), ITEM_TAKE, MAX_INPUT_LENGTH, obj_to_char(), obj_to_room(), one_argument(), TRUE, and wear_obj(). 00539 {
00540 char arg1[MAX_INPUT_LENGTH];
00541 char arg2[MAX_INPUT_LENGTH];
00542 char arg3[MAX_INPUT_LENGTH];
00543 OBJ_INDEX_DATA *pObjIndex;
00544 OBJ_DATA *obj;
00545 int level;
00546 bool fToroom = FALSE, fWear = FALSE;
00547
00548 argument = one_argument (argument, arg1);
00549 argument = one_argument (argument, arg2);
00550 one_argument (argument, arg3);
00551
00552 if (arg1[0] == '\0' || !is_number (arg1))
00553 {
00554 bug ("Mpoload - Bad syntax from vnum %d.",
00555 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00556 return;
00557 }
00558
00559 if (arg2[0] == '\0')
00560 {
00561 level = get_trust (ch);
00562 }
00563 else
00564 {
00565 /*
00566 * New feature from Alander.
00567 */
00568 if (!is_number (arg2))
00569 {
00570 bug ("Mpoload - Bad syntax from vnum %d.",
00571 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00572 return;
00573 }
00574 level = atoi (arg2);
00575 if (level < 0 || level > get_trust (ch))
00576 {
00577 bug ("Mpoload - Bad level from vnum %d.",
00578 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00579 return;
00580 }
00581 }
00582
00583 /*
00584 * Added 3rd argument
00585 * omitted - load to mobile's inventory
00586 * 'R' - load to room
00587 * 'W' - load to mobile and force wear
00588 */
00589 if (arg3[0] == 'R' || arg3[0] == 'r')
00590 fToroom = TRUE;
00591 else if (arg3[0] == 'W' || arg3[0] == 'w')
00592 fWear = TRUE;
00593
00594 if ((pObjIndex = get_obj_index (atoi (arg1))) == NULL)
00595 {
00596 bug ("Mpoload - Bad vnum arg from vnum %d.",
00597 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
00598 return;
00599 }
00600
00601 obj = create_object (pObjIndex, level);
00602 if ((fWear || !fToroom) && CAN_WEAR (obj, ITEM_TAKE))
00603 {
00604 obj_to_char (obj, ch);
00605 if (fWear)
00606 wear_obj (ch, obj, TRUE);
00607 }
00608 else
00609 {
00610 obj_to_room (obj, ch->in_room);
00611 }
00612
00613 return;
00614 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1295 of file mob_cmds.c. References bug(), obj_data::carried_by, find_location(), get_obj_here(), IS_NPC, MAX_INPUT_LENGTH, obj_from_char(), obj_from_room(), obj_to_room(), one_argument(), unequip_char(), obj_data::wear_loc, and WEAR_NONE. 01296 {
01297 OBJ_DATA *obj;
01298 ROOM_INDEX_DATA *location;
01299 char arg[MAX_INPUT_LENGTH];
01300 char buf[MAX_INPUT_LENGTH];
01301
01302 argument = one_argument (argument, arg);
01303 if (arg[0] == '\0')
01304 {
01305 bug ("MpOTransfer - Missing argument from vnum %d.",
01306 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01307 return;
01308 }
01309 one_argument (argument, buf);
01310 if ((location = find_location (ch, buf)) == NULL)
01311 {
01312 bug ("MpOTransfer - No such location from vnum %d.",
01313 IS_NPC (ch) ? ch->pIndexData->vnum : 0);
01314 return;
01315 }
01316 if ((obj = get_obj_here (ch, arg)) == NULL)
01317 return;
01318 if (obj->carried_by == NULL)
01319 obj_from_room (obj);
01320 else
01321 {
01322 if (obj->wear_loc != WEAR_NONE)
01323 unequip_char (ch, obj);
01324 obj_from_char (obj);
01325 }
01326 obj_to_room (obj, location);
01327 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 623 of file mob_cmds.c. References ACT_NOPURGE, bug(), room_index_data::contents, obj_data::extra_flags, extract_char(), extract_obj(), get_char_room(), get_obj_here(), obj_data::in_room, char_data::in_room, IS_NPC, IS_SET, ITEM_NOPURGE, MAX_INPUT_LENGTH, obj_data::next_content, char_data::next_in_room, one_argument(), room_index_data::people, and TRUE. 00624 {
00625 char arg[MAX_INPUT_LENGTH];
00626 CHAR_DATA *victim;
00627 OBJ_DATA *obj;
00628
00629 one_argument (argument, arg);
00630
00631 if (arg[0] == '\0')
00632 {
00633 /* 'purge' */
00634 CHAR_DATA *vnext;
00635 OBJ_DATA *obj_next;
00636
00637 for (victim = ch->in_room->people; victim != NULL; victim = vnext)
00638 {
00639 vnext = victim->next_in_room;
00640 if |