added some missing code.

This commit is contained in:
hondacrx
2023-05-06 07:21:37 -04:00
parent d3f0045b4b
commit 24b0836710
3 changed files with 60 additions and 5 deletions
@@ -1499,6 +1499,12 @@ namespace Game
}
break;
}
case ConditionTypes.ObjectEntryGuidLegacy:
{
cond.ConditionType = ConditionTypes.ObjectEntryGuid;
cond.ConditionValue1 = Legacy.ConvertLegacyTypeID(cond.ConditionValue1);
goto case ConditionTypes.ObjectEntryGuid;
}
case ConditionTypes.ObjectEntryGuid:
{
switch ((TypeId)cond.ConditionValue1)
@@ -1564,6 +1570,10 @@ namespace Game
}
break;
}
case ConditionTypes.TypeMaskLegacy:
cond.ConditionType = ConditionTypes.TypeMask;
cond.ConditionValue1 = Legacy.ConvertLegacyTypeMask(cond.ConditionValue1);
goto case ConditionTypes.TypeMask;
case ConditionTypes.TypeMask:
{
if (cond.ConditionValue1 == 0 || Convert.ToBoolean(cond.ConditionValue1 & ~(uint)(TypeMask.Unit | TypeMask.Player | TypeMask.GameObject | TypeMask.Corpse)))
+45
View File
@@ -1027,4 +1027,49 @@ namespace Game.Entities
return ObjectGuidFactory.CreateWorldLayer(arg1, arg2, arg3, arg4);
}
}
public class Legacy
{
public enum LegacyTypeId
{
Object = 0,
Item = 1,
Container = 2,
Unit = 3,
Player = 4,
GameObject = 5,
DynamicObject = 6,
Corpse = 7,
AreaTrigger = 8,
SceneObject = 9,
Conversation = 10,
Max
}
public static uint ConvertLegacyTypeID(uint legacyTypeID) => (LegacyTypeId)legacyTypeID switch
{
LegacyTypeId.Object => (uint)TypeId.Object,
LegacyTypeId.Item => (uint)TypeId.Item,
LegacyTypeId.Container => (uint)TypeId.Container,
LegacyTypeId.Unit => (uint)TypeId.Unit,
LegacyTypeId.Player => (uint)TypeId.Player,
LegacyTypeId.GameObject => (uint)TypeId.GameObject,
LegacyTypeId.DynamicObject => (uint)TypeId.DynamicObject,
LegacyTypeId.Corpse => (uint)TypeId.Corpse,
LegacyTypeId.AreaTrigger => (uint)TypeId.AreaTrigger,
LegacyTypeId.SceneObject => (uint)TypeId.SceneObject,
LegacyTypeId.Conversation => (uint)TypeId.Conversation,
_ => (uint)TypeId.Object
};
public static uint ConvertLegacyTypeMask(uint legacyTypeMask)
{
uint typeMask = 0;
for (uint i = (uint)LegacyTypeId.Object; i < (uint)LegacyTypeId.Max; i = i + 1)
if ((legacyTypeMask & (1 << (int)i)) != 0)
typeMask |= 1u << (int)ConvertLegacyTypeID(i);
return typeMask;
}
}
}
+5 -5
View File
@@ -371,7 +371,7 @@ namespace Scripts.Spells.Warlock
}
}
// 366330 - Random Sayaad
[Script] // 366330 - Random Sayaad
class spell_warl_random_sayaad : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
@@ -406,7 +406,7 @@ namespace Scripts.Spells.Warlock
// 366323 - Strengthen Pact - Succubus
// 366325 - Strengthen Pact - Incubus
// 366222 - Summon Sayaad
[Script] // 366222 - Summon Sayaad
class spell_warl_sayaad_precast_disorientation : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
@@ -748,7 +748,7 @@ namespace Scripts.Spells.Warlock
}
}
// 366323 - Strengthen Pact - Succubus
[Script] // 366323 - Strengthen Pact - Succubus
class spell_warl_strengthen_pact_succubus : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
@@ -770,7 +770,7 @@ namespace Scripts.Spells.Warlock
}
}
// 366325 - Strengthen Pact - Incubus
[Script] // 366325 - Strengthen Pact - Incubus
class spell_warl_strengthen_pact_incubus : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
@@ -792,7 +792,7 @@ namespace Scripts.Spells.Warlock
}
}
// 366222 - Summon Sayaad
[Script] // 366222 - Summon Sayaad
class spell_warl_summon_sayaad : SpellScript
{
public override bool Validate(SpellInfo spellInfo)