mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-20 03:20:03 +00:00
Various bugfixes
- Eruption is now blocked by stun and sleep. - Corruption should block all nano abilities. - Buffs time out for other players - Timed mission bugfixes (AGAIN) - Corruption and Eruptions fire quicker. - Heal egg ids fix - No power nanos no longer break the system. - Mobs should no longer restun. - Mob ability chance calculation adjustments. - Duration of the power's debuff is sent as iDamage instead of 0, this removes the ugly "Block" that shows up on successful hits. - Group mob respawning bugfixes - a bit of a cleanup
This commit is contained in:
@@ -287,6 +287,11 @@ void NanoManager::summonNano(CNSocket *sock, int slot, bool silent) {
|
||||
if (slot > 2 || slot < -1)
|
||||
return; // sanity check
|
||||
|
||||
int16_t nanoID = slot == -1 ? 0 : plr->equippedNanos[slot];
|
||||
|
||||
if (slot != -1 && plr->Nanos[nanoID].iSkillID == 0)
|
||||
return; // prevent powerless nanos from summoning
|
||||
|
||||
plr->nanoDrainRate = 0;
|
||||
int16_t skillID = plr->Nanos[plr->activeNano].iSkillID;
|
||||
|
||||
@@ -299,14 +304,11 @@ void NanoManager::summonNano(CNSocket *sock, int slot, bool silent) {
|
||||
nanoUnbuff(sock, targetData, pwr.bitFlag, pwr.timeBuffID, 0,(SkillTable[skillID].targetType == 3));
|
||||
}
|
||||
|
||||
int16_t nanoID = slot == -1 ? 0 : plr->equippedNanos[slot];
|
||||
|
||||
if (nanoID > 36 || nanoID < 0)
|
||||
return; // sanity check
|
||||
|
||||
plr->activeNano = nanoID;
|
||||
sNano nano = plr->Nanos[nanoID];
|
||||
skillID = nano.iSkillID;
|
||||
skillID = plr->Nanos[nanoID].iSkillID;
|
||||
|
||||
// passive nano buffing
|
||||
if (SkillTable[skillID].drainType == 2) {
|
||||
@@ -494,6 +496,11 @@ int NanoManager::nanoStyle(int nanoID) {
|
||||
return NanoTable[nanoID].style;
|
||||
}
|
||||
|
||||
/*
|
||||
* targetData approach
|
||||
* first integer is the count
|
||||
* second to fifth integers are IDs, these can be either player iID or mob's iID
|
||||
*/
|
||||
std::vector<int> NanoManager::findTargets(Player* plr, int skillID, CNPacketData* data) {
|
||||
std::vector<int> tD(5);
|
||||
|
||||
@@ -564,10 +571,13 @@ bool doDebuff(CNSocket *sock, sSkillResult_Buff *respdata, int i, int32_t target
|
||||
|
||||
respdata[i].eCT = 4;
|
||||
respdata[i].iID = mob->appearanceData.iNPC_ID;
|
||||
respdata[i].iConditionBitFlag = mob->appearanceData.iConditionBitFlag |= bitFlag;
|
||||
mob->unbuffTimes[bitFlag] = getTime() + duration * 100;
|
||||
|
||||
std::cout << (int)mob->appearanceData.iNPC_ID << " was debuffed" << std::endl;
|
||||
respdata[i].bProtected = 1;
|
||||
if (mob->skillStyle < 0 && mob->state != MobState::RETREAT) { // only debuff if the enemy is not retreating and not casting corruption
|
||||
mob->appearanceData.iConditionBitFlag |= bitFlag;
|
||||
mob->unbuffTimes[bitFlag] = getTime() + duration * 100;
|
||||
respdata[i].bProtected = 0;
|
||||
}
|
||||
respdata[i].iConditionBitFlag = mob->appearanceData.iConditionBitFlag;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -620,15 +630,19 @@ bool doDamageNDebuff(CNSocket *sock, sSkillResult_Damage_N_Debuff *respdata, int
|
||||
|
||||
Mob* mob = MobManager::Mobs[targetID];
|
||||
|
||||
int damage = MobManager::hitMob(sock, mob, 0); // using amount for something else
|
||||
MobManager::hitMob(sock, mob, 0); // just to gain aggro
|
||||
|
||||
respdata[i].eCT = 4;
|
||||
respdata[i].iDamage = damage;
|
||||
respdata[i].iDamage = duration / 10;
|
||||
respdata[i].iID = mob->appearanceData.iNPC_ID;
|
||||
respdata[i].iHP = mob->appearanceData.iHP;
|
||||
respdata[i].iConditionBitFlag = mob->appearanceData.iConditionBitFlag |= bitFlag;
|
||||
mob->unbuffTimes[bitFlag] = getTime() + duration * 100;
|
||||
std::cout << (int)mob->appearanceData.iNPC_ID << " was debuffed" << std::endl;
|
||||
respdata[i].bProtected = 1;
|
||||
if (mob->skillStyle < 0 && mob->state != MobState::RETREAT) { // only debuff if the enemy is not retreating and not casting corruption
|
||||
mob->appearanceData.iConditionBitFlag |= bitFlag;
|
||||
mob->unbuffTimes[bitFlag] = getTime() + duration * 100;
|
||||
respdata[i].bProtected = 0;
|
||||
}
|
||||
respdata[i].iConditionBitFlag = mob->appearanceData.iConditionBitFlag;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -665,8 +679,6 @@ bool doHeal(CNSocket *sock, sSkillResult_Heal_HP *respdata, int i, int32_t targe
|
||||
respdata[i].iHP = plr->HP;
|
||||
respdata[i].iHealHP = healedAmount;
|
||||
|
||||
std::cout << (int)plr->iID << " was healed" << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -687,8 +699,6 @@ bool doDamage(CNSocket *sock, sSkillResult_Damage *respdata, int i, int32_t targ
|
||||
respdata[i].iID = mob->appearanceData.iNPC_ID;
|
||||
respdata[i].iHP = mob->appearanceData.iHP;
|
||||
|
||||
std::cout << (int)mob->appearanceData.iNPC_ID << " was damaged" << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -737,8 +747,6 @@ bool doLeech(CNSocket *sock, sSkillResult_Heal_HP *healdata, int i, int32_t targ
|
||||
damagedata->iID = mob->appearanceData.iNPC_ID;
|
||||
damagedata->iHP = mob->appearanceData.iHP;
|
||||
|
||||
std::cout << (int)mob->appearanceData.iNPC_ID << " was leeched" << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user