@@ -2920,6 +2920,10 @@ bool CChar::WearItem( CItem *toWear )
2920
2920
IncDexterity2 ( itemLayers[tLayer]->GetDexterity2 () );
2921
2921
IncIntelligence2 ( itemLayers[tLayer]->GetIntelligence2 () );
2922
2922
2923
+ IncHealthBonus ( itemLayers[tLayer]->GetHealthBonus () );
2924
+ IncStaminaBonus ( itemLayers[tLayer]->GetStaminaBonus () );
2925
+ IncManaBonus ( itemLayers[tLayer]->GetManaBonus () );
2926
+
2923
2927
if ( toWear->IsPostLoaded () )
2924
2928
{
2925
2929
if ( itemLayers[tLayer]->GetPoisoned () )
@@ -2979,6 +2983,11 @@ bool CChar::TakeOffItem( ItemLayers Layer )
2979
2983
IncStrength2 ( -itemLayers[Layer]->GetStrength2 () );
2980
2984
IncDexterity2 ( -itemLayers[Layer]->GetDexterity2 () );
2981
2985
IncIntelligence2 ( -itemLayers[Layer]->GetIntelligence2 () );
2986
+
2987
+ IncHealthBonus ( -itemLayers[Layer]->GetHealthBonus () );
2988
+ IncStaminaBonus ( -itemLayers[Layer]->GetStaminaBonus () );
2989
+ IncManaBonus ( -itemLayers[Layer]->GetManaBonus () );
2990
+
2982
2991
if ( itemLayers[Layer]->GetPoisoned () )
2983
2992
{
2984
2993
if ( itemLayers[Layer]->GetPoisoned () > GetPoisoned () )
@@ -3787,7 +3796,7 @@ UI16 CChar::GetMaxHP( void )
3787
3796
oldRace = GetRace ();
3788
3797
3789
3798
}
3790
- return maxHP;
3799
+ return maxHP + GetHealthBonus () ;
3791
3800
}
3792
3801
void CChar::SetMaxHP ( UI16 newmaxhp, UI16 newoldstr, RACEID newoldrace )
3793
3802
{
@@ -3830,7 +3839,7 @@ void CChar::SetFixedMaxHP( SI16 newmaxhp )
3830
3839
SI16 CChar::GetMaxMana ( void )
3831
3840
{
3832
3841
if (( maxMana_oldint != GetIntelligence () || oldRace != GetRace () ) && !GetMaxManaFixed () )
3833
- // if int/race changed since last calculation, recalculate maxHp
3842
+ // if int/race changed since last calculation, recalculate maxMana
3834
3843
{
3835
3844
CRace *pRace = Races->Race ( GetRace () );
3836
3845
@@ -3847,7 +3856,7 @@ SI16 CChar::GetMaxMana( void )
3847
3856
oldRace = GetRace ();
3848
3857
3849
3858
}
3850
- return maxMana;
3859
+ return maxMana + GetManaBonus () ;
3851
3860
}
3852
3861
void CChar::SetMaxMana ( SI16 newmaxmana, UI16 newoldint, RACEID newoldrace )
3853
3862
{
@@ -3889,7 +3898,7 @@ void CChar::SetFixedMaxMana( SI16 newmaxmana )
3889
3898
// o------------------------------------------------------------------------------------------------o
3890
3899
SI16 CChar::GetMaxStam ( void )
3891
3900
{
3892
- // If dex/race changed since last calculation, recalculate maxHp
3901
+ // If dex/race changed since last calculation, recalculate maxStam
3893
3902
if (( maxStam_olddex != GetDexterity () || oldRace != GetRace () ) && !GetMaxStamFixed () )
3894
3903
{
3895
3904
CRace *pRace = Races->Race ( GetRace () );
@@ -3907,7 +3916,7 @@ SI16 CChar::GetMaxStam( void )
3907
3916
oldRace = GetRace ();
3908
3917
3909
3918
}
3910
- return maxStam;
3919
+ return maxStam + GetStaminaBonus () ;
3911
3920
}
3912
3921
void CChar::SetMaxStam ( SI16 newmaxstam, UI16 newolddex, RACEID newoldrace )
3913
3922
{
@@ -5593,6 +5602,74 @@ void CChar::SetIntelligence2( SI16 nVal )
5593
5602
UpdateRegion ();
5594
5603
}
5595
5604
5605
+ // o------------------------------------------------------------------------------------------------o
5606
+ // | Function - CChar::SetHealthBonus()
5607
+ // o------------------------------------------------------------------------------------------------o
5608
+ // | Purpose - Sets bonus Hits stat for character
5609
+ // o------------------------------------------------------------------------------------------------o
5610
+ void CChar::SetHealthBonus ( SI16 nVal )
5611
+ {
5612
+ CBaseObject::SetHealthBonus ( nVal );
5613
+ Dirty ( UT_HITPOINTS );
5614
+ UpdateRegion ();
5615
+ }
5616
+
5617
+ // o------------------------------------------------------------------------------------------------o
5618
+ // | Function - CChar::SetStaminaBonus()
5619
+ // o------------------------------------------------------------------------------------------------o
5620
+ // | Purpose - Sets bonus Stam stat for character
5621
+ // o------------------------------------------------------------------------------------------------o
5622
+ void CChar::SetStaminaBonus ( SI16 nVal )
5623
+ {
5624
+ CBaseObject::SetStaminaBonus ( nVal );
5625
+ Dirty ( UT_STAMINA );
5626
+ UpdateRegion ();
5627
+ }
5628
+
5629
+ // o------------------------------------------------------------------------------------------------o
5630
+ // | Function - CChar::SetManaBonus()
5631
+ // o------------------------------------------------------------------------------------------------o
5632
+ // | Purpose - Sets bonus Mana stat for character
5633
+ // o------------------------------------------------------------------------------------------------o
5634
+ void CChar::SetManaBonus ( SI16 nVal )
5635
+ {
5636
+ CBaseObject::SetManaBonus ( nVal );
5637
+ Dirty ( UT_MANA );
5638
+ UpdateRegion ();
5639
+ }
5640
+
5641
+ // o------------------------------------------------------------------------------------------------o
5642
+ // | Function - CChar::IncHealthBonus()
5643
+ // o------------------------------------------------------------------------------------------------o
5644
+ // | Purpose - Increments GetHealthBonus (modifications) by toAdd
5645
+ // o------------------------------------------------------------------------------------------------o
5646
+ void CChar::IncHealthBonus ( SI16 toAdd )
5647
+ {
5648
+ SetHealthBonus ( static_cast <SI16>( GetHealthBonus () + toAdd ));
5649
+ }
5650
+
5651
+ // o------------------------------------------------------------------------------------------------o
5652
+ // | Function - CChar::IncStaminaBonus()
5653
+ // | Date - 26 May 2024
5654
+ // o------------------------------------------------------------------------------------------------o
5655
+ // | Purpose - Increments GetBonusStam (modifications) by toAdd
5656
+ // o------------------------------------------------------------------------------------------------o
5657
+ void CChar::IncStaminaBonus ( SI16 toAdd )
5658
+ {
5659
+ SetStaminaBonus ( static_cast <SI16>( GetStaminaBonus () + toAdd ));
5660
+ }
5661
+
5662
+ // o------------------------------------------------------------------------------------------------o
5663
+ // | Function - CChar::IncManaBonus()
5664
+ // | Date - 26 May 2024
5665
+ // o------------------------------------------------------------------------------------------------o
5666
+ // | Purpose - Increments GetBonusMana (modifications) by toAdd
5667
+ // o------------------------------------------------------------------------------------------------o
5668
+ void CChar::IncManaBonus ( SI16 toAdd )
5669
+ {
5670
+ SetManaBonus ( static_cast <SI16>( GetManaBonus () + toAdd ));
5671
+ }
5672
+
5596
5673
// o------------------------------------------------------------------------------------------------o
5597
5674
// | Function - CChar::IncStamina()
5598
5675
// o------------------------------------------------------------------------------------------------o
0 commit comments