revquest.c

demise/src/revquest.c · 4.3 KB

From the archive dodbackup-final.tar.gz

Download the archive   « Back to the archive contents

#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>             /* unlink() */
#include <signal.h>
#include "merc.h"

CHAR_DATA * pick_victim (CHAR_DATA *ch) {
CHAR_DATA *victim;
DESCRIPTOR_DATA *d;
int pick, max, numb;
  max = 10;
  numb = 1;
 pick = number_range (2, max);
//do_say (ch, "It is at least trying to load the proc, before the for loop");
  for (d = descriptor_list; d != NULL; d = d->next)
    {
      numb++;
      if (d->connected != CON_PLAYING)
        continue;
      CHAR_DATA *och = d->character;
   if (och->level < 3)
     continue;
//    do_say (ch, och->name);
    if (och == ch)
        continue;
      else if (och->max_hit > ch->max_hit + 30000) {
 //    do_say (ch, "too big");
        continue; }
//      else if (och->max_hit < ch->max_hit - 50000) {
//     do_say (ch, "too small");
//       continue; }
 //     if (ch->lstatus > victim->lstatus)
//        continue;
      else if (IS_IMMORTAL (och))
        continue;
      else if (!can_see (ch, och)) {
 //     do_say (ch, "Cant see");
        continue;
      }
      else if (och->pcdata->jagasafe > 0) {
 //     do_say (ch, "jagasafe");
        continue;
      }

      else if (IS_NEWBIE (och))
        continue;
       else if (numb < pick)
        continue;
      else 
         return och;
      break;
     }
//do_say (ch, "returning null");
return NULL;
}
void qreq_assassin (CHAR_DATA *ch, CHAR_DATA *assassin) {
CHAR_DATA *victim;
ROOM_INDEX_DATA *room;

  if (assassin == NULL || assassin->spec_fun != spec_lookup ("spec_assassin"))
    {
      do_huh (ch, "");
      return;
    }
if (!IS_ASSASSIN (ch))
{
do_say (assassin, "There are wolves, and there are lambs. Tread not in our den little sheep.");
return;
}
//do_say (assassin, "sorry, bugs bugs bugs, mud crashes!");
//return;
if (ch->assassin != NULL && find_char_mud (ch, ch->assassin->name) != NULL)
{
do_say (assassin, "What, is the assignment I gave you too hard? Get back to work!");
return;
}
  if (ch->countdown > 0 && !IS_IMMORTAL (ch))
    {
      if (ch->countdown > 120)
        {
          do_say (assassin,
                  "I dont have any need of your services right now come back later.");
          waiting (ch, 9);
          return;
        }
      else
        {
 do_say (assassin, "Come back in a couple of minutes and I\'ll have an assignment for you.");
          waiting (ch, 9);
          return;
        }
    }

if ((victim = pick_victim (ch)) == NULL || IS_IMMORTAL (ch))
   {
//    do_say (assassin, "Sorry, mob quests are out of order!");
//    return;
//  }

//   do_say (ch, "pick_victim returned null apperently");
    int randmob = number_range (46001,46010);
   if ((victim = create_mobile (get_mob_index(randmob))) == NULL)
  return;
   int randroom;
int whileloop = 1;
while (whileloop <= 24) {
whileloop++;
    if (IS_HYBRID (ch) || HAS_EVOLVED (ch))
      randroom = number_range (45701, 45800);
    else
      randroom = number_range (300, 45500);
    if ((room = get_room_index (randroom)) == NULL)
      continue;
    else if (!IS_HYBRID (ch) && !HAS_EVOLVED (ch) && room->area->plane == PLANE_PAND)
      continue;
    int door, doorsinroom = 0;
    for (door = 1; door < 5; door++) {
       if ((room->exit[door]) != NULL)
         doorsinroom++; }
        if (doorsinroom > 1)
         break;

}
if (victim->level < 2000 && IS_NPC (victim)) {
victim->level = number_range (2000, 5000);
  victim->armor = interpolate (victim->level, 100, -100);
int tempvalue;
  tempvalue = victim->level * 8 + number_range (victim->level * victim->level / 4,
                                             victim->level * victim->level);
  if (tempvalue > 10000000)
    victim->max_hit = 10000000;
  else
    victim->max_hit = tempvalue;
  victim->hit = victim->max_hit;
  victim->hitroll = victim->level;
  victim->damroll = victim->level;
if (room == NULL)
room = get_room_index (ROOM_VNUM_ALTAR);
char_to_room (victim, room);

}
}
char buf[MSL];
if (IS_NPC (victim)) {
sprintf (buf, "Go kill %s!", victim->short_descr);
if (victim->in_room == NULL) {
if (room == NULL)
room = get_room_index (ROOM_VNUM_ALTAR);
char_to_room (victim, room);
}
}
else
sprintf (buf, "Go kill %s!", victim->name); 
do_say (assassin, buf);
ch->assassin = victim;
//do_say (assassin, "Kill them!");
return;
}

Site Stats

Snippets: 1791
Codebases: 571