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


C++ PlayerPointer::CastSpell方法代码示例

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


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

示例1: AIUpdate

	void AIUpdate()
	{
		PlayerPointer CurrentPlayer = objmgr.GetPlayer( mPlayerGuid );
		if ( CurrentPlayer == NULLPLR )
		{
			RemoveAIUpdateEvent();
			mPlayerGuid = 0;
			return;
		};

		if ( CurrentPlayer->GetMapId() == 530 ) 		// Shattrath
		{
			CurrentPlayer->SafeTeleport( 530, 0, -1742.640869f, 5454.712402f, -7.928009f, 4.606363f );
		}
		else if ( CurrentPlayer->GetMapId() == 0 ) 		// Elwynn Forest
		{
			CurrentPlayer->SafeTeleport( 0, 0, -9569.150391f, -14.753426f, 68.051422f, 4.874008f );
		}
		else if ( CurrentPlayer->GetMapId() == 1 ) 		// Mulgore
		{
			CurrentPlayer->SafeTeleport( 1, 0, -1326.711914f, 86.301125f, 133.093918f, 3.510725f );
		};

		CurrentPlayer->SetMovement( MOVE_UNROOT, 1 );
		CurrentPlayer->CastSpell( CurrentPlayer, 42867, true ); // 24742
		_gameobject->SetUInt32Value(GAMEOBJECT_FLAGS,0);
		mPlayerGuid = 0;
		RemoveAIUpdateEvent();
	};
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:29,代码来源:DarkmoonFaireObjects.cpp

示例2: OnQuestStart

  void OnQuestStart(PlayerPointer mTarget, QuestLogEntry * qLogEntry)
  {
    if(!mTarget)
		return;
    if(!mTarget->HasSpell(30829))
      mTarget->CastSpell(mTarget, 30829, true);
  }
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:7,代码来源:BloodmystIsle.cpp

示例3: OnActivate

		void OnActivate(PlayerPointer  pPlayer)
		{
			if(pPlayer && !pPlayer->HasAura(SILITHYST_SPELL))
				pPlayer->CastSpell(pPlayer, SILITHYST_SPELL, true);

			if(_gameobject)
				_gameobject->Despawn(0);
		}
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:8,代码来源:ZoneSilithus.cpp

示例4: OnActivate

	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;
		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10111);
		if(qle == NULL)
			return;

		if(!pPlayer->HasAura(33382))
			pPlayer->CastSpell(pPlayer, 33382, true);
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:11,代码来源:GameObjects.cpp

示例5: OnActivate

 void OnActivate(PlayerPointer pPlayer)
 {
     if(pPlayer->getLevel() >= 70)
     {
         //pPlayer->SafeTeleport(530, 4080, 12803.374023f, -6907.089844f, 41.114765f, 2.251736f);
         pPlayer->CastSpell(pPlayer, dbcSpell.LookupEntry(44870), true);
     }
     else if(pPlayer->getLevel() <= 69)
     {
         pPlayer->BroadcastMessage("You must be level 70 to use this!");
     }
 }
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:12,代码来源:QuelDanasPortal.cpp

示例6: ZoneHook

void ZoneHook(PlayerPointer plr, uint32 Zone, uint32 OldZone)
{
    static uint32 spellids[2] = { HELLFIRE_SUPERORITY_ALLIANCE, HELLFIRE_SUPERORITY_HORDE };
    if(Zone == ZONE_HELLFIRE_PENINSULA)
    {
        if(g_superiorTeam == plr->GetTeam())
            plr->CastSpell(plr, dbcSpell.LookupEntry(spellids[plr->GetTeam()]), true);
    }
    else if(OldZone == ZONE_HELLFIRE_PENINSULA)
    {
        if(g_superiorTeam == plr->GetTeam())
            plr->RemovePositiveAura(spellids[plr->GetTeam()]);
    }
}
开发者ID:AriDEV,项目名称:AscEmu,代码行数:14,代码来源:ZoneHellfirePeninsula.cpp

