コード例 #1
0
ファイル: WorldCreator.cpp プロジェクト: Chameleo/Hearthstone
void InstanceMgr::ResetSavedInstances(PlayerPointer plr)
{
	WorldPacket data(SMSG_INSTANCE_RESET, 4);
	Instance * in;
	InstanceMap::iterator itr;
	InstanceMap * instancemap;
	uint32 i;

	if(!plr->IsInWorld() || plr->GetMapMgr()->GetMapInfo()->type != INSTANCE_NULL)
		return;

	m_mapLock.Acquire();
	for(i = 0; i < NUM_MAPS; ++i)
	{
		if(m_instances[i] != NULL)
		{
			instancemap = m_instances[i];
			for(itr = instancemap->begin(); itr != instancemap->end();)
			{
				in = itr->second;
				++itr;

				if  ( in->m_mapInfo->type == INSTANCE_NONRAID && 
					( plr->GetLowGUID() == in->m_creatorGuid || 
					( plr->GetGroup() && plr->GetGroup()->GetID() == in->m_creatorGroup )))
				{
					if(in->m_mapMgr && in->m_mapMgr->HasPlayers())
					{
						plr->GetSession()->SystemMessage("Can't reset instance %u (%s) when there are still players inside!", in->m_instanceId, in->m_mapMgr->GetMapInfo()->name);
						continue;
					}

					// <mapid> has been reset.
					data << uint32(in->m_mapId);
					plr->GetSession()->SendPacket(&data);

					// reset groupinstanceid
					if(plr->GetGroup())
						plr->GetGroup()->SetGroupInstanceID(0);

					// destroy the instance
					_DeleteInstance(in, true);
				}
			}
		}
	}
    m_mapLock.Release();	
}
コード例 #2
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9582);
		if(qle == NULL)
			return;

		// What is this ? :O To remove ?
		CreaturePointer reaver = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17556);
		if(reaver)
		{
			CreaturePointer reaver2 = pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(17556, reaver->GetPositionX(), reaver->GetPositionY(), reaver->GetPositionZ(), reaver->GetOrientation(), true, false, 0, 0);
			reaver2->Despawn(5*60*1000, 0);
			reaver->Despawn(1, 5*60*1000);
		}

	}
コード例 #3
0
	void CastScriptSpell( ScriptSpell* spell )
	{
		_unit->Root();
		uint32 spellid = heroic ? spell->heroic_spellid : spell->normal_spellid;
		UnitPointer spelltarget = NULLUNIT;
		switch( spell->target )
		{
		case SPELL_TARGET_SELF:
			{
				spelltarget = _unit;
			}break;
		case SPELL_TARGET_GENERATE:
			{
				spelltarget = NULLUNIT;
			}break;
		case SPELL_TARGET_CURRENT_ENEMY:
			{
				spelltarget = _unit->GetAIInterface()->GetNextTarget();
			}break;
		case SPELL_TARGET_RANDOM_PLAYER:
			{
				spelltarget = GetRandomPlayerTarget();
			}break;
		case SPELL_TARGET_RANDOM_PLAYER_POSITION:
			{
				PlayerPointer target = GetRandomPlayerTarget();
				if( target )
				{
					SpellPointer sp(new Spell(_unit,dbcSpell.LookupEntry( spellid ),true,NULLAURA));
					SpellCastTargets targets;
					targets.m_destX = target->GetPositionX();
					targets.m_destY = target->GetPositionY();
					targets.m_destZ = target->GetPositionZ();
					targets.m_targetMask = TARGET_FLAG_DEST_LOCATION;
					sp->prepare(&targets);
					_unit->UnRoot();
					return;
				}
			}break;
		}
		_unit->CastSpell( spelltarget , spellid, false );
		_unit->UnRoot();
	}
コード例 #4
0
	void OnActivate(PlayerPointer pPlayer)
	{
		QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry(181433);
		if(pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0])
		{
			pQuest->SetMobCount(0, 1);
			pQuest->SendUpdateAddKill(0);
			pQuest->UpdatePlayerFields();
		}
	}
コード例 #5
0
ファイル: Channel.cpp プロジェクト: Maduse/server
void Channel::Leave(ObjectGuid p, bool send)
{
    if (!IsOn(p))
    {
        if (send)
        {
            WorldPacket data;
            MakeNotMember(&data);
            SendToOne(&data, p);
        }
    }
    else
    {
        PlayerPointer plr = GetPlayer(p);

        if (send)
        {
            WorldPacket data;
            MakeYouLeft(&data);
            SendToOne(&data, p);
            plr->LeftChannel(this);
            data.clear();
        }

        bool changeowner = m_players[p].IsOwner();

        m_players.erase(p);
        if (m_announce && (!plr.get() || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getConfig(CONFIG_BOOL_SILENTLY_GM_JOIN_TO_CHANNEL)))
        {
            WorldPacket data;
            MakeLeft(&data, p);
            SendToAll(&data);
        }

        LeaveNotify(p);

        if (changeowner)
        {
            ObjectGuid newowner = !m_players.empty() ? m_players.begin()->second.player : ObjectGuid();
            SetOwner(newowner);
        }
    }
}
コード例 #6
0
	void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
	{
		GossipMenu *Menu;
		if(!plr->GetItemInterface()->GetItemCount(24573, true))
		{
			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 9226, plr);
			Menu->AddItem( 0, "Offer treat", 1);
			Menu->SendTo(plr);
		}
	}
コード例 #7
0
    void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
    {
        GossipMenu *Menu;
		objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 11224, plr);
        if(plr->GetQuestLogForEntry(11142) != NULL){
			Menu->AddItem( 0, GOSSIP_CASSA_CRIMSONWING, 1);
		};
        if(AutoSend)
            Menu->SendTo(plr);
    }
コード例 #8
0
	void OnActivate(PlayerPointer pPlayer)
	{
		QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry(10872);
		
		if(pQuest == NULL)
			return;

		pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1);
		pQuest->SendUpdateAddKill(0);
		pQuest->UpdatePlayerFields();
	}
コード例 #9
0
	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;
		}
	}
コード例 #10
0
    void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 11469, plr);

		if(plr->GetQuestLogForEntry(11223))
        Menu->AddItem( 0, GOSSIP_ARCHMAGE_MALIN, 1);
        
        if(AutoSend)
            Menu->SendTo(plr);
    }
コード例 #11
0
ファイル: Item.cpp プロジェクト: Vanj-crew/HearthStone-Emu
uint32 GetBuyPriceForItem( ItemPrototype* proto, uint32 count, PlayerPointer plr, CreaturePointer vendor )
{
	int32 cost = proto->BuyPrice;

	if( plr != NULL && vendor != NULL )
	{
		Standing plrstanding = plr->GetStandingRank( vendor->m_faction->Faction );
		cost = float2int32( ceilf( float( proto->BuyPrice ) * pricemod[plrstanding] ) );
	}

	return cost * count;
}
コード例 #12
0
	void OnActivate(PlayerPointer pPlayer)
	{

		CreaturePointer Ulag = NULLCREATURE;
		GameObjectPointer pDoor = NULLGOB;
		Ulag = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(2390.101807f, 336.676788f, 40.015614f, 6390);
		pDoor = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2388.480029f, 338.3901f, 40.092899f, 176594);
		QuestLogEntry * en = pPlayer->GetQuestLogForEntry(1819);
		if(!en || pDoor==NULL || Ulag)
		return;

		CreaturePointer NewCreature = pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(6390, 2390.101807f, 336.676788f, 40.015614f, 2.259590f, true, false, 0, 0);
		if ( NewCreature != NULL )
		{
			NewCreature->Despawn(180000, 0);
			NewCreature->GetAIInterface()->SetNextTarget(pPlayer);
			NewCreature->GetAIInterface()->AttackReaction(pPlayer, 1);
			pDoor->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
			pDoor->SetByte(GAMEOBJECT_BYTES_1, 0, 0);
		};
	}
コード例 #13
0
	void OnQuestStart( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();

		CreaturePointer Dashel = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 4961);

		if(Dashel == NULL)
			return;
		
		Dashel->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 72);
		Dashel->GetAIInterface()->disable_melee = false;
		Dashel->GetAIInterface()->SetAllowedToEnterCombat(true);

		uint32 chance = RandomUInt(100);
		if(chance < 15)
		{
			string say = "Now you're gonna get it good, ";
			say+=(TO_PLAYER(mTarget))->GetName();
			say+="!";
			Dashel->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say.c_str());
		}
		CreaturePointer Thug1 = sEAS.SpawnCreature(mTarget, 4969, -8686.803711, 445.267792, 99.789223, 5.461184, 300000);
		CreaturePointer Thug2 = sEAS.SpawnCreature(mTarget, 4969, -8675.571289, 444.162262, 99.644737, 3.834103, 300000);
	}
コード例 #14
0
	void OnQuestComplete( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();

		CreaturePointer Zealot = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 1931);

		if(Zealot == NULL)
			return;

		Zealot->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I. . . I. . .don't. . .feel. . .right. . .");
		sEAS.EventCastSpell(Zealot, Zealot, 3287, 3000);
		Zealot->GetAIInterface()->setMoveType(11);
		Zealot->GetAIInterface()->StopMovement(3000);


		sEAS.CreateCustomWaypointMap(Zealot);

		sEAS.WaypointCreate(Zealot, 2289.649658f, 237.001389f, 27.089531f, 1.323f, 0, 256, 0);
		sEAS.WaypointCreate(Zealot, 2291.700928f, 235.561844f, 27.089531f, 1.323f, 0, 256, 0);
		sEAS.WaypointCreate(Zealot, 2292.835693f, 240.636948f, 27.089531f, 1.323f, 0, 256, 0);
		sEAS.WaypointCreate(Zealot, 2288.737305f, 240.503952f, 27.088022f, 1.323f, 0, 256, 0);
		sEAS.WaypointCreate(Zealot, 2287.812744f, 236.320938f, 27.088022f, 1.323f, 0, 256, 0);
		sEAS.WaypointCreate(Zealot, 2292.643033f, 240.513489f, 27.088022f, 1.323f, 0, 256, 0);
		sEAS.WaypointCreate(Zealot, 2289.628418f, 239.908279f, 27.088022f, 1.323f, 0, 256, 0);
	}
コード例 #15
0
ファイル: WorldCreator.cpp プロジェクト: Chameleo/Hearthstone
void InstanceMgr::PlayerLeftGroup(Group * pGroup, PlayerPointer pPlayer)
{
	// does this group own any instances? we have to kick the player out of those instances.
	Instance * in;
	InstanceMap::iterator itr;
	InstanceMap * instancemap;
	WorldPacket data(SMSG_RAID_GROUP_ONLY, 8);
	uint32 i;

	m_mapLock.Acquire();
	for(i = 0; i < NUM_MAPS; ++i)
	{
		instancemap = m_instances[i];
		if(instancemap)
		{
			for(itr = instancemap->begin(); itr != instancemap->end();)
			{
				in = itr->second;
				++itr;

				if(PlayerOwnsInstance(in,pPlayer))
				{
					// better make sure we're actually in that instance.. :P
					if(!pPlayer->raidgrouponlysent && pPlayer->GetInstanceID() == (int32)in->m_instanceId)
					{
						data << uint32(60000) << uint32(1);
						pPlayer->GetSession()->SendPacket(&data);
						pPlayer->raidgrouponlysent=true;
	
						sEventMgr.AddEvent(pPlayer, &Player::EjectFromInstance, EVENT_PLAYER_EJECT_FROM_INSTANCE, 60000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

						m_mapLock.Release();
						return;
					}
				}
			}
		}
	}
	m_mapLock.Release();
}
コード例 #16
0
void OnEmote(PlayerPointer pPlayer, uint32 Emote, UnitPointer pUnit)
{
	pUnit = pPlayer->GetMapMgr()->GetUnit(pPlayer->GetSelection());
	if (!pUnit || !pUnit->isAlive() || pUnit->GetAIInterface()->GetNextTarget())
		return;

	// Switch For Emote Name (You do EmoteName to Script Name link).
	switch(Emote)
	{
	case EMOTE_ONESHOT_SALUTE: // <- Its EMOTE name.
		GuardsOnSalute(pPlayer, pUnit); // <- Its Link.
		break;

	case EMOTE_ONESHOT_KISS:
		GaurdsOnKiss(pPlayer, pUnit);
		break;
	
	case EMOTE_ONESHOT_WAVE:
		GuardsOnWave(pPlayer, pUnit);
		break;
	}
}
コード例 #17
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10915);
		if(qle == NULL)
			return;

		CreaturePointer exarch = sEAS.SpawnCreature(pPlayer, 22452, -3365.9, 5143.19, -9.00132, 3.05, 0);
		if ( exarch != NULL )
			exarch->Despawn(6*60*1000, 0);
	}
コード例 #18
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(1150);
		if(qle == NULL)
			return;

		CreaturePointer grenka = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 4490);
		if(grenka)
		{
			if(!grenka->isAlive())
				grenka->Despawn( 5000, 120000 );
			else
				return;
		}

		CreaturePointer grenkaspawn = sEAS.SpawnCreature(pPlayer, 4490, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 0);
		if ( grenkaspawn != NULL )
			grenkaspawn->Despawn(6*60*1000, 0);
	}
コード例 #19
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(5381);
		if(qle == NULL)
			return;

		CreaturePointer demon = sEAS.SpawnCreature(pPlayer, 11876, -348.231, 1763.85, 138.371, 4.42728, 0);
		if ( demon != NULL )
			demon->Despawn(6*60*1000, 0);
	}
コード例 #20
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(6027);
		if(qle == NULL)
			  return;

		CreaturePointer naga = sEAS.SpawnCreature(pPlayer, 12369, 246.741, 2953.3, 5.8631, 1.078, 0);
		if ( naga != NULL )
			naga->Despawn(6*60*1000, 0);
	}
コード例 #21
0
bool ChatHandler::HandleReviveStringcommand(const char* args, WorldSession* m_session)
{
	PlayerPointer plr = objmgr.GetPlayer(args, false);
	if(!plr)
	{
		RedSystemMessage(m_session, "Could not find player %s.", args);
		return true;
	}

	if(plr->isDead())
	{
		if(plr->GetInstanceID() == m_session->GetPlayer()->GetInstanceID())
			plr->RemoteRevive();
		else
			sEventMgr.AddEvent(plr, &Player::RemoteRevive, EVENT_PLAYER_REST, 1, 1,0);

		GreenSystemMessage(m_session, "Revived player %s.", args);
	} else {
		GreenSystemMessage(m_session, "Player %s is not dead.", args);
	}
	return true;
}
コード例 #22
0
void DnDController::chat_message (const PlayerPointer& receiver,
                                  const QString& message)
{
  int flags = 0;
  Uuid dst_uuid;

  if (receiver)
    dst_uuid = receiver->get_uuid ();
  else
    flags |= CHAT_BROADCAST;

  _client->chat_message (_me->get_uuid (), dst_uuid, message, flags);
}
コード例 #23
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9689);
		if(qle == NULL)
			return;

		CreaturePointer razormaw = sEAS.SpawnCreature(pPlayer, 17592, -1203.8, -12424.7, 95.36, 4.7, 0);
		if ( razormaw != NULL )
			razormaw->Despawn(6*60*1000, 0);
	}
コード例 #24
0
    void GossipSelectOption(ObjectPointer pObject, PlayerPointer  plr, uint32 Id, uint32 IntId, const char * Code)
    {
		if( !plr )
			return;
		
		CreaturePointer  pCreature = NULLCREATURE;
		pCreature = pObject->IsCreature() ? TO_CREATURE( pObject ) : NULLCREATURE;
		if( !pCreature )
			return;

		if( IntId == 3 )
		{
			plr->GetSession()->SendInventoryList(pCreature);
			return;
		}

		uint32 CastSpellID = IntId == 1 ? 32430 : 32431;
		if( CastSpellID != 0 )
			if( !plr->HasAura( CastSpellID ) )
				pCreature->CastSpell(plr,CastSpellID,true);
		return;
    }
コード例 #25
0
bool ChatHandler::HandleKillByPlrCommand( const char *args , WorldSession *m_session )
{
	PlayerPointer plr = objmgr.GetPlayer(args, false);
	if(!plr)
	{
		RedSystemMessage(m_session, "Player %s is not online or does not exist.", args);
		return true;
	}

	if(plr->isDead())
	{
		RedSystemMessage(m_session, "Player %s is already dead.", args);
	} else {
		plr->SetUInt32Value(UNIT_FIELD_HEALTH, 0); // Die, insect
		plr->KillPlayer();
		BlueSystemMessageToPlr(plr, "You were killed by %s with a GM command.", m_session->GetPlayer()->GetName());
		GreenSystemMessage(m_session, "Killed player %s.", args);
		sGMLog.writefromsession(m_session, "remote killed "I64FMT" (Name: %s)", plr->GetGUID(), plr->GetNameString() );

	}
	return true;
}
コード例 #26
0
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9544);
		if(qle == NULL)
			return;

		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}

		CreaturePointer prisoner = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17375);
		if(!prisoner)
			return;

		prisoner->Despawn(1, 6*60*1000);
	}
コード例 #27
0
void GuardsOnWave(PlayerPointer pPlayer, UnitPointer pUnit)
{
	if ( pPlayer == NULLPLR || pUnit == NULLUNIT )
		return;

	// Check if we are friendly with our Guards (they will wave only when You are)
	if (((pUnit->GetEntry() == 68 || pUnit->GetEntry() == 1976) && pPlayer->GetStandingRank(72) >= FRIENDLY) || (pUnit->GetEntry() == 3296 && pPlayer->GetStandingRank(76) >= FRIENDLY))
	{
		uint32 EmoteChance = RandomUInt(100);
		if(EmoteChance < 33) // 1/3 chance to get Bow from Guard
			pUnit->Emote(EMOTE_ONESHOT_WAVE);
	}
}
コード例 #28
0
bool HealingTheLake(uint32 i, SpellPointer pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	PlayerPointer pPlayer = TO_PLAYER( pSpell->u_caster );

	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9294 );
	if ( pQuest == NULL )
		return true;

	if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
	{
		pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
		pQuest->SendUpdateAddKill( 0 );
		pQuest->UpdatePlayerFields();
		
		return true;
	}
	
	return true;
}
コード例 #29
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);
	}
コード例 #30
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 );
	}