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

View file

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