Skip to content

Commit

Permalink
[9354] Add spell efffects for dual spec.
Browse files Browse the repository at this point in the history
Actual dual spec still not implemented.

Credits to EnderGT for original patch.

Signed-off-by: hunuza <hunuza@gmail.com>
  • Loading branch information
hunuza committed Feb 10, 2010
1 parent 450bcff commit eb637ca
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 15 deletions.
4 changes: 2 additions & 2 deletions sql/characters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

DROP TABLE IF EXISTS `character_db_version`;
CREATE TABLE `character_db_version` (
`required_9349_01_characters_character_action` bit(1) default NULL
`required_9354_01_characters_character_action` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';

--
Expand Down Expand Up @@ -341,7 +341,7 @@ CREATE TABLE `character_action` (
`button` tinyint(3) unsigned NOT NULL default '0',
`action` int(11) unsigned NOT NULL default '0',
`type` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`guid`,`button`)
PRIMARY KEY (`guid`,`spec`,`button`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';

--
Expand Down
3 changes: 3 additions & 0 deletions sql/updates/9354_01_characters_character_action.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE character_db_version CHANGE COLUMN required_9349_01_characters_character_action required_9354_01_characters_character_action bit;

ALTER TABLE `character_action` DROP PRIMARY KEY, ADD PRIMARY KEY(`guid`,`spec`,`button`);
2 changes: 2 additions & 0 deletions sql/updates/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pkgdata_DATA = \
9331_01_mangos_quest_template.sql \
9339_01_characters_group.sql \
9349_01_characters_character_action.sql \
9354_01_characters_character_action.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -108,4 +109,5 @@ EXTRA_DIST = \
9331_01_mangos_quest_template.sql \
9339_01_characters_group.sql \
9349_01_characters_character_action.sql \
9354_01_characters_character_action.sql \
README
26 changes: 24 additions & 2 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5634,7 +5634,7 @@ void Player::SendInitialActionButtons() const
sLog.outDetail( "Initializing Action Buttons for '%u'", GetGUIDLow() );

WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4));
data << uint8(0); // can be 0, 1, 2 (talent spec)
data << uint8(1); // can be 0, 1, 2 (talent spec)
ActionButtonList const& currentActionButtonList = m_actionButtons[m_activeSpec];
for(int button = 0; button < MAX_ACTION_BUTTONS; ++button)
{
Expand Down Expand Up @@ -21315,12 +21315,34 @@ void Player::DeleteEquipmentSet(uint64 setGuid)
}
}

void Player::ActivateSpec(uint32 specNum)
void Player::ActivateSpec(uint8 specNum)
{
if(GetActiveSpec() == specNum)
return;

resetTalents(true);

SetActiveSpec(specNum);

SendInitialActionButtons();

InitTalentForLevel();
}

void Player::UpdateSpecCount(uint8 count)
{
uint8 curCount = GetSpecsCount();
if(curCount == count)
return;

if(count > curCount)
{
//TODO: copy current action button set
}

SetSpecsCount(count);

SendTalentsInfoData(false);
}

void Player::RemoveAtLoginFlag( AtLoginFlags f, bool in_db_also /*= false*/ )
Expand Down
15 changes: 8 additions & 7 deletions src/game/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1532,11 +1532,12 @@ class MANGOS_DLL_SPEC Player : public Unit
uint32 CalculateTalentsPoints() const;

// Dual Spec
uint32 GetActiveSpec() { return m_activeSpec; }
void SetActiveSpec(uint32 spec) { m_activeSpec = spec; }
uint32 GetSpecsCount() { return m_specsCount; }
void SetSpecsCount(uint32 count) { m_specsCount = count; }
void ActivateSpec(uint32 specNum);
uint8 GetActiveSpec() { return m_activeSpec; }
void SetActiveSpec(uint8 spec) { m_activeSpec = spec; }
uint8 GetSpecsCount() { return m_specsCount; }
void SetSpecsCount(uint8 count) { m_specsCount = count; }
void ActivateSpec(uint8 specNum);
void UpdateSpecCount(uint8 count);

