diff --git a/Source/ACE.Server/Managers/PropertyManager.cs b/Source/ACE.Server/Managers/PropertyManager.cs index 2e0b6f71f2..7c5bff1053 100644 --- a/Source/ACE.Server/Managers/PropertyManager.cs +++ b/Source/ACE.Server/Managers/PropertyManager.cs @@ -612,6 +612,7 @@ public static void LoadDefaultProperties() public static readonly ReadOnlyDictionary> DefaultLongProperties = DictOf( + ("award_wcid_for_legendary", new Property(0, "the WCID to award for emote giving instead of legendary keys. 0 = disabled feature")), ("char_delete_time", new Property(3600, "the amount of time in seconds a deleted character can be restored")), ("chat_requires_account_time_seconds", new Property(0, "the amount of time in seconds an account is required to have existed for for global chat privileges")), ("chat_requires_player_age", new Property(0, "the amount of time in seconds a player is required to have played for global chat privileges")), diff --git a/Source/ACE.Server/WorldObjects/Player_Inventory.cs b/Source/ACE.Server/WorldObjects/Player_Inventory.cs index 57fd5f6287..c43d24bb7d 100644 --- a/Source/ACE.Server/WorldObjects/Player_Inventory.cs +++ b/Source/ACE.Server/WorldObjects/Player_Inventory.cs @@ -3383,7 +3383,34 @@ private void OnPutItemInContainer(uint itemGuid, uint containerGuid, int placeme Prev_PutItemInContainer[1] = Prev_PutItemInContainer[0]; Prev_PutItemInContainer[0] = new PutItemInContainerEvent(itemGuid, containerGuid, placement); } - + + // Map of the various legendary keys that may be given on emote/quest and the number of uses. + // Static map for quick comparisons + static Dictionary _LegendaryKeyUses = new Dictionary() + { + {48746, 1 }, // Aged Legendary Key + {48747, 1 }, // 24 hour, single use + {48748, 2 }, // 24 hour, 2 use + {48749, 3 }, // 24 hour, 3 use + {48750, 4 }, // 24 hour, 4 use + {48914, 1 }, // 24 hour, 1 use, quest legendary chest key + {51558, 1 }, // 1 use + {51586, 3 }, // 24 hour, 3 use, quest legendary chest key + {51648, 3 }, // 24 hour, 3 use, quest legendary chest key + {51954, 10 }, // Durable Legendary Key + {51963, 25 }, // 25 use + {52010, 5 }, // 24 hour, 5 use, quest legendary chest key + {72048, 1 }, // 24 hour, 1 use, quest legendary chest key non-pcap + {72338, 3 }, // 24 hour, 3 use, quest legendary chest key non-pcap + {72474, 2 }, // 24 hour, 2 use, quest legendary chest key non-pcap + {72600, 1 }, // 24 hour, 1 use, quest legendary chest key non-pcap + {72628, 1 }, // 24 hour, 1 use, quest legendary chest key non-pcap + {72635, 3 }, // 24 hour, 3 use, quest legendary chest key non-pcap + {72669, 1 }, // 24 hour, 1 use, quest legendary chest key non-pcap + {72807, 2 }, // 24 hour, 2 use, quest legendary chest key non-pcap + {87168, 4 } // 24 hour, 4 use, quest legendary chest key non-pcap + }; + public void GiveFromEmote(WorldObject emoter, uint weenieClassId, int amount = 1, int palette = 0, float shade = 0) { if (emoter is null || weenieClassId == 0) @@ -3397,8 +3424,17 @@ public void GiveFromEmote(WorldObject emoter, uint weenieClassId, int amount = 1 } var itemsToReceive = new ItemsToReceive(this); - itemsToReceive.Add(weenieClassId, amount); + // If supported by server setting, substitute emote given items across all interactions + uint substituteItem = (uint)PropertyManager.GetLong("award_wcid_for_legendary").Item; + if ((substituteItem != 0) && _LegendaryKeyUses.ContainsKey(weenieClassId)) + { + // log.Debug($"Substituting {substituteItem} for {weenieClassId} with quantity {amount}"); + amount *= _LegendaryKeyUses[weenieClassId]; + weenieClassId = substituteItem; + // log.Debug($"Substituted quantity {amount}"); + } + itemsToReceive.Add(weenieClassId, amount); var itemStacks = itemsToReceive.RequiredSlots; if (itemsToReceive.PlayerExceedsLimits)