当前位置: 首页>>代码示例>>C++>>正文


C++ AIM_Initialize函数代码示例

本文整理汇总了C++中AIM_Initialize函数的典型用法代码示例。如果您正苦于以下问题:C++ AIM_Initialize函数的具体用法?C++ AIM_Initialize怎么用?C++ AIM_Initialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AIM_Initialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetInstanceId

void Totem::Summon(Unit* owner)
{
    sLog.outDebug("AddObject at Totem.cpp line 49");

    SetInstanceId(owner->GetInstanceId());
    owner->GetMap()->Add((Creature*)this);

    // select totem model in dependent from owner team
    CreatureInfo const *cinfo = GetCreatureInfo();
    if(owner->GetTypeId()==TYPEID_PLAYER && cinfo)
    {
        uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(),cinfo);
        CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
        if (minfo)
            display_id = minfo->modelid;
        SetDisplayId(display_id);
    }

    WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
    data << GetGUID();
    SendMessageToSet(&data,true);

    AIM_Initialize();

    switch(m_type)
    {
        case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break;
        case TOTEM_STATUE:  CastSpell(GetOwner(), GetSpell(), true); break;
        default: break;
    }
}
开发者ID:Aemu,项目名称:mangos,代码行数:31,代码来源:Totem.cpp

示例2: setPowerType

void Vehicle::AddToWorld()
{
    if(!IsInWorld())
    {
        if(m_zoneScript)
            m_zoneScript->OnCreatureCreate(this, true);
        ObjectAccessor::Instance().AddObject(this);

        for(uint32 i = 0; i < MAX_SPELL_VEHICLE; ++i)
        {
            if(!m_spells[i])
                continue;

            SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]);
            if(!spellInfo)
                continue;

            if(spellInfo->powerType == POWER_MANA)
                break;

            if(spellInfo->powerType == POWER_ENERGY)
            {
                setPowerType(POWER_ENERGY);
                SetMaxPower(POWER_ENERGY, 100);
                break;
            }
        }

        Unit::AddToWorld();
        InstallAllAccessories();

        AIM_Initialize();
    }
}
开发者ID:MilchBuby,项目名称:riboncore,代码行数:34,代码来源:Vehicle.cpp

示例3: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
    case TOTEM_PASSIVE:
        for (int i=0; i<MAX_CREATURE_SPELL_DATA_SLOT; ++i)
            if (m_spells[i])
                CastSpell(this, m_spells[i], true);
        break;
    case TOTEM_STATUE:
        CastSpell(GetOwner(), GetSpell(), true);
        break;
    default:
        break;
    }
}
开发者ID:koksneo,项目名称:MangosBack,代码行数:26,代码来源:Totem.cpp

示例4: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);
#ifdef ENABLE_ELUNA
    sEluna->OnSummoned(this, owner);
