[10734] Rename and clarify SummonPropertiesEntry.Type->Title field meaning.

This also show why we have some problems with sorting sumons by types base at this field.

Thanks to TOM_RUS for research.
This commit is contained in:
VladimirMangos 2010-11-18 22:03:23 +03:00
parent 9c0076181b
commit 98d19f4d07
4 changed files with 37 additions and 35 deletions

View file

@ -4049,25 +4049,25 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
case SUMMON_PROP_GROUP_WILD:
case SUMMON_PROP_GROUP_FRIENDLY:
{
switch(summon_prop->Type)
switch(summon_prop->Title) // better from known way sorting summons by AI types
{
case SUMMON_PROP_TYPE_OTHER:
case UNITNAME_SUMMON_TITLE_NONE:
{
// those are classical totems - effectbasepoints is their hp and not summon ammount!
//SUMMON_TYPE_TOTEM = 121: 23035, battlestands
//SUMMON_TYPE_TOTEM2 = 647: 52893, Anti-Magic Zone (npc used)
//121: 23035, battlestands
//647: 52893, Anti-Magic Zone (npc used)
if (prop_id == 121 || prop_id == 647)
DoSummonTotem(eff_idx);
else
DoSummonWild(eff_idx, summon_prop->FactionId);
break;
}
case SUMMON_PROP_TYPE_SUMMON:
case SUMMON_PROP_TYPE_ARMY:
case SUMMON_PROP_TYPE_DK:
case UNITNAME_SUMMON_TITLE_PET:
case UNITNAME_SUMMON_TITLE_MINION:
case UNITNAME_SUMMON_TITLE_RUNEBLADE:
DoSummonGuardian(eff_idx, summon_prop->FactionId);
break;
case SUMMON_PROP_TYPE_GUARDIAN:
case UNITNAME_SUMMON_TITLE_GUARDIAN:
{
if (prop_id == 61) // mixed guardians, totems, statues
{
@ -4093,7 +4093,7 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
DoSummonGuardian(eff_idx, summon_prop->FactionId);
break;
}
case SUMMON_PROP_TYPE_CONSTRUCT:
case UNITNAME_SUMMON_TITLE_CONSTRUCT:
{
if (prop_id == 2913) // Scrapbot
DoSummonWild(eff_idx, summon_prop->FactionId);
@ -4101,28 +4101,28 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
DoSummonGuardian(eff_idx, summon_prop->FactionId);
break;
}
case SUMMON_PROP_TYPE_TOTEM:
case UNITNAME_SUMMON_TITLE_TOTEM:
DoSummonTotem(eff_idx, summon_prop->Slot);
break;
case SUMMON_PROP_TYPE_CRITTER:
case UNITNAME_SUMMON_TITLE_COMPANION:
// 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:
case SUMMON_PROP_TYPE_REPAIR_BOT:
case UNITNAME_SUMMON_TITLE_OPPONENT:
case UNITNAME_SUMMON_TITLE_LIGHTWELL:
case UNITNAME_SUMMON_TITLE_BUTLER:
DoSummonWild(eff_idx, summon_prop->FactionId);
break;
case SUMMON_PROP_TYPE_SIEGE_VEH:
case SUMMON_PROP_TYPE_DRAKE_VEH:
case UNITNAME_SUMMON_TITLE_VEHICLE:
case UNITNAME_SUMMON_TITLE_MOUNT:
// TODO
// EffectSummonVehicle(i);
break;
default:
sLog.outError("EffectSummonType: Unhandled summon type %u", summon_prop->Type);
sLog.outError("EffectSummonType: Unhandled summon title %u", summon_prop->Title);
break;
}
break;
@ -4628,7 +4628,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
for(int32 count = 0; count < amount; ++count)
{
Pet* spawnCreature = new Pet(propEntry->Type == SUMMON_PROP_TYPE_CRITTER ? PROTECTOR_PET : GUARDIAN_PET);
Pet* spawnCreature = new Pet(propEntry->Title == UNITNAME_SUMMON_TITLE_COMPANION ? PROTECTOR_PET : GUARDIAN_PET);
Map *map = m_caster->GetMap();
uint32 pet_number = sObjectMgr.GeneratePetNumber();