[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

@ -360,21 +360,21 @@ enum SummonPropGroup
}; };
// SummonProperties.dbc, col 3 // SummonProperties.dbc, col 3
enum SummonPropType enum UnitNameSummonTitle
{ {
SUMMON_PROP_TYPE_OTHER = 0, // different summons, 1330 spells in 3.0.3 UNITNAME_SUMMON_TITLE_NONE = 0, // no default title, different summons, 1330 spells in 3.0.3
SUMMON_PROP_TYPE_SUMMON = 1, // generic summons, 49 spells in 3.0.3 UNITNAME_SUMMON_TITLE_PET = 1, // 's Pet, generic summons, 49 spells in 3.0.3
SUMMON_PROP_TYPE_GUARDIAN = 2, // summon guardian, 393 spells in 3.0.3 UNITNAME_SUMMON_TITLE_GUARDIAN = 2, // 's Guardian, summon guardian, 393 spells in 3.0.3
SUMMON_PROP_TYPE_ARMY = 3, // summon army, 5 spells in 3.0.3 UNITNAME_SUMMON_TITLE_MINION = 3, // 's Minion, summon army, 5 spells in 3.0.3
SUMMON_PROP_TYPE_TOTEM = 4, // summon totem, 169 spells in 3.0.3 UNITNAME_SUMMON_TITLE_TOTEM = 4, // 's Totem, summon totem, 169 spells in 3.0.3
SUMMON_PROP_TYPE_CRITTER = 5, // critter/minipet, 195 spells in 3.0.3 UNITNAME_SUMMON_TITLE_COMPANION = 5, // 's Companion, critter/minipet, 195 spells in 3.0.3
SUMMON_PROP_TYPE_DK = 6, // summon DRW/Ghoul, 2 spells in 3.0.3 "%s's Runeblade" UNITNAME_SUMMON_TITLE_RUNEBLADE = 6, // 's Runeblade, summon DRW/Ghoul, 2 spells in 3.0.3"
SUMMON_PROP_TYPE_CONSTRUCT = 7, // summon bot/bomb, 4 spells in 3.0.3 "%s's Construct" UNITNAME_SUMMON_TITLE_CONSTRUCT = 7, // 's Construct, summon bot/bomb, 4 spells in 3.0.3
SUMMON_PROP_TYPE_PHASING = 8, // something todo with DK prequest line, 2 spells in 3.0.3 "%s's Opponent" UNITNAME_SUMMON_TITLE_OPPONENT = 8, // 's Opponent, something todo with DK prequest line, 2 spells in 3.0.3
SUMMON_PROP_TYPE_SIEGE_VEH = 9, // summon different vehicles, 14 spells in 3.0.3 "%s's Vehicle" UNITNAME_SUMMON_TITLE_VEHICLE = 9, // 's Vehicle, summon different vehicles, 14 spells in 3.0.3
SUMMON_PROP_TYPE_DRAKE_VEH = 10, // summon drake (vehicle), 3 spells UNITNAME_SUMMON_TITLE_MOUNT = 10, // 's Mount, summon drake (vehicle), 3 spells
SUMMON_PROP_TYPE_LIGHTWELL = 11, // summon lightwell, 6 spells in 3.0.3 UNITNAME_SUMMON_TITLE_LIGHTWELL = 11, // 's Lightwell, summon lightwell, 6 spells in 3.0.3
SUMMON_PROP_TYPE_REPAIR_BOT = 12 // summon repir bot, 1 spells in 3.2.2a UNITNAME_SUMMON_TITLE_BUTLER = 12 // 's Butler, summon repair bot, 1 spells in 3.2.2a
}; };
// SummonProperties.dbc, col 5 // SummonProperties.dbc, col 5

View file

@ -1631,8 +1631,10 @@ struct SummonPropertiesEntry
uint32 Id; // 0 uint32 Id; // 0
uint32 Group; // 1, enum SummonPropGroup uint32 Group; // 1, enum SummonPropGroup
uint32 FactionId; // 2, 14 rows > 0 uint32 FactionId; // 2, 14 rows > 0
uint32 Type; // 3, enum SummonPropType uint32 Title; // 3, enum UnitNameSummonTitle
uint32 Slot; // 4, if type = SUMMON_PROP_TYPE_TOTEM, its actual slot (0-6). Slot may have other uses, selection of pet type in some cases? uint32 Slot; // 4, if title = UNITNAME_SUMMON_TITLE_TOTEM, its actual slot (0-6).
// if title = UNITNAME_SUMMON_TITLE_COMPANION, slot=6 -> defensive guardian, in other cases criter/minipet
// Slot may have other uses, selection of pet type in some cases?
uint32 Flags; // 5, enum SummonPropFlags uint32 Flags; // 5, enum SummonPropFlags
}; };

