Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current draft for primal storm pets #659

Closed
wants to merge 5 commits into from
Closed

Conversation

cyriun
Copy link
Contributor

@cyriun cyriun commented Oct 10, 2023

detection for the "Elementally Imbued" buff seems to work but its still giving attempts whether the buff is present or not. For example, add a random npc id that doesn't have the correct buff to the primal storm pets in the database and it will give an attempt.

@Duckwhale
Copy link
Member

Duckwhale commented Oct 10, 2023

Assuming that the logic is correct (haven't tested it ingame), the code would behave as follows:

  • Rarity calls IsAttemptAllowed to determine whether an attempt should be added
  • Your code iterates through all active (helpful) auras on the target unit, if any exists
  • It tries to match every one of them against the required aura ID and name
  • Since there is no match, it proceeds executing the rest of the function
  • This will usually return true, leading Rarity to add an attempt for the item

In other words, you forgot return (or return false) in the case of requiredAuraNotFound. Does that sound about right?

@cyriun
Copy link
Contributor Author

cyriun commented Oct 10, 2023

gotcha, thanks i believe i do know what you mean, will get back to testing.

@cyriun
Copy link
Contributor Author

cyriun commented Oct 10, 2023

ok after adding return false it does seem to disallow attempts when the aura isnt found. So now i believe all that has to be done is re-adding all the relevant npc ids

@cyriun cyriun marked this pull request as ready for review October 10, 2023 14:24
@Duckwhale
Copy link
Member

Just FYI: I haven't forgotten about this at all, but I probably won't have time to review/test before the weekend. Thanks, though!

Copy link
Member

@Duckwhale Duckwhale left a comment

Choose a reason for hiding this comment

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

Not sure if this is now working completely, but here's the (long overdue) review. Sorry!

DB/Pets/Dragonflight.lua Show resolved Hide resolved
DB/Pets/Dragonflight.lua Show resolved Hide resolved
Core.lua Show resolved Hide resolved
Core.lua Show resolved Hide resolved
@Duckwhale
Copy link
Member

What's the state of this PR? I've rebased it to resolve the conflicts, but there seems to be at least one error:

11x Rarity/Core.lua:845: bad argument #2 to 'strsplit' (string expected, got nil)

Should I spend more time getting this to work or shelve it for now? I only took a brief look, so maybe I missed something.

these were only removed for ease of testing
roughly 4 elemental npcs spawn with the corresponding elemental storm that dont get the aura but drop the pets.
this might need another rework to fit in player aura checking to track the "Brul" pet
@cyriun
Copy link
Contributor Author

cyriun commented Feb 22, 2024

What's the state of this PR? I've rebased it to resolve the conflicts, but there seems to be at least one error:

11x Rarity/Core.lua:845: bad argument #2 to 'strsplit' (string expected, got nil)

Should I spend more time getting this to work or shelve it for now? I only took a brief look, so maybe I missed something.

ill have to resub soon and take a look but i believe it was something to do with npcids duplicated?

@Duckwhale
Copy link
Member

No need to resub just for this! But it seemed like the NPC ID was nil, so I guess something's a bit funky here still.

I'll mark this as a draft for now. Hopefully, I'll find some time to review things in detail before too long.

@Duckwhale Duckwhale marked this pull request as draft February 22, 2024 14:27
@cyriun
Copy link
Contributor Author

cyriun commented Feb 26, 2024

No need to resub just for this! But it seemed like the NPC ID was nil, so I guess something's a bit funky here still.

I'll mark this as a draft for now. Hopefully, I'll find some time to review things in detail before too long.

i was planning to resub soon anyways, sub dropped off over christmas and new years and i havent been back on yet but im sure i will be soon

@Duckwhale
Copy link
Member

Duckwhale commented May 30, 2024

After spending more time on the problem, I think there are some flaws with the approach of checking for auras:

  • As already noted, the "persistent" (elementals/caster) NPCs don't have any auras - this complicates the handling code, a lot
  • The other NPCs are empowered by an element based on the event, and should only drop the pet of the "right" element
  • We also can't check NPC IDs in the function that checks for allowed attempts, since it only provides the item DB entry
  • Lastly, even if we could - by the time the NPC is looted the aura will no longer be active (since the NPC is dead, it has no auras)

So if you don't mind, I'd close this and proceed later with an approach based on Area POIs (using these IDs, see WIP branch here).

@Duckwhale
Copy link
Member

Closing in favor of #720. Thank you for your effort!

@Duckwhale Duckwhale closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants