Upload from upload_mods.ps1
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
public class MinEventActionVerifyNPCActionsRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute START");
|
||||
var entity = _params.Self as EntityAlive;
|
||||
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute BUF ENTITY: " + entity.EntityClass.entityClassName);
|
||||
|
||||
if (entity is EntityPlayerLocal)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute ENTITY IS PLAYER");
|
||||
EntityPlayerLocal ___entityPlayerLocal = (EntityPlayerLocal)entity;
|
||||
|
||||
float flMode = ___entityPlayerLocal.Buffs.GetCustomVar("varNPCModMode");
|
||||
float flHalt = ___entityPlayerLocal.Buffs.GetCustomVar("varNPCModStopAttacking");
|
||||
|
||||
for (int j = 0; j < ___entityPlayerLocal.Companions.Count; j++)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute j: " + j);
|
||||
var entityNPC = ___entityPlayerLocal.Companions[j] as EntityNPCRebirth;
|
||||
if (entityNPC != null)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute entityNPC: " + entityNPC.EntityClass.entityClassName);
|
||||
if (flMode == 0)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 1");
|
||||
entityNPC.Buffs.AddBuff("buffNPCModFullControlMode");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 2");
|
||||
entityNPC.Buffs.RemoveBuff("buffNPCModFullControlMode");
|
||||
}
|
||||
|
||||
if (flHalt == 1)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 3");
|
||||
entityNPC.Buffs.AddBuff("buffNPCModStopAttacking");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 4");
|
||||
entityNPC.Buffs.RemoveBuff("buffNPCModStopAttacking");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute ENTITY IS NPC");
|
||||
|
||||
EntityNPCRebirth entityNPC = (EntityNPCRebirth)entity;
|
||||
|
||||
if (entityNPC.LeaderUtils.Owner)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 6");
|
||||
float flMode = entityNPC.LeaderUtils.Owner.Buffs.GetCustomVar("varNPCModMode");
|
||||
float flHalt = entityNPC.LeaderUtils.Owner.Buffs.GetCustomVar("varNPCModStopAttacking");
|
||||
|
||||
if (flMode == 0)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 7");
|
||||
entityNPC.Buffs.AddBuff("buffNPCModFullControlMode");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 8");
|
||||
entityNPC.Buffs.RemoveBuff("buffNPCModFullControlMode");
|
||||
}
|
||||
|
||||
if (flHalt == 1)
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 9");
|
||||
entityNPC.Buffs.AddBuff("buffNPCModStopAttacking");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventVerifyNPCActionsRebirth-Execute 10");
|
||||
entityNPC.Buffs.RemoveBuff("buffNPCModStopAttacking");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user