diff --git a/data/sql/updates/pending_db_world/rev_1637860809744969300.sql b/data/sql/updates/pending_db_world/rev_1637860809744969300.sql new file mode 100644 index 000000000..89886ca04 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1637860809744969300.sql @@ -0,0 +1,7 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1637860809744969300'); + +-- Set proper modelid +UPDATE `creature_template` SET `modelid1`=31248, `modelid2`=31007 WHERE `entry`=38545; -- Invincible +UPDATE `creature_template` SET `modelid1`=31957, `modelid2`=31958 WHERE `entry`=40625; -- Celestial Steed +-- Invincible wrong otherGender displayID +UPDATE `creature_model_info` SET `DisplayID_Other_Gender`=0 WHERE `DisplayID` IN (31007,31248); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3437ec70c..75496f3c6 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2813,6 +2813,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo if (apply) { uint32 creatureEntry = GetMiscValue(); + uint32 displayId = 0; + uint32 vehicleId = 0; // Festive Holiday Mount if (target->HasAura(62061)) @@ -2836,23 +2838,31 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo } } - CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry); - if (!ci) + if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry)) { - LOG_ERROR("sql.sql", "AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue()); - return; + if (GetMiscValueB() > 0) // Choose proper modelid + { + displayId = GetMiscValueB() == 2 && creatureInfo->Modelid2 > 0 ? creatureInfo->Modelid2 : creatureInfo->Modelid1; + } + else // Should we choose random modelid in this case? + { + displayId = ObjectMgr::ChooseDisplayId(creatureInfo); + } + sObjectMgr->GetCreatureModelRandomGender(&displayId); + + vehicleId = creatureInfo->VehicleId; + + //some spell has one aura of mount and one of vehicle + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue()) + { + displayId = 0; + } + } + } - - uint32 displayID = ObjectMgr::ChooseDisplayId(ci); - sObjectMgr->GetCreatureModelRandomGender(&displayID); - - //some spell has one aura of mount and one of vehicle - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON - && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue()) - displayID = 0; - - target->Mount(displayID, ci->VehicleId, GetMiscValue()); + target->Mount(displayId, vehicleId, GetMiscValue()); } else {