Member
- Sep
- Threads
- 6
- 55
- 1
- 2
- 8
AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!
Hi team,
I am having issue with the DR voucher. I have tried it with cash or with coins ( I use coins as DR ) , but nothing, the items don't work.
I have tried different option, I try to provide you as much information I can.
1. Option
I have the function for cash already implemented in source:
game > questlua_pc.cpp
db > ClientManager.cpp
When I go in the client, login and use the item: 80014 or 80015 or 80016 , I can select "Yes" or "Not" ( I NEVER IMPLEMENTED THIS, I DON'T KNOW T_T)
If I select "Yes" item is still there, nothing happen, Cash in account is still 0.
In the FTP main > quest , I don't see any quests for charge so I added it in quest and used ./qc
quest added:
After this, still nothing happen.
I also tried to change in source > db > ClientManager.cpp (cash to coins) ( same in the quest) but still same
Please do you know what I am missing? thank you in advance
I am having issue with the DR voucher. I have tried it with cash or with coins ( I use coins as DR ) , but nothing, the items don't work.
I have tried different option, I try to provide you as much information I can.
1. Option
I have the function for cash already implemented in source:
game > questlua_pc.cpp
ALUA(pc_charge_cash)
{
TRequestChargeCash packet;
int amount = lua_isnumber(L, 1) ? (int)lua_tonumber(L, 1) : 0;
std::string strChargeType = lua_isstring(L, 2) ? lua_tostring(L, 2) : "";
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (NULL == ch || NULL == ch->GetDesc() || 1 > amount || 50000 < amount)
{
lua_pushboolean(L, 0);
return 1;
}
packet.dwAID = ch->GetDesc()->GetAccountTable().id;
packet.dwAmount = (DWORD)amount;
packet.eChargeType = ERequestCharge_Cash;
if (0 < strChargeType.length())
std::transform(strChargeType.begin(), strChargeType.end(), strChargeType.begin(), (int(*)(int))std::tolower);
if ("mileage" == strChargeType)
packet.eChargeType = ERequestCharge_Mileage;
db_clientdesc->DBPacketHeader(HEADER_GD_REQUEST_CHARGE_CASH, 0, sizeof(TRequestChargeCash));
db_clientdesc->Packet(&packet, sizeof(packet));
lua_pushboolean(L, 1);
return 1;
}
db > ClientManager.cpp
void CClientManager::ChargeCash(const TRequestChargeCash* packet)
{
char szQuery[512];
if (ERequestCharge_Cash == packet->eChargeType)
sprintf(szQuery, "update account set cash = cash + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);
else if(ERequestCharge_Mileage == packet->eChargeType)
sprintf(szQuery, "update account set mileage = mileage + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);
else
{
sys_err ("Invalid request charge type (type : %d, amount : %d, aid : %d)", packet->eChargeType, packet->dwAmount, packet->dwAID);
return;
}
sys_err ("Request Charge (type : %d, amount : %d, aid : %d)", packet->eChargeType, packet->dwAmount, packet->dwAID);
CDBManager::Instance().AsyncQuery(szQuery, SQL_ACCOUNT);
}
When I go in the client, login and use the item: 80014 or 80015 or 80016 , I can select "Yes" or "Not" ( I NEVER IMPLEMENTED THIS, I DON'T KNOW T_T)
If I select "Yes" item is still there, nothing happen, Cash in account is still 0.
In the FTP main > quest , I don't see any quests for charge so I added it in quest and used ./qc
quest added:
Font:quest charge_cash_by_voucher begin
state start begin
function charge(amount, charge_type)
if charge_type == nil then
charge_type = "cash"
end
if 0 < amount then
-- syntax : pc.charge_cash(amount, charge_type)
-- warning: 1. 'charge_type' : "cash"(default) | "mileage"
-- 2. 'amount' must be positive number.
local result = pc.charge_cash(amount, charge_type)
if true == result then
local item_id = item.get_id()
char_log(item_id, "CHARGE_CASH_BY_VOUCHER", amount)
syschat(string.format(gameforge.charge_cash_by_voucher._010_syschat, amount))
local flag_name = "total_" .. charge_type
pc.setqf(flag_name, pc.getqf(flag_name) + amount)
item.remove()
end
end
return false
end
when 80014.use or 80015.use or 80016.use or 80017.use begin
local amount = item.get_value(0)
charge_cash_by_voucher.charge(amount, "cash")
end
end
end
To see the download links,
Log in or register now.
After this, still nothing happen.
I also tried to change in source > db > ClientManager.cpp (cash to coins) ( same in the quest) but still same
if (ERequestCharge_Cash == packet->eChargeType)
sprintf(szQuery, "update account set coins = coins + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);
Please do you know what I am missing? thank you in advance

