[implemented] Research Timer and ESO Premium Membership
I'am saving the remaining research-time for all characters with "GetSmithingResearchLineTraitTimes" in the saved variable and add the Timestamp to each.
But if i use this saved values to display them, the values are incorrect for Premium Member with the 10% Bonus. After many trys and errors i do not found a formula or function to get the correct value. The only way is to use "GetSmithingResearchLineTraitTimes" for the current character, but all other characters (saved values) will still be false. Is it possible, to get a function which calculates with this 10% bonus if necessary (from any value)? |
Correct me if I'm wrong, but can you compute the full duration and the start time and then multiply by 10% if the account has ESO Plus using an API for that?
|
The more I think about it, the less I am certain if it is really that simple.
There are 4 possible cases:
The GetSmithingResearchLineTraitTimes function returns duration and timeRemaining and we can detect if someone has plus membership via GetUnitBuffInfo. So we can save the start time, the duration and if he had plus membership at the time when we saved it. It could be as simple as multiplying or dividing the duration by 1.1, but it could also be that we need to interpolate between non-plus-duration and plus-duration. In that case we would need to know how long he had plus membership during the research. For example: The user starts research without plus membership. It gives a duration of 10 days. After 5 days he obtains plus membership which reduces the duration by 10%. Does it reduce the overall duration, or does it reduce the remaining duration? In the first case, the remaining time would be 4 days, in the second case it would be 4.5 days. |
did you look at the other research addons for solutions?
|
Quote:
Thats a wish, a function which checks for membership and calculates the given value with 10% and return it. There are not only the research times affected, XP got also a bonus i believe. :D Lua Code:
With such a value i can calculate even positive or negative. |
Long time ago, than my crafter was young, I had a remaining research.
I finally was able to spend an additional skillpoint to shorten research. Instead of shorting the remaining time, the research was immediately finished. If the ESO+ membership is handled that way, too: For a logged-in char you get: local duration, remaining = GetSmithingResearchLineTraitTimes(...) These values are ajusted to your current ESO+ membership You can get and should store at EVENT_PLAYER_DEACTIVATED: (because of skillpoints, which could be spend in-between) local duration, remaining = GetSmithingResearchLineTraitTimes(...) local FinishTimestamp = GetTimestamp() + remaining local StartTime = FinishTimestamp - duration local esoPlus = GetUnitBuffInfo(...) if you are ESO+ member at that time, duration is 90% of real duration, otherwise 100%. For an offline char: local duration = EndTimestamp - StartTimestamp if lostMembership then duration = duration / 0.9 -- 1.11111111, not 1.10 else if gotMembership then duration = duration * 0.9 else -- duration remains end local newFinishTimestamp = StartTimestamp + duration local remaining = newFinishTimestamp - GetTimestamp() if remaining <= 0 then -- Finished end Correct me, if I am wrong. I wrote this at work and could not test. But I guess, this is what you already did. :o |
as you need to be logged in to launch a research you can register the Start timestamp then use
GetSmithingResearchLineInfo(integer TradeskillType craftingSkillType, integer researchLineIndex) Returns: string name, textureName icon, integer numTraits, integer timeRequiredForNextResearchSecs and make the operations from that duration? I think this is the unaltered duration but I can't be sure. maybe someone with ESO+ can compare this one with the "remaining" one. in both case, just get the time start stamp and get or calculate the base duration then when reading it re-calculate the duration with the current settings. At least getting a new passive requires to be logged in. Should check if this changes this timeRequiredForNextResearchSecs too. worst worst worst case scenario : you can still 1) get the starting stamp at the start of the research. 2) calculate the needed base time from the number of traits already learned 3) apply passives... readjust this on new passive learned 4) whenever the info is displayed, apply ESO memebership status to the recalculated duration when it is displayed. If you really need to do this though, I 100% agree that improving the API wouldn't be a blank shot. |
IsESOPlusSubscriber should be the API for checking the premium part of your function.
|
Quote:
|
That would be because it isn't live yet, whoops. It will be in the next big update.
|
All times are GMT -6. The time now is 01:17 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI