Merge fix

This commit is contained in:
KimLS 2017-04-15 12:18:50 -07:00
commit 004c0f7858
15 changed files with 286 additions and 191 deletions

View File

@ -56,6 +56,7 @@ RULE_REAL(Character, GroupExpMultiplier, 0.5)
RULE_REAL(Character, RaidExpMultiplier, 0.2)
RULE_BOOL(Character, UseXPConScaling, true)
RULE_INT(Character, ShowExpValues, 0) //0 - normal, 1 - Show raw experience values, 2 - Show raw experience values AND percent.
RULE_INT(Character, GreenModifier, 20)
RULE_INT(Character, LightBlueModifier, 40)
RULE_INT(Character, BlueModifier, 90)
RULE_INT(Character, WhiteModifier, 100)
@ -149,6 +150,7 @@ RULE_INT(Character, AvoidanceCap, 750) // 750 Is a pretty good value, seen peopl
RULE_BOOL(Character, AllowMQTarget, false) // Disables putting players in the 'hackers' list for targeting beyond the clip plane or attempting to target something untargetable
RULE_BOOL(Character, UseOldBindWound, false) // Uses the original bind wound behavior
RULE_BOOL(Character, GrantHoTTOnCreate, false) // Grant Health of Target's Target leadership AA on character creation
RULE_BOOL(Character, UseOldConSystem, false) // Grant Health of Target's Target leadership AA on character creation
RULE_CATEGORY_END()
RULE_CATEGORY(Mercs)

View File

