Upload from upload_mods.ps1
This commit is contained in:
40
Scripts/Dialog/NPCs/DialogActionExecuteCommandRebirth.cs
Normal file
40
Scripts/Dialog/NPCs/DialogActionExecuteCommandRebirth.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
public class DialogActionExecuteCommandRebirth : DialogActionAddBuff
|
||||
{
|
||||
public override BaseDialogAction.ActionTypes ActionType => BaseDialogAction.ActionTypes.AddBuff;
|
||||
|
||||
public override void PerformAction(EntityPlayer player)
|
||||
{
|
||||
var entityId = -1;
|
||||
if (player.Buffs.HasCustomVar("CurrentNPC"))
|
||||
entityId = (int)player.Buffs.GetCustomVar("CurrentNPC");
|
||||
|
||||
if (entityId == -1)
|
||||
return;
|
||||
|
||||
var myEntity = GameManager.Instance.World.GetEntity(entityId) as EntityAliveV2;
|
||||
if (myEntity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
|
||||
switch (ID)
|
||||
{
|
||||
case "OpenInventory":
|
||||
if (myEntity.lootContainer == null)
|
||||
{
|
||||
Log.Out("DialogActionExecuteCommandRebirth-PerformAction NO LOOT CONTAINER SET");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(myEntity.lootContainer.lootListName))
|
||||
myEntity.lootContainer.lootListName = "traderNPC";
|
||||
|
||||
RebirthUtilities.lootContainerOpened(myEntity.lootContainer, uiforPlayer, player.entityId);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user