示例7: OnActivate

	void OnActivate( PlayerPointer pPlayer )
	{
		if ( pPlayer == NULLPLR || mPlayerGuid != 0 )
			return;

		// Do you think we should look for ai owner ?
		/*GameObjectPointer BlastCannon = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 180515 );
		if ( BlastCannon != NULLGOB )
			BlastCannon->SetUInt32Value( GAMEOBJECT_FLAGS, 33 );*/

		pPlayer->CastSpell( pPlayer, 24832, true );
		pPlayer->SetMovement( MOVE_ROOT, 1 );
		_gameobject->PlaySoundToSet( 8476 );
		mPlayerGuid = pPlayer->GetGUID();
		RegisterAIUpdateEvent( 2200 );
	};
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:16,代码来源:DarkmoonFaireObjects.cpp

示例8: SilithusZoneHook

void SilithusZoneHook(PlayerPointer plr, uint32 Zone, uint32 OldZone)
{
	if(!plr)
		return;

	if(Zone == ZONE_SILITHUS)
	{
		if(winners == plr->GetTeam())
			plr->CastSpell(plr, dbcSpell.LookupEntry(CENARION_FAVOR), true);
	}
	else if(OldZone == ZONE_SILITHUS)
	{
		if(winners == plr->GetTeam())
			plr->RemovePositiveAura(CENARION_FAVOR);
	}
}
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:16,代码来源:ZoneSilithus.cpp

示例9: TFZoneHook

void TFZoneHook(PlayerPointer plr, uint32 Zone, uint32 OldZone)
{
    if(!plr)
        return;

    if(Zone == ZONE_TEROKKAR_FOREST)
    {
        if(TFg_superiorTeam == plr->GetTeam())
            plr->CastSpell(plr, dbcSpell.LookupEntry(BLESSING_OF_AUCHINDOUND), true);
    }
    else if(OldZone == ZONE_TEROKKAR_FOREST)
    {
        if(TFg_superiorTeam == plr->GetTeam())
            plr->RemovePositiveAura(BLESSING_OF_AUCHINDOUND);
    }
}
开发者ID:AscEmu,项目名称:AscEmu,代码行数:16,代码来源:ZoneTerokkarForest.cpp

示例10: OnAddPlayer

void Arena::OnAddPlayer(PlayerPointer plr)
{
	plr->m_deathVision = true;

	if( plr->m_isGmInvisible )
		return;

	// remove all buffs (exclude talents, include flasks)
	for(uint32 x=0;x<MAX_AURAS;x++)
	{
		if(plr->m_auras[x])
		{
			if(plr->m_auras[x] && !plr->m_auras[x]->GetSpellProto()->DurationIndex && plr->m_auras[x]->GetSpellProto()->Flags4 & CAN_PERSIST_AND_CASTED_WHILE_DEAD)
				continue;
			else
			{
				plr->m_auras[x]->Remove();
			}
		}
	}
	plr->GetItemInterface()->RemoveAllConjured();
	plr->ResetAllCooldowns();

	if( !m_started )
		plr->CastSpell(plr, ARENA_PREPARATION, true);

	m_playersCount[plr->GetTeam()]++;
	UpdatePlayerCounts();

	/* Add the green/gold team flag */
	AuraPointer aura(new Aura(dbcSpell.LookupEntry(32724+plr->m_bgTeam), -1, plr, plr));
	plr->AddAura(aura);
	
	/* Set FFA PvP Flag */
	plr->SetFFAPvPFlag();

	hashmap_put(m_playersAlive, plr->GetLowGUID(), (any_t)1);
	if(Rated())
	{
		// Store the players who join so that we can change their rating even if they leave before arena finishes
		hashmap_put(m_players2[plr->GetTeam()], plr->GetLowGUID(), (any_t)1);
		if(m_teams[plr->GetTeam()] == -1 && plr->m_playerInfo && plr->m_playerInfo->arenaTeam[m_arenateamtype] != NULL)
		{
			m_teams[plr->GetTeam()] = plr->m_playerInfo->arenaTeam[m_arenateamtype]->m_id;
		}
	}
}
开发者ID:CadeLaRen,项目名称:Xeon-MMORPG-Emulator,代码行数:47,代码来源:Arenas.cpp

