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


C++ Ousters::sendRealWearingInfo方法代码示例

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


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

示例1: unaffect

void EffectEvade::unaffect(Creature* pCreature)
	throw(Error)
{
	__BEGIN_TRY

	//cout << "EffectEvade" << "unaffect BEGIN" << endl;

	Assert(pCreature != NULL);
	Assert(pCreature->isOusters());

	// 플래그를 끈다.
	pCreature->removeFlag(Effect::EFFECT_CLASS_EVADE);

	Zone* pZone = pCreature->getZone();
	Assert(pZone != NULL);

	Ousters* pTargetOusters = dynamic_cast<Ousters*>(pCreature);
	Assert(pTargetOusters != NULL);

	OUSTERS_RECORD prev;

	pTargetOusters->getOustersRecord(prev);
	pTargetOusters->initAllStat();
	pTargetOusters->sendRealWearingInfo();
	pTargetOusters->sendModifyInfo(prev);

	// 이펙트를 삭제하라고 알려준다.
	GCRemoveEffect gcRemoveEffect;
	gcRemoveEffect.setObjectID(pCreature->getObjectID());
	gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_EVADE);
	pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcRemoveEffect);

	//cout << "EffectEvade" << "unaffect END" << endl;

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:36,代码来源:EffectEvade.cpp

示例2: executeNormal


//.........这里部分代码省略.........

						// 걸어다니는 크리쳐를 검색	
						if (tile.hasCreature(Creature::MOVE_MODE_WALKING))
						{
							pNearCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
							if (pNearCreature == NULL) continue;

							// 방금 물건을 판 플레이어라면 생략
							if (pNearCreature->getObjectID() == pPC->getObjectID()) continue;
							
							// 만약 플레이어라면 패킷을 보내준다.
							if (pNearCreature->isPC())
							{
								pNearPlayer = pNearCreature->getPlayer();
								if (pNearPlayer == NULL) continue;
								pNearPlayer->sendPacket(&boughtpkt);
							}
						}
						// 날아다니는 크리쳐를 검색
						if (tile.hasCreature(Creature::MOVE_MODE_FLYING))
						{
							pNearCreature = tile.getCreature(Creature::MOVE_MODE_FLYING);
							if (pNearCreature == NULL) continue;
							
							// 방금 물건을 판 플레이어라면 생략
							if (pNearCreature->getObjectID() == pPC->getObjectID()) continue;

							// 만약 플레이어라면 패킷을 보내준다.
							if (pNearCreature->isPC())
							{
								pNearPlayer = pNearCreature->getPlayer();
								if (pNearPlayer == NULL) continue;
								pNearPlayer->sendPacket(&boughtpkt);
							}
						}

					} // end of for (ZoneCoord_t zy=CenterY-5; zy<=CenterY+5; zy++)
				} // end of for (ZoneCoord_t zx=CenterX-5; zx<=CenterX+5; zx++)
			}
			catch (Throwable & t)
			{
				filelog("shopbug_packet.log", "%s", t.toString().c_str());
			}

		} // if (index < SHOP_RACK_INDEX_MAX)
		else
		{
			SAFE_DELETE(pItem);
		}
	} // if (pItem->getOptionType() != 0)
	else
	{
		bSpecialItem = false;
		SAFE_DELETE(pItem);
	}

	// 물건을 산 플레이어에게 GCShopSellOK를...보낸다.
	GCShopSellOK okpkt;
	okpkt.setObjectID(NPCID);
	if (bSpecialItem) okpkt.setShopVersion(pNPC->getShopVersion(SHOP_RACK_SPECIAL));
	else              okpkt.setShopVersion(pNPC->getShopVersion(SHOP_RACK_NORMAL));
	okpkt.setItemObjectID(ITEMOID);
	//okpkt.setPrice(playerMoney+itemPrice);
	// playerMoney + itemPrice 가 MAX_MONEY를 넘어갈 수 있다.
	// 2003.1.8 by bezz
	okpkt.setPrice(pPC->getGold());
	pPlayer->sendPacket(&okpkt);
	
	if (bClearDefaultOptionTypes )
	{
		pPC->clearDefaultOptionTypes();
		pPC->initAllStatAndSend();

		if (pPC->isSlayer() )
		{
			Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
			Assert(pSlayer != NULL);

			pSlayer->sendRealWearingInfo();
		}
		else if (pPC->isVampire() )
		{
			Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
			Assert(pVampire != NULL);

			pVampire->sendRealWearingInfo();
		}
		else if (pPC->isOusters() )
		{
			Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
			Assert(pOusters != NULL);

			pOusters->sendRealWearingInfo();
		}
	}

