| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| . | |
| using System.Runtime.CompilerServices; |
| using System.Text; |
| using System.Text; |
| using UnityEngine; |
| using UnityEngine; |
| |
| |
| public class ItemDrop : MonoBehaviour, Hoverable, Interactable |
| public class ItemDrop : MonoBehaviour, Hoverable, Interactable |
| { |
| { |
| private void Awake() |
| private void Awake() |
| { |
| { |
| if (!string.IsNullOrEmpty(base.name)) |
| if (!string.IsNullOrEmpty(base.name)) |
| { |
| { |
| this.m_nameHash = base.name.GetStableHashCode(); |
| this.m_nameHash = base.name.GetStableHashCode(); |
| } |
| } |
| this.m_myIndex = ItemDrop.s_instances.Count; |
| this.m_myIndex = ItemDrop.s_instances.Count; |
| ItemDrop.s_instances.Add(this); |
| ItemDrop.s_instances.Add(this); |
| string prefabName = this.GetPrefabName(base.gameObject.name); |
| string prefabName = this.GetPrefabName(base.gameObject.name); |
| GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(prefabName); |
| GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(prefabName); |
| this.m_itemData.m_dropPrefab = itemPrefab; |
| this.m_itemData.m_dropPrefab = itemPrefab; |
| if (Application.isEditor) |
| if (Application.isEditor) |
| { |
| { |
| this.m_itemData.m_shared = itemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared; |
| this.m_itemData.m_shared = itemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared; |
| } |
| } |
| this.m_floating = base.GetComponent<Floating>(); |
| this.m_floating = base.GetComponent<Floating>(); |
| this.m_body = base.GetComponent<Rigidbody>(); |
| this.m_body = base.GetComponent<Rigidbody>(); |
| if (this.m_body) |
| if (this.m_body) |
| { |
| { |
| this.m_body.maxDepenetrationVelocity = 1f; |
| this.m_body.maxDepenetrationVelocity = 1f; |
| } |
| } |
| this.m_spawnTime = Time.time; |
| this.m_spawnTime = Time.time; |
| this.m_nview = base.GetComponent<ZNetView>(); |
| this.m_nview = base.GetComponent<ZNetView>(); |
| if (this.m_nview && this.m_nview.IsValid()) |
| if (this.m_nview && this.m_nview.IsValid()) |
| { |
| { |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| DateTime dateTime = new DateTime(this.m_nview.GetZDO().GetLong(ZDOVars.s_spawnTime, 0L)); |
| DateTime dateTime = new DateTime(this.m_nview.GetZDO().GetLong(ZDOVars.s_spawnTime, 0L)); |
| if (dateTime.Ticks == 0L) |
| if (dateTime.Ticks == 0L) |
| { |
| { |
| this.m_nview.GetZDO().Set(ZDOVars.s_spawnTime, ZNet.instance.GetTime().Ticks); |
| this.m_nview.GetZDO().Set(ZDOVars.s_spawnTime, ZNet.instance.GetTime().Ticks); |
| } |
| } |
| } |
| } |
| this.m_nview.Register("RequestOwn", new Action<long>(this.RPC_RequestOwn)); |
| this.m_nview.Register("RequestOwn", new Action<long>(this.RPC_RequestOwn)); |
| this.Load(); |
| this.Load(); |
| base.InvokeRepeating("SlowUpdate", UnityEngine.Random.Range(1f, 2f), 10f); |
| base.InvokeRepeating("SlowUpdate", UnityEngine.Random.Range(1f, 2f), 10f); |
| } |
| } |
| this.SetQuality(this.m_itemData.m_quality); |
| this.SetQuality(this.m_itemData.m_quality); |
| } |
| } |
| |
| |
| private void OnDestroy() |
| private void OnDestroy() |
| { |
| { |
| ItemDrop.s_instances[this.m_myIndex] = ItemDrop.s_instances[ItemDrop.s_instances.Count - 1]; |
| ItemDrop.s_instances[this.m_myIndex] = ItemDrop.s_instances[ItemDrop.s_instances.Count - 1]; |
| ItemDrop.s_instances[this.m_myIndex].m_myIndex = this.m_myIndex; |
| ItemDrop.s_instances[this.m_myIndex].m_myIndex = this.m_myIndex; |
| ItemDrop.s_instances.RemoveAt(ItemDrop.s_instances.Count - 1); |
| ItemDrop.s_instances.RemoveAt(ItemDrop.s_instances.Count - 1); |
| } |
| } |
| |
| |
| private void Start() |
| private void Start() |
| { |
| { |
| this.Save(); |
| this.Save(); |
| IEquipmentVisual componentInChildren = base.gameObject.GetComponentInChildren<IEquipmentVisual>(); |
| IEquipmentVisual componentInChildren = base.gameObject.GetComponentInChildren<IEquipmentVisual>(); |
| if (componentInChildren != null) |
| if (componentInChildren != null) |
| { |
| { |
| componentInChildren.Setup(this.m_itemData.m_variant); |
| componentInChildren.Setup(this.m_itemData.m_variant); |
| } |
| } |
| } |
| } |
| |
| |
| public static void OnCreateNew(GameObject go) |
| public static void OnCreateNew(GameObject go) |
| { |
| { |
| ItemDrop component = go.GetComponent<ItemDrop>(); |
| ItemDrop component = go.GetComponent<ItemDrop>(); |
| if (component != null) |
| if (component != null) |
| { |
| { |
| ItemDrop.OnCreateNew(component); |
| ItemDrop.OnCreateNew(component); |
| } |
| } |
| } |
| } |
| |
| |
| public static void OnCreateNew(ItemDrop item) |
| public static void OnCreateNew(ItemDrop item) |
| { |
| { |
| item.m_itemData.m_worldLevel = (int)((byte)Game.m_worldLevel); |
| item.m_itemData.m_worldLevel = (int)((byte)Game.m_worldLevel); |
| } |
| } |
| |
| |
| private double GetTimeSinceSpawned() |
| private double GetTimeSinceSpawned() |
| { |
| { |
| DateTime dateTime = new DateTime(this.m_nview.GetZDO().GetLong(ZDOVars.s_spawnTime, 0L)); |
| DateTime dateTime = new DateTime(this.m_nview.GetZDO().GetLong(ZDOVars.s_spawnTime, 0L)); |
| return (ZNet.instance.GetTime() - dateTime).TotalSeconds; |
| return (ZNet.instance.GetTime() - dateTime).TotalSeconds; |
| } |
| } |
| |
| |
| private void SlowUpdate() |
| private void SlowUpdate() |
| { |
| { |
| if (!this.m_nview.IsValid() || !this.m_nview.IsOwner()) |
| if (!this.m_nview.IsValid() || !this.m_nview.IsOwner()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.TerrainCheck(); |
| this.TerrainCheck(); |
| if (this.m_autoDestroy) |
| if (this.m_autoDestroy) |
| { |
| { |
| this.TimedDestruction(); |
| this.TimedDestruction(); |
| } |
| } |
| if (ItemDrop.s_instances.Count > 200) |
| if (ItemDrop.s_instances.Count > 200) |
| { |
| { |
| this.AutoStackItems(); |
| this.AutoStackItems(); |
| } |
| } |
| } |
| } |
| |
| |
| private void TerrainCheck() |
| private void TerrainCheck() |
| { |
| { |
| float groundHeight = ZoneSystem.instance.GetGroundHeight(base.transform.position); |
| float groundHeight = ZoneSystem.instance.GetGroundHeight(base.transform.position); |
| if (base.transform.position.y - groundHeight < -0.5f) |
| if (base.transform.position.y - groundHeight < -0.5f) |
| { |
| { |
| Vector3 position = base.transform.position; |
| Vector3 position = base.transform.position; |
| position.y = groundHeight + 0.5f; |
| position.y = groundHeight + 0.5f; |
| base.transform.position = position; |
| base.transform.position = position; |
| Rigidbody component = base.GetComponent<Rigidbody>(); |
| Rigidbody component = base.GetComponent<Rigidbody>(); |
| if (component) |
| if (component) |
| { |
| { |
| component.velocity = Vector3.zero; |
| component.velocity = Vector3.zero; |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| private void TimedDestruction() |
| private void TimedDestruction() |
| { |
| { |
| if (this.GetTimeSinceSpawned() < 3600.0) |
| if (this.GetTimeSinceSpawned() < 3600.0) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.IsInsideBase()) |
| if (this.IsInsideBase()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (Player.IsPlayerInRange(base.transform.position, 25f)) |
| if (Player.IsPlayerInRange(base.transform.position, 25f)) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.InTar()) |
| if (this.InTar()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.m_nview.Destroy(); |
| this.m_nview.Destroy(); |
| } |
| } |
| |
| |
| private bool IsInsideBase() |
| private bool IsInsideBase() |
| { |
| { |
| . | return base.transform.position.y > ZoneSystem.instance.m_waterLevel + -2f && EffectArea.IsPointInsideArea(base.transform.position, EffectArea.Type.PlayerBase, 0f); |
| return base.transform.position.y > 28f && EffectArea.IsPointInsideArea(base.transform.position, EffectArea.Type.PlayerBase, 0f); |
| } |
| } |
| |
| |
| private void AutoStackItems() |
| private void AutoStackItems() |
| { |
| { |
| if (this.m_itemData.m_shared.m_maxStackSize <= 1 || this.m_itemData.m_stack >= this.m_itemData.m_shared.m_maxStackSize) |
| if (this.m_itemData.m_shared.m_maxStackSize <= 1 || this.m_itemData.m_stack >= this.m_itemData.m_shared.m_maxStackSize) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.m_haveAutoStacked) |
| if (this.m_haveAutoStacked) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.m_haveAutoStacked = true; |
| this.m_haveAutoStacked = true; |
| if (ItemDrop.s_itemMask == 0) |
| if (ItemDrop.s_itemMask == 0) |
| { |
| { |
| ItemDrop.s_itemMask = LayerMask.GetMask(new string[] { "item" }); |
| ItemDrop.s_itemMask = LayerMask.GetMask(new string[] { "item" }); |
| } |
| } |
| bool flag = false; |
| bool flag = false; |
| foreach (Collider collider in Physics.OverlapSphere(base.transform.position, 4f, ItemDrop.s_itemMask)) |
| foreach (Collider collider in Physics.OverlapSphere(base.transform.position, 4f, ItemDrop.s_itemMask)) |
| { |
| { |
| if (collider.attachedRigidbody) |
| if (collider.attachedRigidbody) |
| { |
| { |
| ItemDrop component = collider.attachedRigidbody.GetComponent<ItemDrop>(); |
| ItemDrop component = collider.attachedRigidbody.GetComponent<ItemDrop>(); |
| if (!(component == null) && !(component == this) && component.m_itemData.m_shared.m_autoStack && !(component.m_nview == null) && component.m_nview.IsValid() && component.m_nview.IsOwner() && !(component.m_itemData.m_shared.m_name != this.m_itemData.m_shared.m_name) && component.m_itemData.m_quality == this.m_itemData.m_quality) |
| if (!(component == null) && !(component == this) && component.m_itemData.m_shared.m_autoStack && !(component.m_nview == null) && component.m_nview.IsValid() && component.m_nview.IsOwner() && !(component.m_itemData.m_shared.m_name != this.m_itemData.m_shared.m_name) && component.m_itemData.m_quality == this.m_itemData.m_quality) |
| { |
| { |
| int num = this.m_itemData.m_shared.m_maxStackSize - this.m_itemData.m_stack; |
| int num = this.m_itemData.m_shared.m_maxStackSize - this.m_itemData.m_stack; |
| if (num == 0) |
| if (num == 0) |
| { |
| { |
| break; |
| break; |
| } |
| } |
| if (component.m_itemData.m_stack <= num) |
| if (component.m_itemData.m_stack <= num) |
| { |
| { |
| this.m_itemData.m_stack += component.m_itemData.m_stack; |
| this.m_itemData.m_stack += component.m_itemData.m_stack; |
| flag = true; |
| flag = true; |
| component.m_nview.Destroy(); |
| component.m_nview.Destroy(); |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| if (flag) |
| if (flag) |
| { |
| { |
| this.Save(); |
| this.Save(); |
| } |
| } |
| } |
| } |
| |
| |
| public string GetHoverText() |
| public string GetHoverText() |
| { |
| { |
| this.Load(); |
| this.Load(); |
| string text = this.m_itemData.m_shared.m_name; |
| string text = this.m_itemData.m_shared.m_name; |
| if (this.m_itemData.m_quality > 1) |
| if (this.m_itemData.m_quality > 1) |
| { |
| { |
| text = text + "[" + this.m_itemData.m_quality.ToString() + "] "; |
| text = text + "[" + this.m_itemData.m_quality.ToString() + "] "; |
| } |
| } |
| if (this.m_itemData.m_stack > 1) |
| if (this.m_itemData.m_stack > 1) |
| { |
| { |
| text = text + " x" + this.m_itemData.m_stack.ToString(); |
| text = text + " x" + this.m_itemData.m_stack.ToString(); |
| } |
| } |
| return Localization.instance.Localize(text + "\n[<color=yellow><b>$KEY_Use</b></color>] $inventory_pickup"); |
| return Localization.instance.Localize(text + "\n[<color=yellow><b>$KEY_Use</b></color>] $inventory_pickup"); |
| } |
| } |
| |
| |
| public string GetHoverName() |
| public string GetHoverName() |
| { |
| { |
| return this.m_itemData.m_shared.m_name; |
| return this.m_itemData.m_shared.m_name; |
| } |
| } |
| |
| |
| private string GetPrefabName(string name) |
| private string GetPrefabName(string name) |
| { |
| { |
| char[] array = new char[] { '(', ' ' }; |
| char[] array = new char[] { '(', ' ' }; |
| int num = name.IndexOfAny(array); |
| int num = name.IndexOfAny(array); |
| string text; |
| string text; |
| if (num >= 0) |
| if (num >= 0) |
| { |
| { |
| text = name.Substring(0, num); |
| text = name.Substring(0, num); |
| } |
| } |
| else |
| else |
| { |
| { |
| text = name; |
| text = name; |
| } |
| } |
| return text; |
| return text; |
| } |
| } |
| |
| |
| public bool Interact(Humanoid character, bool repeat, bool alt) |
| public bool Interact(Humanoid character, bool repeat, bool alt) |
| { |
| { |
| if (repeat) |
| if (repeat) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| if (this.InTar()) |
| if (this.InTar()) |
| { |
| { |
| character.Message(MessageHud.MessageType.Center, "$hud_itemstucktar", 0, null); |
| character.Message(MessageHud.MessageType.Center, "$hud_itemstucktar", 0, null); |
| return true; |
| return true; |
| } |
| } |
| this.Pickup(character); |
| this.Pickup(character); |
| return true; |
| return true; |
| } |
| } |
| |
| |
| public bool InTar() |
| public bool InTar() |
| { |
| { |
| if (this.m_body == null) |
| if (this.m_body == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| if (this.m_floating != null) |
| if (this.m_floating != null) |
| { |
| { |
| return this.m_floating.IsInTar(); |
| return this.m_floating.IsInTar(); |
| } |
| } |
| Vector3 worldCenterOfMass = this.m_body.worldCenterOfMass; |
| Vector3 worldCenterOfMass = this.m_body.worldCenterOfMass; |
| float liquidLevel = Floating.GetLiquidLevel(worldCenterOfMass, 1f, LiquidType.Tar); |
| float liquidLevel = Floating.GetLiquidLevel(worldCenterOfMass, 1f, LiquidType.Tar); |
| return worldCenterOfMass.y < liquidLevel; |
| return worldCenterOfMass.y < liquidLevel; |
| } |
| } |
| |
| |
| public bool UseItem(Humanoid user, ItemDrop.ItemData item) |
| public bool UseItem(Humanoid user, ItemDrop.ItemData item) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| |
| |
| public void SetStack(int stack) |
| public void SetStack(int stack) |
| { |
| { |
| if (!this.m_nview.IsValid() || !this.m_nview.IsOwner()) |
| if (!this.m_nview.IsValid() || !this.m_nview.IsOwner()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.m_itemData.m_stack = stack; |
| this.m_itemData.m_stack = stack; |
| if (this.m_itemData.m_stack > this.m_itemData.m_shared.m_maxStackSize) |
| if (this.m_itemData.m_stack > this.m_itemData.m_shared.m_maxStackSize) |
| { |
| { |
| this.m_itemData.m_stack = this.m_itemData.m_shared.m_maxStackSize; |
| this.m_itemData.m_stack = this.m_itemData.m_shared.m_maxStackSize; |
| } |
| } |
| this.Save(); |
| this.Save(); |
| } |
| } |
| |
| |
| public void Pickup(Humanoid character) |
| public void Pickup(Humanoid character) |
| { |
| { |
| if (!this.m_nview.IsValid()) |
| if (!this.m_nview.IsValid()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.CanPickup(true)) |
| if (this.CanPickup(true)) |
| { |
| { |
| this.Load(); |
| this.Load(); |
| character.Pickup(base.gameObject, true, true); |
| character.Pickup(base.gameObject, true, true); |
| this.Save(); |
| this.Save(); |
| return; |
| return; |
| } |
| } |
| this.m_pickupRequester = character; |
| this.m_pickupRequester = character; |
| base.CancelInvoke("PickupUpdate"); |
| base.CancelInvoke("PickupUpdate"); |
| float num = 0.05f; |
| float num = 0.05f; |
| base.InvokeRepeating("PickupUpdate", num, num); |
| base.InvokeRepeating("PickupUpdate", num, num); |
| this.RequestOwn(); |
| this.RequestOwn(); |
| } |
| } |
| |
| |
| public void RequestOwn() |
| public void RequestOwn() |
| { |
| { |
| if (Time.time - this.m_lastOwnerRequest < this.m_ownerRetryTimeout) |
| if (Time.time - this.m_lastOwnerRequest < this.m_ownerRetryTimeout) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.m_lastOwnerRequest = Time.time; |
| this.m_lastOwnerRequest = Time.time; |
| this.m_ownerRetryTimeout = Mathf.Min(0.2f * Mathf.Pow(2f, (float)this.m_ownerRetryCounter), 30f); |
| this.m_ownerRetryTimeout = Mathf.Min(0.2f * Mathf.Pow(2f, (float)this.m_ownerRetryCounter), 30f); |
| this.m_ownerRetryCounter++; |
| this.m_ownerRetryCounter++; |
| this.m_nview.InvokeRPC("RequestOwn", Array.Empty<object>()); |
| this.m_nview.InvokeRPC("RequestOwn", Array.Empty<object>()); |
| } |
| } |
| |
| |
| public bool RemoveOne() |
| public bool RemoveOne() |
| { |
| { |
| if (!this.CanPickup(true)) |
| if (!this.CanPickup(true)) |
| { |
| { |
| this.RequestOwn(); |
| this.RequestOwn(); |
| return false; |
| return false; |
| } |
| } |
| if (this.m_itemData.m_stack <= 1) |
| if (this.m_itemData.m_stack <= 1) |
| { |
| { |
| this.m_nview.Destroy(); |
| this.m_nview.Destroy(); |
| return true; |
| return true; |
| } |
| } |
| this.m_itemData.m_stack--; |
| this.m_itemData.m_stack--; |
| this.Save(); |
| this.Save(); |
| return true; |
| return true; |
| } |
| } |
| |
| |
| public void OnPlayerDrop() |
| public void OnPlayerDrop() |
| { |
| { |
| this.m_autoPickup = false; |
| this.m_autoPickup = false; |
| } |
| } |
| |
| |
| public bool CanPickup(bool autoPickupDelay = true) |
| public bool CanPickup(bool autoPickupDelay = true) |
| { |
| { |
| if (this.m_nview == null || !this.m_nview.IsValid()) |
| if (this.m_nview == null || !this.m_nview.IsValid()) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| if (autoPickupDelay && (double)(Time.time - this.m_spawnTime) < 0.5) |
| if (autoPickupDelay && (double)(Time.time - this.m_spawnTime) < 0.5) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| this.m_ownerRetryCounter = 0; |
| this.m_ownerRetryCounter = 0; |
| this.m_ownerRetryTimeout = 0f; |
| this.m_ownerRetryTimeout = 0f; |
| } |
| } |
| return this.m_nview.IsOwner(); |
| return this.m_nview.IsOwner(); |
| } |
| } |
| |
| |
| private void RPC_RequestOwn(long uid) |
| private void RPC_RequestOwn(long uid) |
| { |
| { |
| ZLog.Log(string.Concat(new string[] |
| ZLog.Log(string.Concat(new string[] |
| { |
| { |
| "Player ", |
| "Player ", |
| uid.ToString(), |
| uid.ToString(), |
| " wants to pickup ", |
| " wants to pickup ", |
| base.gameObject.name, |
| base.gameObject.name, |
| " im: ", |
| " im: ", |
| ZDOMan.GetSessionID().ToString() |
| ZDOMan.GetSessionID().ToString() |
| })); |
| })); |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| this.m_nview.GetZDO().SetOwner(uid); |
| this.m_nview.GetZDO().SetOwner(uid); |
| return; |
| return; |
| } |
| } |
| if (this.m_nview.GetZDO().GetOwner() == uid) |
| if (this.m_nview.GetZDO().GetOwner() == uid) |
| { |
| { |
| ZLog.Log(" but they are already the owner"); |
| ZLog.Log(" but they are already the owner"); |
| return; |
| return; |
| } |
| } |
| ZLog.Log(" but neither I nor the requesting player are the owners"); |
| ZLog.Log(" but neither I nor the requesting player are the owners"); |
| } |
| } |
| |
| |
| private void PickupUpdate() |
| private void PickupUpdate() |
| { |
| { |
| if (!this.m_nview.IsValid()) |
| if (!this.m_nview.IsValid()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.CanPickup(true)) |
| if (this.CanPickup(true)) |
| { |
| { |
| ZLog.Log("Im finally the owner"); |
| ZLog.Log("Im finally the owner"); |
| base.CancelInvoke("PickupUpdate"); |
| base.CancelInvoke("PickupUpdate"); |
| this.Load(); |
| this.Load(); |
| (this.m_pickupRequester as Player).Pickup(base.gameObject, true, true); |
| (this.m_pickupRequester as Player).Pickup(base.gameObject, true, true); |
| this.Save(); |
| this.Save(); |
| return; |
| return; |
| } |
| } |
| ZLog.Log("Im still nto the owner"); |
| ZLog.Log("Im still nto the owner"); |
| } |
| } |
| |
| |
| private void Save() |
| private void Save() |
| { |
| { |
| if (this.m_nview == null || !this.m_nview.IsValid()) |
| if (this.m_nview == null || !this.m_nview.IsValid()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| ItemDrop.SaveToZDO(this.m_itemData, this.m_nview.GetZDO()); |
| ItemDrop.SaveToZDO(this.m_itemData, this.m_nview.GetZDO()); |
| } |
| } |
| } |
| } |
| |
| |
| public void Load() |
| public void Load() |
| { |
| { |
| if (this.m_nview == null || !this.m_nview.IsValid()) |
| if (this.m_nview == null || !this.m_nview.IsValid()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| ZDO zdo = this.m_nview.GetZDO(); |
| ZDO zdo = this.m_nview.GetZDO(); |
| if (zdo.DataRevision == this.m_loadedRevision) |
| if (zdo.DataRevision == this.m_loadedRevision) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.m_loadedRevision = zdo.DataRevision; |
| this.m_loadedRevision = zdo.DataRevision; |
| ItemDrop.LoadFromZDO(this.m_itemData, zdo); |
| ItemDrop.LoadFromZDO(this.m_itemData, zdo); |
| this.SetQuality(this.m_itemData.m_quality); |
| this.SetQuality(this.m_itemData.m_quality); |
| } |
| } |
| |
| |
| public void LoadFromExternalZDO(ZDO zdo) |
| public void LoadFromExternalZDO(ZDO zdo) |
| { |
| { |
| ItemDrop.LoadFromZDO(this.m_itemData, zdo); |
| ItemDrop.LoadFromZDO(this.m_itemData, zdo); |
| ItemDrop.SaveToZDO(this.m_itemData, this.m_nview.GetZDO()); |
| ItemDrop.SaveToZDO(this.m_itemData, this.m_nview.GetZDO()); |
| this.SetQuality(this.m_itemData.m_quality); |
| this.SetQuality(this.m_itemData.m_quality); |
| } |
| } |
| |
| |
| public static void SaveToZDO(ItemDrop.ItemData itemData, ZDO zdo) |
| public static void SaveToZDO(ItemDrop.ItemData itemData, ZDO zdo) |
| { |
| { |
| zdo.Set(ZDOVars.s_durability, itemData.m_durability); |
| zdo.Set(ZDOVars.s_durability, itemData.m_durability); |
| zdo.Set(ZDOVars.s_stack, itemData.m_stack, false); |
| zdo.Set(ZDOVars.s_stack, itemData.m_stack, false); |
| zdo.Set(ZDOVars.s_quality, itemData.m_quality, false); |
| zdo.Set(ZDOVars.s_quality, itemData.m_quality, false); |
| zdo.Set(ZDOVars.s_variant, itemData.m_variant, false); |
| zdo.Set(ZDOVars.s_variant, itemData.m_variant, false); |
| zdo.Set(ZDOVars.s_crafterID, itemData.m_crafterID); |
| zdo.Set(ZDOVars.s_crafterID, itemData.m_crafterID); |
| zdo.Set(ZDOVars.s_crafterName, itemData.m_crafterName); |
| zdo.Set(ZDOVars.s_crafterName, itemData.m_crafterName); |
| zdo.Set(ZDOVars.s_dataCount, itemData.m_customData.Count, false); |
| zdo.Set(ZDOVars.s_dataCount, itemData.m_customData.Count, false); |
| int num = 0; |
| int num = 0; |
| foreach (KeyValuePair<string, string> keyValuePair in itemData.m_customData) |
| foreach (KeyValuePair<string, string> keyValuePair in itemData.m_customData) |
| { |
| { |
| zdo.Set(string.Format("data_{0}", num), keyValuePair.Key); |
| zdo.Set(string.Format("data_{0}", num), keyValuePair.Key); |
| zdo.Set(string.Format("data__{0}", num++), keyValuePair.Value); |
| zdo.Set(string.Format("data__{0}", num++), keyValuePair.Value); |
| } |
| } |
| zdo.Set(ZDOVars.s_worldLevel, itemData.m_worldLevel, false); |
| zdo.Set(ZDOVars.s_worldLevel, itemData.m_worldLevel, false); |
| zdo.Set(ZDOVars.s_pickedUp, itemData.m_pickedUp); |
| zdo.Set(ZDOVars.s_pickedUp, itemData.m_pickedUp); |
| } |
| } |
| |
| |
| private static void LoadFromZDO(ItemDrop.ItemData itemData, ZDO zdo) |
| private static void LoadFromZDO(ItemDrop.ItemData itemData, ZDO zdo) |
| { |
| { |
| itemData.m_durability = zdo.GetFloat(ZDOVars.s_durability, itemData.m_durability); |
| itemData.m_durability = zdo.GetFloat(ZDOVars.s_durability, itemData.m_durability); |
| itemData.m_stack = zdo.GetInt(ZDOVars.s_stack, itemData.m_stack); |
| itemData.m_stack = zdo.GetInt(ZDOVars.s_stack, itemData.m_stack); |
| itemData.m_quality = zdo.GetInt(ZDOVars.s_quality, itemData.m_quality); |
| itemData.m_quality = zdo.GetInt(ZDOVars.s_quality, itemData.m_quality); |
| itemData.m_variant = zdo.GetInt(ZDOVars.s_variant, itemData.m_variant); |
| itemData.m_variant = zdo.GetInt(ZDOVars.s_variant, itemData.m_variant); |
| itemData.m_crafterID = zdo.GetLong(ZDOVars.s_crafterID, itemData.m_crafterID); |
| itemData.m_crafterID = zdo.GetLong(ZDOVars.s_crafterID, itemData.m_crafterID); |
| itemData.m_crafterName = zdo.GetString(ZDOVars.s_crafterName, itemData.m_crafterName); |
| itemData.m_crafterName = zdo.GetString(ZDOVars.s_crafterName, itemData.m_crafterName); |
| int @int = zdo.GetInt(ZDOVars.s_dataCount, 0); |
| int @int = zdo.GetInt(ZDOVars.s_dataCount, 0); |
| itemData.m_customData.Clear(); |
| itemData.m_customData.Clear(); |
| for (int i = 0; i < @int; i++) |
| for (int i = 0; i < @int; i++) |
| { |
| { |
| itemData.m_customData[zdo.GetString(string.Format("data_{0}", i), "")] = zdo.GetString(string.Format("data__{0}", i), ""); |
| itemData.m_customData[zdo.GetString(string.Format("data_{0}", i), "")] = zdo.GetString(string.Format("data__{0}", i), ""); |
| } |
| } |
| itemData.m_worldLevel = (int)((byte)zdo.GetInt(ZDOVars.s_worldLevel, itemData.m_worldLevel)); |
| itemData.m_worldLevel = (int)((byte)zdo.GetInt(ZDOVars.s_worldLevel, itemData.m_worldLevel)); |
| itemData.m_pickedUp = zdo.GetBool(ZDOVars.s_pickedUp, itemData.m_pickedUp); |
| itemData.m_pickedUp = zdo.GetBool(ZDOVars.s_pickedUp, itemData.m_pickedUp); |
| } |
| } |
| |
| |
| public static void SaveToZDO(int index, ItemDrop.ItemData itemData, ZDO zdo) |
| public static void SaveToZDO(int index, ItemDrop.ItemData itemData, ZDO zdo) |
| { |
| { |
| zdo.Set(index.ToString() + "_durability", itemData.m_durability); |
| zdo.Set(index.ToString() + "_durability", itemData.m_durability); |
| zdo.Set(index.ToString() + "_stack", itemData.m_stack); |
| zdo.Set(index.ToString() + "_stack", itemData.m_stack); |
| zdo.Set(index.ToString() + "_quality", itemData.m_quality); |
| zdo.Set(index.ToString() + "_quality", itemData.m_quality); |
| zdo.Set(index.ToString() + "_variant", itemData.m_variant); |
| zdo.Set(index.ToString() + "_variant", itemData.m_variant); |
| zdo.Set(index.ToString() + "_crafterID", itemData.m_crafterID); |
| zdo.Set(index.ToString() + "_crafterID", itemData.m_crafterID); |
| zdo.Set(index.ToString() + "_crafterName", itemData.m_crafterName); |
| zdo.Set(index.ToString() + "_crafterName", itemData.m_crafterName); |
| zdo.Set(index.ToString() + "_dataCount", itemData.m_customData.Count); |
| zdo.Set(index.ToString() + "_dataCount", itemData.m_customData.Count); |
| int num = 0; |
| int num = 0; |
| foreach (KeyValuePair<string, string> keyValuePair in itemData.m_customData) |
| foreach (KeyValuePair<string, string> keyValuePair in itemData.m_customData) |
| { |
| { |
| zdo.Set(string.Format("{0}_data_{1}", index, num), keyValuePair.Key); |
| zdo.Set(string.Format("{0}_data_{1}", index, num), keyValuePair.Key); |
| zdo.Set(string.Format("{0}_data__{1}", index, num++), keyValuePair.Value); |
| zdo.Set(string.Format("{0}_data__{1}", index, num++), keyValuePair.Value); |
| } |
| } |
| zdo.Set(index.ToString() + "_worldLevel", itemData.m_worldLevel); |
| zdo.Set(index.ToString() + "_worldLevel", itemData.m_worldLevel); |
| zdo.Set(index.ToString() + "_pickedUp", itemData.m_pickedUp); |
| zdo.Set(index.ToString() + "_pickedUp", itemData.m_pickedUp); |
| } |
| } |
| |
| |
| public static void LoadFromZDO(int index, ItemDrop.ItemData itemData, ZDO zdo) |
| public static void LoadFromZDO(int index, ItemDrop.ItemData itemData, ZDO zdo) |
| { |
| { |
| itemData.m_durability = zdo.GetFloat(index.ToString() + "_durability", itemData.m_durability); |
| itemData.m_durability = zdo.GetFloat(index.ToString() + "_durability", itemData.m_durability); |
| itemData.m_stack = zdo.GetInt(index.ToString() + "_stack", itemData.m_stack); |
| itemData.m_stack = zdo.GetInt(index.ToString() + "_stack", itemData.m_stack); |
| itemData.m_quality = zdo.GetInt(index.ToString() + "_quality", itemData.m_quality); |
| itemData.m_quality = zdo.GetInt(index.ToString() + "_quality", itemData.m_quality); |
| itemData.m_variant = zdo.GetInt(index.ToString() + "_variant", itemData.m_variant); |
| itemData.m_variant = zdo.GetInt(index.ToString() + "_variant", itemData.m_variant); |
| itemData.m_crafterID = zdo.GetLong(index.ToString() + "_crafterID", itemData.m_crafterID); |
| itemData.m_crafterID = zdo.GetLong(index.ToString() + "_crafterID", itemData.m_crafterID); |
| itemData.m_crafterName = zdo.GetString(index.ToString() + "_crafterName", itemData.m_crafterName); |
| itemData.m_crafterName = zdo.GetString(index.ToString() + "_crafterName", itemData.m_crafterName); |
| int @int = zdo.GetInt(index.ToString() + "_dataCount", 0); |
| int @int = zdo.GetInt(index.ToString() + "_dataCount", 0); |
| for (int i = 0; i < @int; i++) |
| for (int i = 0; i < @int; i++) |
| { |
| { |
| itemData.m_customData[zdo.GetString(string.Format("{0}_data_{1}", index, i), "")] = zdo.GetString(string.Format("{0}_data__{1}", index, i), ""); |
| itemData.m_customData[zdo.GetString(string.Format("{0}_data_{1}", index, i), "")] = zdo.GetString(string.Format("{0}_data__{1}", index, i), ""); |
| } |
| } |
| itemData.m_worldLevel = (int)((byte)zdo.GetInt(index.ToString() + "_worldLevel", itemData.m_worldLevel)); |
| itemData.m_worldLevel = (int)((byte)zdo.GetInt(index.ToString() + "_worldLevel", itemData.m_worldLevel)); |
| itemData.m_pickedUp = zdo.GetBool(index.ToString() + "_pickedUp", itemData.m_pickedUp); |
| itemData.m_pickedUp = zdo.GetBool(index.ToString() + "_pickedUp", itemData.m_pickedUp); |
| } |
| } |
| |
| |
| public static ItemDrop DropItem(ItemDrop.ItemData item, int amount, Vector3 position, Quaternion rotation) |
| public static ItemDrop DropItem(ItemDrop.ItemData item, int amount, Vector3 position, Quaternion rotation) |
| { |
| { |
| ItemDrop component = UnityEngine.Object.Instantiate<GameObject>(item.m_dropPrefab, position, rotation).GetComponent<ItemDrop>(); |
| ItemDrop component = UnityEngine.Object.Instantiate<GameObject>(item.m_dropPrefab, position, rotation).GetComponent<ItemDrop>(); |
| component.m_itemData = item.Clone(); |
| component.m_itemData = item.Clone(); |
| if (component.m_itemData.m_quality > 1) |
| if (component.m_itemData.m_quality > 1) |
| { |
| { |
| component.SetQuality(component.m_itemData.m_quality); |
| component.SetQuality(component.m_itemData.m_quality); |
| } |
| } |
| if (amount > 0) |
| if (amount > 0) |
| { |
| { |
| component.m_itemData.m_stack = amount; |
| component.m_itemData.m_stack = amount; |
| } |
| } |
| if (component.m_onDrop != null) |
| if (component.m_onDrop != null) |
| { |
| { |
| component.m_onDrop(component); |
| component.m_onDrop(component); |
| } |
| } |
| component.Save(); |
| component.Save(); |
| return component; |
| return component; |
| } |
| } |
| |
| |
| public void SetQuality(int quality) |
| public void SetQuality(int quality) |
| { |
| { |
| this.m_itemData.m_quality = quality; |
| this.m_itemData.m_quality = quality; |
| base.transform.localScale = this.m_itemData.GetScale(); |
| base.transform.localScale = this.m_itemData.GetScale(); |
| } |
| } |
| |
| |
| private void OnDrawGizmos() |
| private void OnDrawGizmos() |
| { |
| { |
| } |
| } |
| |
| |
| public int NameHash() |
| public int NameHash() |
| { |
| { |
| return this.m_nameHash; |
| return this.m_nameHash; |
| } |
| } |
| |
| |
| private static List<ItemDrop> s_instances = new List<ItemDrop>(); |
| private static List<ItemDrop> s_instances = new List<ItemDrop>(); |
| |
| |
| private int m_myIndex = -1; |
| private int m_myIndex = -1; |
| |
| |
| public bool m_autoPickup = true; |
| public bool m_autoPickup = true; |
| |
| |
| public bool m_autoDestroy = true; |
| public bool m_autoDestroy = true; |
| |
| |
| public ItemDrop.ItemData m_itemData = new ItemDrop.ItemData(); |
| public ItemDrop.ItemData m_itemData = new ItemDrop.ItemData(); |
| |
| |
| [HideInInspector] |
| [HideInInspector] |
| public Action<ItemDrop> m_onDrop; |
| public Action<ItemDrop> m_onDrop; |
| |
| |
| private int m_nameHash; |
| private int m_nameHash; |
| |
| |
| private Floating m_floating; |
| private Floating m_floating; |
| |
| |
| private Rigidbody m_body; |
| private Rigidbody m_body; |
| |
| |
| private ZNetView m_nview; |
| private ZNetView m_nview; |
| |
| |
| private Character m_pickupRequester; |
| private Character m_pickupRequester; |
| |
| |
| private float m_lastOwnerRequest; |
| private float m_lastOwnerRequest; |
| |
| |
| private int m_ownerRetryCounter; |
| private int m_ownerRetryCounter; |
| |
| |
| private float m_ownerRetryTimeout; |
| private float m_ownerRetryTimeout; |
| |
| |
| private float m_spawnTime; |
| private float m_spawnTime; |
| |
| |
| private uint m_loadedRevision = uint.MaxValue; |
| private uint m_loadedRevision = uint.MaxValue; |
| |
| |
| private const double c_AutoDestroyTimeout = 3600.0; |
| private const double c_AutoDestroyTimeout = 3600.0; |
| |
| |
| private const double c_AutoPickupDelay = 0.5; |
| private const double c_AutoPickupDelay = 0.5; |
| |
| |
| private const float c_AutoDespawnBaseMinAltitude = -2f; |
| private const float c_AutoDespawnBaseMinAltitude = -2f; |
| |
| |
| private const int c_AutoStackThreshold = 200; |
| private const int c_AutoStackThreshold = 200; |
| |
| |
| private const float c_AutoStackRange = 4f; |
| private const float c_AutoStackRange = 4f; |
| |
| |
| private bool m_haveAutoStacked; |
| private bool m_haveAutoStacked; |
| |
| |
| private static int s_itemMask = 0; |
| private static int s_itemMask = 0; |
| |
| |
| [Serializable] |
| [Serializable] |
| public class ItemData |
| public class ItemData |
| { |
| { |
| public ItemDrop.ItemData Clone() |
| public ItemDrop.ItemData Clone() |
| { |
| { |
| ItemDrop.ItemData itemData = base.MemberwiseClone() as ItemDrop.ItemData; |
| ItemDrop.ItemData itemData = base.MemberwiseClone() as ItemDrop.ItemData; |
| itemData.m_customData = new Dictionary<string, string>(this.m_customData); |
| itemData.m_customData = new Dictionary<string, string>(this.m_customData); |
| return itemData; |
| return itemData; |
| } |
| } |
| |
| |
| public bool IsEquipable() |
| public bool IsEquipable() |
| { |
| { |
| return this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Tool || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.OneHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shield || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Helmet || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Chest || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Legs || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shoulder || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Ammo || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Torch || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Utility; |
| return this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Tool || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.OneHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shield || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Helmet || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Chest || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Legs || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shoulder || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Ammo || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Torch || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Utility; |
| } |
| } |
| |
| |
| public bool IsWeapon() |
| public bool IsWeapon() |
| { |
| { |
| return this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.OneHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Torch; |
| return this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.OneHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Torch; |
| } |
| } |
| |
| |
| public bool IsTwoHanded() |
| public bool IsTwoHanded() |
| { |
| { |
| return this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow; |
| return this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft || this.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow; |
| } |
| } |
| |
| |
| public bool HavePrimaryAttack() |
| public bool HavePrimaryAttack() |
| { |
| { |
| return !string.IsNullOrEmpty(this.m_shared.m_attack.m_attackAnimation); |
| return !string.IsNullOrEmpty(this.m_shared.m_attack.m_attackAnimation); |
| } |
| } |
| |
| |
| public bool HaveSecondaryAttack() |
| public bool HaveSecondaryAttack() |
| { |
| { |
| return !string.IsNullOrEmpty(this.m_shared.m_secondaryAttack.m_attackAnimation); |
| return !string.IsNullOrEmpty(this.m_shared.m_secondaryAttack.m_attackAnimation); |
| } |
| } |
| |
| |
| public float GetArmor() |
| public float GetArmor() |
| { |
| { |
| return this.GetArmor(this.m_quality, (float)this.m_worldLevel); |
| return this.GetArmor(this.m_quality, (float)this.m_worldLevel); |
| } |
| } |
| |
| |
| public float GetArmor(int quality, float worldLevel) |
| public float GetArmor(int quality, float worldLevel) |
| { |
| { |
| return this.m_shared.m_armor + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_armorPerLevel + worldLevel * (float)Game.instance.m_worldLevelGearBaseAC; |
| return this.m_shared.m_armor + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_armorPerLevel + worldLevel * (float)Game.instance.m_worldLevelGearBaseAC; |
| } |
| } |
| |
| |
| public int GetValue() |
| public int GetValue() |
| { |
| { |
| return this.m_shared.m_value * this.m_stack; |
| return this.m_shared.m_value * this.m_stack; |
| } |
| } |
| |
| |
| public float GetWeight() |
| public float GetWeight() |
| { |
| { |
| float num = this.m_shared.m_weight * (float)this.m_stack; |
| float num = this.m_shared.m_weight * (float)this.m_stack; |
| if (this.m_shared.m_scaleWeightByQuality != 0f && this.m_quality != 1) |
| if (this.m_shared.m_scaleWeightByQuality != 0f && this.m_quality != 1) |
| { |
| { |
| num += num * (float)(this.m_quality - 1) * this.m_shared.m_scaleWeightByQuality; |
| num += num * (float)(this.m_quality - 1) * this.m_shared.m_scaleWeightByQuality; |
| } |
| } |
| return num; |
| return num; |
| } |
| } |
| |
| |
| public float GetNonStackedWeight() |
| public float GetNonStackedWeight() |
| { |
| { |
| float num = this.m_shared.m_weight; |
| float num = this.m_shared.m_weight; |
| if (this.m_shared.m_scaleWeightByQuality != 0f && this.m_quality != 1) |
| if (this.m_shared.m_scaleWeightByQuality != 0f && this.m_quality != 1) |
| { |
| { |
| num += num * (float)(this.m_quality - 1) * this.m_shared.m_scaleWeightByQuality; |
| num += num * (float)(this.m_quality - 1) * this.m_shared.m_scaleWeightByQuality; |
| } |
| } |
| return num; |
| return num; |
| } |
| } |
| |
| |
| public HitData.DamageTypes GetDamage() |
| public HitData.DamageTypes GetDamage() |
| { |
| { |
| return this.GetDamage(this.m_quality, (float)this.m_worldLevel); |
| return this.GetDamage(this.m_quality, (float)this.m_worldLevel); |
| } |
| } |
| |
| |
| public float GetDurabilityPercentage() |
| public float GetDurabilityPercentage() |
| { |
| { |
| float maxDurability = this.GetMaxDurability(); |
| float maxDurability = this.GetMaxDurability(); |
| if (maxDurability == 0f) |
| if (maxDurability == 0f) |
| { |
| { |
| return 1f; |
| return 1f; |
| } |
| } |
| return Mathf.Clamp01(this.m_durability / maxDurability); |
| return Mathf.Clamp01(this.m_durability / maxDurability); |
| } |
| } |
| |
| |
| public float GetMaxDurability() |
| public float GetMaxDurability() |
| { |
| { |
| return this.GetMaxDurability(this.m_quality); |
| return this.GetMaxDurability(this.m_quality); |
| } |
| } |
| |
| |
| public float GetMaxDurability(int quality) |
| public float GetMaxDurability(int quality) |
| { |
| { |
| return this.m_shared.m_maxDurability + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_durabilityPerLevel; |
| return this.m_shared.m_maxDurability + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_durabilityPerLevel; |
| } |
| } |
| |
| |
| public HitData.DamageTypes GetDamage(int quality, float worldLevel) |
| public HitData.DamageTypes GetDamage(int quality, float worldLevel) |
| { |
| { |
| HitData.DamageTypes damages = this.m_shared.m_damages; |
| HitData.DamageTypes damages = this.m_shared.m_damages; |
| if (quality > 1) |
| if (quality > 1) |
| { |
| { |
| damages.Add(this.m_shared.m_damagesPerLevel, quality - 1); |
| damages.Add(this.m_shared.m_damagesPerLevel, quality - 1); |
| } |
| } |
| if (worldLevel > 0f) |
| if (worldLevel > 0f) |
| { |
| { |
| damages.IncreaseEqually(worldLevel * (float)Game.instance.m_worldLevelGearBaseDamage, true); |
| damages.IncreaseEqually(worldLevel * (float)Game.instance.m_worldLevelGearBaseDamage, true); |
| } |
| } |
| return damages; |
| return damages; |
| } |
| } |
| |
| |
| public float GetBaseBlockPower() |
| public float GetBaseBlockPower() |
| { |
| { |
| return this.GetBaseBlockPower(this.m_quality); |
| return this.GetBaseBlockPower(this.m_quality); |
| } |
| } |
| |
| |
| public float GetBaseBlockPower(int quality) |
| public float GetBaseBlockPower(int quality) |
| { |
| { |
| return this.m_shared.m_blockPower + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_blockPowerPerLevel; |
| return this.m_shared.m_blockPower + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_blockPowerPerLevel; |
| } |
| } |
| |
| |
| public float GetBlockPower(float skillFactor) |
| public float GetBlockPower(float skillFactor) |
| { |
| { |
| return this.GetBlockPower(this.m_quality, skillFactor); |
| return this.GetBlockPower(this.m_quality, skillFactor); |
| } |
| } |
| |
| |
| public float GetBlockPower(int quality, float skillFactor) |
| public float GetBlockPower(int quality, float skillFactor) |
| { |
| { |
| float baseBlockPower = this.GetBaseBlockPower(quality); |
| float baseBlockPower = this.GetBaseBlockPower(quality); |
| return baseBlockPower + baseBlockPower * skillFactor * 0.5f; |
| return baseBlockPower + baseBlockPower * skillFactor * 0.5f; |
| } |
| } |
| |
| |
| public float GetBlockPowerTooltip(int quality) |
| public float GetBlockPowerTooltip(int quality) |
| { |
| { |
| if (Player.m_localPlayer == null) |
| if (Player.m_localPlayer == null) |
| { |
| { |
| return 0f; |
| return 0f; |
| } |
| } |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(Skills.SkillType.Blocking); |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(Skills.SkillType.Blocking); |
| return this.GetBlockPower(quality, skillFactor); |
| return this.GetBlockPower(quality, skillFactor); |
| } |
| } |
| |
| |
| public float GetDrawStaminaDrain() |
| public float GetDrawStaminaDrain() |
| { |
| { |
| if (this.m_shared.m_attack.m_drawStaminaDrain <= 0f) |
| if (this.m_shared.m_attack.m_drawStaminaDrain <= 0f) |
| { |
| { |
| return 0f; |
| return 0f; |
| } |
| } |
| float drawStaminaDrain = this.m_shared.m_attack.m_drawStaminaDrain; |
| float drawStaminaDrain = this.m_shared.m_attack.m_drawStaminaDrain; |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(this.m_shared.m_skillType); |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(this.m_shared.m_skillType); |
| return drawStaminaDrain - drawStaminaDrain * 0.33f * skillFactor; |
| return drawStaminaDrain - drawStaminaDrain * 0.33f * skillFactor; |
| } |
| } |
| |
| |
| . | |
| public float GetDrawEitrDrain() |
| |
| { |
| |
| if (this.m_shared.m_attack.m_drawEitrDrain <= 0f) |
| |
| { |
| |
| return 0f; |
| |
| } |
| |
| float drawEitrDrain = this.m_shared.m_attack.m_drawEitrDrain; |
| |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(this.m_shared.m_skillType); |
| |
| return drawEitrDrain - drawEitrDrain * 0.33f * skillFactor; |
| |
| } |
| |
| |
| public float GetWeaponLoadingTime() |
| public float GetWeaponLoadingTime() |
| { |
| { |
| if (this.m_shared.m_attack.m_requiresReload) |
| if (this.m_shared.m_attack.m_requiresReload) |
| { |
| { |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(this.m_shared.m_skillType); |
| float skillFactor = Player.m_localPlayer.GetSkillFactor(this.m_shared.m_skillType); |
| return Mathf.Lerp(this.m_shared.m_attack.m_reloadTime, this.m_shared.m_attack.m_reloadTime * 0.5f, skillFactor); |
| return Mathf.Lerp(this.m_shared.m_attack.m_reloadTime, this.m_shared.m_attack.m_reloadTime * 0.5f, skillFactor); |
| } |
| } |
| return 1f; |
| return 1f; |
| } |
| } |
| |
| |
| public float GetDeflectionForce() |
| public float GetDeflectionForce() |
| { |
| { |
| return this.GetDeflectionForce(this.m_quality); |
| return this.GetDeflectionForce(this.m_quality); |
| } |
| } |
| |
| |
| public float GetDeflectionForce(int quality) |
| public float GetDeflectionForce(int quality) |
| { |
| { |
| return this.m_shared.m_deflectionForce + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_deflectionForcePerLevel; |
| return this.m_shared.m_deflectionForce + (float)Mathf.Max(0, quality - 1) * this.m_shared.m_deflectionForcePerLevel; |
| } |
| } |
| |
| |
| public Vector3 GetScale() |
| public Vector3 GetScale() |
| { |
| { |
| return this.GetScale((float)this.m_quality); |
| return this.GetScale((float)this.m_quality); |
| } |
| } |
| |
| |
| public Vector3 GetScale(float quality) |
| public Vector3 GetScale(float quality) |
| { |
| { |
| float num = 1f + (quality - 1f) * this.m_shared.m_scaleByQuality; |
| float num = 1f + (quality - 1f) * this.m_shared.m_scaleByQuality; |
| return new Vector3(num, num, num); |
| return new Vector3(num, num, num); |
| } |
| } |
| |
| |
| public string GetTooltip() |
| public string GetTooltip() |
| { |
| { |
| return ItemDrop.ItemData.GetTooltip(this, this.m_quality, false, (float)this.m_worldLevel); |
| return ItemDrop.ItemData.GetTooltip(this, this.m_quality, false, (float)this.m_worldLevel); |
| } |
| } |
| |
| |
| public Sprite GetIcon() |
| public Sprite GetIcon() |
| { |
| { |
| return this.m_shared.m_icons[this.m_variant]; |
| return this.m_shared.m_icons[this.m_variant]; |
| } |
| } |
| |
| |
| private static void AddHandedTip(ItemDrop.ItemData item, StringBuilder text) |
| private static void AddHandedTip(ItemDrop.ItemData item, StringBuilder text) |
| { |
| { |
| ItemDrop.ItemData.ItemType itemType = item.m_shared.m_itemType; |
| ItemDrop.ItemData.ItemType itemType = item.m_shared.m_itemType; |
| if (itemType <= ItemDrop.ItemData.ItemType.TwoHandedWeapon) |
| if (itemType <= ItemDrop.ItemData.ItemType.TwoHandedWeapon) |
| { |
| { |
| switch (itemType) |
| switch (itemType) |
| { |
| { |
| case ItemDrop.ItemData.ItemType.OneHandedWeapon: |
| case ItemDrop.ItemData.ItemType.OneHandedWeapon: |
| case ItemDrop.ItemData.ItemType.Shield: |
| case ItemDrop.ItemData.ItemType.Shield: |
| break; |
| break; |
| case ItemDrop.ItemData.ItemType.Bow: |
| case ItemDrop.ItemData.ItemType.Bow: |
| goto IL_48; |
| goto IL_48; |
| default: |
| default: |
| if (itemType != ItemDrop.ItemData.ItemType.TwoHandedWeapon) |
| if (itemType != ItemDrop.ItemData.ItemType.TwoHandedWeapon) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| goto IL_48; |
| goto IL_48; |
| } |
| } |
| } |
| } |
| else if (itemType != ItemDrop.ItemData.ItemType.Torch) |
| else if (itemType != ItemDrop.ItemData.ItemType.Torch) |
| { |
| { |
| if (itemType != ItemDrop.ItemData.ItemType.Tool && itemType != ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft) |
| if (itemType != ItemDrop.ItemData.ItemType.Tool && itemType != ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| goto IL_48; |
| goto IL_48; |
| } |
| } |
| text.Append("\n$item_onehanded"); |
| text.Append("\n$item_onehanded"); |
| return; |
| return; |
| IL_48: |
| IL_48: |
| text.Append("\n$item_twohanded"); |
| text.Append("\n$item_twohanded"); |
| } |
| } |
| |
| |
| private static void AddBlockTooltip(ItemDrop.ItemData item, int qualityLevel, StringBuilder text) |
| private static void AddBlockTooltip(ItemDrop.ItemData item, int qualityLevel, StringBuilder text) |
| { |
| { |
| text.AppendFormat("\n$item_blockarmor: <color=orange>{0}</color> <color=yellow>({1})</color>", item.GetBaseBlockPower(qualityLevel), item.GetBlockPowerTooltip(qualityLevel).ToString("0")); |
| text.AppendFormat("\n$item_blockarmor: <color=orange>{0}</color> <color=yellow>({1})</color>", item.GetBaseBlockPower(qualityLevel), item.GetBlockPowerTooltip(qualityLevel).ToString("0")); |
| text.AppendFormat("\n$item_blockforce: <color=orange>{0}</color>", item.GetDeflectionForce(qualityLevel)); |
| text.AppendFormat("\n$item_blockforce: <color=orange>{0}</color>", item.GetDeflectionForce(qualityLevel)); |
| if (item.m_shared.m_timedBlockBonus > 1f) |
| if (item.m_shared.m_timedBlockBonus > 1f) |
| { |
| { |
| text.AppendFormat("\n$item_parrybonus: <color=orange>{0}x</color>", item.m_shared.m_timedBlockBonus); |
| text.AppendFormat("\n$item_parrybonus: <color=orange>{0}x</color>", item.m_shared.m_timedBlockBonus); |
| } |
| } |
| string damageModifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers); |
| string damageModifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers); |
| if (damageModifiersTooltipString.Length > 0) |
| if (damageModifiersTooltipString.Length > 0) |
| { |
| { |
| text.Append(damageModifiersTooltipString); |
| text.Append(damageModifiersTooltipString); |
| } |
| } |
| } |
| } |
| |
| |
| public static string GetTooltip(ItemDrop.ItemData item, int qualityLevel, bool crafting, float worldLevel) |
| public static string GetTooltip(ItemDrop.ItemData item, int qualityLevel, bool crafting, float worldLevel) |
| { |
| { |
| Player localPlayer = Player.m_localPlayer; |
| Player localPlayer = Player.m_localPlayer; |
| ItemDrop.ItemData.m_stringBuilder.Clear(); |
| ItemDrop.ItemData.m_stringBuilder.Clear(); |
| ItemDrop.ItemData.m_stringBuilder.Append(item.m_shared.m_description); |
| ItemDrop.ItemData.m_stringBuilder.Append(item.m_shared.m_description); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n"); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n"); |
| if (item.m_shared.m_dlc.Length > 0) |
| if (item.m_shared.m_dlc.Length > 0) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append("\n<color=#00FFFF>$item_dlc</color>"); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n<color=#00FFFF>$item_dlc</color>"); |
| } |
| } |
| if (item.m_worldLevel > 0) |
| if (item.m_worldLevel > 0) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append("\n<color=orange>$item_newgameplusitem " + ((item.m_worldLevel != 1) ? item.m_worldLevel.ToString() : "") + "</color>"); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n<color=orange>$item_newgameplusitem " + ((item.m_worldLevel != 1) ? item.m_worldLevel.ToString() : "") + "</color>"); |
| } |
| } |
| ItemDrop.ItemData.AddHandedTip(item, ItemDrop.ItemData.m_stringBuilder); |
| ItemDrop.ItemData.AddHandedTip(item, ItemDrop.ItemData.m_stringBuilder); |
| if (item.m_crafterID != 0L) |
| if (item.m_crafterID != 0L) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_crafter: <color=orange>{0}</color>", CensorShittyWords.FilterUGC(item.m_crafterName, UGCType.CharacterName, null, item.m_crafterID)); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_crafter: <color=orange>{0}</color>", CensorShittyWords.FilterUGC(item.m_crafterName, UGCType.CharacterName, null, item.m_crafterID)); |
| } |
| } |
| if (!item.m_shared.m_teleportable && !ZoneSystem.instance.GetGlobalKey(GlobalKeys.TeleportAll)) |
| if (!item.m_shared.m_teleportable && !ZoneSystem.instance.GetGlobalKey(GlobalKeys.TeleportAll)) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append("\n<color=orange>$item_noteleport</color>"); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n<color=orange>$item_noteleport</color>"); |
| } |
| } |
| if (item.m_shared.m_value > 0) |
| if (item.m_shared.m_value > 0) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_value: <color=orange>{0} ({1})</color>", item.GetValue(), item.m_shared.m_value); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_value: <color=orange>{0} ({1})</color>", item.GetValue(), item.m_shared.m_value); |
| } |
| } |
| if (item.m_shared.m_maxStackSize > 1) |
| if (item.m_shared.m_maxStackSize > 1) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_weight: <color=orange>{0} ({1} $item_total)</color>", item.GetNonStackedWeight().ToString("0.0"), item.GetWeight().ToString("0.0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_weight: <color=orange>{0} ({1} $item_total)</color>", item.GetNonStackedWeight().ToString("0.0"), item.GetWeight().ToString("0.0")); |
| } |
| } |
| else |
| else |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_weight: <color=orange>{0}</color>", item.GetWeight().ToString("0.0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_weight: <color=orange>{0}</color>", item.GetWeight().ToString("0.0")); |
| } |
| } |
| if (item.m_shared.m_maxQuality > 1 && !crafting) |
| if (item.m_shared.m_maxQuality > 1 && !crafting) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_quality: <color=orange>{0}</color>", qualityLevel); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_quality: <color=orange>{0}</color>", qualityLevel); |
| } |
| } |
| if (item.m_shared.m_useDurability) |
| if (item.m_shared.m_useDurability) |
| { |
| { |
| if (crafting) |
| if (crafting) |
| { |
| { |
| float maxDurability = item.GetMaxDurability(qualityLevel); |
| float maxDurability = item.GetMaxDurability(qualityLevel); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}</color>", maxDurability); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}</color>", maxDurability); |
| } |
| } |
| else |
| else |
| { |
| { |
| float maxDurability2 = item.GetMaxDurability(qualityLevel); |
| float maxDurability2 = item.GetMaxDurability(qualityLevel); |
| float durability = item.m_durability; |
| float durability = item.m_durability; |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}%</color> <color=yellow>({1}/{2})</color>", (item.GetDurabilityPercentage() * 100f).ToString("0"), durability.ToString("0"), maxDurability2.ToString("0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}%</color> <color=yellow>({1}/{2})</color>", (item.GetDurabilityPercentage() * 100f).ToString("0"), durability.ToString("0"), maxDurability2.ToString("0")); |
| } |
| } |
| if (item.m_shared.m_canBeReparied && !crafting) |
| if (item.m_shared.m_canBeReparied && !crafting) |
| { |
| { |
| Recipe recipe = ObjectDB.instance.GetRecipe(item); |
| Recipe recipe = ObjectDB.instance.GetRecipe(item); |
| if (recipe != null) |
| if (recipe != null) |
| { |
| { |
| int minStationLevel = recipe.m_minStationLevel; |
| int minStationLevel = recipe.m_minStationLevel; |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_repairlevel: <color=orange>{0}</color>", minStationLevel.ToString()); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_repairlevel: <color=orange>{0}</color>", minStationLevel.ToString()); |
| } |
| } |
| } |
| } |
| } |
| } |
| switch (item.m_shared.m_itemType) |
| switch (item.m_shared.m_itemType) |
| { |
| { |
| case ItemDrop.ItemData.ItemType.Consumable: |
| case ItemDrop.ItemData.ItemType.Consumable: |
| if (item.m_shared.m_food > 0f || item.m_shared.m_foodStamina > 0f || item.m_shared.m_foodEitr > 0f) |
| if (item.m_shared.m_food > 0f || item.m_shared.m_foodStamina > 0f || item.m_shared.m_foodEitr > 0f) |
| { |
| { |
| float maxHealth = localPlayer.GetMaxHealth(); |
| float maxHealth = localPlayer.GetMaxHealth(); |
| float maxStamina = localPlayer.GetMaxStamina(); |
| float maxStamina = localPlayer.GetMaxStamina(); |
| float maxEitr = localPlayer.GetMaxEitr(); |
| float maxEitr = localPlayer.GetMaxEitr(); |
| if (item.m_shared.m_food > 0f) |
| if (item.m_shared.m_food > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_health: <color=#ff8080ff>{0}</color> ($item_current:<color=yellow>{1}</color>)", item.m_shared.m_food, maxHealth.ToString("0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_health: <color=#ff8080ff>{0}</color> ($item_current:<color=yellow>{1}</color>)", item.m_shared.m_food, maxHealth.ToString("0")); |
| } |
| } |
| if (item.m_shared.m_foodStamina > 0f) |
| if (item.m_shared.m_foodStamina > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_stamina: <color=#ffff80ff>{0}</color> ($item_current:<color=yellow>{1}</color>)", item.m_shared.m_foodStamina, maxStamina.ToString("0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_stamina: <color=#ffff80ff>{0}</color> ($item_current:<color=yellow>{1}</color>)", item.m_shared.m_foodStamina, maxStamina.ToString("0")); |
| } |
| } |
| if (item.m_shared.m_foodEitr > 0f) |
| if (item.m_shared.m_foodEitr > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_eitr: <color=#9090ffff>{0}</color> ($item_current:<color=yellow>{1}</color>)", item.m_shared.m_foodEitr, maxEitr.ToString("0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_eitr: <color=#9090ffff>{0}</color> ($item_current:<color=yellow>{1}</color>)", item.m_shared.m_foodEitr, maxEitr.ToString("0")); |
| } |
| } |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_duration: <color=orange>{0}</color>", ItemDrop.ItemData.GetDurationString(item.m_shared.m_foodBurnTime)); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_duration: <color=orange>{0}</color>", ItemDrop.ItemData.GetDurationString(item.m_shared.m_foodBurnTime)); |
| if (item.m_shared.m_foodRegen > 0f) |
| if (item.m_shared.m_foodRegen > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_regen: <color=orange>{0} hp/tick</color>", item.m_shared.m_foodRegen); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_food_regen: <color=orange>{0} hp/tick</color>", item.m_shared.m_foodRegen); |
| } |
| } |
| } |
| } |
| break; |
| break; |
| case ItemDrop.ItemData.ItemType.OneHandedWeapon: |
| case ItemDrop.ItemData.ItemType.OneHandedWeapon: |
| case ItemDrop.ItemData.ItemType.Bow: |
| case ItemDrop.ItemData.ItemType.Bow: |
| case ItemDrop.ItemData.ItemType.TwoHandedWeapon: |
| case ItemDrop.ItemData.ItemType.TwoHandedWeapon: |
| case ItemDrop.ItemData.ItemType.Torch: |
| case ItemDrop.ItemData.ItemType.Torch: |
| case ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft: |
| case ItemDrop.ItemData.ItemType.TwoHandedWeaponLeft: |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append(item.GetDamage(qualityLevel, worldLevel).GetTooltipString(item.m_shared.m_skillType)); |
| ItemDrop.ItemData.m_stringBuilder.Append(item.GetDamage(qualityLevel, worldLevel).GetTooltipString(item.m_shared.m_skillType)); |
| . | |
| if (item.m_shared.m_attack.m_damageMultiplierByTotalHealthMissing > 0f) |
| |
| { |
| |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_damagemultipliertotal: <color=orange>{0}%</color>", item.m_shared.m_attack.m_damageMultiplierByTotalHealthMissing * 100f); |
| |
| } |
| |
| if (item.m_shared.m_attack.m_damageMultiplierPerMissingHP > 0f) |
| |
| { |
| |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_damagemultiplierhp: <color=orange>{0}%</color>", item.m_shared.m_attack.m_damageMultiplierPerMissingHP * 100f); |
| |
| } |
| if (item.m_shared.m_attack.m_attackStamina > 0f) |
| if (item.m_shared.m_attack.m_attackStamina > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_staminause: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackStamina); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_staminause: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackStamina); |
| } |
| } |
| if (item.m_shared.m_attack.m_attackEitr > 0f) |
| if (item.m_shared.m_attack.m_attackEitr > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_eitruse: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackEitr); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_eitruse: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackEitr); |
| } |
| } |
| if (item.m_shared.m_attack.m_attackHealth > 0f) |
| if (item.m_shared.m_attack.m_attackHealth > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_healthuse: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackHealth); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_healthuse: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackHealth); |
| } |
| } |
| . | |
| if (item.m_shared.m_attack.m_attackHealthReturnHit > 0f) |
| |
| { |
| |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_healthhitreturn: <color=orange>{0}</color>", item.m_shared.m_attack.m_attackHealthReturnHit); |
| |
| } |
| if (item.m_shared.m_attack.m_attackHealthPercentage > 0f) |
| if (item.m_shared.m_attack.m_attackHealthPercentage > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_healthuse: <color=orange>{0}%</color>", item.m_shared.m_attack.m_attackHealthPercentage.ToString("0.0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_healthuse: <color=orange>{0}%</color>", item.m_shared.m_attack.m_attackHealthPercentage.ToString("0.0")); |
| } |
| } |
| if (item.m_shared.m_attack.m_drawStaminaDrain > 0f) |
| if (item.m_shared.m_attack.m_drawStaminaDrain > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_staminahold: <color=orange>{0}</color>/s", item.m_shared.m_attack.m_drawStaminaDrain); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_staminahold: <color=orange>{0}</color>/s", item.m_shared.m_attack.m_drawStaminaDrain); |
| } |
| } |
| ItemDrop.ItemData.AddBlockTooltip(item, qualityLevel, ItemDrop.ItemData.m_stringBuilder); |
| ItemDrop.ItemData.AddBlockTooltip(item, qualityLevel, ItemDrop.ItemData.m_stringBuilder); |
| if (item.m_shared.m_attackForce > 0f) |
| if (item.m_shared.m_attackForce > 0f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce); |
| } |
| } |
| if (item.m_shared.m_backstabBonus > 1f) |
| if (item.m_shared.m_backstabBonus > 1f) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_backstab: <color=orange>{0}x</color>", item.m_shared.m_backstabBonus); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_backstab: <color=orange>{0}x</color>", item.m_shared.m_backstabBonus); |
| } |
| } |
| if (item.m_shared.m_tamedOnly) |
| if (item.m_shared.m_tamedOnly) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n<color=orange>$item_tamedonly</color>", Array.Empty<object>()); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n<color=orange>$item_tamedonly</color>", Array.Empty<object>()); |
| } |
| } |
| string projectileTooltip = item.GetProjectileTooltip(qualityLevel); |
| string projectileTooltip = item.GetProjectileTooltip(qualityLevel); |
| if (projectileTooltip.Length > 0 && item.m_shared.m_projectileToolTip) |
| if (projectileTooltip.Length > 0 && item.m_shared.m_projectileToolTip) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append("\n\n"); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n\n"); |
| ItemDrop.ItemData.m_stringBuilder.Append(projectileTooltip); |
| ItemDrop.ItemData.m_stringBuilder.Append(projectileTooltip); |
| } |
| } |
| break; |
| break; |
| } |
| } |
| case ItemDrop.ItemData.ItemType.Shield: |
| case ItemDrop.ItemData.ItemType.Shield: |
| ItemDrop.ItemData.AddBlockTooltip(item, qualityLevel, ItemDrop.ItemData.m_stringBuilder); |
| ItemDrop.ItemData.AddBlockTooltip(item, qualityLevel, ItemDrop.ItemData.m_stringBuilder); |
| break; |
| break; |
| case ItemDrop.ItemData.ItemType.Helmet: |
| case ItemDrop.ItemData.ItemType.Helmet: |
| case ItemDrop.ItemData.ItemType.Chest: |
| case ItemDrop.ItemData.ItemType.Chest: |
| case ItemDrop.ItemData.ItemType.Legs: |
| case ItemDrop.ItemData.ItemType.Legs: |
| case ItemDrop.ItemData.ItemType.Shoulder: |
| case ItemDrop.ItemData.ItemType.Shoulder: |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_armor: <color=orange>{0}</color>", item.GetArmor(qualityLevel, worldLevel)); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_armor: <color=orange>{0}</color>", item.GetArmor(qualityLevel, worldLevel)); |
| string damageModifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers); |
| string damageModifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers); |
| if (damageModifiersTooltipString.Length > 0) |
| if (damageModifiersTooltipString.Length > 0) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append(damageModifiersTooltipString); |
| ItemDrop.ItemData.m_stringBuilder.Append(damageModifiersTooltipString); |
| } |
| } |
| break; |
| break; |
| } |
| } |
| case ItemDrop.ItemData.ItemType.Ammo: |
| case ItemDrop.ItemData.ItemType.Ammo: |
| case ItemDrop.ItemData.ItemType.AmmoNonEquipable: |
| case ItemDrop.ItemData.ItemType.AmmoNonEquipable: |
| ItemDrop.ItemData.m_stringBuilder.Append(item.GetDamage(qualityLevel, worldLevel).GetTooltipString(item.m_shared.m_skillType)); |
| ItemDrop.ItemData.m_stringBuilder.Append(item.GetDamage(qualityLevel, worldLevel).GetTooltipString(item.m_shared.m_skillType)); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce); |
| break; |
| break; |
| } |
| } |
| float skillLevel = Player.m_localPlayer.GetSkillLevel(item.m_shared.m_skillType); |
| float skillLevel = Player.m_localPlayer.GetSkillLevel(item.m_shared.m_skillType); |
| string statusEffectTooltip = item.GetStatusEffectTooltip(qualityLevel, skillLevel); |
| string statusEffectTooltip = item.GetStatusEffectTooltip(qualityLevel, skillLevel); |
| if (statusEffectTooltip.Length > 0) |
| if (statusEffectTooltip.Length > 0) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.Append("\n\n"); |
| ItemDrop.ItemData.m_stringBuilder.Append("\n\n"); |
| ItemDrop.ItemData.m_stringBuilder.Append(statusEffectTooltip); |
| ItemDrop.ItemData.m_stringBuilder.Append(statusEffectTooltip); |
| } |
| } |
| . | |
| string chainTooltip = item.GetChainTooltip(qualityLevel, skillLevel); |
| |
| if (chainTooltip.Length > 0) |
| |
| { |
| |
| ItemDrop.ItemData.m_stringBuilder.Append("\n\n"); |
| |
| ItemDrop.ItemData.m_stringBuilder.Append(chainTooltip); |
| |
| } |
| if (item.m_shared.m_eitrRegenModifier > 0f && localPlayer != null) |
| if (item.m_shared.m_eitrRegenModifier > 0f && localPlayer != null) |
| { |
| { |
| float equipmentEitrRegenModifier = localPlayer.GetEquipmentEitrRegenModifier(); |
| float equipmentEitrRegenModifier = localPlayer.GetEquipmentEitrRegenModifier(); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_eitrregen_modifier: <color=orange>{0}%</color> ($item_total:<color=yellow>{1}%</color>)", (item.m_shared.m_eitrRegenModifier * 100f).ToString("+0;-0"), (equipmentEitrRegenModifier * 100f).ToString("+0;-0")); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_eitrregen_modifier: <color=orange>{0}%</color> ($item_total:<color=yellow>{1}%</color>)", (item.m_shared.m_eitrRegenModifier * 100f).ToString("+0;-0"), (equipmentEitrRegenModifier * 100f).ToString("+0;-0")); |
| } |
| } |
| . | if (item.m_shared.m_movementModifier != 0f && localPlayer != null) |
| if (localPlayer != null) |
| { |
| { |
| . | float equipmentMovementModifier = localPlayer.GetEquipmentMovementModifier(); |
| localPlayer.AppendEquipmentModifierTooltips(item, ItemDrop.ItemData.m_stringBuilder); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$item_movement_modifier: <color=orange>{0}%</color> ($item_total:<color=yellow>{1}%</color>)", (item.m_shared.m_movementModifier * 100f).ToString("+0;-0"), (equipmentMovementModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (item.m_shared.m_baseItemsStaminaModifier != 0f && localPlayer != null) |
| |
| { |
| |
| float equipmentBaseItemModifier = localPlayer.GetEquipmentBaseItemModifier(); |
| |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n$base_item_modifier: <color=orange>{0}%</color> ($item_total:<color=yellow>{1}%</color>)", (item.m_shared.m_baseItemsStaminaModifier * 100f).ToString("+0;-0"), (equipmentBaseItemModifier * 100f).ToString("+0;-0")); |
| |
| } |
| } |
| string setStatusEffectTooltip = item.GetSetStatusEffectTooltip(qualityLevel, skillLevel); |
| string setStatusEffectTooltip = item.GetSetStatusEffectTooltip(qualityLevel, skillLevel); |
| if (setStatusEffectTooltip.Length > 0) |
| if (setStatusEffectTooltip.Length > 0) |
| { |
| { |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n\n$item_seteffect (<color=orange>{0}</color> $item_parts):<color=orange>{1}</color>\n{2}", item.m_shared.m_setSize, item.m_shared.m_setStatusEffect.m_name, setStatusEffectTooltip); |
| ItemDrop.ItemData.m_stringBuilder.AppendFormat("\n\n$item_seteffect (<color=orange>{0}</color> $item_parts):<color=orange>{1}</color>\n{2}", item.m_shared.m_setSize, item.m_shared.m_setStatusEffect.m_name, setStatusEffectTooltip); |
| } |
| } |
| return ItemDrop.ItemData.m_stringBuilder.ToString(); |
| return ItemDrop.ItemData.m_stringBuilder.ToString(); |
| } |
| } |
| |
| |
| public static string GetDurationString(float time) |
| public static string GetDurationString(float time) |
| { |
| { |
| int num = Mathf.CeilToInt(time); |
| int num = Mathf.CeilToInt(time); |
| int num2 = (int)((float)num / 60f); |
| int num2 = (int)((float)num / 60f); |
| int num3 = Mathf.Max(0, num - num2 * 60); |
| int num3 = Mathf.Max(0, num - num2 * 60); |
| if (num2 > 0 && num3 > 0) |
| if (num2 > 0 && num3 > 0) |
| { |
| { |
| return num2.ToString() + "m " + num3.ToString() + "s"; |
| return num2.ToString() + "m " + num3.ToString() + "s"; |
| } |
| } |
| if (num2 > 0) |
| if (num2 > 0) |
| { |
| { |
| return num2.ToString() + "m "; |
| return num2.ToString() + "m "; |
| } |
| } |
| return num3.ToString() + "s"; |
| return num3.ToString() + "s"; |
| } |
| } |
| |
| |
| private string GetStatusEffectTooltip(int quality, float skillLevel) |
| private string GetStatusEffectTooltip(int quality, float skillLevel) |
| { |
| { |
| if (this.m_shared.m_attackStatusEffect) |
| if (this.m_shared.m_attackStatusEffect) |
| { |
| { |
| this.m_shared.m_attackStatusEffect.SetLevel(quality, skillLevel); |
| this.m_shared.m_attackStatusEffect.SetLevel(quality, skillLevel); |
| . | return "<color=orange>" + this.m_shared.m_attackStatusEffect.m_name + "</color>\n" + this.m_shared.m_attackStatusEffect.GetTooltipString(); |
| string text = ((this.m_shared.m_attackStatusEffectChance < 1f) ? string.Format("$item_chancetoapplyse <color=orange>{0}%</color>\n", this.m_shared.m_attackStatusEffectChance * 100f) : ""); |
| |
| return string.Concat(new string[] |
| |
| { |
| |
| text, |
| |
| "<color=orange>", |
| |
| this.m_shared.m_attackStatusEffect.m_name, |
| |
| "</color>\n", |
| |
| this.m_shared.m_attackStatusEffect.GetTooltipString() |
| |
| }); |
| } |
| } |
| if (this.m_shared.m_consumeStatusEffect) |
| if (this.m_shared.m_consumeStatusEffect) |
| { |
| { |
| this.m_shared.m_consumeStatusEffect.SetLevel(quality, skillLevel); |
| this.m_shared.m_consumeStatusEffect.SetLevel(quality, skillLevel); |
| return "<color=orange>" + this.m_shared.m_consumeStatusEffect.m_name + "</color>\n" + this.m_shared.m_consumeStatusEffect.GetTooltipString(); |
| return "<color=orange>" + this.m_shared.m_consumeStatusEffect.m_name + "</color>\n" + this.m_shared.m_consumeStatusEffect.GetTooltipString(); |
| } |
| } |
| if (this.m_shared.m_equipStatusEffect) |
| if (this.m_shared.m_equipStatusEffect) |
| { |
| { |
| this.m_shared.m_equipStatusEffect.SetLevel(quality, skillLevel); |
| this.m_shared.m_equipStatusEffect.SetLevel(quality, skillLevel); |
| return "<color=orange>" + this.m_shared.m_equipStatusEffect.m_name + "</color>\n" + this.m_shared.m_equipStatusEffect.GetTooltipString(); |
| return "<color=orange>" + this.m_shared.m_equipStatusEffect.m_name + "</color>\n" + this.m_shared.m_equipStatusEffect.GetTooltipString(); |
| } |
| } |
| return ""; |
| return ""; |
| } |
| } |
| |
| |
| . | |
| private string GetChainTooltip(int quality, float skillLevel) |
| |
| { |
| |
| if (this.m_shared.m_attack.m_spawnOnHitChance > 0f && this.m_shared.m_attack.m_spawnOnHit != null) |
| |
| { |
| |
| return ((this.m_shared.m_attack.m_spawnOnHitChance < 1f) ? string.Format("$item_chancetoapplyse <color=orange>{0}%</color>\n", this.m_shared.m_attack.m_spawnOnHitChance * 100f) : "") + "<color=orange>" + this.<GetChainTooltip>g__getName|37_0(true) + "</color>"; |
| |
| } |
| |
| if (this.m_shared.m_secondaryAttack.m_spawnOnHitChance > 0f && this.m_shared.m_secondaryAttack.m_spawnOnHit != null) |
| |
| { |
| |
| return ((this.m_shared.m_secondaryAttack.m_spawnOnHitChance < 1f) ? string.Format("$item_chancetoapplyse <color=orange>{0}%</color>\n", this.m_shared.m_secondaryAttack.m_spawnOnHitChance * 100f) : "") + "<color=orange>" + this.<GetChainTooltip>g__getName|37_0(false) + "</color>"; |
| |
| } |
| |
| return ""; |
| |
| } |
| |
| |
| private string GetEquipStatusEffectTooltip(int quality, float skillLevel) |
| private string GetEquipStatusEffectTooltip(int quality, float skillLevel) |
| { |
| { |
| if (this.m_shared.m_equipStatusEffect) |
| if (this.m_shared.m_equipStatusEffect) |
| { |
| { |
| StatusEffect equipStatusEffect = this.m_shared.m_equipStatusEffect; |
| StatusEffect equipStatusEffect = this.m_shared.m_equipStatusEffect; |
| this.m_shared.m_equipStatusEffect.SetLevel(quality, skillLevel); |
| this.m_shared.m_equipStatusEffect.SetLevel(quality, skillLevel); |
| if (equipStatusEffect != null) |
| if (equipStatusEffect != null) |
| { |
| { |
| return equipStatusEffect.GetTooltipString(); |
| return equipStatusEffect.GetTooltipString(); |
| } |
| } |
| } |
| } |
| return ""; |
| return ""; |
| } |
| } |
| |
| |
| private string GetSetStatusEffectTooltip(int quality, float skillLevel) |
| private string GetSetStatusEffectTooltip(int quality, float skillLevel) |
| { |
| { |
| if (this.m_shared.m_setStatusEffect) |
| if (this.m_shared.m_setStatusEffect) |
| { |
| { |
| StatusEffect setStatusEffect = this.m_shared.m_setStatusEffect; |
| StatusEffect setStatusEffect = this.m_shared.m_setStatusEffect; |
| this.m_shared.m_setStatusEffect.SetLevel(quality, skillLevel); |
| this.m_shared.m_setStatusEffect.SetLevel(quality, skillLevel); |
| if (setStatusEffect != null) |
| if (setStatusEffect != null) |
| { |
| { |
| return setStatusEffect.GetTooltipString(); |
| return setStatusEffect.GetTooltipString(); |
| } |
| } |
| } |
| } |
| return ""; |
| return ""; |
| } |
| } |
| |
| |
| private string GetProjectileTooltip(int itemQuality) |
| private string GetProjectileTooltip(int itemQuality) |
| { |
| { |
| string text = ""; |
| string text = ""; |
| if (this.m_shared.m_attack.m_attackProjectile) |
| if (this.m_shared.m_attack.m_attackProjectile) |
| { |
| { |
| IProjectile component = this.m_shared.m_attack.m_attackProjectile.GetComponent<IProjectile>(); |
| IProjectile component = this.m_shared.m_attack.m_attackProjectile.GetComponent<IProjectile>(); |
| if (component != null) |
| if (component != null) |
| { |
| { |
| text += component.GetTooltipString(itemQuality); |
| text += component.GetTooltipString(itemQuality); |
| } |
| } |
| } |
| } |
| if (this.m_shared.m_spawnOnHit) |
| if (this.m_shared.m_spawnOnHit) |
| { |
| { |
| IProjectile component2 = this.m_shared.m_spawnOnHit.GetComponent<IProjectile>(); |
| IProjectile component2 = this.m_shared.m_spawnOnHit.GetComponent<IProjectile>(); |
| if (component2 != null) |
| if (component2 != null) |
| { |
| { |
| text += component2.GetTooltipString(itemQuality); |
| text += component2.GetTooltipString(itemQuality); |
| } |
| } |
| } |
| } |
| return text; |
| return text; |
| } |
| } |
| |
| |
| public override string ToString() |
| public override string ToString() |
| { |
| { |
| return string.Format("{0}: stack: {1}, quality: {2}, Shared: {3}", new object[] { "ItemData", this.m_stack, this.m_quality, this.m_shared }); |
| return string.Format("{0}: stack: {1}, quality: {2}, Shared: {3}", new object[] { "ItemData", this.m_stack, this.m_quality, this.m_shared }); |
| } |
| } |
| |
| |
| . | |
| [CompilerGenerated] |
| |
| private string <GetChainTooltip>g__getName|37_0(bool primary) |
| |
| { |
| |
| GameObject gameObject = (primary ? this.m_shared.m_attack.m_spawnOnHit : this.m_shared.m_secondaryAttack.m_spawnOnHit); |
| |
| Aoe component = gameObject.GetComponent<Aoe>(); |
| |
| if (component != null) |
| |
| { |
| |
| return component.m_name; |
| |
| } |
| |
| ItemDrop component2 = gameObject.GetComponent<ItemDrop>(); |
| |
| if (component2 != null) |
| |
| { |
| |
| return component2.m_itemData.m_shared.m_name; |
| |
| } |
| |
| return gameObject.name; |
| |
| } |
| |
| |
| private static StringBuilder m_stringBuilder = new StringBuilder(256); |
| private static StringBuilder m_stringBuilder = new StringBuilder(256); |
| |
| |
| public int m_stack = 1; |
| public int m_stack = 1; |
| |
| |
| public float m_durability = 100f; |
| public float m_durability = 100f; |
| |
| |
| public int m_quality = 1; |
| public int m_quality = 1; |
| |
| |
| public int m_variant; |
| public int m_variant; |
| |
| |
| public int m_worldLevel = Game.m_worldLevel; |
| public int m_worldLevel = Game.m_worldLevel; |
| |
| |
| public bool m_pickedUp; |
| public bool m_pickedUp; |
| |
| |
| public ItemDrop.ItemData.SharedData m_shared; |
| public ItemDrop.ItemData.SharedData m_shared; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public long m_crafterID; |
| public long m_crafterID; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public string m_crafterName = ""; |
| public string m_crafterName = ""; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public Dictionary<string, string> m_customData = new Dictionary<string, string>(); |
| public Dictionary<string, string> m_customData = new Dictionary<string, string>(); |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public Vector2i m_gridPos = Vector2i.zero; |
| public Vector2i m_gridPos = Vector2i.zero; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public bool m_equipped; |
| public bool m_equipped; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public GameObject m_dropPrefab; |
| public GameObject m_dropPrefab; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public float m_lastAttackTime; |
| public float m_lastAttackTime; |
| |
| |
| [NonSerialized] |
| [NonSerialized] |
| public GameObject m_lastProjectile; |
| public GameObject m_lastProjectile; |
| |
| |
| public enum ItemType |
| public enum ItemType |
| { |
| { |
| None, |
| None, |
| Material, |
| Material, |
| Consumable, |
| Consumable, |
| OneHandedWeapon, |
| OneHandedWeapon, |
| Bow, |
| Bow, |
| Shield, |
| Shield, |
| Helmet, |
| Helmet, |
| Chest, |
| Chest, |
| Ammo = 9, |
| Ammo = 9, |
| Customization, |
| Customization, |
| Legs, |
| Legs, |
| Hands, |
| Hands, |
| Trophy, |
| Trophy, |
| TwoHandedWeapon, |
| TwoHandedWeapon, |
| Torch, |
| Torch, |
| Misc, |
| Misc, |
| Shoulder, |
| Shoulder, |
| Utility, |
| Utility, |
| Tool, |
| Tool, |
| Attach_Atgeir, |
| Attach_Atgeir, |
| Fish, |
| Fish, |
| TwoHandedWeaponLeft, |
| TwoHandedWeaponLeft, |
| AmmoNonEquipable |
| AmmoNonEquipable |
| } |
| } |
| |
| |
| public enum AnimationState |
| public enum AnimationState |
| { |
| { |
| Unarmed, |
| Unarmed, |
| OneHanded, |
| OneHanded, |
| TwoHandedClub, |
| TwoHandedClub, |
| Bow, |
| Bow, |
| Shield, |
| Shield, |
| Torch, |
| Torch, |
| LeftTorch, |
| LeftTorch, |
| Atgeir, |
| Atgeir, |
| TwoHandedAxe, |
| TwoHandedAxe, |
| FishingRod, |
| FishingRod, |
| Crossbow, |
| Crossbow, |
| Knives, |
| Knives, |
| Staves, |
| Staves, |
| Greatsword, |
| Greatsword, |
| . | MagicItem |
| MagicItem, |
| |
| DualAxes |
| } |
| } |
| |
| |
| public enum AiTarget |
| public enum AiTarget |
| { |
| { |
| Enemy, |
| Enemy, |
| FriendHurt, |
| FriendHurt, |
| Friend |
| Friend |
| } |
| } |
| |
| |
| public enum HelmetHairType |
| public enum HelmetHairType |
| { |
| { |
| Default, |
| Default, |
| Hidden, |
| Hidden, |
| HiddenHat, |
| HiddenHat, |
| HiddenHood, |
| HiddenHood, |
| HiddenNeck, |
| HiddenNeck, |
| HiddenScarf |
| HiddenScarf |
| } |
| } |
| |
| |
| public enum AccessoryType |
| public enum AccessoryType |
| { |
| { |
| Hair, |
| Hair, |
| Beard |
| Beard |
| } |
| } |
| |
| |
| [Serializable] |
| [Serializable] |
| public class HelmetHairSettings |
| public class HelmetHairSettings |
| { |
| { |
| public ItemDrop.ItemData.HelmetHairType m_setting; |
| public ItemDrop.ItemData.HelmetHairType m_setting; |
| |
| |
| public ItemDrop m_hairPrefab; |
| public ItemDrop m_hairPrefab; |
| } |
| } |
| |
| |
| [Serializable] |
| [Serializable] |
| public class SharedData |
| public class SharedData |
| { |
| { |
| public override string ToString() |
| public override string ToString() |
| { |
| { |
| return string.Format("{0}: {1}, max stack: {2}, attacks: {3} / {4}", new object[] { "SharedData", this.m_name, this.m_maxStackSize, this.m_attack, this.m_secondaryAttack }); |
| return string.Format("{0}: {1}, max stack: {2}, attacks: {3} / {4}", new object[] { "SharedData", this.m_name, this.m_maxStackSize, this.m_attack, this.m_secondaryAttack }); |
| } |
| } |
| |
| |
| public string m_name = ""; |
| public string m_name = ""; |
| |
| |
| public string m_dlc = ""; |
| public string m_dlc = ""; |
| |
| |
| public ItemDrop.ItemData.ItemType m_itemType = ItemDrop.ItemData.ItemType.Misc; |
| public ItemDrop.ItemData.ItemType m_itemType = ItemDrop.ItemData.ItemType.Misc; |
| |
| |
| public Sprite[] m_icons = Array.Empty<Sprite>(); |
| public Sprite[] m_icons = Array.Empty<Sprite>(); |
| |
| |
| public ItemDrop.ItemData.ItemType m_attachOverride; |
| public ItemDrop.ItemData.ItemType m_attachOverride; |
| |
| |
| [TextArea] |
| [TextArea] |
| public string m_description = ""; |
| public string m_description = ""; |
| |
| |
| public int m_maxStackSize = 1; |
| public int m_maxStackSize = 1; |
| |
| |
| public bool m_autoStack = true; |
| public bool m_autoStack = true; |
| |
| |
| public int m_maxQuality = 1; |
| public int m_maxQuality = 1; |
| |
| |
| public float m_scaleByQuality; |
| public float m_scaleByQuality; |
| |
| |
| public float m_weight = 1f; |
| public float m_weight = 1f; |
| |
| |
| public float m_scaleWeightByQuality; |
| public float m_scaleWeightByQuality; |
| |
| |
| public int m_value; |
| public int m_value; |
| |
| |
| public bool m_teleportable = true; |
| public bool m_teleportable = true; |
| |
| |
| public bool m_questItem; |
| public bool m_questItem; |
| |
| |
| public float m_equipDuration = 1f; |
| public float m_equipDuration = 1f; |
| |
| |
| public int m_variants; |
| public int m_variants; |
| |
| |
| public Vector2Int m_trophyPos = Vector2Int.zero; |
| public Vector2Int m_trophyPos = Vector2Int.zero; |
| |
| |
| public PieceTable m_buildPieces; |
| public PieceTable m_buildPieces; |
| |
| |
| public bool m_centerCamera; |
| public bool m_centerCamera; |
| |
| |
| public string m_setName = ""; |
| public string m_setName = ""; |
| |
| |
| public int m_setSize; |
| public int m_setSize; |
| |
| |
| public StatusEffect m_setStatusEffect; |
| public StatusEffect m_setStatusEffect; |
| |
| |
| public StatusEffect m_equipStatusEffect; |
| public StatusEffect m_equipStatusEffect; |
| |
| |
| [Header("Stat modifiers")] |
| [Header("Stat modifiers")] |
| . | |
| public float m_eitrRegenModifier; |
| |
| |
| public float m_movementModifier; |
| public float m_movementModifier; |
| |
| |
| . | public float m_eitrRegenModifier; |
| public float m_homeItemsStaminaModifier; |
| |
| |
| |
| public float m_heatResistanceModifier; |
| |
| |
| . | public float m_baseItemsStaminaModifier; |
| public float m_jumpStaminaModifier; |
| |
| |
| |
| public float m_attackStaminaModifier; |
| |
| |
| |
| public float m_blockStaminaModifier; |
| |
| |
| |
| public float m_dodgeStaminaModifier; |
| |
| |
| |
| public float m_swimStaminaModifier; |
| |
| |
| |
| public float m_sneakStaminaModifier; |
| |
| |
| |
| public float m_runStaminaModifier; |
| |
| |
| [Header("Food settings")] |
| [Header("Food settings")] |
| public float m_food; |
| public float m_food; |
| |
| |
| public float m_foodStamina; |
| public float m_foodStamina; |
| |
| |
| public float m_foodEitr; |
| public float m_foodEitr; |
| |
| |
| public float m_foodBurnTime; |
| public float m_foodBurnTime; |
| |
| |
| public float m_foodRegen; |
| public float m_foodRegen; |
| |
| |
| [Header("Armor settings")] |
| [Header("Armor settings")] |
| public Material m_armorMaterial; |
| public Material m_armorMaterial; |
| |
| |
| public ItemDrop.ItemData.HelmetHairType m_helmetHideHair = ItemDrop.ItemData.HelmetHairType.Hidden; |
| public ItemDrop.ItemData.HelmetHairType m_helmetHideHair = ItemDrop.ItemData.HelmetHairType.Hidden; |
| |
| |
| public ItemDrop.ItemData.HelmetHairType m_helmetHideBeard; |
| public ItemDrop.ItemData.HelmetHairType m_helmetHideBeard; |
| |
| |
| public List<ItemDrop.ItemData.HelmetHairSettings> m_helmetHairSettings = new List<ItemDrop.ItemData.HelmetHairSettings>(); |
| public List<ItemDrop.ItemData.HelmetHairSettings> m_helmetHairSettings = new List<ItemDrop.ItemData.HelmetHairSettings>(); |
| |
| |
| public List<ItemDrop.ItemData.HelmetHairSettings> m_helmetBeardSettings = new List<ItemDrop.ItemData.HelmetHairSettings>(); |
| public List<ItemDrop.ItemData.HelmetHairSettings> m_helmetBeardSettings = new List<ItemDrop.ItemData.HelmetHairSettings>(); |
| |
| |
| public float m_armor = 10f; |
| public float m_armor = 10f; |
| |
| |
| public float m_armorPerLevel = 1f; |
| public float m_armorPerLevel = 1f; |
| |
| |
| public List<HitData.DamageModPair> m_damageModifiers = new List<HitData.DamageModPair>(); |
| public List<HitData.DamageModPair> m_damageModifiers = new List<HitData.DamageModPair>(); |
| |
| |
| [Header("Shield settings")] |
| [Header("Shield settings")] |
| public float m_blockPower = 10f; |
| public float m_blockPower = 10f; |
| |
| |
| public float m_blockPowerPerLevel; |
| public float m_blockPowerPerLevel; |
| |
| |
| public float m_deflectionForce; |
| public float m_deflectionForce; |
| |
| |
| public float m_deflectionForcePerLevel; |
| public float m_deflectionForcePerLevel; |
| |
| |
| public float m_timedBlockBonus = 1.5f; |
| public float m_timedBlockBonus = 1.5f; |
| |
| |
| [Header("Weapon")] |
| [Header("Weapon")] |
| public ItemDrop.ItemData.AnimationState m_animationState = ItemDrop.ItemData.AnimationState.OneHanded; |
| public ItemDrop.ItemData.AnimationState m_animationState = ItemDrop.ItemData.AnimationState.OneHanded; |
| |
| |
| public Skills.SkillType m_skillType = Skills.SkillType.Swords; |
| public Skills.SkillType m_skillType = Skills.SkillType.Swords; |
| |
| |
| public int m_toolTier; |
| public int m_toolTier; |
| |
| |
| public HitData.DamageTypes m_damages; |
| public HitData.DamageTypes m_damages; |
| |
| |
| public HitData.DamageTypes m_damagesPerLevel; |
| public HitData.DamageTypes m_damagesPerLevel; |
| |
| |
| public float m_attackForce = 30f; |
| public float m_attackForce = 30f; |
| |
| |
| public float m_backstabBonus = 4f; |
| public float m_backstabBonus = 4f; |
| |
| |
| public bool m_dodgeable; |
| public bool m_dodgeable; |
| |
| |
| public bool m_blockable; |
| public bool m_blockable; |
| |
| |
| public bool m_tamedOnly; |
| public bool m_tamedOnly; |
| |
| |
| public bool m_alwaysRotate; |
| public bool m_alwaysRotate; |
| |
| |
| public StatusEffect m_attackStatusEffect; |
| public StatusEffect m_attackStatusEffect; |
| |
| |
| . | |
| public float m_attackStatusEffectChance = 1f; |
| |
| |
| public GameObject m_spawnOnHit; |
| public GameObject m_spawnOnHit; |
| |
| |
| public GameObject m_spawnOnHitTerrain; |
| public GameObject m_spawnOnHitTerrain; |
| |
| |
| public bool m_projectileToolTip = true; |
| public bool m_projectileToolTip = true; |
| |
| |
| [Header("Ammo")] |
| [Header("Ammo")] |
| public string m_ammoType = ""; |
| public string m_ammoType = ""; |
| |
| |
| [Header("Attacks")] |
| [Header("Attacks")] |
| public Attack m_attack; |
| public Attack m_attack; |
| |
| |
| public Attack m_secondaryAttack; |
| public Attack m_secondaryAttack; |
| |
| |
| [Header("Durability")] |
| [Header("Durability")] |
| public bool m_useDurability; |
| public bool m_useDurability; |
| |
| |
| public bool m_destroyBroken = true; |
| public bool m_destroyBroken = true; |
| |
| |
| public bool m_canBeReparied = true; |
| public bool m_canBeReparied = true; |
| |
| |
| public float m_maxDurability = 100f; |
| public float m_maxDurability = 100f; |
| |
| |
| public float m_durabilityPerLevel = 50f; |
| public float m_durabilityPerLevel = 50f; |
| |
| |
| public float m_useDurabilityDrain = 1f; |
| public float m_useDurabilityDrain = 1f; |
| |
| |
| public float m_durabilityDrain; |
| public float m_durabilityDrain; |
| |
| |
| [Header("AI")] |
| [Header("AI")] |
| public float m_aiAttackRange = 2f; |
| public float m_aiAttackRange = 2f; |
| |
| |
| public float m_aiAttackRangeMin; |
| public float m_aiAttackRangeMin; |
| |
| |
| public float m_aiAttackInterval = 2f; |
| public float m_aiAttackInterval = 2f; |
| |
| |
| public float m_aiAttackMaxAngle = 5f; |
| public float m_aiAttackMaxAngle = 5f; |
| |
| |
| . | |
| public bool m_aiInvertAngleCheck; |
| |
| |
| public bool m_aiWhenFlying = true; |
| public bool m_aiWhenFlying = true; |
| |
| |
| public float m_aiWhenFlyingAltitudeMin; |
| public float m_aiWhenFlyingAltitudeMin; |
| |
| |
| public float m_aiWhenFlyingAltitudeMax = 999999f; |
| public float m_aiWhenFlyingAltitudeMax = 999999f; |
| |
| |
| public bool m_aiWhenWalking = true; |
| public bool m_aiWhenWalking = true; |
| |
| |
| public bool m_aiWhenSwiming = true; |
| public bool m_aiWhenSwiming = true; |
| |
| |
| public bool m_aiPrioritized; |
| public bool m_aiPrioritized; |
| |
| |
| public bool m_aiInDungeonOnly; |
| public bool m_aiInDungeonOnly; |
| |
| |
| public bool m_aiInMistOnly; |
| public bool m_aiInMistOnly; |
| |
| |
| [Range(0f, 1f)] |
| [Range(0f, 1f)] |
| public float m_aiMaxHealthPercentage = 1f; |
| public float m_aiMaxHealthPercentage = 1f; |
| |
| |
| . | |
| [Range(0f, 1f)] |
| |
| public float m_aiMinHealthPercentage; |
| |
| |
| public ItemDrop.ItemData.AiTarget m_aiTargetType; |
| public ItemDrop.ItemData.AiTarget m_aiTargetType; |
| |
| |
| [Header("Effects")] |
| [Header("Effects")] |
| public EffectList m_hitEffect = new EffectList(); |
| public EffectList m_hitEffect = new EffectList(); |
| |
| |
| public EffectList m_hitTerrainEffect = new EffectList(); |
| public EffectList m_hitTerrainEffect = new EffectList(); |
| |
| |
| public EffectList m_blockEffect = new EffectList(); |
| public EffectList m_blockEffect = new EffectList(); |
| |
| |
| public EffectList m_startEffect = new EffectList(); |
| public EffectList m_startEffect = new EffectList(); |
| |
| |
| public EffectList m_holdStartEffect = new EffectList(); |
| public EffectList m_holdStartEffect = new EffectList(); |
| . | |
| |
| |
| public EffectList m_equipEffect = new EffectList(); |
| |
| |
| |
| public EffectList m_unequipEffect = new EffectList(); |
| |
| |
| public EffectList m_triggerEffect = new EffectList(); |
| public EffectList m_triggerEffect = new EffectList(); |
| |
| |
| public EffectList m_trailStartEffect = new EffectList(); |
| public EffectList m_trailStartEffect = new EffectList(); |
| |
| |
| [Header("Consumable")] |
| [Header("Consumable")] |
| public StatusEffect m_consumeStatusEffect; |
| public StatusEffect m_consumeStatusEffect; |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |