41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|