Clear Mind

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: Clear Mind

Post by diatanato » Fri Sep 14, 2012 2:48 am

я не соглашусь с этим, пока не будут приведены примеры с реального сервера для подтверждения несоответствия с этой формулой

Anged_Obscurite
Posts: 14
Joined: Wed Sep 05, 2012 10:12 pm

Re: Clear Mind

Post by Anged_Obscurite » Fri Sep 14, 2012 3:32 am

diatanato wrote:я не соглашусь с этим, пока не будут приведены примеры с реального сервера для подтверждения несоответствия с этой формулой
http://wiki.ffxiclopedia.org/wiki/Signet

according to the wiki,
Initial HP recovered is calculated as 10 + 3 * floor( level / 10 )
Incremental HP recovered is calculated as 1 + floor( max HP / 300), capping at 5 with maximum HP at 1200 or higher.
I have modified it, with ZeDingo's assistance, to the following:

Code: Select all

if (target:hasStatusEffect(EFFECT_SIGNET)) then
            local playerMaxHP = player:getMaxHP();
            if (playerMaxHP > 1200) then
                     playerMaxHP = 1200; // To make sure that the increment is properly capped
            end
            target:addHP(10+(3*math.floor(target:getMainLvl()/10))+(healtime-2)*(1+floor(playerMaxHP/300))+(target:getMod(MOD_HPHEAL))); 
Attachments
hHP fix.patch
Fixing the Increment Cap that I ignored earlier.
(1.97 KiB) Downloaded 309 times

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: Clear Mind

Post by diatanato » Fri Sep 14, 2012 4:33 am

Не нужно путать алгебраическую прогрессию с геометрическо. Формула проверялась на соответствие с получаемым количеством HP на официальном сервере.
Единственное упоминание геометрической прогрессии

http://wiki.ffxiclopedia.org/wiki/HP_Re ... le_Healing
Amount healed = (10+hHP)N + N(N+1)/2 where N is the number of healing ticks. A /healing tick is 10 seconds, but the first tick takes 20 seconds, so be sure to factor that when calculating the number of ticks over time. (For example, if calculating how many ticks there are in 5 minutes, do 5 * 60 / 10 to determine the number of 10 second ticks, then just subtract 1 tick to factor-in the first 20 second tick.)
если в эту формулу подставить N то результатом будет сумма всех полученных HP за данный период времени. Наша формула выдает количество HP за один tick.

Anged_Obscurite
Posts: 14
Joined: Wed Sep 05, 2012 10:12 pm

Re: Clear Mind

Post by Anged_Obscurite » Fri Sep 14, 2012 9:09 am

Let's suppose we have a Player Character with 350 HP, and Level 15, with no hHP equipment.

With Signet, he should be healing at 10 (base) + 3 (3 * floor of 15/10) for the first tick, 10 + 3 + (tick-1)*(1+floor(350/300)) = 10 + 3 + 1*2 = 15 for the second tick, and 10 + 3 + 2*2 = 17 for the second tick.

My formula is calculating the current tick, not the sum.
addHP(10 // base hHP is 10
+(3*math.floor(target:getMainLvl()/10)) // +3 per 10 Levels on Main Job
+(healtime-2)*(1+floor(playerMaxHP/300)) // healtime-2 is the # of ticks subtracted by 2 because first tick occurs at 20 sec and gains no increment; (1+floor(playerMaxHP/300) is the bonus to increment (minimum 1, +1 per 300 MaxHP)
+(target:getMod(MOD_HPHEAL)) // hHP equipment effects

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: Clear Mind

Post by diatanato » Fri Sep 14, 2012 10:21 am

yes, you are right.
i lose the skill of to do mental arithmetic ((

Anged_Obscurite
Posts: 14
Joined: Wed Sep 05, 2012 10:12 pm

Re: Clear Mind

Post by Anged_Obscurite » Fri Sep 14, 2012 2:41 pm

diatanato wrote:yes, you are right.
i lose the skill of to do mental arithmetic ((
dia, the (healtime-1) needs to be (healtime-2) because of how the script is written (the healing starts when healtime > 1, so the initial tick is when healtime = 2, where there's no increment)

As is, if we use (healtime-1), then the healing increment starts adding right away at 20sec, but it shouldn't.

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: Clear Mind

Post by diatanato » Fri Sep 14, 2012 2:49 pm

ok

Post Reply