Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #008611

  • 0 - None Assigned

  • Working as Intended

Issue Confirmations

  • Yes (0)No (0)
Photo

Fear Breeze math error

Posted by zloba on 06 April 2015 - 09:52 AM

Suggest iRO Wiki at skill level 5 we had 30% (about 1\3) total overall chance of shoot more than one arrow at once.
Roughly speaking this means that if we shot 100 times in 30 cases it will have two or more shots at a time. But in code we had only 12% max total overall chance to do that:
                    int chance = rnd()%100;
					switch(sc->data[SC_FEARBREEZE]->val1){
						case 5:
							if( chance < 3){// 3 % chance to attack 5 times.
								wd.div_ = 5;
								break;
							}
						case 4:
							if( chance < 7){// 6 % chance to attack 4 times.
								wd.div_ = 4;
								break;
							}
						case 3:
							if( chance < 10){// 9 % chance to attack 3 times.
								wd.div_ = 3;
								break;
							}
						case 2:
						case 1:
							if( chance < 13){// 12 % chance to attack 2 times.
								wd.div_ = 2;
								break;
							}
					}

This is a very well confirmed experimentally.

Possibly it should be something like that:
                int chance = rnd()%100;
                int previousChance = 0;
                switch (sc->data[SC_FEARBREEZE]->val1){
                case 5:
                    if (chance < 3 + previousChance){// 3 % chance to attack 5 times.
                        wd.div_ = 5;
                        break;
                    }
                    previousChance += 3;
                case 4:
                    if (chance < 7 + previousChance){// 6 % chance to attack 4 times.
                        wd.div_ = 4;
                        break;
                    }
                    previousChance += 6;
                case 3:
                    if (chance < 10 + previousChance){// 9 % chance to attack 3 times.
                        wd.div_ = 3;
                        break;
                    }
                    previousChance += 9;
                case 2:
                case 1:
                    if (chance < 13 + previousChance){// 12 % chance to attack 2 times.
                        wd.div_ = 2;
                        break;
                    }
                }

changed status to: Working as Intended

in iRo Wiki the total percentage is just the representation if you add all chances per level..but actually the percentage is based per level and priority over hits...in what you have suggested, in level 5 the chance to attack x2 is 30% and not 12% in which it makes it wrong..and btw hercules derived those chances direct from aegis....

:meow:

Umm. Can you explain how it works then? Because as I see it with current code (and that makes OP right):
1) It chooses random number from 0 to 99;
2) If skill level is 5, it checks if number is 0,1 or 2, in which case it launches 5 attacks and stops;
3) If skill level is 4 or 5, it checks if the number is below 6, but since for level 5 it checked 0,1,2 for 5 hits, it can only be 3,4 or 5 for 4 hits, which is 3% chance to deal 4 hits using lvl 5 skill, but 6% chance for lvl 4.
4) ???
5) PROFIT!
6) Last it checks if number is less than 12, but for level 5 it checked numbers 0,1,2 for 5 hits, 3,4,5 for 4 hits, 6,7,8 for 3 hits, so down here it can only be 9,10,11, which makes it 3% chance to hit with 2 attacks. Thus overall chance to get MORE THAN 1 HIT on level 5 is 3%(5 hits/0,1,2)+3%(4 hits/3,4,5)+3%(3 hits/6,7,8)+3%(2 hits/9,10,11) = 12% vs 30% on iROwiki.

yay..don't get confuse..iRo description just make things complicated...
this is how it works...the higher the level the chance of having chance to make 2 or 3 or 4 or 5 hits having a max of 12%...here I will show you pseudo code from aegis then analyze it carefully....chance of 30 won't proc any hits...
SkillData2 = [0, 2, 2, 3, 4, 5];
SkillData3 = [0, 12, 12, 21, 27, 30];
SkillData4 = [0, 0, 12, 9, 6, 3];
chance = rand(1, 100);
result = 0;
level = rand(1, SkillLevel);

if( chance < ( SkillData3[level] + level - 4 ) && ( result = SkillData2[level] ) && result >=2 ){
     chance2 = SkillData4[level] + 4 * result - 4;
     while(true){
          if ( chance < chance2 ){
               if ( (level + 15) > result )
                   break;
          }
          --result;
         chance2 -= 4;
         if ( result < 2 )
              return 0;
     }
}

return result;
but it seems I need to change the code..I just notice something wrong..hahahahaha
Level 1: if chance is 1~3% it will hit x2
Level 2: if chance is 1~9% it will hit x2
Level 3: if chance is 1~16% it will hit x3
Level 4: if chance is 1~17% it will hit x4
Level 5: if chance is 1~18% it will hit x5

:meow: