Jump to content

AbeilleTurbulante

Member
  • Posts

    14
  • Joined

  • Last visited

  • Feedback

    0%

About AbeilleTurbulante

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AbeilleTurbulante's Achievements

Explorer

Explorer (4/16)

  • Collaborator
  • Dedicated
  • First Post
  • Conversation Starter
  • One Year In

Recent Badges

3

Reputation

  1. It's just above, in char_skill.cpp, inside this condition: if (iCriticalPct) { if (iCriticalPct >= 10) iCriticalPct = 5 + (iCriticalPct - 10) / 4; else iCriticalPct /= 2; iCriticalPct -= GetPoint(POINT_RESIST_CRITICAL); if (number(1, 100) <= iCriticalPct) { IsCritical = true; dam *= 2; EffectPacket(SE_CRITICAL); if (IsAffectFlag(AFF_MANASHIELD)) { RemoveAffect(AFF_MANASHIELD); } } } However, if you kept this code, you will need more than 394% critical to get extra damages with skills.
  2. Lol what is the difficulty? You didn't even try, did you? You're lucky I'm nice today. You have this condition inside char_battle.cpp: if (iCriticalPct) { iCriticalPct -= GetPoint(POINT_RESIST_CRITICAL); if (number(1, 100) <= iCriticalPct) { IsCritical = true; dam *= 2; EffectPacket(SE_CRITICAL); } } Just add this part at the end of the condition: if (IsPC() && iCriticalPct >= 100) { dam += (dam * (iCriticalPct - 100)) / 200; } It's the same formula for extra piercing hits in the official. With this, 1 critical above 100% turns into 0.5% damages. This is for melee attacks, you can do the same for skills if you want.
  3. Can I be the new administrator pleae
  4. I find the soluton... There is an error in the source code int victim_lv = pkAttacker->GetLevel(); I took victim level instead of attacker level...
  5. Hello, I am trying to calculate the damage in the simplest possible case: no bonuses and no weapon involved. However, I'm encountering discrepancies between the theoretical calculation and the actual in-game values, and I can't seem to identify where I might be making a mistake. Here's an example scenario: Attacker: Race: Warrior Level: 10 Strength: 26 Dexterity: 10 Victim: Monster: Wild dog (vnum: 171) Level: 1 Dexterity: 6 Vitality: 5 Defense: 4 Results from this test: Theoretical damage: 46 Official server: 45 Private server: 45 I used the source code in this manner to calculate the theoretical damage (I removed unnecessary parts): void CHARACTER::ComputeBattlePoints() { if (IsPolymorphed()) { ... } else if (IsPC()) { SetPoint(POINT_ATT_GRADE, 0); ... int iAtk = GetLevel() * 2; // iAtk = 20 int iStatAtk = 0; switch (GetJob()) { case JOB_WARRIOR: iStatAtk = (2 * GetPoint(POINT_ST)); // iStatAtk = 52 break; ... } ... iAtk += iStatAtk; // iAtk = 72 ... iAtk += GetPoint(POINT_ATT_GRADE_BONUS); // iAtk = 72 PointChange(POINT_ATT_GRADE, iAtk); ... } else { ... } } float CalcAttackRating(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreTargetRating) { int iARSrc; int iERSrc; if (LC_IsYMIR()) { ... } else { int attacker_dx = pkAttacker->GetPolymorphPoint(POINT_DX); // attacker_dx = 10 int attacker_lv = pkAttacker->GetLevel(); // attacker_lv = 10 int victim_dx = pkVictim->GetPolymorphPoint(POINT_DX); // victim_dx = 6 int victim_lv = pkAttacker->GetLevel(); // victim_lv = 1 iARSrc = MIN(90, (attacker_dx * 4 + attacker_lv * 2) / 6); // iARSrc = 10 iERSrc = MIN(90, (victim_dx * 4 + victim_lv * 2) / 6); // iERSrc = 4 } float fAR = ((float) iARSrc + 210.0f) / 300.0f; // fAR = 0.733333 if (bIgnoreTargetRating) return fAR; float fER = ((float) (iERSrc * 2 + 5) / (iERSrc + 95)) * 3.0f / 10.0f; // fER = 0.0393939 return fAR - fER; } int CalcBattleDamage(int iDam, int iAttackerLev, int iVictimLev) { if (iDam < 3) iDam = number(1, 5); return iDam; } int CalcMeleeDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreDefense, bool bIgnoreTargetRating) { LPITEM pWeapon = pkAttacker->GetWear(WEAR_WEAPON); bool bPolymorphed = pkAttacker->IsPolymorphed(); if (pWeapon && !(bPolymorphed && !pkAttacker->IsPolyMaintainStat())) { ... } int iDam = 0; float fAR = CalcAttackRating(pkAttacker, pkVictim, bIgnoreTargetRating); // fAR = 0.693939 int iDamMin = 0, iDamMax = 0; if (bPolymorphed && !pkAttacker->IsPolyMaintainStat()) { ... } else if (pWeapon) { ... } else if (pkAttacker->IsNPC()) { ... } iDam = number(iDamMin, iDamMax) * 2; // iDam = 0 int iAtk = 0; iAtk = pkAttacker->GetPoint(POINT_ATT_GRADE) + iDam - (pkAttacker->GetLevel() * 2); // iAtk = 72 + 0 - 2 * 10 = 52 iAtk = (int) (iAtk * fAR); // iAtk = 36 iAtk += pkAttacker->GetLevel() * 2; // iAtk = 56 if (pWeapon) { ... } iAtk += pkAttacker->GetPoint(POINT_PARTY_ATTACKER_BONUS); // iAtk = 56 iAtk = (int) (iAtk * (100 + (pkAttacker->GetPoint(POINT_ATT_BONUS) + pkAttacker->GetPoint(POINT_MELEE_MAGIC_ATT_BONUS_PER))) / 100); // iAtk = 56 iAtk = CalcAttBonus(pkAttacker, pkVictim, iAtk); // iAtk = 56 (no bonus) int iDef = 0; if (!bIgnoreDefense) { // int iDef = GetLevel() + GetPoint(POINT_HT) + GetMobTable().wDef; iDef = (pkVictim->GetPoint(POINT_DEF_GRADE) * (100 + pkVictim->GetPoint(POINT_DEF_BONUS)) / 100); // iDef = 10 if (!pkAttacker->IsPC()) ... } if (pkAttacker->IsNPC()) ... iDam = MAX(0, iAtk - iDef); // iDam = 46 return CalcBattleDamage(iDam, pkAttacker->GetLevel(), pkVictim->GetLevel()); // = 46 } If anyone could help me pinpoint the issue or offer any suggestions, I would greatly appreciate it. Thank you in advance!
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.