#endif /* ENABLE_ELUNA */

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch (m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:mangosthree,项目名称:server,代码行数:26,代码来源:Totem.cpp

示例5: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            // Totem of Wrath, Area Aura Enemies: Mod Crit % Taken
            if (m_spells[1] == 30708)
                CastSpell(this, m_spells[1], true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:SPIRITnsk,项目名称:mangos,代码行数:26,代码来源:Totem.cpp

示例6: SetMaxHealth

void Totem::Summon(Unit* owner)
{
	if(!owner)
		return;

	// Mana Tide Totem should have 10% of caster's health
	if(GetSpell() == 16191)
	{
		SetMaxHealth(owner->GetMaxHealth()*10/100);
		SetHealth(GetMaxHealth());
	}

    owner->GetMap()->Add((Creature*)this);

    AIM_Initialize();

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:AwkwardDev,项目名称:MangosFX,代码行数:31,代码来源:Totem.cpp

示例7: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
    data << GetObjectGuid();
    SendMessageToSet(&data,true);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:Deffender,项目名称:mangos1,代码行数:27,代码来源:Totem.cpp

示例8: GetCreatureInfo

void Totem::Summon(Unit* owner)
{
    owner->GetMap()->Add((Creature*)this);

    // select totem model in dependent from owner team
    CreatureInfo const *cinfo = GetCreatureInfo();
    if(owner->GetTypeId() == TYPEID_PLAYER && cinfo)
    {
        uint32 display_id = sObjectMgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
        CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
        if (minfo)
            display_id = minfo->modelid;
        SetDisplayId(display_id);
    }

    AIM_Initialize();

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
开发者ID:AdharRuafo,项目名称:mangos,代码行数:32,代码来源:Totem.cpp

示例9: AIM_Initialize

void Totem::Summon(Unit* owner)
{
    AIM_Initialize();
    owner->GetMap()->Add((Creature*)this);

    if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
        ((Creature*)owner)->AI()->JustSummoned((Creature*)this);

    switch(m_type)
    {
        case TOTEM_PASSIVE:
        {
            for (uint32 i = 0; i <= GetSpellMaxIndex(); ++i)
            {
                if (uint32 spellId = GetSpell(i))
                    CastSpell(this, spellId, true);
            }
            break;
        }
        case TOTEM_STATUE:
        {
            if (GetSpell(0))
                CastSpell(GetOwner(), GetSpell(0), true);
            break;
        }
        default:
            break;
    }
}
开发者ID:beyourself,项目名称:RustEmu-Core,代码行数:29,代码来源:Totem.cpp

示例10: SetMapId

bool Vehicle::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehicleId, uint32 team)
{
    SetMapId(map->GetId());
    SetInstanceId(map->GetInstanceId());

    Object::_Create(guidlow, Entry, HIGHGUID_VEHICLE);

    if(!InitEntry(Entry, team))
        return false;

    m_defaultMovementType = IDLE_MOTION_TYPE;

    AIM_Initialize();

    SetVehicleId(vehicleId);

    SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
    SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);

    CreatureInfo const *ci = GetCreatureInfo();
    setFaction(team == ALLIANCE ? ci->faction_A : ci->faction_H);
    SetMaxHealth(ci->maxhealth);
    SelectLevel(ci);
    SetHealth(GetMaxHealth());

    return true;
}
开发者ID:Aemu,项目名称:mangos,代码行数:27,代码来源:Vehicle.cpp

示例11: SetSummonProperties

void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
{
    SetSummonProperties(type, lifetime);

    GetMap()->Add((Creature*)this);

    AIM_Initialize();
}
开发者ID:Chuck5ta,项目名称:server-3,代码行数:8,代码来源:TemporarySummon.cpp

示例12: AIM_Initialize

void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
{
    m_type = type;
    m_timer = lifetime;
    m_lifetime = lifetime;

    AIM_Initialize();
    GetMap()->Add((Creature*)this);
}
开发者ID:SeTM,项目名称:mangos,代码行数:9,代码来源:TemporarySummon.cpp

示例13: AIM_Initialize

void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
{
    m_type = type;
    m_timer = lifetime;
    m_lifetime = lifetime;

    MapManager::Instance().GetMap(GetMapId(), this)->Add((Creature*)this);

    AIM_Initialize();
}
开发者ID:yunishaa,项目名称:mangos-112,代码行数:10,代码来源:TemporarySummon.cpp

示例14: UpdateNPCPositions

void Transport::Update(uint32 p_diff)
{
    UpdateNPCPositions();

	if (!AI())
    {
		if (!AIM_Initialize())
			sLog->outError("Could not initialize GameObjectAI for Transport");
	}
    else
		AI()->UpdateAI(p_diff);

	if (m_WayPoints.size() <= 1)
		return;

	m_timer = getMSTime() % m_period;
	while (((m_timer - m_curr->first) % m_pathTime)
	> ((m_next->first - m_curr->first) % m_pathTime))
    {
		DoEventIfAny(*m_curr, true);

		m_curr = GetNextWayPoint();
		m_next = GetNextWayPoint();

		DoEventIfAny(*m_curr, false);

		// first check help in case client-server transport coordinates de-synchronization
		if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport) 
        {
			TeleportTransport(m_curr->second.mapid, m_curr->second.x,
			m_curr->second.y, m_curr->second.z);
		} 
        else 
        {
			Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI));
		}

		sScriptMgr->OnRelocate(this, m_curr->first, m_curr->second.mapid,
		m_curr->second.x, m_curr->second.y, m_curr->second.z);

		m_nextNodeTime = m_curr->first;

		if (m_curr == m_WayPoints.begin())
			sLog->outDebug(LOG_FILTER_TRANSPORTS,
					" ************ BEGIN ************** %s", m_name.c_str());

		sLog->outDebug(LOG_FILTER_TRANSPORTS, "%s moved to %d %f %f %f %d",
		m_name.c_str(), m_curr->second.id, m_curr->second.x,
		m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
	}
	sScriptMgr->OnTransportUpdate(this, p_diff);
}
开发者ID:FrenchCORE,项目名称:Server,代码行数:52,代码来源:Transport.cpp

示例15: Update

void Transport::Update(uint32 p_diff)
{
    if (!AI())
    {
        if (!AIM_Initialize())
            TC_LOG_ERROR("entities.transport", "Could not initialize GameObjectAI for Transport");
    }
    else
        AI()->UpdateAI(p_diff);

    if (m_WayPoints.size() <= 1)
        return;

    if (!m_period)
        return;

    m_timer = getMSTime() % m_period;
    while (((m_timer - m_curr->first) % m_pathTime) > ((m_next->first - m_curr->first) % m_pathTime))
    {
        DoEventIfAny(*m_curr, true);

        m_curr = GetNextWayPoint();
        m_next = GetNextWayPoint();

        DoEventIfAny(*m_curr, false);

        // first check help in case client-server transport coordinates de-synchronization
        if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport)
        {
            TeleportTransport(m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z);
        }
        else
        {
            Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI));
            UpdateNPCPositions(); // COME BACK MARKER
            // This forces the server to update positions in transportation for players -- gunship
            UpdatePlayerPositions();
        }

        sScriptMgr->OnRelocate(this, m_curr->first, m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z);

        m_nextNodeTime = m_curr->first;

        if (m_curr == m_WayPoints.begin())
            TC_LOG_DEBUG("entities.transport", " ************ BEGIN ************** %s", m_name.c_str());

        TC_LOG_DEBUG("entities.transport", "%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
    }

    sScriptMgr->OnTransportUpdate(this, p_diff);
}
开发者ID:Exodius,项目名称:chuspi,代码行数:51,代码来源:Transport.cpp


注:本文中的AIM_Initialize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。