mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-05 00:40:07 +00:00
Moved Debuff handling to Combat + Bugfixes
* Majority of mob debuff handling is moved to combatStep(). * Drain now kills the mob and does 40% overall damage. * Bumped up active nano debuff durations, debuffs like drain linger longer but damage less. * Debuffs are cleared upon mob death and retreating. * Patched out vehicle off success packet spam * Boosts and potions now cost the right amount (100 taros) and give the right quantity (100). * Damage was tweaked slightly. At higher levels you are more likely to fall prey to rand(). * Enemies now use run animations during combat and retreating.
This commit is contained in:
@@ -406,16 +406,16 @@ void NPCManager::npcVendorBuyBattery(CNSocket* sock, CNPacketData* data) {
|
||||
if (plr == nullptr)
|
||||
return;
|
||||
|
||||
int cost = req->Item.iOpt * 10;
|
||||
int cost = req->Item.iOpt * 100;
|
||||
if ((req->Item.iID == 3 ? (plr->batteryW >= 9999) : (plr->batteryN >= 9999)) || plr->money < cost) { // sanity check
|
||||
INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_BATTERY_BUY_FAIL, failResp);
|
||||
failResp.iErrorCode = 0;
|
||||
sock->sendPacket((void*)&failResp, P_FE2CL_REP_PC_VENDOR_BATTERY_BUY_FAIL, sizeof(sP_FE2CL_REP_PC_VENDOR_BATTERY_BUY_FAIL));
|
||||
}
|
||||
|
||||
plr->money -= cost;
|
||||
plr->batteryW += req->Item.iID == 3 ? req->Item.iOpt * 10 : 0;
|
||||
plr->batteryN += req->Item.iID == 4 ? req->Item.iOpt * 10 : 0;
|
||||
cost = plr->batteryW + plr->batteryN;
|
||||
plr->batteryW += req->Item.iID == 3 ? req->Item.iOpt * 100 : 0;
|
||||
plr->batteryN += req->Item.iID == 4 ? req->Item.iOpt * 100 : 0;
|
||||
|
||||
// caps
|
||||
if (plr->batteryW > 9999)
|
||||
@@ -423,6 +423,9 @@ void NPCManager::npcVendorBuyBattery(CNSocket* sock, CNPacketData* data) {
|
||||
if (plr->batteryN > 9999)
|
||||
plr->batteryN = 9999;
|
||||
|
||||
cost = plr->batteryW + plr->batteryN - cost;
|
||||
plr->money -= cost;
|
||||
|
||||
INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_BATTERY_BUY_SUCC, resp);
|
||||
|
||||
resp.iCandy = plr->money;
|
||||
|
||||
Reference in New Issue
Block a user