Core/Units: treat CREATURE_FLAG_EXTRA_NO_COMBAT as a pseudo passive react state. Units with that flag will no longer enter combat with potential targets unless they are being engaged by their opponent or explicitely commanded to do so
* apply no combat flag on every creature and their difficulty entries that have been flagged in creaturedifficulty.db2
This commit is contained in:
1 parent
b36233b8f6
commit
a2fa0c2ffa
4 files changed
+15
-6
No files matched your search
@@ -0,0 +1,8 @@
|
||||
-- Default entry
|
||||
UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x2000 WHERE `entry` IN (229, 1182, 4952, 5202, 10938, 14122, 15546, 15727, 15809, 15896, 15904, 15910, 15925, 15933, 16092, 16129, 16364, 16400, 16486, 16697, 16897, 16898, 16899, 17008, 17025, 17059, 17060, 17176, 17211, 17231, 17248, 17293, 17451, 17469, 17470, 17471, 17516, 17529, 17611, 17646, 17687, 17847, 17886, 17955, 18104, 18156, 18157, 18158, 18163, 18164, 18305, 18306, 18307, 18308, 18370, 18372, 18409, 18458, 18479, 18491, 18504, 18564, 18581, 18729, 18734, 18735, 18736, 18737, 18738, 18793, 18891, 19067, 19139, 19159, 19198, 19210, 19211, 19212, 19297, 19376, 19381, 19387, 19388, 19393, 19421, 19437, 19439, 19464, 19483, 19484, 19523, 19524, 19577, 19597, 19677, 19727, 19750, 19845, 19922, 19939, 20003, 20023, 20024, 20084, 20093, 20133, 20143, 20148, 20155, 20156, 20229, 20286, 20288, 20289, 20391, 20392, 20405, 20431, 20462, 20602, 20605, 20608, 20675, 20676, 20709, 20736, 20804, 20858, 20933, 20978, 21002, 21030, 21041, 21049, 21052, 21092, 21094, 21095, 21096, 21101, 21144, 21149, 21150, 21157, 21159, 21160, 21186, 21203, 21252, 21281, 21290, 21310, 21316, 21322, 21334, 21364, 21369, 21414, 21436, 21437, 21438, 21439, 21440, 21447, 21628, 21664, 21682, 21683, 21684, 21689, 21726, 21747, 21748, 21750, 21752, 21756, 21761, 21791, 21792, 21793, 21794, 21812, 21855, 21856, 21933, 21934, 21958, 22054, 22083, 22114, 22131, 22140, 22161, 22207, 22228, 22232, 22233, 22235, 22240, 22246, 22258, 22269, 22277, 22279, 22280, 22288, 22317, 22335, 22340, 22389, 22418, 22422, 22430, 22431, 22449, 22457, 22463, 22465, 22507, 22521, 22841, 22856, 22865, 22996, 23019, 23041, 23061, 23069, 23070, 23082, 23085, 23088, 23113, 23116, 23121, 23124, 23189, 23190, 23215, 23230, 23241, 23250, 23252, 23259, 23261, 23281, 23282, 23292, 23293, 23294, 23295, 23296, 23297, 23298, 23299, 23307, 23336, 23340, 23342, 23344, 23345, 23346, 23348, 23358, 23375, 23387, 23405, 23421, 23429, 23448, 23451, 23467, 23472, 23487, 23499, 23503, 23508, 23509, 23537, 23557, 23686, 23702, 23703, 23705, 23709, 23716, 23771, 23777, 23806, 23818, 23876, 23877, 23878, 23879, 23880, 23894, 23920, 23965, 23996, 23997, 24012, 24068, 24112, 24114, 24136, 24187, 24221, 24260, 24280, 24284, 24325, 24326, 24471, 24504, 24536, 24551, 24666, 24675, 24721, 24792, 24809, 24817, 24820, 24824, 24858, 24902, 24911, 24913, 24973, 24992, 25063, 25172, 25173, 25229, 25230, 25231, 25232, 25252, 25254, 25255, 25267, 25269, 25284, 25293, 25319, 25342, 25343, 25349, 25384, 25423, 25502, 25510, 25511, 25512, 25513, 25525, 25603, 25608, 25614, 25624, 25640, 25703, 25735, 25745, 25746, 25762, 25848, 25879, 25952, 25953, 25964, 25965, 25966, 25971, 25972, 25973, 26057, 26120, 26121, 26162, 26230, 26262, 26286, 26346, 26365, 26523, 26668, 26675, 26678, 26712, 26774, 26775, 26777, 26778, 26832, 26834, 26918, 27075, 27079, 27099, 27101, 27123, 27171, 27241, 27257, 27268, 27282, 27303, 27305, 27307, 27308, 27309, 27327, 27359, 27369, 27375, 27384, 27392, 27403, 27404, 27454, 27455, 27480, 27530, 27564, 27567, 27583, 27607, 27625, 27669, 27671, 27693, 27714, 27757, 27788, 27827, 27829, 27832, 27839, 27840, 27847, 27868, 27881, 27886, 27890, 27894, 27908, 27909, 27914, 27932, 27939, 27942, 27981, 27999, 28055, 28061, 28094, 28130, 28136, 28142, 28144, 28148, 28150, 28166, 28174, 28183, 28234, 28235, 28236, 28237, 28260, 28265, 28274, 28277, 28301, 28312, 28319, 28351, 28366, 28408, 28509, 28525, 28542, 28543, 28544, 28567, 28614, 28616, 28619, 28640, 28655, 28656, 28665, 28719, 28724, 28781, 28823, 28833, 28852, 28853, 28857, 28864, 28884, 28886, 28887, 28891, 28893, 28894, 28904, 28947, 29011, 29032, 29038, 29048, 29061, 29065, 29067, 29068, 29070, 29071, 29072, 29073, 29074, 29165, 29184, 29192, 29218, 29265, 29276, 29281, 29326, 29364, 29365, 29399, 29416, 29425, 29457, 29460, 29522, 29580, 29581, 29588, 29589, 29598, 29618, 29619, 29639, 29682, 29684, 29685, 29700, 29708, 29709, 29742, 29748, 29754, 29790, 29791, 29849, 29856, 30054, 30078, 30084, 30090, 30101, 30106, 30121, 30134, 30172, 30173, 30176, 30178, 30181, 30248, 30275, 30282, 30288, 30330, 30332, 30334, 30337, 30391, 30413, 30454, 30465, 30477, 30487, 30492, 30494, 30560, 30563, 30592, 30616, 30639, 30641, 30648, 30650, 30679, 30684, 30702, 30741, 30828, 30837, 30857, 30878, 30882, 30887, 30891, 30896, 30897, 30898, 30899, 30900, 30948, 31004, 31011, 31012, 31013, 31079, 31103, 31118, 31131, 31138, 31144, 31146, 31204, 31253, 31264, 31273, 31282, 31304, 31324, 31406, 31407, 31408, 31409, 31415, 31517, 31526, 31553, 31576, 31577, 31578, 31583, 31641, 31653, 31684, 31686, 31687, 31827, 31831, 31838, 31840, 31856, 31869, 31880, 31881, 31883, 31884, 31893, 31894, 31895, 31896, 31897, 32152, 32154, 32155, 32159, 32174, 32179, 32182, 32183, 32184, 32200, 32204, 32214, 32215, 32217, 32221, 32225, 32227, 32246, 32305, 32316, 32327, 32431, 32445, 32448, 32473, 32512, 32513, 32525, 32528, 32531, 32532, 32541, 32542, 32543, 32545, 32546, 32547, 32567, 325Line truncated
|
||||
-- difficulty 1
|
||||
UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x2000 WHERE `entry` IN (30183, 20571, 20570, 20598, 20170, 20654, 20659, 20572, 20573, 21534, 21625, 21620, 21584, 21603, 30795, 30776, 30768, 30758, 30769, 31672, 31835, 31655, 31670, 25554, 25558, 30810, 30522, 30539, 30780, 30782, 30784, 30786, 30805, 30757, 31682, 32795, 31388, 31874, 31875, 31878, 32796, 30809, 31518, 31519, 31816, 32218, 32187, 31458, 31446, 31445, 31441, 31448, 31749, 31461, 31521, 30777, 31539, 31492, 31491, 31550, 31547, 32209, 33690, 33352, 33353, 34296, 34215, 33395, 33116, 34045, 33396, 34131, 33191, 34332, 33968, 33397, 33402, 34254, 33385, 34257, 34256, 33887, 33789, 33730, 33756, 33942, 34255, 33954, 33989, 34110, 34174, 34153, 34148, 34189, 34649, 34648, 35415, 35431, 35436, 35417, 35413, 35419, 35265, 35278, 35410, 35427, 35531, 35429, 35541, 35538, 35530, 35536, 35540, 35521, 35528, 35543, 35535, 35537, 35527, 35542, 35520, 35533, 35523, 35525, 35534, 35522, 35524, 35539, 35529, 35532, 35544, 35519, 35433, 35421, 36067, 36357, 36358, 38233, 38174, 37611, 38156, 38157, 38406, 38404, 38262, 38261, 38403, 38408, 38407, 38320, 38405, 38256, 38257, 38000, 38129, 38220, 38219, 38128, 38312, 39284, 38171, 38641, 38775, 38590, 38970, 38973, 39287, 48832, 49079, 40670, 40005, 40470, 43280, 40673, 50379, 49096, 49065, 49082, 49094, 51104, 49973, 51456, 51119, 51459, 51248, 49118, 50194, 50197, 48954, 49097, 49100, 49073, 49062, 49063, 49101, 45933, 49134, 48913, 51251, 48835, 49220, 57866, 50277, 50279, 54051, 53820, 54155, 54564, 57973, 57972, 57437, 57884, 57887, 57700, 57698, 57937, 57974, 57701, 57704, 58034, 57868, 57870);
|
||||
-- difficulty 2
|
||||
UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x2000 WHERE `entry` IN (35655, 35266, 35279, 38459, 38637, 38639, 38685, 38679, 38683, 38691, 38675, 38689, 38687, 38321, 38681, 38693, 38677, 38701, 38699, 39285, 38727, 38773, 38776, 38971, 38974, 39288, 40671, 40471, 43281, 40674, 51105, 49979, 51457, 51120, 51460, 51249, 49119, 50195, 50198, 51252, 53821, 58131, 58129, 57438, 57885, 57888, 57837, 57845, 57938, 58133, 57839, 57717);
|
||||
-- difficulty 3
|
||||
UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x2000 WHERE `entry` IN (35656, 35267, 35280, 38460, 38638, 38640, 38686, 38680, 38684, 38692, 38676, 38690, 38688, 38322, 38682, 38694, 38678, 38702, 38700, 39286, 38737, 38774, 38777, 38972, 38975, 39289, 40672, 40472, 43282, 40675, 51106, 49985, 51458, 51121, 51461, 51250, 49120, 50196, 50199, 51253, 51627, 53822, 58132, 58130, 57439, 57886, 57889, 57838, 57846, 57939, 58134, 57840, 57718);
|
||||
@@ -108,7 +108,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
|
||||
if (me->IsEngaged())
|
||||
return;
|
||||
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false))
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) && !me->IsIgnoringCombat() && me->CanStartAttack(who, false))
|
||||
me->EngageWithTarget(who);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,6 @@
|
||||
return false;
|
||||
if (a->HasUnitState(UNIT_STATE_IN_FLIGHT) || b->HasUnitState(UNIT_STATE_IN_FLIGHT))
|
||||
return false;
|
||||
// ... both units must not be ignoring combat
|
||||
if (a->IsIgnoringCombat() || b->IsIgnoringCombat())
|
||||
return false;
|
||||
if (a->IsFriendlyTo(b) || b->IsFriendlyTo(a))
|
||||
return false;
|
||||
Player const* playerA = a->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
@@ -2713,7 +2713,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (missInfo != SPELL_MISS_EVADE && spellHitTarget && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
|
||||
{
|
||||
if (Unit* unitCaster = m_caster->ToUnit())
|
||||
unitCaster->AtTargetAttacked(unit, m_spellInfo->HasInitialAggro());
|
||||
unitCaster->AtTargetAttacked(unit, m_spellInfo->HasInitialAggro() && !unitCaster->IsIgnoringCombat());
|
||||
|
||||
if (!unit->IsStandState())
|
||||
unit->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
@@ -7691,7 +7691,11 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier)
|
||||
return;
|
||||
|
||||
// This will only cause combat - the target will engage once the projectile hits (in DoAllEffectOnTarget)
|
||||
if (m_originalCaster && targetInfo.missCondition != SPELL_MISS_EVADE && !m_originalCaster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) && (m_spellInfo->HasInitialAggro() || unit->IsEngaged()))
|
||||
if (m_originalCaster && targetInfo.missCondition != SPELL_MISS_EVADE
|
||||
&& !m_originalCaster->IsFriendlyTo(unit)
|
||||
&& (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))
|
||||
&& (m_spellInfo->HasInitialAggro() || unit->IsEngaged())
|
||||
&& !m_originalCaster->IsIgnoringCombat())
|
||||
m_originalCaster->SetInCombatWith(unit);
|
||||
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
|
||||
Reference in new issue
Block a user