Page 2 of 2
Re: Treasure Hunter how does it work on DSP?
Posted: Sat Aug 31, 2013 10:35 am
by altnob
kjLotus wrote:thf does auto attack
ai_char_normal.cpp#2624
Code: Select all
if (charutils::hasTrait(m_PChar, TRAIT_TREASURE_HUNTER))
{
if (Monster->m_THLvl == 0)
{
Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER);
Monster->m_THPCID = m_PChar->id;
}
else if ((Monster->m_THPCID != m_PChar->id) && (Monster->m_THLvl < m_PChar->getMod(MOD_TREASURE_HUNTER))) Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER)+1;
else if ((Monster->m_THPCID == m_PChar->id) && (Monster->m_THLvl < m_PChar->getMod(MOD_TREASURE_HUNTER))) Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER);
if (Monster->m_THLvl > 12) Monster->m_THLvl = 12;
}
if someone with TH never attacked, highestTH is just 0
This is probably why I'm no good at coding. I just don't see how that's an auto attack. To me it just checks to see if char has trait. I'll take your word for it.
Re: Treasure Hunter how does it work on DSP?
Posted: Sat Aug 31, 2013 12:41 pm
by kjLotus
it isn't an auto attack, it's in the auto attack function (ActionAttack)
i just didn't want to post all five bajillion lines of the auto attack for 10 lines of relevant code
Re: Treasure Hunter how does it work on DSP?
Posted: Sat Aug 31, 2013 8:54 pm
by atom0s
Some other notes with the treasure hunter:
ai_char_normal.cpp: (
ActionRangedFinish)
Code: Select all
if (charutils::hasTrait(m_PChar, TRAIT_TREASURE_HUNTER))
{
if (Monster->m_THLvl == 0)
{
Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER);
Monster->m_THPCID = m_PChar->id;
}
else if ((Monster->m_THPCID != m_PChar->id) && (Monster->m_THLvl < m_PChar->getMod(MOD_TREASURE_HUNTER))) Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER)+1;
else if ((Monster->m_THPCID == m_PChar->id) && (Monster->m_THLvl < m_PChar->getMod(MOD_TREASURE_HUNTER))) Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER);
if (Monster->m_THLvl > 12)
Monster->m_THLvl = 12;
}
ai_char_normal.cpp: (
ActionAttack This is from auto-attacks.)
Code: Select all
if (charutils::hasTrait(m_PChar, TRAIT_TREASURE_HUNTER))
{
if (Monster->m_THLvl == 0)
{
Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER);
Monster->m_THPCID = m_PChar->id;
}
else if ((Monster->m_THPCID != m_PChar->id) && (Monster->m_THLvl < m_PChar->getMod(MOD_TREASURE_HUNTER))) Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER)+1;
else if ((Monster->m_THPCID == m_PChar->id) && (Monster->m_THLvl < m_PChar->getMod(MOD_TREASURE_HUNTER))) Monster->m_THLvl = m_PChar->getMod(MOD_TREASURE_HUNTER);
if (Monster->m_THLvl > 12) Monster->m_THLvl = 12;
}
Also inside of ActionAttack is:
Code: Select all
if(m_PChar->GetMJob() == JOB_THF && (!ignoreSneakTrickAttack) &&
m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SNEAK_ATTACK) &&
abs(m_PBattleTarget->loc.p.rotation - m_PChar->loc.p.rotation) < 23)
{
bonusDMG = m_PChar->DEX();
if(rand()%100 < 4) Monster->m_THLvl +=1;
}
To allow for white hits to randomly give an increase to the treasure hunter.
Re: Treasure Hunter how does it work on DSP?
Posted: Mon Dec 09, 2013 9:08 pm
by ciradan
Code: Select all
if(m_PChar->GetMJob() == JOB_THF && (!ignoreSneakTrickAttack) &&
m_PChar->StatusEffectContainer->HasStatusEffect(EFFECT_SNEAK_ATTACK) &&
abs(m_PBattleTarget->loc.p.rotation - m_PChar->loc.p.rotation) < 23)
{
bonusDMG = m_PChar->DEX();
if(rand()%100 < 4) Monster->m_THLvl +=1;
}
What's the point of this?
It reads like every SA has a 4% chance to increase the TH level of the mob, but from what you posted on the first page all the mob needs is a TH level of something other than 0 for the loot list to check for the highest TH on a party member.
So if the monster TH level is 25 because of a damn lot SA's the highest chance for an item is still only 4 times (considering the thf has TH 3).
Or am I missing something here?
/edit:
I just saw that my question also applies to the increase of monster TH level for auto and ranged attacks, not just for SA.