daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, AuraEffect const * triggeredByAura, uint64 originalCaster)
  2. {
  3.     if (!spellInfo)
  4.     {
  5.         sLog.outError("CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
  6.         return;
  7.     }
  8.  
  9.     if (!originalCaster && GetTypeId() == TYPEID_UNIT && this->ToCreature()->isTotem() && IsControlledByPlayer())
  10.         if (Unit * owner = GetOwner())
  11.             originalCaster=owner->GetGUID();
  12.  
  13.     SpellCastTargets targets;
  14.     targets.setUnitTarget(Victim);
  15.  
  16.     if (castItem)
  17.         sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
  18.  
  19.     if (!originalCaster && triggeredByAura)
  20.         originalCaster = triggeredByAura->GetCasterGUID();
  21.  
  22.     Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
  23.  
  24.     spell->m_CastItem = castItem;
  25.     spell->prepare(&targets, triggeredByAura);
  26. }
RAW Paste Data
Top