Rindro-Sqr/Base/CallBack/GetDamageRate.nut

72 lines
1.7 KiB
Plaintext

/*
文件名:GetDamageRate.nut
路径:Base/CallBack/GetDamageRate.nut
创建日期:2024-08-09 14:10
文件用途:获取伤害倍率
*/
function L_getCurrentModuleDamageRate(obj) {
if (!obj)
return 1.0;
local rate;
if (getroottable().rawin("LenheartCurrentModuleDamageRate")) {
rate = 1.0 + getroottable()["LenheartCurrentModuleDamageRate"];
} else {
rate = 1.0;
}
//超时空伤害
if (getroottable().rawin("LenheartFiendModuleDamageRate")) {
rate *= getroottable()["LenheartFiendModuleDamageRate"];
} else {
rate *= 1.0;
}
//pvf伤害
local ClientRat = 1.0;
try {
ClientRat = getCurrentModuleDamageRate(obj).tofloat();
} catch (exception) {
ClientRat = 1.0;
}
//副本伤害控制
try {
local stage = sq_GetGlobaludpModuleStage();
local dungeon = sq_GetDungeonByStage(stage);
local dungeonIndex = sq_GetDuegonIndex(dungeon);
local fbsh = 100;
foreach(id in DungeonIndex) {
if (dungeonIndex == id[0]) {
fbsh = id[1];
}
}
local nrate = fbsh.tofloat() / 100.0;
rate = rate.tofloat() * nrate;
} catch (exception) {
}
//职业伤害控制
try {
local LLJob = sq_getJob(obj);
local LLGrowT = sq_getGrowType(obj);
local LLLen = GrowType.len();
for (local i = 0; i< 11; ++i) {
if (i == LLLen) break;
if (LLJob == i) {
foreach(GR in GrowType[i]) {
if (LLGrowT == GR[0])
rate = rate.tofloat() * GR[1].tofloat();
}
}
}
} catch (exception) {
}
return (rate * ClientRat);
}