aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2024-01-29 09:21:42 +0100
committerOvahlord <dreadkiller@gmx.de>2024-01-29 09:21:42 +0100
commit693329aefc8b3b2a38a7fb1a18db47592f68daa5 (patch)
tree85f206c84f7ec495cc588de26619beb7f0e17494 /src
parentf33f8e018ac688534bda37fa0312d7b6b2d27fad (diff)
Core/Spells: fixed learning skills via spells and removed the unneeded implementation for automatically learning riding spells (they are being taught by quest reward spells or level up autolearn spell effects)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp17
-rw-r--r--src/server/game/Spells/SpellEffects.cpp14
2 files changed, 12 insertions, 19 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index e6402598faa..29afb42274b 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -140,9 +140,7 @@
enum PlayerSpells
{
- SPELL_EXPERIENCE_ELIMINATED = 206662,
- SPELL_APPRENTICE_RIDING = 33389,
- SPELL_JOURNEYMAN_RIDING = 33391
+ SPELL_EXPERIENCE_ELIMINATED = 206662
};
static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
@@ -23910,6 +23908,10 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races r
continue;
}
+ // AcquireMethod == 2 && NumSkillUps == 1 --> automatically learn riding skill spell, else we skip it (client shows riding in spellbook as trainable).
+ if (skillId == SKILL_RIDING && (ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN || ability->NumSkillUps != 1))
+ continue;
+
// Check race if set
if (!ability->RaceMask.IsEmpty() && !ability->RaceMask.HasRace(race))
continue;
@@ -23920,15 +23922,6 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races r
// Check level, skip class spells if not high enough
uint32 requiredLevel = std::max(spellInfo->SpellLevel, spellInfo->BaseLevel);
-
- // riding special cases
- if (skillId == SKILL_RIDING)
- {
- if (GetClassMask() & ((1 << (CLASS_DEATH_KNIGHT - 1)) | (1 << (CLASS_DEMON_HUNTER - 1)))
- && (ability->Spell == SPELL_APPRENTICE_RIDING || ability->Spell == SPELL_JOURNEYMAN_RIDING))
- requiredLevel = 0;
- }
-
if (requiredLevel > GetLevel())
continue;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 450bcfd7757..a36a12dbfa4 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2286,7 +2286,7 @@ void Spell::EffectLearnSkill()
if (!playerTarget)
return;
- if (damage < 1)
+ if (damage < 0)
return;
uint32 skillid = effectInfo->MiscValue;
@@ -2299,12 +2299,12 @@ void Spell::EffectLearnSkill()
return;
uint16 skillval = std::max<uint16>(1, playerTarget->GetPureSkillValue(skillid));
- uint16 maxSkillVal = tier->GetValueForTierIndex(damage - 1);
+ uint16 maxSkillVal = tier->GetValueForTierIndex(damage);
if (rcEntry->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
skillval = maxSkillVal;
- playerTarget->SetSkill(skillid, damage, skillval, maxSkillVal);
+ playerTarget->SetSkill(skillid, (damage + 1), skillval, maxSkillVal);
}
void Spell::EffectPlayMovie()
@@ -4550,11 +4550,11 @@ void Spell::EffectSkill()
if (!playerTarget)
return;
- if (damage < 1)
+ if (damage < 0)
return;
uint32 skillid = effectInfo->MiscValue;
- if (playerTarget->GetSkillStep(skillid) >= damage)
+ if (playerTarget->GetSkillStep(skillid) >= (damage + 1))
return;
SkillRaceClassInfoEntry const* rcEntry = sDB2Manager.GetSkillRaceClassInfo(skillid, playerTarget->GetRace(), playerTarget->GetClass());
@@ -4566,12 +4566,12 @@ void Spell::EffectSkill()
return;
uint16 skillval = std::max<uint16>(1, playerTarget->GetPureSkillValue(skillid));
- uint16 maxSkillVal = tier->GetValueForTierIndex(damage - 1);
+ uint16 maxSkillVal = tier->GetValueForTierIndex(damage);
if (rcEntry->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
skillval = maxSkillVal;
- playerTarget->SetSkill(skillid, damage, skillval, maxSkillVal);
+ playerTarget->SetSkill(skillid, (damage + 1), skillval, maxSkillVal);
}
void Spell::EffectSpiritHeal()