View file

@ -4049,25 +4049,25 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
case SUMMON_PROP_GROUP_WILD: case SUMMON_PROP_GROUP_WILD:
case SUMMON_PROP_GROUP_FRIENDLY: 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! // those are classical totems - effectbasepoints is their hp and not summon ammount!
//SUMMON_TYPE_TOTEM = 121: 23035, battlestands //121: 23035, battlestands
//SUMMON_TYPE_TOTEM2 = 647: 52893, Anti-Magic Zone (npc used) //647: 52893, Anti-Magic Zone (npc used)
if (prop_id == 121 || prop_id == 647) if (prop_id == 121 || prop_id == 647)
DoSummonTotem(eff_idx); DoSummonTotem(eff_idx);
else else
DoSummonWild(eff_idx, summon_prop->FactionId); DoSummonWild(eff_idx, summon_prop->FactionId);
break; break;
} }
case SUMMON_PROP_TYPE_SUMMON: case UNITNAME_SUMMON_TITLE_PET:
case SUMMON_PROP_TYPE_ARMY: case UNITNAME_SUMMON_TITLE_MINION:
case SUMMON_PROP_TYPE_DK: case UNITNAME_SUMMON_TITLE_RUNEBLADE:
DoSummonGuardian(eff_idx, summon_prop->FactionId); DoSummonGuardian(eff_idx, summon_prop->FactionId);
break; break;
case SUMMON_PROP_TYPE_GUARDIAN: case UNITNAME_SUMMON_TITLE_GUARDIAN:
{ {
if (prop_id == 61) // mixed guardians, totems, statues if (prop_id == 61) // mixed guardians, totems, statues
{ {
@ -4093,7 +4093,7 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
DoSummonGuardian(eff_idx, summon_prop->FactionId); DoSummonGuardian(eff_idx, summon_prop->FactionId);
break; break;
} }
case SUMMON_PROP_TYPE_CONSTRUCT: case UNITNAME_SUMMON_TITLE_CONSTRUCT:
{ {
if (prop_id == 2913) // Scrapbot if (prop_id == 2913) // Scrapbot
DoSummonWild(eff_idx, summon_prop->FactionId); DoSummonWild(eff_idx, summon_prop->FactionId);
@ -4101,28 +4101,28 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
DoSummonGuardian(eff_idx, summon_prop->FactionId); DoSummonGuardian(eff_idx, summon_prop->FactionId);
break; break;
} }
case SUMMON_PROP_TYPE_TOTEM: case UNITNAME_SUMMON_TITLE_TOTEM:
DoSummonTotem(eff_idx, summon_prop->Slot); DoSummonTotem(eff_idx, summon_prop->Slot);
break; break;
case SUMMON_PROP_TYPE_CRITTER: case UNITNAME_SUMMON_TITLE_COMPANION:
// slot 6 set for critters that can help to player in fighting // slot 6 set for critters that can help to player in fighting
if (summon_prop->Slot == 6) if (summon_prop->Slot == 6)
DoSummonGuardian(eff_idx, summon_prop->FactionId); DoSummonGuardian(eff_idx, summon_prop->FactionId);
else else
DoSummonCritter(eff_idx, summon_prop->FactionId); DoSummonCritter(eff_idx, summon_prop->FactionId);
break; break;
case SUMMON_PROP_TYPE_PHASING: case UNITNAME_SUMMON_TITLE_OPPONENT:
case SUMMON_PROP_TYPE_LIGHTWELL: case UNITNAME_SUMMON_TITLE_LIGHTWELL:
case SUMMON_PROP_TYPE_REPAIR_BOT: case UNITNAME_SUMMON_TITLE_BUTLER:
DoSummonWild(eff_idx, summon_prop->FactionId); DoSummonWild(eff_idx, summon_prop->FactionId);
break; break;
case SUMMON_PROP_TYPE_SIEGE_VEH: case UNITNAME_SUMMON_TITLE_VEHICLE:
case SUMMON_PROP_TYPE_DRAKE_VEH: case UNITNAME_SUMMON_TITLE_MOUNT:
// TODO // TODO
// EffectSummonVehicle(i); // EffectSummonVehicle(i);
break; break;
default: default:
sLog.outError("EffectSummonType: Unhandled summon type %u", summon_prop->Type); sLog.outError("EffectSummonType: Unhandled summon title %u", summon_prop->Title);
break; break;
} }
break; break;
@ -4628,7 +4628,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
for(int32 count = 0; count < amount; ++count) 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(); Map *map = m_caster->GetMap();
uint32 pet_number = sObjectMgr.GeneratePetNumber(); uint32 pet_number = sObjectMgr.GeneratePetNumber();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10733" #define REVISION_NR "10734"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__