Core/Spells: Fixed targeting selection for target type 90 (TARGET_UNIT_TARGET_MINIPET)

Closes #1776
This commit is contained in:
Shauren
2011-06-04 12:13:27 +02:00
parent 665dbfd9ae
commit 009aff2cc9
6 changed files with 5 additions and 20 deletions
-8
View File
@@ -31,14 +31,6 @@
#include "Util.h" #include "Util.h"
#include "Group.h" #include "Group.h"
char const* petTypeSuffix[MAX_PET_TYPE] =
{
"'s Minion", // SUMMON_PET
"'s Pet", // HUNTER_PET
"'s Guardian", // GUARDIAN_PET
"'s Companion" // MINI_PET
};
#define PET_XP_FACTOR 0.05f #define PET_XP_FACTOR 0.05f
Pet::Pet(Player *owner, PetType type) : Guardian(NULL, owner), Pet::Pet(Player *owner, PetType type) : Guardian(NULL, owner),
-2
View File
@@ -30,8 +30,6 @@ enum PetType
MAX_PET_TYPE = 4, MAX_PET_TYPE = 4,
}; };
extern char const* petTypeSuffix[MAX_PET_TYPE];
#define MAX_PET_STABLES 4 #define MAX_PET_STABLES 4
// stored in character_pet.slot // stored in character_pet.slot
@@ -1366,7 +1366,7 @@ enum Targets
TARGET_DEST_DEST = 87, TARGET_DEST_DEST = 87,
TARGET_DEST_DYNOBJ_NONE = 88, TARGET_DEST_DYNOBJ_NONE = 88,
TARGET_DEST_TRAJ = 89, TARGET_DEST_TRAJ = 89,
TARGET_UNIT_TARGET_PUPPET = 90, TARGET_UNIT_TARGET_MINIPET = 90,
TARGET_DEST_DEST_RANDOM_DIR_DIST = 91, TARGET_DEST_DEST_RANDOM_DIR_DIST = 91,
TARGET_UNIT_SUMMONER = 92, TARGET_UNIT_SUMMONER = 92,
TARGET_CORPSE_AREA_ENEMY_PLAYER_SRC= 93, // TODO TARGET_CORPSE_AREA_ENEMY_PLAYER_SRC= 93, // TODO
+3 -3
View File
@@ -2005,7 +2005,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
break; break;
case TARGET_UNIT_TARGET_RAID: case TARGET_UNIT_TARGET_RAID:
case TARGET_UNIT_TARGET_PARTY: case TARGET_UNIT_TARGET_PARTY:
case TARGET_UNIT_TARGET_PUPPET: case TARGET_UNIT_TARGET_MINIPET:
if (IsValidSingleTargetSpell(target)) if (IsValidSingleTargetSpell(target))
AddUnitTarget(target, i); AddUnitTarget(target, i);
break; break;
@@ -6719,8 +6719,8 @@ bool Spell::IsValidSingleTargetEffect(Unit const* target, Targets type) const
return m_caster != target && m_caster->IsInPartyWith(target); return m_caster != target && m_caster->IsInPartyWith(target);
case TARGET_UNIT_TARGET_RAID: case TARGET_UNIT_TARGET_RAID:
return m_caster->IsInRaidWith(target); return m_caster->IsInRaidWith(target);
case TARGET_UNIT_TARGET_PUPPET: case TARGET_UNIT_TARGET_MINIPET:
return target->HasUnitTypeMask(UNIT_MASK_PUPPET) && m_caster == target->GetOwner(); return target->GetGUID() == m_caster->GetCritterGUID();
default: default:
break; break;
} }
-5
View File
@@ -3034,17 +3034,12 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION))
return; return;
//summon->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as summon...
summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp
summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag); summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summon->AI()->EnterEvadeMode(); summon->AI()->EnterEvadeMode();
std::string name = m_originalCaster->GetName();
name.append(petTypeSuffix[3]);
summon->SetName(name);
break; break;
} }
default: default:
+1 -1
View File
@@ -121,7 +121,7 @@ SpellMgr::SpellMgr()
case TARGET_UNIT_SUMMONER: case TARGET_UNIT_SUMMONER:
SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER; SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER;
break; break;
case TARGET_UNIT_TARGET_PUPPET: case TARGET_UNIT_TARGET_MINIPET:
case TARGET_UNIT_TARGET_ALLY: case TARGET_UNIT_TARGET_ALLY:
case TARGET_UNIT_TARGET_RAID: case TARGET_UNIT_TARGET_RAID:
case TARGET_UNIT_TARGET_ANY: case TARGET_UNIT_TARGET_ANY: