• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AIM_Initialize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: data

void Totem::Summon()
{
    sLog.outDebug("AddObject at Totem.cpp line 49");
    MapManager::Instance().GetMap(GetMapId())->Add((Creature*)this);

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

    AIM_Initialize();

    if (m_type == TOTEM_PASSIVE)
        this->CastSpell(this, m_spell, true);
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:14,代码来源:Totem.cpp


示例17: GetCreatureInfo

void Totem::Summon(Unit* owner)
{
    CreatureInfo const *cinfo = GetCreatureInfo();
    if (owner->GetTypeId()==TYPEID_PLAYER && cinfo)
    {
        uint32 modelid = 0;
        if(((Player*)owner)->GetTeam() == HORDE)
        {
            if(cinfo->Modelid_H1)
                modelid = cinfo->Modelid_H1;
            else if(cinfo->Modelid_H2)
                modelid = cinfo->Modelid_H2;
        }
        else
        {
            if(cinfo->Modelid_A1)
                modelid = cinfo->Modelid_A1;
            else if(cinfo->Modelid_A2)
                modelid = cinfo->Modelid_A2;
        }
        if (modelid)
            SetDisplayId(modelid);
        else
            sLog.outErrorDb("Totem::Summon: Missing modelid information for entry %u, team %u, totem will use default values.",GetEntry(),((Player*)owner)->GetTeam());
    }

    // Only add if a display exists.
    sLog.outDebug("AddObject at Totem.cpp line 49");
    SetInstanceId(owner->GetInstanceId());
    owner->GetMap()->Add((Creature*)this);

    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;
    }

    if(GetEntry() == SENTRY_TOTEM_ENTRY)
        SetReactState(REACT_AGGRESSIVE);
}
开发者ID:Bootz,项目名称:TC-One,代码行数:47,代码来源:Totem.cpp


示例18: 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 [-ZERO] not implemented/useful
    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);
    }

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

    AIM_Initialize();

    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:dythzer,项目名称:mangoszero,代码行数:42,代码来源:Totem.cpp


示例19: ASSERT

void Creature::LoadFromDB(uint32 guid)
{

    std::stringstream ss;
    ss << "SELECT * FROM creatures WHERE id=" << guid;

    QueryResult *result = sDatabase.Query( ss.str().c_str() );
    ASSERT(result);

    Field *fields = result->Fetch();

    

    Create(fields[8].GetUInt32(), objmgr.GetCreatureName(fields[8].GetUInt32())->Name.c_str(), fields[6].GetUInt32(),
        fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetFloat(), fields[8].GetUInt32());

    m_zoneId = fields[5].GetUInt32();

    m_moveRandom = fields[9].GetBool();
    m_moveRun = fields[10].GetBool();

    LoadValues(fields[7].GetString());
    
    
    SetNameId(fields[8].GetUInt32());
    _RealtimeSetCreatureInfo();

    delete result;

    if ( HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR ) )
        _LoadGoods();

    if ( HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER ) )
        _LoadQuests();

    
    SetUInt32Value( OBJECT_FIELD_GUID+1, HIGHGUID_UNIT );
    AIM_Initialize();

}
开发者ID:Artea,项目名称:mangos-svn,代码行数:40,代码来源:Creature.cpp


示例20: AIM_Initialize

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

    if (owner->AI())
        owner->AI()->JustSummoned((Creature*)this);
    sEluna->OnSummoned(this, owner);

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

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AIR_AFFINE函数代码示例发布时间:2022-05-30
下一篇:
C++ AH_PRIVATE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap