Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Runtime.CompilerServices;
- using ProtoBuf;
- using RakNet.Network;
- using SapphireEngine;
- using SapphireEngine.Functions;
- using UnityEngine;
- using UServer3.Rust.Data;
- // Token: 0x02000021 RID: 33
- public class GClass20 : SapphireType
- {
- // Token: 0x17000018 RID: 24
- // (get) Token: 0x060000FF RID: 255 RVA: 0x00002867 File Offset: 0x00000A67
- // (set) Token: 0x06000100 RID: 256 RVA: 0x0000286E File Offset: 0x00000A6E
- public static GClass20 GClass20_0 { get; private set; } = null;
- // Token: 0x06000101 RID: 257 RVA: 0x00008090 File Offset: 0x00006290
- private static float smethod_0()
- {
- return (float)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
- }
- // Token: 0x06000102 RID: 258 RVA: 0x000080C4 File Offset: 0x000062C4
- public static void smethod_1(int int_0, uint uint_1, int int_1)
- {
- GClass20.dictionary_0[int_0] = new GStruct1
- {
- float_0 = GClass20.smethod_0(),
- uint_0 = uint_1,
- int_0 = int_1
- };
- }
- // Token: 0x17000019 RID: 25
- // (get) Token: 0x06000103 RID: 259 RVA: 0x00008104 File Offset: 0x00006304
- private static GClass6 GClass6_0
- {
- get
- {
- return GClass6.gclass6_0;
- }
- }
- // Token: 0x06000104 RID: 260 RVA: 0x00002876 File Offset: 0x00000A76
- public override void OnAwake()
- {
- GClass20.GClass20_0 = this;
- }
- // Token: 0x06000105 RID: 261 RVA: 0x00008118 File Offset: 0x00006318
- public override void OnUpdate()
- {
- this.float_0 += SapphireType.DeltaTime;
- if (this.float_0 >= 0.1f)
- {
- this.float_0 = 0f;
- if (GClass6.Boolean_2)
- {
- if (this.float_1 >= 0.5f)
- {
- this.float_1 = 0f;
- this.gclass6_0 = null;
- }
- for (int i = 0; i < GClass6.list_0.Count; i++)
- {
- if (!GClass6.list_0[i].Boolean_6 && GClass6.list_0[i].Boolean_1 && !GClass6.list_0[i].Boolean_3)
- {
- float num = Vector3.Distance(GClass6.list_0[i].vector3_0, GClass6.gclass6_0.vector3_0);
- if ((GClass6.gclass6_0.Boolean_1 && num < 1150f) || num < 11350f)
- {
- Vector3 a = GClass6.gclass6_0.method_11() * num + GClass6.gclass6_0.vector3_0;
- float num2;
- if (num < 10f)
- {
- num2 = num / 3f;
- }
- else if (num <= 550f)
- {
- }
- num2 = 550f;
- float num3 = Vector3.Distance(a, GClass6.list_0[i].vector3_0 + new Vector3(0f, GClass6.list_0[i].method_5() * 0.5f, 0f));
- if (num3 < num2)
- {
- this.stack_0.Push(new GStruct4
- {
- gclass6_0 = GClass6.list_0[i],
- float_0 = num3
- });
- }
- }
- }
- }
- if (this.stack_0.Count > 0)
- {
- GClass6 gclass = null;
- float maxValue = float.MaxValue;
- while (this.stack_0.Count > 0)
- {
- GStruct4 gstruct = this.stack_0.Pop();
- if (maxValue > gstruct.float_0)
- {
- maxValue = gstruct.float_0;
- gclass = gstruct.gclass6_0;
- }
- }
- this.gclass6_0 = gclass;
- }
- else if (this.gclass6_0 != null)
- {
- this.float_1 += 0.1f;
- }
- if (this.gclass6_0 != null && GClass0.bool_25)
- {
- GClass15.smethod_3(this.gclass6_0.vector3_0 + new Vector3(0f, this.gclass6_0.method_5() * 4.5f, 0f), "<size={1}>*FAGGOT*</size>", Color.red, 0.3f);
- GClass20.uint_0 = this.gclass6_0.uint_0;
- }
- if (this.gclass6_0 == null)
- {
- }
- }
- }
- }
- // Token: 0x06000106 RID: 262 RVA: 0x000083EC File Offset: 0x000065EC
- private static float smethod_2(GStruct1 gstruct1_0, float float_2)
- {
- double num = (double)(gstruct1_0.float_0 + 5f);
- double num2 = 110.0;
- double num3 = (double)310f + 1.5 * num * num2 - 10.778899863362312;
- double num4 = (double)165f;
- double num5 = num3 / num4;
- double num6 = num5 - (double)GClass20.smethod_0();
- return (float)num6;
- }
- // Token: 0x06000107 RID: 263 RVA: 0x00008450 File Offset: 0x00006650
- public static bool smethod_3(PlayerProjectileAttack playerProjectileAttack_0)
- {
- bool result;
- if (GClass20.GClass20_0.gclass6_0 != null)
- {
- EHumanBone typeHit = GClass24.smethod_5((EHumanBone)0u, GClass0.bool_0);
- Vector4 hitPosition = GClass20.GClass20_0.gclass6_0.vector3_0 + new Vector3(70f, 70f, 70f);
- float num = 0.001f;
- float num2 = 1.001f;
- float num3 = 3f;
- float num4 = 4f;
- float num5 = 0.001f;
- float num6 = 0.0021f;
- if (num6 <= 1.0033f)
- {
- num5 = 1.0033f;
- }
- bool flag;
- if (flag = (num <= 0.001f))
- {
- num = 0.001f;
- }
- if (flag)
- {
- num2 = 1f;
- }
- if (flag)
- {
- num3 = 0.001f;
- }
- if (flag)
- {
- num4 = 2f;
- }
- if (flag)
- {
- num5 = 0.001f;
- }
- GClass6 player = GClass20.GClass20_0.gclass6_0;
- PlayerProjectileAttack attackCopy = playerProjectileAttack_0.Copy();
- Timer.SetTimeout(delegate()
- {
- GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
- }, num);
- Timer.SetTimeout(delegate()
- {
- GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
- }, num2);
- Timer.SetTimeout(delegate()
- {
- GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
- }, num3);
- Timer.SetTimeout(delegate()
- {
- GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
- }, num4);
- Timer.SetTimeout(delegate()
- {
- GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
- }, num5);
- result = true;
- }
- else
- {
- result = false;
- }
- return result;
- }
- // Token: 0x06000108 RID: 264 RVA: 0x000085C0 File Offset: 0x000067C0
- public static bool smethod_4(PlayerProjectileAttack playerProjectileAttack_0)
- {
- GClass3 gclass = GClass2.smethod_2<GClass3>(GClass3.uint_3);
- Attack attack = playerProjectileAttack_0.playerAttack.attack;
- if (GClass0.bool_26)
- {
- playerProjectileAttack_0.hitDistance = 0.5f;
- }
- if (GClass0.bool_27)
- {
- playerProjectileAttack_0.hitDistance = 999f;
- }
- if ((float)gclass.int_1 <= 5000f)
- {
- attack.hitBone = 2699525250u;
- }
- else
- {
- attack.hitBone = 224139191u;
- }
- attack.hitNormalLocal = gclass.vector3_0;
- attack.hitPositionLocal = gclass.vector3_0;
- attack.hitID = gclass.uint_0;
- attack.hitNormalWorld = gclass.vector3_0;
- attack.pointStart = GClass20.GClass6_0.vector3_0;
- attack.pointEnd = gclass.vector3_0;
- GClass17.client_0.write.Start();
- GClass17.client_0.write.PacketID(Message.Type.RPCMessage);
- GClass17.client_0.write.UInt32(GClass20.GClass6_0.uint_0);
- GClass17.client_0.write.UInt32(363681694u);
- PlayerProjectileAttack.Serialize(GClass17.client_0.write, playerProjectileAttack_0);
- GClass17.client_0.write.Send(new SendInfo(GClass17.client_0.Connection));
- return true;
- }
- // Token: 0x06000109 RID: 265 RVA: 0x000086FC File Offset: 0x000068FC
- public static bool smethod_5(GClass6 gclass6_1, EHumanBone ehumanBone_0, PlayerProjectileAttack playerProjectileAttack_0, Vector3 vector3_0)
- {
- if (gclass6_1.Boolean_1)
- {
- if (GClass0.bool_26)
- {
- playerProjectileAttack_0.hitDistance = 0.5f;
- }
- if (GClass0.bool_27)
- {
- playerProjectileAttack_0.hitDistance = 9000000f;
- }
- GClass24.smethod_3(ehumanBone_0);
- playerProjectileAttack_0.playerAttack.attack.hitBone = 698017942u;
- playerProjectileAttack_0.playerAttack.attack.hitPartID = 44297u;
- playerProjectileAttack_0.playerAttack.attack.hitNormalLocal = gclass6_1.vector3_0;
- playerProjectileAttack_0.playerAttack.attack.hitPositionLocal = gclass6_1.vector3_0;
- playerProjectileAttack_0.playerAttack.attack.hitID = gclass6_1.uint_0;
- playerProjectileAttack_0.playerAttack.attack.hitItem = 1u;
- playerProjectileAttack_0.playerAttack.attack.hitMaterialID = 3u;
- playerProjectileAttack_0.playerAttack.attack.hitNormalWorld = gclass6_1.vector3_0;
- gclass6_1.method_5();
- playerProjectileAttack_0.playerAttack.attack.pointStart = GClass20.GClass6_0.vector3_0;
- playerProjectileAttack_0.playerAttack.attack.pointEnd = gclass6_1.vector3_0;
- GClass17.client_0.write.Start();
- GClass17.client_0.write.PacketID(Message.Type.RPCMessage);
- GClass17.client_0.write.UInt32(GClass20.GClass6_0.uint_0);
- GClass17.client_0.write.UInt32(363681694u);
- PlayerProjectileAttack.Serialize(GClass17.client_0.write, playerProjectileAttack_0);
- GClass17.client_0.write.Send(new SendInfo(GClass17.client_0.Connection));
- }
- return true;
- }
- // Token: 0x040000CC RID: 204
- private static Dictionary<int, GStruct1> dictionary_0 = new Dictionary<int, GStruct1>();
- // Token: 0x040000CD RID: 205
- public GClass6 gclass6_0 = null;
- // Token: 0x040000CE RID: 206
- public GClass5 gclass5_0 = null;
- // Token: 0x040000CF RID: 207
- private float float_0 = 0f;
- // Token: 0x040000D0 RID: 208
- private float float_1 = 5f;
- // Token: 0x040000D1 RID: 209
- private Stack<GStruct4> stack_0 = new Stack<GStruct4>();
- // Token: 0x040000D2 RID: 210
- [CompilerGenerated]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private static GClass20 gclass20_0;
- // Token: 0x040000D3 RID: 211
- public static uint uint_0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement