2010-06-11, 12:08 AM
Fiel missed a step in simplifying his code.
The pointer to anMoneyAmount is incremented at the same time as the attack number.
So it's looking through an array of meso values, not using a single one for all 15 hits.
This code should be sufficient for 1 hit, 1 bag though. And I don't know how the meso array is populated.
Paraphrasing, slightly
dwDropFlag tells it which of the 15 drops (probably first x, for number of bags under 15) are valid.
I'll assume it's a boolean array of 15 bits, ie dwDropFlag[i] is ok pseudocode (easier than (1<<i)&dwDropFlag, imo)
Result being that some fraction of the 15 hits are populated with damage amounts.
There is one oddity I saw in the code...
It initializes 7 32-bit random variables.
It then loops through these to provide the damage random function.
So hit #1, #8 and #15 are gonna do the same damage. And so forth.
Anyway, the method for filling *anMoneyAmount needs to be clarified to have a full understanding of the skill. If it's taking into account 20 meso bags, it shouldn't just be the quantities of the first 15, and why would they repeat the total 15 times? (maybe it blows the last 5 just to be a plantain to people who drop hundreds of bags at once?)
The pointer to anMoneyAmount is incremented at the same time as the attack number.
So it's looking through an array of meso values, not using a single one for all 15 hits.
This code should be sufficient for 1 hit, 1 bag though. And I don't know how the meso array is populated.
Paraphrasing, slightly
dwDropFlag tells it which of the 15 drops (probably first x, for number of bags under 15) are valid.
I'll assume it's a boolean array of 15 bits, ie dwDropFlag[i] is ok pseudocode (easier than (1<<i)&dwDropFlag, imo)
Code:
for (int i=0,i<15,i++) {
if (dwDropFlag[i]) {
do Fiel's code on anMoneyAmount[i] and store to damage[i];
numberOfHits++;
}
}There is one oddity I saw in the code...
It initializes 7 32-bit random variables.
It then loops through these to provide the damage random function.
So hit #1, #8 and #15 are gonna do the same damage. And so forth.
Anyway, the method for filling *anMoneyAmount needs to be clarified to have a full understanding of the skill. If it's taking into account 20 meso bags, it shouldn't just be the quantities of the first 15, and why would they repeat the total 15 times? (maybe it blows the last 5 just to be a plantain to people who drop hundreds of bags at once?)

