What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Question] Mods on strongboxes

MrUnreal

Member
Joined
Oct 27, 2013
Messages
66
Reaction score
1
Are we able to programmatically acess the mods on strongboxes ?
 
Yes! You have access to all the mods for strongboxes, corrupted areas, and even the current map.

You'll want to checkout the Loki.Game.Objects.Chest class which exposes chest specific things, but you're also able to access the various components to get more information.

The easiest thing to do is access the Stats property and go from there. If you use the Object Explorer, you'll be able to see them as well in the debug window. As expected, you can't know the stats of unidentified objects, so you have to id them first to process it.

To use currency on them, you'll want to use InventoryPanel.UseItemOnObject and pass the currency you find from your main inventory on the strongbox itself. You'll want to be somewhat close, sine you have to open your inventory to use an item, so your screen view will be cut in half roughly when you go to use the item itself.
 
heyas :)

working on a strongbox plugin currently
having some trouble finding the best way to check the affixes on strongboxes


chest = LokiPoe.ObjectManager.GetObjectById<Chest>(_chestLocation.Id);


foreach (var kvp in chest.Stats)
{
Log.ErrorFormat("[WhatAffix] {0} => {1}", kvp.Key, kvp.Value);
}


will return something like
[WhatAffix] 2165 => 1
[WhatAffix] 2168 => 1
[WhatAffix] 2216 => 500
[WhatAffix] 2242 => 1
[WhatAffix] 2279 => 3

changing the foreach to chest.ObjectMagicPropertiesStats returns the same results

checking the same chest in object explorer shows:
MagicProperties: (Magic)
ChestDelayDropsUntilDaemonsFinish = 1
ChestPlayWarningSound = 1
ChestHiddenItemRarityPosPct = 500
ChestDisplayExplosion = 1
NumberOfPacksToSummon = 3

matching them up, we now know key 2242 refers to 'explodes' mod
but the keys for https://gist.github.com/anonymous/4031b9a778ed83280f26 seems to be outdated
and basing logic off the key alone is dangerous, since they change often. Don't want to unintentionally open a ice nova / explodes on a reduced resist map etc

there are two ways I can think of for handling this:
is there somewhere with the API to check the key relating to a stat, that is always up to date?
or alternatively, a way to check the plaintext name of the stat directly

advice?


Thanks!
 
Code:
public enum ChestStat
{
    ChestCamoflaged = 0x8bd,
    ChestDelayDropsUntilDaemonsFinish = 0x875,
    ChestDisplayCastRandomCurse = 0x8be,
    ChestDisplayExplodesCorpses = 0x8bc,
    ChestDisplayExplosion = 0x8c2,
    ChestDisplayFireStorm = 0x8c0,
    ChestDisplayFreeze = 0x87d,
    ChestDisplayIceNova = 0x87c,
    ChestDisplayIgnite = 0x8bf,
    ChestDisplayKaomTotems = 0x94a,
    ChestDisplayPoisonClouds = 0x8c1,
    ChestDisplayReviveNearbyMonsters = 0x8ba,
    ChestDisplaySpawnsMonstersContinuously = 0x8bb,
    ChestDisplaySummonsSkeletons = 0x87b,
    ChestDropAdditionalMagicItemsUpTo = 0x8b0,
    ChestDropAdditionalNormalItemsUpTo = 0x8af,
    ChestDropAdditionalNumberOfUniquesOfDropPoolTypes = 0x949,
    ChestDropAdditionalRareItemsUpTo = 0x8b1,
    ChestDropAdditionalUniqueMaps = 0x94e,
    ChestDropAdditionalUnqiueItems = 0x879,
    ChestDroppedItemLevelPos = 0x8b5,
    ChestDroppedItemsAreFullyLinked = 0x8b4,
    ChestDroppedItemsHaveAdditionalSockets = 0x8b3,
    ChestDroppedItemsHaveQualityPct = 0x8b2,
    ChestDropsAdditionalUtilityFlasks = 0x8ad,
    ChestDropsDuplicatedItem = 0x8b6,
    ChestDropsExtraVaalGems = 0x8c5,
    ChestDropsOnlyHybridFlasks = 0x8c3,
    ChestDropsOnlySupportGems = 0x8c4,
    ChestGemsDropWithExperience = 0x8ac,
    ChestHiddenItemQuantityPosPct = 0x8a7,
    ChestHiddenItemRarityPosPct = 0x8a8,
    ChestItemQuantityPosPct = 0x99,
    ChestItemRarityPosPct = 0x9b,
    ChestItemsDropIdentified = 0x8ae,
    ChestNoRegularDrops = 0x94c,
    ChestNumberOfAdditionalKaomUniquesToDrop = 0x948,
    ChestPlayWarningSound = 0x878,
    ChestSpawnRogueExiles = 0x8b9
}

This can be found in Loki.Game.GameData.StatType enum
 
In addition, to know the correct enum type, you can just cast to a StatTypeGGG (which is in Loki.Game.GameData):
Code:
foreach (var kvp in chest.Stats)
{
   Log.ErrorFormat("[WhatAffix] {0} => {1}", (StatTypeGGG)kvp.Key, kvp.Value);
}

To know all the stats and stuff, you can dump them using the Dev tab. See the second half of the following guide: The "Dev" Tab: Runtime Development Using CodeDOM. The generated StatTypeGGG.cs file will list all stats and their int values.

That way, you can handle stat id changes, which can happen frequently in this game.
Code:
foreach (var kvp in chest.Stats)
{
   var stat = (StatTypeGGG)kvp.Key;
   Log.ErrorFormat("[WhatAffix] {0} => {1}", stat, kvp.Value);
   if(stat == StatTypeGGG.ChestNoRegularDrops)
   {
       // ...
   }
}

That solves the issue of ChestNoRegularDrops changing by 1 due to GGG adding a state before it in a future version.
 
Back
Top