PDA

Просмотр полной версии : Creature type critter


Den
22.12.2010, 19:54
Суть проблемы:
На офе за критчеров при ударе - воину регенится ярость, а дк сила рун.
У нас же нет. Тогда зачем данный кусок кода ? :confused:
Если:
1) скининг с критчеров проверяется в другом месте.
2) прокачка скилов тоже.
3) с лутом конкретных критчеров всё ок.
Да, при удалении куска кода за них начисляется опыт, нашел решение в Formulas.h
Быть может я ошибаюсь и какойто баг всплывает, при удалении этого куска кода ?

diff --git a/src/game/Formulas.h b/src/game/Formulas.h
index 46c5800..fbbc147 100644
--- a/src/game/Formulas.h
+++ b/src/game/Formulas.h
@@ -112,7 +112,8 @@ namespace MaNGOS
{
if(u->GetTypeId()==TYPEID_UNIT && (
((Creature*)u)->IsTotem() || ((Creature*)u)->IsPet() ||
- (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ))
+ (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ||
+ ((Creature*)u)->GetCreatureInfo()->type == CREATURE_TYPE_CRITTER))
return 0;

uint32 xp_gain= BaseGain(pl->getLevel(), u->getLevel(), GetContentLevelsForMapAndZone(pl->GetMapId(),pl->GetZoneId()));
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b3fe869..7035802 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -560,35 +560,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (!spellProto || !(spellProto->Mechanic == MECHANIC_ROOT || IsSpellHaveAura(spellProto,SPELL_AURA_MOD_ROOT)))
pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_ROOT, damage);

- // no xp,health if type 8 /critters/
- if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER)
- {
- // TODO: fix this part
- // Critter may not die of damage taken, instead expect it to run away (no fighting back)
- // If (this) is TYPEID_PLAYER, (this) will enter combat w/victim, but after some time, automatically leave combat.
- // It is unclear how it should work for other cases.
-
- ((Creature*)pVictim)->SetLootRecipient(this);
-
- pVictim->SetDeathState(JUST_DIED);
- pVictim->SetHealth(0);
-
- // allow loot only if has loot_id in creature_template
- ((Creature*)pVictim)->PrepareBodyLootState();
- ((Creature*)pVictim)->AllLootRemovedFromCorpse();
-
- // some critters required for quests (need normal entry instead possible heroic in any cases)
- if (GetTypeId() == TYPEID_PLAYER)
- {
- if (CreatureInfo const* normalInfo = ObjectMgr::GetCreatureTemplate(pVictim->GetEntry()))
- ((Player*)this)->KilledMonster(normalInfo, pVictim->GetObjectGuid());
- }
-
- DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE, "DealDamage critter, critter dies");
-
- return damage;
- }
-
DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE,"DealDamageStart");

uint32 health = pVictim->GetHealth();