hire() { int cost; object bodyguard; if (!this_player()) return 0; cost = COST; if (!antonio) write("But Antonio is not here, so he cannot assign a bodyguard to you.\n"); else if (this_player()->query_money(0) < cost) write("You don't have " + cost + " gold coins, so you cannot hire a bodyguard.\n"); else if (this_player()->query_name() == "Someone") write("Due to technical reasons, we cannot handle invisible clients.\n"); else { bodyguard = make_bodyguard(this_player()); if (!bodyguard) { write("Sorry, all bodyguards are busy.\n"); return 1; } log_file("padrone", ctime(time()) + ": " + this_player()->query_name() + " hired a bodyguard.\n"); this_player()->add_money(-cost); /* Before moving the bodyguard here, or he could attack Antonio: */ tell_room(this_object(), "A bodyguard arrives.\n"); move_object(bodyguard, this_object()); /* To start the heartbeat in the monster: */ move_object(this_player(), this_object()); tell_object(bodyguard, "Padrone tells you: report\n"); } return 1; } /* hire */
extra_reset() { if (!rakshasa || !living(rakshasa)) { rakshasa = clone_object ("obj/monster"); call_other (rakshasa, "set_name", "rakshasa"); call_other (rakshasa, "set_race", "demon"); call_other (rakshasa, "set_short", "An evil rakshasa"); call_other (rakshasa, "set_long", "A fearsome rakshasa, one of the tiger-demons of India.\n"); call_other (rakshasa, "set_level", 18); call_other (rakshasa, "set_ep", 400000); /* Was 1125000 Pell */ call_other (rakshasa, "set_hp", 400); /* Was 600 */ call_other (rakshasa, "set_ac", 7); /* Was 8 */ call_other (rakshasa, "set_wc", 20); /* Was 25 */ call_other (rakshasa, "set_al", -1000); call_other (rakshasa, "set_aggressive", 1); call_other (rakshasa, "set_spell_mess1", /* Pell */ "The demon screams for your soul, chilling your body."); /* Pell */ call_other (rakshasa, "set_spell_mess2", "The demon sucks out part of your soul, chilling your body."); call_other (rakshasa, "set_chance", 2); call_other (rakshasa, "set_spell_dam", 60); /* Was 80 */ move_object (rakshasa, this_object()); scroll = clone_object ("obj/money"); call_other (scroll, "set_money", 1000 + random(1000)); move_object (scroll, rakshasa); } }
int refresh(object obj) { int may_need_warning; may_need_warning = 0; if(is_debug) { tell_object(obj, "Refreshing Quicktyper,"); } if(first_inventory(obj) != this_object()) { may_need_warning = 1; } refreshing = 1; move_object(this_object(), "room/storage"); if(is_debug) { tell_object(obj, "moved to storage,"); } move_object(this_object(), obj); if(is_debug) { tell_object(obj, "back again\n"); } if(may_need_warning && obj->query_level() > 19) { tell_object(obj, "Quicktyper: Your inventory has been rearranged.\n"); } refreshing = 0; needs_refresh = 0; return 1; }
extra_reset() { object treasure; if (!dragon || !living(dragon)) { dragon = clone_object("obj/monster"); call_other(dragon, "set_name", "dragon"); call_other(dragon, "set_alias", "wyrm"); call_other(dragon, "set_level", 19); call_other(dragon, "set_hp", 200); call_other(dragon, "set_short", "A gold dragon"); call_other(dragon, "set_wc", 22); call_other(dragon, "set_ac", 5); call_other(dragon, "set_al", 900); call_other(dragon, "set_aggressive", 0); call_other(dragon, "set_chance",20); call_other(dragon, "set_spell_mess1", "The dragon breathes fire."); call_other(dragon, "set_spell_mess2", "The dragon breathes fire on you."); call_other(dragon, "set_spell_dam",30); move_object(dragon, this_object()); treasure = clone_object("obj/treasure"); call_other(treasure, "set_id", "diamond"); call_other(treasure, "set_alias", "gem"); call_other(treasure, "set_short", "A giant diamond"); call_other(treasure, "set_weight", 3); call_other(treasure, "set_value", 1000); move_object(treasure, dragon); } }
extra_reset() { if (!the_guard) { object the_weapon, the_money; the_guard = clone_object("obj/monster"); the_guard->set_name("security guard"); the_guard->set_alias("guard"); the_guard->set_level(4); the_guard->set_hp(100); the_guard->set_wc(5); the_guard->set_al(-10); the_guard->set_short("A security guard"); the_guard->set_long("This is a security guard in a dark suit, tie and sunglasses.\n" + "He is responsible for the security here.\n"); the_guard->set_aggressive(1); the_guard->set_male(); the_guard->set_spell_mess1("The guard yells: This is a private area! Get out, terrorist!"); the_guard->set_spell_mess2("The guard yells at you: This is a private area! Get out, terrorist!"); the_guard->set_chance(50); move_object(the_guard, this_object()); the_weapon = clone_object("players/padrone/obj/m16"); the_weapon->set_monsters_reload_at_reset(1); move_object(the_weapon, the_guard); the_guard->init_command("wield m16"); the_money = clone_object("obj/money"); the_money->set_money(random(50)); move_object(the_money, the_guard); } }
extra_reset() { if (!slug2 || !living(slug2)) { slug2 = clone_object("obj/monster"); call_other(slug2, "set_name", "slime puddle"); call_other(slug2, "set_alias", "puddle"); call_other(slug2, "set_level", 14); call_other(slug2, "set_hp", 150); call_other(slug2, "set_short", "A puddle of slime"); call_other(slug2, "set_wc", 12); call_other(slug2, "set_ac", 4); call_other(slug2, "set_al", -350); call_other(slug2, "set_aggressive", 1); move_object(slug2, this_object()); } if (!slug1 || !living(slug1)) { slug1 = clone_object("obj/monster"); call_other(slug1, "set_name", "slug"); call_other(slug1, "set_alias", "slime slug"); call_other(slug1, "set_level", 14); call_other(slug1, "set_hp", 150); call_other(slug1, "set_short", "A slime slug"); call_other(slug1, "set_wc", 12); call_other(slug1, "set_ac", 4); call_other(slug1, "set_al", -350); call_other(slug1, "set_aggressive", 1); move_object(slug1, this_object()); } }
init() { ::init(); if(!present("hide")) move_object(clone_object(OBJ+"gspiplat"), this_object()); // Added clonep check cuz of stupid unique bug - Picard: Easter of 97 if(!present("stinger") && clonep(this_object())) move_object(clone_object(OBJ+"gstinger"), this_object()); }
make_golem() { object temp; golem = clone_object("obj/monster"); /* NEW, IMPROVED monster class! */ golem->set_name("golem-padrone"); golem->set_alias("golem"); golem->set_level(21); golem->set_ep(120000); golem->set_hp(1000); golem->set_ac(5); golem->set_ac(5); golem->set_al(0); golem->set_short("Padrone the Wizard of Law and Balance (grey lord)"); golem->set_long("The famous wizard doesn't have time to sit here and wait all day.\n" + "Therefore he made this golem, named it Golem-padrone, and put\n" + "it here. It is a silicon golem, and it is equipped with a\n" + "limited amount of intelligence.\n"); golem->set_aggressive(0); /* The NEW, IMPROVED monster calls: */ if (!chat_str) setup_arrays(); golem->load_chat(10, chat_str); golem->load_a_chat(20, a_chat_str); golem->set_match(this_object(), function, type, match); move_object(call_other("players/padrone/outside/front_yard", "make_ticket"), golem); move_object(golem, this_object()); temp = clone_object("players/padrone/obj/wizardshat"); move_object(temp, golem); golem->init_command("wear hat"); golem->init_command("say lux"); temp = clone_object("obj/weapon"); temp->set_name("debugging tool"); temp->set_alt_name("tool"); temp->set_alias("debugger"); temp->set_class(10); temp->set_value(100); temp->set_weight(3); temp->set_short("A debugging tool"); temp->set_long("This is a debugging tool.\n" + "One of the wizards probably made it to take care of all\n" + "the bugs that crawl into his correct and beautiful programs\n" + "as soon as he's looking the other way.\n" + "It looks like a big iron hammer with an extra wide head.\n"); temp->set_hit_func(this_object()); move_object(temp, golem); golem->set_ac(10); /* After all wear commands! */ } /* make_robot_padrone */
PyObject* parse_request(PyObject* ignored, PyObject* args) { PyObject* self; PyObject* source; PyObject* port = NULL; PyObject* ret = NULL; int status; if(!PyArg_ParseTuple(args, "OO", &self, &source)) return NULL; request_t* req = create_request(source); if(req == NULL) goto done; status = do_parse(req); if(status < 0) goto done; if(status == 0) { destroy_request(req); Py_RETURN_NONE; } // Move objects to self if(move_object(self, "method", &(req->method)) != 0) goto done; if(move_object(self, "uri", &(req->uri)) != 0) goto done; if(move_object(self, "scheme", &(req->scheme)) != 0) goto done; if(move_object(self, "host", &(req->host)) != 0) goto done; port = PyInt_FromLong(req->port); if(port == NULL) goto done; if(move_object(self, "port", &port) != 0) goto done; if(move_object(self, "path", &(req->path)) != 0) goto done; if(move_object(self, "query", &(req->query)) != 0) goto done; if(move_object(self, "fragment", &(req->fragment)) != 0) goto done; if(move_object(self, "version", &(req->version)) != 0) goto done; if(move_object(self, "headers", &(req->headers)) != 0) goto done; if(req->buflen > 0) { ret = PyString_FromStringAndSize(req->buffer, req->buflen); } else { ret = PyString_FromString(""); } done: Py_XDECREF(port); if(req != NULL) destroy_request(req); return ret; }
extra_reset() { if (!paladin || !living(paladin)) { paladin = clone_object("obj/monster"); call_other(paladin, "set_name", "paladin"); call_other(paladin, "set_alias", "knight"); call_other(paladin, "set_level", 19); call_other(paladin, "set_hp", 300); call_other(paladin, "set_al", 1000); call_other(paladin, "set_short", "A noble knight"); call_other(paladin, "set_long", "A noble paladin.\n"); move_object(paladin, this_object()); weapon = clone_object("obj/weapon"); call_other(weapon, "set_name", "glowing sword"); call_other(weapon, "set_short", "A softly glowing sword"); call_other(weapon, "set_alias", "sword"); call_other(weapon, "set_long", "It is a long sword of finest workmanship, and it glows with goodness.\n"); call_other(weapon, "set_class", 20); call_other(weapon, "set_value", 1000); call_other(weapon, "set_weight", 3); call_other(weapon, "set_hit_func", this_object()); call_other(weapon, "set_wield_func", this_object()); transfer(weapon, paladin); call_other(paladin, "init_command", "wield sword"); } }
extra_reset() { if (!present("world map")) { map = clone_object("obj/treasure"); call_other(map, "set_id", "world map"); call_other(map, "set_alias", "map"); call_other(map, "set_short", "A map of the world"); call_other(map, "set_weight", 30); call_other(map, "set_value", 2000); call_other(map, "set_long", "The map looks roughly like this:\n\n" + " + *\n" + " + +\n" + " ++++\n" + " +++\n" + " +++++++++\n" + " |||\n" + " +++* *+ +\n" + " + | |+++ + *\n" + " + + | | | |\n" + " +-+-+--+-+-*-+-+-+-+---+-+-+-*\n" + " + | | |\n" + " ++++ +* | +\n" + " | | + +*++\n" + " +++ + +\n" + " + +++\n" + " * *\n\n" + "The *'s refer to other maps, most of which are not here\n"); move_object(map, this_object()); } }
extra_reset() { object book; if (!present("book")) { book=clone_object("players/morgar/book"); move_object(book,this_object()); } }
extra_reset() { if (!witness) { witness = clone_object("obj/monster"); witness->set_name("witness"); witness->set_alias("witness of jehova"); witness->set_level(3); witness->set_al(100); witness->set_short("One of Jehova's Witnesses"); witness->set_long("This is person is a Witness of Jehova.\n" + "He is not actually ugly, and he shows no obvious signs of insanity,\n" + "but he has that unmistakable look of a disciple of Jehova.\n" + "If he came knocking on your door,\n" + "you wouldn't let him in.\n"); witness->set_aggressive(0); witness->set_male(); witness->set_spell_mess1("Witness tries to exorcise a demon from his attacker."); witness->set_spell_mess2("Witness tries to exorcise a demon from you. Ouch! That hurt!"); witness->set_chance(20); witness->set_spell_dam(10); if (!chat_str) setup_arrays(); witness->load_chat(50, chat_str); witness->load_a_chat(50, a_chat_str); move_object(witness, this_object()); } } /* extra_reset */
void reset(int arg) { ::reset(arg); if( !arg ) { object crown; set_name("frog"); set_alias("toad"); set_short("a frog"); set_long("It is your typical frog: small, green, and warty. However,\n"+ "perched atop its head is a tiny crown. Perhaps it is a prince\n"+ "or princess enchanted by some witch?\n"); set_race("frog"); set_level(1); set_frog(1); set_wc(4); crown = clone_object("/std/simple_armour"); crown->set_name("crown"); crown->add_alias("iron crown"); crown->set_short("An iron crown"); crown->set_long("Actually, it is made of iron and seems to only be "+ "painted gold.\nIt is tiny and would barely fit you.\n"); crown->set_class(1); crown->set_weight(2); crown->set_type("helmet"); /* Added by Banshee. 960118 */ crown->set_value(18); move_object(crown, this_object()); command("wear crown"); } }
void makeone() { object socialism = find_player( "socialism" ); string *locations = get_dir( FROOM "*1.c" ); object monster; object room = load_object( locations[ random( sizeof( locations) )] ); tell_player( socialism, "Loaded random room." ); int gotime = random( 300 ) + 4; if( monster = present_clone( FMONS "tent2.c", room ) ) { tell_object( room, "The tendrils recede into the ground." ); destruct( monster ); call_out( "makeone", gotime ); tell_player( socialism, "Tent already in this room.\n" ); return; } move_object( clone_object( FMONS "tent2" ), room ); tell_object( room, "Tendrils erupt from the ground!\n" ); call_out( "makeone", gotime ); tell_player( socialism, "Cloned a monster in a room." ); return; }
playgrid_legal move_player(playgrid_direction direction, int x_new, int y_new, PlayGrid* grid, Square_list* updated){ playgrid_object new_object; //object at new square new_object = get_Playgrid_object(x_new,y_new,grid); //is the new square legal to move to switch(new_object){ case ROCK://try to move the rock if(ILLEGAL == move_object(x_new, y_new, direction, grid, updated) ){ return ILLEGAL; } break; case EMPTY://EMPTY is fine break; default: return ILLEGAL; break; } //everything seems fine, move player update_square( grid, EMPTY,grid->player_x, grid->player_y, updated); update_square( grid, PLAYER,x_new, y_new, updated); return LEGAL; }
go_slider() { write("You say the magic word and are transported to Slider's workroom.\n"); move_object(this_player(), "/players/slider/workroom"); this_player()->look(); return(1); }
extra_reset() { if (!mirror) { mirror = clone_object("players/morgar/mirror"); call_other(mirror, "roomset", this_object()); move_object(mirror, "players/morgar/mazeworld/entry"); } }
/** Stops listening to a channel, and resets this chat object. \a chan may be any string. * \return True on success, false otherwise (no such channel). */ int remove_channel(string chan) { DAEMON->exit(chan,this_player()); this_player()->remove_env_var_item("channels", chan); if (environment(this_object())) move_object(this_object(), environment(this_object())); return 1; }
int move(mixed dest) { // add code here to prevent disallowed moves (target is full, object // is immovable, etc.). move_object(dest); }
MDS_DATA StopwatchMsgProc(void *obj, int message, MDS_DATA extra_data) { Stopwatch *stopwatch = (Stopwatch *)obj; if (!stopwatch->alive) return NULL_DATA; switch (message) { case MESSAGE_RENDER: // single rendering if extra_data == 0 // erasing rendering if extra_data == -1 con_gotoXY(stopwatch->pos.x, stopwatch->pos.y); if (extra_data.integer == 0) { char *buffer = (char *)malloc(stopwatch->size.x + 1); int s = stopwatch->msec / 1000; if (buffer == NULL) break; sprintf(buffer, "%02i:%02i:%02i", s / 3600, (s % 3600) / 60, s % 60); if (stopwatch->active) con_outTxt("<%*s>", stopwatch->size.x-2, buffer); else con_outTxt("[%*s]", stopwatch->size.x-2, buffer); free(buffer); } else con_outTxt("%*s", stopwatch->size.x, ""); break; case MESSAGE_MOVE: move_object((Object *)stopwatch, extra_data.integer); break; case MDS_MESSAGE_KEY_PRESSED: process_keys((Object *)stopwatch, extra_data.integer); break; case MESSAGE_FOCUS: set_activity((Object *)stopwatch, extra_data.integer); break; case MESSAGE_STOPWATCH_START: stopwatch->running = !stopwatch->running; if (stopwatch->running) { ++(stopwatch->msg_id.integer); MDS_postMessage(stopwatch, MESSAGE_STOPWATCH_INC, stopwatch->msg_id, STOPWATCH_INC); } break; case MESSAGE_STOPWATCH_INC: if (extra_data.integer == stopwatch->msg_id.integer) { stopwatch->msec += STOPWATCH_INC; if (stopwatch->running) MDS_postMessage(stopwatch, MESSAGE_STOPWATCH_INC, stopwatch->msg_id, STOPWATCH_INC); } break; } return NULL_DATA; }
void extra_create() { object ob; set_name( "Paula Spleen" ); add_alias( "paula" ); add_alias( "spleen" ); add_alias( "paula spleen" ); add_alias( "Paula Spleen" ); set_short( "Paula Spleen" ); set_long( "This here be Paula. She is famous round these parts fer " "being the best durn cook this side-a the mississipper. " "She sure must love herself some butter, cuz she's five " "hunred pounds if shesa ounce yessireeee yeeehawwww." ); set_race( "pig" ); set_gender( "female" ); set_alignment( 250 ); set_stat( "str", 500 ); set_stat( "int", 1 ); set_stat( "wil", 800 ); set_stat( "con", 500 ); set_stat( "dex", 300 ); set_stat( "chr", 1500 ); set_max_fatigue( 25000 ); set_natural_ac ( 10 ); set_proficiency( "pig-fu", 6 ); set_skill( "dodge", 100 ); set_percent_bonus_exp( -15 ); add_special_attack( "chuck_butter", THISO, 10 ); ob = clone_object( ZOBJ "wig" ); move_object( ob, THISO ); ob = clone_object( ZOBJ "muumuu" ); move_object( ob, THISO ); ob = clone_object( ZOBJ "diabetes" ); if( !ob ) ob = clone_object( ZOBJ "butter" ); move_object( ob, THISO ); call_out( "gear_up", 2 ); }
make_mathilda() { object dagger, bag, torch; mathilda = clone_object("obj/monster"); /* NEW, IMPROVED monster class! */ mathilda->set_name("mathilda"); mathilda->set_level(2); mathilda->set_ep(100); mathilda->set_hp(7); mathilda->set_al(150); mathilda->set_short("Mathilda the small thief (good)"); mathilda->set_long("Mathilda is a dressed in black clothes, and she carries a dagger\n" + "and a bag to carry things in. She is probably a thief.\n" + "But something terrible has happened to Mathilda, and she\n" + "is horribly hurt. She will probably die any minute now.\n"); mathilda->set_aggressive(0); mathilda->set_spell_mess1("Mathilda bleeds a little."); mathilda->set_spell_mess2("Mathilda bleeds on you."); mathilda->set_chance(20); mathilda->set_spell_dam(0); move_object(mathilda, this_object()); /* The NEW, IMPROVED monster calls: */ if (!chat_str) setup_arrays(); mathilda->load_chat(20, chat_str); dagger = clone_object("obj/weapon"); dagger->set_name("dagger"); dagger->set_class(7); dagger->set_value(10); dagger->set_weight(1); dagger->set_short("A dagger"); dagger->set_long("This is an ordinary dagger, like the ones thieves often carry.\n"); move_object(dagger, mathilda); mathilda->init_command("wield dagger"); bag = clone_object("obj/bag"); move_object(bag, mathilda); torch = clone_object("obj/torch"); torch->set_name("torch"); torch->set_fuel(2000); torch->set_weight(1); move_object(torch, bag); } /* make_mathilda */
/** Starts listening on a new channel, and resets this chat object. \a chan may be any string. * \return True on success, false otherwise (channel already added). */ int add_channel(string chan, int silent) { if (DAEMON->enter(chan,this_player(),silent)) this_player()->add_env_var("channels", chan); else return 0; if(environment(this_object())) move_object(this_object(), environment(this_object())); return 1; }
void update_objects() { uint8_t ok = first_used_object; // object index while (ok < 255) { move_object(ok, object[ok].x, object[ok].y); ok = object[ok].next_used_object; } }
void CHSInterface::MoveObject(HS_DBREF dbObject, HS_DBREF dbTo) { #ifdef PENNMUSH // No change in code between versions moveto(dbObject, dbTo, SYSEVENT, "HSpace MoveObject"); #endif #if defined(TM3) || defined(MUX) move_object(dbObject, dbTo); #endif }
extra_reset() { object black_stone; if (!rat || !living(rat)) { rat = clone_object("obj/monster"); call_other(rat, "set_name", "rat"); call_other(rat, "set_alias", "black rat"); call_other(rat, "set_level", 3); call_other(rat, "set_short", "An ugly black rat"); call_other(rat, "set_wc", 5); call_other(rat, "set_agressive", 1); move_object(rat, this_object()); black_stone = clone_object("obj/treasure"); call_other(black_stone, "set_id", "stone"); call_other(black_stone, "set_alias", "black stone"); call_other(black_stone, "set_short", "A black stone"); call_other(black_stone, "set_value", 60); move_object(black_stone, rat); } }
void create() { #ifndef __NO_ENVIRONMENT__ if (clonep()) { string s = file_name(); sscanf(s, "%s#%*d", s); move_object(s); } #endif }
int handle_enter(string arg) { if(arg == "crypt") { move_object(THISP, "/usr/kharas/zone/cv/aradale/graveyard/room/g_025"); command("glance",THISP); return(1); } }
extra_reset() { if (!treasure) { treasure = clone_object("obj/treasure"); call_other(treasure, "set_id", "pretty rock"); call_other(treasure, "set_alias", "rock"); call_other(treasure, "set_short", "A pretty rock"); call_other(treasure, "set_weight", 1); call_other(treasure, "set_value", 15); move_object(treasure, this_object()); } }