Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments for matching retail corpse rare generation notifications #1836

Merged
merged 1 commit into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Source/ACE.Server/Network/Structure/AppraiseInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@ private void generateAppraisalInfo(WorldObject wo, Player examiner, bool success
}
}

if (wo is Corpse)
{
PropertiesBool.Clear();
PropertiesDID.Clear();
PropertiesFloat.Clear();
PropertiesInt64.Clear();

var discardInts = PropertiesInt.Where(x => x.Key != PropertyInt.EncumbranceVal && x.Key != PropertyInt.Value).Select(x => x.Key).ToList();
foreach (var key in discardInts)
PropertiesInt.Remove(key);
var discardString = PropertiesString.Where(x => x.Key != PropertyString.LongDesc).Select(x => x.Key).ToList();
foreach (var key in discardString)
PropertiesString.Remove(key);
}

if (wo is Portal)
{
if (PropertiesInt.ContainsKey(PropertyInt.EncumbranceVal))
Expand Down
21 changes: 16 additions & 5 deletions Source/ACE.Server/WorldObjects/Corpse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using ACE.Server.Managers;
using ACE.Server.Network.GameMessages.Messages;
using ACE.Server.Factories;
using ACE.Server.Entity.Actions;

namespace ACE.Server.WorldObjects
{
Expand Down Expand Up @@ -165,16 +166,23 @@ public bool CorpseGeneratedRare

public override void EnterWorld()
{
var actionChain = new ActionChain();

base.EnterWorld();

if (Location != null)
actionChain.AddDelaySeconds(.5);
actionChain.AddAction(this, () =>
{
if (CorpseGeneratedRare)
if (Location != null)
{
EnqueueBroadcast(new GameMessageSystemChat($"{killerName} has discovered the {rareGenerated.Name}!", ChatMessageType.System));
ApplySoundEffects(Sound.TriggerActivated, 10);
if (CorpseGeneratedRare)
{
EnqueueBroadcast(new GameMessageSystemChat($"{killerName} has discovered the {rareGenerated.Name}!", ChatMessageType.System));
ApplySoundEffects(Sound.TriggerActivated, 10);
}
}
}
});
actionChain.EnqueueChain();
}

private WorldObject rareGenerated;
Expand All @@ -191,6 +199,9 @@ public void GenerateRare(WorldObject killer)
if (wo == null)
return;

if (!wo.IconUnderlayId.HasValue || wo.IconUnderlayId.Value != 0x6005B0C) // ensure icon underlay exists for rare (loot profiles use this)
wo.IconUnderlayId = 0x6005B0C;

var tier = LootGenerationFactory.GetRareTier(wo.WeenieClassId);
LootGenerationFactory.RareChances.TryGetValue(tier, out var chance);

Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ACEmulator Change Log

### 2019-05-01
[Ripley]
* Adjust rare generation code to apply expected icon underlay if wrong or missing.
* Adjust corpse world entry to issue rare alert text/sound after corpse is spawned and not before.
* Remove all properties from corpse assessment except those seen in pcaps.

### 2019-04-30
[Theran]
* Update Tusker Guard loot tier profile to T4, up from T3, to match wiki
Expand Down