private int CalculateAmount(NWPlayer player) { var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int perkLevel = PerkService.GetCreaturePerkLevel(player, PerkType.Meditate); int amount; switch (perkLevel) { default: amount = 6; break; case 4: case 5: case 6: amount = 10; break; case 7: amount = 14; break; } amount += effectiveStats.Meditate; return(amount); }
private float CalculateEquipmentBonus(NWPlayer player, SkillType skillType) { var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int equipmentBonus = 0; float multiplier = 0.5f; int atmosphere = CraftService.CalculateAreaAtmosphereBonus(player.Area); if (atmosphere >= 75) { multiplier = 0.7f; } else if (atmosphere >= 25) { multiplier = 0.6f; } switch (skillType) { case SkillType.Armorsmith: equipmentBonus = effectiveStats.Armorsmith; break; case SkillType.Weaponsmith: equipmentBonus = effectiveStats.Weaponsmith; break; case SkillType.Cooking: equipmentBonus = effectiveStats.Cooking; break; case SkillType.Engineering: equipmentBonus = effectiveStats.Engineering; break; case SkillType.Fabrication: equipmentBonus = effectiveStats.Fabrication; break; case SkillType.Medicine: equipmentBonus = effectiveStats.Medicine; break; } return(equipmentBonus * multiplier); // +0.5%, +0.6%, or +0.7% per equipment bonus }
private int CalculateAmount(NWPlayer player) { var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int perkLevel = PerkService.GetPCPerkLevel(player, PerkType.Rest); int amount; switch (perkLevel) { default: amount = 2; break; case 4: case 5: case 6: amount = 3; break; case 7: amount = 4; break; } amount += effectiveStats.Rest; return(amount); }
// Create Service private PlayerStatService CreatePlayerStatService() { var userID = Guid.Parse(User.Identity.GetUserId()); var service = new PlayerStatService(userID); return(service); }
public void OnPurchased(NWCreature creature, int newLevel) { if (!creature.IsPlayer) { return; } PlayerStatService.ApplyStatChanges(creature.Object, null); }
public void OnRemoved(NWCreature creature) { if (!creature.IsPlayer) { return; } PlayerStatService.ApplyStatChanges(creature.Object, null); }
private void DoPerkRemoval() { if (!CanRefundPerk()) { return; } var model = GetDialogCustomData <Model>(); var player = GetPC(); var pcPerk = DataService.PCPerk.GetByID(model.PCPerkID); var perk = DataService.Perk.GetByID(pcPerk.PerkID); var minimumLevel = 1; if (IsGrantedByBackground((PerkType)perk.ID)) { minimumLevel = 2; } var refundAmount = DataService.PerkLevel.GetAllByPerkID(perk.ID) .Where(x => x.Level <= pcPerk.PerkLevel && x.Level >= minimumLevel).Sum(x => x.Price); var dbPlayer = DataService.Player.GetByID(player.GlobalID); dbPlayer.DatePerkRefundAvailable = DateTime.UtcNow.AddHours(24); RemovePerkItem(perk); RemovePerkFeat(perk); CustomEffectService.RemoveStance(GetPC()); PlayerStatService.ApplyStatChanges(GetPC(), null); dbPlayer.UnallocatedSP += refundAmount; var refundAudit = new PCPerkRefund { PlayerID = player.GlobalID, DateAcquired = pcPerk.AcquiredDate, DateRefunded = DateTime.UtcNow, Level = pcPerk.PerkLevel, PerkID = pcPerk.PerkID }; // Bypass caching for perk refunds. DataService.DataQueue.Enqueue(new DatabaseAction(refundAudit, DatabaseActionType.Insert)); DataService.SubmitDataChange(pcPerk, DatabaseActionType.Delete); DataService.SubmitDataChange(dbPlayer, DatabaseActionType.Update); // If perk refunded was one granted by a background bonus, we need to reapply it. ReapplyBackgroundBonus((PerkType)pcPerk.PerkID); GetPC().FloatingText("Perk refunded! You reclaimed " + refundAmount + " SP."); model.TomeItem.Destroy(); var handler = PerkService.GetPerkHandler(perk.ID); handler.OnRemoved(player); MessageHub.Instance.Publish(new OnPerkRefunded(player, pcPerk.PerkID)); }
public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier) { float length; int ab; int chance; switch (perkLevel) { case 1: length = 12.0f; ab = 1; chance = 10; break; case 2: length = 12.0f; ab = 1; chance = 20; break; case 3: length = 12.0f; ab = 2; chance = 20; break; case 4: length = 12.0f; ab = 2; chance = 30; break; case 5: length = 12.0f; ab = 3; chance = 30; break; default: return; } if (creature.IsPlayer) { var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(creature.Object); int luck = PerkService.GetCreaturePerkLevel(creature, PerkType.Lucky) + effectiveStats.Luck; chance += luck; } if (RandomService.Random(100) + 1 <= chance) { _.ApplyEffectToObject(_.DURATION_TYPE_TEMPORARY, _.EffectAttackIncrease(ab), creature.Object, length); creature.SendMessage(ColorTokenService.Combat("You perform a defensive maneuver.")); } }
public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData) { NWPlayer player = (user.Object); var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); target.RemoveEffect(EFFECT_TYPE_REGENERATE); int rank = SkillService.GetPCSkillRank(player, SkillType.Medicine); int luck = PerkService.GetPCPerkLevel(player, PerkType.Lucky); int perkDurationBonus = PerkService.GetPCPerkLevel(player, PerkType.HealingKitExpert) * 6 + (luck * 2); float duration = 30.0f + (rank * 0.4f) + perkDurationBonus; int restoreAmount = 1 + item.GetLocalInt("HEALING_BONUS") + effectiveStats.Medicine + item.MedicineBonus; int delta = item.RecommendedLevel - rank; float effectivenessPercent = 1.0f; if (delta > 0) { effectivenessPercent = effectivenessPercent - (delta * 0.1f); } restoreAmount = (int)(restoreAmount * effectivenessPercent); int perkBlastBonus = PerkService.GetPCPerkLevel(player, PerkType.ImmediateImprovement); if (perkBlastBonus > 0) { int blastHeal = restoreAmount * perkBlastBonus; if (RandomService.Random(100) + 1 <= luck / 2) { blastHeal *= 2; } _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(blastHeal), target.Object); } float interval = 6.0f; BackgroundType background = (BackgroundType)player.Class1; if (background == BackgroundType.Medic) { interval *= 0.5f; } _.PlaySound("use_bacta"); Effect regeneration = _.EffectRegenerate(restoreAmount, interval); _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, regeneration, target.Object, duration); player.SendMessage("You successfully treat " + target.Name + "'s wounds. The healing kit will expire in " + duration + " seconds."); _.DelayCommand(duration + 0.5f, () => { player.SendMessage("The healing kit that you applied to " + target.Name + " has expired."); }); if (target.IsPlayer) { int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(300, item.RecommendedLevel, rank); SkillService.GiveSkillXP(player, SkillType.Medicine, xp); } }
public string Apply(NWCreature oCaster, NWObject oTarget, int effectiveLevel) { PlayerStatService.ApplyStatChanges(oTarget.Object, null); int healAmount = (int)(CustomEffectService.CalculateEffectHPBonusPercent(oTarget.Object) * oTarget.MaxHP); if (healAmount > 0) { _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(healAmount), oTarget); } return(null); }
public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData) { NWPlayer player = (user.Object); var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int rank = SkillService.GetPCSkillRank(player, SkillType.Medicine); int luck = PerkService.GetCreaturePerkLevel(player, PerkType.Lucky); int perkDurationBonus = PerkService.GetCreaturePerkLevel(player, PerkType.HealingKitExpert) * 6 + (luck * 2); float duration = 30.0f + (rank * 0.4f) + perkDurationBonus + effectiveStats.Medicine; int restoreAmount = 1 + item.GetLocalInt("HEALING_BONUS") + (rank / 10); int delta = item.RecommendedLevel - rank; float effectivenessPercent = 1.0f; if (delta > 0) { effectivenessPercent = effectivenessPercent - (delta * 0.1f); } restoreAmount = (int)(restoreAmount * effectivenessPercent) + item.MedicineBonus; int perkBlastBonus = PerkService.GetCreaturePerkLevel(player, PerkType.ImmediateForcePack); if (perkBlastBonus > 0) { int blastHeal = restoreAmount * perkBlastBonus; if (RandomService.Random(100) + 1 <= luck / 2) { blastHeal *= 2; } AbilityService.RestorePlayerFP(target.Object, blastHeal); } float interval = 6.0f; BackgroundType background = (BackgroundType)player.Class1; if (background == BackgroundType.Medic) { interval *= 0.5f; } string data = (int)interval + ", " + restoreAmount; CustomEffectService.ApplyCustomEffect(user, target.Object, CustomEffectType.ForcePack, (int)duration, restoreAmount, data); player.SendMessage("You successfully apply a force pack to " + target.Name + ". The force pack will expire in " + duration + " seconds."); _.DelayCommand(duration + 0.5f, () => { player.SendMessage("The force pack that you applied to " + target.Name + " has expired."); }); int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(300, item.RecommendedLevel, rank); SkillService.GiveSkillXP(player, SkillType.Medicine, xp); }
public float Seconds(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData) { NWPlayer player = (user.Object); var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); if (RandomService.Random(100) + 1 <= PerkService.GetCreaturePerkLevel(player, PerkType.SpeedyFirstAid) * 10) { return(0.1f); } int rank = SkillService.GetPCSkillRank(player, SkillType.Medicine); return(12.0f - (rank + effectiveStats.Medicine / 2) * 0.1f); }
public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier) { int chance; int amount; switch (perkLevel) { case 1: chance = 50; amount = 1; break; case 2: chance = 50; amount = 2; break; case 3: chance = 50; amount = 3; break; case 4: chance = 75; amount = 3; break; case 5: chance = 75; amount = 4; break; default: return; } if (creature.IsPlayer) { var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(creature.Object); int luck = PerkService.GetCreaturePerkLevel(creature, PerkType.Lucky) + effectiveStats.Luck; chance += luck; } if (RandomService.Random(100) + 1 <= chance) { Effect heal = _.EffectHeal(amount); _.ApplyEffectToObject(_.DURATION_TYPE_INSTANT, heal, creature.Object); } }
public void Tick(NWCreature oCaster, NWObject oTarget, int currentTick, int effectiveLevel, string data) { NWPlayer targetPlayer = oTarget.Object; if (targetPlayer.Chest.CustomItemType != CustomItemType.HeavyArmor) { CustomEffectService.RemovePCCustomEffect(targetPlayer, CustomEffectType.ShieldBoost); PlayerStatService.ApplyStatChanges(targetPlayer, null); var vfx = targetPlayer.Effects.SingleOrDefault(x => _.GetEffectTag(x) == "SHIELD_BOOST_VFX"); if (vfx != null) { _.RemoveEffect(targetPlayer, vfx); } } }
public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData) { NWPlayer player = (user.Object); var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); CustomEffectService.RemovePCCustomEffect(target.Object, CustomEffectType.Bleeding); player.SendMessage("You finish bandaging " + target.Name + "'s wounds."); int rank = SkillService.GetPCSkillRank(player, SkillType.Medicine); int healAmount = 2 + effectiveStats.Medicine / 2; healAmount += item.MedicineBonus; if (rank >= item.RecommendedLevel && item.MedicineBonus > 0) { _.ApplyEffectToObject(DurationType.Instant, _.EffectHeal(healAmount), target); } if (target.IsPlayer) { int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(100, item.RecommendedLevel, rank); SkillService.GiveSkillXP(player, SkillType.Medicine, xp); } }
public void Main() { NWPlaceable point = (_.OBJECT_SELF); NWPlayer oPC = (_.GetLastOpenedBy()); if (!oPC.IsPlayer) { return; } var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(oPC); const int baseChanceToFullyHarvest = 50; bool hasBeenSearched = point.GetLocalInt("SCAVENGE_POINT_FULLY_HARVESTED") == 1; if (hasBeenSearched) { oPC.SendMessage("There's nothing left to harvest here..."); return; } if (!oPC.IsPlayer && !oPC.IsDM) { return; } int rank = SkillService.GetPCSkillRank(oPC, SkillType.Scavenging); int lootTableID = point.GetLocalInt("SCAVENGE_POINT_LOOT_TABLE_ID"); int level = point.GetLocalInt("SCAVENGE_POINT_LEVEL"); int delta = level - rank; if (delta > 8) { oPC.SendMessage("You aren't skilled enough to scavenge through this. (Required Level: " + (level - 8) + ")"); oPC.AssignCommand(() => _.ActionInteractObject(point.Object)); return; } int dc = 6 + delta; if (dc <= 4) { dc = 4; } int searchAttempts = 1 + CalculateSearchAttempts(oPC); int luck = PerkService.GetCreaturePerkLevel(oPC, PerkType.Lucky) + effectiveStats.Luck; if (RandomService.Random(100) + 1 <= luck / 2) { dc--; } oPC.AssignCommand(() => _.ActionPlayAnimation(Animation.LoopingGetLow, 1.0f, 2.0f)); for (int attempt = 1; attempt <= searchAttempts; attempt++) { int roll = RandomService.Random(20) + 1; if (roll >= dc) { oPC.FloatingText(ColorTokenService.SkillCheck("Search: *success*: (" + roll + " vs. DC: " + dc + ")")); ItemVO spawnItem = LootService.PickRandomItemFromLootTable(lootTableID); if (spawnItem == null) { return; } if (!string.IsNullOrWhiteSpace(spawnItem.Resref) && spawnItem.Quantity > 0) { _.CreateItemOnObject(spawnItem.Resref, point.Object, spawnItem.Quantity); } float xp = SkillService.CalculateRegisteredSkillLevelAdjustedXP(200, level, rank); SkillService.GiveSkillXP(oPC, SkillType.Scavenging, (int)xp); } else { oPC.FloatingText(ColorTokenService.SkillCheck("Search: *failure*: (" + roll + " vs. DC: " + dc + ")")); float xp = SkillService.CalculateRegisteredSkillLevelAdjustedXP(50, level, rank); SkillService.GiveSkillXP(oPC, SkillType.Scavenging, (int)xp); } dc += RandomService.Random(3) + 1; } // Chance to destroy the scavenge point. int chanceToFullyHarvest = baseChanceToFullyHarvest - (PerkService.GetCreaturePerkLevel(oPC, PerkType.CarefulScavenger) * 5); if (chanceToFullyHarvest <= 5) { chanceToFullyHarvest = 5; } point.SetLocalInt("SCAVENGE_POINT_FULLY_HARVESTED", 1); oPC.SendMessage("This resource has been fully harvested..."); point.SetLocalInt("SCAVENGE_POINT_DESPAWN_TICKS", 30); }
private void OnCompleteSmelt(OnCompleteSmelt data) { NWPlayer player = data.Player; string oreResref = data.OreResref; List <ItemProperty> itemProperties = data.ItemProperties; player.IsBusy = false; int rank = SkillService.GetPCSkillRank(player, SkillType.Harvesting); int level = CraftService.GetIngotLevel(oreResref); string ingotResref = CraftService.GetIngotResref(oreResref); if (level < 0 || string.IsNullOrWhiteSpace(ingotResref)) { return; } int delta = rank - level; int count = 2; if (delta > 2) { count = delta; } if (count > 4) { count = 4; } if (RandomService.Random(100) + 1 <= PerkService.GetCreaturePerkLevel(player, PerkType.Lucky)) { count++; } if (RandomService.Random(100) + 1 <= PerkService.GetCreaturePerkLevel(player, PerkType.ProcessingEfficiency) * 10) { count++; } for (int x = 1; x <= count; x++) { var item = (_.CreateItemOnObject(ingotResref, player.Object)); int chance; switch (x) { case 1: case 2: chance = 100; break; case 3: chance = 70; break; case 4: chance = 60; break; case 5: chance = 50; break; default: chance = 30; break; } foreach (var ip in itemProperties) { if (RandomService.D100(1) <= chance) { BiowareXP2.IPSafeAddItemProperty(item, ip, 0.0f, AddItemPropertyPolicy.IgnoreExisting, true, true); } } } var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int harvestingSkill = SkillService.GetPCSkillRank(player, SkillType.Harvesting); int perkBonus = PerkService.GetCreaturePerkLevel(player, PerkType.StronidiumRefining) + 1; int stronidiumAmount = 10 + effectiveStats.Harvesting + harvestingSkill + RandomService.Random(1, 5); stronidiumAmount *= perkBonus; _.CreateItemOnObject("stronidium", player.Object, stronidiumAmount); int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(100, level, rank); SkillService.GiveSkillXP(player, SkillType.Harvesting, xp); }
public void OnPurchased(NWPlayer oPC, int newLevel) { PlayerStatService.ApplyStatChanges(oPC, null); }
public void OnRemoved(NWPlayer oPC) { PlayerStatService.ApplyStatChanges(oPC, null); }
public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData) { NWPlayer player = user.Object; var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int skillRank = SkillService.GetPCSkillRank(player, SkillType.Medicine); int perkLevel = PerkService.GetCreaturePerkLevel(player, PerkType.ResuscitationDevices); int rank = item.GetLocalInt("RANK"); int baseHeal; switch (rank) { case 1: baseHeal = 1; break; case 2: baseHeal = 11; break; case 3: baseHeal = 31; break; case 4: baseHeal = 51; break; default: return; } baseHeal += perkLevel * 2; baseHeal += effectiveStats.Medicine / 2; baseHeal += item.MedicineBonus / 2; int delta = item.RecommendedLevel - skillRank; float effectivenessPercent = 1.0f; if (delta > 0) { effectivenessPercent = effectivenessPercent - (delta * 0.1f); } if (target.IsPlayer) { baseHeal = (int)(baseHeal * effectivenessPercent); Player dbPlayer = DataService.Player.GetByID(target.GlobalID); int fpRecover = (int)(dbPlayer.MaxFP * (0.01f * baseHeal)); int hpRecover = (int)(target.MaxHP * (0.01f * baseHeal)); _.PlaySound("use_bacta"); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectResurrection(), target); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(hpRecover), target); dbPlayer.CurrentFP = fpRecover; DataService.SubmitDataChange(dbPlayer, DatabaseActionType.Update); player.SendMessage("You successfully resuscitate " + target.Name + "!"); int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(600, item.RecommendedLevel, skillRank); SkillService.GiveSkillXP(player, SkillType.Medicine, xp); } else { baseHeal = (int)(baseHeal * effectivenessPercent); int hpRecover = (int)(target.MaxHP * (0.01f * baseHeal)); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectResurrection(), target); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(hpRecover), target); player.SendMessage("You successfully resuscitate " + target.Name + "!"); } }
// New component items will be spawned and the appropriate properties from the base item will be transferred. public bool Run(params object[] args) { _player = (NWPlayer)args[0]; int xp = 100; // Always grant at least this much XP to player. // Remove the immobilization effect foreach (var effect in _player.Effects) { if (_.GetEffectTag(effect) == "CRAFTING_IMMOBILIZATION") { _.RemoveEffect(_player, effect); } } // Check for a fuel cell in the player's inventory again. If it doesn't exist, we exit early with an error message. NWItem fuel = _.GetItemPossessedBy(_player, "ass_power"); if (!fuel.IsValid) { _player.SendMessage(ColorTokenService.Red("A 'Reassembly Fuel Cell' was not found in your inventory. Reassembly failed.")); return(false); } // Otherwise the fuel cell was found. Destroy it and continue on with the process. fuel.Destroy(); _playerItemStats = PlayerStatService.GetPlayerItemEffectiveStats(_player); string serializedSalvageItem = (string)args[1]; NWPlaceable tempStorage = _.GetObjectByTag("TEMP_ITEM_STORAGE"); NWItem item = SerializationService.DeserializeItem(serializedSalvageItem, tempStorage); int salvageComponentTypeID = (int)args[2]; _componentType = DataService.Get <ComponentType>(salvageComponentTypeID); // Create an item with no bonuses every time. _.CreateItemOnObject(_componentType.ReassembledResref, _player); // Now check specific custom properties which are stored as local variables on the item. xp += ProcessProperty(item.HarvestingBonus, 3, ComponentBonusType.HarvestingUp); xp += ProcessProperty(item.PilotingBonus, 3, ComponentBonusType.PilotingUp); xp += ProcessProperty(item.ScanningBonus, 3, ComponentBonusType.ScanningUp); xp += ProcessProperty(item.ScavengingBonus, 3, ComponentBonusType.ScavengingUp); xp += ProcessProperty(item.CooldownRecovery, 3, ComponentBonusType.CooldownRecoveryUp); xp += ProcessProperty(item.CraftBonusArmorsmith, 3, ComponentBonusType.ArmorsmithUp); xp += ProcessProperty(item.CraftBonusWeaponsmith, 3, ComponentBonusType.WeaponsmithUp); xp += ProcessProperty(item.CraftBonusCooking, 3, ComponentBonusType.CookingUp); xp += ProcessProperty(item.CraftBonusEngineering, 3, ComponentBonusType.EngineeringUp); xp += ProcessProperty(item.CraftBonusFabrication, 3, ComponentBonusType.FabricationUp); xp += ProcessProperty(item.HPBonus, 5, ComponentBonusType.HPUp, 0.5f); xp += ProcessProperty(item.FPBonus, 5, ComponentBonusType.FPUp, 0.5f); xp += ProcessProperty(item.EnmityRate, 3, ComponentBonusType.EnmityUp); xp += ProcessProperty(item.LuckBonus, 3, ComponentBonusType.LuckUp); xp += ProcessProperty(item.MeditateBonus, 3, ComponentBonusType.MeditateUp); xp += ProcessProperty(item.RestBonus, 3, ComponentBonusType.RestUp); xp += ProcessProperty(item.MedicineBonus, 3, ComponentBonusType.MedicineUp); xp += ProcessProperty(item.HPRegenBonus, 3, ComponentBonusType.HPRegenUp); xp += ProcessProperty(item.FPRegenBonus, 3, ComponentBonusType.FPRegenUp); xp += ProcessProperty(item.BaseAttackBonus, 3, ComponentBonusType.BaseAttackBonusUp, 6f); xp += ProcessProperty(item.StructureBonus, 3, ComponentBonusType.StructureBonusUp); xp += ProcessProperty(item.SneakAttackBonus, 3, ComponentBonusType.SneakAttackUp); xp += ProcessProperty(item.DamageBonus, 3, ComponentBonusType.DamageUp); xp += ProcessProperty(item.StrengthBonus, 3, ComponentBonusType.StrengthUp); xp += ProcessProperty(item.DexterityBonus, 3, ComponentBonusType.DexterityUp); xp += ProcessProperty(item.ConstitutionBonus, 3, ComponentBonusType.ConstitutionUp); xp += ProcessProperty(item.WisdomBonus, 3, ComponentBonusType.WisdomUp); xp += ProcessProperty(item.IntelligenceBonus, 3, ComponentBonusType.IntelligenceUp); xp += ProcessProperty(item.CharismaBonus, 3, ComponentBonusType.CharismaUp); xp += ProcessProperty(item.DurationBonus, 3, ComponentBonusType.DurationUp); item.Destroy(); SkillService.GiveSkillXP(_player, SkillType.Harvesting, xp); return(true); }
private void SkillResponses(int responseID) { var model = GetDialogCustomData <Model>(); // This is the first click. Mark the distribution type and wait for confirmation on the next click. if (model.DistributionType != responseID) { model.DistributionType = responseID; } // This is confirmation to distribute the rank(s). Do it. else { int amount; // Figure out how much to increase the skill by. if (responseID == 1) { amount = 1; } else if (responseID == 2) { amount = 5; } else if (responseID == 3) { amount = 10; } else { // We shouldn't ever see this message, but just in case a future change breaks it... GetPC().FloatingText("You cannot distribute this number of ranks into this skill."); return; } // Ensure the player can distribute the ranks one more time. if (!CanDistribute(amount)) { GetPC().FloatingText("You cannot distribute these ranks into this skill."); return; } // Let's do the distribution. Normally, you would want to run the SkillService methods but in this scenario // all of that's already been applied. You don't want to reapply the SP gains because they'll get more than they should. // Just set the ranks on the DB record and recalc stats. var pcSkill = DataService.Single <PCSkill>(x => x.PlayerID == GetPC().GlobalID&& x.SkillID == model.SkillID); var skill = DataService.Get <Skill>(pcSkill.SkillID); // Prevent the player from adding too many ranks. if (pcSkill.Rank + amount > skill.MaxRank) { GetPC().FloatingText("You cannot distribute this number of ranks into this skill."); return; } pcSkill.Rank += amount; DataService.SubmitDataChange(pcSkill, DatabaseActionType.Update); PlayerStatService.ApplyStatChanges(GetPC(), null); // Reduce the pool levels. Delete the record if it drops to zero. var pool = DataService.Single <PCSkillPool>(x => x.PlayerID == GetPC().GlobalID&& x.SkillCategoryID == model.SkillCategoryID); pool.Levels -= amount; if (pool.Levels <= 0) { DataService.SubmitDataChange(pool, DatabaseActionType.Delete); EndConversation(); return; } else { DataService.SubmitDataChange(pool, DatabaseActionType.Update); } model.DistributionType = 0; } LoadSkillPage(); }
public bool Run(params object[] args) { NWPlaceable container = (Object.OBJECT_SELF); NWPlayer oPC = (_.GetLastDisturbed()); int type = _.GetInventoryDisturbType(); NWItem item = (_.GetInventoryDisturbItem()); var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(oPC); if (type != _.INVENTORY_DISTURB_TYPE_ADDED) { return(false); } int plantID = item.GetLocalInt("PLANT_ID"); if (plantID <= 0) { ItemService.ReturnItem(oPC, item); oPC.SendMessage("You cannot plant that item."); return(true); } Plant plant = FarmingService.GetPlantByID(plantID); if (plant == null) { ItemService.ReturnItem(oPC, item); oPC.SendMessage("You cannot plant that item."); return(true); } int rank = SkillService.GetPCSkillRank(oPC, SkillType.Farming); if (rank + 2 < plant.Level) { ItemService.ReturnItem(oPC, item); oPC.SendMessage("You do not have enough Farming skill to plant that seed. (Required: " + (plant.Level - 2) + ")"); return(true); } item.Destroy(); string areaTag = container.Area.Tag; Location plantLocation = container.Location; int perkBonus = PerkService.GetPCPerkLevel(oPC, PerkType.FarmingEfficiency) * 2; int ticks = (int)(plant.BaseTicks - ((PerkService.GetPCPerkLevel(oPC, PerkType.ExpertFarmer) * 0.05f)) * plant.BaseTicks); Data.Entity.GrowingPlant growingPlant = new Data.Entity.GrowingPlant { PlantID = plant.ID, RemainingTicks = ticks, LocationAreaTag = areaTag, LocationOrientation = _.GetFacingFromLocation(plantLocation), LocationX = _.GetPositionFromLocation(plantLocation).m_X, LocationY = _.GetPositionFromLocation(plantLocation).m_Y, LocationZ = _.GetPositionFromLocation(plantLocation).m_Z, IsActive = true, DateCreated = DateTime.UtcNow, LongevityBonus = perkBonus }; DataService.SubmitDataChange(growingPlant, DatabaseActionType.Insert); NWPlaceable hole = (container.GetLocalObject("FARM_SMALL_HOLE")); NWPlaceable plantPlc = (_.CreateObject(_.OBJECT_TYPE_PLACEABLE, "growing_plant", hole.Location)); plantPlc.SetLocalString("GROWING_PLANT_ID", growingPlant.ID.ToString()); plantPlc.Name = "Growing Plant (" + plant.Name + ")"; container.Destroy(); hole.Destroy(); int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(200, plant.Level, rank); if (RandomService.Random(100) + 1 <= PerkService.GetPCPerkLevel(oPC, PerkType.Lucky) + effectiveStats.Luck) { xp *= 2; } SkillService.GiveSkillXP(oPC, SkillType.Farming, xp); return(true); }
public void OnImpact(NWPlayer player, NWObject target, int perkLevel, int spellFeatID) { float recoveryPercent; int basePotency; const float Tier1Modifier = 1; const float Tier2Modifier = 2; const float Tier3Modifier = 0; const float Tier4Modifier = 0; switch (perkLevel) { case 1: basePotency = 10; recoveryPercent = 0.2f; break; case 2: basePotency = 15; recoveryPercent = 0.2f; break; case 3: basePotency = 20; recoveryPercent = 0.4f; break; case 4: basePotency = 25; recoveryPercent = 0.4f; break; case 5: basePotency = 30; recoveryPercent = 0.5f; break; default: return; } var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int luck = PerkService.GetPCPerkLevel(player, PerkType.Lucky) + effectiveStats.Luck; if (RandomService.Random(100) + 1 <= luck) { recoveryPercent = 1.0f; player.SendMessage("Lucky drain life!"); } var calc = CombatService.CalculateForceDamage( player, target.Object, ForceAbilityType.Dark, basePotency, Tier1Modifier, Tier2Modifier, Tier3Modifier, Tier4Modifier); _.AssignCommand(player, () => { int heal = (int)(calc.Damage * recoveryPercent); if (heal > target.CurrentHP) { heal = target.CurrentHP; } _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(calc.Damage), target); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(heal), player); _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectVisualEffect(VFX_BEAM_MIND), target, 1.0f); }); _.PlaySound("v_pro_drain"); SkillService.RegisterPCToAllCombatTargetsForSkill(player, SkillType.ForceCombat, target.Object); CombatService.AddTemporaryForceDefense(target.Object, ForceAbilityType.Dark); }
public bool Run(params object[] args) { NWPlaceable point = (Object.OBJECT_SELF); NWPlayer oPC = (_.GetLastOpenedBy()); if (!oPC.IsPlayer) { return(false); } var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(oPC); const int baseChanceToFullyHarvest = 50; bool alwaysDestroys = point.GetLocalInt("SCAVENGE_POINT_ALWAYS_DESTROYS") == 1; bool hasBeenSearched = point.GetLocalInt("SCAVENGE_POINT_FULLY_HARVESTED") == 1; if (hasBeenSearched) { oPC.SendMessage("There's nothing left to harvest here..."); return(true); } // Not fully harvested but the timer hasn't counted down yet. int refillTick = point.GetLocalInt("SCAVENGE_POINT_REFILL_TICKS"); if (refillTick > 0) { oPC.SendMessage("You couldn't find anything new here. Check back later..."); return(true); } if (!oPC.IsPlayer && !oPC.IsDM) { return(false); } int rank = SkillService.GetPCSkillRank(oPC, SkillType.Scavenging); int lootTableID = point.GetLocalInt("SCAVENGE_POINT_LOOT_TABLE_ID"); int level = point.GetLocalInt("SCAVENGE_POINT_LEVEL"); int delta = level - rank; if (delta > 8) { oPC.SendMessage("You aren't skilled enough to scavenge through this. (Required Level: " + (level - 8) + ")"); oPC.AssignCommand(() => _.ActionInteractObject(point.Object)); return(true); } int dc = 6 + delta; if (dc <= 4) { dc = 4; } int searchAttempts = 1 + CalculateSearchAttempts(oPC); int luck = PerkService.GetPCPerkLevel(oPC, PerkType.Lucky) + effectiveStats.Luck; if (RandomService.Random(100) + 1 <= luck / 2) { dc--; } oPC.AssignCommand(() => _.ActionPlayAnimation(_.ANIMATION_LOOPING_GET_LOW, 1.0f, 2.0f)); for (int attempt = 1; attempt <= searchAttempts; attempt++) { int roll = RandomService.Random(20) + 1; if (roll >= dc) { oPC.FloatingText(ColorTokenService.SkillCheck("Search: *success*: (" + roll + " vs. DC: " + dc + ")")); ItemVO spawnItem = LootService.PickRandomItemFromLootTable(lootTableID); if (spawnItem == null) { return(false); } if (!string.IsNullOrWhiteSpace(spawnItem.Resref) && spawnItem.Quantity > 0) { NWItem resource = _.CreateItemOnObject(spawnItem.Resref, point.Object, spawnItem.Quantity); var componentIP = resource.ItemProperties.FirstOrDefault(x => _.GetItemPropertyType(x) == (int)CustomItemPropertyType.ComponentType); if (componentIP != null) { // Add properties to the item based on Scavenging skill. Similar logic to the resource harvester. var chance = RandomService.Random(1, 100) + PerkService.GetPCPerkLevel(oPC, PerkType.Lucky) + effectiveStats.Luck; ResourceQuality quality; if (chance < 50) { quality = ResourceQuality.Low; } else if (chance < 75) { quality = ResourceQuality.Normal; } else if (chance < 95) { quality = ResourceQuality.High; } else { quality = ResourceQuality.VeryHigh; } int ipBonusChance = ResourceService.CalculateChanceForComponentBonus(oPC, (level / 10 + 1), quality, true); if (RandomService.Random(1, 100) <= ipBonusChance) { var ip = ResourceService.GetRandomComponentBonusIP(ResourceQuality.Normal); BiowareXP2.IPSafeAddItemProperty(resource, ip.Item1, 0.0f, AddItemPropertyPolicy.IgnoreExisting, true, true); switch (ip.Item2) { case 0: resource.Name = ColorTokenService.Green(resource.Name); break; case 1: resource.Name = ColorTokenService.Blue(resource.Name); break; case 2: resource.Name = ColorTokenService.Purple(resource.Name); break; case 3: resource.Name = ColorTokenService.Orange(resource.Name); break; } } } } float xp = SkillService.CalculateRegisteredSkillLevelAdjustedXP(200, level, rank); SkillService.GiveSkillXP(oPC, SkillType.Scavenging, (int)xp); } else { oPC.FloatingText(ColorTokenService.SkillCheck("Search: *failure*: (" + roll + " vs. DC: " + dc + ")")); float xp = SkillService.CalculateRegisteredSkillLevelAdjustedXP(50, level, rank); SkillService.GiveSkillXP(oPC, SkillType.Scavenging, (int)xp); } dc += RandomService.Random(3) + 1; } // Chance to destroy the scavenge point. int chanceToFullyHarvest = baseChanceToFullyHarvest - (PerkService.GetPCPerkLevel(oPC, PerkType.CarefulScavenger) * 5); string growingPlantID = point.GetLocalString("GROWING_PLANT_ID"); if (!string.IsNullOrWhiteSpace(growingPlantID)) { Data.Entity.GrowingPlant growingPlant = FarmingService.GetGrowingPlantByID(new Guid(growingPlantID)); chanceToFullyHarvest = chanceToFullyHarvest - (growingPlant.LongevityBonus); } if (chanceToFullyHarvest <= 5) { chanceToFullyHarvest = 5; } if (alwaysDestroys || RandomService.Random(100) + 1 <= chanceToFullyHarvest) { point.SetLocalInt("SCAVENGE_POINT_FULLY_HARVESTED", 1); oPC.SendMessage("This resource has been fully harvested..."); } // Otherwise the scavenge point will be refilled in 10-20 minutes. else { point.SetLocalInt("SCAVENGE_POINT_REFILL_TICKS", 100 + RandomService.Random(100)); } point.SetLocalInt("SCAVENGE_POINT_DESPAWN_TICKS", 30); return(true); }
public bool Run(params object[] args) { NWPlaceable point = (Object.OBJECT_SELF); NWPlayer oPC = (_.GetLastOpenedBy()); if (!oPC.IsPlayer) { return(false); } var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(oPC); const int baseChanceToFullyHarvest = 50; bool alwaysDestroys = point.GetLocalInt("SCAVENGE_POINT_ALWAYS_DESTROYS") == 1; bool hasBeenSearched = point.GetLocalInt("SCAVENGE_POINT_FULLY_HARVESTED") == 1; if (hasBeenSearched) { oPC.SendMessage("There's nothing left to harvest here..."); return(true); } // Not fully harvested but the timer hasn't counted down yet. int refillTick = point.GetLocalInt("SCAVENGE_POINT_REFILL_TICKS"); if (refillTick > 0) { oPC.SendMessage("You couldn't find anything new here. Check back later..."); return(true); } if (!oPC.IsPlayer && !oPC.IsDM) { return(false); } int rank = SkillService.GetPCSkillRank(oPC, SkillType.Scavenging); int lootTableID = point.GetLocalInt("SCAVENGE_POINT_LOOT_TABLE_ID"); int level = point.GetLocalInt("SCAVENGE_POINT_LEVEL"); int delta = level - rank; if (delta > 8) { oPC.SendMessage("You aren't skilled enough to scavenge through this. (Required Level: " + (level - 8) + ")"); oPC.AssignCommand(() => _.ActionInteractObject(point.Object)); return(true); } int dc = 6 + delta; if (dc <= 4) { dc = 4; } int searchAttempts = 1 + CalculateSearchAttempts(oPC); int luck = PerkService.GetCreaturePerkLevel(oPC, PerkType.Lucky) + effectiveStats.Luck; if (RandomService.Random(100) + 1 <= luck / 2) { dc--; } oPC.AssignCommand(() => _.ActionPlayAnimation(_.ANIMATION_LOOPING_GET_LOW, 1.0f, 2.0f)); for (int attempt = 1; attempt <= searchAttempts; attempt++) { int roll = RandomService.Random(20) + 1; if (roll >= dc) { oPC.FloatingText(ColorTokenService.SkillCheck("Search: *success*: (" + roll + " vs. DC: " + dc + ")")); ItemVO spawnItem = LootService.PickRandomItemFromLootTable(lootTableID); if (spawnItem == null) { return(false); } if (!string.IsNullOrWhiteSpace(spawnItem.Resref) && spawnItem.Quantity > 0) { _.CreateItemOnObject(spawnItem.Resref, point.Object, spawnItem.Quantity); } float xp = SkillService.CalculateRegisteredSkillLevelAdjustedXP(200, level, rank); SkillService.GiveSkillXP(oPC, SkillType.Scavenging, (int)xp); } else { oPC.FloatingText(ColorTokenService.SkillCheck("Search: *failure*: (" + roll + " vs. DC: " + dc + ")")); float xp = SkillService.CalculateRegisteredSkillLevelAdjustedXP(50, level, rank); SkillService.GiveSkillXP(oPC, SkillType.Scavenging, (int)xp); } dc += RandomService.Random(3) + 1; } // Chance to destroy the scavenge point. int chanceToFullyHarvest = baseChanceToFullyHarvest - (PerkService.GetCreaturePerkLevel(oPC, PerkType.CarefulScavenger) * 5); string growingPlantID = point.GetLocalString("GROWING_PLANT_ID"); if (!string.IsNullOrWhiteSpace(growingPlantID)) { Data.Entity.GrowingPlant growingPlant = FarmingService.GetGrowingPlantByID(new Guid(growingPlantID)); chanceToFullyHarvest = chanceToFullyHarvest - (growingPlant.LongevityBonus); } if (chanceToFullyHarvest <= 5) { chanceToFullyHarvest = 5; } if (alwaysDestroys || RandomService.Random(100) + 1 <= chanceToFullyHarvest) { point.SetLocalInt("SCAVENGE_POINT_FULLY_HARVESTED", 1); oPC.SendMessage("This resource has been fully harvested..."); } // Otherwise the scavenge point will be refilled in 10-20 minutes. else { point.SetLocalInt("SCAVENGE_POINT_REFILL_TICKS", 100 + RandomService.Random(100)); } point.SetLocalInt("SCAVENGE_POINT_DESPAWN_TICKS", 30); return(true); }
public void WearOff(NWCreature oCaster, NWObject oTarget, int effectiveLevel, string data) { PlayerStatService.ApplyStatChanges(oTarget.Object, null); }
public string Apply(NWCreature oCaster, NWObject oTarget, int effectiveLevel) { PlayerStatService.ApplyStatChanges(oTarget.Object, null); return(null); }
// New component items will be spawned and the appropriate properties from the base item will be transferred. public bool Run(params object[] args) { _player = (NWPlayer)args[0]; _playerItemStats = PlayerStatService.GetPlayerItemEffectiveStats(_player); int xp = 100; // Always grant at least this much XP to player. // Remove the immobilization effect foreach (var effect in _player.Effects) { if (_.GetEffectTag(effect) == "CRAFTING_IMMOBILIZATION") { _.RemoveEffect(_player, effect); } } string serializedSalvageItem = (string)args[1]; NWPlaceable tempStorage = _.GetObjectByTag("TEMP_ITEM_STORAGE"); NWItem item = SerializationService.DeserializeItem(serializedSalvageItem, tempStorage); int salvageComponentTypeID = (int)args[2]; _componentType = DataService.Get <ComponentType>(salvageComponentTypeID); // Create an item with no bonuses every time. _.CreateItemOnObject(_componentType.ReassembledResref, _player); // First check is for attack bonuses foreach (var prop in item.ItemProperties) { int propTypeID = _.GetItemPropertyType(prop); if (propTypeID == _.ITEM_PROPERTY_ATTACK_BONUS) { // Get the amount of Attack Bonus int amount = _.GetItemPropertyCostTableValue(prop); xp += ProcessProperty(amount, 3, ComponentBonusType.AttackBonusUp); } } // Now check specific custom properties which are stored as local variables on the item. xp += ProcessProperty(item.CustomAC, 3, ComponentBonusType.ACUp); xp += ProcessProperty(item.HarvestingBonus, 3, ComponentBonusType.HarvestingUp); xp += ProcessProperty(item.PilotingBonus, 3, ComponentBonusType.PilotingUp); xp += ProcessProperty(item.ScanningBonus, 3, ComponentBonusType.ScanningUp); xp += ProcessProperty(item.ScavengingBonus, 3, ComponentBonusType.ScavengingUp); xp += ProcessProperty(item.CastingSpeed, 3, ComponentBonusType.CastingSpeedUp); xp += ProcessProperty(item.CraftBonusArmorsmith, 3, ComponentBonusType.ArmorsmithUp); xp += ProcessProperty(item.CraftBonusWeaponsmith, 3, ComponentBonusType.WeaponsmithUp); xp += ProcessProperty(item.CraftBonusCooking, 3, ComponentBonusType.CookingUp); xp += ProcessProperty(item.CraftBonusEngineering, 3, ComponentBonusType.EngineeringUp); xp += ProcessProperty(item.CraftBonusFabrication, 3, ComponentBonusType.FabricationUp); xp += ProcessProperty(item.HPBonus, 5, ComponentBonusType.HPUp, 0.5f); xp += ProcessProperty(item.FPBonus, 5, ComponentBonusType.FPUp, 0.5f); xp += ProcessProperty(item.EnmityRate, 3, ComponentBonusType.EnmityUp); xp += ProcessProperty(item.ForcePotencyBonus, 3, ComponentBonusType.ForcePotencyUp); xp += ProcessProperty(item.ForceAccuracyBonus, 3, ComponentBonusType.ForceAccuracyUp); xp += ProcessProperty(item.ForceDefenseBonus, 3, ComponentBonusType.ForceDefenseUp); xp += ProcessProperty(item.ElectricalPotencyBonus, 3, ComponentBonusType.ElectricalPotencyUp); xp += ProcessProperty(item.MindPotencyBonus, 3, ComponentBonusType.MindPotencyUp); xp += ProcessProperty(item.LightPotencyBonus, 3, ComponentBonusType.LightPotencyUp); xp += ProcessProperty(item.DarkPotencyBonus, 3, ComponentBonusType.DarkPotencyUp); xp += ProcessProperty(item.ElectricalDefenseBonus, 3, ComponentBonusType.ElectricalDefenseUp); xp += ProcessProperty(item.MindDefenseBonus, 3, ComponentBonusType.MindDefenseUp); xp += ProcessProperty(item.LightDefenseBonus, 3, ComponentBonusType.LightDefenseUp); xp += ProcessProperty(item.DarkDefenseBonus, 3, ComponentBonusType.DarkDefenseUp); xp += ProcessProperty(item.LuckBonus, 3, ComponentBonusType.LuckUp); xp += ProcessProperty(item.MeditateBonus, 3, ComponentBonusType.MeditateUp); xp += ProcessProperty(item.RestBonus, 3, ComponentBonusType.RestUp); xp += ProcessProperty(item.MedicineBonus, 3, ComponentBonusType.MedicineUp); xp += ProcessProperty(item.HPRegenBonus, 3, ComponentBonusType.HPRegenUp); xp += ProcessProperty(item.FPRegenBonus, 3, ComponentBonusType.FPRegenUp); xp += ProcessProperty(item.BaseAttackBonus, 3, ComponentBonusType.BaseAttackBonusUp, 6f); xp += ProcessProperty(item.StructureBonus, 3, ComponentBonusType.StructureBonusUp); xp += ProcessProperty(item.SneakAttackBonus, 3, ComponentBonusType.SneakAttackUp); xp += ProcessProperty(item.DamageBonus, 3, ComponentBonusType.DamageUp); xp += ProcessProperty(item.StrengthBonus, 3, ComponentBonusType.StrengthUp); xp += ProcessProperty(item.DexterityBonus, 3, ComponentBonusType.DexterityUp); xp += ProcessProperty(item.ConstitutionBonus, 3, ComponentBonusType.ConstitutionUp); xp += ProcessProperty(item.WisdomBonus, 3, ComponentBonusType.WisdomUp); xp += ProcessProperty(item.IntelligenceBonus, 3, ComponentBonusType.IntelligenceUp); xp += ProcessProperty(item.CharismaBonus, 3, ComponentBonusType.CharismaUp); xp += ProcessProperty(item.DurationBonus, 3, ComponentBonusType.DurationUp); item.Destroy(); SkillService.GiveSkillXP(_player, SkillType.Harvesting, xp); return(true); }
public void OnImpact(NWPlayer player, NWObject target, int level, int spellFeatID) { float length; int damage; switch (level) { case 1: damage = RandomService.D4(1); length = 3; break; case 2: damage = RandomService.D4(1); length = 6; break; case 3: damage = RandomService.D6(1); length = 6; break; case 4: damage = RandomService.D8(1); length = 6; break; case 5: damage = RandomService.D8(1); length = 9; break; default: return; } SkillService.RegisterPCToNPCForSkill(player, target, SkillType.ForceCombat); // Resistance affects length for this perk. ForceResistanceResult resistance = CombatService.CalculateResistanceRating(player, target.Object, ForceAbilityType.Mind); length = length * resistance.Amount; if (length <= 0.0f || resistance.Type != ResistanceType.Zero) { player.SendMessage("Your Force Push effect was resisted."); return; } var effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player); int luck = PerkService.GetPCPerkLevel(player, PerkType.Lucky) + effectiveStats.Luck; if (RandomService.Random(100) + 1 <= luck) { length = length * 2; player.SendMessage("Lucky force push!"); } _.PlaySound("v_imp_frcpush"); _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage, DAMAGE_TYPE_POSITIVE), target); _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectKnockdown(), target, length); CombatService.AddTemporaryForceDefense(target.Object, ForceAbilityType.Light); }