mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Merge commit 'origin/master' into 310
Conflicts: src/game/SpellAuras.cpp
This commit is contained in:
commit
cae3f0a532
53 changed files with 1074 additions and 954 deletions
|
|
@ -84,7 +84,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
|||
if (target)
|
||||
target->GetSession()->m_muteTime = mutetime;
|
||||
|
||||
loginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id );
|
||||
loginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'",uint64(mutetime), account_id );
|
||||
|
||||
if(target)
|
||||
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime);
|
||||
|
|
@ -3893,6 +3893,40 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
void ChatHandler::HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id)
|
||||
{
|
||||
uint32 classmask = player->getClassMask();
|
||||
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
{
|
||||
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
|
||||
if (!skillLine)
|
||||
continue;
|
||||
|
||||
// wrong skill
|
||||
if( skillLine->skillId != skill_id)
|
||||
continue;
|
||||
|
||||
// not high rank
|
||||
if(skillLine->forward_spellid )
|
||||
continue;
|
||||
|
||||
// skip racial skills
|
||||
if (skillLine->racemask != 0)
|
||||
continue;
|
||||
|
||||
// skip wrong class skills
|
||||
if( skillLine->classmask && (skillLine->classmask & classmask) == 0)
|
||||
continue;
|
||||
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
|
||||
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,player,false))
|
||||
continue;
|
||||
|
||||
player->learnSpell(skillLine->spellId,false);
|
||||
}
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
|
||||
{
|
||||
uint32 classmask = m_session->GetPlayer()->getClassMask();
|
||||
|
|
@ -3903,31 +3937,10 @@ bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
|
|||
if( !skillInfo )
|
||||
continue;
|
||||
|
||||
if( skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY )
|
||||
if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) &&
|
||||
skillInfo->canLink) // only prof. with recipes have
|
||||
{
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
{
|
||||
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
|
||||
if( !skillLine )
|
||||
continue;
|
||||
|
||||
// skip racial skills
|
||||
if( skillLine->racemask != 0 )
|
||||
continue;
|
||||
|
||||
// skip wrong class skills
|
||||
if( skillLine->classmask && (skillLine->classmask & classmask) == 0)
|
||||
continue;
|
||||
|
||||
if( skillLine->skillId != i || skillLine->forward_spellid )
|
||||
continue;
|
||||
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
|
||||
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
|
||||
continue;
|
||||
|
||||
m_session->GetPlayer()->learnSpell(skillLine->spellId,false);
|
||||
}
|
||||
HandleLearnSkillRecipesHelper(m_session->GetPlayer(),skillInfo->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3960,54 +3973,58 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
|
|||
|
||||
uint32 classmask = m_session->GetPlayer()->getClassMask();
|
||||
|
||||
for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i)
|
||||
std::string name;
|
||||
|
||||
SkillLineEntry const *targetSkillInfo = NULL;
|
||||
for (uint32 i = 1; i < sSkillLineStore.GetNumRows(); ++i)
|
||||
{
|
||||
SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(i);
|
||||
if( !skillInfo )
|
||||
if (!skillInfo)
|
||||
continue;
|
||||
|
||||
if( skillInfo->categoryId != SKILL_CATEGORY_PROFESSION &&
|
||||
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY )
|
||||
if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION &&
|
||||
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
|
||||
!skillInfo->canLink) // only prof with recipes have set
|
||||
continue;
|
||||
|
||||
int loc = GetSessionDbcLocale();
|
||||
std::string name = skillInfo->name[loc];
|
||||
name = skillInfo->name[loc];
|
||||
if(name.empty())
|
||||
continue;
|
||||
|
||||
if(Utf8FitTo(name, wnamepart))
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
|
||||
if( !skillLine )
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
if( skillLine->skillId != i || skillLine->forward_spellid )
|
||||
name = skillInfo->name[loc];
|
||||
if(name.empty())
|
||||
continue;
|
||||
|
||||
// skip racial skills
|
||||
if( skillLine->racemask != 0 )
|
||||
continue;
|
||||
|
||||
// skip wrong class skills
|
||||
if( skillLine->classmask && (skillLine->classmask & classmask) == 0)
|
||||
continue;
|
||||
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
|
||||
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
|
||||
continue;
|
||||
|
||||
if( !target->HasSpell(spellInfo->Id) )
|
||||
m_session->GetPlayer()->learnSpell(skillLine->spellId,false);
|
||||
if (Utf8FitTo(name, wnamepart))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint16 maxLevel = target->GetPureMaxSkillValue(skillInfo->id);
|
||||
target->SetSkill(skillInfo->id, maxLevel, maxLevel);
|
||||
PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str());
|
||||
return true;
|
||||
if(loc < MAX_LOCALE)
|
||||
{
|
||||
targetSkillInfo = skillInfo;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
if(!targetSkillInfo)
|
||||
return false;
|
||||
|
||||
HandleLearnSkillRecipesHelper(target,targetSkillInfo->id);
|
||||
|
||||
uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id);
|
||||
target->SetSkill(targetSkillInfo->id, maxLevel, maxLevel);
|
||||
PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue