mixed do_resurrect_obj(object ob) { int corpse; object playerob; if(ob->isCorpse()) corpse = 1; if(interactive(ob)) playerob = ob; if( ob->isPlayer() ) playerob = ob->GetPlayerob(); if( ob->isPlayer() && !playerob ){ write("You cannot resurrect a player that isn't logged on."); return 1; } if((playerob && !playerob->GetGhost()) || living(ob)) { write("You can't resurrect the living."); return 1; } if(base_name(ob) != LIB_CORPSE){ write("You can only resurrect flesh-based creatures."); return 1; } if(environment(ob) != environment(this_player())) { write(capitalize(ob->GetKeyName())+" isn't here."); return 1; } tell_player(this_player(),"You wave your hand, and with a flash "+ "of light, "+ob->GetCapName()+" comes back to life!"); tell_player(ob,capitalize(this_player()->GetKeyName())+" waves "+ possessive(this_player())+ " hand, and with a flash of light, you come back from the dead!"); tell_room(environment(this_player()),this_player()->GetCapName()+" waves "+ possessive(this_player())+ " hand, and with a flash of light, "+ob->GetCapName()+ " comes back to life!", ({ob, this_player()}) );
varargs int invoke_causelt (string str) { object target; if (!str) str = "NONE"; if (str=="NONE") target = TP->query_current_attacker(); if (!target) target = present(str, environment(TP)); if (!target) { write(SYNTAX); return 0; } if (!check_valid_targ(TP, target)) return 0; if (!invoke_spell(TP, COST)) return 0; target->kill_ob(TP); lvl = TP->query_level("priest"); write("You begin casting cause light wounds...\n"+ "Dark energies coalesce around your fingers.\n"); say(TPN+" begins a prayer...\n"+ "Dark energies coalesce around "+ possessive(TP->query("gender"))+" fingers!\n"); if (!TP->query_hit(target)) { write("You fail to hit your target with the dark energies.\n"); say(TPN+" fails to hit!\n"); return 1; } if (!check_magic_resist((TP->query_level("priest")), target, COST, ROLL)) return; tell_room(environment(TP), TPN+" drains the life from "+ target->query("cap_name")+"!\n", ({ TP, target }) );
varargs int cast_lightning (string str, int obj) { object target; if (!str) str = "NONE"; if (str=="NONE") target = TP->query_current_attacker(); if (!target) target = present(str, environment(TP)); if (!target) { write(SYNTAX); return 0; } if (!check_valid_targ(TP, target)) return 0; if (!obj) { if (!cast_spell(TP, COST)) return 0; obj = query_caster_level(TP, "wizard"); lvl = obj; write("You begin casting Chain Lightning...\n"+ "Electricity begins crackling between your fingers.\n"); say(TPN+" begins uttering arcane words...\n"+ "Electricity begins crackling between "+ possessive(TP->query("gender"))+" fingers!\n"); tell_room(environment(TP), TPN+" hurls a lightning bolt at "+ target->query("cap_name")+"!\n", ({ caster, target }) ); write("You hurl a lightning bolt at "+ target->query("cap_name")+".\n"); tell_object(target, TPN+" hurls a lightning bolt at you!\n"); } else {
int cmd_trip(string str) { int dmg; object ob, env, tp; if (!abil()) return notify_fail("What?\n"); env = environment(this_player()); tp = this_player(); if (!str) ob = this_player()->query_current_attacker(); else ob = present(str, env); if (!ob || !ob->is_living()) return notify_fail("You do not see that here.\n"); if (ob==this_player()) return notify_fail("You trip and fall down.\n"); if(this_player()->query_ghost()) return notify_fail("Hard to trip without a body..\n"); if (this_player()->query_disable()) return notify_fail("You are not oriented enough to do this.\n"); if (environment(this_player())->query_property("no attack")) return notify_fail("Greater powers prevent your malice.\n"); if ((int)this_player()->query_sp() < 20) return notify_fail("You are too tired.\n"); if (ob->query_rest_type() == SIT) return notify_fail(ob->query_cap_name()+" is already on the ground!\n"); if(!this_player()->kill_ob(ob)) { write(ob->query_cap_name()+" can't be attacked by you yet."); return 1; } tp->set_disable(); dmg = tp->query_stats("dexterity"); dmg -= (ob->query_stats("dexterity") / 2); if (dmg < random(25)) { write("You spin at "+ob->query_cap_name()+", miss "+possessive(ob)+" and fall to the ground."); message("info", tp->query_cap_name()+" spins around on the ground and tries to trip you but misses and falls to the ground.", ob); message("info", tp->query_cap_name()+" spins around on the ground and tries to trip "+ob->query_cap_name()+" but misses and falls to the ground.",environment(ob), ({ tp, ob }));
mixed do_steal_wrd_from_liv(string wrd, object liv) { this_player()->eventPrint("You eye " + (string)liv->GetName() + " with thoughts on " + possessive(liv) + " pockets."); if( (int)this_player()->GetInCombat() ) this_player()->SetAttack(0, (: eventSteal,this_player(), "money", liv :), ROUND_OTHER); else eventSteal(this_player(), "money", liv);
int regenerate(string limb) { int money, bonus; mapping limb_info; object tp; string *there, *missing; tp = this_player(); if(present(limb, this_player())) bonus = 2; else bonus = 1; there = (string *)tp->query_limbs(); missing = (string *)this_player()->query_severed_limbs() + (string *)RACE_D->query_limbs((string)this_player()->query("race")); /* checking with the race_d is allowing compatibility with old versions of the mudlib */ if(!missing) { notify_fail("You aren't missing any limbs!\n"); return 0; } if(member_array(limb, missing) == -1) { notify_fail("You are not missing that limb!\n"); return 0; } if(member_array(limb, there) != -1) { notify_fail("You already have that one back!\n"); return 0; } limb_info= (mapping)RACE_D->query_limb_info(limb,(string)tp->query("race")); if(!limb_info) { notify_fail("That limb cannot be replaced!\n"); return 0; } if(limb_info["attach"] != "0") { if(member_array(limb_info["attach"], there) == -1) { notify_fail("You would need a "+limb_info["attach"]+" for that!\n"); return 0; } } if((string)this_player()->query_class() == "cleric") money = 1200; else money = 1600; money = money / limb_info["max"]; if((int)tp->query_money("gold") < COST) { notify_fail("The cleric tells you: You do not have enough gold.\n"); return 0; } tp->add_limb(limb, limb_info["ref"], (int)tp->query_max_hp()/limb_info["max"], 0, 0); if(member_array(limb, (string *)RACE_D->query_wielding_limbs((string)tp->query("race"))) != -1) tp->add_wielding_limb(limb); this_player()->add_money("gold", -COST); say(sprintf("%s asks the clerics for some help with %s missing %s.", this_player()->query_cap_name(), possessive(this_player()), limb)); write("The clerics restore your "+limb+"!"); return 1; }
int mimic( object victim, object attacker ) { string vil = victim->query_name(); string att = attacker->query_name(); int dam = 100 + random( 30 ); ansi_tell_room( ENV( attacker ), sprintf( "%s screams as the slime touches %s " "skin! The slime burbles and changes form. " "It looks almost identical to %s!!!!\n", vil, possessive( vil ), vil ), color, ({ victim }) );
int cmd_drink( string a ) { if( !id( a ) ) { notify_fail( "You wish to drink what?\nNB \"drink drink\" will work.\n" ); return 0; } write( "You drink your " + query( "name" ) + ".\n" ); say( sprintf( "%s drinks %s %s.\n", (string)this_player()-> query( "cap_name" ), possessive( this_player() ), query( "name" ), ) ); call_out( "remove", 0 ); return 1; }
int add_command(string cmd) { int number; string type; if(cmd) { sscanf(cmd, "%d %s", number, type); } if(number && type) { if(number > 30000 || total + number > 30000) { message("info","You can't fit more than 30000 coins inside the box.\n", this_player()); } else if(this_player()->debit(type,number)) { message("info","You put "+number+" "+type+" coins into the box.\n", this_player()); message("info",""+this_player()->query_cap_name()+" puts "+number+" "+ ""+type+" coins into "+possessive(this_player())+" box.\n", environment(this_player()),this_player()); coins=clone_object("/std/coins.c"); coins->set_type(type); coins->set_number(number); coins->move(this_object(),1); calculate_totals(); } else { message("info","You don't seem to have "+number+" "+type+" coins.\n", this_player()); } return 1; } return notify_fail("Syntax: 'add <number> <coin type>'\n"); }
varargs int cast_necrobolt (string str, int obj) { object target; if (!str) str = "NONE"; if (str=="NONE") target = TP->query_current_attacker(); if (!target) target = present(str, environment(TP)); if (!target) { write(SYNTAX); return 0; } if (!check_valid_targ(TP, target)) return 0; if (!obj) { obj = query_caster_level(TP, "wizard"); if (!cast_spell(TP, COST)) return 0; write("You begin casting Necromantic Bolt...\n"+ "Your hands fill with negative energy.\n"); say(TPN+" begins uttering arcane words...\n"+ "a thick blackness engulfs "+ possessive(TP->query("gender"))+" hands!\n"); tell_room(environment(TP), TPN+" hurls a black beam of light at "+ target->query("cap_name")+"!\n", ({ caster, target }) );
int cmd_trance(string s) { int x, b, time; object o, t; if(!s || s == "") return notify_fail("Trance who?\n"); if(!o=present(s, environment(this_player()))) return notify_fail("You do not notice that here.\n"); t=this_player(); if(!o->is_living()) return notify_fail("You cannot trance " "inanimate objects.\n"); if(o->query_trance()) notify_fail(o->query_cap_name()+" is already under " "someone elses control.\n"); x=(o->query_stats("intelligence")+o->query_stats("wisdom"))*2/3+random(t->query_level()); b=(t->query_stats("intelligence")+t->query_stats("wisdom")+ (t->query_stats("charisma")/2))*2/3+random(t->query_level()); if(x < b) return notify_fail("Your trance fails to affect "+o->query_cap_name()+".\n"); time=(x-b)*3/2; if(time > 25) time=25; write("X: "+x+" T: "+b+" Time: "+time); write("You trance "+o->query_cap_name()+"."); message("", "You pay a little too much attention to "+ (string)t->query_cap_name()+"'s eyes and you fall under "+ possessive(t)+" trance.", o); message("", o->query_cap_name()+" places "+o->query_cap_name()+ " under a trance.", environment(t), ({o,t}) );
string query_possessive() { return possessive(query("gender")); }
} tmprumbo = rumbo; if(stringp(rumbo)){ if(grepp(rumbo, "#")) err = "Let's not load a clone."; else err = catch(rumbo = load_object(rumbo)); } if(err || !rumbo){ log_file("runtime","\n"+timestamp()+" "+identify(this_object())+ " could not load "+identify(rumbo)+" to fall into.\n"); err = catch(rumbo = load_object(rvoid)); } if(err || !rumbo){ this_object()->eventMove(ROOM_START); return 0; } tell_object(this_object(),"You plummet downward!"); if(err = this_object()->eventMove(rumbo)){ tell_room(rumbo,capitalize(name)+" plummets in from above.", ({ this_object() })); tell_room(env,capitalize(name)+" continues "+ possessive(this_object())+" fall downward.", ({ this_object() })); if(rumbo->GetMedium() == MEDIUM_AIR && !(this_object()->CanFly())){ call_out( "eventFall", 1); } } return 1; } return 0; }
void extra_create() { string race, name, lastname, rankfirst, ranksecond, rankthird, rankfourth, attk; int sex = random( 2 ); if( sex == 1 ) { set_gender( "male" ); switch( random( 15 ) ) { case 0 : name = "Gary"; break; case 1 : name = "Larry"; break; case 2 : name = "Sigmund"; break; case 3 : name = "Alfred"; break; case 4 : name = "Gregory"; break; case 5 : name = "Lester"; break; case 6 : name = "Arnold"; break; case 7 : name = "Homer"; break; case 8 : name = "James"; break; case 9 : name = "Atherton"; break; case 10 : name = "Eric"; break; case 11 : name = "Robert"; break; case 12 : name = "Mike"; break; case 13 : name = "Gabe"; break; case 14 : name = "Malcom"; break; } } if( sex == 0 ) { set_gender( "female" ); switch( random( 15 ) ) { case 0 : name = "Gale"; break; case 1 : name = "Edith"; break; case 2 : name = "Marilyn"; break; case 3 : name = "Margo"; break; case 4 : name = "Agnes"; break; case 5 : name = "Nelly"; break; case 6 : name = "Mildred"; break; case 7 : name = "Charlotte"; break; case 8 : name = "Eva"; break; case 9 : name = "Victoria"; break; case 10 : name = "Stella"; break; case 11 : name = "Vivian"; break; case 12 : name = "Ruth"; break; case 13 : name = "Sophronia"; break; case 14 : name = "Virginia"; break; } } switch( random( 15 ) ) { case 0 : lastname = "Masterson"; break; case 1 : lastname = "Laymon"; break; case 2 : lastname = "Wilson"; break; case 3 : lastname = "McCammon"; break; case 4 : lastname = "Bierce"; break; case 5 : lastname = "Blackwood"; break; case 6 : lastname = "Lovecraft"; break; case 7 : lastname = "Saul"; break; case 8 : lastname = "Poe"; break; case 9 : lastname = "Ketchum"; break; case 10 : lastname = "Koontz"; break; case 11 : lastname = "Lumley"; break; case 12 : lastname = "Lansdale"; break; case 13 : lastname = "Barker"; break; case 14 : lastname = "Bloch"; break; } switch( random( 4 ) ) { case 0 : race = "drow_elf"; break; case 1 : race = "dwarf"; break; case 2 : race = "human"; break; case 3 : race = "gnome"; break; } switch( random( 4 ) ) { case 0 : rankfirst = sprintf( "%s is tall and middle aged. %s " "shirt is wrinkled and %s looks dazed. ", name, CAP( possessive( THISO ) ), subjective( THISO ) ); break; case 1 : rankfirst = sprintf( "%s is a bit overweight. %s presence " "is chilling. There is something dark about %s. ", name, CAP( possessive( THISO ) ), objective( THISO ) ); break; case 2 : rankfirst = sprintf( "There is a silky shine to %s hair. %s " "looks clean and well groomed. Almost too well groomed. Like %s is " "hiding something. ", possessive( THISO ), CAP( subjective( THISO ) ), subjective( THISO ) ); break; case 3 : rankfirst = sprintf( "%s has taut skin and well toned muscles. %s " "looks to only be around thirty, though you know %s is much older. ", name, CAP( subjective( THISO ) ), subjective( THISO ) ); break; } switch( random( 4 ) ) { case 0 : ranksecond = sprintf( "%s dutifully concentrates on " "whatever %s task maybe. %s concentration is unwavering and intense. ", CAP( subjective( THISO ) ), possessive( THISO ), CAP( possessive( THISO ) ) ); break; case 1 : ranksecond = sprintf( "%s moves with great agility. %s speed " "and grace is almost supernatural. As if %s wasn't fully of this world. ", CAP( subjective( THISO ) ), CAP( possessive( THISO ) ), subjective( THISO ) ); break; case 2 : ranksecond = sprintf( "%s refuses to pause for a moment. %s " "rushes forward lost in thought. ", CAP( subjective( THISO ) ), CAP( subjective( THISO ) ) ); break; case 3 : ranksecond = sprintf( "%s shoes are scuffed and the soles are almost " "worn through. %s proceeds relentlessly forwards driven by an unknown goal. ", CAP( possessive( THISO ) ), CAP( subjective( THISO ) ) ); break; } switch( random( 4 ) ) { case 0 : rankthird = sprintf( "%s eyes are crisp and calculating. ", CAP( possessive( THISO ) ) ); break; case 1 : rankthird = sprintf( "%s eyes seem cold, yet relentless. ", CAP( possessive( THISO ) ) ); break; case 2 : rankthird = sprintf( "%s eyes are tireless and unyielding. ", CAP( possessive( THISO ) ) ); break; case 3 : rankthird = sprintf( "%s eyes intake the whole of the room, " "%s is searching for something. ", CAP( possessive( THISO ) ), subjective( THISO ) ); break; } switch( random( 4 ) ) { case 0 : rankfourth = sprintf( "%s only cares for work.", CAP( subjective( THISO ) ) ); break; case 1 : rankfourth = sprintf( "%s licks %s lips at the sight of you.", CAP( subjective( THISO ) ), possessive( THISO ) ); break; case 2 : rankfourth = sprintf( "%s is a tireless asset to this company.", CAP( subjective( THISO ) ) ); break; case 3 : rankfourth = sprintf( "%s has no fear. No worry.", CAP( subjective( THISO ) ) ); break; } switch( random( 100 ) ) { case 0..20 : attk = "sympathy"; break; case 21..70 : attk = "shove"; break; case 71..76 : attk = "panic"; break; case 77..99 : attk = "eyeclaw"; break; } set_name( sprintf( "%s %s", name, lastname ) ); add_alias( "researcher" ); add_alias( "res" ); add_alias( "doctor" ); add_alias( lower_case( name ) ); add_alias( lower_case( lastname ) ); add_alias( sprintf( "%s %s", lower_case( name ), lower_case( lastname ) ) ); set_short( sprintf( "%s %s, a high level researcher", name, lastname ) ); set_long( sprintf( "%s %s %s %s", rankfirst, ranksecond, rankthird, rankfourth ) ); set_race( race ); set_alignment( NEUTRAL_AL ); set_stat( "str", 120 + random( 30 ) ); set_stat( "con", 100 + random( 30 ) ); set_stat( "wil", 100 + random( 30 ) ); set_stat( "int", 100 + random( 30 ) ); set_stat( "dex", 100 + random( 30 ) ); set_avoid_props( ({ NoWanderRoomP }) );
int teleport_command(string cmd) { if (!cmd) { if (!this_player()->query_battleob()) { if(!environment(this_player())->query_no_teleport()) { object p = this_player(); switch (this_player()->query_home_town()) { case "vaerlon": htst = "Vaerlon"; destination = "/d/valkor/vaerlon/rooms/streets/h4.c"; break; case "graemor": htst = "Graemor"; destination = "/d/graemor/virtual/9,18.graemor-part1.c"; break; case "teladan": htst = "Teladan"; destination = "/u/t/tarak/areas/town/rooms/f8.c"; break; case "cenedoiss": htst = "Cenedoiss"; destination = "/u/b/belannaer/virtual/18,27.cenedoiss.c"; break; //case "mahrakc": ? case "atherton": htst = "Atherton"; destination = "/u/b/belannaer/virtual/14,13.atherton.c"; break; default: htst = "Vaerlon"; destination = "/d/valkor/vaerlon/rooms/streets/h4.c"; break; } message("teleport", "You rub the Ring of Teleportation while thinking "+ "of your hometown. The air around you shimmers and suddenly you find "+ "yourself standing in the central square of "+htst+".\n", p); message("teleport", ""+p->query_cap_name()+" rubs "+possessive(p)+" "+ "Ring of Teleportation. The air around "+objective(p)+" starts to "+ "distort, and suddenly in the blink of an eye "+subjective(p)+" "+ "disappears.\n", environment(p), p); p->move(destination); charges--; if (charges < 1) { call_out("destruct_me", 1); } } else { message("info", "Strange energy fluctuations in this room prevent "+ "you from teleporting...\n", this_player()); } } else { message("info", "You are too busy fighting to do that!\n", this_player()); } return 1; } }
int cmd_stat (string name) { string *coins, *list, *statnames ; object ob ; string *skillnames ; mapping skills ; int i, flag ; string spouse, tempstr ; string subj ; mapping stats ; int wealth; if (!name) { return help() ; } ob = get_object(name); if (!ob || !living(ob)) { notify_fail("No such living object exists.\n"); return 0 ; } subj = capitalize(subjective(ob->query("gender"))) ; tempstr = ob->query("race") ; if (tempstr) write (subj+" is " + article(tempstr) + " " + tempstr + ".\n") ; spouse = ob->query("spouse") ; if (spouse) { write (subj+" is married to "+spouse+".\n") ; } if ((int)ob->query("no_attack")) { write (subj+" is not an attackable object.\n") ; } flag = ob->query("drunk") ; switch (flag) { case 1..5 : { write (subj+" are a bit tispy.\n") ; break ; } case 6..10 : { write (subj+" are somewhat drunk.\n") ; break ; } case 11..15 : { write (subj+" are rather drunk.\n") ; break ; } case 16..20 : { write (subj+" are completely smashed.\n") ; break ; } case 21..25 : { write (subj+" are maximally drunk.\n") ; break ; } } write ("Hit points: "+ob->query("hit_points")+" of "+ ob->query("max_hp")+"\n") ; write ("Spell points: "+ob->query("spell_points")+" of "+ ob->query("max_sp")+"\n") ; write ("\n") ; stats = ob->query("stat") ; if (stats && sizeof(stats)) { statnames = keys(stats) ; for (i=0;i<sizeof(stats);i++) { write (sprintf("%12-s : %d\n",capitalize(statnames[i]),stats[statnames[i]])) ; } write ("\n") ; } wealth = ob->query("wealth") ; if (!wealth) { write (subj+" doesn't have any coins in "+ possessive(ob->query("gender"))+" purse.\n"); } else { write ("Wealth:"+wealth+" coins.\n"); } skills = ob->query_skills() ; if (skills && sizeof(skills)) { skillnames = keys(skills) ; write ("\n") ; write (capitalize(possessive(ob->query("gender"))) + " skills are:\n") ; list = sort_array(skillnames, "sort_skills", this_object()) ; for (i=0;i<sizeof(skills);i++) { write (sprintf("%24-s : %d\n",capitalize(list[i]),skills[list[i]])) ; } } return 1 ; }
int cmd_palmread(string who) { object tp=this_player(); object tgt; object *inv; int skill, i; int deaths, age, marriages; int kills, quests, str, wis; if (!abil()) { message("info","What?",tp); return 1; } if (!who) { message("info","Read whose palm?",tp); return 1; } if (tp->query_mp() < 30) { message("info","Not enough magic.",tp); return 1; } if (tp->query_disable()) { message("info","You are busy.",tp); return 1; } if (tp->query_current_attacker()) { message("info","You are too busy fighting.",tp); return 1; } tgt=present(who,environment(tp)); if (!tgt) { message("info","You don't see "+who+" here.",tp); return 1; } if (!userp(tgt)) { message("info","You cannot read the palm of "+tgt->query_cap_name()+".", tp); return 1; } if (tgt->query_current_attacker()) { message("info",nominative(tgt)+" is too caught up in battle to show " "you "+possessive(tgt)+" palm.",tp); return 1; } // these races either don't have hands, or have some kind of hand // without normal skin on it if (tgt->query_race() == "dragon" || tgt->query_race() == "lich" || tgt->query_race() == "raknid") { message("info","That creature does not have a palm.",tp); return 1; } // if their hands are both severed we can't read them very well.. if (member_array("right hand",tgt->query_limbs()) == -1 && member_array("left hand",tgt->query_limbs()) == -1) { message("info",nominative(tgt)+" has only stumps where "+possessive(tgt)+ " hands should be.",tp); return 1; } if (tgt == tp) { message("info","You look over your own palm...\n",tp); message("info",tp->query_cap_name()+" examines "+possessive(tp)+" palm.", environment(tp), tp); } else { message("info","You look over "+tgt->query_cap_name()+"'s palm...\n",tp); message("info",tp->query_cap_name()+" examines the palm of your hand.",tgt); message("info",tp->query_cap_name()+" examines the palm of "+ tgt->query_cap_name()+"'s hand.", environment(tp), ({ tgt, tp }) ); }
mixed do_sleep() { tell_player(this_player(),"You fall asleep."); tell_room(environment(this_player()), this_player()->GetName()+ " closes "+possessive(this_player())+" eyes and appears to "+ "lose consciousness.", ({this_player()}) );
void blood() { tell_player( THISP, "Your fresh shotgun wounds bleed." ); tell_room( ENV( THISP ), sprintf( "%s groans as %s wounds " "bleed.\n", THISP->query_name(), possessive( THISP ) ), ({ THISP }) );