*Update to Mangos 7083.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-01-14 00:35:13 -06:00
1 parent 78e92e9023
commit 83e7f653fe
16 files changed
+698 -147

No files matched your search

+14 -9
View File
@@ -3566,22 +3566,22 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
if (!trainer_spell)
return TRAINER_SPELL_RED;
if (!trainer_spell->spell)
if (!trainer_spell->learned_spell)
return TRAINER_SPELL_RED;
// known spell
if(HasSpell(trainer_spell->spell))
if(HasSpell(trainer_spell->learned_spell))
return TRAINER_SPELL_GRAY;
// check race/class requirement
if(!IsSpellFitByClassAndRace(trainer_spell->spell))
if(!IsSpellFitByClassAndRace(trainer_spell->learned_spell))
return TRAINER_SPELL_RED;
// check level requirement
if(getLevel() < trainer_spell->reqlevel)
return TRAINER_SPELL_RED;
if(SpellChainNode const* spell_chain = spellmgr.GetSpellChainNode(trainer_spell->spell))
if(SpellChainNode const* spell_chain = spellmgr.GetSpellChainNode(trainer_spell->learned_spell))
{
// check prev.rank requirement
if(spell_chain->prev && !HasSpell(spell_chain->prev))
@@ -3600,7 +3600,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
return TRAINER_SPELL_RED;
// exist, already checked at loading
SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->spell);
SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->learned_spell);
// secondary prof. or not prof. spell
uint32 skill = spell->EffectMiscValue[1];
@@ -5049,7 +5049,7 @@ void Player::UpdateSkillsToMaxSkillsForLevel()
if (GetUInt32Value(PLAYER_SKILL_INDEX(i)))
{
uint32 pskill = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
if( IsProfessionSkill(pskill) || pskill == SKILL_RIDING )
if( IsProfessionOrRidingSkill(pskill))
continue;
uint32 data = GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i));
@@ -18756,18 +18756,23 @@ bool Player::IsSpellFitByClassAndRace( uint32 spell_id ) const
SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spell_id);
SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spell_id);
if(lower==upper)
return true;
for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
{
// skip wrong race skills
if( _spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0)
return false;
continue;
// skip wrong class skills
if( _spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0)
return false;
continue;
return true;
}
return true;
return false;
}
bool Player::HasQuestForGO(int32 GOId)