mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Conditions: Implement CONDITION_CREATURE_TYPE - 24
This commit is contained in:
@@ -317,6 +317,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
condMeets = unit->HasUnitState(ConditionValue1);
|
||||
break;
|
||||
}
|
||||
case CONDITION_CREATURE_TYPE:
|
||||
{
|
||||
if (Creature* creature = object->ToCreature())
|
||||
condMeets = creature->GetCreatureTemplate()->type == ConditionValue1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
condMeets = false;
|
||||
break;
|
||||
@@ -1988,9 +1994,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_UNUSED_24:
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring");
|
||||
return false;
|
||||
case CONDITION_CREATURE_TYPE:
|
||||
{
|
||||
if (!cond->ConditionValue1 || cond->ConditionValue1 > CREATURE_TYPE_GAS_CLOUD)
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureType condition has non existing CreatureType in value1 (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ enum ConditionTypes
|
||||
CONDITION_UNIT_STATE = 21, // unitState 0 0 true if unit has unitState
|
||||
CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
|
||||
CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
|
||||
CONDITION_UNUSED_24 = 24, //
|
||||
CONDITION_CREATURE_TYPE = 24, // cinfo.type 0 0 true if creature_template.type = value1
|
||||
CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
|
||||
CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask
|
||||
CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
|
||||
|
||||
Reference in New Issue
Block a user