Modify eye of zomm support to be more efficient.

This commit is contained in:
Noudess
2019-10-26 10:42:00 -04:00
parent 8f5bd52e24
commit 194c61a467
6 changed files with 23 additions and 7 deletions
+7 -1
View File
@@ -109,6 +109,8 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
glm::vec2(8, 8), glm::vec2(-8, 8), glm::vec2(8, -8), glm::vec2(-8, -8)
};
NPC* swarm_pet_npc;
while (summon_count > 0) {
int pet_duration = pet.duration;
if (duration_override > 0)
@@ -122,7 +124,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
memcpy(npc_dup, made_npc, sizeof(NPCType));
}
NPC* swarm_pet_npc = new NPC(
swarm_pet_npc = new NPC(
(npc_dup != nullptr) ? npc_dup : npc_type, //make sure we give the NPC the correct data pointer
0,
GetPosition() + glm::vec4(swarmPetLocations[summon_count], 0.0f, 0.0f),
@@ -162,6 +164,10 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
summon_count--;
}
if (IsClient() && spell_id == SPELL_EYE_OF_ZOMM) {
CastToClient()->SetControlledMobId(swarm_pet_npc->GetID());
}
//the target of these swarm pets will take offense to being cast on...
if (targ != nullptr)
targ->AddToHateList(this, 1, 0);