aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2015-12-03 21:37:33 +0100
committerMitchesD <majklprofik@seznam.cz>2015-12-03 21:37:33 +0100
commitcdb5bd3eb78ea40fbd927c5662e1dad778bf12d5 (patch)
treeff9d3aa54f82de2b1d70244ed2783d4884539dee
parent9dde78716c0e51a9f43564c3bd9e26a2e83d3b9a (diff)
Core/Conditions: extended CONDITION_NEAR_CREATURE, condition value 3 is now used to check for dead creature entries (0 - alive, 1 - dead)
* I used 0 for alive to avoid touching all conditions with this type
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp4
-rw-r--r--src/server/game/Conditions/ConditionMgr.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index e09b6a820f5..f5cb2b633ee 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -90,7 +90,7 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
{ "Phase", true, false, false },
{ "Level", true, true, false },
{ "Quest Completed", true, false, false },
- { "Near Creature", true, true, false },
+ { "Near Creature", true, true, true },
{ "Near GameObject", true, true, false },
{ "Object Entry or Guid", true, true, true },
{ "Object TypeMask", true, false, false },
@@ -282,7 +282,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
}
case CONDITION_NEAR_CREATURE:
{
- condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2) ? true : false;
+ condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3)) ? true : false;
break;
}
case CONDITION_NEAR_GAMEOBJECT:
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index d33b7edffce..aa885b7972c 100644
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -76,7 +76,7 @@ enum ConditionTypes
CONDITION_PHASEID = 26, // phaseid 0 0 true if object is in phaseid
CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded
- CONDITION_NEAR_CREATURE = 29, // creature entry distance 0 true if there is a creature of entry in range
+ CONDITION_NEAR_CREATURE = 29, // creature entry distance dead (0/1) true if there is a creature of entry in range
CONDITION_NEAR_GAMEOBJECT = 30, // gameobject entry distance 0 true if there is a gameobject of entry in range
CONDITION_OBJECT_ENTRY_GUID = 31, // TypeID entry guid true if object is type TypeID and the entry is 0 or matches entry of the object or matches guid of the object
CONDITION_TYPE_MASK = 32, // TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask