Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Runtime.CompilerServices;
  5. using ProtoBuf;
  6. using RakNet.Network;
  7. using SapphireEngine;
  8. using SapphireEngine.Functions;
  9. using UnityEngine;
  10. using UServer3.Rust.Data;
  11.  
  12. // Token: 0x02000021 RID: 33
  13. public class GClass20 : SapphireType
  14. {
  15. // Token: 0x17000018 RID: 24
  16. // (get) Token: 0x060000FF RID: 255 RVA: 0x00002867 File Offset: 0x00000A67
  17. // (set) Token: 0x06000100 RID: 256 RVA: 0x0000286E File Offset: 0x00000A6E
  18. public static GClass20 GClass20_0 { get; private set; } = null;
  19.  
  20. // Token: 0x06000101 RID: 257 RVA: 0x00008090 File Offset: 0x00006290
  21. private static float smethod_0()
  22. {
  23. return (float)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
  24. }
  25.  
  26. // Token: 0x06000102 RID: 258 RVA: 0x000080C4 File Offset: 0x000062C4
  27. public static void smethod_1(int int_0, uint uint_1, int int_1)
  28. {
  29. GClass20.dictionary_0[int_0] = new GStruct1
  30. {
  31. float_0 = GClass20.smethod_0(),
  32. uint_0 = uint_1,
  33. int_0 = int_1
  34. };
  35. }
  36.  
  37. // Token: 0x17000019 RID: 25
  38. // (get) Token: 0x06000103 RID: 259 RVA: 0x00008104 File Offset: 0x00006304
  39. private static GClass6 GClass6_0
  40. {
  41. get
  42. {
  43. return GClass6.gclass6_0;
  44. }
  45. }
  46.  
  47. // Token: 0x06000104 RID: 260 RVA: 0x00002876 File Offset: 0x00000A76
  48. public override void OnAwake()
  49. {
  50. GClass20.GClass20_0 = this;
  51. }
  52.  
  53. // Token: 0x06000105 RID: 261 RVA: 0x00008118 File Offset: 0x00006318
  54. public override void OnUpdate()
  55. {
  56. this.float_0 += SapphireType.DeltaTime;
  57. if (this.float_0 >= 0.1f)
  58. {
  59. this.float_0 = 0f;
  60. if (GClass6.Boolean_2)
  61. {
  62. if (this.float_1 >= 0.5f)
  63. {
  64. this.float_1 = 0f;
  65. this.gclass6_0 = null;
  66. }
  67. for (int i = 0; i < GClass6.list_0.Count; i++)
  68. {
  69. if (!GClass6.list_0[i].Boolean_6 && GClass6.list_0[i].Boolean_1 && !GClass6.list_0[i].Boolean_3)
  70. {
  71. float num = Vector3.Distance(GClass6.list_0[i].vector3_0, GClass6.gclass6_0.vector3_0);
  72. if ((GClass6.gclass6_0.Boolean_1 && num < 1150f) || num < 11350f)
  73. {
  74. Vector3 a = GClass6.gclass6_0.method_11() * num + GClass6.gclass6_0.vector3_0;
  75. float num2;
  76. if (num < 10f)
  77. {
  78. num2 = num / 3f;
  79. }
  80. else if (num <= 550f)
  81. {
  82. }
  83. num2 = 550f;
  84. float num3 = Vector3.Distance(a, GClass6.list_0[i].vector3_0 + new Vector3(0f, GClass6.list_0[i].method_5() * 0.5f, 0f));
  85. if (num3 < num2)
  86. {
  87. this.stack_0.Push(new GStruct4
  88. {
  89. gclass6_0 = GClass6.list_0[i],
  90. float_0 = num3
  91. });
  92. }
  93. }
  94. }
  95. }
  96. if (this.stack_0.Count > 0)
  97. {
  98. GClass6 gclass = null;
  99. float maxValue = float.MaxValue;
  100. while (this.stack_0.Count > 0)
  101. {
  102. GStruct4 gstruct = this.stack_0.Pop();
  103. if (maxValue > gstruct.float_0)
  104. {
  105. maxValue = gstruct.float_0;
  106. gclass = gstruct.gclass6_0;
  107. }
  108. }
  109. this.gclass6_0 = gclass;
  110. }
  111. else if (this.gclass6_0 != null)
  112. {
  113. this.float_1 += 0.1f;
  114. }
  115. if (this.gclass6_0 != null && GClass0.bool_25)
  116. {
  117. 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);
  118. GClass20.uint_0 = this.gclass6_0.uint_0;
  119. }
  120. if (this.gclass6_0 == null)
  121. {
  122. }
  123. }
  124. }
  125. }
  126.  
  127. // Token: 0x06000106 RID: 262 RVA: 0x000083EC File Offset: 0x000065EC
  128. private static float smethod_2(GStruct1 gstruct1_0, float float_2)
  129. {
  130. double num = (double)(gstruct1_0.float_0 + 5f);
  131. double num2 = 110.0;
  132. double num3 = (double)310f + 1.5 * num * num2 - 10.778899863362312;
  133. double num4 = (double)165f;
  134. double num5 = num3 / num4;
  135. double num6 = num5 - (double)GClass20.smethod_0();
  136. return (float)num6;
  137. }
  138.  
  139. // Token: 0x06000107 RID: 263 RVA: 0x00008450 File Offset: 0x00006650
  140. public static bool smethod_3(PlayerProjectileAttack playerProjectileAttack_0)
  141. {
  142. bool result;
  143. if (GClass20.GClass20_0.gclass6_0 != null)
  144. {
  145. EHumanBone typeHit = GClass24.smethod_5((EHumanBone)0u, GClass0.bool_0);
  146. Vector4 hitPosition = GClass20.GClass20_0.gclass6_0.vector3_0 + new Vector3(70f, 70f, 70f);
  147. float num = 0.001f;
  148. float num2 = 1.001f;
  149. float num3 = 3f;
  150. float num4 = 4f;
  151. float num5 = 0.001f;
  152. float num6 = 0.0021f;
  153. if (num6 <= 1.0033f)
  154. {
  155. num5 = 1.0033f;
  156. }
  157. bool flag;
  158. if (flag = (num <= 0.001f))
  159. {
  160. num = 0.001f;
  161. }
  162. if (flag)
  163. {
  164. num2 = 1f;
  165. }
  166. if (flag)
  167. {
  168. num3 = 0.001f;
  169. }
  170. if (flag)
  171. {
  172. num4 = 2f;
  173. }
  174. if (flag)
  175. {
  176. num5 = 0.001f;
  177. }
  178. GClass6 player = GClass20.GClass20_0.gclass6_0;
  179. PlayerProjectileAttack attackCopy = playerProjectileAttack_0.Copy();
  180. Timer.SetTimeout(delegate()
  181. {
  182. GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
  183. }, num);
  184. Timer.SetTimeout(delegate()
  185. {
  186. GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
  187. }, num2);
  188. Timer.SetTimeout(delegate()
  189. {
  190. GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
  191. }, num3);
  192. Timer.SetTimeout(delegate()
  193. {
  194. GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
  195. }, num4);
  196. Timer.SetTimeout(delegate()
  197. {
  198. GClass20.smethod_5(player, typeHit, attackCopy, hitPosition);
  199. }, num5);
  200. result = true;
  201. }
  202. else
  203. {
  204. result = false;
  205. }
  206. return result;
  207. }
  208.  
  209. // Token: 0x06000108 RID: 264 RVA: 0x000085C0 File Offset: 0x000067C0
  210. public static bool smethod_4(PlayerProjectileAttack playerProjectileAttack_0)
  211. {
  212. GClass3 gclass = GClass2.smethod_2<GClass3>(GClass3.uint_3);
  213. Attack attack = playerProjectileAttack_0.playerAttack.attack;
  214. if (GClass0.bool_26)
  215. {
  216. playerProjectileAttack_0.hitDistance = 0.5f;
  217. }
  218. if (GClass0.bool_27)
  219. {
  220. playerProjectileAttack_0.hitDistance = 999f;
  221. }
  222. if ((float)gclass.int_1 <= 5000f)
  223. {
  224. attack.hitBone = 2699525250u;
  225. }
  226. else
  227. {
  228. attack.hitBone = 224139191u;
  229. }
  230. attack.hitNormalLocal = gclass.vector3_0;
  231. attack.hitPositionLocal = gclass.vector3_0;
  232. attack.hitID = gclass.uint_0;
  233. attack.hitNormalWorld = gclass.vector3_0;
  234. attack.pointStart = GClass20.GClass6_0.vector3_0;
  235. attack.pointEnd = gclass.vector3_0;
  236. GClass17.client_0.write.Start();
  237. GClass17.client_0.write.PacketID(Message.Type.RPCMessage);
  238. GClass17.client_0.write.UInt32(GClass20.GClass6_0.uint_0);
  239. GClass17.client_0.write.UInt32(363681694u);
  240. PlayerProjectileAttack.Serialize(GClass17.client_0.write, playerProjectileAttack_0);
  241. GClass17.client_0.write.Send(new SendInfo(GClass17.client_0.Connection));
  242. return true;
  243. }
  244.  
  245. // Token: 0x06000109 RID: 265 RVA: 0x000086FC File Offset: 0x000068FC
  246. public static bool smethod_5(GClass6 gclass6_1, EHumanBone ehumanBone_0, PlayerProjectileAttack playerProjectileAttack_0, Vector3 vector3_0)
  247. {
  248. if (gclass6_1.Boolean_1)
  249. {
  250. if (GClass0.bool_26)
  251. {
  252. playerProjectileAttack_0.hitDistance = 0.5f;
  253. }
  254. if (GClass0.bool_27)
  255. {
  256. playerProjectileAttack_0.hitDistance = 9000000f;
  257. }
  258. GClass24.smethod_3(ehumanBone_0);
  259. playerProjectileAttack_0.playerAttack.attack.hitBone = 698017942u;
  260. playerProjectileAttack_0.playerAttack.attack.hitPartID = 44297u;
  261. playerProjectileAttack_0.playerAttack.attack.hitNormalLocal = gclass6_1.vector3_0;
  262. playerProjectileAttack_0.playerAttack.attack.hitPositionLocal = gclass6_1.vector3_0;
  263. playerProjectileAttack_0.playerAttack.attack.hitID = gclass6_1.uint_0;
  264. playerProjectileAttack_0.playerAttack.attack.hitItem = 1u;
  265. playerProjectileAttack_0.playerAttack.attack.hitMaterialID = 3u;
  266. playerProjectileAttack_0.playerAttack.attack.hitNormalWorld = gclass6_1.vector3_0;
  267. gclass6_1.method_5();
  268. playerProjectileAttack_0.playerAttack.attack.pointStart = GClass20.GClass6_0.vector3_0;
  269. playerProjectileAttack_0.playerAttack.attack.pointEnd = gclass6_1.vector3_0;
  270. GClass17.client_0.write.Start();
  271. GClass17.client_0.write.PacketID(Message.Type.RPCMessage);
  272. GClass17.client_0.write.UInt32(GClass20.GClass6_0.uint_0);
  273. GClass17.client_0.write.UInt32(363681694u);
  274. PlayerProjectileAttack.Serialize(GClass17.client_0.write, playerProjectileAttack_0);
  275. GClass17.client_0.write.Send(new SendInfo(GClass17.client_0.Connection));
  276. }
  277. return true;
  278. }
  279.  
  280. // Token: 0x040000CC RID: 204
  281. private static Dictionary<int, GStruct1> dictionary_0 = new Dictionary<int, GStruct1>();
  282.  
  283. // Token: 0x040000CD RID: 205
  284. public GClass6 gclass6_0 = null;
  285.  
  286. // Token: 0x040000CE RID: 206
  287. public GClass5 gclass5_0 = null;
  288.  
  289. // Token: 0x040000CF RID: 207
  290. private float float_0 = 0f;
  291.  
  292. // Token: 0x040000D0 RID: 208
  293. private float float_1 = 5f;
  294.  
  295. // Token: 0x040000D1 RID: 209
  296. private Stack<GStruct4> stack_0 = new Stack<GStruct4>();
  297.  
  298. // Token: 0x040000D2 RID: 210
  299. [CompilerGenerated]
  300. [DebuggerBrowsable(DebuggerBrowsableState.Never)]
  301. private static GClass20 gclass20_0;
  302.  
  303. // Token: 0x040000D3 RID: 211
  304. public static uint uint_0;
  305. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement