Adds new mob skill condition MSC_MOBNEARBYGT (#7130)

* Adds new mob skill condition MSC_MOBNEARBYGT as on official some monsters trigger skills when specific amount of other monsters are nearby.
This commit is contained in:
munkrej 2022-07-25 17:11:20 +02:00 committed by GitHub
parent 322709f78d
commit 84d295e784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 2 deletions

View File

@ -43,6 +43,7 @@
// afterskill After mob casts the specified skill.
// casttargeted When a target is in cast range (no condition value).
// rudeattacked When mob is rude attacked (no condition value).
// mobnearbygt When monsters in range become greater than specified number.
//
// Status abnormalities specified through the statuson/statusoff system:
// anybad (any type of state change) / stone / freeze / stun / sleep /

View File

@ -44,6 +44,7 @@
// afterskill After mob casts the specified skill.
// casttargeted When a target is in cast range (no condition value).
// rudeattacked When mob is rude attacked (no condition value).
// mobnearbygt When monsters in range become greater than specified number.
//
// Status abnormalities specified through the statuson/statusoff system:
// anybad (any type of state change) / stone / freeze / stun / sleep /

View File

@ -44,6 +44,7 @@
// afterskill After mob casts the specified skill.
// casttargeted When a target is in cast range (no condition value).
// rudeattacked When mob is rude attacked (no condition value).
// mobnearbygt When monsters in range become greater than specified number.
//
// Status abnormalities specified through the statuson/statusoff system:
// anybad (any type of state change) / stone / freeze / stun / sleep /

View File

@ -3765,8 +3765,9 @@ int mobskill_use(struct mob_data *md, t_tick tick, int event)
case MSC_MASTERATTACKED:
flag = (md->master_id > 0 && (fbl=map_id2bl(md->master_id)) && unit_counttargeted(fbl) > 0); break;
case MSC_ALCHEMIST:
flag = (md->state.alchemist);
break;
flag = (md->state.alchemist); break;
case MSC_MOBNEARBYGT:
flag = (map_foreachinallrange(mob_count_sub, &md->bl, AREA_SIZE, BL_MOB) > c2 ); break;
}
}
@ -5794,6 +5795,7 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current)
{ "masterattacked", MSC_MASTERATTACKED },
{ "alchemist", MSC_ALCHEMIST },
{ "onspawn", MSC_SPAWN },
{ "mobnearbygt", MSC_MOBNEARBYGT },
}, cond2[] ={
{ "anybad", -1 },
{ "stone", SC_STONE },

View File

@ -430,6 +430,7 @@ enum e_mob_skill_condition {
MSC_MASTERATTACKED,
MSC_ALCHEMIST,
MSC_SPAWN,
MSC_MOBNEARBYGT,
};
// The data structures for storing delayed item drops