• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Critical Chance Bug (?)

yoiker

Member
Joined
Jan 21, 2012
Messages
194
Solutions
1
Reaction score
9
A cordial greeting to all, I write this to leave doubts and do not know if this really is a mistake or do I use bad

I explain: The next server using https://otland.net/threads/10-95-cast-tfs-1-2-custom-modifications-v2.244282/ ... I have a problem with the critical chance and critical damage.

Now when I have the critical damage by + 100% and critical chance between 0, 100

The following happens:

Suppose my player does not hurt normal critical 5000 would be 10,000 but if you repeat the critic would be 15000 and not the idea since only it should work with the base damage and not with the same critical that you give normal

Another quick example: Hit normal: 7000 = critical * 2 = 14000 and that's when things get ugly because it is assumed that the critic is based on the average hit but this leaves the latest blow then it is also * 2 and would 28000

This is what I found in game.cpp

Code:
            //critical damage
            if (normal_random(0, 100) < attackerPlayer->getSkillLevel(SKILL_CRITICAL_HIT_CHANCE)) {
                damage.primary.value = (int32_t)(damage.primary.value * (1 + (attackerPlayer->getSkillLevel(SKILL_CRITICAL_HIT_DAMAGE) / 100)));
                critical = true;
            }

I think it's fine but do not know why that happens I hope someone can do this for me or try on their servers if they have these boost.

Thanks for viewing the post!
 
I knew already that causes it is because I use creatureevent that also uses onHealthChange. And then collides with critical script of my creatureevent, but is there a way to do that they do not collide? as it represents a big problem on my server and do not know what to do at this point D:
 
Back
Top