aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-02-05 15:39:22 +0100
committerShauren <shauren.trinity@gmail.com>2017-02-05 15:39:22 +0100
commite1f14215d86fc9f0cd041f0e87bf0a689c086329 (patch)
tree6bc81f6754f793687ecc5a92316e2f33bd3eb840 /src/server/scripts/EasternKingdoms
parent38d0340c198caa73494c22876079a9b34b1dfdba (diff)
Core/Creatures: Various fixes for creatures, regarding combat conditions, despawning, and few others (#18998)
* Made some changes to kiting mechanics, simplified code and made taunt auras prolong combat no matter the distance from the spawn Unified some creature despawning code, removed some brutal direct calls in scripts Don't play death anim on forced despawn Removed some redundant visibility changes on creature despawn Fixed possible problem with pet initializing template info from difficulty greater than normal Properly keep UNIT_FLAG_IN_COMBAT on UpdateEntry call Moved RegenerateMana function to general Regenerate(Power) function Fixed increased health regeneration from polymorph for pets Implemented CREATURE_TYPE_FLAG_GHOST_VISIBLE, those creatures will be properly seen when player is dead also Removed hackfix from Gaeriyan and Franclorn Forgewright, fixed properly Simplified ForcedRespawnTime code in ForcedDespawn Do not allow to assist unit while evading or when enemy is evading Do not allow to attack other units when evading or when the unit is evading Corrected distance checking code before creature is allowed to evade, should fix some common problems Properly return summon position for summoned creatures as their respawn position Properly stop all moving units on gossip hello, no matter their npc flags
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp12
5 files changed, 10 insertions, 17 deletions
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index 0ff1744457e..eb65bf1dfb3 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -193,10 +193,7 @@ public:
{
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
{
- if (summon->IsAlive())
- summon->DisappearAndDie();
- else
- summon->RemoveCorpse();
+ summon->DespawnOrUnsummon();
}
}
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index 8f1e35a0219..264a21d880f 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -479,8 +479,7 @@ public:
}
else
{
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- me->RemoveCorpse();
+ me->DespawnOrUnsummon();
}
}
void EnterCombat(Unit* /*who*/) override { }
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index 53569bdce2a..f2941a5b314 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -502,9 +502,7 @@ public:
me->SummonCreature(NPC_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
}
(*i)->SetVisible(false);
- (*i)->setDeathState(JUST_DIED);
- if ((*i)->getDeathState() == CORPSE)
- (*i)->RemoveCorpse();
+ (*i)->DespawnOrUnsummon();
}
}
};
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index fb587cdd6e5..77b3da4eece 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -1168,8 +1168,7 @@ public:
uiTimer = 5000;
break;
case 3:
- me->KillSelf();
- me->RemoveCorpse();
+ me->DespawnOrUnsummon();
break;
}
} else uiTimer -=diff;
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index bbed195508b..854f42e16cd 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -222,8 +222,8 @@ class instance_uldaman : public InstanceMapScript
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
continue;
- target->setDeathState(JUST_DIED);
- target->RemoveCorpse();
+
+ target->DespawnOrUnsummon();
}
// Vault Walkers
@@ -232,8 +232,8 @@ class instance_uldaman : public InstanceMapScript
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
continue;
- target->setDeathState(JUST_DIED);
- target->RemoveCorpse();
+
+ target->DespawnOrUnsummon();
}
// Earthen Guardians
@@ -242,8 +242,8 @@ class instance_uldaman : public InstanceMapScript
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
continue;
- target->setDeathState(JUST_DIED);
- target->RemoveCorpse();
+
+ target->DespawnOrUnsummon();
}
}