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


C++ MoonScriptCreatureAI::SetCanMove方法代码示例

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


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

示例1: ForceofNeltharakuSpell

bool ForceofNeltharakuSpell(uint32 i, SpellPointer pSpell) // Becoming a Shadoweave Tailor
{
	if(pSpell->u_caster->IsPlayer() == false)
		return true;

	PlayerPointer	pPlayer= TO_PLAYER(pSpell->u_caster);
	UnitPointer		pUnit	= TO_UNIT(pPlayer->GetMapMgr()->GetCreature(GET_LOWGUID_PART(pPlayer->GetSelection())));

	if(pUnit == NULLUNIT)
		return true;

	if(!pUnit->IsCreature())
		return true;

	CreaturePointer		 pTarget	= TO_CREATURE(pUnit);
	QuestLogEntry	 *pQuest	= pPlayer->GetQuestLogForEntry(10854);
	if(pQuest == NULL)
		return true;

	if(pTarget->GetEntry() == 21722 && pPlayer->CalcDistance(pUnit)<30)
	{
		if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
		{
			pTarget->CastSpell(pPlayer, dbcSpell.LookupEntry(38775), true);
			pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1);
			pQuest->SendUpdateAddKill(0);
			pQuest->UpdatePlayerFields();
			if ( pTarget->GetScript() != NULL )
			{
				MoonScriptCreatureAI *pDrakeAI = static_cast<MoonScriptCreatureAI*>(pTarget->GetScript());
				pDrakeAI->SetCanMove(true);
				pDrakeAI->SetWaypointToMove(0);
			}
		}
	}
	return true;
}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:37,代码来源:Shadowmoon.cpp

示例2: AIUpdate

 void AIUpdate()
 {
     if(IsTimerFinished(mJovaanTimer))
     {
         switch(mJovaanPhase)
         {
             case 0:
                 {
                     MoonScriptCreatureAI* pRazuunAI = SpawnCreature(21502, -3300.47f, 2927.22f, 173.870f, 2.42924f, false);    // Spawn Razuun
                     if(pRazuunAI != NULL)
                     {
                         pRazuunAI->GetUnit()->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
                         pRazuunAI->SetCanEnterCombat(false);
                         pRazuunAI->SetMoveType(Move_DontMoveWP);
                         pRazuunAI->SetCanMove(false);
                     }
                     _unit->SetStandState(STANDSTATE_KNEEL);
                     _unit->Emote(EMOTE_ONESHOT_TALK);
                     _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Everything is in readiness, warbringer.");
                     mJovaanPhase = 1;
                     ResetTimer(mJovaanTimer, 6000);
                 }
                 break;
             case 1:
                 {
                     _unit->Emote(EMOTE_ONESHOT_TALK);
                     _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Warbringer, that will require the use of all the hold's infernals. It may leave us vulnerable to a counterattack.");
                     mJovaanPhase = 2;
                     ResetTimer(mJovaanTimer, 11000);
                 }
                 break;
             case 2:
                 {
                     _unit->SetStandState(STANDSTATE_STAND);
                     mJovaanPhase = 3;
                     ResetTimer(mJovaanTimer, 1000);
                 }
                 break;
             case 3:
                 {
                     _unit->Emote(EMOTE_ONESHOT_SALUTE);
                     _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "It shall be as you say, warbringer. One last question, if I may...");
                     mJovaanPhase = 4;
                     ResetTimer(mJovaanTimer, 10000);
                 }
                 break;
             case 4:
                 {
                     _unit->Emote(EMOTE_ONESHOT_QUESTION);
                     _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "What's in the crate?");
                     mJovaanPhase = 5;
                     ResetTimer(mJovaanTimer, 10000);
                 }
                 break;
             case 5:
                 {
                     _unit->Emote(EMOTE_ONESHOT_SALUTE);
                     mJovaanPhase = -1;
                     RemoveTimer(mJovaanTimer);
                 }
                 break;
         }
     }
     ParentClass::AIUpdate();
 }
开发者ID:lev1976g,项目名称:easywow,代码行数:65,代码来源:Quest_ShadowMoon.cpp


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