Core/Conditions: Added conditions for automatic learning spells with SkillLineAbility::AcquireMethod = 4
Port From (https://github.com/TrinityCore/TrinityCore/commit/7eaa695581589e8cb9a277f9c13ad0e3daf669a7)
This commit is contained in:
@@ -739,30 +739,22 @@ namespace Game.Conditions
|
||||
|
||||
public class ConditionSourceInfo
|
||||
{
|
||||
public ConditionSourceInfo(WorldObject target0, WorldObject target1 = null, WorldObject target2 = null)
|
||||
{
|
||||
mConditionTargets[0] = target0;
|
||||
mConditionTargets[1] = target1;
|
||||
mConditionTargets[2] = target2;
|
||||
if (target0 != null)
|
||||
mConditionMap = target0.GetMap();
|
||||
else if (target1 != null)
|
||||
mConditionMap = target1.GetMap();
|
||||
else if (target2 != null)
|
||||
mConditionMap = target2.GetMap();
|
||||
else
|
||||
mConditionMap = null;
|
||||
mLastFailedCondition = null;
|
||||
}
|
||||
|
||||
public ConditionSourceInfo(Map map)
|
||||
{
|
||||
mConditionMap = map;
|
||||
mLastFailedCondition = null;
|
||||
}
|
||||
|
||||
public WorldObject[] mConditionTargets = new WorldObject[SharedConst.MaxConditionTargets]; // an array of targets available for conditions
|
||||
public Map mConditionMap;
|
||||
public Condition mLastFailedCondition;
|
||||
|
||||
public ConditionSourceInfo(WorldObject target0, WorldObject target1 = null, WorldObject target2 = null)
|
||||
{
|
||||
mConditionTargets = [target0, target1, target2];
|
||||
|
||||
var target = target0 ?? target1 ?? target2;
|
||||
if (target != null)
|
||||
mConditionMap = target.GetMap();
|
||||
}
|
||||
|
||||
public ConditionSourceInfo(Map map)
|
||||
{
|
||||
mConditionMap = map;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1120,6 +1120,21 @@ namespace Game
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.SkillLineAbility:
|
||||
{
|
||||
var skillLineAbility = CliDB.SkillLineAbilityStorage.LookupByKey(cond.SourceEntry);
|
||||
if (skillLineAbility == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"{cond} SourceEntry in `condition` table, does not exist in SkillLineAbility.db2, ignoring.");
|
||||
return false;
|
||||
}
|
||||
if (skillLineAbility.AcquireMethod != SkillLineAbilityAcquireMethod.LearnedOrAutomaticCharLevel)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"{cond} in SkillLineAbility.db2 does not have AcquireMethod = {SkillLineAbilityAcquireMethod.LearnedOrAutomaticCharLevel} (LearnedOrAutomaticCharLevel), ignoring.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.GossipMenu:
|
||||
case ConditionSourceType.GossipMenuOption:
|
||||
case ConditionSourceType.SmartEvent:
|
||||
@@ -2712,8 +2727,8 @@ namespace Game
|
||||
}
|
||||
case WorldStateExpressionValueType.WorldState:
|
||||
{
|
||||
uint worldStateId = buffer.ReadUInt32();
|
||||
value = Global.WorldStateMgr.GetValue((int)worldStateId, map);
|
||||
int worldStateId = buffer.ReadInt32();
|
||||
value = Global.WorldStateMgr.GetValue(worldStateId, map);
|
||||
break;
|
||||
}
|
||||
case WorldStateExpressionValueType.Function:
|
||||
|
||||
Reference in New Issue
Block a user