WIP
This commit is contained in:
parent
e44af68309
commit
6b8988ade4
77 changed files with 3033 additions and 391 deletions
|
|
@ -1,6 +1,5 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Memory;
|
||||
using jRandomSkills.src.player;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
|
||||
|
|
@ -8,50 +7,57 @@ namespace jRandomSkills
|
|||
{
|
||||
public class Mute : ISkill
|
||||
{
|
||||
private static Skills skillName = Skills.None;
|
||||
private const float ExplosionRadius = 500.0f;
|
||||
private const int ExplosionDamage = 999;
|
||||
private static Skills skillName = Skills.AntyHead;
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
return;
|
||||
|
||||
if (Config.config.SkillsInfo.FirstOrDefault(s => s.Name == skillName.ToString())?.Active != true)
|
||||
return;
|
||||
|
||||
Utils.RegisterSkill(skillName, "#F5CB42");
|
||||
SkillUtils.RegisterSkill(skillName, "#2fc468");
|
||||
|
||||
Instance.RegisterListener<Listeners.OnEntitySpawned>(@event =>
|
||||
{
|
||||
var name = @event.DesignerName;
|
||||
if (!name.EndsWith("_projectile"))
|
||||
if (!name.EndsWith("_projectile") && name != "instanced_scripted_scene")
|
||||
return;
|
||||
|
||||
// mp_freezetime 0; mp_warmup_end
|
||||
Server.PrintToChatAll("-> " + name);
|
||||
|
||||
switch (name)
|
||||
if (@event.DesignerName == "instanced_scripted_scene")
|
||||
{
|
||||
case "flashbang_projectile":
|
||||
var flash = @event.As<CFlashbangProjectile>();
|
||||
break;
|
||||
case "smokegrenade_projectile":
|
||||
var smoke = @event.As<CSmokeGrenadeProjectile>();
|
||||
Schema.SetSchemaValue<int>(smoke.Handle, "CSmokeGrenadeProjectile", "m_nSmokeEffectTickBegin", int.MaxValue);
|
||||
Schema.SetSchemaValue<bool>(smoke.Handle, "CSmokeGrenadeProjectile", "m_bDidSmokeEffect", true);
|
||||
break;
|
||||
case "hegrenade_projectile":
|
||||
var hegrenade = @event.As<CHEGrenadeProjectile>();
|
||||
hegrenade.DetonateTime = 0;
|
||||
break;
|
||||
case "molotov_projectile":
|
||||
var molotov = @event.As<CMolotovProjectile>();
|
||||
molotov.StillTimer.Timestamp = 0;
|
||||
break;
|
||||
case "decoy_projectile":
|
||||
var decoy = @event.As<CDecoyProjectile>();
|
||||
break;
|
||||
@event.AcceptInput("Kill");
|
||||
@event.Remove();
|
||||
return;
|
||||
}
|
||||
|
||||
Server.NextFrame(() => {
|
||||
switch (name)
|
||||
{
|
||||
case "smokegrenade_projectile":
|
||||
var smoke = @event.As<CSmokeGrenadeProjectile>();
|
||||
smoke.SmokeEffectTickBegin = int.MaxValue;
|
||||
break;
|
||||
case "molotov_projectile":
|
||||
var molotov = @event.As<CMolotovProjectile>();
|
||||
molotov.Detonated = true;
|
||||
break;
|
||||
case "decoy_projectile":
|
||||
var decoy = @event.As<CDecoyProjectile>();
|
||||
decoy.ExpireTime = int.MaxValue;
|
||||
decoy.DecoyShotTick = int.MaxValue;
|
||||
decoy.ShotsRemaining = int.MaxValue;
|
||||
break;
|
||||
default:
|
||||
var grenade = @event.As<CBaseCSGrenadeProjectile>();
|
||||
grenade.DetonateTime = float.MaxValue;
|
||||
break;
|
||||
}
|
||||
|
||||
Instance.AddTimer(5f, () =>
|
||||
{
|
||||
if (@event != null && @event.IsValid)
|
||||
@event.Remove();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue