you need to edit 2 place in that place the first one for when entry is edited, the second one is when new entry created, capped into 8000 (80%) for SC_FREEZE, better use SC_FREEZE instead 1 for comparison, so it will human readable
for (auto &it : effect) {
if (it.sc == sc && it.flag == flag) {
if (sc == SC_FREEZE)
it.rate = cap_value(it.rate + rate, -10000, 8000);
else
it.rate = cap_value(it.rate + rate, -10000, 10000);
it.arrow_rate += arrow_rate;
it.duration = umax(it.duration, duration);
return;
}
}
struct s_addeffect entry = {};
if (rate < -10000 || rate > 10000)
ShowWarning("pc_bonus_addeff: Item bonus rate %d exceeds -10000~10000 range, capping.\n", rate);
entry.sc = sc;
if (sc == SC_FREEZE)
entry.rate = cap_value(rate, -10000, 8000);
else
entry.rate = cap_value(rate, -10000, 10000);
entry.arrow_rate = arrow_rate;
entry.flag = flag;
entry.duration = duration;
effect.push_back(entry);