void stop_fight( char_data* ch ) { char_data* rch; remove_bit( &ch->status, STAT_BERSERK ); ch->fighting = NULL; disrupt_spell( ch ); clear( ch->aggressive ); stop_events( ch, execute_leap ); for( int i = 0; i < *ch->array; i++ ) { if( ( rch = character( ch->array->list[i] ) ) == NULL ) continue; if( rch->cast != NULL && rch->cast->target == ch && spell_table[rch->cast->spell].type != STYPE_WORLD ) disrupt_spell( rch ); rch->aggressive -= ch; if( rch->fighting == ch ) rch->fighting = NULL; for( int j = rch->events-1; j >= 0; j-- ) if( rch->events[j]->pointer == (void*) ch ) { extract( rch->events[j] ); init_attack( rch ); } } }
thing_data* Obj_Data :: From( int i ) { char_data* ch; obj_data* obj; content_array* where = array; if( number > i ) { remove_weight( this, i ); number -= i; obj = duplicate( this ); obj->number = i; obj->selected = i; return obj; } Thing_Data :: From( ); if( ( ch = character( where->where ) ) != NULL && where == &ch->wearing ) unequip( ch, this ); for( int i = 0; i < *where; i++ ) if( ( ch = character( where->list[i] ) ) != NULL && ch->cast != NULL && ch->cast->target == this ) disrupt_spell( ch ); stop_events( this, execute_decay ); return this; }
void add_path( char_data* ch, char_data* summoner ) { path_data* path; event_data* event; if( ( path = make_path( ch->in_room ) ) == NULL ) return; stop_events( ch, execute_path ); stop_events( ch, execute_wander ); event = new event_data( execute_path, ch ); event->pointer = (void*) path; path->summoner = summoner; add_queue( event, 50 ); }
static void deinit_dlg(){ int i,ret; stop_events(); vib_close(); res_free_surface(keyboards); if(DEBUG) printf("INFO: Free surface %s\n",keyboard_file); res_free_surface(checkmark); }
void Obj_Data :: Extract( ) { obj_array* array; int i; if( !Is_Valid( ) ) { roach( "Extracting invalid object." ); roach( "-- Valid = %d", valid ); roach( "-- Obj = %s", this ); return; } if( this->array != NULL ) From( number ); extract( contents ); if( boot_stage == 2 ) pIndexData->count -= number; clear_queue( this ); stop_events( this ); if( save != NULL ) { array = &save->save_list; for( i = 0; ; i++ ) { if( i >= array->size ) panic( "Extract: Object not found in save array." ); if( this == array->list[i] ) { array->list[i] = NULL; save = NULL; break; } } } delete_list( affected ); free_string( source, MEM_OBJECT ); if( singular != pIndexData->singular ) free_string( singular, MEM_OBJECT ); if( plural != pIndexData->plural ) free_string( plural, MEM_OBJECT ); if( after != pIndexData->after ) free_string( after, MEM_OBJECT ); if( before != pIndexData->before ) free_string( before, MEM_OBJECT ); timer = -2; valid = -1; extracted += this; }
thing_data* Char_Data :: From( int ) { room_data* room; in_room = NULL; if( ( room = Room( array->where ) ) != NULL ) { if( pcdata != NULL ) room->area->nplayer--; stop_fight( this ); stop_events( this, execute_drown ); } Thing_Data :: From( ); return NULL; }