#endif

	__END_DEBUG_EX __END_CATCH
}
开发者ID:jun199004,项目名称:server,代码行数:101,代码来源:CGShopRequestSellHandler.cpp

示例3: unaffect

void EffectDoom::unaffect(Creature* pCreature)
	throw(Error)
{
	__BEGIN_TRY
	__BEGIN_DEBUG

	//cout << "EffectDoom" << "unaffect BEGIN" << endl;

	Assert(pCreature != NULL);

	// 능력치를 정상적으로 되돌리기 위해서는 플래그를 끄고,
	// initAllStat을 불러야 한다.
	pCreature->removeFlag(Effect::EFFECT_CLASS_DOOM);

	if (pCreature->isVampire())
	{
		Vampire* pTargetVampire = dynamic_cast<Vampire*>(pCreature);
		VAMPIRE_RECORD prev;

		pTargetVampire->getVampireRecord(prev);
		pTargetVampire->initAllStat();
		pTargetVampire->sendRealWearingInfo();
		pTargetVampire->sendModifyInfo(prev);
    }
	else if (pCreature->isMonster())
	{
		Monster* pMonster = dynamic_cast<Monster*>(pCreature);
		pMonster->initAllStat();
	}
	else if (pCreature->isSlayer())
	{
		Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pCreature);
		SLAYER_RECORD prev;

		pTargetSlayer->getSlayerRecord(prev);
		pTargetSlayer->initAllStat();
		pTargetSlayer->sendRealWearingInfo();
		pTargetSlayer->sendModifyInfo(prev);
    }
	else if (pCreature->isOusters())
	{
		Ousters* pTargetOusters = dynamic_cast<Ousters*>(pCreature);
		OUSTERS_RECORD prev;

		pTargetOusters->getOustersRecord(prev);
		pTargetOusters->initAllStat();
		pTargetOusters->sendRealWearingInfo();
		pTargetOusters->sendModifyInfo(prev);
    }
	else Assert(false);

	Zone* pZone = pCreature->getZone();
	Assert(pZone != NULL);

	GCRemoveEffect gcRemoveEffect;
	gcRemoveEffect.setObjectID(pCreature->getObjectID());
	gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_DOOM);
	pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcRemoveEffect);

	//cout << "EffectDoom" << "unaffect END" << endl;

	__END_DEBUG
	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:64,代码来源:EffectDoom.cpp

示例4: execute


