mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-17 03:20:06 +00:00
some struct reorg
This commit is contained in:
parent
4ec3a3acb7
commit
536d5fbcfa
@ -8,6 +8,15 @@
|
|||||||
|
|
||||||
std::map<int32_t, SkillData> Abilities::SkillTable;
|
std::map<int32_t, SkillData> Abilities::SkillTable;
|
||||||
|
|
||||||
namespace Abilities {
|
/*
|
||||||
|
// New email notification
|
||||||
|
static void emailUpdateCheck(CNSocket* sock, CNPacketData* data) {
|
||||||
|
INITSTRUCT(sP_FE2CL_REP_PC_NEW_EMAIL, resp);
|
||||||
|
resp.iNewEmailCnt = Database::getUnreadEmailCount(PlayerManager::getPlayer(sock)->iID);
|
||||||
|
sock->sendPacket(resp, P_FE2CL_REP_PC_NEW_EMAIL);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}; // namespace
|
void Abilities::init() {
|
||||||
|
//REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_EMAIL_UPDATE_CHECK, emailUpdateCheck);
|
||||||
|
}
|
||||||
|
@ -5,14 +5,21 @@
|
|||||||
|
|
||||||
struct SkillData {
|
struct SkillData {
|
||||||
int skillType;
|
int skillType;
|
||||||
|
int effectTarget;
|
||||||
|
int effectType;
|
||||||
int targetType;
|
int targetType;
|
||||||
int drainType;
|
int batteryDrainType;
|
||||||
int effectArea;
|
int effectArea;
|
||||||
|
|
||||||
int batteryUse[4];
|
int batteryUse[4];
|
||||||
int durationTime[4];
|
int durationTime[4];
|
||||||
int powerIntensity[4];
|
|
||||||
|
int valueTypes[3];
|
||||||
|
int values[3][4];
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Abilities {
|
namespace Abilities {
|
||||||
extern std::map<int32_t, SkillData> SkillTable;
|
extern std::map<int32_t, SkillData> SkillTable;
|
||||||
|
|
||||||
|
void init();
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ int Eggs::eggBuffPlayer(CNSocket* sock, int skillId, int eggId, int duration) {
|
|||||||
memset(respbuf, 0, resplen);
|
memset(respbuf, 0, resplen);
|
||||||
skill->eCT = 1;
|
skill->eCT = 1;
|
||||||
skill->iID = plr->iID;
|
skill->iID = plr->iID;
|
||||||
skill->iDamage = PC_MAXHEALTH(plr->level) * Abilities::SkillTable[skillId].powerIntensity[0] / 1000;
|
skill->iDamage = PC_MAXHEALTH(plr->level) * Abilities::SkillTable[skillId].values[0][0] / 1000;
|
||||||
plr->HP -= skill->iDamage;
|
plr->HP -= skill->iDamage;
|
||||||
if (plr->HP < 0)
|
if (plr->HP < 0)
|
||||||
plr->HP = 0;
|
plr->HP = 0;
|
||||||
@ -51,7 +51,7 @@ int Eggs::eggBuffPlayer(CNSocket* sock, int skillId, int eggId, int duration) {
|
|||||||
memset(respbuf, 0, resplen);
|
memset(respbuf, 0, resplen);
|
||||||
skill->eCT = 1;
|
skill->eCT = 1;
|
||||||
skill->iID = plr->iID;
|
skill->iID = plr->iID;
|
||||||
skill->iHealHP = PC_MAXHEALTH(plr->level) * Abilities::SkillTable[skillId].powerIntensity[0] / 1000;
|
skill->iHealHP = PC_MAXHEALTH(plr->level) * Abilities::SkillTable[skillId].values[0][0] / 1000;
|
||||||
plr->HP += skill->iHealHP;
|
plr->HP += skill->iHealHP;
|
||||||
if (plr->HP > PC_MAXHEALTH(plr->level))
|
if (plr->HP > PC_MAXHEALTH(plr->level))
|
||||||
plr->HP = PC_MAXHEALTH(plr->level);
|
plr->HP = PC_MAXHEALTH(plr->level);
|
||||||
|
@ -281,7 +281,7 @@ static void dealCorruption(Mob *mob, std::vector<int> targetData, int skillID, i
|
|||||||
int style2 = Nanos::nanoStyle(plr->activeNano);
|
int style2 = Nanos::nanoStyle(plr->activeNano);
|
||||||
if (style2 == -1) { // no nano
|
if (style2 == -1) { // no nano
|
||||||
respdata[i].iHitFlag = HF_BIT_STYLE_TIE;
|
respdata[i].iHitFlag = HF_BIT_STYLE_TIE;
|
||||||
respdata[i].iDamage = Abilities::SkillTable[skillID].powerIntensity[0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
respdata[i].iDamage = Abilities::SkillTable[skillID].values[0][0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
||||||
} else if (style == style2) {
|
} else if (style == style2) {
|
||||||
respdata[i].iHitFlag = HF_BIT_STYLE_TIE;
|
respdata[i].iHitFlag = HF_BIT_STYLE_TIE;
|
||||||
respdata[i].iDamage = 0;
|
respdata[i].iDamage = 0;
|
||||||
@ -300,7 +300,7 @@ static void dealCorruption(Mob *mob, std::vector<int> targetData, int skillID, i
|
|||||||
pwr.handle(sock, targetData2, plr->activeNano, skillID, 0, 200);*/
|
pwr.handle(sock, targetData2, plr->activeNano, skillID, 0, 200);*/
|
||||||
} else {
|
} else {
|
||||||
respdata[i].iHitFlag = HF_BIT_STYLE_LOSE;
|
respdata[i].iHitFlag = HF_BIT_STYLE_LOSE;
|
||||||
respdata[i].iDamage = Abilities::SkillTable[skillID].powerIntensity[0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
respdata[i].iDamage = Abilities::SkillTable[skillID].values[0][0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
||||||
respdata[i].iNanoStamina = plr->Nanos[plr->activeNano].iStamina -= 90;
|
respdata[i].iNanoStamina = plr->Nanos[plr->activeNano].iStamina -= 90;
|
||||||
if (plr->Nanos[plr->activeNano].iStamina < 0) {
|
if (plr->Nanos[plr->activeNano].iStamina < 0) {
|
||||||
respdata[i].bNanoDeactive = 1;
|
respdata[i].bNanoDeactive = 1;
|
||||||
|
@ -86,7 +86,7 @@ void Nanos::summonNano(CNSocket *sock, int slot, bool silent) {
|
|||||||
int16_t skillID = plr->Nanos[plr->activeNano].iSkillID;
|
int16_t skillID = plr->Nanos[plr->activeNano].iSkillID;
|
||||||
|
|
||||||
// passive nano unbuffing
|
// passive nano unbuffing
|
||||||
if (Abilities::SkillTable[skillID].drainType == 2) {
|
if (Abilities::SkillTable[skillID].batteryDrainType == 2) {
|
||||||
// TODO ABILITIES
|
// TODO ABILITIES
|
||||||
/*std::vector<int> targetData = Abilities::findTargets(plr, skillID);
|
/*std::vector<int> targetData = Abilities::findTargets(plr, skillID);
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ void Nanos::summonNano(CNSocket *sock, int slot, bool silent) {
|
|||||||
skillID = plr->Nanos[nanoID].iSkillID;
|
skillID = plr->Nanos[nanoID].iSkillID;
|
||||||
|
|
||||||
// passive nano buffing
|
// passive nano buffing
|
||||||
if (Abilities::SkillTable[skillID].drainType == 2) {
|
if (Abilities::SkillTable[skillID].batteryDrainType == 2) {
|
||||||
int boost = 0;
|
int boost = 0;
|
||||||
if (getNanoBoost(plr))
|
if (getNanoBoost(plr))
|
||||||
boost = 1;
|
boost = 1;
|
||||||
|
@ -231,15 +231,31 @@ static void loadXDT(json& xdtData) {
|
|||||||
// load nano powers
|
// load nano powers
|
||||||
json skills = xdtData["m_pSkillTable"]["m_pSkillData"];
|
json skills = xdtData["m_pSkillTable"]["m_pSkillData"];
|
||||||
|
|
||||||
for (json::iterator _skills = skills.begin(); _skills != skills.end(); _skills++) {
|
for (json::iterator _skill = skills.begin(); _skill != skills.end(); _skill++) {
|
||||||
auto skills = _skills.value();
|
auto skill = _skill.value();
|
||||||
SkillData skillData = { skills["m_iSkillType"], skills["m_iTargetType"], skills["m_iBatteryDrainType"], skills["m_iEffectArea"] };
|
SkillData skillData = {
|
||||||
|
skill["m_iSkillType"],
|
||||||
|
skill["m_iEffectTarget"],
|
||||||
|
skill["m_iEffectType"],
|
||||||
|
skill["m_iTargetType"],
|
||||||
|
skill["m_iBatteryDrainType"],
|
||||||
|
skill["m_iEffectArea"]
|
||||||
|
};
|
||||||
|
|
||||||
|
skillData.valueTypes[0] = skill["m_iValueA_Type"];
|
||||||
|
skillData.valueTypes[1] = skill["m_iValueB_Type"];
|
||||||
|
skillData.valueTypes[2] = skill["m_iValueC_Type"];
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
skillData.batteryUse[i] = skills["m_iBatteryDrainUse"][i];
|
skillData.batteryUse[i] = skill["m_iBatteryDrainUse"][i];
|
||||||
skillData.durationTime[i] = skills["m_iDurationTime"][i];
|
skillData.durationTime[i] = skill["m_iDurationTime"][i];
|
||||||
skillData.powerIntensity[i] = skills["m_iValueA"][i];
|
|
||||||
|
skillData.values[0][i] = skill["m_iValueA"][i];
|
||||||
|
skillData.values[1][i] = skill["m_iValueB"][i];
|
||||||
|
skillData.values[2][i] = skill["m_iValueC"][i];
|
||||||
}
|
}
|
||||||
Abilities::SkillTable[skills["m_iSkillNumber"]] = skillData;
|
|
||||||
|
Abilities::SkillTable[skill["m_iSkillNumber"]] = skillData;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "[INFO] Loaded " << Abilities::SkillTable.size() << " nano skills" << std::endl;
|
std::cout << "[INFO] Loaded " << Abilities::SkillTable.size() << " nano skills" << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user