Changeset 5 for src/map/mob.c

Show
Ignore:
Timestamp:
06/30/08 21:19:58 (17 years ago)
Author:
jinshiro
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/map/mob.c

    r1 r5  
    245245 * 1: poring list 
    246246 * 2: bloody branch list 
     247 * 3: mob_pouch list 
     248 * 4: familiar list // familiar by FlavioJS [Brain] 
    247249 * flag: 
    248250 * &1: Apply the summon success chance found in the list (otherwise get any monster from the db) 
     
    20112013                        break; 
    20122014                //Let players decide whether to retaliate versus the master or the mob. [Skotlex] 
    2013                 if (md2->master_id && battle_config.retaliate_to_master) 
    2014                         md->attacked_id = md2->master_id; 
     2015                /*if (md2->master_id && battle_config.retaliate_to_master) 
     2016                        md->attacked_id = md2->master_id;*/ 
     2017//UNCOMMENT IF ERROR OCCURS WITH CUSTOM JOBS V 
     2018//if (md2->master_id && battle_config.retaliate_to_master) 
     2019                //BEGIN Custom Jobs (blackmagic) 
     2020                        { 
     2021                //necro_retaliation config (same as above, but only works for adept/necro/warlock summons) [Brainstorm] 
     2022                if(!battle_config.necro_retaliation && (md2->class_ >= 3100 && md2->class_ <= 3235)) 
     2023                md->attacked_id = src->id; 
     2024                else md->attacked_id = md2->master_id; //All normal summons 
     2025        } 
     2026                        //end 
    20152027                else 
    20162028                        md->attacked_id = src->id; 
     
    28122824        return map_foreachinmap(mob_countslave_sub, bl->m, BL_MOB,bl->id); 
    28132825} 
     2826 
     2827//Begin Custom Jobs (blackmagic) 
     2828/// Count slaves with a certain master and class. by FlavioJS [Brain] 
     2829static int mob_countslave_class_sub(struct block_list* bl, va_list ap) 
     2830{ 
     2831        int id; 
     2832        int count; 
     2833        short* classes; 
     2834        TBL_MOB* md; 
     2835 
     2836        id = va_arg(ap, int); 
     2837        count = va_arg(ap, int); 
     2838        classes = va_arg(ap, short*); 
     2839        md = (TBL_MOB*)bl; 
     2840         
     2841        if( md->master_id == id ) 
     2842        {// has the correct master 
     2843        int i; 
     2844        for( i = 0; i < count; ++i ) 
     2845        { 
     2846                if( md->class_ == classes[i] ) 
     2847                return 1; 
     2848        } 
     2849        } 
     2850        return 0; 
     2851} 
     2852 
     2853/// Returns the number of slaves of the specified classes. by FlavioJS [Brain] 
     2854/// @param bl Master 
     2855/// @param count Number of classes 
     2856/// @param classes Array of classes 
     2857int mob_countslave_class(struct block_list* bl, int count, short* classes) 
     2858{ 
     2859        return map_foreachinmap(mob_countslave_class_sub, bl->m, BL_MOB, bl->id, count, classes); 
     2860} 
     2861 
     2862//End 
    28142863 
    28152864/*========================================== 
     
    39744023                "mob_poring.txt", 
    39754024                "mob_boss.txt", 
    3976                 "mob_pouch.txt"}; 
     4025                "mob_pouch.txt" 
     4026                //Begin custom Jobs (blackmagic 
     4027                "mob_familiar.txt" // familiar By FlavioJS [Brain] 
     4028        }; 
     4029        //end 
    39774030 
    39784031        memset(&summon, 0, sizeof(summon));