Jump to content

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


Recommended Posts

Posted
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...

Posted
Creatures also can summon own gameobjects (in different wild gameobjects that not have owner). Owner set faction gameobject /etc.

:)Thank you!

May I ask what SLOT1~SLOT4 for? the array has 4 length limit?Thanks!

Posted
:|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.

Posted
:|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?

×
×
  • 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