9. #SPECIALS - spetsiaalselt mõningatele mobidele kirjutatud C programmid. -------------------------------------------------------------------------- #SPECIALS * M S Mida rohkem on uues areas erinevaid (uusi) Specialeid, seda huvitavam ja omapärasem see on. Enamasti teevadki originaalsed Specialid just areast selle õige area. Speciali kirjutamine ei nõua praktiliselt üldse C keele enda tundmist, see käib juba olemasolevate käskude abil. (Varsti lülitame ka Mob-programming keele ka mängu, mis teeb nende Specialite kirjutamise veelgi lihtsamaks.) * Kommenteeriv rida. comment Kommentaar ühe rea piires. mob-vnum Mobi vnum, millele pannakse spetsiaalne lisaprogramm. spec-fun C programmile antud nimi. On olemas sellised Specialid: spec_breath_any spec_breath_acid spec_breath_fire spec_breath_frost spec_breath_gas spec_breath_lightning spec_cast_adept spec_cast_cleric spec_cast_judge spec_cast_mage spec_cast_undead spec_fido spec_guard spec_janitor spec_mayor spec_poison spec_thief spec_puff *** Näiteks kaks lühemat Specialit: bool spec_poison( CHAR_DATA *ch ) { CHAR_DATA *victim; if ( ch->position != POS_FIGHTING || ( victim = ch->fighting ) == NULL || number_percent( ) > 2 * ch->level ) return FALSE; act( "You bite $N!", ch, NULL, victim, TO_CHAR ); act( "$n bites $N!", ch, NULL, victim, TO_NOTVICT ); act( "$n bites you!", ch, NULL, victim, TO_VICT ); spell_poison( gsn_poison, ch->level, ch, victim ); return TRUE; } bool spec_janitor( CHAR_DATA *ch ) { OBJ_DATA *trash; OBJ_DATA *trash_next; if ( !IS_AWAKE(ch) ) return FALSE; for ( trash = ch->in_room->contents; trash != NULL; trash = trash_next ) { trash_next = trash->next_content; if ( !IS_SET( trash->wear_flags, ITEM_TAKE ) || !can_see_obj(ch,trash)) continue; if ( trash->item_type == ITEM_DRINK_CON || trash->item_type == ITEM_TRASH || trash->cost < 10 ) { act( "$n picks up some trash.", ch, NULL, NULL, TO_ROOM ); obj_from_room( trash ); obj_to_char( trash, ch ); return TRUE; } } return FALSE; } ** Näiteks: #SPECIALS M 3000 spec_cast_mage M 3005 spec_thief M 3011 spec_guard M 3012 spec_cast_adept M 3020 spec_cast_mage M 3021 spec_cast_cleric M 3024 spec_cast_mage M 3043 spec_cast_cleric * M 3060 spec_guard M 3061 spec_janitor M 3062 spec_fido S