diff --git a/zone/client.cpp b/zone/client.cpp index b0eca3c43..85cda94a2 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3457,7 +3457,7 @@ float Client::CalcPriceMod(Mob* other, bool reverse) float chaformula = 0; if (other) { - int factionlvl = GetFactionLevel(CharacterID(), other->CastToNPC()->GetNPCTypeID(), GetRace(), GetClass(), GetDeity(), other->CastToNPC()->GetPrimaryFaction(), other); + int factionlvl = GetFactionLevel(CharacterID(), other->CastToNPC()->GetNPCTypeID(), GetFactionRace(), GetClass(), GetDeity(), other->CastToNPC()->GetPrimaryFaction(), other); if (factionlvl >= FACTION_APPREHENSIVE) // Apprehensive or worse. { if (GetCHA() > 103) @@ -7692,7 +7692,7 @@ FACTION_VALUE Client::GetReverseFactionCon(Mob* iOther) { if (iOther->GetPrimaryFaction() == 0) return FACTION_INDIFFERENT; - return GetFactionLevel(CharacterID(), 0, GetRace(), GetClass(), GetDeity(), iOther->GetPrimaryFaction(), iOther); + return GetFactionLevel(CharacterID(), 0, GetFactionRace(), GetClass(), GetDeity(), iOther->GetPrimaryFaction(), iOther); } //o-------------------------------------------------------------- @@ -7779,7 +7779,7 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui // Find out starting faction for this faction // It needs to be used to adj max and min personal // The range is still the same, 1200-3000(4200), but adjusted for base - database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(), + database.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), faction_id[i]); if (quest) @@ -7829,7 +7829,7 @@ void Client::SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class // Find out starting faction for this faction // It needs to be used to adj max and min personal // The range is still the same, 1200-3000(4200), but adjusted for base - database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(), + database.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), faction_id); // Adjust the amount you can go up or down so the resulting range @@ -7930,9 +7930,15 @@ return; int32 Client::GetModCharacterFactionLevel(int32 faction_id) { int32 Modded = GetCharacterFactionLevel(faction_id); FactionMods fm; - if (database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(), faction_id)) + if (database.GetFactionData(&fm, GetClass(), GetFactionRace(), GetDeity(), faction_id)) + { Modded += fm.base + fm.class_mod + fm.race_mod + fm.deity_mod; + //Tack on any bonuses from Alliance type spell effects + Modded += GetFactionBonus(faction_id); + Modded += GetItemFactionBonus(faction_id); + } + return Modded; } @@ -7945,7 +7951,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction) // If a faction is involved, get the data. if (primaryfaction > 0) { - if (database.GetFactionData(&fmod, GetClass(), GetRace(), GetDeity(), primaryfaction)) { + if (database.GetFactionData(&fmod, GetClass(), GetFactionRace(), GetDeity(), primaryfaction)) { tmpFactionValue = GetCharacterFactionLevel(primaryfaction); lowestvalue = std::min(std::min(tmpFactionValue, fmod.deity_mod), std::min(fmod.class_mod, fmod.race_mod)); @@ -9126,4 +9132,4 @@ bool Client::GotoPlayer(std::string player_name) } return false; -} \ No newline at end of file +} diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 7485d7451..667601a2b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -4623,7 +4623,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) con->playerid = GetID(); con->targetid = conin->targetid; if (tmob->IsNPC()) - con->faction = GetFactionLevel(character_id, tmob->GetNPCTypeID(), race, class_, deity, (tmob->IsNPC()) ? tmob->CastToNPC()->GetPrimaryFaction() : 0, tmob); // Dec. 20, 2001; TODO: Send the players proper deity + con->faction = GetFactionLevel(character_id, tmob->GetNPCTypeID(), GetFactionRace(), class_, deity, (tmob->IsNPC()) ? tmob->CastToNPC()->GetPrimaryFaction() : 0, tmob); // Dec. 20, 2001; TODO: Send the players proper deity else con->faction = 1; con->level = GetLevelCon(tmob->GetLevel()); diff --git a/zone/embparser.cpp b/zone/embparser.cpp index c267bd857..848299580 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1046,7 +1046,7 @@ void PerlembParser::ExportMobVariables(bool isPlayerQuest, bool isGlobalPlayerQu if (mob && npcmob && mob->IsClient()) { Client* client = mob->CastToClient(); - fac = client->GetFactionLevel(client->CharacterID(), npcmob->GetID(), client->GetRace(), + fac = client->GetFactionLevel(client->CharacterID(), npcmob->GetID(), client->GetFactionRace(), client->GetClass(), client->GetDeity(), npcmob->GetPrimaryFaction(), npcmob); } } diff --git a/zone/mob.cpp b/zone/mob.cpp index 773c53767..aec319ba7 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1553,7 +1553,7 @@ void Mob::ShowStats(Client* client) } } else { - client->Message(0, " Level: %i AC: %i Class: %i Size: %1.1f Haste: %i", GetLevel(), GetAC(), GetClass(), GetSize(), GetHaste()); + client->Message(0, " Level: %i AC: %i Class: %i Size: %1.1f Haste: %i", GetLevel(), ACSum(), GetClass(), GetSize(), GetHaste()); client->Message(0, " HP: %i Max HP: %i",GetHP(), GetMaxHP()); client->Message(0, " Mana: %i Max Mana: %i", GetMana(), GetMaxMana()); client->Message(0, " Total ATK: %i Worn/Spell ATK (Cap %i): %i", GetATK(), RuleI(Character, ItemATKCap), GetATKBonus()); @@ -2121,6 +2121,16 @@ bool Mob::IsPlayerRace(uint16 in_race) { return false; } +uint16 Mob::GetFactionRace() { + uint16 current_race = GetRace(); + if (IsPlayerRace(current_race) || current_race == TREE || + current_race == MINOR_ILL_OBJ) { + return current_race; + } + else { + return (GetBaseRace()); + } +} uint8 Mob::GetDefaultGender(uint16 in_race, uint8 in_gender) { if (Mob::IsPlayerRace(in_race) || in_race == 15 || in_race == 50 || in_race == 57 || in_race == 70 || in_race == 98 || in_race == 118 || in_race == 562) { diff --git a/zone/mob.h b/zone/mob.h index ad65bab39..548a974b0 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -442,6 +442,7 @@ public: virtual void SetMaxHP() { current_hp = max_hp; } virtual inline uint16 GetBaseRace() const { return base_race; } virtual inline uint8 GetBaseGender() const { return base_gender; } + virtual uint16 GetFactionRace(); virtual inline uint16 GetDeity() const { return deity; } virtual EQEmu::deity::DeityTypeBit GetDeityBit() { return EQEmu::deity::ConvertDeityTypeToDeityTypeBit((EQEmu::deity::DeityType)deity); } inline uint16 GetRace() const { return race; } diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 660ac3273..d6e5e0535 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2845,7 +2845,7 @@ uint8 QuestManager::FactionValue() FACTION_VALUE oldfac; uint8 newfac = 0; if(initiator && owner->IsNPC()) { - oldfac = initiator->GetFactionLevel(initiator->GetID(), owner->GetID(), initiator->GetRace(), initiator->GetClass(), initiator->GetDeity(), owner->GetPrimaryFaction(), owner); + oldfac = initiator->GetFactionLevel(initiator->GetID(), owner->GetID(), initiator->GetFactionRace(), initiator->GetClass(), initiator->GetDeity(), owner->GetPrimaryFaction(), owner); // now, reorder the faction to have it make sense (higher values are better) switch (oldfac) {