Trinity Health Potion Fix .19 and .20
Hi,
I tought i would make a clean topic about this since i had the problem myself and simply using the forum search does not reveal a awnser, and browsing trough 20+ orso pages can be quite confusing IMHO.
So if your have a problem with DB not using Potions here is the sollution:
FOR THE .20 VERSION OF TRINITY
As stated: This is NOT my work but that of GuuD and mainly rrix. So do not thank anyone but them!
Hope this helps some people who where lost in all the threads and pages....
Cheers,
Ditto
[Edit: just saw late last night someone made kinda the exact same post and i cant find the delete button oO Sorry
Hey it was late for me to!!
]
Hi,
I tought i would make a clean topic about this since i had the problem myself and simply using the forum search does not reveal a awnser, and browsing trough 20+ orso pages can be quite confusing IMHO.
So if your have a problem with DB not using Potions here is the sollution:
For everyone who encounters potion problem (aka everyone) here is the fix:
Open Plugins/Trinity/Combat/HandleTarget.cs with Sublime Text, Visual Studio, Notepad++ or any other editor.
Findline.Code:bool hasPotion = ZetaDia.Me.Inventory.Backpack.Any(p => p.GameBalanceId == -2142362846);
Add this code just below it:
Code:if (hasPotion && Player.CurrentHealthPct <= PlayerEmergencyHealthPotionLimit && !IsWaitingForPower && !IsWaitingForPotion && !Player.IsIncapacitated && SNOPowerUseTimer(SNOPower.DrinkHealthPotion)) { Logger.Log(TrinityLogLevel.Debug, LogCategory.Targetting, "Setting isWaitingForPotion: MyHP={0}, Limit={1}", Player.CurrentHealthPct, PlayerEmergencyHealthPotionLimit); IsWaitingForPotion = true; runStatus = HandlerRunStatus.TreeRunning; }
Save the file and restart DB.
All credits go to rrix, it's his code till the last ";", he just lost it in the latest Trinity.
FOR THE .20 VERSION OF TRINITY
Ok, another fix for the people on .20 Trinity:
Find this block of code (it's the part of "if" condition):
Code:SpellHistory.TimeSinceUse(SNOPower.DrinkHealthPotion) < TimeSpan.FromSeconds(30)
Replace it with:
Code:(SpellHistory.TimeSinceUse(SNOPower.DrinkHealthPotion) > TimeSpan.FromSeconds(30) || SpellHistory.GetSpellLastused(SNOPower.DrinkHealthPotion) == DateTime.MinValue)
Your condition should look like:
Code:if (!Player.IsIncapacitated && Player.CurrentHealthPct > 0 && (SpellHistory.TimeSinceUse(SNOPower.DrinkHealthPotion) > TimeSpan.FromSeconds(30) || SpellHistory.GetSpellLastused(SNOPower.DrinkHealthPotion) == DateTime.MinValue) && Player.CurrentHealthPct <= PlayerEmergencyHealthPotionLimit)
Enjoy.
As stated: This is NOT my work but that of GuuD and mainly rrix. So do not thank anyone but them!
Hope this helps some people who where lost in all the threads and pages....
Cheers,
Ditto
[Edit: just saw late last night someone made kinda the exact same post and i cant find the delete button oO Sorry


Last edited: