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 |
| 2826 | |
| 2827 | //Begin Custom Jobs (blackmagic) |
| 2828 | /// Count slaves with a certain master and class. by FlavioJS [Brain] |
| 2829 | static 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 |
| 2857 | int 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 |