//.........这里部分代码省略.........
		else if (which == INC_DEX)
		{
			cur = pVampire->getDEX(ATTR_BASIC) + 1;
			pVampire->setDEX(cur, ATTR_BASIC);

			StringStream sst;
			sst << "DEX = " << (int)cur;
			pVampire->tinysave(sst.toString());

			//log(LOG_USE_BONUS_POINT, pVampire->getName(), "", "DEX");
		}

		// 바뀐 보너스 포인트를 저장한다.
		Bonus_t OldBonus = pVampire->getBonus();
		pVampire->setBonus(OldBonus - 1);
		StringStream sst;
		sst << "Bonus = " << (int)(OldBonus - 1);
		pVampire->tinysave(sst.toString());

		// 능력치가 변화되었으니, stat을 새로 고친다.
		pVampire->initAllStat();
		
		// 클라이언트의 계산 순서 때문에 생기는 버그로 인하여,
		// 먼저 인증 패킷을 날려준 후에, 바뀐 능력치에 대한 정보를 보낸다.
		// 나중에 CGUseBonusPointOK에다 바로 바뀐 능력치에 대한 정보를 
		// 실어보내도록 해야 한다.

		// OK 패킷을 보내준다.
		GCUseBonusPointOK okpkt;
		pGamePlayer->sendPacket (&okpkt);

		// 바뀐 능력치에 관한 정보를 보내준다.
		pVampire->sendModifyInfo(oldRecord);
		pVampire->sendRealWearingInfo();
	}
	else if (pCreature->isOusters() ) 
	{
		// 보너스 포인트가 없다면 리턴
		Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
		if (pOusters->getBonus() <= 0)
		{
			GCUseBonusPointFail failPkt;
			pPlayer->sendPacket(&failPkt);
			return;
		}

		OUSTERS_RECORD oldRecord;
		// 능력치를 올리기 전에 기존의 능력치를 저장한다.
		pOusters->getOustersRecord(oldRecord);

		if (which == INC_INT)
		{
			cur = pOusters->getINT(ATTR_BASIC) + 1;
			pOusters->setINT(cur, ATTR_BASIC);

			StringStream sst;
			sst << "INTE = " << (int)cur;
			pOusters->tinysave(sst.toString());
		}
		else if (which == INC_STR)
		{
			cur = pOusters->getSTR(ATTR_BASIC) + 1;
			pOusters->setSTR(cur, ATTR_BASIC);

			StringStream sst;
			sst << "STR = " << (int)cur;
开发者ID:jun199004,项目名称:server,代码行数:67,代码来源:CGUseBonusPointHandler.cpp

示例5: execute


//.........这里部分代码省略.........

        for (; itr != rRequiredSkills.end(); ++itr )
        {
            if (pOusters->hasSkill(*itr) != NULL )
            {
                bool canDrop = false;
                SkillInfo* pFollowingSkillInfo = g_pSkillInfoManager->getSkillInfo(*itr);
                list<SkillType_t>& rRequireSkills = pFollowingSkillInfo->getRequireSkills();
                list<SkillType_t>::iterator itr2 = rRequireSkills.begin();
                for (; itr2 != rRequireSkills.end(); ++itr2 )
                {
                    if ((*itr2) != targetSkillType && pOusters->hasSkill(*itr2) != NULL )
                    {
                        SkillInfo* pAlternativeSkillInfo = g_pSkillInfoManager->getSkillInfo(*itr2);
                        if (getSkillMapID((ElementalDomain)pAlternativeSkillInfo->getElementalDomain()) == getSkillMapID((ElementalDomain)pTargetSkillInfo->getElementalDomain()) )
                            canDrop = true;
                    }
                }

                if (!canDrop )
                {
                    failpkt.setDesc(CANNOT_DROP_SKILL);
                    pPlayer->sendPacket(&failpkt);
                    return;
                }
            }
        }
    }

    /*	if (pTargetSkillSlot->getExpLevel() >= 30 )
    	{
    		failpkt.setDesc(TOO_HIGH);
    		pPlayer->sendPacket(&failpkt);
    		return;
    	}*/

    Assert(pTargetSkillInfo != NULL);

    int backPoint = pTargetSkillInfo->getLevelUpPoint();
    Price_t downPrice = (int)(backPoint * pow(pOusters->getLevel(),1.3) * 200);

    if (pTargetSkillSlot->getExpLevel() <= 1 )
    {
        downPrice *= 5;
        if (downPrice == 0 ) downPrice = 1000000;
    }

    if (pOusters->getGold() < downPrice )
    {
        failpkt.setDesc(NOT_ENOUGH_MONEY);
        pPlayer->sendPacket(&failpkt);

        return;
    }

    pOusters->decreaseGoldEx(downPrice);
    pTargetSkillSlot->setExpLevel(pTargetSkillSlot->getExpLevel() - 1);
    pTargetSkillSlot->save();
    if (pTargetSkillSlot->getExpLevel() <= 0 )
    {
        pTargetSkillSlot->destroy(pOusters->getName());
        backPoint = pTargetSkillInfo->getSkillPoint();
        pOusters->removeSkill(targetSkillType);
    }

    pOusters->setSkillBonus(pOusters->getSkillBonus() + backPoint);
    char query[50];
    sprintf(query, "SkillBonus=%d", pOusters->getSkillBonus());
    pOusters->tinysave(query);

    GCDownSkillOK okpkt;
    okpkt.setSkillType(targetSkillType);
    pPlayer->sendPacket(&okpkt);

    GCModifyInformation gcMI;
    gcMI.addLongData(MODIFY_GOLD, pOusters->getGold());
    gcMI.addShortData(MODIFY_SKILL_BONUS_POINT, pOusters->getSkillBonus());

    switch (targetSkillType )
    {
    case SKILL_HIDE_SIGHT:
    {
        OUSTERS_RECORD prev;
        pOusters->getOustersRecord(prev);
        pOusters->initAllStat();
        pOusters->sendRealWearingInfo();
        pOusters->addModifyInfo(prev, gcMI);
    }
    break;

    default :
        break;
    }

    pPlayer->sendPacket(&gcMI);

#endif	// __GAME_SERVER__

    __END_DEBUG_EX __END_CATCH
}
开发者ID:opendarkeden,项目名称:server,代码行数:101,代码来源:CGDownSkillHandler.cpp

