Jump to content

guaranteed loot drop by creaturetype?


davidlallen

Recommended Posts

I have run into the problem you mention with companions. If it happens that my companions get in the killing blow, then the item does not drop. So I would like to add/remove the perk to companions as well, at least for the easy case of standard teammates. But I cannot see a way to do it.

 

Is there a function which gives me the list of current teammates? I can see ref.GetPlayerTeammate, but I'm certainly not going to iterate all NPC's to see if they are a teammate. Is there a formlist which lists the standard teammates, and is there a way to iterate a formlist with "foreach"? It would be "close enough" to iterate the 6-8 standard teammates and add/remove the perk from everybody on that list, regardless of whether they are currently a teammate. I am willing to accept any small, remaining bugs such as Veronica killing a ghoul while I am hunting ghouls but she is not my teammate, etc.

Link to comment
Share on other sites

K, I've actually tried...

 

NPCs can't have perks.

Followers can have perks (all Followers can have same perks, and this have to be added via Player.AddPerk PerkName 1)

Add Leveled List on Death does not work in companion perk (for example Calculate Weapon Damage does)

 

so... I'm afraid it's not possible to easily add this item of Yours when companion takes killing blow.

 

anyways (NVSE required)...

 

short nLootMode
ref rLootRef

begin menumode 1008
if nLootMode == 0
 set rLootRef to GetCrosshairRef
 set nLootMode to 2
 if rLootRef != 0 && rLootRef.IsActor && rLootRef.GetInFaction FeralGhoulFaction && rLootRef.GetAV Strength < 100
  rLootRef.ModAV Strength 100
  rLootRef.AddItem Caps001 1000
  set nLootMode to 1
  con_CloseAllMenus
 endif
endif
end

begin gamemode
if nLootMode == 1
 set nLootMode to 0
 rLootRef.Activate Player 1
endif
set nLootMode to 0
end

 

should work always (it's essentially Activate perk on loot containers...) You'll need to add quest check, put this into quest with lowest possible delay.

It will however have ugly effect of closing container menu and reopenning it... Possibly better way if You don't mind is adding item directly into player inventory with some message.

Like "After carefully examining ghoul while searching it for items You also found ...."

 

Also it would be best separating gamemode and menumode into two quests and starting / stopping gamemode quest for tiny performance gain.

 

EDIT:

slightly better version, but openning container still looks a bit strange...

 

short nLootMode
ref rLootRef

begin menumode 1008
if nLootMode == 0
 set rLootRef to GetCrosshairRef
 set nLootMode to 1
 if rLootRef != 0 && rLootRef.IsActor && rLootRef.GetInFaction FeralGhoulFaction && rLootRef.GetAV Strength < 100
  rLootRef.ModAV Strength 100
  rLootRef.AddItem Caps001 1000
  rLootRef.Activate Player 1
 endif
endif
end

begin gamemode
set nLootMode to 0
end

Edited by thc1234
Link to comment
Share on other sites

Thank you very much for all this investigation. I was hoping the perk would be the "perfect" answer. For now, I think I will accept the limitation that companion kills will not trigger the drop. If this becomes the biggest complaint about the mod, then I will learn about NVSE and try more.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...