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


C++ CMobEntity::GetName方法代码示例

本文整理汇总了C++中CMobEntity::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CMobEntity::GetName方法的具体用法?C++ CMobEntity::GetName怎么用?C++ CMobEntity::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMobEntity的用法示例。


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

示例1: spawnSecondPartDynamis

	bool spawnSecondPartDynamis(CInstance* instance){
		DSP_DEBUG_BREAK_IF(instance==NULL);

		//get ids from DB
		const int8* fmtQuery = "SELECT monsterId \
								FROM bcnm_instance \
								WHERE bcnmId = %u AND instanceNumber = 2";

		int32 ret = Sql_Query(SqlHandle, fmtQuery, instance->getID());

		if (ret == SQL_ERROR ||
			Sql_NumRows(SqlHandle) == 0)
		{
			ShowError("spawnSecondPartDynamis : SQL error - Cannot find any monster IDs for Dynamis %i \n",
				instance->getID(), instance->getInstanceNumber());
		}
		else{
			while(Sql_NextRow(SqlHandle) == SQL_SUCCESS){
				uint32 mobid = Sql_GetUIntData(SqlHandle,0);
				CMobEntity* PMob = (CMobEntity*)zoneutils::GetEntity(mobid, TYPE_MOB);
				if (PMob != NULL)
				{
				    if (PMob->PBattleAI->GetCurrentAction() == ACTION_NONE ||
				        PMob->PBattleAI->GetCurrentAction() == ACTION_SPAWN)
				    {
				        PMob->PBattleAI->SetLastActionTime(0);
				        PMob->PBattleAI->SetCurrentAction(ACTION_SPAWN);

						PMob->m_instanceID = instance->getInstanceNumber();

						ShowDebug("Spawned %s (%u) id %i inst %i \n",PMob->GetName(),PMob->id,instance->getID(),instance->getInstanceNumber());
						instance->addEnemy(PMob, CONDITION_SPAWNED_AT_START & CONDITION_WIN_REQUIREMENT);
				    } else {
				        ShowDebug(CL_CYAN"spawnSecondPartDynamis: <%s> (%u) is alredy spawned\n" CL_RESET, PMob->GetName(), PMob->id);
				    }
				} else {
				    ShowDebug("spawnSecondPartDynamis: mob %u not found\n", mobid);
				}
			}
			return true;
		}
		return false;
	}
开发者ID:Euda,项目名称:darkstar,代码行数:43,代码来源:instanceutils.cpp

示例2: spawnSecondPartDynamis

    bool spawnSecondPartDynamis(CBattlefield* battlefield) {
        DSP_DEBUG_BREAK_IF(battlefield == nullptr);

        //get ids from DB
        const int8* fmtQuery = "SELECT monsterId \
								FROM bcnm_battlefield \
								WHERE bcnmId = %u AND battlefieldNumber = 2";

        int32 ret = Sql_Query(SqlHandle, fmtQuery, battlefield->getID());

        if (ret == SQL_ERROR ||
            Sql_NumRows(SqlHandle) == 0)
        {
            ShowError("spawnSecondPartDynamis : SQL error - Cannot find any monster IDs for Dynamis %i \n",
                battlefield->getID(), battlefield->getBattlefieldNumber());
        }
        else {
            while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) {
                uint32 mobid = Sql_GetUIntData(SqlHandle, 0);
                CMobEntity* PMob = (CMobEntity*)zoneutils::GetEntity(mobid, TYPE_MOB);
                if (PMob != nullptr)
                {
                    if (!PMob->PAI->IsSpawned())
                    {
                        PMob->Spawn();

                        PMob->m_battlefieldID = battlefield->getBattlefieldNumber();

                        ShowDebug("Spawned %s (%u) id %i inst %i \n", PMob->GetName(), PMob->id, battlefield->getID(), battlefield->getBattlefieldNumber());
                        battlefield->addEnemy(PMob, CONDITION_SPAWNED_AT_START & CONDITION_WIN_REQUIREMENT);
                    }
                    else {
                        ShowDebug(CL_CYAN"spawnSecondPartDynamis: <%s> (%u) is already spawned\n" CL_RESET, PMob->GetName(), PMob->id);
                    }
                }
                else {
                    ShowDebug("spawnSecondPartDynamis: mob %u not found\n", mobid);
                }
            }
            return true;
        }
        return false;
    }
开发者ID:Alice5150,项目名称:darkstar,代码行数:43,代码来源:battlefieldutils.cpp

