Sphereserver / Source-X

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

[Feature Request] New trigger: @Deposit #1150

Open canerksk opened 11 months ago

canerksk commented 11 months ago

A trigger can be added that is triggered when we convert physical money into virtual money. Thus, critical currencies on the servers can be logged more easily or can be useful for a specially written bank account system.

eg;

                if ((g_Cfg.m_iFeatureTOL & FEATURE_TOL_VIRTUALGOLD) && (pItem->IsType(IT_GOLD) || pItem->GetDispID() == ITEMID_COPPER_C1 || pItem->GetDispID() == ITEMID_SILVER_C1))
                {
                    if (IsTrigUsed(TRIGGER_DEPOSIT))
                    {
                        CScriptTriggerArgs args;
                        args.m_pO1 = pItem;
                        if (m_pChar->OnTrigger(CTRIG_Deposit, this, &args) == TRIGRET_RET_TRUE)
                        {
                            Event_Item_Drop_Fail(pItem);
                            return;
                        }
                    }
                }

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