Some cleanup as well as fix for a certain type of aa proc

This commit is contained in:
KimLS
2015-06-15 15:09:06 -07:00
parent 34f0106437
commit a984e9bd7c
8 changed files with 120 additions and 147 deletions
+37 -33
View File
@@ -4647,7 +4647,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
if (IsClient() && aabonuses.LimitToSkill[skill]){
CanProc = true;
uint32 effect = 0;
uint32 effect_id = 0;
int32 base1 = 0;
int32 base2 = 0;
uint32 slot = 0;
@@ -4666,39 +4666,43 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
proc_spell_id = 0;
ProcMod = 0;
//old AA
//std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aaid);
//if(find_iter == aa_effects.end())
// break;
for(auto &rank_info : aa_ranks) {
auto ability_rank = zone->GetAlternateAdvancementAbilityAndRank(rank_info.first, rank_info.second.first);
auto ability = ability_rank.first;
auto rank = ability_rank.second;
//for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) {
// effect = iter->second.skill_id;
// base1 = iter->second.base1;
// base2 = iter->second.base2;
// slot = iter->second.slot;
//
// if (effect == SE_SkillProc || effect == SE_SkillProcSuccess) {
// proc_spell_id = base1;
// ProcMod = static_cast<float>(base2);
// }
//
// else if (effect == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
//
// if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
// float final_chance = chance * (ProcMod / 100.0f);
//
// if (zone->random.Roll(final_chance)) {
// ExecWeaponProc(nullptr, proc_spell_id, on);
// CanProc = false;
// break;
// }
// }
// }
// else {
// proc_spell_id = 0;
// ProcMod = 0;
// }
//}
if(!ability) {
continue;
}
for(auto &effect : rank->effects) {
effect_id = effect.effect_id;
base1 = effect.base1;
base2 = effect.base2;
slot = effect.slot;
if(effect_id == SE_SkillProc || effect_id == SE_SkillProcSuccess) {
proc_spell_id = base1;
ProcMod = static_cast<float>(base2);
}
else if(effect_id == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f);
if (zone->random.Roll(final_chance)) {
ExecWeaponProc(nullptr, proc_spell_id, on);
CanProc = false;
break;
}
}
}
else {
proc_spell_id = 0;
ProcMod = 0;
}
}
}
}
}
}