示例3: spawnMonstersForBcnm

	/***************************************************************
		Spawns monsters for the given BCNMID/Instance number by
		looking at bcnm_instance table for mob ids then spawning
		them and adding them to the monster list for the given
		instance.
	****************************************************************/
	bool spawnMonstersForBcnm(CInstance* instance){
		DSP_DEBUG_BREAK_IF(instance==NULL);

		//get ids from DB
		const int8* fmtQuery = "SELECT monsterId, conditions \
						    FROM bcnm_instance \
							WHERE bcnmId = %u AND instanceNumber = %u";

		int32 ret = Sql_Query(SqlHandle, fmtQuery, instance->getID(), instance->getInstanceNumber());

		if (ret == SQL_ERROR ||
			Sql_NumRows(SqlHandle) == 0)
		{
			ShowError("spawnMonstersForBcnm : SQL error - Cannot find any monster IDs for BCNMID %i Instance %i \n",
				instance->getID(), instance->getInstanceNumber());
		}
		else{
			while(Sql_NextRow(SqlHandle) == SQL_SUCCESS){
				uint32 mobid = Sql_GetUIntData(SqlHandle,0);
				uint8 condition = Sql_GetUIntData(SqlHandle,1);
				CMobEntity* PMob = (CMobEntity*)zoneutils::GetEntity(mobid, TYPE_MOB);
				if (PMob != NULL)
				{

					PMob->m_instanceID = instance->getInstanceNumber();
					PMob->m_bcnmID = instance->getID();

					if (condition & CONDITION_SPAWNED_AT_START)
					{
						// This condition is needed for some mob at dynamis, else he don't pop
						if(PMob->PBattleAI->GetCurrentAction() == ACTION_FADE_OUT){
							PMob->PBattleAI->SetLastActionTime(0);
							PMob->PBattleAI->SetCurrentAction(ACTION_NONE);
						}
						if (PMob->PBattleAI->GetCurrentAction() == ACTION_NONE ||
							PMob->PBattleAI->GetCurrentAction() == ACTION_SPAWN)
						{
							PMob->PBattleAI->SetLastActionTime(0);
							PMob->PBattleAI->SetCurrentAction(ACTION_SPAWN);

							if(strcmp(PMob->GetName(),"Maat")==0){
								mobutils::SetupMaat(PMob, (JOBTYPE)instance->getPlayerMainJob());
								PMob->m_DropID = 4485; //Give Maat his stealable Warp Scroll 

								// disable players subjob
								instance->disableSubJob();

								// disallow subjob, this will enable for later
								instance->m_RuleMask &= ~(1 << RULES_ALLOW_SUBJOBS);

							}
							//ShowDebug("Spawned %s (%u) id %i inst %i \n",PMob->GetName(),PMob->id,instance->getID(),instance->getInstanceNumber());
							instance->addEnemy(PMob, condition);
						} else {
							ShowDebug(CL_CYAN"SpawnMobForBcnm: <%s> (%u) is alredy spawned\n" CL_RESET, PMob->GetName(), PMob->id);
						}
					} else {
						instance->addEnemy(PMob, condition);
					}
				} else {
				    ShowDebug("SpawnMobForBcnm: mob %u not found\n", mobid);
				}
			}
			return true;
		}
		return false;
	}
开发者ID:Euda,项目名称:darkstar,代码行数:73,代码来源:instanceutils.cpp

示例4: spawnMonstersForBcnm

    /***************************************************************
        Spawns monsters for the given BCNMID/Battlefield number by
        looking at bcnm_battlefield table for mob ids then spawning
        them and adding them to the monster list for the given
        battlefield.
    ****************************************************************/
    bool spawnMonstersForBcnm(CBattlefield* battlefield) {
        DSP_DEBUG_BREAK_IF(battlefield == nullptr);

        //get ids from DB
        const int8* fmtQuery = "SELECT monsterId, conditions \
						    FROM bcnm_battlefield \
							WHERE bcnmId = %u AND battlefieldNumber = %u";

        int32 ret = Sql_Query(SqlHandle, fmtQuery, battlefield->getID(), battlefield->getBattlefieldNumber());

        if (ret == SQL_ERROR ||
            Sql_NumRows(SqlHandle) == 0)
        {
            ShowError("spawnMonstersForBcnm : SQL error - Cannot find any monster IDs for BCNMID %i Battlefield %i \n",
                battlefield->getID(), battlefield->getBattlefieldNumber());
        }
        else {
            while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) {
                uint32 mobid = Sql_GetUIntData(SqlHandle, 0);
                uint8 condition = Sql_GetUIntData(SqlHandle, 1);
                CMobEntity* PMob = (CMobEntity*)zoneutils::GetEntity(mobid, TYPE_MOB);
                if (PMob != nullptr)
                {

                    PMob->m_battlefieldID = battlefield->getBattlefieldNumber();
                    PMob->m_bcnmID = battlefield->getID();

                    if (condition & CONDITION_SPAWNED_AT_START)
                    {
                        if (!PMob->PAI->IsSpawned())
                        {
                            PMob->Spawn();

                            if (strcmp(PMob->GetName(), "Maat") == 0) {
                                mobutils::InitializeMaat(PMob, (JOBTYPE)battlefield->getPlayerMainJob());

                                // disable players subjob
                                battlefield->disableSubJob();

                                // disallow subjob, this will enable for later
                                battlefield->m_RuleMask &= ~(1 << RULES_ALLOW_SUBJOBS);

                            }
                            //ShowDebug("Spawned %s (%u) id %i inst %i \n",PMob->GetName(),PMob->id,battlefield->getID(),battlefield->getBattlefieldNumber());
                            battlefield->addEnemy(PMob, condition);
                        }
                        else {
                            ShowDebug(CL_CYAN"SpawnMobForBcnm: <%s> (%u) is already spawned\n" CL_RESET, PMob->GetName(), PMob->id);
                        }
                    }
                    else {
                        battlefield->addEnemy(PMob, condition);
                    }
                }
                else {
                    ShowDebug("SpawnMobForBcnm: mob %u not found\n", mobid);
                }
            }
            return true;
        }
        return false;
    }
开发者ID:Alice5150,项目名称:darkstar,代码行数:68,代码来源:battlefieldutils.cpp


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