cgshoprequestlisthandler.cpp
来自「dk1游戏的原代码文件,完整.编译系统redhat7.3,mysql 3.23 」· C++ 代码 · 共 121 行
CPP
121 行
//////////////////////////////////////////////////////////////////////////////// Filename : CGShopRequestListHandler.cpp// Written By : 辫己刮// Description : CGShopRequestList狼 勤甸矾捞促.//////////////////////////////////////////////////////////////////////////////#include "CGShopRequestList.h"#ifdef __GAME_SERVER__ #include "GamePlayer.h" #include "NPC.h" #include "quest/TriggerManager.h" #include "quest/Trigger.h" #include "quest/Condition.h" #include "quest/Action.h" #include "Gpackets/GCNPCResponse.h" #include "Gpackets/GCShopList.h" #include "Gpackets/GCShopListMysterious.h"#endif////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void CGShopRequestListHandler::execute(CGShopRequestList* pPacket , Player* pPlayer) throw (ProtocolException , Error){ __BEGIN_TRY __BEGIN_DEBUG_EX#ifdef __GAME_SERVER__ Assert(pPacket != NULL); Assert(pPlayer != NULL); // 菩哦俊辑 沥焊甫 惶酒辰促. ObjectID_t NPCID = pPacket->getObjectID(); ShopRackType_t type = pPacket->getRackType(); // 颇扼固磐 棺 菩哦俊辑 惶酒辰 沥焊甫 啊傍 GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer); Creature* pPC = pGamePlayer->getCreature(); Zone* pZone = pPC->getZone(); Creature* pNPCBase = NULL; /* try { pNPCBase = pZone->getCreature(NPCID); } catch (NoSuchElementException & nsee) { pNPCBase = NULL; } */ // NoSuch力芭. by sigi. 2002.5.2 pNPCBase = pZone->getCreature(NPCID); if (pNPCBase == NULL || pNPCBase->isNPC() == false) { GCNPCResponse gcNPCResponse; pPlayer->sendPacket(&gcNPCResponse); return; } NPC* pNPC = dynamic_cast<NPC*>(pNPCBase); if (type == SHOP_RACK_SPECIAL) { // 惑前狼 府胶飘甫 菩哦俊促 累己茄促. GCShopList pkt; pkt.setNPCShopType(pNPC->getShopType()); pkt.setObjectID(NPCID); pkt.setShopVersion(pNPC->getShopVersion(type)); pkt.setShopType(type); for (BYTE i=0; i<SHOP_RACK_INDEX_MAX; i++) { // 阿阿狼 酒捞袍 沥焊甫 利绰促. Item* pItem = pNPC->getShopItem(type, i); if (pItem != NULL) pkt.setShopItem(i, pItem); } pkt.setMarketCondBuy(pNPC->getMarketCondBuy()); pkt.setMarketCondSell(pNPC->getMarketCondSell()); // 菩哦阑 焊郴磊. pPlayer->sendPacket(&pkt); } else if (type == SHOP_RACK_MYSTERIOUS) { // 惑前狼 府胶飘甫 菩哦俊促 累己茄促. GCShopListMysterious pkt; pkt.setObjectID(NPCID); pkt.setShopVersion(pNPC->getShopVersion(type)); pkt.setShopType(type); for (BYTE i=0; i<SHOP_RACK_INDEX_MAX; i++) { // 阿阿狼 酒捞袍 沥焊甫 利绰促. Item* pItem = pNPC->getShopItem(type, i); if (pItem != NULL) pkt.setShopItem(i, pItem); } pkt.setMarketCondBuy(pNPC->getMarketCondBuy()); pkt.setMarketCondSell(pNPC->getMarketCondSell()); // 菩哦阑 焊郴磊. pPlayer->sendPacket(&pkt); } else { throw ProtocolException("NORMAL shop item list not allowed!!!"); }#endif __END_DEBUG_EX __END_CATCH}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?