Treasure Hunter how does it work on DSP?
Treasure Hunter how does it work on DSP?
I'm curiouis to know how TH works on DSP can someone fill me in?
Re: Treasure Hunter how does it work on DSP?
When a monster dies and a pool of items is found (DropList) the highest treasure hunter in the party is used as a number of tries an item can drop:
ai_mob_dummy.cpp:
The number of tries relates to the highest Treasure Hunter in the party. For example if you have two THF's, one with TH2 and one with TH3, the TH3 is considered the highest and 4 chances are given for the item to drop. (Treasure Hunter level + 1 = number of tries)
ai_mob_dummy.cpp:
Code: Select all
DropList_t* DropList = itemutils::GetDropList(m_PMob->m_DropID);
if (DropList != NULL && DropList->size())
{
uint8 highestTH = charutils::GetHighestTreasureHunter(PChar, m_PMob);
for(uint8 i = 0; i < DropList->size(); ++i)
{
//highestTH is the number of 'extra chances' at an item. If the item is obtained, then break out.
uint8 tries = 0;
while(tries < 1+highestTH)
{
if(rand()%100 < DropList->at(i).DropRate)
{
PChar->PTreasurePool->AddItem(DropList->at(i).ItemID, m_PMob);
break;
}
tries++;
}
}
}
Re: Treasure Hunter how does it work on DSP?
it also does not increase with chance on hit
Re: Treasure Hunter how does it work on DSP?
Does the thief have to make action or does it just check if it's in zone and in party/alliance?
Judging by this, thf doesn't have to make action just needs to be within 100yalms of kill. Right?
uint8 GetHighestTreasureHunter(CCharEntity* PChar, CMobEntity* PMob)
{
bool thf_in_party = true;
uint8 highestTH = PMob->m_THLvl;
if (map_config.thf_in_party_for_drops == 1) {
if(PChar->PParty != NULL) { // There's a party
if(PChar->PParty->m_PAlliance == NULL) { // but no alliance
thf_in_party = false;
for(uint8 i = 0; i < PChar->PParty->members.size(); i++) {
CCharEntity* thPChar = (CCharEntity*)PChar->PParty->members;
// THFs must be within 100 yalms in order for TH to work
if (distance(thPChar->loc.p, PMob->loc.p) < 100 && (charutils::hasTrait(thPChar, TRAIT_TREASURE_HUNTER))) {
thf_in_party = true;
break; // no point continuing to search
}
}
}
else{ // alliance
thf_in_party = false;
for(uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) {
for(uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList[a]->members.size(); i++) {
CCharEntity* thPChar = (CCharEntity*)PChar->PParty->m_PAlliance->partyList[a]->members;
if (distance(thPChar->loc.p, PMob->loc.p) < 100 && (charutils::hasTrait(thPChar, TRAIT_TREASURE_HUNTER))) {
thf_in_party = true;
break; // no point continuing to search
}
}
}
}
}
}
if (!thf_in_party) {
highestTH = 0;
}
return highestTH;
}
Judging by this, thf doesn't have to make action just needs to be within 100yalms of kill. Right?
Re: Treasure Hunter how does it work on DSP?
think it only does that if the mob has had TH applied to it (as in atom0s' post), too lazy to check
Re: Treasure Hunter how does it work on DSP?
judging by the source code it only checks if there's a thief within 100 yalms of the mob when it dies. so theoritcally a thief does not have to make action on the mob it just needs to be within exp range.kjLotus wrote:think it only does that if the mob has had TH applied to it (as in atom0s' post), too lazy to check
Re: Treasure Hunter how does it work on DSP?
checked da codez
fourth line you posted
uint8 highestTH = PMob->m_THLvl;
this is zero if a thf never hit
fourth line you posted
uint8 highestTH = PMob->m_THLvl;
this is zero if a thf never hit
Re: Treasure Hunter how does it work on DSP?
kjLotus wrote:checked da codez
fourth line you posted
uint8 highestTH = PMob->m_THLvl;
this is zero if a thf never hit
can you further elaborate on this? what i mean is can you post the source code and show me what means what as to what you're referring to? to me it just looks like it checks for <100yalms
Re: Treasure Hunter how does it work on DSP?
thf does auto attack
ai_char_normal.cpp#2624
if someone with TH never attacked, highestTH is just 0
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
Re: Treasure Hunter how does it work on DSP?
kjLotus wrote:thf does auto attack
ai_char_normal.cpp#2624Code: 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.