mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[10733] Implement defencive guardians pet type for creatures like 28120
This commit is contained in:
parent
10273fa38a
commit
9c0076181b
5 changed files with 18 additions and 7 deletions
|
|
@ -4105,10 +4105,11 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
|
|||
DoSummonTotem(eff_idx, summon_prop->Slot);
|
||||
break;
|
||||
case SUMMON_PROP_TYPE_CRITTER:
|
||||
DoSummonCritter(eff_idx, summon_prop->FactionId);
|
||||
// TODO: differenciate between regular 'critter' types and 'critter' that are fighting.
|
||||
// prop_id == 387 are expected to be fighting (but they have postfix 'companion').
|
||||
// Note: summon_prop->Slot==6 may be related to how selection are done for this type (need more research)
|
||||
// slot 6 set for critters that can help to player in fighting
|
||||
if (summon_prop->Slot == 6)
|
||||
DoSummonGuardian(eff_idx, summon_prop->FactionId);
|
||||
else
|
||||
DoSummonCritter(eff_idx, summon_prop->FactionId);
|
||||
break;
|
||||
case SUMMON_PROP_TYPE_PHASING:
|
||||
case SUMMON_PROP_TYPE_LIGHTWELL:
|
||||
|
|
@ -4592,6 +4593,10 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
|
|||
if (!pet_entry)
|
||||
return;
|
||||
|
||||
SummonPropertiesEntry const* propEntry = sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[eff_idx]);
|
||||
if (!propEntry)
|
||||
return;
|
||||
|
||||
// in another case summon new
|
||||
uint32 level = m_caster->getLevel();
|
||||
|
||||
|
|
@ -4623,7 +4628,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
|
|||
|
||||
for(int32 count = 0; count < amount; ++count)
|
||||
{
|
||||
Pet* spawnCreature = new Pet(GUARDIAN_PET);
|
||||
Pet* spawnCreature = new Pet(propEntry->Type == SUMMON_PROP_TYPE_CRITTER ? PROTECTOR_PET : GUARDIAN_PET);
|
||||
|
||||
Map *map = m_caster->GetMap();
|
||||
uint32 pet_number = sObjectMgr.GeneratePetNumber();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue