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()}) );
/*Do not attack other NPC's*/
void CheckNPC(object ob){
 
 object env=environment(this_object());
 if(ob && !inherits(LIB_NPC, ob)){
         eventForce("kill " +ob->GetKeyName());
 }
}
Exemple #3
0
int performDivorce(object ob1){
    string spouse1, spouse2;
    object ring1, ring2, ob2;

    spouse1 = ob1->GetKeyName();
    if(!ob1->GetSpouse()){
        eventForce("say You don't appear to be married.");
        return 1;
    }
    spouse2 = lower_case(ob1->GetSpouse());
    ob2 = find_player(spouse2);

    if(!ob1->CanDivorce(ob1)){
        eventForce("say I cannot perform this divorce. Are you sure "+
                "you are still married?");
        return 1;
    }

    if(!find_player(spouse1) || !ob1 ){
        eventForce("say I'm sorry. Both spouses must be logged "+
                "on for a divorce to take place.");
        return 1;
    }

    ob1->eventDivorce(ob1);
    ob2->eventDivorce(ob2);

    ring1 = present("official wedding ring",ob1);
    ring2 = present("official wedding ring",ob2);

    if(ring1) ring1->eventDestruct();
    if(ring2) ring2->eventDestruct();

    eventForce("say The divorce is complete.");
    tell_player(spouse1,"%^RED%^You are now divorced from "+capitalize(spouse2)+"%^RESET%^!");
    tell_player(spouse2,"%^RED%^You are now divorced from "+capitalize(spouse1)+"%^RESET%^!");
    eventForce("shout this office duly records and announces that "+capitalize(spouse1) +" has divorced "+capitalize(spouse2)+"!");
    return 1;
}