From 1afdc2c529517d0e799d954c1fd20d88be2248f5 Mon Sep 17 00:00:00 2001 From: Caelic <36283957+Caelic@users.noreply.github.com> Date: Sun, 12 Apr 2020 02:25:02 -0400 Subject: [PATCH 1/3] Update charutils.cpp --- src/map/utils/charutils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/map/utils/charutils.cpp b/src/map/utils/charutils.cpp index 13d63df895d..7e70871c3ba 100644 --- a/src/map/utils/charutils.cpp +++ b/src/map/utils/charutils.cpp @@ -773,6 +773,8 @@ namespace charutils memcpy(&PChar->teleport.survival, buf, (length > sizeof(PChar->teleport.survival) ? sizeof(PChar->teleport.survival) : length)); } + PChar->m_hitCounter = 0; + PChar->PMeritPoints = new CMeritPoints(PChar); PChar->PMeritPoints->SetMeritPoints(meritPoints); PChar->PMeritPoints->SetLimitPoints(limitPoints); From d68cd11ce78c5bdd73935137021da00d4008fa5d Mon Sep 17 00:00:00 2001 From: Caelic <36283957+Caelic@users.noreply.github.com> Date: Sun, 12 Apr 2020 02:25:55 -0400 Subject: [PATCH 2/3] Update charentity.h --- src/map/entities/charentity.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/map/entities/charentity.h b/src/map/entities/charentity.h index d34f93648f0..76dda0abf0e 100644 --- a/src/map/entities/charentity.h +++ b/src/map/entities/charentity.h @@ -296,6 +296,8 @@ class CCharEntity : public CBattleEntity bool m_mentorUnlocked; uint32 m_moghouseID; uint16 m_moghancementID; + + uint8 m_hitCounter; // auto-attack it counter for Tredecim Scythe int8 getShieldSize(); From 4c7dd68349b9396f19289aeb6f51616d863d6e62 Mon Sep 17 00:00:00 2001 From: Caelic <36283957+Caelic@users.noreply.github.com> Date: Sun, 12 Apr 2020 02:32:56 -0400 Subject: [PATCH 3/3] Update battleentity.cpp --- src/map/entities/battleentity.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 9a9973273d1..280e1fb3df7 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -1426,6 +1426,12 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action) actionList_t& list = action.getNewActionList(); list.ActionTargetID = PTarget->id; + + bool tredecim = false; + if (this->objtype == TYPE_PC && (((CCharEntity*)this)->getEquip(SLOT_MAIN))->getID() == 18052) + { + tredecim = true; + } ///////////////////////////////////////////////////////////////////////// // Start of the attack loop. @@ -1435,6 +1441,9 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action) actionTarget_t& actionTarget = list.getNewActionTarget(); // Reference to the current swing. CAttack& attack = attackRound.GetCurrentAttack(); + + if (tredecim) + (((CCharEntity*)this)->m_hitCounter)++; // Set the swing animation. actionTarget.animation = attack.GetAnimationID(); @@ -1514,7 +1523,11 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action) { // Set this attack's critical flag. attack.SetCritical(dsprand::GetRandomNumber(100) < battleutils::GetCritHitRate(this, PTarget, !attack.IsFirstSwing())); - + if (tredecim && ((CCharEntity*)this)->m_hitCounter > 12) + { + ((CCharEntity*)this)->m_hitCounter = 0; + attack.SetCritical(true); + } // Critical hit. if (attack.IsCritical()) {