What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Trinity Health Potion Fix

Ditto

New Member
Joined
Apr 9, 2014
Messages
54
Reaction score
0
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 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.
Find
Code:
bool hasPotion = ZetaDia.Me.Inventory.Backpack.Any(p => p.GameBalanceId == -2142362846);
line.

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 :P Hey it was late for me to!! ;) ]
 
Last edited:
sorry but... in trinity .20 that part of code changed
 
The .20 aka Revison 63 is Beta and has no support yet. U use that at your own risk. That is why u cannot yet download it from the thread mannualy.
 
That is the adress

Need SVN for that link.
Else just use the DB forum for latest release.
 
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.
 
Confirmed this fixed, I SVN trinity, so i had to blacklist HandleTarget.cd but all is working now. Thanks for the fix, we should sticky this to prevent all the many people from asking about it
 
Thanks, this worked like a charm :)

just wanna let you know its SpellHistory.TimeSinceUse(SNOPower.DrinkHealthPotion) > TimeSpan.FromSeconds(30) and not SpellHistory.TimeSinceUse(SNOPower.DrinkHealthPotion) < TimeSpan.FromSeconds(30) as u wrote :) Can be somewhat misleading if you are not super good at theese things

Cheers m8!

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.
 
Hmm, when I use the SVN version of Trinity it keeps crashing DB while authenticating...
 
I dont understand how to use svn on that link so i did just download and overwrite and potion problem was solved :D
 
I dont understand how to use svn on that link so i did just download and overwrite and potion problem was solved :D

If you just install the latest SVN and then in your programs tab click ToirtoiseSVN --> click TortoiseSVN Repository Browser --> add the link that you find on some profiles and/or plugins etc
You see a window then where it loads the adress and you see maps / files there.
Then you make a map on say your desktop name that whatever you want.
Right click that map and click TortoiseMERG

It then places all the files in that map so can load it from DB.

Pretty simple when you done it a few times its like kidsplay. Practice makes perfect ;)

Cheers
 
please can someone tell me which file is the one i have to edit to fix the potion bug and its location? thanks !
 
please can someone tell me which file is the one i have to edit to fix the potion bug and its location? thanks !


Open Plugins/Trinity/Combat/HandleTarget.cs

Open it with Notepad / word / txt editor
 
Back
Top