Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Claim updates #431

Merged
merged 2 commits into from
Mar 26, 2020
Merged

Claim updates #431

merged 2 commits into from
Mar 26, 2020

Conversation

cocosolos
Copy link
Contributor

This attempts to bring claim mechanics closer to retail. Claim is currently applied in several different places, so I moved all of that to one function in battleutils, I also added a separate function to dirty exp based on party size and player level, and another for handling new unclaiming/claim passing mechanics. I tried to get this as close to retail as I could, but there's probably still things to iron out, like all claimed mobs still having the same color name. Some things this will have an effect on is anything that uses the player on mob death. There will be situations where the mob dies while unclaimed and there is no owner, such as a DoT tick.

I affirm:

  • that I agree to Project Topaz's Limited Contributor License Agreement, as written on this date
  • that I've tested my code since the last commit in the PR, and will test after any later commits

* Add var to char entity to track currently claimed mob.
* Move all claiming mechanics to claim function.
* Add unclaiming mechanics.
* Dirty exp based on max party size, clean exp when back to 100%.
* Change how claim is applied based on if player is engaged to their claimed mob.
* Properly dirty exp with spikes damage.
* Refactor Aern mixin
Copy link
Contributor

@ibm2431 ibm2431 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks cocosolos! A few questions:

How does/should this interact with switching targets in a party situation? From my reading (and please correct me if this is wrong), at the moment if a party member is the mob's owner, but then attacks another mob (spell, WS, etc), that original mob's owner (attacker->PClaimedMob) is wiped in claimMob, but relinquishClaim isn't called to attempt to pass on the claim to another party member.

src/map/utils/battleutils.cpp Outdated Show resolved Hide resolved
Comment on lines +730 to +733
PTarget = static_cast<CBattleEntity*>(state.GetTarget());
if (PTarget->isDead())
{
battleutils::ClaimMob(PTarget, this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize the secondary targets shouldn't, but shouldn't the primary target of the AoE always get claimed?

(Same for magic too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I read that mobskills don't actually claim, only normal attacks/magic, but I may be wrong about that. Magic should be claiming the primary target.

@ibm2431 ibm2431 changed the base branch from release to claim March 24, 2020 21:28
@ibm2431 ibm2431 added the reviewed Has been reviewed by at least one Staff Member label Mar 24, 2020
@cocosolos
Copy link
Contributor Author

Switching targets doesn't call relinquishClaim, only actually disengaging from a mob. So if you're the owner and switch targets the mob will go unclaimed unless another party member hits it first.

@ibm2431
Copy link
Contributor

ibm2431 commented Mar 25, 2020

Re: Switching targets, a player who has claim attacking another mob calls a clean for the owner ID of the mob they originally had claim on:

if (PDefender->isAlive() && attacker->PClaimedMob && attacker->PClaimedMob != PDefender
&& attacker->PClaimedMob->isAlive() && attacker->PClaimedMob->m_OwnerID.id == attacker->id)
    { // unclaim any other living mobs owned by attacker
        attacker->PClaimedMob->m_OwnerID.clean();
        attacker->PClaimedMob->updatemask |= UPDATE_STATUS;
        attacker->PClaimedMob = nullptr;

Which, unlike in RelinquishClaim, doesn't attempt to find another party member to pass claim onto.

Scenario:

  1. Members A and B have taken aggressive action against a mob
  2. Member A was the last one to do so, their ID is currently the one set in m_OwnerID
  3. Member A, without taking an action which would trigger a ReliniquishClaim call, attacks another mob

What happens to the claim which should pass onto Member B?

@cocosolos
Copy link
Contributor Author

In that scenario, the mob is supposed to go unclaimed. Unless Member B does an action to become the owner before Member A performs a claiming action on another mob, claim will drop. Member B will still have that mob as their ClaimedMob, but the mob loses its owner. This is supposed to happen.

@59blargedy
Copy link
Contributor

59blargedy commented Mar 25, 2020

https://youtu.be/BWZDHvzbns4
perhaps changed at some point. tested:
lvl 32 rng, lvl 99 rdm.
lvl 32 engaged sole member of party, received outside cures, xp.
32 engaged, 99 buffed, 99 dropped, no xp.
32 engaged 99 buffed with flurry (in case multiple buffs/regen messing things up), 99 dropped, no xp
32 engaged 99 dropped, cured outside, no xp
32 engaged 99 dropped, no 99 action, no xp
(all on xp bearing mobs

Copy link
Contributor

@KnowOne134 KnowOne134 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

been testing and seems to be good

@ibm2431
Copy link
Contributor

ibm2431 commented Mar 26, 2020

In that scenario, the mob is supposed to go unclaimed.

Even if Member B is still engaged?

@cocosolos
Copy link
Contributor Author

In that scenario, the mob is supposed to go unclaimed.

Even if Member B is still engaged?

Yep, unless they're the owner they basically have no claim over the mob. This is also why Member A could drop party instead of attacking another mob and the mob would become exclusively theirs, Member B would auto disengage.

@ibm2431
Copy link
Contributor

ibm2431 commented Mar 26, 2020

What about a scenario of two BLMs who have both (single-target) nuked a mob, but then the one currently listed as the mob's owner decides to nuke a second?

I'm worried about people outside a party trying to yoink an NM if the one single party member who is marked as the claimant tries to deal with an add.

@cocosolos
Copy link
Contributor Author

If the owner nukes another mob, the first mob will go unclaimed. I believe this is intentional. However, anyone not in this party will have to place themselves at the top of the hate list to steal the claim. Any party member of the original owner will be able to reclaim instantly.

@zircon-tpl zircon-tpl merged commit 285ebac into project-topaz:claim Mar 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
reviewed Has been reviewed by at least one Staff Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants