public void OnImpact(NWPlayer player, NWObject target, int level) { var effectiveStats = _playerStat.GetPlayerItemEffectiveStats(player); int luck = _perk.GetPCPerkLevel(player, PerkType.Lucky) + effectiveStats.Luck; int lightBonus = effectiveStats.LightAbility; int min = 1; float length; int damage; int wisdom = player.WisdomModifier; int intelligence = player.IntelligenceModifier; min += lightBonus / 4 + wisdom / 3 + intelligence / 4; switch (level) { case 1: damage = _random.D4(1, min); length = 3; break; case 2: damage = _random.D4(1, min); length = 6; break; case 3: damage = _random.D6(1, min); length = 6; break; case 4: damage = _random.D8(1, min); length = 6; break; case 5: damage = _random.D8(1, min); length = 9; break; case 6: // Only available with background perk damage = _random.D12(1, min); length = 9; break; default: return; } if (_random.Random(100) + 1 <= luck) { length = length * 2; player.SendMessage("Lucky force push!"); } _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage, DAMAGE_TYPE_POSITIVE), target); _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectKnockdown(), target, length); _skill.RegisterPCToNPCForSkill(player, target, SkillType.LightSideAbilities); }
public void OnImpact(NWPlayer oPC, NWObject oTarget) { int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.Knockdown); int chance; float length; switch (perkLevel) { case 1: chance = 10; length = 3.0f; break; case 2: chance = 20; length = 3.0f; break; case 3: chance = 20; length = 6.0f; break; case 4: chance = 30; length = 6.0f; break; case 5: chance = 40; length = 6.0f; break; case 6: chance = 50; length = 6.0f; break; default: return; } if (_random.Random(100) + 1 <= chance) { _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectKnockdown(), oTarget.Object, length); } }
public void OnImpact(NWPlayer player, NWObject target, int perkLevel) { int damage; float length; switch (perkLevel) { case 1: damage = _random.D4(1); length = 6.0f; break; case 2: damage = _random.D4(2); length = 6.0f; break; case 3: damage = _random.D6(2); length = 6.0f; break; case 4: damage = _random.D6(2); length = 9.0f; break; case 5: damage = _random.D6(3); length = 9.0f; break; case 6: damage = _random.D8(3); length = 9.0f; break; default: return; } _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectKnockdown(), target.Object, length); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage, DAMAGE_TYPE_BLUDGEONING), target); }
private void HandleGrenadeProficiency(NWPlayer oPC, NWObject target) { NWItem weapon = _.GetSpellCastItem(); if (weapon.BaseItemType != BASE_ITEM_GRENADE) { return; } int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.GrenadeProficiency); int chance = 10 * perkLevel; float duration; switch (perkLevel) { case 1: case 2: case 3: case 4: duration = 6; break; case 5: case 6: case 7: case 8: case 9: duration = 9; break; default: return; } if (_random.D100(1) <= chance) { _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectKnockdown(), target, duration); } }