[svn] * Prevent creatures from moving if they are dead (if they were fleeing for example).
* Critters now flee from attacker when taking damage. --HG-- branch : trunk
This commit is contained in:
+19
-8
@@ -500,17 +500,25 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||||||
// no xp,health if type 8 /critters/
|
// no xp,health if type 8 /critters/
|
||||||
if ( pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER)
|
if ( pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER)
|
||||||
{
|
{
|
||||||
pVictim->setDeathState(JUST_DIED);
|
// critters run away when hit
|
||||||
pVictim->SetHealth(0);
|
pVictim->GetMotionMaster()->MoveFleeing(this);
|
||||||
|
|
||||||
// allow loot only if has loot_id in creature_template
|
// allow loot only if has loot_id in creature_template
|
||||||
CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
|
if(damage >= pVictim->GetHealth())
|
||||||
if(cInfo && cInfo->lootid)
|
{
|
||||||
pVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
pVictim->setDeathState(JUST_DIED);
|
||||||
|
pVictim->SetHealth(0);
|
||||||
|
|
||||||
// some critters required for quests
|
CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
|
||||||
if(GetTypeId() == TYPEID_PLAYER)
|
if(cInfo && cInfo->lootid)
|
||||||
((Player*)this)->KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
|
pVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||||
|
|
||||||
|
// some critters required for quests
|
||||||
|
if(GetTypeId() == TYPEID_PLAYER)
|
||||||
|
((Player*)this)->KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pVictim->ModifyHealth(- (int32)damage);
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
@@ -612,6 +620,9 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||||||
pVictim->CombatStop();
|
pVictim->CombatStop();
|
||||||
pVictim->getHostilRefManager().deleteReferences();
|
pVictim->getHostilRefManager().deleteReferences();
|
||||||
|
|
||||||
|
// stop movement
|
||||||
|
pVictim->StopMoving();
|
||||||
|
|
||||||
bool damageFromSpiritOfRedemtionTalent = spellProto && spellProto->Id == 27795;
|
bool damageFromSpiritOfRedemtionTalent = spellProto && spellProto->Id == 27795;
|
||||||
|
|
||||||
// if talent known but not triggered (check priest class for speedup check)
|
// if talent known but not triggered (check priest class for speedup check)
|
||||||
|
|||||||
Reference in New Issue
Block a user