Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 25 additions & 17 deletions engine/class_modules/sc_demon_hunter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10771,28 +10771,36 @@ void demon_hunter_t::init_spells()
talent.annihilator.world_killer = find_talent_spell( talent_tree::HERO, "World Killer" );

// Scarred talents
talent.scarred.demonsurge = find_talent_spell( talent_tree::HERO, "Demonsurge" );
if ( specialization() == DEMON_HUNTER_HAVOC )
talent.scarred.demonsurge = find_talent_spell( talent_tree::HERO, "Demonsurge" );
else
talent.scarred.demonsurge = find_talent_spell( talent_tree::HERO, "Voidsurge" );

auto HT_FS = [ this ]( std::string_view n ) {
return find_talent_spell( specialization() == DEMON_HUNTER_HAVOC ? HERO_FELSCARRED : HERO_VOID_SCARRED, n );
};

talent.scarred.wave_of_debilitation = HT_FS( "Wave of Debilitation" );

talent.scarred.wave_of_debilitation = find_talent_spell( talent_tree::HERO, "Wave of Debilitation" );
talent.scarred.pursuit_of_angriness = find_talent_spell( talent_tree::HERO, "Pursuit of Angriness" );
talent.scarred.focused_hatred = find_talent_spell( talent_tree::HERO, "Focused Hatred" );
talent.scarred.set_fire_to_the_pain = find_talent_spell( talent_tree::HERO, "Set Fire to the Pain" );
talent.scarred.improved_soul_rending = find_talent_spell( talent_tree::HERO, "Improved Soul Rending" );
talent.scarred.pursuit_of_angriness = HT_FS( "Pursuit of Angriness" );
talent.scarred.focused_hatred = HT_FS( "Focused Hatred" );
talent.scarred.set_fire_to_the_pain = HT_FS( "Set Fire to the Pain" );
talent.scarred.improved_soul_rending = HT_FS( "Improved Soul Rending" );

talent.scarred.burning_blades = find_talent_spell( talent_tree::HERO, "Burning Blades" );
talent.scarred.violent_transformation = find_talent_spell( talent_tree::HERO, "Violent Transformation" );
talent.scarred.enduring_torment = find_talent_spell( talent_tree::HERO, "Enduring Torment" );
talent.scarred.burning_blades = HT_FS( "Burning Blades" );
talent.scarred.violent_transformation = HT_FS( "Violent Transformation" );
talent.scarred.enduring_torment = HT_FS( "Enduring Torment" );

talent.scarred.untethered_fury = find_talent_spell( talent_tree::HERO, "Untethered Fury" );
talent.scarred.student_of_suffering = find_talent_spell( talent_tree::HERO, "Student of Suffering" );
talent.scarred.flamebound = find_talent_spell( talent_tree::HERO, "Flamebound" );
talent.scarred.monster_rising = find_talent_spell( talent_tree::HERO, "Monster Rising" );
talent.scarred.untethered_fury = HT_FS( "Untethered Fury" );
talent.scarred.student_of_suffering = HT_FS( "Student of Suffering" );
talent.scarred.flamebound = HT_FS( "Flamebound" );
talent.scarred.monster_rising = HT_FS( "Monster Rising" );

talent.scarred.blind_focus = find_talent_spell( talent_tree::HERO, "Blind Focus" );
talent.scarred.undying_embers = find_talent_spell( talent_tree::HERO, "Undying Embers" );
talent.scarred.volatile_instinct = find_talent_spell( talent_tree::HERO, "Volatile Instinct" );
talent.scarred.blind_focus = HT_FS( "Blind Focus" );
talent.scarred.undying_embers = HT_FS( "Undying Embers" );
talent.scarred.volatile_instinct = HT_FS( "Volatile Instinct" );

talent.scarred.demonic_intensity = find_talent_spell( talent_tree::HERO, "Demonic Intensity" );
talent.scarred.demonic_intensity = HT_FS( "Demonic Intensity" );

