示例#1
0
void CompanionSummon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot)
{
	Summon::Load(proto, owner, position, spellid, summonslot);

	SetFaction(35);
	setLevel(1);
	m_aiInterface->Init(this, AITYPE_PET, MOVEMENTTYPE_NONE, owner);
	m_aiInterface->SetUnitToFollow(owner);
	m_aiInterface->SetUnitToFollowAngle(-M_PI_FLOAT / 2);
	m_aiInterface->SetFollowDistance(3.0f);
	m_aiInterface->disable_melee = true;
	bInvincible = true;

	RemovePvPFlag();
	RemoveFFAPvPFlag();
}
示例#2
0
void Summon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot)
{
    ARCEMU_ASSERT(owner != NULL);

    Creature::Load(proto, owner->GetMapMgr(), position.x, position.y, position.z, position.o);

    SetFaction(owner->GetFaction());
    Phase(PHASE_SET, owner->GetPhase());
    SetZoneId(owner->GetZoneId());
    SetCreatedBySpell(spellid);
    this->summonslot = summonslot;

    if (owner->IsPvPFlagged())
        SetPvPFlag();
    else
        RemovePvPFlag();

    if (owner->IsFFAPvPFlagged())
        SetFFAPvPFlag();
    else
        RemoveFFAPvPFlag();

    if (owner->IsSanctuaryFlagged())
        SetSanctuaryFlag();
    else
        RemoveSanctuaryFlag();

    SetCreatedByGUID(owner->GetGUID());

    if (owner->GetSummonedByGUID() == 0)
        SetSummonedByGUID(owner->GetGUID());
    else
        SetSummonedByGUID(owner->GetSummonedByGUID());

    this->owner = owner;

    if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
        SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
}