示例11: GossipHello

	void GossipHello( ObjectPointer pObject, PlayerPointer pPlayer, bool AutoSend )
	{
		if ( pObject == NULL || pObject->GetTypeId() != TYPEID_ITEM || pPlayer == NULL )
			return;

		QuestLogEntry* QuestEntry = pPlayer->GetQuestLogForEntry( 9452 );
		if ( QuestEntry == NULL )
			return;

#ifndef BLIZZLIKE
		//if ( QuestEntry->GetMobCount( 0 ) >= QuestEntry->GetQuest()->required_mobcount[ 0 ] )
		//	return;
#endif
		if ( pPlayer->GetMapMgr() == NULLMAPMGR )
			return;

		// Meh, double object looking - we should find a way to remove this
		GameObjectPointer School = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 181616 );
		if ( School == NULLGOB || pPlayer->CalcDistance( School ) > 5.0f )
			return;

#ifdef BLIZZLIKE
		sEventMgr.AddEvent( School, &GameObject::Despawn, static_cast< uint32 >( 20000 ), EVENT_GAMEOBJECT_ITEM_SPAWN, 1000, 1, 0 );
#else
		School->Despawn( 20000 );
#endif
		pPlayer->CastSpell( pPlayer, dbcSpell.LookupEntry( TO_ITEM( pObject )->GetProto()->Spells[ 0 ].Id ), false );
		uint32 Chance = RandomUInt( 10 );
		if ( Chance <= 3 )
		{
			CreaturePointer NewCreature = sEAS.SpawnCreature( pPlayer, 17102, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 180000 );
			if ( NewCreature != NULLCREATURE )
			{
				NewCreature->GetAIInterface()->StopMovement( 500 );
				NewCreature->setAttackTimer( 1000, false );
				NewCreature->m_noRespawn = true;
			};

			return;
		};

		sEAS.AddItem( 23614, pPlayer );
		QuestEntry->SendUpdateAddKill( 1 );
		QuestEntry->UpdatePlayerFields();
		pPlayer->Gossip_Complete();
	};
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:46,代码来源:Azuremyst_Isle.cpp

示例12: HookOnAreaTrigger

void Arena::HookOnAreaTrigger(PlayerPointer plr, uint32 id)
{
	if(!m_started)
		return;

	int32 buffslot = -1;

	ASSERT(plr != NULL);

	switch (id) 
	{
		case 4536:
		case 4538:
		case 4696:
			buffslot = 0;
			break;
		case 4537:
		case 4539:
		case 4697:
			buffslot = 1;
			break;
		default:
			{
				Log.Error("Arena", "Encountered unhandled areatrigger id %u", id);
				return;
			}break;
	}

	if(!m_shadowsightspawned)
		return;

	if(buffslot >= 0)
	{
		if(m_buffs[buffslot] != NULL && m_buffs[buffslot]->IsInWorld())
		{
			/* apply the buff */
			plr->CastSpell(plr, m_buffs[buffslot]->GetInfo()->sound3, true);

			/* despawn the gameobject (not delete!) */
			m_buffs[buffslot]->Despawn(BUFF_RESPAWN_TIME);
		}
	}
}
开发者ID:CadeLaRen,项目名称:Xeon-MMORPG-Emulator,代码行数:43,代码来源:Arenas.cpp

