Core/Spells: - Apply proper unit flags to summoned minions

- SPELL_AURA_MOD_REPUTATION_GAIN spells (e.g Diplomacy) should increase reputation gained from spells (e.g Commendation Badges)
This commit is contained in:
Nay
2011-08-06 17:22:24 +01:00
parent 0b9a5cb37a
commit a39ea8f3e5

View File

@@ -3014,7 +3014,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
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->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
summon->AI()->EnterEvadeMode();
break;
@@ -5876,6 +5876,10 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
{
rep_change = int32((float)rep_change * repData->spell_rate);
}
// Bonus from spells that increase reputation gain
float bonus = rep_change * _player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0; // 10%
rep_change += (int32)bonus;
_player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
}