示例6: executeNormal

//////////////////////////////////////////////////////////////////////////////
// 일반 아이템을 처리한다.
//////////////////////////////////////////////////////////////////////////////
void CGRequestRepairHandler::executeNormal (CGRequestRepair* pPacket , Player* pPlayer)
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY __BEGIN_DEBUG_EX

#ifdef __GAME_SERVER__

	ObjectID_t    ITEMOID       = pPacket->getObjectID();
	Creature*     pPC           = dynamic_cast<GamePlayer*>(pPlayer)->getCreature();
	bool          bSlayer       = false;
	bool          bVampire      = false;
	bool          bOusters      = false;
	Gold_t        playerMoney   = 0;
	Price_t       repairPrice   = 0;
	Item*         pItem         = NULL;
	Slayer*       pSlayer       = NULL;
	Vampire*      pVampire      = NULL;
	Ousters*      pOusters      = NULL;
	int           storage       = 0;
	int           X             = 0;
	int           Y             = 0;
	GCNPCResponse response;

	// 플레이어가 슬레이어인지 뱀파이어인지 구분.
	if (pPC->isSlayer())       bSlayer = true;
	else if (pPC->isVampire()) bVampire = true;
	else if (pPC->isOusters()) bOusters = true;

	// 플레이어가 수리하려고 하는 아이템을 가지고 있는지 검사
	if (bSlayer)
	{
		pSlayer     = dynamic_cast<Slayer*>(pPC);
		playerMoney = pSlayer->getGold();
		pItem       = pSlayer->findItemOID(ITEMOID, storage, X, Y);
	}
	else if (bVampire)
	{
		pVampire    = dynamic_cast<Vampire*>(pPC);
		playerMoney = pVampire->getGold();
		pItem       = pVampire->findItemOID(ITEMOID, storage, X, Y);
	}
	else if (bOusters)
	{
		pOusters    = dynamic_cast<Ousters*>(pPC);
		playerMoney = pOusters->getGold();
		pItem       = pOusters->findItemOID(ITEMOID, storage, X, Y);
	}

	// 플레이어가 수리하려고 하는 아이템을 가지고 있는지 
	// 상위에서 검사를 하기 때문에, pItem이 널일리는 없다.
	// 단, 수리할 수 없는 아이템인지를 검사한다.
	if (isRepairableItem(pItem) == false)
	{
		response.setCode(NPC_RESPONSE_REPAIR_FAIL_ITEM_TYPE);
		pPlayer->sendPacket(&response);
		return;
	}

	// 이전 내구도를 저장한다.
	Durability_t oldDurability = pItem->getDurability();

	repairPrice = g_pPriceManager->getRepairPrice(pItem);

	if (repairPrice > playerMoney)
	{
		response.setCode(NPC_RESPONSE_REPAIR_FAIL_MONEY);
		pPlayer->sendPacket(&response);
		return;
	}

	// 수리한다.
	repairItem(pItem);

	// 수리한 아이템이 기어창의 아이템이고 이전 내구도가 0 이었다면 정보를 새로 보내줘야한다.
	if (storage == STORAGE_GEAR && oldDurability == 0 )
	{
		if (bSlayer && pSlayer != NULL )
		{
			pSlayer->initAllStatAndSend();
			pSlayer->sendRealWearingInfo();
		}
		else if (bVampire && pVampire != NULL )
		{
			pVampire->initAllStatAndSend();
			pVampire->sendRealWearingInfo();
		}
		else if (bOusters && pOusters != NULL )
		{
			pOusters->initAllStatAndSend();
			pOusters->sendRealWearingInfo();
		}
	}

	// 돈을 줄인다.
	if (bSlayer)
	{
		//pSlayer->setGoldEx(playerMoney-repairPrice);
//.........这里部分代码省略.........
开发者ID:hillwah,项目名称:darkeden,代码行数:101,代码来源:CGRequestRepairHandler.cpp

示例7: executeAll


//.........这里部分代码省略.........
			Item* pItem = pOusters->getWearItem((Ousters::WearPart)i);
			if (pItem != NULL) 
			{
				if (i == Ousters::WEAR_RIGHTHAND && isTwohandWeapon(pItem))
				{
					// 양손무기는 한쪽만 수리한다.
				}
				else
				{
					repairPrice += g_pPriceManager->getRepairPrice(pItem);
				}
			}
		}

		// 돈이 모자라다면 리턴한다.
		if (pOusters->getGold() < repairPrice)
		{
			response.setCode(NPC_RESPONSE_REPAIR_FAIL_MONEY);
			pPlayer->sendPacket(&response);
			return;
		}
 
		// 각각의 아이템을 수리하고, DB에 저장한다.
		char pField[80];

		for (int i=0; i<Ousters::OUSTERS_WEAR_MAX; i++)
		{
			Item* pItem = pOusters->getWearItem((Ousters::WearPart)i);
			if (pItem != NULL)
			{
				if (i == Ousters::WEAR_RIGHTHAND && isTwohandWeapon(pItem))
				{
					// 양손무기는 한쪽만 수리한다.
				}
				else
				{
					Durability_t oldDurability = pItem->getDurability();
					repairItem(pItem);
					if (pItem->getDurability() != oldDurability)
					{
						// DB 쿼리를 줄이기 위해서
						// 내구도의 변화가 생긴 경우에만 세이브한다.
						//pItem->save(pOusters->getName(), STORAGE_GEAR, 0, i, 0);
						// item저장 최적화. by sigi. 2002.5.13
						sprintf(pField, "Durability=%d", pItem->getDurability());
						pItem->tinysave(pField);
					}

					if (oldDurability == 0 )
						bSendRealWearingInfo = true;
				}
			}
		}

		// 돈을 줄이고...
		//pOusters->setGoldEx(pOusters->getGold() - repairPrice);
		// by sigi.2002.9.4
		pOusters->decreaseGoldEx(repairPrice);

		// 로그를 남긴다.
		//log(LOG_REPAIR_ITEM, pOusters->getName(), "", "ALL");

		// OK 패킷을 날려준다.
		response.setCode(NPC_RESPONSE_REPAIR_OK);
		response.setParameter(pOusters->getGold());
		pPlayer->sendPacket(&response);
	}

	if (bSendRealWearingInfo )
	{
		if (pPC->isSlayer() )
		{
			Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
			Assert(pSlayer != NULL);

			pSlayer->initAllStatAndSend();
			pSlayer->sendRealWearingInfo();
		}
		else if (pPC->isVampire() )
		{
			Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
			Assert(pVampire != NULL);

			pVampire->initAllStatAndSend();
			pVampire->sendRealWearingInfo();
		}
		else if (pPC->isOusters() )
		{
			Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
			Assert(pOusters != NULL);

			pOusters->initAllStatAndSend();
			pOusters->sendRealWearingInfo();
		}
	}

#endif

	__END_DEBUG_EX __END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:101,代码来源:CGRequestRepairHandler.cpp


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