Jump to content

[Code]what's the meaning of member m_ObjectSlot of class Unit?


kimxee

Recommended Posts

It's used for void Spell::EffectSummonObject(SpellEffectIndex eff_idx) for storing the GUIDs of objects summoned by spells.

;)Thanks!

I'd read the function void Spell::EffectSummonObject(SpellEffectIndex eff_idx) ,and it has the following code:

switch(m_spellInfo->Effect[eff_idx])
   {
       case SPELL_EFFECT_SUMMON_OBJECT_SLOT1: slot = 0; break;
       case SPELL_EFFECT_SUMMON_OBJECT_SLOT2: slot = 1; break;
       case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: slot = 2; break;
       case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: slot = 3; break;
       default: return;
   }

So I traced these definetion,found :

in file Spell.cpp, line 3480 in function void Spell::SendLogExecute() callby void Spell::_handle_finish_phase()

case SPELL_EFFECT_SUMMON_OBJECT_SLOT1:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT2:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT3:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT4:
   if(Unit *unit = m_targets.getUnitTarget())
       data << unit->GetPackGUID();
   else if(m_targets.getItemTargetGUID())
       data.appendPackGUID(m_targets.getItemTargetGUID());
   else if(GameObject *go = m_targets.getGOTarget())
       data << go->GetPackGUID();
   else
       data << uint8(0);                   // guid
   break;

:|Does it mean Only when SLOT4 reached can I get the GameobjectTarget's Guid? As I haven't been playing wow for a year, I can't remember which spell / mob or other stuff fits this situation...

Link to comment
Share on other sites

:|Does it mean Only when SLOT4 reached can I get the GameobjectTarget's Guid? As I haven't been playing wow for a year, I can't remember which spell / mob or other stuff fits this situation...

In fact not many for creatures case. This is creature versions hunter traps + 2 less clear cases.

hmmmm...Spell effect like hunter's trap? Engineering Robot?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use