Core/Auras: tidy up one little hack
Port From (https://github.com/TrinityCore/TrinityCore/commit/9d16dce63365502b45561ce972178a780272b146)
This commit is contained in:
@@ -1155,8 +1155,19 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint GetModelForForm(ShapeShiftForm form)
|
public uint GetModelForForm(ShapeShiftForm form, uint spellId)
|
||||||
{
|
{
|
||||||
|
// Hardcoded cases
|
||||||
|
switch (spellId)
|
||||||
|
{
|
||||||
|
case 7090: // Bear Form
|
||||||
|
return 29414;
|
||||||
|
case 35200: // Roc Form
|
||||||
|
return 4877;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Player thisPlayer = ToPlayer();
|
Player thisPlayer = ToPlayer();
|
||||||
if (thisPlayer != null)
|
if (thisPlayer != null)
|
||||||
{
|
{
|
||||||
@@ -2134,17 +2145,24 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint modelId;
|
|
||||||
|
var shapeshiftAura = GetAuraEffectsByType(AuraType.ModShapeshift);
|
||||||
|
|
||||||
// transform aura was found
|
// transform aura was found
|
||||||
if (handledAura != null)
|
if (handledAura != null)
|
||||||
handledAura.HandleEffect(this, AuraEffectHandleModes.SendForClient, true);
|
handledAura.HandleEffect(this, AuraEffectHandleModes.SendForClient, true);
|
||||||
// we've found shapeshift
|
// we've found shapeshift
|
||||||
else if ((modelId = GetModelForForm(GetShapeshiftForm())) != 0)
|
else if (!shapeshiftAura.Empty()) // we've found shapeshift
|
||||||
{
|
{
|
||||||
if (!ignorePositiveAurasPreventingMounting || !IsDisallowedMountForm(0, GetShapeshiftForm(), modelId))
|
// only one such aura possible at a time
|
||||||
SetDisplayId(modelId);
|
uint modelId = GetModelForForm(GetShapeshiftForm(), shapeshiftAura[0].GetId());
|
||||||
else
|
if (modelId != 0)
|
||||||
SetDisplayId(GetNativeDisplayId());
|
{
|
||||||
|
if (!ignorePositiveAurasPreventingMounting || !IsDisallowedMountForm(0, GetShapeshiftForm(), modelId))
|
||||||
|
SetDisplayId(modelId);
|
||||||
|
else
|
||||||
|
SetDisplayId(GetNativeDisplayId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// no auras found - set modelid to default
|
// no auras found - set modelid to default
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1292,23 +1292,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
Unit target = aurApp.GetTarget();
|
Unit target = aurApp.GetTarget();
|
||||||
ShapeShiftForm form = (ShapeShiftForm)GetMiscValue();
|
ShapeShiftForm form = (ShapeShiftForm)GetMiscValue();
|
||||||
|
uint modelid = target.GetModelForForm(form, GetId());
|
||||||
uint modelid = 0;
|
|
||||||
|
|
||||||
switch (GetId())
|
|
||||||
{
|
|
||||||
// Bear Form
|
|
||||||
case 7090:
|
|
||||||
modelid = 29414;
|
|
||||||
break;
|
|
||||||
// Roc Form
|
|
||||||
case 35200:
|
|
||||||
modelid = 4877;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
modelid = target.GetModelForForm(form);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user