aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/CreatureAISelector.cpp2
-rw-r--r--src/game/Object.cpp2
-rw-r--r--src/game/SharedDefines.h4
-rw-r--r--src/game/Spell.h1
-rw-r--r--src/game/SpellEffects.cpp121
-rw-r--r--src/game/TemporarySummon.cpp3
-rw-r--r--src/shared/Database/DBCStructure.h2
7 files changed, 39 insertions, 96 deletions
diff --git a/src/game/CreatureAISelector.cpp b/src/game/CreatureAISelector.cpp
index a9c2f9b5dd1..74275c8b173 100644
--- a/src/game/CreatureAISelector.cpp
+++ b/src/game/CreatureAISelector.cpp
@@ -68,7 +68,7 @@ namespace FactorySelector
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
else if(creature->isSummon() && ((TempSummon*)creature)->m_Properties)
{
- if(((TempSummon*)creature)->m_Properties->Category == SUMMON_CATEGORY_GUARDIAN
+ if(((TempSummon*)creature)->m_Properties->Category == SUMMON_CATEGORY_PET
|| ((TempSummon*)creature)->m_Properties->Type == SUMMON_TYPE_GUARDIAN
|| ((TempSummon*)creature)->m_Properties->Type == SUMMON_TYPE_MINION)
ai_factory = ai_registry.GetRegistryItem("PetAI");
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 638c1390e14..2b15fb523b8 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1650,7 +1650,7 @@ TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float a
uint32 mask = SUMMON_MASK_SUMMON;
if(properties)
{
- if(properties->Category == SUMMON_CATEGORY_GUARDIAN
+ if(properties->Category == SUMMON_CATEGORY_PET
|| properties->Type == SUMMON_TYPE_GUARDIAN
|| properties->Type == SUMMON_TYPE_MINION)
mask = SUMMON_MASK_GUARDIAN;
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index f51a8764dd8..6c28aeea2c7 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -2378,7 +2378,7 @@ enum SummonCategory
{
SUMMON_CATEGORY_WILD = 0,
SUMMON_CATEGORY_ALLY = 1,
- SUMMON_CATEGORY_GUARDIAN = 2,
+ SUMMON_CATEGORY_PET = 2,
SUMMON_CATEGORY_POSSESSED = 3,
SUMMON_CATEGORY_VEHICLE = 4,
};
@@ -2386,7 +2386,7 @@ enum SummonCategory
enum SummonType
{
SUMMON_TYPE_NONE = 0,
- SUMMON_TYPE_WILD1 = 1,
+ SUMMON_TYPE_PET = 1,
SUMMON_TYPE_GUARDIAN = 2,
SUMMON_TYPE_MINION = 3,
SUMMON_TYPE_TOTEM = 4,
diff --git a/src/game/Spell.h b/src/game/Spell.h
index 7b68bd97429..a7daf94cf22 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -270,7 +270,6 @@ class Spell
void EffectProficiency(uint32 i);
void EffectApplyAreaAura(uint32 i);
void EffectSummonType(uint32 i);
- void EffectSummon(uint32 i);
void EffectLearnSpell(uint32 i);
void EffectDispel(uint32 i);
void EffectDualWield(uint32 i);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index a95c1dac11f..9651a15f88d 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3285,106 +3285,47 @@ void Spell::EffectSummonType(uint32 i)
if(!entry)
return;
- switch(m_spellInfo->EffectMiscValueB[i])
+ SummonPropertiesEntry const *properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[i]);
+ if(!properties)
+ {
+ sLog.outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->EffectMiscValueB[i]);
+ return;
+ }
+
+ switch(properties->Category)
{
- case SUMMON_TYPE_WILD:
- case SUMMON_TYPE_FROZEN_EARTH:
- case SUMMON_TYPE_LIGHTWELL:
- EffectSummonWild(i);
- break;
- case SUMMON_TYPE_DEMON:
- EffectSummonDemon(i);
- break;
- case SUMMON_TYPE_SUMMON:
- EffectSummon(i);
- break;
default:
- {
- SummonPropertiesEntry const *properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[i]);
- if(!properties)
+ switch(properties->Type)
{
- sLog.outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->EffectMiscValueB[i]);
- return;
- }
- switch(properties->Category)
- {
- default:
- switch(properties->Type)
- {
- case SUMMON_TYPE_GUARDIAN:
- case SUMMON_TYPE_MINION:
- SummonGuardian(entry, properties);
- break;
- case SUMMON_TYPE_VEHICLE:
- SummonVehicle(entry, properties);
- break;
- case SUMMON_TYPE_TOTEM:
- SummonTotem(entry, properties);
- break;
- case SUMMON_TYPE_MINIPET:
- EffectSummonCritter(i);
- break;
- default:
- EffectSummonWild(i);
- break;
- }
- break;
- case SUMMON_CATEGORY_GUARDIAN:
+ case SUMMON_TYPE_PET:
+ case SUMMON_TYPE_GUARDIAN:
+ case SUMMON_TYPE_MINION:
SummonGuardian(entry, properties);
break;
- case SUMMON_CATEGORY_POSSESSED:
- SummonPossessed(entry, properties);
- break;
- case SUMMON_CATEGORY_VEHICLE:
+ case SUMMON_TYPE_VEHICLE:
SummonVehicle(entry, properties);
break;
+ case SUMMON_TYPE_TOTEM:
+ SummonTotem(entry, properties);
+ break;
+ case SUMMON_TYPE_MINIPET:
+ EffectSummonCritter(i);
+ break;
+ default:
+ EffectSummonWild(i);
+ break;
}
break;
- }
- }
-}
-
-void Spell::EffectSummon(uint32 i)
-{
- uint32 pet_entry = m_spellInfo->EffectMiscValue[i];
- if(!pet_entry)
- return;
-
- if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER)
- {
- EffectSummonWild(i);
- return;
- }
-
- Player *owner = (Player*)m_originalCaster;
-
- if(owner->GetPetGUID())
- return;
-
- // Summon in dest location
- float x,y,z;
- if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
- {
- x = m_targets.m_destX;
- y = m_targets.m_destY;
- z = m_targets.m_destZ;
+ case SUMMON_CATEGORY_PET:
+ SummonGuardian(entry, properties);
+ break;
+ case SUMMON_CATEGORY_POSSESSED:
+ SummonPossessed(entry, properties);
+ break;
+ case SUMMON_CATEGORY_VEHICLE:
+ SummonVehicle(entry, properties);
+ break;
}
- else
- m_caster->GetClosePoint(x,y,z,owner->GetObjectSize());
-
- Pet *spawnCreature = owner->SummonPet(pet_entry, x, y, z, m_caster->GetOrientation(), SUMMON_PET, GetSpellDuration(m_spellInfo));
- if(!spawnCreature)
- return;
-
- spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
- spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
-
- std::string name = owner->GetName();
- name.append(petTypeSuffix[spawnCreature->getPetType()]);
- spawnCreature->SetName( name );
-
- spawnCreature->SetReactState( REACT_DEFENSIVE );
}
void Spell::EffectLearnSpell(uint32 i)
diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
index f837cfbae8b..8f3988994fb 100644
--- a/src/game/TemporarySummon.cpp
+++ b/src/game/TemporarySummon.cpp
@@ -189,6 +189,9 @@ void TempSummon::InitSummon(uint32 duration)
owner->m_TotemSlot[slot] = GetGUID();
}
}
+
+ if(m_Properties->Faction)
+ setFaction(m_Properties->Faction);
}
void TempSummon::SetTempSummonType(TempSummonType type)
diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h
index bc44caa8127..15a23211869 100644
--- a/src/shared/Database/DBCStructure.h
+++ b/src/shared/Database/DBCStructure.h
@@ -1426,7 +1426,7 @@ struct SummonPropertiesEntry
{
uint32 Id; // 0
uint32 Category; // 1, 0 - can't be controlled?, 1 - something guardian?, 2 - pet?, 3 - something controllable?, 4 - taxi/mount?
- uint32 Unk2; // 2, 14 rows > 0
+ uint32 Faction; // 2, 14 rows > 0
uint32 Type; // 3, see enum
uint32 Slot; // 4, 0-6
uint32 Flags; // 5