Treasure Hunter how does it work on DSP?

Thief
altnob
Posts: 10
Joined: Mon Jul 22, 2013 6:58 pm

Re: Treasure Hunter how does it work on DSP?

Post by altnob » Sat Aug 31, 2013 10:35 am

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.

User avatar
kjLotus
Lead Developer
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Treasure Hunter how does it work on DSP?

Post by kjLotus » Sat Aug 31, 2013 12:41 pm

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 ;)

User avatar
atom0s
Developer
Posts: 537
Joined: Thu Oct 25, 2012 9:52 am

Re: Treasure Hunter how does it work on DSP?

Post by atom0s » Sat Aug 31, 2013 8:54 pm

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.

ciradan
Posts: 25
Joined: Fri Jul 27, 2012 7:47 pm

Re: Treasure Hunter how does it work on DSP?

Post by ciradan » Mon Dec 09, 2013 9:08 pm

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.

Post Reply