MoriceD3 / D3ROS-ArreatCore

8 stars 10 forks source link

Enhance TP/WP #84

Closed Lentice closed 10 years ago

Lentice commented 10 years ago

Using array $LevelAreaForWP[56] to know exactly where WP goes to. This can avoid a infinit loop condition that $Newarea always equal to $Curentarea. Enhance dealing TP loading bar.

Ano69 commented 10 years ago

This code only works on Adventure mode and will break campain mode :(

Lentice commented 10 years ago

I'll try to add campain mode. :)

Lentice commented 10 years ago

Some Problems: I use $Act to determine what act we are, but $Act will never equal to 4 in GetAct(). :( And I get problem when taking WP=5 in Campain Act1. Don't I have the waypoint or it is ready not exist??

Ano69 commented 10 years ago

It's possible some waypoints does not exists on some acts.

For act4 it's complicated since detection is made from areaid of starting point and there's no one for act4 it's the same as 3.

But you may want to test 2 values if in act3 to compensate.

Lentice commented 10 years ago

I found that the number of waypoints are different between Act3 and Act4.

Maybe I can check if last waypoint of Act3 exist during CheckGameMode(). If GetOfsFastUI() return false for that WP then we should be act4. I expect the act will not be changed after CheckGameMode().

Ano69 commented 10 years ago

No :(

As in campain mode, WP are opened based on the chosen quest. If a player want to do only Ghom runs, last WP will not be visible and it will fails.

Lentice commented 10 years ago

Bad news. orz.... Thanks for telling me before I modify the code.

Maybe I can just check if current LevelArea meet the WP index of any LevaAreaForWP. As you said before "But you may want to test 2 values if in act3 to compensate."

Ano69 commented 10 years ago

Yes that was the idea ;)

But you cannot just check if area is in the list, since when you chain sequence you are already in an valid area ;)

As proposed the easier valid solution is when in act 3 check for 2 values for each WP target areaid.

Or to not handle the act, and for each WP value check in the 5 possible values (1 per act) (less hacky code and easier to maintain in future)

Lentice commented 10 years ago

Yes the last proposal is what I want. I will test it after I get off office. :)

MoriceD3 commented 10 years ago

Hello, I tested your code. Is this desire for TownPortalnew spam as the key. Another point of time the progress bar should be reduced, if it is attacked at the end, we enter the loop '' While Not _intown() And $try < $MaxTry '' and we become vulnerable to attack for 7 sec.

Should also add in WaitTpBarLoading checkForPotion () checkForGlobes () if tp in an affix.

Sorry I do not speak much English

Lentice commented 10 years ago

Hi, Yes, for TownPortalnew I send the KeyPortal periodically during WaitTpBarLoading(). That is because I ever see send the key once is not work. But that behavior is not necessary, there is retry loop in TownPortalnew(). I'll remove it.

If ever attack during TP, I expect the position of mouse will change and TP bar will disappear. So WaitTpBarLoading will return a false value and loop '' While Not _intown() And $try < $MaxTry '' will be skipped. Thanks for your feedback. :)

Lentice commented 10 years ago

Hi MoriceD3, I modified the code. WaitTpBarLoading() will return True only when the TP loading bar keep longer then 3.7 seconds. If WaitTpBarLoading() return False, then the ContinueLoop will skip " While Not _intown() And $try < $MaxTry ". If any problems, please tell me. Thanks!! :)