// Class Background Spells
spell.felblade_damage = talent_spell_lookup( talent.demon_hunter.felblade, 213243 );
Expand Down
7 changes: 6 additions & 1 deletion engine/dbc/trait_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ const trait_data_t* trait_data_t::find( unsigned trait_node_entry_id, bool ptr )
}

const trait_data_t* trait_data_t::find( talent_tree tree, std::string_view name, unsigned class_id,
specialization_e spec, bool ptr, bool tokenize, unsigned index )
specialization_e spec, bool ptr, bool tokenize, unsigned index, unsigned sub_tree_id )
{
std::vector<const trait_data_t*> _traits;

auto _data = data( class_id, tree, ptr );

for ( const auto& entry : _data )
{
if ( sub_tree_id != 0 && entry.id_sub_tree != 0 && entry.id_sub_tree != sub_tree_id )
{
continue;
}

if ( util::str_compare_ci( name, tokenize ? util::tokenize_fn( entry.name ) : entry.name ) )
{
if ( entry.id_spec[ 0 ] == 0 || range::contains( entry.id_spec, static_cast<unsigned>( spec ) ) )
Expand Down
2 changes: 1 addition & 1 deletion engine/dbc/trait_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct trait_data_t
// static functions
static const trait_data_t* find( unsigned trait_node_entry_id, bool ptr = false );
static const trait_data_t* find( talent_tree tree, std::string_view name, unsigned class_id, specialization_e spec,
bool ptr = false, bool tokenize = false, unsigned index = 0 );
bool ptr = false, bool tokenize = false, unsigned index = 0, unsigned sub_tree_id = 0 );
static std::vector<const trait_data_t*> find_by_spell( talent_tree tree, unsigned spell_id, unsigned class_id = 0,
specialization_e spec = SPEC_NONE, bool ptr = false );
static const trait_data_t* find_by_trait_definition( unsigned trait_definition_id, bool ptr = false );
Expand Down
10 changes: 8 additions & 2 deletions engine/player/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11583,11 +11583,17 @@ static player_talent_t create_talent_obj( const player_t* player, const trait_da
return { player, trait, rank };
}

player_talent_t player_t::find_talent_spell( hero_tree_e tree, std::string_view name, bool name_tokenized,
unsigned index ) const
{
return find_talent_spell( talent_tree::HERO, name, _spec, name_tokenized, index, tree );
}

player_talent_t player_t::find_talent_spell( talent_tree tree, std::string_view name, specialization_e s,
bool name_tokenized, unsigned index ) const
bool name_tokenized, unsigned index, hero_tree_e hero_tree ) const
{
auto trait = trait_data_t::find( tree, name, util::class_id( type ), s == SPEC_NONE ? _spec : s, dbc->ptr,
name_tokenized, index );
name_tokenized, index, static_cast<unsigned>( hero_tree ) );

if ( trait == &trait_data_t::nil() )
{
Expand Down
4 changes: 3 additions & 1 deletion engine/player/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,10 @@ struct player_t : public actor_t
const spell_data_t* find_rank_spell( util::string_view name, util::string_view rank,
specialization_e s = SPEC_NONE ) const;
const spell_data_t* find_pet_spell( util::string_view name ) const;
player_talent_t find_talent_spell( hero_tree_e tree, std::string_view name, bool name_tokenized = false,
unsigned index = 0 ) const;
player_talent_t find_talent_spell( talent_tree tree, std::string_view name, specialization_e s = SPEC_NONE,
bool name_tokenized = false, unsigned index = 0 ) const;
bool name_tokenized = false, unsigned index = 0, hero_tree_e hero_tree = HERO_NONE ) const;
player_talent_t find_talent_spell( talent_tree tree, std::string_view name, unsigned index ) const;
player_talent_t find_talent_spell( talent_tree tree, unsigned spell_id, specialization_e s = SPEC_NONE ) const;
player_talent_t find_talent_spell( unsigned talent_entry_id ) const;
Expand Down
Loading