- Joined
- Apr 9, 2012
- Messages
- 2,359
- Reaction score
- 442
Hello, this has been a problem, I almost forgot about this function
this function that let you purchase cash shop using gold was actually designed by CCR to be used on Test Server and not Open Server.
to enable the setting edit this files :
Zone Server\WorldInfo\WorldInfo.ini
and change to : BuyCashItemByGold = true
the problem happened when you purchase the item on game, it would crash the zone, it was caused by nonexistent Database Object,
there's two method to fix this crash issue:
1. For Beginner
open your zoneserver.exe using hex editor, go to offset 2ef5bf
change :
E8 46 7C D1 FF 0F B6 C0 85 C0 75
to
90 90 90 90 90 90 90 90 85 C0 EB
Pros: it's easy, fast anyone can do it without headache
Cons:
2. Using module
Pros:
here's the snippet of the module:
NOTE: this was supposed to be for Test Server, I haven't tested too deep about this, so use at your own risk, if you encounter any problem/another bug, you could write the comment bellow
this function that let you purchase cash shop using gold was actually designed by CCR to be used on Test Server and not Open Server.
to enable the setting edit this files :
Zone Server\WorldInfo\WorldInfo.ini
and change to : BuyCashItemByGold = true
the problem happened when you purchase the item on game, it would crash the zone, it was caused by nonexistent Database Object,
there's two method to fix this crash issue:
1. For Beginner
open your zoneserver.exe using hex editor, go to offset 2ef5bf
change :
E8 46 7C D1 FF 0F B6 C0 85 C0 75
to
90 90 90 90 90 90 90 90 85 C0 EB
Pros: it's easy, fast anyone can do it without headache
Cons:
- it's disabling the LOG feature
- The gold in your inventory won't be updated, say you had 1000 Gold, and you purchase something which cost 700, your inventory Gold will remain 1000 after purchase, but your actual gold in server is 300, you will be able to update your gold if you purchase/sell something on NPC, this happened because the zone didn't send packet to update the gold
2. Using module
Pros:
- you could fix/send update Gold packet
- you could even write your own log ( I haven't write the code, so I just disabled it at the moment)
here's the snippet of the module:
Code:
void _buybygold_complete(void *_this, void *pOne, void *Send, void *pRecv, void *pSrc, void *pSheet, bool bCouponUse){
//send alter money inform packet
auto p = (void (__cdecl *)(void *, char ))0x1400DF070;
p(pOne,0);
//call original function
auto ori = (void (__cdecl*)(void *, void *, void *, void *, void *, void *, bool )) 0x140300840;
return ori(_this,pOne,Send,pRecv,pSrc,pSheet,bCouponUse);
}
bool CallProc_InsertCashItemLog(void *_this, unsigned int dwSerial, char byLv, char *szItemCode, char *szItemName, char byNum, unsigned int dwCost)
{
//disable log, you had to write your own log/database connection yourself
return true;
}
void CCashByGold::Init()
{
WriteInstruction(0x140001FCD,(INT64)_buybygold_complete,0,0xE9);
WriteInstruction(0x140007E0A,(INT64)CallProc_InsertCashItemLog,0,0xE9);
}
NOTE: this was supposed to be for Test Server, I haven't tested too deep about this, so use at your own risk, if you encounter any problem/another bug, you could write the comment bellow