void ShopPointEx::AddMonsterBonus(int UserIndex, int MonsterIndex)
{
if( !this->m_IsLoaded )
{
return;
}
int MonsterSlot = this->GetMonsterSlot(gObj[MonsterIndex].Class, gObj[MonsterIndex].MapNumber);
if( MonsterSlot == -1 )
{
return;
}
gObj[UserIndex].GameShop.WCoinC += this->m_MonsterBonus[MonsterSlot].AddCoinC;
gObj[UserIndex].GameShop.WCoinP += this->m_MonsterBonus[MonsterSlot].AddCoinP;
gObj[UserIndex].GameShop.GoblinPoint += this->m_MonsterBonus[MonsterSlot].AddCoinG;
this->SendNotify(UserIndex,
this->m_MonsterBonus[MonsterSlot].AddCoinC,
this->m_MonsterBonus[MonsterSlot].AddCoinP,
this->m_MonsterBonus[MonsterSlot].AddCoinG);
}
void ShopPointEx::SendNotify(int UserIndex, int CoinC, int CoinP, int CoinG)
{
gGameShop.GDSavePoint(UserIndex);
protocol::MSG_GTOS_UPDATE_POINT_EX pMsg;
pMsg.dwUserGuid = gObj[UserIndex].DBNumber;
pMsg.dwAddPoint[0] = CoinC;
pMsg.dwAddPoint[1] = CoinP;
pMsg.dwAddPoint[2] = CoinG;
g_ShopServerClient.DataSend((PCHAR)&pMsg,sizeof(pMsg));
char Text[256];
if( CoinC > 0 )
{
ZeroMemory(Text, 255);
wsprintf(Text, "Obtained %d WCoinC", CoinC);
GCServerMsgStringSend(Text, UserIndex, 1);
}
if( CoinP > 0 )
{
ZeroMemory(Text, 255);
wsprintf(Text, "Obtained %d WCoinP", CoinP);
GCServerMsgStringSend(Text, UserIndex, 1);
}
if( CoinG > 0 )
{
ZeroMemory(Text, 255);
wsprintf(Text, "Obtained %d GoblinPoint", CoinG);
GCServerMsgStringSend(Text, UserIndex, 1);
}
}