-- ������� �������� ����������� ������������ ����� -- Lua compatibility: some runtimes do not provide math.pow (use ^ operator instead) if math and math.pow == nil then math.pow = function(a, b) return a ^ b end end function role_CanCrit(MapID, InstanceID, RoleID, TargetID) if unit.IsPlayer(TargetID) then if role.IsRoleHaveBuff(MapID, InstanceID, TargetID, 98163) then return false elseif role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 10706) then local a, b = role.GetBuffLayer(RoleID, 1071901) local c = math.random(1, 100) local d = role.GetRoleAttValue(MapID, InstanceID, RoleID, 57) local e = role.GetRoleAttValue(MapID, InstanceID, RoleID, 16) local f = role.GetRoleAttValue(MapID, InstanceID, TargetID, 17) local g = role.GetRoleAttValue(MapID, InstanceID, TargetID, 110) local crit = math.pow(e / 150000, 0.5) * (1 - (f - e) / 5000) + (d - g) / 1000 -- ������� ������������ ����� crit = (crit - 0.1 * a) * 100 -- ���� ��������� ���� ������������ ����� �� 10% if c <= crit then return true else return false end else return true end else return true end end aux.RegisterRoleEvent(69, "role_CanCrit") -- ������� ���������� ������ function s9101101_Cast(MapID, InstanceID, SkillID, TargetID) if SkillID == 9101101 then unit.AddBuff(MapID, InstanceID, OwnerID, 9816301, OwnerID) end role.RemoveFromRole(MapID, InstanceID, TargetID, 6600819, 1, 400) end aux.RegisterSkillEvent(9101101, 1, "s9101101_Cast") aux.RegisterSkillEvent(9101201, 1, "s9101101_Cast") aux.RegisterSkillEvent(9101301, 1, "s9101101_Cast") aux.RegisterSkillEvent(9101401, 1, "s9101101_Cast") -- ������� �������� ����������� ������������� ������ function s9101101_canuse(MapID, InstanceID, SkillID, RoleID) local itemNum = role.GetRoleItemNum(RoleID, 6600819) if itemNum < 1 then return 79, false end end aux.RegisterSkillEvent(9101101, 0, "s9101101_canuse") aux.RegisterSkillEvent(9101201, 0, "s9101101_canuse") aux.RegisterSkillEvent(9101301, 0, "s9101101_canuse") aux.RegisterSkillEvent(9101401, 0, "s9101101_canuse")