mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-12-23 11:50:04 +00:00
Reverting back some changes + Tweaks
This commit is contained in:
parent
2b25b17bd8
commit
28276d2229
@ -286,13 +286,7 @@ void ItemManager::itemUseHandler(CNSocket* sock, CNPacketData* data) {
|
||||
resp->RemainItem = gumball;
|
||||
resp->iTargetCnt = 1;
|
||||
resp->eST = EST_NANOSTIMPAK;
|
||||
|
||||
if (request->iNanoSlot == 1)
|
||||
resp->iSkillID = 191;
|
||||
else if (request->iNanoSlot == 2)
|
||||
resp->iSkillID = 197;
|
||||
else
|
||||
resp->iSkillID = 144;
|
||||
resp->iSkillID = 144;
|
||||
|
||||
int value1 = CSB_BIT_STIMPAKSLOT1 << request->iNanoSlot;
|
||||
int value2 = ECSB_STIMPAKSLOT1 + request->iNanoSlot;
|
||||
@ -312,8 +306,8 @@ void ItemManager::itemUseHandler(CNSocket* sock, CNPacketData* data) {
|
||||
// update inventory serverside
|
||||
player->Inven[resp->iSlotNum] = resp->RemainItem;
|
||||
|
||||
std::pair<CNSocket*, int32_t> key = std::make_pair(sock, resp->iSkillID);
|
||||
time_t until = getTime() + (time_t)NanoManager::SkillTable[resp->iSkillID].durationTime[0] * 10;
|
||||
std::pair<CNSocket*, int32_t> key = std::make_pair(sock, value1);
|
||||
time_t until = getTime() + (time_t)NanoManager::SkillTable[144].durationTime[0] * 10;
|
||||
NPCManager::EggBuffs[key] = until;
|
||||
}
|
||||
|
||||
|
@ -578,12 +578,14 @@ int NPCManager::eggBuffPlayer(CNSocket* sock, int skillId, int eggId) {
|
||||
if (otherPlr == nullptr)
|
||||
return -1;
|
||||
|
||||
std::pair<CNSocket*, int32_t> key = std::make_pair(sock, skillId);
|
||||
int CBFlag = 0;
|
||||
int bitFlag = GroupManager::getGroupFlags(otherPlr);
|
||||
|
||||
if (EggBuffs.find(key) == EggBuffs.end())
|
||||
if (!NanoManager::applyBuff(sock, skillId, 1, 3, bitFlag))
|
||||
return -1;
|
||||
CBFlag = NanoManager::applyBuff(sock, skillId, 1, 3, bitFlag);
|
||||
if (CBFlag == 0)
|
||||
return -1;
|
||||
|
||||
std::pair<CNSocket*, int32_t> key = std::make_pair(sock, CBFlag);
|
||||
|
||||
// save the buff serverside;
|
||||
// if you get the same buff again, new duration will override the previous one
|
||||
@ -629,15 +631,25 @@ void NPCManager::eggStep(CNServer* serv, time_t currTime) {
|
||||
// if time reached 0
|
||||
else {
|
||||
CNSocket* sock = it->first.first;
|
||||
int32_t skillId = it->first.second;
|
||||
int32_t CBFlag = it->first.second;
|
||||
Player* plr = PlayerManager::getPlayer(sock);
|
||||
Player* otherPlr = PlayerManager::getPlayerFromID(plr->iIDGroup);
|
||||
|
||||
if (otherPlr == nullptr)
|
||||
return;
|
||||
continue;
|
||||
|
||||
int bitFlag = GroupManager::getGroupFlags(otherPlr);
|
||||
NanoManager::applyBuff(sock, skillId, 2, 3, bitFlag);
|
||||
int groupFlags = GroupManager::getGroupFlags(otherPlr);
|
||||
for (auto& pwr : NanoManager::NanoPowers) {
|
||||
if (pwr.bitFlag == CBFlag) {
|
||||
INITSTRUCT(sP_FE2CL_PC_BUFF_UPDATE, resp);
|
||||
resp.eCSTB = pwr.timeBuffID;
|
||||
resp.eTBU = 2;
|
||||
resp.eTBT = 3; // for egg buffs
|
||||
plr->iConditionBitFlag &= ~CBFlag;
|
||||
resp.iConditionBitFlag = plr->iConditionBitFlag |= groupFlags | plr->iSelfConditionBitFlag;
|
||||
sock->sendPacket((void*)&resp, P_FE2CL_PC_BUFF_UPDATE, sizeof(sP_FE2CL_PC_BUFF_UPDATE));
|
||||
}
|
||||
}
|
||||
// remove buff from the map
|
||||
it = EggBuffs.erase(it);
|
||||
}
|
||||
|
@ -305,15 +305,9 @@ void NanoManager::summonNano(CNSocket *sock, int slot) {
|
||||
if (SkillTable[skillID].drainType == 2) {
|
||||
int *targetData = findTargets(plr, skillID);
|
||||
|
||||
int boost = 0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (plr->equippedNanos[i] == plr->activeNano)
|
||||
if (plr->iConditionBitFlag & (CSB_BIT_STIMPAKSLOT1 << i))
|
||||
boost = 1;
|
||||
|
||||
for (auto& pwr : NanoPowers)
|
||||
if (pwr.skillType == SkillTable[skillID].skillType)
|
||||
nanoUnbuff(sock, targetData, pwr.bitFlag, pwr.timeBuffID, SkillTable[skillID].powerIntensity[boost],(SkillTable[skillID].targetType == 3));
|
||||
for (auto& pwr : NanoPowers)
|
||||
if (pwr.skillType == SkillTable[skillID].skillType)
|
||||
nanoUnbuff(sock, targetData, pwr.bitFlag, pwr.timeBuffID, 0,(SkillTable[skillID].targetType == 3));
|
||||
}
|
||||
|
||||
int16_t nanoID = slot == -1 ? 0 : plr->equippedNanos[slot];
|
||||
@ -480,9 +474,9 @@ void NanoManager::nanoUnbuff(CNSocket* sock, int targetData[], int32_t bitFlag,
|
||||
}
|
||||
}
|
||||
|
||||
bool NanoManager::applyBuff(CNSocket* sock, int skillID, int eTBU, int eTBT, int32_t groupFlags) {
|
||||
int NanoManager::applyBuff(CNSocket* sock, int skillID, int eTBU, int eTBT, int32_t groupFlags) {
|
||||
if (SkillTable[skillID].drainType == 1)
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
int32_t bitFlag = 0;
|
||||
|
||||
@ -496,30 +490,20 @@ bool NanoManager::applyBuff(CNSocket* sock, int skillID, int eTBU, int eTBT, int
|
||||
resp.eTBU = eTBU;
|
||||
resp.eTBT = eTBT;
|
||||
|
||||
if (skillID == 191) { // dealing with gumballs
|
||||
resp.eCSTB = pwr.timeBuffID + 1;
|
||||
bitFlag = bitFlag << 1;
|
||||
} else if (skillID == 197) {
|
||||
resp.eCSTB = pwr.timeBuffID + 2;
|
||||
bitFlag = bitFlag << 2;
|
||||
}
|
||||
|
||||
if (eTBU == 1)
|
||||
plr->iConditionBitFlag |= bitFlag;
|
||||
else
|
||||
plr->iConditionBitFlag &= ~bitFlag;
|
||||
|
||||
resp.iConditionBitFlag = plr->iConditionBitFlag |= groupFlags | plr->iSelfConditionBitFlag;
|
||||
|
||||
resp.TimeBuff.iValue = SkillTable[skillID].powerIntensity[0];
|
||||
|
||||
sock->sendPacket((void*)&resp, P_FE2CL_PC_BUFF_UPDATE, sizeof(sP_FE2CL_PC_BUFF_UPDATE));
|
||||
}
|
||||
return true;
|
||||
return bitFlag;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0=A 1=B 2=C -1=Not found
|
||||
|
@ -65,7 +65,7 @@ namespace NanoManager {
|
||||
void setNanoSkill(CNSocket* sock, sP_CL2FE_REQ_NANO_TUNE* skill);
|
||||
void resetNanoSkill(CNSocket* sock, int16_t nanoID);
|
||||
void nanoUnbuff(CNSocket* sock, int* targetData, int32_t bitFlag, int16_t timeBuffID, int16_t amount, bool groupPower);
|
||||
bool applyBuff(CNSocket* sock, int skillID, int eTBU, int eTBT, int32_t groupFlags);
|
||||
int applyBuff(CNSocket* sock, int skillID, int eTBU, int eTBT, int32_t groupFlags);
|
||||
int nanoStyle(int nanoID);
|
||||
int* findTargets(Player* plr, int skillID, CNPacketData* data = nullptr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user