/* ************************************************************************
* File: spec_assign.c Part of CircleMUD *
* Usage: Functions to assign function pointers to objs/mobs/rooms *
* *
* All rights reserved. See license.doc for complete information. *
* *
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
************************************************************************ */
#include <stdio.h>
#include "structs.h"
#include "awake.h"
#include "db.h"
#include "interpreter.h"
#include "utils.h"
#include "spells.h"
extern struct room_data *world;
extern int top_of_world;
extern int mini_mud;
extern struct index_data *mob_index;
extern struct index_data *obj_index;
void ASSIGNMOB(int mob, SPECIAL(fname));
/* arrays for trainers/teachers/adepts/masters */
/* order: vnum, attributes, 1 - newbie trainer (else 0) */
/* to have multiple attributes, separate them with | */
train_t trainers[] = {
// { 2506, STR, 0 },
// { 4255, BOD, 0 },
{ 8004, BOD | QUI | STR | CHA | INT | WIL, 1 },
{ 8005, BOD | QUI | STR | CHA | INT | WIL, 1 },
{ 8006, BOD | QUI | STR | CHA | INT | WIL, 1 },
{ 8007, BOD | QUI | STR | CHA | INT | WIL, 1 },
{ 8018, BOD | QUI | STR | CHA | INT | WIL, 1 },
// { 17104, BOD | QUI | STR, 0 },
// { 9413, CHA | INT | WIL, 0 },
{ 0, 0, 0 } /* this MUST be last */
};
/* order: vnum, skill1, skill2, skill3, skill4, skill5, learn message, level */
/* see spells.h for the list of skills. */
/* don't have them teach anything above SKILL_ELF_ETTIQUETTE (except SKILL_CLIMBING)*/
/* if they teach < 5 skills, put a 0 in the remaining skill slots */
/* available levels are NEWBIE (4), AMATEUR (6/7), and ADVANCED (10/11) */
teach_t teachers[] = {
/* Awake 2050 specific trainers *
{ 2508, SKILL_BIOTECH, 0, 0, 0, 0, 0, 0, 0, "After hours of medical research and instruction, you begin "
"to\r\nunderstand more of the basic biotech procedures.\r\n", NEWBIE },
{ 3722, SKILL_ATHLETICS, SKILL_RIFLES, SKILL_PISTOLS, 0, 0, 0, 0, 0,
"After hours of study and physical practice, you feel like you've "
"learned\r\nsomething.\r\n", AMATEUR },
{ 4101, SKILL_FIREARMS, SKILL_PISTOLS, SKILL_RIFLES, SKILL_SHOTGUNS, SKILL_GUNNERY, 0, 0, 0,
"After hours of study and target practice, you feel like you've "
"learned\r\nsomething.\r\n", AMATEUR },
{ 4102, SKILL_ARMED_COMBAT, SKILL_EDGED_WEAPONS, SKILL_POLE_ARMS, SKILL_WHIPS_FLAILS,
SKILL_CLUBS, 0, 0, 0, "After hours of study and melee practice, you feel like you've "
"learned\r\nsomething.\r\n", AMATEUR },
{ 4103, SKILL_FIREARMS, SKILL_PISTOLS, SKILL_RIFLES, SKILL_SHOTGUNS, SKILL_GUNNERY, 0, 0, 0,
"After hours of study and target practice, you feel like you've "
"learned\r\nsomething.\r\n", ADVANCED },
{ 4104, SKILL_ARMED_COMBAT, SKILL_EDGED_WEAPONS, SKILL_POLE_ARMS, SKILL_WHIPS_FLAILS, 0, 0, 0,
SKILL_CLUBS, "After hours of study and melee practice, you feel like you've "
"learned\r\nsomething.\r\n", ADVANCED },
{ 4250, SKILL_SORCERY, SKILL_MAGICAL_THEORY, SKILL_CONJURING, 0, 0, 0, 0, 0,
"After hours of study and magical practice, you feel like you've "
"learned\r\nsomething.\r\n", ADVANCED },
{ 4251, SKILL_SHAMANIC_STUDIES, SKILL_CONJURING, SKILL_SORCERY, 0, 0, 0, 0, 0,
"After hours of study and magical practice, you feel like you've "
"learned\r\nsomething.\r\n", ADVANCED },
{ 4257, SKILL_ASSAULT_RIFLES, SKILL_TASERS, 0, 0, 0, 0, 0, 0,
"After hours of study and weapon practice, you feel like you've "
"learned\r\nsomething.\r\n", AMATEUR },
* * * * * */
{ 8000, SKILL_UNARMED_COMBAT, SKILL_ARMED_COMBAT, SKILL_FIREARMS, SKILL_COMPUTER,
SKILL_ATHLETICS, SKILL_STREET_ETIQUETTE, SKILL_GUNNERY, SKILL_ELECTRONICS, "After hours of study and practice, you feel like you've "
"learned\r\nsomething.\r\n", NEWBIE },
{ 8001, SKILL_SORCERY, SKILL_MAGICAL_THEORY, SKILL_FIREARMS, SKILL_ARMED_COMBAT,
SKILL_UNARMED_COMBAT, SKILL_STREET_ETIQUETTE, SKILL_ELECTRONICS, SKILL_BIOTECH, "After hours of study and practice, you feel like you've "
"learned\r\nsomething.\r\n", NEWBIE },
{ 8003, SKILL_SORCERY, SKILL_SHAMANIC_STUDIES, SKILL_FIREARMS, SKILL_ARMED_COMBAT,
SKILL_UNARMED_COMBAT, SKILL_BIOTECH, SKILL_STREET_ETIQUETTE, SKILL_ELECTRONICS, "After hours of study and practice, you feel like you've "
"learned\r\nsomething.\r\n", NEWBIE },
{ 8017, SKILL_UNARMED_COMBAT, SKILL_ARMED_COMBAT, SKILL_FIREARMS, SKILL_ATHLETICS,
SKILL_THROWING_WEAPONS, SKILL_PROJECTILES, SKILL_STREET_ETIQUETTE, SKILL_GUNNERY, "After hours of study and practice, you feel like you've "
"learned\r\nsomething.\r\n", NEWBIE },
/* Again, more Awake 2050 specific stuff *
{ 13499, SKILL_COMPUTER, SKILL_ELECTRONICS, SKILL_COMPUTER_THEORY, 0, 0, 0, 0, 0, "Brian explains some concepts you had yet to understand "
"and\r\nyou feel like you've learned somthing.\r\n", AMATEUR },
{ 14839, SKILL_UNARMED_COMBAT, SKILL_THROWING_WEAPONS, SKILL_STEALTH, SKILL_ATHLETICS,
SKILL_CLIMBING, SKILL_PROJECTILES, 0, 0, "Shing gives you a work out like none you've ever had, "
"but\r\nyou feel like you've learned something.\r\n", AMATEUR },
* * * */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, "Report this bug!\r\n", 0 } // this MUST be last
};
/* order: vnum, perception, combat sense, inc. reflexes, killing hands, pain res.,
1 - newbie trainer (else 0) */
/* max ratings - astral perception: 1, combat sense: 3, inc. reflexes: 3, */
/* killing hands: 4, pain resistance: 10 */
adept_t adepts[] = {
{ 8019, { 1, 1, 1, 2, 3 }, 1 },
// { 14839,{ 0, 0, 0, 2, 5 }, 0 },
// { 3603, { 0, 2, 2, 3, 8 }, 0 },
// { 20326,{ 0, 2, 0, 1, 0 }, 0 },
{ 0, { 0, 0, 0, 0 }, 0 } // this MUST be last
};
/* order: vnum, first spell, first max force, second spell, second max force,
1 - mage teacher (0 - shaman teacher), 1 - newbie teacher (else 0) */
/* see spells.h for the list of spells */
/* don't have them teach anything above SPELL_TOXIC_WAVE */
/* neither force shouldn't exceed 6, as no one should have a magic rating > 6 */
/* if they don't teach two spells, put a 0 in the fourth and fifth slots */
master_t masters[] = {
{ 8008, SPELL_POWER_DART, 4, SPELL_MANA_DART, 4, 1, 1 },
{ 8009, SPELL_POWER_DART, 4, SPELL_MANA_DART, 4, 0, 1 },
// { 9413, SPELL_INVISIBILITY, 6, SPELL_ARMOR, 6, 0, 0 },
{ 0, 0, 0, 0, 0 } // this MUST be last
};
/* functions to perform assignments */
void ASSIGNMOB(int mob, SPECIAL(fname))
{
int rnum;
if ((rnum = real_mobile(mob)) >= 0) {
mob_index[rnum].sfunc = mob_index[rnum].func;
mob_index[rnum].func = fname;
} else if (!mini_mud) {
sprintf(buf, "SYSERR: Attempt to assign spec to non-existant mob #%d", mob);
log(buf);
}
}
void ASSIGNOBJ(int obj, SPECIAL(fname))
{
if (real_object(obj) >= 0)
obj_index[real_object(obj)].func = fname;
else if (!mini_mud) {
sprintf(buf, "SYSERR: Attempt to assign spec to non-existant obj #%d", obj);
log(buf);
}
}
void ASSIGNWEAPON(int weapon, WSPEC(fname))
{
if (real_object(weapon) >= 0)
obj_index[real_object(weapon)].wfunc = fname;
else if (!mini_mud) {
sprintf(buf, "SYSERR: Attempt to assign spec to non-existant weapon #%d", weapon);
log(buf);
}
}
void ASSIGNROOM(int room, SPECIAL(fname))
{
if (real_room(room) >= 0)
world[real_room(room)].func = fname;
else if (!mini_mud) {
sprintf(buf, "SYSERR: Attempt to assign spec to non-existant rm. #%d", room);
log(buf);
}
}
/* ********************************************************************
* Assignments *
******************************************************************** */
/* assign special procedures to mobiles */
void assign_mobiles(void)
{
int i;
SPECIAL(postmaster);
SPECIAL(generic_guard);
SPECIAL(receptionist);
SPECIAL(cryogenicist);
SPECIAL(teacher);
SPECIAL(trainer);
SPECIAL(adept_trainer);
SPECIAL(spell_master);
SPECIAL(puff);
SPECIAL(janitor);
SPECIAL(snake);
SPECIAL(thief);
SPECIAL(magic_user);
SPECIAL(clean);
SPECIAL(pike);
SPECIAL(jeff);
SPECIAL(captain);
SPECIAL(rodgers);
SPECIAL(delaney);
SPECIAL(lone_star_park);
SPECIAL(mugger_park);
SPECIAL(gate_guard_park);
SPECIAL(squirrel_park);
SPECIAL(sick_ork);
SPECIAL(mage_messenger);
SPECIAL(adept_guard);
SPECIAL(takehero_tsuyama);
SPECIAL(bio_secretary);
SPECIAL(expreen);
SPECIAL(beurring);
SPECIAL(tarmile);
SPECIAL(nitler);
SPECIAL(pool);
SPECIAL(harlten);
SPECIAL(branson);
SPECIAL(bio_guard);
SPECIAL(worker);
SPECIAL(dwarf);
SPECIAL(elf);
SPECIAL(george);
SPECIAL(wendigo);
SPECIAL(pimp);
SPECIAL(prostitute);
SPECIAL(heinrich);
SPECIAL(ignaz);
SPECIAL(waitress);
SPECIAL(dracula);
SPECIAL(pandemonia);
SPECIAL(tunnel_rat);
SPECIAL(saeder_guard);
SPECIAL(atomix);
SPECIAL(fixer);
SPECIAL(hacker);
SPECIAL(fence);
SPECIAL(taxi);
SPECIAL(crime_mall_guard);
SPECIAL(doctor_scriptshaw);
SPECIAL(huge_troll);
SPECIAL(phrodos_receptionist);
SPECIAL(ghosts_receptionist);
SPECIAL(aegnor);
SPECIAL(purple_haze_bartender);
/* trainers */
for (i = 0; trainers[i].vnum != 0; i++)
ASSIGNMOB(trainers[i].vnum, trainer);
/* teachers */
for (i = 0; teachers[i].vnum != 0; i++)
ASSIGNMOB(teachers[i].vnum, teacher);
/* adept trainer */
for (i = 0; adepts[i].vnum != 0; i++)
ASSIGNMOB(adepts[i].vnum, adept_trainer);
for (i = 0; masters[i].vnum != 0; i++)
ASSIGNMOB(masters[i].vnum, spell_master);
/* Personal rooms */
ASSIGNMOB(1, puff);
ASSIGNMOB(2, mage_messenger);
ASSIGNMOB(4, pool);
ASSIGNMOB(8, phrodos_receptionist);
ASSIGNMOB(9, ghosts_receptionist);
/* cab drivers */
ASSIGNMOB(600, taxi);
/* Immortal HQ */
ASSIGNMOB(1002, janitor);
ASSIGNMOB(1005, postmaster);
/* SWU */
ASSIGNMOB(1102, postmaster);
/* Various Tacoma */
ASSIGNMOB(1823, aegnor);
ASSIGNMOB(1832, fixer);
ASSIGNMOB(1833, purple_haze_bartender);
ASSIGNMOB(1900, postmaster);
ASSIGNMOB(1902, receptionist);
ASSIGNMOB(1916, generic_guard);
/* Tacoma */
ASSIGNMOB(2013, generic_guard);
ASSIGNMOB(2020, hacker);
ASSIGNMOB(2022, janitor);
/* club penumbra -- disabled *
ASSIGNMOB(2112, generic_guard);
ASSIGNMOB(2111, clean);
ASSIGNMOB(2113, magic_user);
ASSIGNMOB(2115, receptionist);
* */
/* Puyallup -- disabled *
ASSIGNMOB(2306, pike);
ASSIGNMOB(2305, jeff);
ASSIGNMOB(2403, atomix);
* */
/*Lone Star 17th Precinct -- disbled *
ASSIGNMOB(3700, captain);
ASSIGNMOB(3708, rodgers);
ASSIGNMOB(3709, delaney);
ASSIGNMOB(3703, generic_guard);
ASSIGNMOB(3720, generic_guard);
ASSIGNMOB(3829, janitor);
ASSIGNMOB(3712, janitor);
* */
/*Seattle State Park -- disabled *
ASSIGNMOB(4001, lone_star_park);
ASSIGNMOB(4003, mugger_park);
ASSIGNMOB(4008, janitor);
ASSIGNMOB(4009, gate_guard_park);
ASSIGNMOB(4012, squirrel_park);
ASSIGNMOB(4013, sick_ork);
ASSIGNMOB(4016, adept_guard);
ASSIGNMOB(4019, takehero_tsuyama);
* */
/* Various - zone 116 -- disabled *
ASSIGNMOB(4100, postmaster);
* */
/*BioHyde Complex -- disabled *
ASSIGNMOB(4202, bio_secretary);
ASSIGNMOB(4208, expreen);
ASSIGNMOB(4206, harlten);
ASSIGNMOB(4209, branson);
ASSIGNMOB(4200, bio_guard);
ASSIGNMOB(4203, worker);
* */
/* Groetza Camp -- disabled *
ASSIGNMOB(4227, beurring);
ASSIGNMOB(4228, tarmile);
ASSIGNMOB(4219, nitler);
ASSIGNMOB(4221, janitor);
* */
/* Titty Twister -- disabled *
ASSIGNMOB(4500, wendigo);
ASSIGNMOB(4501, pimp);
ASSIGNMOB(4502, prostitute);
ASSIGNMOB(4504, heinrich);
ASSIGNMOB(4506, ignaz);
ASSIGNMOB(4507, waitress);
ASSIGNMOB(4508, dracula);
ASSIGNMOB(4509, pandemonia);
ASSIGNMOB(4513, tunnel_rat);
* */
/* Tarislar -- disabled *
ASSIGNMOB(4912, saeder_guard);
* */
/* Seattle -- disabled *
ASSIGNMOB(5100, generic_guard);
ASSIGNMOB(5101, janitor);
* */
/* Neophytic Guild */
ASSIGNMOB(8010, postmaster);
ASSIGNMOB(8015, receptionist);
/* Council Island -- disabled *
ASSIGNMOB(9202, doctor_scriptshaw);
ASSIGNMOB(9410, huge_troll);
* */
/* Ork Underground -- disabled *
ASSIGNMOB(9913, receptionist);
* */
/* Bellevue -- disabled *
ASSIGNMOB(20342, receptionist);
* */
/* Crime Mall -- disabled *
ASSIGNMOB(10022, crime_mall_guard);
* */
/* Bradenton -- disabled *
ASSIGNMOB(14515, hacker);
ASSIGNMOB(14516, fence);
* */
}
/* assign special procedures to objects */
void assign_objects(void)
{
SPECIAL(bank);
SPECIAL(gen_board);
SPECIAL(vendtix);
SPECIAL(clock);
SPECIAL(inky_pendant);
SPECIAL(emerald_chalice);
SPECIAL(vending_machine);
SPECIAL(hand_held_scanner);
SPECIAL(anticoagulant);
SPECIAL(rng);
ASSIGNOBJ(3, gen_board);
ASSIGNOBJ(4, gen_board);
ASSIGNOBJ(12, gen_board);
ASSIGNOBJ(21, gen_board);
ASSIGNOBJ(22, gen_board);
ASSIGNOBJ(26, gen_board);
ASSIGNOBJ(1006, gen_board); /* builder board */
ASSIGNOBJ(1007, gen_board);
ASSIGNOBJ(1038, gen_board);
ASSIGNOBJ(1075, gen_board); /* Initiation Board */
ASSIGNOBJ(1904, clock);
ASSIGNOBJ(1946, bank);
ASSIGNOBJ(2104, gen_board); /* mortal board */
ASSIGNOBJ(2106, gen_board); /* immortal board */
ASSIGNOBJ(2107, gen_board); /* freeze board */
ASSIGNOBJ(2108, bank); /* atm */
//ASSIGNOBJ(22700, gen_board); /* Washu's Board */
//ASSIGNOBJ(2506, anticoagulant);
//ASSIGNOBJ(3012, vendtix);
//ASSIGNOBJ(3114, gen_board);
//ASSIGNOBJ(4006, clock);
//ASSIGNOBJ(4216, clock);
//ASSIGNOBJ(4507, emerald_chalice);
//ASSIGNOBJ(4516, inky_pendant);
ASSIGNOBJ(8001, gen_board);
ASSIGNOBJ(8002, gen_board);
ASSIGNOBJ(8003, gen_board);
ASSIGNOBJ(8004, gen_board);
ASSIGNOBJ(8013, gen_board);
//ASSIGNOBJ(9329, vending_machine);
//ASSIGNOBJ(9406, hand_held_scanner);
//ASSIGNOBJ(12114, vending_machine);
WSPEC(monowhip);
//ASSIGNWEAPON(4905, monowhip);
}
/* assign special procedures to rooms */
void assign_rooms(void)
{
extern int dts_are_dumps;
int i;
SPECIAL(dump);
SPECIAL(pet_shops);
SPECIAL(oceansounds);
SPECIAL(aztec_one);
SPECIAL(rope);
SPECIAL(combination);
SPECIAL(escalator);
SPECIAL(center_initiation);
SPECIAL(neophyte_lobby);
SPECIAL(neophyte_entrance);
SPECIAL(simulate_bar_fight);
SPECIAL(crime_mall_blockade);
SPECIAL(waterfall);
SPECIAL(climb_down_junk_pile);
SPECIAL(climb_up_junk_pile);
SPECIAL(junk_pile_fridge);
SPECIAL(cpu);
SPECIAL(datastore);
SPECIAL(input_output);
SPECIAL(spu);
SPECIAL(system_access);
SPECIAL(slave);
SPECIAL(phrodos_office);
SPECIAL(ghosts_office);
/* ASSIGNROOM(2130, dump);
ASSIGNROOM(2131, pet_shops); */
/* Limbo/God Rooms */
ASSIGNROOM(3, rope);
ASSIGNROOM(8, oceansounds);
ASSIGNROOM(9, oceansounds);
ASSIGNROOM(15, ghosts_office);
ASSIGNROOM(17, phrodos_office);
/* Carbanado */
//ASSIGNROOM(2617, combination);
//ASSIGNROOM(4477, waterfall);
/* Aztechnology */
//ASSIGNROOM(7401, aztec_one);
/* Neophytic guild */
ASSIGNROOM(8000, center_initiation);
ASSIGNROOM(8029, neophyte_lobby);
ASSIGNROOM(8031, neophyte_entrance);
/* Ork Underground */
//ASSIGNROOM(9978, simulate_bar_fight);
/* Tacoma Mall */
ASSIGNROOM(1904, escalator);
ASSIGNROOM(1920, escalator);
ASSIGNROOM(1923, escalator);
ASSIGNROOM(1937, escalator);
/* Crime Mall */
//ASSIGNROOM(10075, crime_mall_blockade);
//ASSIGNROOM(10077, crime_mall_blockade);
/* Mr. BetterWrench Auto Repair */
//ASSIGNROOM(12246, climb_down_junk_pile);
//ASSIGNROOM(12248, junk_pile_fridge);
//ASSIGNROOM(12278, climb_up_junk_pile);
for (i = 0; i < top_of_world; i++) {
if (IS_SET(ROOM_FLAGS(i), ROOM_MATRIX) && SECT(i) >= SECT_BLUE)
switch (world[i].spec) {
case 1 : world[i].func = cpu; break;
case 2 : world[i].func = datastore; break;
case 3 : world[i].func = input_output; break;
case 4 : world[i].func = spu; break;
case 5 : world[i].func = system_access; break;
case 6 : world[i].func = slave; break;
default: break;
}
if (dts_are_dumps)
if (IS_SET(ROOM_FLAGS(i), ROOM_DEATH))
world[i].func = dump;
}
}