Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

[Feature Request] Teaching process with other coins #1152

Open canerksk opened 11 months ago

canerksk commented 11 months ago

Teaching with other currencies available on the server can be added.

eg;

if ( pItem->IsType(IT_GOLD) )
{
    CItemMemory *pMemory = Memory_FindObj(pCharSrc);
    if ( pMemory )
    {
        switch ( pMemory->m_itEqMemory.m_Action )
        {
            case NPC_MEM_ACT_SPEAK_TRAIN:
                return NPC_OnTrainPay(pCharSrc, pMemory, pItem);
            case NPC_MEM_ACT_SPEAK_HIRE:
                return NPC_OnHirePay(pCharSrc, pMemory, pItem);
            default:
                break;
        }
    }
}

if (pItem->GetDispID() == ITEMID_SILVER_C1)
{
    CItemMemory* pMemory = Memory_FindObj(pCharSrc);
    if (pMemory)
    {
        switch (pMemory->m_itEqMemory.m_Action)
        {
        case NPC_MEM_ACT_SPEAK_TRAIN:
            return NPC_OnTrainPay(pCharSrc, pMemory, pItem);
        default:
            break;
        }
    }
}

if (pItem->GetDispID() == ITEMID_COPPER_C1)
{
    CItemMemory* pMemory = Memory_FindObj(pCharSrc);
    if (pMemory)
    {
        switch (pMemory->m_itEqMemory.m_Action)
        {
        case NPC_MEM_ACT_SPEAK_TRAIN:
            return NPC_OnTrainPay(pCharSrc, pMemory, pItem);
        default:
            break;
        }
    }
}

// Giving item to own pet

The codes here are purely examples. Although many have been tested, some may need to be rewritten.

xwerswoodx commented 11 months ago

You can just set Silver Coins and Copper Coins as a type of T_GOLD, I am not sure if we need this.