コード例 #1
0
	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();
	};
コード例 #2
0
void DropFlag(PlayerPointer  pPlayer, uint32 spellID)
{
	if(!pPlayer || spellID != SILITHYST_SPELL)
		return;
	uint32 triggerID = pPlayer->GetTeam() == ALLIANCE ? ALLIANCE_RETURN : HORDE_RETURN;
	// we have to use AreaTrigger.dbc here
	AreaTrigger* pAreaTrigger = AreaTriggerStorage.LookupEntry(triggerID);
	if(pAreaTrigger)
		if(pPlayer->CalcDistance(pAreaTrigger->x, pAreaTrigger->y, pAreaTrigger->z) > 10.0f)
		{
			GameObjectPointer pGo = pPlayer->GetMapMgr()->GetInterface()->SpawnGameObject(SILITHYST_MOUND, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, true, 0, 0);
			if(pGo == NULL)
			{
				pGo->Destructor();
				pGo = NULLGOB;
			}
		};
}
コード例 #3
0
	void OnQuestStart(PlayerPointer mTarget, QuestLogEntry * qLogEntry)
	{
		if( !mTarget || !mTarget->GetMapMgr() || !mTarget->GetMapMgr()->GetInterface() )
			return;

		Yor = sEAS.SpawnCreature( mTarget, 17393, -4634.246582f, -13071.686523f, -14.755350f, 1.569997f, 0 );
		if( !Yor )
			return;
	
		Yor->CastSpell( Yor, 25035, true ); // Apparition Effect

		Yor->m_escorter = mTarget;   
		Yor->GetAIInterface()->StopMovement( 1000 );
		Yor->SetUInt32Value( UNIT_NPC_FLAGS, 0 );
		char msg[256];
		snprintf((char*)msg, 256, "Come, %s . Let us leave the water together, purified.", mTarget->GetName() );
		Yor->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, msg );

		sEAS.CreateCustomWaypointMap( Yor );
		sEAS.WaypointCreate( Yor, -4650.081055f, -13016.692383f, 1.776296f, 2.021601f, 0, 256, 16393 );
		sEAS.WaypointCreate( Yor, -3886.341553f, -13098.914063f, 3.964841f, 1.855801f, 1000, 256, 16393 );
		sEAS.WaypointCreate( Yor, -4677.421387f, -12983.874023f, 0.833827f, 2.335760f, 0, 256, 16393 ); // Should look player
		sEAS.EnableWaypoints( Yor );

		//We have to set up these pointers first to resolve ambiguity in the event manager template
		UnitPointer Totem = TO_UNIT(Yor);
		UnitPointer Plr = TO_UNIT(mTarget);
		// Change to Stillpine form
		sEventMgr.AddEvent(Totem, &Unit::EventCastSpell, Totem, dbcSpell.LookupEntry(30446), EVENT_CREATURE_UPDATE, 15500, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		string msg2 = "[Furbolg] We go now, together. We will seek Vark.";
		sEventMgr.AddEvent(Totem, &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg2.c_str(), EVENT_UNIT_CHAT_MSG, 26500, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		// Change to nightsaber form
		sEventMgr.AddEvent(Totem, &Unit::EventCastSpell, Totem, dbcSpell.LookupEntry(30448), EVENT_CREATURE_UPDATE, 30000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		string msg3 = "[Furbolg] Follow me to Vark.";
		sEventMgr.AddEvent(Totem, &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg3.c_str(), EVENT_UNIT_CHAT_MSG, 31000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		if( mTarget->CalcDistance( Totem, Plr ) <= 10 )
			sEventMgr.AddEvent(Totem, &Unit::EventCastSpell, Plr, dbcSpell.LookupEntry(30448), EVENT_CREATURE_UPDATE, 31000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
	}
コード例 #4
0
	void OnQuestStart( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
	{
		if( !mTarget || !mTarget->GetMapMgr() || !mTarget->GetMapMgr()->GetInterface() )
			return;

		Coo = sEAS.SpawnCreature( mTarget, 17391, -3926.974365f, -12752.285156f, 97.672722f, 4.926801f, 0 );
		if( !Coo )
			return;

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

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

		sEAS.CreateCustomWaypointMap( Coo );
		sEAS.WaypointCreate( Coo, -3926.076660f, -12755.158203f, 99.080429f, 5.031188f, 0, 256, 16993 );
		sEAS.WaypointCreate( Coo, -3924.019043f, -12763.895508f, 101.547874f, 5.212689f, 0, 256, 16993 );
		sEAS.EnableWaypoints( Coo );


		UnitPointer Totem = TO_UNIT(Coo);
		UnitPointer Plr = TO_UNIT(mTarget);

		string msg = "Ritk kin'chikx azul azure summit...";
		sEventMgr.AddEvent(TO_UNIT(Coo), &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg.c_str(), EVENT_UNIT_CHAT_MSG, 6000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

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

		string msg2 = "Coo xip fly... Jump ilos river. Find Tikti.";
		sEventMgr.AddEvent(TO_UNIT(Coo), &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg2.c_str(), EVENT_UNIT_CHAT_MSG, 9000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

		sEventMgr.AddEvent(TO_UNIT(Coo), &Unit::EventCastSpell, Totem, dbcSpell.LookupEntry(30473), EVENT_CREATURE_UPDATE, 12750, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT );
		Coo->Despawn( 15200, 0 );
	}
コード例 #5
0
	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);
	}