Several bug fixes

This commit is contained in:
Mind Rapist
2026-02-13 01:51:51 +02:00
parent 410c785dd1
commit 4d3c6c4a40
5 changed files with 54 additions and 320 deletions

View File

@@ -632,17 +632,34 @@ int CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow,
//return iDam;
}
void NormalAttackAffect(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
{
// 독 공격은 특이하므로 특수 처리
if (pkAttacker->GetPoint(POINT_POISON_PCT) && !pkVictim->IsAffectFlag(AFF_POISON))
{
if (number(1, 100) <= pkAttacker->GetPoint(POINT_POISON_PCT))
// MR-11: DPS Debuff Fixes
int delta = pkAttacker->GetLevel() - pkVictim->GetLevel();
int absDelta = abs(delta);
if (absDelta > 8)
absDelta = 8;
int levelPct = 100;
if (delta < 0)
levelPct = poison_level_adjust[absDelta];
else if (delta > 0)
levelPct = 100 + (100 - poison_level_adjust[absDelta]) / 2;
int additChance = pkAttacker->GetPoint(POINT_POISON_PCT) * (levelPct - 100) / 100;
if (number(1, 100) <= pkAttacker->GetPoint(POINT_POISON_PCT) + additChance)
pkVictim->AttackedByPoison(pkAttacker);
// MR-11: -- END OF -- DPS Debuff Fixes
}
int iStunDuration = 2;
if (pkAttacker->IsPC() && !pkVictim->IsPC())
iStunDuration = 4;

View File

@@ -57,6 +57,8 @@ enum
SUMMON_MONSTER_COUNT = 3,
};
extern const int poison_level_adjust[9];
enum
{
FLY_NONE,

View File

@@ -2173,6 +2173,13 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu
dam -= dec_dam;
}
// MR-11: DPS Debuff Fixes
if (type == DAMAGE_TYPE_FIRE && IsNPC() && GetRaceNum() == 1192)
{
dam = dam * 80 / 100;
}
// MR-11: -- END OF -- DPS Debuff Fixes
if (pAttacker)
{
//
@@ -2275,14 +2282,16 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu
if (IsDead())
return true;
// 독 공격으로 죽지 않도록 함.
if (type == DAMAGE_TYPE_POISON)
// MR-11: DPS Debuff Fixes
// 독/불 데미지로 죽지 않도록 함.
if (type == DAMAGE_TYPE_POISON || type == DAMAGE_TYPE_FIRE)
{
if (GetHP() - dam <= 0)
{
dam = GetHP() - 1;
}
}
// MR-11: -- END OF -- DPS Debuff Fixes
// ------------------------
// 독일 프리미엄 모드

View File

@@ -46,7 +46,7 @@ EVENTINFO(TPoisonEventInfo)
EVENTFUNC(poison_event)
{
TPoisonEventInfo * info = dynamic_cast<TPoisonEventInfo *>( event->info );
TPoisonEventInfo * info = dynamic_cast<TPoisonEventInfo*>(event->info);
if ( info == NULL )
{
@@ -59,9 +59,11 @@ EVENTFUNC(poison_event)
if (ch == NULL) { // <Factor>
return 0;
}
LPCHARACTER pkAttacker = CHARACTER_MANAGER::instance().FindByPID(info->attacker_pid);
int dam = ch->GetMaxHP() * GetPoisonDamageRate(ch) / 1000;
if (test_server) ch->ChatPacket(CHAT_TYPE_NOTICE, "Poison Damage %d", dam);
if (ch->Damage(pkAttacker, dam, DAMAGE_TYPE_POISON))
@@ -99,7 +101,7 @@ EVENTINFO(TFireEventInfo)
EVENTFUNC(fire_event)
{
TFireEventInfo * info = dynamic_cast<TFireEventInfo *>( event->info );
TFireEventInfo * info = dynamic_cast<TFireEventInfo*>(event->info);
if ( info == NULL )
{
@@ -108,12 +110,15 @@ EVENTFUNC(fire_event)
}
LPCHARACTER ch = info->ch;
if (ch == NULL) { // <Factor>
return 0;
}
LPCHARACTER pkAttacker = CHARACTER_MANAGER::instance().FindByPID(info->attacker_pid);
int dam = info->amount;
if (test_server) ch->ChatPacket(CHAT_TYPE_NOTICE, "Fire Damage %d", dam);
if (ch->Damage(pkAttacker, dam, DAMAGE_TYPE_FIRE))
@@ -157,10 +162,12 @@ EVENTFUNC(fire_event)
*/
static int poison_level_adjust[9] =
// MR-11: DPS Debuff Fixes
const int poison_level_adjust[9] =
{
100, 90, 80, 70, 50, 30, 10, 5, 0
};
// MR-11: -- END OF -- DPS Debuff Fixes
void CHARACTER::AttackedByFire(LPCHARACTER pkAttacker, int amount, int count)
{
@@ -197,8 +204,13 @@ void CHARACTER::AttackedByPoison(LPCHARACTER pkAttacker)
if (m_bHasPoisoned && !IsPC()) // 몬스터는 독이 한번만 걸린다.
return;
// MR-11: DPS Debuff Fixes
if (IsStone() || IsDoor())
return;
// MR-11: -- END OF -- DPS Debuff Fixes
// MR-8: Check damage immunity system - prevent poison application if conditions not met
if (m_bDamageImmune && (IsMonster() || IsStone() || IsDoor()))
if (m_bDamageImmune && IsMonster())
{
if (!CheckDamageImmunityConditions(pkAttacker))
{
@@ -230,7 +242,7 @@ void CHARACTER::AttackedByPoison(LPCHARACTER pkAttacker)
info->ch = this;
info->count = 10;
info->attacker_pid = pkAttacker?pkAttacker->GetPlayerID():0;
info->attacker_pid = pkAttacker ? pkAttacker->GetPlayerID() : 0;
m_pkPoisonEvent = event_create(poison_event, info, 1);