void InitGlyphsForLevel();
void SetGlyphSlot(uint8 slot, uint32 slottype) { SetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot, slottype); }
Expand Down Expand Up @@ -2357,8 +2358,8 @@ class MANGOS_DLL_SPEC Player : public Unit
SpellCooldowns m_spellCooldowns;
uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use

uint32 m_activeSpec;
uint32 m_specsCount;
uint8 m_activeSpec;
uint8 m_specsCount;

ActionButtonList m_actionButtons[MAX_TALENT_SPEC_COUNT];

Expand Down
2 changes: 2 additions & 0 deletions src/game/Spell.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ class Spell
void EffectTitanGrip(uint32 i);
void EffectEnchantItemPrismatic(uint32 i);
void EffectPlayMusic(uint32 i);
void EffectSpecCount(uint32 i);
void EffectActivateSpec(uint32 i);

Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL );
~Spell();
Expand Down
21 changes: 19 additions & 2 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectRenamePet, //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
&Spell::EffectNULL, //160 SPELL_EFFECT_160 unused
&Spell::EffectNULL, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert)
&Spell::EffectNULL, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec
&Spell::EffectSpecCount, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert)
&Spell::EffectActivateSpec, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec
};

void Spell::EffectNULL(uint32 /*i*/)
Expand Down Expand Up @@ -6996,3 +6996,20 @@ void Spell::EffectPlayMusic(uint32 i)
data << uint32(soundid);
((Player*)unitTarget)->GetSession()->SendPacket(&data);
}

void Spell::EffectSpecCount(uint32 /*eff_idx*/)
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;

((Player*)unitTarget)->UpdateSpecCount(damage);
}

void Spell::EffectActivateSpec(uint32 /*eff_idx*/)
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;

// damage = spec + 1
((Player*)unitTarget)->ActivateSpec(damage-1);
}
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9353"
#define REVISION_NR "9354"
#endif // __REVISION_NR_H__
2 changes: 1 addition & 1 deletion src/shared/revision_sql.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_9349_01_characters_character_action"
#define REVISION_DB_CHARACTERS "required_9354_01_characters_character_action"
#define REVISION_DB_MANGOS "required_9331_01_mangos_quest_template"
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
#endif // __REVISION_SQL_H__

8 comments on commit eb637ca

@Andrewzz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I got confused :S It is, or It is not implemented?

If it is not, do you know if it is going to be implemented today? :D Hope yes

@Wowka321
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note fully implemented yet, but i hope very soon. =)

@luisalvarado
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just give the mangos team some more time. We all know they do a great job. When the Dual Talent gets implemented you wont see the commit message saying "Actual dual spec still not implemented." instead you will see something like "DUAL TALENT IS IMPLEMENTED OMG!!!"

@boxa
Copy link
Contributor

@boxa boxa commented on eb637ca Feb 11, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fuuu. I'm sorry, very much respecting to developers (Vladimir - cool work always!!!), but - this is shame for MaNGOS. Patch for "dual spec" exists already a long time and worked perfectly. And on my server also. Why don't use it in "official" version (with your own fixes)?
And a long time to wait vehicles, which also work normally in a patch... It's a base features...
But anyway - cool work guys! Good luck in develop & in life :-) !

@luisalvarado
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it contains code that may have some of the following:

  • Does not conform with the coding standards of Mangos - May have some hardcoded stuff instead of using for example the dbc files - May be unstable or create a crash when some code executes itself after long time.

In any of the cases please be patient. For both, the vehicle and dual talent. You are right, this 2 are needed features but it is much more important the stability and correct code than a new feature (or old in this case actually ;) )

@morphau
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for CYREX, wait and see ! ;)

@NetSky
Copy link

@NetSky NetSky commented on eb637ca Feb 11, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agreed according to dual spec :P

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"And a long time to wait vehicles, which also work normally in a patch..."
One big hack can't be "normal" patch ;) without dependence work it or not...

Please sign in to comment.