All pastes #935451 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-09 17:42 UTC
rendered paste body
bool ProtectingOurOwn(uint32 i, Spell* pSpell) // Protecting Our Own
{
  if(!pSpell->u_caster->IsPlayer() && pSpell->GetUnitTarget()->GetTypeId() != TYPEID_UNIT)
    return true;

  Player *plr = (Player*)pSpell->u_caster;
  QuestLogEntry *qle = plr->GetQuestLogForEntry(10488);
  
  if(qle == NULL)
  return true;

  Creature *target = static_cast<Creature*>(pSpell->GetUnitTarget());
  if(target->GetEntry() != 20748) // Thunderlord Dire Wolf
    return true;

			if(en->GetMobCount(0) < en->GetQuest()->required_mobcount[0])
			{
				target->GetAIInterface()->SetNextTarget(pSpell->p_caster);
				target->GetAIInterface()->AttackReaction(pSpll->p_caster, 1);
				uint32 newcount = en->GetMobCount(0) + 1;
				en->SetMobCount(0, newcount);
				en->SendUpdateAddKill(0);
				en->UpdatePlayerFields();
				return;
				
			}

  return true;
}