Merge branch 'master' into 310

Conflicts:
	src/game/GameObject.h
	src/game/MiscHandler.cpp
	src/game/Player.cpp
	src/game/QueryHandler.cpp
	src/game/QuestHandler.cpp
	src/game/SkillHandler.cpp
	src/game/SpellAuras.cpp
	src/game/SpellEffects.cpp
	src/game/Unit.cpp
	src/game/WorldSession.h
This commit is contained in:
tomrus88 2009-05-29 19:15:43 +04:00
commit e454cb693d
8 changed files with 244 additions and 234 deletions

View file

@ -8681,7 +8681,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
if(slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_START+GetMaxKeyringSize() && !(pProto->BagFamily & BAG_FAMILY_MASK_KEYS))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// currencytoken case (disabled until proper implement)
// currencytoken case
if(slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;

View file

@ -399,7 +399,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED))
{
for(int j=0;j<3;j++)
for(int j = 0;j < 3; ++j)
{
if (m_spellInfo->Effect[j] == 0)
continue;
@ -768,23 +768,31 @@ void Spell::prepareDataForTriggerSystem()
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0000000000200080LL) m_canTrigger = true;
if (m_spellInfo->SpellFamilyFlags & 0x0000000000200080LL)
m_canTrigger = true;
break;
case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0000800000000060LL) m_canTrigger = true;
if (m_spellInfo->SpellFamilyFlags & 0x0000800000000060LL)
m_canTrigger = true;
break;
case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0001800000000000LL) m_canTrigger = true;
if (m_spellInfo->SpellFamilyFlags & 0x0001800000000000LL)
m_canTrigger = true;
break;
case SPELLFAMILY_ROGUE: // For poisons need do it
if (m_spellInfo->SpellFamilyFlags & 0x000000101001E000LL) m_canTrigger = true;
if (m_spellInfo->SpellFamilyFlags & 0x000000101001E000LL)
m_canTrigger = true;
break;
case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot
if (m_spellInfo->SpellFamilyFlags & 0x0100200000000214LL ||
m_spellInfo->SpellFamilyFlags2 & 0x200) m_canTrigger = true;
m_spellInfo->SpellFamilyFlags2 & 0x200)
m_canTrigger = true;
break;
case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0001000900B80400LL) m_canTrigger = true;
if (m_spellInfo->SpellFamilyFlags & 0x0001000900B80400LL)
m_canTrigger = true;
break;
default:
break;
}
}
@ -1204,7 +1212,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if (m_preCastSpell)
m_caster->CastSpell(unit, m_preCastSpell, true, m_CastItem);
for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber)
{
if (effectMask & (1 << effectNumber))
{
@ -1236,7 +1244,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target)
if(!go)
return;
for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber)
if (effectMask & (1 << effectNumber))
HandleEffects(NULL, NULL, go, effectNumber);
@ -1255,7 +1263,7 @@ void Spell::DoAllEffectOnTarget(ItemTargetInfo *target)
if(!target->item || !effectMask)
return;
for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber)
if (effectMask & (1 << effectNumber))
HandleEffects(NULL, target->item, NULL, effectNumber);
}
@ -2575,7 +2583,7 @@ void Spell::_handle_immediate_phase()
HandleThreatSpells(m_spellInfo->Id);
m_needSpellLog = IsNeedSendToClient();
for(uint32 j = 0;j<3;j++)
for(uint32 j = 0; j < 3; ++j)
{
if(m_spellInfo->Effect[j] == 0)
continue;
@ -2612,7 +2620,7 @@ void Spell::_handle_immediate_phase()
DoAllEffectOnTarget(&(*ihit));
// process ground
for(uint32 j = 0;j<3;j++)
for(uint32 j = 0; j < 3; ++j)
{
// persistent area auras target only the ground
if(m_spellInfo->Effect[j] == SPELL_EFFECT_PERSISTENT_AREA_AURA)
@ -3126,21 +3134,23 @@ void Spell::WriteSpellGoTargets( WorldPacket * data )
{
// possibly SPELL_MISS_IMMUNE2 for this??
ihit->missCondition = SPELL_MISS_IMMUNE2;
miss++;
++miss;
}
else if ((*ihit).missCondition == SPELL_MISS_NONE)
hit++;
++hit;
else
miss++;
++miss;
}
*data << (uint8)hit;
for(std::list<TargetInfo>::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
{
if ((*ihit).missCondition == SPELL_MISS_NONE) // Add only hits
{
*data << uint64(ihit->targetGUID);
m_needAliveTargetMask |=ihit->effectMask;
}
}
for(std::list<GOTargetInfo>::const_iterator ighit = m_UniqueGOTargetInfo.begin(); ighit != m_UniqueGOTargetInfo.end(); ++ighit)
*data << uint64(ighit->targetGUID); // Always hits
@ -3371,7 +3381,7 @@ void Spell::SendPlaySpellVisual(uint32 SpellID)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 12);
WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 8 + 4);
data << uint64(m_caster->GetGUID());
data << uint32(SpellID); // spell visual id?
((Player*)m_caster)->GetSession()->SendPacket(&data);
@ -3586,7 +3596,7 @@ void Spell::TakeReagents()
if (p_caster->CanNoReagentCast(m_spellInfo))
return;
for(uint32 x=0;x<8;x++)
for(uint32 x = 0; x < 8; ++x)
{
if(m_spellInfo->Reagent[x] <= 0)
continue;
@ -3795,7 +3805,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
// check pet presents
for(int j=0;j<3;j++)
for(int j = 0; j < 3; ++j)
{
if(m_spellInfo->EffectImplicitTargetA[j] == TARGET_PET)
{
@ -3915,7 +3925,7 @@ SpellCastResult Spell::CheckCast(bool strict)
//ImpliciteTargetA-B = 38, If fact there is 0 Spell with ImpliciteTargetB=38
if(m_UniqueTargetInfo.empty()) // skip second CheckCast apply (for delayed spells for example)
{
for(uint8 j = 0; j < 3; j++)
for(uint8 j = 0; j < 3; ++j)
{
if( m_spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT ||
m_spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT && m_spellInfo->EffectImplicitTargetA[j] != TARGET_SELF ||
@ -4558,7 +4568,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
else
{
bool duelvsplayertar = false;
for(int j=0;j<3;j++)
for(int j = 0; j < 3; ++j)
{
//TARGET_DUELVSPLAYER is positive AND negative
duelvsplayertar |= (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER);
@ -4593,7 +4603,7 @@ SpellCastResult Spell::CheckCasterAuras() const
// We use bitmasks so the loop is done only once and not on every aura check below.
if ( m_spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY )
{
for(int i = 0;i < 3; i ++)
for(int i = 0; i < 3; ++i)
{
if(m_spellInfo->EffectApplyAuraName[i] == SPELL_AURA_SCHOOL_IMMUNITY)
school_immune |= uint32(m_spellInfo->EffectMiscValue[i]);
@ -4603,7 +4613,7 @@ SpellCastResult Spell::CheckCasterAuras() const
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
}
// immune movement impairment and loss of control
if(m_spellInfo->Id==(uint32)42292)
if(m_spellInfo->Id == 42292)
mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
}
@ -4679,7 +4689,7 @@ bool Spell::CanAutoCast(Unit* target)
{
uint64 targetguid = target->GetGUID();
for(uint32 j = 0;j<3;j++)
for(uint32 j = 0; j < 3; ++j)
{
if(m_spellInfo->Effect[j] == SPELL_EFFECT_APPLY_AURA)
{
@ -5237,6 +5247,7 @@ SpellCastResult Spell::CheckItems()
return SPELL_FAILED_NO_AMMO;
}; break;
case ITEM_SUBCLASS_WEAPON_WAND:
break;
default:
break;
}
@ -5326,7 +5337,7 @@ void Spell::DelayedChannel()
Unit* unit = m_caster->GetGUID() == ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
if (unit)
{
for (int j=0;j<3;j++)
for (int j = 0; j < 3; ++j)
if( ihit->effectMask & (1 << j) )
unit->DelayAura(m_spellInfo->Id, j, delaytime);
}
@ -5334,7 +5345,7 @@ void Spell::DelayedChannel()
}
}
for(int j = 0; j < 3; j++)
for(int j = 0; j < 3; ++j)
{
// partially interrupt persistent area auras
DynamicObject* dynObj = m_caster->GetDynObject(m_spellInfo->Id, j);
@ -5546,8 +5557,7 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
if (m_Spell->IsDeletable())
{
// check, if we do have unfinished triggered spells
return(true); // spell is deletable, finish event
return true; // spell is deletable, finish event
}
// event will be re-added automatically at the end of routine)
} break;
@ -5590,7 +5600,7 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
{
// re-add us to the queue
m_Spell->GetCaster()->m_Events.AddEvent(this, m_Spell->GetDelayStart() + n_offset, false);
return(false); // event not complete
return false; // event not complete
}
// event complete
// finish update event will be re-added automatically at the end of routine)
@ -5602,7 +5612,7 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
m_Spell->SetDelayStart(e_time);
// re-plan the event for the delay moment
m_Spell->GetCaster()->m_Events.AddEvent(this, e_time + m_Spell->GetDelayMoment(), false);
return(false); // event not complete
return false; // event not complete
}
} break;
@ -5615,7 +5625,7 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
// spell processing not complete, plan event on the next update interval
m_Spell->GetCaster()->m_Events.AddEvent(this, e_time + 1, false);
return(false); // event not complete
return false; // event not complete
}
void SpellEvent::Abort(uint64 /*e_time*/)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7910"
#define REVISION_NR "7911"
#endif // __REVISION_NR_H__