BOOL NpcAdniel(LPOBJ lpNpc,LPOBJ lpObj ) { if ( bCanChaosBox == TRUE ) { PMSG_TALKRESULT pMsg; pMsg.h.c = 0xC3; pMsg.h.headcode = 0x30; pMsg.h.size = sizeof(pMsg); if ( lpObj->m_bPShopOpen == true ) { LogAdd("[%s][%s] is Already Opening PShop, ChaosBox Failed", lpObj->AccountID, lpObj->Name); GCServerMsgStringSend(lMsg.Get(MSGGET(4, 194)), lpObj->m_Index, 1); return TRUE; } lpObj->m_IfState.type = 7; lpObj->m_IfState.state = 0; lpObj->m_IfState.use = 1; // 39 - entering acheron // 40 - arca war npc // 41 - mix npc pMsg.result = 41; lpObj->bIsChaosMixCompleted = false; pMsg.level1 = gDQChaosSuccessRateLevel1; pMsg.level2 = gDQChaosSuccessRateLevel2; pMsg.level3 = gDQChaosSuccessRateLevel3; pMsg.level4 = gDQChaosSuccessRateLevel4; pMsg.level5 = gDQChaosSuccessRateLevel5; pMsg.level6 = gDQChaosSuccessRateLevel6; DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size); GCAnsCsMapSvrTaxInfo(lpObj->m_Index, 1, g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index)); gObjInventoryTrans(lpObj->m_Index); LogAddTD("[%s][%s] Open Chaos Box", lpObj->AccountID, lpObj->Name); gObjItemTextSave(lpObj); gObjWarehouseTextSave(lpObj); } return true; }
BOOL NpcChaosCardMaster(LPOBJ lpNpc, LPOBJ lpObj) { if ( g_bUseLotterySystem == FALSE ) return FALSE; if ( bCanChaosBox == TRUE ) { if ( lpObj->m_IfState.use > 0 ) return FALSE; if ( lpObj->m_bPShopOpen == true ) { LogAdd("[%s][%s] is Already Opening PShop, ChaosBox Failed", lpObj->AccountID, lpObj->Name); GCServerMsgStringSend(lMsg.Get(MSGGET(4,194)), lpObj->m_Index, 1); return TRUE; } PMSG_TALKRESULT pMsg; pMsg.h.c = 0xC3; pMsg.h.headcode = 0x30; pMsg.h.size = sizeof(pMsg); pMsg.result = 0x15; DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size); lpObj->m_IfState.use = 1; lpObj->m_IfState.type = 7; gObjInventoryTrans(lpObj->m_Index); LogAddTD("[JewelMix] [%s][%s] Jewel Mix Dealer Start", lpObj->AccountID, lpObj->Name); gObjItemTextSave(lpObj); gObjWarehouseTextSave(lpObj); } return TRUE; }
BOOL NpcElderCircle(LPOBJ lpNpc, LPOBJ lpObj) { if ( (lpObj->m_IfState.use ) > 0 ) { return TRUE; } #if(GS_CASTLE==1) if(g_CastleSiege.GetCastleState() == 7) //Good { ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 85))), lpObj->m_Index); return TRUE; } //0001:001d2150 _strcmp 005d3150 f libcmt:strcmp.obj if(strcmp(lpObj->GuildName, "") == 0 ) //Good { ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 86))), lpObj->m_Index); return TRUE; } if(g_CastleSiege.CheckGuildOwnCastle(lpObj->GuildName)) //Good { if( lpObj->GuildStatus != 128 ) { if ( lpObj->GuildStatus != 64 ) { ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 86))), lpObj->m_Index); return TRUE; } } } #endif PMSG_TALKRESULT pMsg; pMsg.h.c = 0xC3; pMsg.h.headcode = 0x30; pMsg.h.size = sizeof(pMsg); pMsg.result = 0x0C; lpObj->m_IfState.use = 1; lpObj->m_IfState.type = 12; #if(GS_CASTLE==1) pMsg.level1 = 0; pMsg.level2 = 0; pMsg.level3 = 0; pMsg.level4 = 0; pMsg.level5 = 0; pMsg.level6 = 0; if( bCanChaosBox == TRUE) //Good { lpObj->m_IfState.type = 7; lpObj->bIsChaosMixCompleted = false; lpObj->m_bCsGuildInvolved = false; //Good pMsg.level1 = 1; //Good GCAnsCsMapSvrTaxInfo(lpObj->m_Index, 1, g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index)); gObjInventoryTrans(lpObj->m_Index); LogAddTD("[%s][%s] Open Chaos Box", lpObj->AccountID, lpObj->Name); gObjItemTextSave(lpObj); gObjWarehouseTextSave(lpObj); } #endif DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size); return TRUE; }
BOOL CJewelOfHarmonySystem::NpcJewelOfHarmony(LPOBJ lpNpc, LPOBJ lpObj) { if ( lpObj->m_IfState.use > 0 ) return TRUE; PMSG_TALKRESULT pResult; pResult.h.c = 0xC3; pResult.h.headcode = 0x30; pResult.h.size = sizeof(pResult); if ( lpNpc->Class == 368 ) { pResult.result = 17; pResult.level1 = this->m_iRatePuritySuccess; if ( this->m_bSystemPrutiyJewel != TRUE ) { GCServerMsgStringSend(lMsg.Get(MSGGET(13,50)), lpObj->m_Index, 1); return TRUE; } if ( !this->IsEnableToUsePuritySystem() ) { GCServerMsgStringSend(lMsg.Get(MSGGET(13,50)), lpObj->m_Index, 1); CLog.LogAdd("[JewelOfHarmony][%s][%s] Not Purtiy Time ", lpObj->AccountID, lpObj->Name); return TRUE; } } else if ( lpNpc->Class == 369 ) { pResult.result = 18; pResult.level1 = this->m_iRateMixSmeltingStoneNor; pResult.level2 = this->m_iRateMixSmeltingStoneExt; if ( this->m_bSystemMixSmeltingStone != TRUE ) { ChatTargetSend(lpNpc, lMsg.Get(MSGGET(13,53)), lpObj->m_Index); return TRUE; } } else if ( lpNpc->Class == 370 ) { pResult.result = 19; if ( this->m_bSystemRestoreStrengthen != TRUE ) { ChatTargetSend(lpNpc, lMsg.Get(MSGGET(13,54)), lpObj->m_Index); return TRUE; } } else { CLog.LogAdd("[JewelOfHarmony][%s][%s] Open Chaos Box Failed NpcType [%d]", lpObj->AccountID, lpObj->Name, lpNpc->Class); return TRUE; } if ( bCanChaosBox == TRUE ) { if ( lpObj->m_bPShopOpen == true ) { CLog.LogAdd("[JewelOfHarmony][%s][%s] is Already Opening PShop, ChaosBox Failed", lpObj->AccountID, lpObj->Name); GCServerMsgStringSend(lMsg.Get(MSGGET(4,194)), lpObj->m_Index, 1); return TRUE; } lpObj->m_IfState.type = 7; lpObj->m_IfState.state = 0; lpObj->m_IfState.use = 1; lpObj->bIsChaosMixCompleted = false; gSendProto.DataSend(lpObj->m_Index, (LPBYTE)&pResult, pResult.h.size); gObjInventoryTrans(lpObj->m_Index); CLog.LogAdd("[JewelOfHarmony][%s][%s] Open Chaos Box", lpObj->AccountID, lpObj->Name); gObjItemTextSave(lpObj); gObjWarehouseTextSave(lpObj); GCAnsCsMapSvrTaxInfo(lpObj->m_Index, 1, g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index)); } return TRUE; }
BOOL NpcElderCircle(LPOBJ lpNpc, LPOBJ lpObj) { #if (GS_CASTLE == 1) if ( (lpObj->m_IfState.use ) > 0 ) { return TRUE; } if( g_CastleSiege.GetCastleState() == CASTLESIEGE_STATE_STARTSIEGE) { ChatTargetSend(lpNpc,lMsg.Get(MSGGET(6,85)),lpObj->m_Index); return TRUE; } if( strcmp(lpObj->GuildName,"") == NULL) { ChatTargetSend(lpNpc,lMsg.Get(MSGGET(6,86)),lpObj->m_Index); return TRUE; } if( g_CastleSiege.CheckGuildOwnCastle(lpObj->GuildName) == FALSE || (lpObj->GuildStatus != G_MASTER && lpObj->GuildStatus != G_SUB_MASTER)) { ChatTargetSend(lpNpc,lMsg.Get(MSGGET(6,86)),lpObj->m_Index); return TRUE; } PMSG_TALKRESULT pMsg; pMsg.h.c = 0xC3; pMsg.h.headcode = 0x30; pMsg.h.size = sizeof(pMsg); pMsg.result = 0x0C; lpObj->m_IfState.use = 1; lpObj->m_IfState.type = 12; pMsg.level1 = 0; pMsg.level2 = 0; pMsg.level3 = 0; pMsg.level4 = 0; pMsg.level5 = 0; pMsg.level6 = 0; if( bCanChaosBox == TRUE ) { lpObj->m_IfState.type = 7; lpObj->bIsChaosMixCompleted = FALSE; pMsg.level1 = 1; GCAnsCsMapSvrTaxInfo(lpObj->m_Index,1,g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index)); gObjInventoryTrans(lpObj->m_Index); LogAddTD("[%s][%s] Open Chaos Box", lpObj->AccountID,lpObj->Name); gObjItemTextSave(lpObj); gObjWarehouseTextSave(lpObj); } DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size); #endif return TRUE; }