Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Damage related to health Mod
Thread: Damage related to health Mod
Khadras
Khadras


Famous Hero
posted July 21, 2016 07:45 AM

Damage related to health Mod

I found a problem in Damage related to health Mod and i don't know how to solve it. I kindly ask if someone can show me how.

The problem is with damage calculation formula that sometimes results negative damage that makes enemy creatures grow in number. Arrow Towers give negative damage and some creatures too. I want to set that the result damage to be always positive and i don't erm so well and i don't know how. The code is made by XEvolution (Emanuel Ciobotaru) and was stripped and modified snippets from Sagamosa's Advanced Levels script.

!?MF1&1000;    before damage dealt

!!BG:N?y-1;       active stack?
!!BMy-1:B?y-2 N?y-3 H?y-4 L?y-5 I?y-99; original number of units / current number of units /HP/Hp lost by next monster

!!MF?y-60;       original damage

!!VRy-10:Sy-2 *y-4;            initial HP pool
!!VRy-11:Sy-3 *y-4 -y-5;       actual HP pool after damage

!!VRy-52:Sy-11 : y-10;         lost hp ratio
!!VRy-53:S1;
!!VRy-54:Sy-53 - y-52;
!!VRy-56:Sy-2 - y-3;     number of lost uits
!!VRy-55:Sy-54 * y-56 : 2;
!!VRy-62:Sy-60 - y-55; modified damage

!!VRv4567:Sy-55; difference of damage

!!MF:Fy-62;        deal new updated damage

!!VRz-1&v4567>0:S^Stack's enjury reduced its damage with %Y-55 from %Y-60^;
!!BU:Mz-1;

The minimum group damage must be 1, not 0 or negative. y-62 variable must be always positive. I don't know how to set y-62 >= 1. Please help me because this mod is very useful for me and it is an interesting mod.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted July 21, 2016 08:34 AM

Try this?

!?MF1&1000;    before damage dealt

!!BG:N?y-1;       active stack?
!!BMy-1:B?y-2 N?y-3 H?y-4 L?y-5 I?y-99; original number of units / current number of units /HP/Hp lost by next monster

!!MF:D?y-60;       original damage

!!VRy-10:Sy-2 *y-4;            initial HP pool
!!VRy-11:Sy-3 *y-4 -y-5;       actual HP pool after damage

!!VRy-52:Sy-11 : y-10;         lost hp ratio
!!VRy-53:S1;
!!VRy-54:Sy-53 - y-52;
!!VRy-56:Sy-2 - y-3;     number of lost uits
!!VRy-55:Sy-54 * y-56 : 2;
!!VRy-62:Sy-60 - y-55; modified damage
!!VRy-62&y-62<1:S1;

!!VRv4567:Sy-55; difference of damage

!!MF:Fy-62;        deal new updated damage

!!VRz-1&v4567>0:S^Stack's enjury reduced its damage with %Y-55 from %Y-60^;
!!BU:Mz-1;

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Khadras
Khadras


Famous Hero
posted July 21, 2016 10:36 AM

Salamandre said:
Try this?

!?MF1&1000;    before damage dealt

!!BG:N?y-1;       active stack?
!!BMy-1:B?y-2 N?y-3 H?y-4 L?y-5 I?y-99; original number of units / current number of units /HP/Hp lost by next monster

!!MF:D?y-60;       original damage

!!VRy-10:Sy-2 *y-4;            initial HP pool
!!VRy-11:Sy-3 *y-4 -y-5;       actual HP pool after damage

!!VRy-52:Sy-11 : y-10;         lost hp ratio
!!VRy-53:S1;
!!VRy-54:Sy-53 - y-52;
!!VRy-56:Sy-2 - y-3;     number of lost uits
!!VRy-55:Sy-54 * y-56 : 2;
!!VRy-62:Sy-60 - y-55; modified damage
!!VRy-62&y-62<1:S1;

!!VRv4567:Sy-55; difference of damage

!!MF:Fy-62;        deal new updated damage

!!VRz-1&v4567>0:S^Stack's enjury reduced its damage with %Y-55 from %Y-60^;
!!BU:Mz-1;


Thank you very much! You saved me. :)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jamal1
Jamal1

Tavern Dweller
posted September 23, 2020 06:41 PM

When choosing a product, the main criteria are health protection and comfort. You should also pay attention to the price: patients who know firsthand about the problems caused by a sedentary lifestyle will not save on their health. The cheapest wheelchair cushion is made of latex or foam rubber, gel cushions are slightly more expensive, but the most comfortable ones can be found at [url=https://communityclinicassociation.org/roho-wheelchair-cushion/]Roho[/url]. The highest price tag for products made of polyurethane or combined
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Khadras
Khadras


Famous Hero
posted September 24, 2020 07:06 PM

Jamal1 said:
When choosing a product, the main criteria are health protection and comfort. You should also pay attention to the price: patients who know firsthand about the problems caused by a sedentary lifestyle will not save on their health. The cheapest wheelchair cushion is made of latex or foam rubber, gel cushions are slightly more expensive, but the most comfortable ones can be found at Roho. The highest price tag for products made of polyurethane or combined


??

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
FirePaladin
FirePaladin


Legendary Hero
DoR Modder
posted September 24, 2020 07:11 PM

It's a bot, again.
____________
"Goblins use pistols because a shotgun recoil would kick them off the ground flying."
The Reckoning.... it's drawing near....

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Khadras
Khadras


Famous Hero
posted September 14, 2022 05:54 AM
Edited by Khadras at 06:33, 14 Sep 2022.

Hi everyone!
I think about a modification of this mod names Moral Related to Health (or to Loss), where the morale and luck of all unit stacks are decreased or raised depending on hero lost units or enemy hero lost units. Total health lost by the hero affects the morale and luck of all his units, and total health lost by the enemy hero raises the morale and luck of the hero. Morale and luck can be negative, so it is not the same problem as it did with damage in Damage Related to Health.
I think only morale must be modified. The morale must raise or decrease by 1 for every 20% of army total health lost by the enemy hero or the current hero. How about luck? The percentage can be calculated in two variants: army total health lost or the total number of units lost. If this is calculated using the total number of units lost by the hero, then the player is tended to hire only the strongest units.
Some ideas on how this idea can be implemented?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
RerryR
RerryR


Promising
Supreme Hero
Researching Magic
posted September 14, 2022 07:50 AM

Khadras said:
Hi everyone!
I think about a modification of this mod names Moral Related to Health (or to Loss), where the morale and luck of all unit stacks are decreased or raised depending on hero lost units or enemy hero lost units. ...

Some ideas on how this idea can be implemented?


To change Morale and Luck during combat, you must set them again after every battle action of the creatures and at the beginning of the fight.
In the GEM Mod there's example how it could work:


Fix the Luck and Morale bug from 8th level creatures in WoG (by PerryR)

!?FU(OnSetupBattlefield)&1000/i^battle_isQuick^=(FALSE);

 !!FU(Set_Morale_and_Luck)i^battle_hero_0^/i^battle_hero_1^/0;

 !?FU(OnCombatRound)&1000/i^battle_isQuick^=(FALSE);                                                      

 !!FU(Set_Morale_and_Luck)i^battle_hero_0^/i^battle_hero_1^/1;

 !?FU(OnAfterBattleAction)&1000/i^battle_isQuick^=(FALSE);

 !!FU(Set_Morale_and_Luck)i^battle_hero_0^/i^battle_hero_1^/1;

 !?FU(Set_Morale_and_Luck);
....

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Khadras
Khadras


Famous Hero
posted September 14, 2022 08:19 AM

Thanks!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0404 seconds