mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Merge commit 'origin/master' into 310
Conflicts: src/game/Player.cpp src/game/SpellAuras.cpp
This commit is contained in:
commit
cffbb8661b
44 changed files with 389 additions and 181 deletions
|
|
@ -8421,13 +8421,6 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
|
|||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
//FIX ME this hack: don't get feared if stunned
|
||||
if (spellInfo->Mechanic == MECHANIC_FEAR )
|
||||
{
|
||||
if ( hasUnitState(UNIT_STAT_STUNNED) )
|
||||
return true;
|
||||
}
|
||||
|
||||
//TODO add spellEffect immunity checks!, player with flag in bg is imune to imunity buffs from other friendly players!
|
||||
//SpellImmuneList const& dispelList = m_spellImmune[IMMUNITY_EFFECT];
|
||||
|
||||
|
|
@ -10325,21 +10318,22 @@ CharmInfo::CharmInfo(Unit* unit)
|
|||
void CharmInfo::InitPetActionBar()
|
||||
{
|
||||
// the first 3 SpellOrActions are attack, follow and stay
|
||||
// last 3 SpellOrActions are reactions
|
||||
for(uint32 i = 0; i < 3; ++i)
|
||||
{
|
||||
SetActionBar(i,COMMAND_ATTACK - i,ACT_COMMAND);
|
||||
SetActionBar(i + 7,COMMAND_ATTACK - i,ACT_REACTION);
|
||||
}
|
||||
for(uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_START - ACTION_BAR_INDEX_START; ++i)
|
||||
SetActionBar(ACTION_BAR_INDEX_START + i,COMMAND_ATTACK - i,ACT_COMMAND);
|
||||
|
||||
// middle 4 SpellOrActions are spells/special attacks/abilities
|
||||
for(uint32 i = 0; i < 4; ++i)
|
||||
SetActionBar(i + 3,0,ACT_DISABLED);
|
||||
for(uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_END-ACTION_BAR_INDEX_PET_SPELL_START; ++i)
|
||||
SetActionBar(ACTION_BAR_INDEX_PET_SPELL_START + i,0,ACT_DISABLED);
|
||||
|
||||
// last 3 SpellOrActions are reactions
|
||||
for(uint32 i = 0; i < ACTION_BAR_INDEX_END - ACTION_BAR_INDEX_PET_SPELL_END; ++i)
|
||||
SetActionBar(ACTION_BAR_INDEX_PET_SPELL_END + i,COMMAND_ATTACK - i,ACT_REACTION);
|
||||
}
|
||||
|
||||
void CharmInfo::InitEmptyActionBar()
|
||||
{
|
||||
SetActionBar(0,COMMAND_ATTACK,ACT_COMMAND);
|
||||
for(uint32 x = 1; x < MAX_UNIT_ACTION_BAR_INDEX; ++x)
|
||||
SetActionBar(ACTION_BAR_INDEX_START,COMMAND_ATTACK,ACT_COMMAND);
|
||||
for(uint32 x = ACTION_BAR_INDEX_START+1; x < ACTION_BAR_INDEX_END; ++x)
|
||||
SetActionBar(x,0,ACT_PASSIVE);
|
||||
}
|
||||
|
||||
|
|
@ -10476,16 +10470,18 @@ void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow)
|
|||
m_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0);
|
||||
}
|
||||
|
||||
bool CharmInfo::LoadActionBar( std::string data )
|
||||
void CharmInfo::LoadPetActionBar( std::string data )
|
||||
{
|
||||
InitPetActionBar();
|
||||
|
||||
Tokens tokens = StrSplit(data, " ");
|
||||
|
||||
if (tokens.size() != MAX_UNIT_ACTION_BAR_INDEX*2)
|
||||
return false;
|
||||
if (tokens.size() != (ACTION_BAR_INDEX_PET_SPELL_END-ACTION_BAR_INDEX_PET_SPELL_START)*2)
|
||||
return; // non critical, will reset to default
|
||||
|
||||
int index;
|
||||
Tokens::iterator iter;
|
||||
for(iter = tokens.begin(), index = 0; index < MAX_UNIT_ACTION_BAR_INDEX; ++iter, ++index )
|
||||
for(iter = tokens.begin(), index = ACTION_BAR_INDEX_PET_SPELL_START; index < ACTION_BAR_INDEX_PET_SPELL_END; ++iter, ++index )
|
||||
{
|
||||
// use unsigned cast to avoid sign negative format use at long-> ActiveStates (int) conversion
|
||||
PetActionBar[index].Type = atol((*iter).c_str());
|
||||
|
|
@ -10496,7 +10492,6 @@ bool CharmInfo::LoadActionBar( std::string data )
|
|||
if(PetActionBar[index].IsActionBarForSpell() && !sSpellStore.LookupEntry(PetActionBar[index].SpellOrAction))
|
||||
SetActionBar(index,0,ACT_DISABLED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CharmInfo::BuildActionBar( WorldPacket* data )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue