コード例 #1
0
void EffectVampireRelic::affect(Creature* pCreature)
	throw(Error)
{
	__BEGIN_TRY
																															    	
	//Timeval      nextTime   = getNextTime();
	//Timeval      deadLine   = getDeadline();
	//Turn_t       RemainTime = deadLine.tv_sec - nextTime.tv_sec;

/*
	StringStream msg;

	if (pCreature->isSlayer())
	{
		Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);

		msg << pSlayer->getName();
	}
	else
	{
		Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);

		msg << pVampire->getName();
	}

	msg << " 님이 뱀파이어 성물을 가졌습니다.";
*/

    char msg[50];
    sprintf(msg, g_pStringPool->c_str(STRID_TAKE_VAMPIRE_RELIC ),
                    pCreature->getName().c_str());

    string sMsg(msg);

	GCSystemMessage gcSystemMessage;

	gcSystemMessage.setType(SYSTEM_MESSAGE_COMBAT);
	gcSystemMessage.setMessage(sMsg);

	g_pZoneGroupManager->broadcast(&gcSystemMessage);


	// Effect붙인다.
	GCAddEffect gcAddEffect;
	gcAddEffect.setObjectID(pCreature->getObjectID());
	gcAddEffect.setEffectID(getSendEffectClass());
	gcAddEffect.setDuration(65000);
	pCreature->getZone()->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcAddEffect);

	setNextTime(m_Tick);

	__END_CATCH
}
コード例 #2
0
void CGRangerSayHandler::execute (CGRangerSay* pPacket , Player* pPlayer)
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY

#ifdef __GAME_SERVER__

	Assert(pPacket != NULL);
	Assert(pPlayer != NULL);

	GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer);
	Assert(pGamePlayer != NULL);

	Creature* pCreature = pGamePlayer->getCreature();
	Assert(pCreature != NULL);

	// 크리쳐 이름과 메시지를 패킷에 넣는다.
	StringStream msg;
	msg << pCreature->getName() << " " << pPacket->getMessage();

	Race_t race = pCreature->getRace();

	// 패킷 생성
	GCSystemMessage gcSystemMessage;
	gcSystemMessage.setMessage(msg.toString());
	gcSystemMessage.setType(SYSTEM_MESSAGE_RANGER_SAY);

	// 필터 생성
	BroadcastFilterRace filter(race);

	// 모든 사용자에게 뿌리기
	g_pZoneGroupManager->pushBroadcastPacket(&gcSystemMessage, &filter);

/*	map<ZoneGroupID_t, ZoneGroup*>::const_iterator itr = g_pZoneGroupManager->getZoneGroups().begin();
	map<ZoneGroupID_t, ZoneGroup*>::const_iterator endItr = g_pZoneGroupManager->getZoneGroups().end();

	for (; itr != endItr; ++itr )
	{
		GCSystemMessage* pSystemMessage = new GCSystemMessage();
		pSystemMessage->setMessage(msg.toString());
		pSystemMessage->setType(SYSTEM_MESSAGE_RANGER_SAY);
		pSystemMessage->setRace(race);

		itr->second->getZonePlayerManager()->pushBroadcastPacket(pSystemMessage);
	}
*/
#endif

	__END_CATCH
}
コード例 #3
0
void EffectRelicPosition::affect(Item* pItem)
	throw(Error)
{
	__BEGIN_TRY

	// 존 정보를 얻는다.
	ZoneInfo* pZoneInfo = g_pZoneInfoManager->getZoneInfo(m_ZoneID);
	Assert(pZoneInfo != NULL);

	if (pItem->getItemClass() == Item::ITEM_CLASS_RELIC)
	{
		// 성물의 정보를 얻는다.
		ItemType_t relicIndex = pItem->getItemType();
		const RelicInfo* pRelicInfo = dynamic_cast<RelicInfo*>(g_pRelicInfoManager->getItemInfo(relicIndex));
		Assert(pRelicInfo != NULL);

//		StringStream msg;

/*		// 위치를 알린다.
		msg << "성물(" << pRelicInfo->getName() << ")이 "
			<< pZoneInfo->getFullName() << "(" << (int)m_X << ", " << (int)m_Y << ")에 떨어져 있습니다."; */

		char msg[100];

		sprintf(msg, g_pStringPool->c_str(STRID_RELIC_IN_ZONE ),
						pRelicInfo->getName().c_str(),
						pZoneInfo->getFullName().c_str(),
						(int)m_X,
						(int)m_Y
		);

		GCSystemMessage gcSystemMessage;
		gcSystemMessage.setType(SYSTEM_MESSAGE_COMBAT);
		gcSystemMessage.setMessage(msg);

		g_pHolyLandManager->broadcast(&gcSystemMessage);

		setNextTime(m_Tick);
	}
	else if (pItem->getItemClass() == Item::ITEM_CLASS_BLOOD_BIBLE)
	{
		ShrineSet* pShrineSet = g_pShrineInfoManager->getShrineSet(m_Part);
		Assert(pShrineSet!=NULL);

		GCBloodBibleStatus* pGCBBS = new GCBloodBibleStatus;
		pGCBBS->setItemType(m_Part);
		pGCBBS->setZoneID(m_ZoneID);
		pGCBBS->setStorage(STORAGE_ZONE);
		//pGCBBS->setRace(pShrineSet->getOwnerRace());
		pGCBBS->setShrineRace(pShrineSet->getOwnerRace());
		pGCBBS->setX(m_X);
		pGCBBS->setY(m_Y);

//		g_pHolyLandManager->broadcast(pGCBBS);
		g_pZoneGroupManager->broadcast(pGCBBS);
		g_pShrineInfoManager->registerBloodBibleStatus(m_Part, pGCBBS);
		/*
		msg << "피의 성서 조각이 "
			<< pZoneInfo->getFullName() << "(" << (int)m_X << ", " << (int)m_Y << ")에 떨어져 있습니다.";

		g_pZoneGroupManager->broadcast(&gcSystemMessage);
		*/

		setNextTime(999999);
	}
	else if (pItem->getItemClass() == Item::ITEM_CLASS_CASTLE_SYMBOL)
	{
//		StringStream msg;

//		msg << "성의 상징이 "
//			<< pZoneInfo->getFullName() << "(" << (int)m_X << ", " << (int)m_Y << ")에 떨어져 있습니다.";

		char msg[200];
		sprintf(msg, g_pStringPool->c_str(STRID_BROADCAST_CASTLE_SYMBOL_POSITION_3 ),
						pZoneInfo->getFullName().c_str(), (int)m_X, (int)m_Y);

		GCSystemMessage gcSystemMessage;
		gcSystemMessage.setType(SYSTEM_MESSAGE_HOLY_LAND);
		gcSystemMessage.setMessage(msg);

		g_pCastleInfoManager->broadcastShrinePacket(m_Part, &gcSystemMessage);

		setNextTime(m_Tick);
//		g_pZoneGroupManager->broadcast(&gcSystemMessage);
	}
	else
	{
		return;
	}


	__END_CATCH
}