private void CheckPassive(object source, Client client) { if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Regenerate <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, "IsRegenerateReady", SkillCooldowns.Regenerate); if (!levelRankCooldowns.IsRegenerateReady) { return; } levelRankCooldowns.IsRegenerateReady = false; if (client.Health >= 95) { return; } client.SendNotification("~b~Regenerate ~w~You feel a bit healthier."); client.Health += levelRanks.Regenerate; }
private void HandleDeath(object source, Client client, Client killer) { AccountUtil.SetPlayerDeath(client, true); LevelRanks levelRanks = AccountUtil.GetLevelRanks(client); LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); DateTime timeOfDeath = AccountUtil.SetTimeOfDeath(client); int downerBonus = 0; if (levelRanks.Downer > 0 && cooldowns.IsDownerReady) { cooldowns.IsDownerReady = false; downerBonus = 5000 * levelRanks.Downer; client.SendChatMessage("~r~Downer ~w~You are using your extended downtime for dieing."); } NotifyPlayersOfDeath(client); NAPI.Task.Run(() => { if (!AccountUtil.IsPlayerDead(client)) { return; } if (timeOfDeath != AccountUtil.GetTimeOfDeath(client)) { return; } AccountUtil.SetPlayerDeath(client, false); }, 30000 + downerBonus); // 30 Seconds + Bonus }
public static void Use(Client client, Client target) { if (!target.Exists) { return; } LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (!cooldowns.IsIntimidateReady || ranks.Intimidate <= 0) { return; } if (client.Position.DistanceTo2D(target.Position) > 4) { return; } cooldowns.IsIntimidateReady = false; Utilities.ForcePlayerCower(target, ranks.Intimidate * 1000); client.SendChatMessage($"~r~Intimidate ~w~You look quite intimidating and ~o~{target.Name}~w~ has noticed."); target.SendChatMessage($"~r~Intimidate ~o~{client.Name} ~w~looks very intimidating you cower in fear."); }
public static int Use(Client client) { int damageRollBonus = 0; if (!client.Exists) { return(damageRollBonus); } LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (ranks.DamageRoll <= 0) { return(damageRollBonus); } if (!cooldowns.IsDamageRollReady) { return(damageRollBonus); } damageRollBonus = ranks.DamageRoll / 2; cooldowns.IsDamageRollReady = false; client.SendNotification("Your shot hit for a little more damage."); return(damageRollBonus); }
public static void Use(Client client, Client target) { if (!client.Exists) { return; } if (!target.Exists) { return; } if (client.Position.DistanceTo2D(target.Position) > 5) { return; } LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (ranks.Drag <= 0) { return; } if (!cooldowns.IsDragReady) { return; } cooldowns.IsDragReady = false; Utilities.ForcePlayerToFollowPlayer(target, client, ranks.Drag * 1500); client.SendNotification($"You are dragging ~o~{target.Name}."); target.SendNotification($"You are being dragged by ~o~{client.Name}."); }
public static int Use(Client client, int number) { LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (!cooldowns.IsQuickReady || ranks.Quick <= 0) { return(number); } cooldowns.IsQuickReady = false; client.SendNotification("You used your increased dodge chance."); return(number += ranks.Quick); }
public static bool Use(Client client) { LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (!cooldowns.IsDeadeyeReady || ranks.Deadeye <= 0) { return(false); } cooldowns.IsDeadeyeReady = false; client.SendNotification("Your shot had increased accuracy."); return(true); }
public static bool Use(Client client) { LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (!cooldowns.IsCalculatedReady || ranks.Calculated <= 0) { return(false); } client.SendNotification("Your shot hit with 100% accuracy."); cooldowns.IsCalculatedReady = false; return(true); }
public static int Use(Client client, int number) { LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (!cooldowns.IsConcentrateReady || ranks.Concentrate <= 0) { return(number); } cooldowns.IsConcentrateReady = false; client.SendNotification("Your shot hit for double damage."); return(number * 2); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) client.SetData(VariableName + Notification, false); if (!(client.GetData(EntityData.Account) is Account account)) return; LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Electric <= 0) return; LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Electric); if (!levelRankCooldowns.IsElectricReady) { client.SetData(VariableName + Notification, false); return; } if (client.IsInVehicle) { // Check if the vehicle is electric. if (!client.Vehicle.HasData("ElectricVehicle")) return; // Get the electric vehicle class. if (!(client.GetData("ElectricVehicle") is ElectricVehicle electricVehicle)) return; // If the electric vehicle's power is greater than 100. Don't try recharging. if (electricVehicle.Power > 100) return; // If the electric vehicle has less than 100 power. Add some power based on ranks put into Electric. levelRankCooldowns.IsElectricReady = false; electricVehicle.Power += levelRanks.Electric; client.SendChatMessage("~b~Electric ~w~This vehicle has recieved a little more power."); } // Has the notification been sent. if (client.GetData(VariableName + Notification)) return; client.SetData(VariableName + Notification, true); client.SendChatMessage("~b~Electric ~w~You will recharge a vehicle slightly when you enter it."); }
public void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Brute <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Brute); if (!levelRankCooldowns.IsBruteReady) { client.SetData(VariableName + Notification, false); return; } levelRankCooldowns.IsBruteReady = false; if (client.Armor >= levelRanks.Brute) { return; } if (!client.GetData(VariableName + Notification)) { client.SetData(VariableName + Notification, true); client.SendChatMessage("~r~Brute ~w~You feel your skin tighten."); client.Armor = levelRanks.Brute; } }
public static void Use(Client client, Vehicle vehicle) { if (!vehicle.Exists) { return; } LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client); LevelRanks ranks = AccountUtil.GetLevelRanks(client); if (!cooldowns.IsSmashReady || ranks.Smash <= 0) { return; } if (client.Position.DistanceTo2D(vehicle.Position) > 2.5) { return; } if (!vehicle.Locked) { return; } cooldowns.IsSmashReady = false; bool didPlayerSucceed = Skillcheck.SkillCheckPlayer(client, Skillcheck.Skills.strength, new Random().Next(15, 28), clientModifier: ranks.Smash, impact: -1); if (!didPlayerSucceed) { client.SendNotification("You try to smash the vehicle window but end up hurting your fist."); return; } vehicle.Locked = false; client.SendNotification("You successfully smash the vehicle window."); Utilities.BreakVehicleWindow(client, vehicle); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Attention <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Attention); if (!levelRankCooldowns.IsAttentionReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~o~Attention ~w~You are able to draw the attention of everyone around you."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Hidden <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Hidden); if (!levelRankCooldowns.IsHiddenReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~o~Hidden ~w~You are able to hide your nametag from others for a period of time."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Calculated <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Calculated); if (!levelRankCooldowns.IsCalculatedReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~b~Calculated ~w~First shot will hit with 100% accuracy."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Persuasion <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Persuasion); if (!levelRankCooldowns.IsPersuasionReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~o~Persuasion ~w~Next time someone questions you, you'll sound very persuasive."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Concentrate <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Concentrate); if (!levelRankCooldowns.IsConcentrateReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~g~Concentrate ~w~Your next shot will do double damage."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Medicine <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Medicine); if (!levelRankCooldowns.IsMedicineReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~b~Medicine ~w~You can heal someone else or heal yourself for additional again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Smash <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Smash - (levelRanks.Smash * 7)); if (!levelRankCooldowns.IsSmashReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~r~Smash ~w~You're able to break a window again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.VehicleSense <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.VehicleSense); if (!levelRankCooldowns.IsVehicleSenseReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~b~VehicleSense ~w~You're able to see your owned vehicles and moving vehicles again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Brains <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Brains); if (!levelRankCooldowns.IsBrainsReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~o~Brains ~w~Your next complete objective grants additional currency."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Deadeye <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Deadeye); if (!levelRankCooldowns.IsDeadeyeReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~g~Deadeye ~w~You have increased accuracy on your next shot."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Drag <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Drag); if (!levelRankCooldowns.IsDragReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~r~Drag ~w~You're able to drag someone again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Leadership <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Leadership); if (!levelRankCooldowns.IsLeadershipReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~o~Leadership ~w~You can increase your teammates ability scores again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.CrowdControl <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.CrowdControl); if (!levelRankCooldowns.IsCrowdControlReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~b~CrowdControl ~w~You are able to disable a person or vehicle temporarily again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Lockpick <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Lockpick - (levelRanks.Lockpick * 5)); if (!levelRankCooldowns.IsLockpickReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~b~Lockpick ~w~Your next lockpick will have a higher chance to succeed."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Quick <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Quick); if (!levelRankCooldowns.IsQuickReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~g~Quick ~w~You have increased dodge chance for your next hit."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Disguise <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Disguise); if (!levelRankCooldowns.IsDisguiseReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~o~Disguise ~w~You can swap to a new outfit again."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.Downer <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Downer); if (!levelRankCooldowns.IsDownerReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendChatMessage("~r~Downer ~w~You have an extended down time available."); }
private void CheckPassive(object source, Client client) { if (!client.HasData(VariableName + Notification)) { client.SetData(VariableName + Notification, false); } if (!(client.GetData(EntityData.Account) is Account account)) { return; } LevelRanks levelRanks = account.GetLevelRanks(); if (levelRanks.DamageRoll <= 0) { return; } LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client); levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.HighJump); if (!levelRankCooldowns.IsDamageRollReady) { client.SetData(VariableName + Notification, false); return; } if (client.GetData(VariableName + Notification)) { return; } client.SetData(VariableName + Notification, true); client.SendNotification("~g~Damage Roll ~w~Your next hit will have a higher damage roll."); }