mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
[svn] *** Source Mangos ***
*Load npc_options at server startup, use cached data at creature gossip menu init. * Also new .reload table command added *Implement npc_option localization support, also store in DB BoxText/BoxMoney/Coded * Use characters.guid instead low guid value from characters.data in charcter enum data prepering for client. * Fixed crash at .pinfo command use from console. * Fixed windows ad.exe build *Creature related code and DB cleanups. * Rename 2 creature_template fields to more clean names and related code update also. * Use enum values instead raw values for type_flags, use halper functions instead code repeating. * Move tamed pet creating code to new function. ** Small code changes to make things compliant with above changes. ** Another rev with big changes so test away. --HG-- branch : trunk
This commit is contained in:
@@ -3669,13 +3669,7 @@ uint8 Spell::CanCast(bool strict)
|
||||
return SPELL_FAILED_TARGET_NOT_LOOTED;
|
||||
}
|
||||
|
||||
uint32 skill;
|
||||
if(creature->GetCreatureInfo()->flag1 & 256)
|
||||
skill = SKILL_HERBALISM; // special case
|
||||
else if(creature->GetCreatureInfo()->flag1 & 512)
|
||||
skill = SKILL_MINING; // special case
|
||||
else
|
||||
skill = SKILL_SKINNING; // normal case
|
||||
uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill();
|
||||
|
||||
int32 skillValue = ((Player*)m_caster)->GetSkillValue(skill);
|
||||
int32 TargetLevel = m_targets.getUnitTarget()->getLevel();
|
||||
@@ -3967,12 +3961,8 @@ uint8 Spell::CanCast(bool strict)
|
||||
if (m_targets.getUnitTarget()->getLevel() > m_caster->getLevel())
|
||||
return SPELL_FAILED_HIGHLEVEL;
|
||||
|
||||
CreatureInfo const *cinfo = ((Creature*)m_targets.getUnitTarget())->GetCreatureInfo();
|
||||
if( cinfo->type != CREATURE_TYPE_BEAST )
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// use SMSG_PET_TAME_FAILURE?
|
||||
if( !(cinfo->flag1 & 1) || !(cinfo->family) )
|
||||
if (!((Creature*)m_targets.getUnitTarget())->GetCreatureInfo()->isTameable ())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if(m_caster->GetPetGUID())
|
||||
|
||||
Reference in New Issue
Block a user