mardi 3 mars 2015

To fix rrrix's R-Rift wave bug -- Use mob's top hitpoints instead of wave

It's a bad idea to use the wave number to decide if bot stop trial rift. And it's hard to dig out the wave number.



Using mob's top Hitpoints is a easy way.

But we should test the rate of HP/wave.



Code will be like these:



\Plugins\QuestTools\Helpers\RiftTrial.cs

public static void PulseRiftTrial():

if (currentWave >= maxWave && !IsAborting)

{

SetIsCombatAllowed(false);

BotBehaviorQueue.Queue(EndTrialSequence, "Trial Abort Sequence");



IsAborting = true;

}



===>

private static double _maxHitPoints = 0;

private const double _HP2WaveRate = 5230000;



foreach (var o in ObjectCache)

{

if(o.IsUnit && o.HitPoints > _maxHitPoints)

_maxHitPoints = o.HitPoints;



if (_maxHitPoints/_HP2WaveRate > maxWave)

{

SetIsCombatAllowed(false);

BotBehaviorQueue.Queue(EndTrialSequence, "Trial Abort Sequence");



IsAborting = true;

}

}





To fix rrrix's R-Rift wave bug -- Use mob's top hitpoints instead of wave

Aucun commentaire:

Enregistrer un commentaire