mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 04:32:35 -04:00
Core/Db/Conditions: Add ContidionTarget column which allows selection of objects which will be checked by condition, depending on SourceTypeOrReferenceId.
So far usable only with CONDITION_SOURCE_TYPE_SPELL: ContidionTarget = 0 - check caster ContidionTarget = 1 - check explicit target
This commit is contained in:
@@ -2783,6 +2783,18 @@ void SmartScript::InstallEvents()
|
||||
}
|
||||
}
|
||||
|
||||
bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3)
|
||||
{
|
||||
if (c == 0) return true;
|
||||
if (!u || !u->ToPlayer()) return false;
|
||||
Condition cond;
|
||||
cond.mConditionType = ConditionType(uint32(c));
|
||||
cond.mConditionValue1 = uint32(v1);
|
||||
cond.mConditionValue1 = uint32(v2);
|
||||
cond.mConditionValue1 = uint32(v3);
|
||||
return cond.Meets(ConditionSourceInfo(u->ToPlayer()));
|
||||
}
|
||||
|
||||
void SmartScript::OnUpdate(uint32 const diff)
|
||||
{
|
||||
if ((mScriptType == SMART_SCRIPT_TYPE_CREATURE || mScriptType == SMART_SCRIPT_TYPE_GAMEOBJECT) && !GetBaseObject())
|
||||
|
||||
Reference in New Issue
Block a user