National Points Shop [18xx]

  • Konbuyu başlatan Konbuyu başlatan jarmen
  • Başlangıç tarihi Başlangıç tarihi
Kayıtlı Üye
Katılım
2 Eylül 2012
Mesajlar
571
  1. uint32 m_iNPBuyPrice;void CUser::ItemTrade(Packet & pkt)







    Kod:
    else if (type == 1 && pNpc->m_iSellingGroup == 249000)
    
    { 
    
    if (m_sItemArray[SLOT_MAX+pos].nNum != 0)
    
    {
    
    if (m_sItemArray[SLOT_MAX+pos].nNum != itemid)
    
    {
    
    errorCode = 2;
    
    goto fail_return;
    
    }
    
    
    
    
    
    if (!pTable->m_bCountable || count <= 0)
    
    {
    
    errorCode = 2;
    
    goto fail_return;
    
    }
    
    
    
    
    
    if (pTable->m_bCountable 
    
    && (count + m_sItemArray[SLOT_MAX+pos].sCount) > MAX_ITEM_COUNT)
    
    {
    
    errorCode = 4;
    
    goto fail_return; 
    
    }
    
    }
    
    transactionPrice = ((uint32)pTable->m_iNPBuyPrice * count);
    
    
    
    
    
    if(pTable->m_bSellingGroup == 0)
    
    {
    
    errorCode = 3;
    
    goto fail_return;
    
    }
    
    
    
    
    
    if (!hasLoyalty(transactionPrice))
    
    {
    
    errorCode = 3;
    
    goto fail_return;
    
    }
    
    
    
    
    
    if (((pTable->m_sWeight * count) + m_sItemWeight) > m_sMaxWeight)
    
    {
    
    errorCode = 4;
    
    goto fail_return;
    
    }
    
    
    
    
    
    m_sItemArray[SLOT_MAX+pos].nNum = itemid;
    
    m_sItemArray[SLOT_MAX+pos].sDuration = pTable->m_sDuration;
    
    m_sItemArray[SLOT_MAX+pos].sCount += count;
    
    
    
    
    
    m_iLoyalty -= transactionPrice;
    
    
    
    
    
    if (!pTable->m_bCountable)
    
    m_sItemArray[SLOT_MAX+pos].nSerialNum = g_pMain->GenerateItemSerial();
    
    
    
    
    
    SetUserAbility(false);
    
    SendItemWeight();
    
    }
    
    else if (type == 2 && pNpc->m_iSellingGroup == 249000)
    
    goto fail_return;
    
    .
    
    .
    
    .
    
    fail_return: 
    
    result << bSuccess;
    
    if (!bSuccess)
    
    result << errorCode;
    
    else if (pNpc->m_iSellingGroup == 249000 && bSuccess)
    
    result << pTable->m_bSellingGroup << m_iLoyalty << transactionPrice;
    
    else if (pNpc->m_iSellingGroup != 249000 && bSuccess)
    
    result << pTable->m_bSellingGroup << m_iGold << transactionPrice; // price bought or sold for




    ALINTIDIR



    Credits by Christian!
 
Kayıtlı Üye
Katılım
9 Mart 2012
Mesajlar
240
Cevap: National Points Shop [18xx]



teşekkürler
 
Üst Alt
Reklam
Reklam