示例13: GossipSelectOption

	void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
	{
		CreaturePointer  pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE;
		if(pObject==NULL)
			return;

		switch(IntId)
		{
		case 0: // Return to start
			GossipHello(pCreature, plr, true);
			break;
		case 1: // Give Item
			{
				plr->CastSpell(plr, dbcSpell.LookupEntry(23122),true);
				plr->Gossip_Complete();
				break;
			}
			break;
		}
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:20,代码来源:QuestGossip.cpp

示例14: AreatriggerHook

void AreatriggerHook(PlayerPointer pPlayer, uint32 triggerID)
{
	if(!pPlayer)
		return;

	if(triggerID == ALLIANCE_RETURN ||
	        triggerID == HORDE_RETURN)
	{
		if(pPlayer->HasAura(SILITHYST_SPELL))     // if we doesn't have it, do nothing
		{
			pPlayer->RemoveAura(SILITHYST_SPELL);

			/* Rewards */
			pPlayer->CastSpell(pPlayer, TRACES_OF_SILITHYST, true);
			pPlayer->m_honorPoints += REWARD_HONOR;
			pPlayer->ModStanding(REWARD_REPUTATION_FACTION, REWARD_REPUTATION_VALUE);

			uint32 quest = pPlayer->GetTeam() == ALLIANCE ? ALLIANCE_SILITHYST_QUEST : HORDE_SILITHYST_QUEST;
			QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(quest);
			if(qle)
				qle->SendQuestComplete();
			/***********/

			if(locked)
				return;
			silithyst_gathered[ pPlayer->GetTeam() ]++;
			uint32 worldstate = pPlayer->GetTeam() == ALLIANCE ? WORLDSTATE_SILITHUS_GATHERED_ALLIANCE : WORLDSTATE_SILITHUS_GATHERED_HORDE;
			pPlayer->GetMapMgr()->GetStateManager().UpdateWorldState(worldstate , silithyst_gathered[ pPlayer->GetTeam() ]);
			if(silithyst_gathered[ pPlayer->GetTeam() ] >= SILITHYST_MAX)
			{
				locked = true; // we win, so opposite team must wait for server restart
				winners = pPlayer->GetTeam();
				pPlayer->GetMapMgr()->CastSpellOnPlayers(winners, CENARION_FAVOR);
				pPlayer->GetMapMgr()->RemovePositiveAuraFromPlayers(winners == ALLIANCE ? HORDE : ALLIANCE, CENARION_FAVOR);
			}
		}
	}
}
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:38,代码来源:ZoneSilithus.cpp

示例15: OnQuestStart

	void OnQuestStart( PlayerPointer mTarget, QuestLogEntry * qLogEntry )
	{
		if( !mTarget || !mTarget->GetMapMgr() || !mTarget->GetMapMgr()->GetInterface() )
			return;

		Tikti = sEAS.SpawnCreature( mTarget, 17392, -3875.430664f, -13125.011719f, 6.822148f, 2.020735f, 0 );
		if( !Tikti )
			return;

		mTarget->CastSpell( Tikti, 25035, true); // Apparition Effect

		Tikti->m_escorter = mTarget;   
		Tikti->GetAIInterface()->setMoveType( WALK );
		Tikti->GetAIInterface()->StopMovement( 3000 );
		Tikti->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Follow me!" );
		Tikti->SetUInt32Value( UNIT_NPC_FLAGS, 0 );

		sEAS.CreateCustomWaypointMap( Tikti );
		sEAS.WaypointCreate( Tikti, -3881.700928f, -13111.898438f, 5.814010f, 1.855801f, 0, 256, 16999 );
		sEAS.WaypointCreate( Tikti, -3886.341553f, -13098.914063f, 3.964841f, 1.855801f, 0, 256, 16999 );
		sEAS.EnableWaypoints( Tikti );

		UnitPointer Totem = TO_UNIT(Tikti);
		UnitPointer Plr = TO_UNIT(mTarget);
		string msg = "[Furbolg] Far you mixik tak come. Gaze upon the kitch'kal river. Follow. Ilog to Yor.";
		sEventMgr.AddEvent(TO_UNIT(Tikti), &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg.c_str(), EVENT_UNIT_CHAT_MSG, 15000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

		if( mTarget->CalcDistance( Tikti, mTarget ) <= 10 )
			sEventMgr.AddEvent(TO_UNIT(Tikti), &Unit::EventCastSpell, Plr, dbcSpell.LookupEntry(30430), EVENT_CREATURE_UPDATE, 18000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT );

		string msg2 = "[Furbolg] Go... Search yitix'kil bottom river. South!";
		sEventMgr.AddEvent(TO_UNIT(Tikti), &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg2.c_str(), EVENT_UNIT_CHAT_MSG, 20000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

		sEventMgr.AddEvent(TO_UNIT(Tikti), &Unit::EventCastSpell, Totem, dbcSpell.LookupEntry(30431), EVENT_GMSCRIPT_EVENT, 20000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT );

		sEventMgr.AddEvent(Tikti, &Creature::Despawn, uint32(0), uint32(0), EVENT_GMSCRIPT_EVENT, 24000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:37,代码来源:Azuremyst_Isle.cpp


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