@ -158,7 +158,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
if (RuleB(Aggro, UseLevelAggro))
{
if (GetLevel() < 18 && mob->GetLevelCon(GetLevel()) == CON_GREEN && GetBodyType() != 3)
if (GetLevel() < 18 && mob->GetLevelCon(GetLevel()) == CON_GRAY && GetBodyType() != 3)
{
towho->Message(0, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2);
return;
@ -166,7 +166,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
}
else
{
if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GREEN ) {
if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GRAY ) {
towho->Message(0, "...%s is red to me (basically)", mob->GetName(),
dist2, iAggroRange2);
return;
@ -339,7 +339,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
( GetLevel() >= 18 )
||(GetBodyType() == 3)
||( mob->IsClient() && mob->CastToClient()->IsSitting() )
||( mob->GetLevelCon(GetLevel()) != CON_GREEN )
||( mob->GetLevelCon(GetLevel()) != CON_GRAY)
)
&&
@ -372,7 +372,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
(
( GetINT() <= RuleI(Aggro, IntAggroThreshold) )
||( mob->IsClient() && mob->CastToClient()->IsSitting() )
||( mob->GetLevelCon(GetLevel()) != CON_GREEN )
||( mob->GetLevelCon(GetLevel()) != CON_GRAY)
)
&&
@ -443,7 +443,7 @@ int EntityList::GetHatedCount(Mob *attacker, Mob *exclude)
if (mob->IsFeared() || mob->IsMezzed())
continue;
if (attacker->GetLevelCon(mob->GetLevel()) == CON_GREEN)
if (attacker->GetLevelCon(mob->GetLevel()) == CON_GRAY)
continue;
if (!mob->CheckAggro(attacker))
@ -502,7 +502,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
{
//if they are in range, make sure we are not green...
//then jump in if they are our friend
if(mob->GetLevel() >= 50 || attacker->GetLevelCon(mob->GetLevel()) != CON_GREEN)
if(mob->GetLevel() >= 50 || attacker->GetLevelCon(mob->GetLevel()) != CON_GRAY)
{
bool useprimfaction = false;
if(mob->GetPrimaryFaction() == sender->CastToNPC()->GetPrimaryFaction())

View File

@ -2293,7 +2293,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil
else {
if (!IsLdonTreasure && MerchantType == 0) {
int conlevel = give_exp->GetLevelCon(GetLevel());
if (conlevel != CON_GREEN) {
if (conlevel != CON_GRAY) {
if (!GetOwner() || (GetOwner() && !GetOwner()->IsClient())) {
give_exp_client->AddEXP((finalxp), conlevel);
if (killer_mob && (killer_mob->GetID() == give_exp_client->GetID() || killer_mob->GetUltimateOwner()->GetID() == give_exp_client->GetID()))
@ -2589,8 +2589,10 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
AddFeignMemory(other->CastToBot()->GetBotOwner()->CastToClient());
}
else {
if (!hate_list.IsEntOnHateList(other->CastToBot()->GetBotOwner()))
if (!hate_list.IsEntOnHateList(other->CastToBot()->GetBotOwner())) {
hate_list.AddEntToHateList(other->CastToBot()->GetBotOwner(), 0, 0, false, true);
other->CastToBot()->GetBotOwner()->CastToClient()->AddAutoXTarget(this);
}
}
}
#endif //BOTS

View File

@ -2995,7 +2995,8 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) {
if(g) {
uint32 TempGroupId = g->GetID();
std::list<uint32> ActiveBots;
if (!botdb.LoadGroupedBotsByGroupID(TempGroupId, ActiveBots)) {
// Modified LoadGroupedBotsByGroupID to require a CharacterID
if (!botdb.LoadGroupedBotsByGroupID(botOwner->CharacterID(), TempGroupId, ActiveBots)) {
botOwner->Message(13, "%s", BotDatabase::fail::LoadGroupedBotsByGroupID());
return;
}
@ -3007,8 +3008,9 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) {
if(activeBot) {
activeBot->Spawn(botOwner);
g->UpdatePlayer(activeBot);
if(g->GetLeader())
activeBot->SetFollowID(g->GetLeader()->GetID());
// follow the bot owner, not the group leader we just zoned with our owner.
if(g->IsGroupMember(botOwner) && g->IsGroupMember(activeBot))
activeBot->SetFollowID(botOwner->GetID());
}
if(activeBot && !botOwner->HasGroup())
@ -7297,10 +7299,11 @@ void Bot::ProcessClientZoneChange(Client* botOwner) {
if(tempBot) {
if(tempBot->HasGroup()) {
Group* g = tempBot->GetGroup();
if(g && g->GetLeader()) {
Mob* tempGroupLeader = tempBot->GetGroup()->GetLeader();
if(tempGroupLeader && tempGroupLeader->IsClient()) {
if(tempBot->GetBotOwnerCharacterID() == tempGroupLeader->CastToClient()->CharacterID())
if(g && g->IsGroupMember(botOwner)) {
if(botOwner && botOwner->IsClient()) {
// Modified to not only zone bots if you're the leader.
// Also zone bots of the non-leader when they change zone.
if(tempBot->GetBotOwnerCharacterID() == botOwner->CharacterID() && g->IsGroupMember(botOwner))
tempBot->Zone();
else
tempBot->Camp();

View File

@ -2459,9 +2459,10 @@ bool BotDatabase::LoadBotGroupsListByOwnerID(const uint32 owner_id, std::list<st
/* Bot owner group functions */
bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 group_id, std::list<uint32>& group_list)
// added owner ID to this function to fix groups with mulitple players grouped with bots.
bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 owner_id, const uint32 group_id, std::list<uint32>& group_list)
{
if (!group_id)
if (!group_id || !owner_id)
return false;
query = StringFormat(
@ -2471,18 +2472,10 @@ bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 group_id, std::list<uint
" AND `charid` IN ("
" SELECT `bot_id`"
" FROM `bot_data`"
" WHERE `owner_id` IN ("
" SELECT `charid`"
" FROM `group_id`"
" WHERE `groupid` = '%u'"
" AND `name` IN ("
" SELECT `name`"
" FROM `character_data`"
" )"
" )"
" WHERE `owner_id` = '%u'"
" )",
group_id,
group_id
owner_id
);
auto results = QueryDatabase(query);

View File

@ -169,7 +169,7 @@ public:
/* Bot group functions */
bool LoadGroupedBotsByGroupID(const uint32 group_id, std::list<uint32>& group_list);
bool LoadGroupedBotsByGroupID(const uint32 owner_id, const uint32 group_id, std::list<uint32>& group_list);
/* Bot heal rotation functions */

View File

@ -2343,7 +2343,7 @@ bool Client::CheckIncreaseSkill(EQEmu::skills::SkillType skillid, Mob *against_w
if(against_who)
{
if(against_who->GetSpecialAbility(IMMUNE_AGGRO) || against_who->IsClient() ||
GetLevelCon(against_who->GetLevel()) == CON_GREEN)
GetLevelCon(against_who->GetLevel()) == CON_GRAY)
{
//false by default
if( !mod_can_increase_skill(skillid, against_who) ) { return(false); }

View File

@ -4755,12 +4755,22 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
else
con->faction = 1;
con->level = GetLevelCon(tmob->GetLevel());
if (ClientVersion() <= EQEmu::versions::ClientVersion::Titanium) {
if (con->level == CON_GRAY) {
con->level = CON_GREEN;
}
if (con->level == CON_WHITE) {
con->level = CON_WHITE_TITANIUM;
}
}
if (zone->IsPVPZone()) {
if (!tmob->IsNPC())
con->pvpcon = tmob->CastToClient()->GetPVP();
}
// Mongrel: If we're feigned show NPC as indifferent
// If we're feigned show NPC as indifferent
if (tmob->IsNPC())
{
if (GetFeigned())
@ -4806,6 +4816,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
case CON_BLUE:
color = 4;
break;
case CON_WHITE_TITANIUM:
case CON_WHITE:
color = 10;
break;
@ -4815,7 +4826,17 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
case CON_RED:
color = 13;
break;
case CON_GRAY:
color = 6;
break;
}
if (ClientVersion() <= EQEmu::versions::ClientVersion::Titanium) {
if (color == 6) {
color = 2;
}
}
SendColoredText(color, std::string("This creature would take an army to defeat!"));
}
safe_delete(outapp);

View File

@ -31,9 +31,11 @@
#define CON_GREEN 2
#define CON_LIGHTBLUE 18
#define CON_BLUE 4
#define CON_WHITE 20
#define CON_WHITE 10
#define CON_WHITE_TITANIUM 20
#define CON_YELLOW 15
#define CON_RED 13
#define CON_GRAY 6
#define DMG_BLOCKED -1
#define DMG_PARRIED -2

View File

@ -101,9 +101,12 @@ uint32 Client::CalcEXP(uint8 conlevel) {
if (conlevel != 0xFF) {
switch (conlevel)
{
case CON_GREEN:
case CON_GRAY:
in_add_exp = 0;
return 0;
case CON_GREEN:
in_add_exp = in_add_exp * RuleI(Character, GreenModifier) / 100;
break;
case CON_LIGHTBLUE:
in_add_exp = in_add_exp * RuleI(Character, LightBlueModifier)/100;
break;
@ -206,10 +209,14 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
if (conlevel != 0xFF && !resexp) {
switch (conlevel)
{
case CON_GREEN:
case CON_GRAY:
add_exp = 0;
add_aaxp = 0;
return;
case CON_GREEN:
add_exp = add_exp * RuleI(Character, GreenModifier) / 100;
add_aaxp = add_aaxp * RuleI(Character, GreenModifier) / 100;
break;
case CON_LIGHTBLUE:
add_exp = add_exp * RuleI(Character, LightBlueModifier)/100;
add_aaxp = add_aaxp * RuleI(Character, LightBlueModifier)/100;
@ -798,7 +805,7 @@ void Group::SplitExp(uint32 exp, Mob* other) {
groupexp += (uint32)((float)exp * groupmod * (RuleR(Character, GroupExpMultiplier)));
int conlevel = Mob::GetLevelCon(maxlevel, other->GetLevel());
if(conlevel == CON_GREEN)
if(conlevel == CON_GRAY)
return; //no exp for greenies...
if (membercount == 0)
@ -845,7 +852,7 @@ void Raid::SplitExp(uint32 exp, Mob* other) {
groupexp = (uint32)((float)groupexp * (1.0f-(RuleR(Character, RaidExpMultiplier))));
int conlevel = Mob::GetLevelCon(maxlevel, other->GetLevel());
if(conlevel == CON_GREEN)
if(conlevel == CON_GRAY)
return; //no exp for greenies...
if (membercount == 0)

View File

@ -72,9 +72,12 @@ void Mob::CheckFlee() {
float run_ratio;
switch(con) {
//these values are not 100% researched
case CON_GREEN:
case CON_GRAY:
run_ratio = fleeratio;
break;
case CON_GREEN:
run_ratio = fleeratio * 9 / 10;
break;
case CON_LIGHTBLUE:
run_ratio = fleeratio * 9 / 10;
break;

View File

@ -4293,11 +4293,17 @@ bool Merc::CheckConfidence() {
CurrentCon = this->GetLevelCon(mob->GetLevel());
switch(CurrentCon) {
case CON_GREEN: {
case CON_GRAY: {
ConRating = 0;
break;
}
case CON_GREEN: {
ConRating = 0.1;
break;
}
case CON_LIGHTBLUE: {
ConRating = 0.2;
break;

View File

@ -531,7 +531,7 @@ public:
//AI
static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel);
inline uint32 GetLevelCon(uint8 iOtherLevel) const {
return this ? GetLevelCon(GetLevel(), iOtherLevel) : CON_GREEN; }
return this ? GetLevelCon(GetLevel(), iOtherLevel) : CON_GRAY; }
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true,
bool bFrenzy = false, bool iBuffTic = false, uint16 spell_id = SPELL_UNKNOWN);
bool RemoveFromHateList(Mob* mob);

View File

@ -2010,9 +2010,13 @@ void Mob::AreaRampage(ExtraAttackOptions *opts)
}
uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
int16 diff = iOtherLevel - mylevel;
uint32 conlevel = 0;
if (RuleB(Character, UseOldConSystem))
{
int16 diff = iOtherLevel - mylevel;
if (diff == 0)
return CON_WHITE;
else if (diff >= 1 && diff <= 2)
@ -2023,14 +2027,14 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
if (mylevel <= 8)
{
if (diff <= -4)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else
conlevel = CON_BLUE;
}
else if (mylevel <= 9)
{
if (diff <= -6)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -4)
conlevel = CON_LIGHTBLUE;
else
@ -2039,7 +2043,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 13)
{
if (diff <= -7)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -5)
conlevel = CON_LIGHTBLUE;
else
@ -2048,7 +2052,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 15)
{
if (diff <= -7)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -5)
conlevel = CON_LIGHTBLUE;
else
@ -2057,7 +2061,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 17)
{
if (diff <= -8)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -6)
conlevel = CON_LIGHTBLUE;
else
@ -2066,7 +2070,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 21)
{
if (diff <= -9)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -7)
conlevel = CON_LIGHTBLUE;
else
@ -2075,7 +2079,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 25)
{
if (diff <= -10)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -8)
conlevel = CON_LIGHTBLUE;
else
@ -2084,7 +2088,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 29)
{
if (diff <= -11)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -9)
conlevel = CON_LIGHTBLUE;
else
@ -2093,7 +2097,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 31)
{
if (diff <= -12)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -9)
conlevel = CON_LIGHTBLUE;
else
@ -2102,7 +2106,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 33)
{
if (diff <= -13)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -10)
conlevel = CON_LIGHTBLUE;
else
@ -2111,7 +2115,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 37)
{
if (diff <= -14)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -11)
conlevel = CON_LIGHTBLUE;
else
@ -2120,7 +2124,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 41)
{
if (diff <= -16)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -12)
conlevel = CON_LIGHTBLUE;
else
@ -2129,7 +2133,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 45)
{
if (diff <= -17)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -13)
conlevel = CON_LIGHTBLUE;
else
@ -2138,7 +2142,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 49)
{
if (diff <= -18)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -14)
conlevel = CON_LIGHTBLUE;
else
@ -2147,7 +2151,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 53)
{
if (diff <= -19)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -15)
conlevel = CON_LIGHTBLUE;
else
@ -2156,7 +2160,7 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else if (mylevel <= 55)
{
if (diff <= -20)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -15)
conlevel = CON_LIGHTBLUE;
else
@ -2165,12 +2169,58 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
else
{
if (diff <= -21)
conlevel = CON_GREEN;
conlevel = CON_GRAY;
else if (diff <= -16)
conlevel = CON_LIGHTBLUE;
else
conlevel = CON_BLUE;
}
}
else
{
int16 diff = iOtherLevel - mylevel;
uint32 conGrayLvl = mylevel - (int32)((mylevel + 5) / 3);
uint32 conGreenLvl = mylevel - (int32)((mylevel + 7) / 4);
if (diff == 0)
return CON_WHITE;
else if (diff >= 1 && diff <= 3)
return CON_YELLOW;
else if (diff >= 4)
return CON_RED;
if (mylevel <= 15)
{
if (diff <= -6)
conlevel = CON_GRAY;
else
conlevel = CON_BLUE;
}
else
if (mylevel <= 20)
{
if (iOtherLevel <= conGrayLvl)
conlevel = CON_GRAY;
else
if (iOtherLevel <= conGreenLvl)
conlevel = CON_GREEN;
else
conlevel = CON_BLUE;
}
else
{
if (iOtherLevel <= conGrayLvl)
conlevel = CON_GRAY;
else
if (iOtherLevel <= conGreenLvl)
conlevel = CON_GREEN;
else
if (diff <= -6)
conlevel = CON_LIGHTBLUE;
else
conlevel = CON_BLUE;
}
}
return conlevel;
}

View File

@ -272,6 +272,12 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
c_type = worldo->m_type;
inst = worldo->m_inst;
worldcontainer=true;
// if we're a world container with an item, use that too
if (inst) {
const EQEmu::ItemData* item = inst->GetItem();
if (item)
some_id = item->ID;
}
}
else {
inst = user_inv.GetItem(in_combine->container_slot);