Upload from upload_mods.ps1
This commit is contained in:
25
Scripts/MinEvents/Inactive/MinEventActionAdjustStats.cs
Normal file
25
Scripts/MinEvents/Inactive/MinEventActionAdjustStats.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
public class MinEventActionAdjustStats : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity is EntityNPCRebirth npc)
|
||||
{
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsClient)
|
||||
{
|
||||
//Log.Out("MinEventActionAdjustStats-Execute SEND TO SERVER");
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer(NetPackageManager.GetPackage<NetPackageAdjustStats>().Setup(entity.entityId), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionAdjustStats-Execute IS SERVER");
|
||||
GameManager.Instance.StartCoroutine(RebirthUtilities.adjustNPCStats(npc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Xml;
|
||||
|
||||
|
||||
public class MinEventActionCheckLockedSlotsRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
float flLockedSlots = player.Buffs.GetCustomVar("$varFuriousRamsayLockedSlots");
|
||||
if (flLockedSlots > 0)
|
||||
{
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
|
||||
XUiV_Window window = uiforPlayer.xui.GetWindow("windowBackpack");
|
||||
if (window != null)
|
||||
{
|
||||
XUiC_ContainerStandardControls ctrlLockedSlots = window.Controller.GetChildByType<XUiC_ContainerStandardControls>();
|
||||
|
||||
if (ctrlLockedSlots != null)
|
||||
{
|
||||
XUiC_ComboBoxInt ctrlComboBox = (XUiC_ComboBoxInt)ctrlLockedSlots.GetChildById("cbxLockedSlots");
|
||||
ctrlComboBox.Value = (int)flLockedSlots;
|
||||
ctrlLockedSlots.ChangeLockedSlots((int)flLockedSlots);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// <triggered_effect trigger = "onSelfBuffUpdate" action="NotifyTeamTeleport, SCore" />
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static HiresManagerRebirth;
|
||||
|
||||
public class MinEventActionNotifyTeamTeleportRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var leader = _params.Self as EntityPlayer;
|
||||
if (leader == null) return;
|
||||
|
||||
foreach (hireInfo hire in playerHires)
|
||||
{
|
||||
if (hire.playerID == leader.entityId && hire.order == 0)
|
||||
{
|
||||
EntityNPCRebirth entity = GameManager.Instance.World.GetEntity(hire.hireID) as EntityNPCRebirth;
|
||||
if (entity)
|
||||
{
|
||||
float flNPCRespawned = entity.Buffs.GetCustomVar("$FR_NPC_Respawn");
|
||||
if (entity.IsDead() || flNPCRespawned == 1) continue;
|
||||
|
||||
var distance = entity.GetDistance(leader);
|
||||
if (distance > 60)
|
||||
{
|
||||
entity.TeleportToPlayer(leader, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
184
Scripts/MinEvents/MinEventActionAOEDamage.cs
Normal file
184
Scripts/MinEvents/MinEventActionAOEDamage.cs
Normal file
@@ -0,0 +1,184 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionAOEDamage : MinEventActionTargetedBase
|
||||
{
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionAOEDamage-Execute");
|
||||
var entityAlive = _params.Self as EntityAlive;
|
||||
|
||||
if (entityAlive == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("ENTITY: " + entityAlive.EntityName);
|
||||
//Log.Out("POSITION: " + entityAlive.position);
|
||||
//Log.Out("BELONGS TO PLAYER: " + entityAlive.belongsPlayerId);
|
||||
//Log.Out("ENTITY radius: " + this.entityRadius);
|
||||
//Log.Out("ENTITY damage: " + this.entityDamage);
|
||||
|
||||
int entityId = EntityClass.FromString("FuriousRamsayNoEarthDamage");
|
||||
|
||||
DynamicProperties properties = EntityClass.list[entityId].Properties;
|
||||
|
||||
ExplosionData tmpExplosionData = new ExplosionData(properties);
|
||||
|
||||
bool ignore = false;
|
||||
|
||||
if (this.ignoreHeatmap == 1)
|
||||
{
|
||||
ignore = true;
|
||||
}
|
||||
|
||||
ExplosionData explosionData = new ExplosionData
|
||||
{
|
||||
BlastPower = this.blastPower,
|
||||
BlockDamage = (float)this.blockDamage,
|
||||
BlockRadius = (float)this.blockRadius,
|
||||
BlockTags = this.blockTags,
|
||||
EntityDamage = (float)this.entityDamage,
|
||||
EntityRadius = this.entityRadius,
|
||||
ParticleIndex = this.ParticleIndex,
|
||||
damageMultiplier = tmpExplosionData.damageMultiplier,
|
||||
IgnoreHeatMap = ignore
|
||||
|
||||
};
|
||||
|
||||
ItemValue itemExplosion = null;
|
||||
|
||||
if (explosionType == 1)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("thrownGrenadeContact", false);
|
||||
}
|
||||
else if (explosionType == 9997)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("otherExplosion2", false);
|
||||
}
|
||||
else if (explosionType == 9998)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("otherExplosion", false);
|
||||
}
|
||||
else if (explosionType == 9999)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("auraExplosion", false);
|
||||
}
|
||||
else if (explosionType == 9996)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("auraExplosion2", false);
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionAOEDamage-Execute: InstigatorId: " + _params.Buff.InstigatorId);
|
||||
//Log.Out("MinEventActionAOEDamage-Execute: entityAlive.belongsPlayerId: " + entityAlive.belongsPlayerId);
|
||||
|
||||
if (entityAlive is EntityZombieSDX)
|
||||
{
|
||||
//Log.Out("MinEventActionAOEDamage-Execute: InstigatorId: " + _params.Buff.InstigatorId);
|
||||
EntityZombieSDX entityZombie = (EntityZombieSDX)entityAlive;
|
||||
if (entityZombie != null)
|
||||
{
|
||||
//Log.Out("MinEventActionAOEDamage-Execute: InstigatorId B");
|
||||
entityZombie.entityThatKilledMeID = _params.Buff.InstigatorId;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.blastPower == 201)
|
||||
{
|
||||
RebirthUtilities.InstantiateParticleEffect(particleName, impactPosition, soundName, _params.Self, _params.Position);
|
||||
}
|
||||
|
||||
GameManager.Instance.ExplosionServer(0, entityAlive.position, entityAlive.GetBlockPosition(), entityAlive.qrotation, explosionData, _params.Buff.InstigatorId, 0f, false, itemExplosion);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "blastPower")
|
||||
{
|
||||
blastPower = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "blockDamage")
|
||||
{
|
||||
blockDamage = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "blockRadius")
|
||||
{
|
||||
blockRadius = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "entityDamage")
|
||||
{
|
||||
entityDamage = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "entityRadius")
|
||||
{
|
||||
entityRadius = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "ParticleIndex")
|
||||
{
|
||||
ParticleIndex = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "explosionType")
|
||||
{
|
||||
explosionType = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "blockTags")
|
||||
{
|
||||
blockTags = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "ignoreHeatmap")
|
||||
{
|
||||
ignoreHeatmap = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "particleName")
|
||||
{
|
||||
particleName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "impactPosition")
|
||||
{
|
||||
impactPosition = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "soundName")
|
||||
{
|
||||
soundName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected int blastPower = 0;
|
||||
protected int blockDamage = 0;
|
||||
protected int blockRadius = 0;
|
||||
protected int entityDamage = 0;
|
||||
protected int entityRadius = 0;
|
||||
protected int ParticleIndex = 13;
|
||||
protected int explosionType = 0;
|
||||
protected int ignoreHeatmap = 0;
|
||||
protected string blockTags = "";
|
||||
protected string particleName = "";
|
||||
protected string impactPosition = "";
|
||||
protected string soundName = "";
|
||||
}
|
||||
102
Scripts/MinEvents/MinEventActionAddAoEBuff.cs
Normal file
102
Scripts/MinEvents/MinEventActionAddAoEBuff.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
#nullable disable
|
||||
[Preserve]
|
||||
public class MinEventActionAddAoEBuff : MinEventActionBuffModifierBase
|
||||
{
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public float duration;
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public bool durationAltered;
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public bool cvarRef;
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public string refCvarName = string.Empty;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
bool _netSync = !_params.Self.isEntityRemote | _params.IsLocal;
|
||||
int _instigatorId = -1;
|
||||
if (_params.Buff != null)
|
||||
_instigatorId = _params.Buff.InstigatorId;
|
||||
if (_instigatorId == -1)
|
||||
_instigatorId = _params.Self.entityId;
|
||||
for (int index1 = 0; index1 < this.targets.Count; ++index1)
|
||||
{
|
||||
#region Rebirth
|
||||
if (!RebirthUtilities.CanAttackExecute(this.targets[index1]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute PROCEEDING target: " + this.targets[index1].EntityClass.entityClassName);
|
||||
|
||||
string[] strArray = this.buffNames;
|
||||
if (this.buffOneOnly && this.buffWeights != null)
|
||||
{
|
||||
float randomFloat = this.targets[index1].rand.RandomFloat;
|
||||
float num = 0.0f;
|
||||
for (int index2 = 0; index2 < this.buffWeights.Length; ++index2)
|
||||
{
|
||||
num += this.buffWeights[index2];
|
||||
if ((double) num >= (double) randomFloat)
|
||||
{
|
||||
strArray = new string[1]
|
||||
{
|
||||
this.buffNames[index2]
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.buffWeights != null)
|
||||
{
|
||||
List<string> stringList = new List<string>();
|
||||
for (int index3 = 0; index3 < this.buffWeights.Length; ++index3)
|
||||
{
|
||||
float randomFloat = this.targets[index1].rand.RandomFloat;
|
||||
if ((double) this.buffWeights[index3] >= (double) randomFloat)
|
||||
stringList.Add(this.buffNames[index3]);
|
||||
}
|
||||
strArray = stringList.ToArray();
|
||||
}
|
||||
for (int index4 = 0; index4 < strArray.Length; ++index4)
|
||||
{
|
||||
string _name = strArray[index4];
|
||||
BuffClass buff = BuffManager.GetBuff(_name);
|
||||
if (buff != null)
|
||||
{
|
||||
if (this.durationAltered && this.cvarRef)
|
||||
this.duration = !this.targets[index1].Buffs.HasCustomVar(this.refCvarName) ? buff.InitialDurationMax : this.targets[index1].Buffs.GetCustomVar(this.refCvarName);
|
||||
if (this.durationAltered)
|
||||
{
|
||||
int num1 = (int) this.targets[index1].Buffs.AddBuff(_name, _instigatorId, _netSync, _buffDuration: this.duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = (int) this.targets[index1].Buffs.AddBuff(_name, _instigatorId, _netSync);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool xmlAttribute = base.ParseXmlAttribute(_attribute);
|
||||
if (xmlAttribute || !(_attribute.Name.LocalName == "duration"))
|
||||
return xmlAttribute;
|
||||
if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.cvarRef = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
this.duration = StringParsers.ParseFloat(_attribute.Value);
|
||||
this.durationAltered = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
49
Scripts/MinEvents/MinEventActionAddBuffRebirth.cs
Normal file
49
Scripts/MinEvents/MinEventActionAddBuffRebirth.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
public class MinEventActionAddBuffRebirth : MinEventActionBuffModifierBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
bool flag = !_params.Self.isEntityRemote | _params.IsLocal;
|
||||
int num = -1;
|
||||
if (_params.Buff != null)
|
||||
{
|
||||
num = _params.Buff.InstigatorId;
|
||||
}
|
||||
if (num == -1)
|
||||
{
|
||||
num = _params.Self.entityId;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
float num2 = 0f;
|
||||
for (int j = 0; j < this.buffNames.Length; j++)
|
||||
{
|
||||
string name = this.buffNames[j];
|
||||
if (BuffManager.GetBuff(name) != null)
|
||||
{
|
||||
if (this.buffOneOnly && this.buffWeights != null)
|
||||
{
|
||||
num2 += this.buffWeights[j];
|
||||
if (num2 >= this.targets[i].rand.RandomFloat)
|
||||
{
|
||||
primaryPlayer.Buffs.AddBuff(name, num, flag && this.targets[i].isEntityRemote, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (this.buffWeights != null)
|
||||
{
|
||||
if (this.buffWeights[j] >= this.targets[i].rand.RandomFloat)
|
||||
{
|
||||
primaryPlayer.Buffs.AddBuff(name, num, flag && this.targets[i].isEntityRemote, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
primaryPlayer.Buffs.AddBuff(name, num, flag && this.targets[i].isEntityRemote, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/MinEvents/MinEventActionAddForceRebirth.cs
Normal file
42
Scripts/MinEvents/MinEventActionAddForceRebirth.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.Globalization;
|
||||
|
||||
using System.Xml.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// Action to add force to the entity rigidbody component by calling the game's DoRagdoll method
|
||||
/// </summary>
|
||||
public class MinEventActionAddForceRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
float _initialForceStrength = 250f;
|
||||
Vector2Int _XZMultiplier = new Vector2Int(4, 10); // side to side range - x and z coord
|
||||
Vector2Int _heightMultiplier = new Vector2Int(6, 12); // y coord
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
// This should provide a nice random distribution of flying zombies
|
||||
EntityAlive entityAlive = _params.Self;
|
||||
int xSign = UnityEngine.Random.Range(0, 2) * 2 - 1; // randomly go in the negative direction
|
||||
int zSign = UnityEngine.Random.Range(0, 2) * 2 - 1;
|
||||
int xStr = UnityEngine.Random.Range(_XZMultiplier.x, _XZMultiplier.y) * xSign;
|
||||
int yStr = UnityEngine.Random.Range(_heightMultiplier.x, _heightMultiplier.y);
|
||||
int zStr = UnityEngine.Random.Range(_XZMultiplier.x, _XZMultiplier.y) * zSign;
|
||||
Vector3 force = new Vector3(_initialForceStrength * xStr, _initialForceStrength * yStr, _initialForceStrength * zStr);
|
||||
//Log.Out($"Execute AddForce v3 force: {force}, x: {xStr}, y: {yStr}, z: {zStr}, xSign: {xSign}, zSign: {zSign}");
|
||||
entityAlive.emodel.DoRagdoll(1f, EnumBodyPartHit.LowerLegs, force, Vector3.zero, entityAlive.isEntityRemote);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "force")
|
||||
{
|
||||
_initialForceStrength = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
112
Scripts/MinEvents/MinEventActionAddItemRebirth.cs
Normal file
112
Scripts/MinEvents/MinEventActionAddItemRebirth.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionAddItemRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private int numItems = 1;
|
||||
private int numLocation = 0;
|
||||
private int numQuality = 0;
|
||||
private string itemName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute IS CLIENT");
|
||||
|
||||
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute NO Player");
|
||||
return;
|
||||
}
|
||||
|
||||
ItemValue item = ItemClass.GetItem(itemName, false);
|
||||
ItemValue itemValue = new ItemValue(ItemClass.GetItem(itemName, false).type, true);
|
||||
int num = numItems;
|
||||
|
||||
if (itemValue.HasQuality)
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 1");
|
||||
num = 1;
|
||||
}
|
||||
|
||||
//Log.Out("Item: " + itemName);
|
||||
//Log.Out("Number: " + num);
|
||||
//Log.Out("Item Value: " + itemValue.ToString());
|
||||
//Log.Out("Item Type: " + itemValue.type.ToString());
|
||||
//Log.Out("Item GetItemId: " + itemValue.GetItemId());
|
||||
//Log.Out("Item GetType: " + itemValue.GetType());
|
||||
|
||||
ItemStack myStack = new ItemStack(itemValue, num);
|
||||
|
||||
if (numQuality > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 2");
|
||||
myStack.itemValue.Quality = (ushort)numQuality;
|
||||
}
|
||||
|
||||
if (numLocation == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 3");
|
||||
if (!player.inventory.AddItem(myStack))
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 4");
|
||||
if (!player.bag.AddItem(myStack))
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 5");
|
||||
player.world.gameManager.ItemDropServer(new ItemStack(itemValue, num), player.GetPosition(), Vector3.zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 6");
|
||||
if (!player.bag.AddItem(myStack))
|
||||
{
|
||||
//Log.Out("MinEventActionAddItemRebirth-Execute 7");
|
||||
player.world.gameManager.ItemDropServer(new ItemStack(itemValue, num), player.GetPosition(), Vector3.zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "numItems")
|
||||
{
|
||||
numItems = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "itemName")
|
||||
{
|
||||
itemName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "location")
|
||||
{
|
||||
numLocation = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "quality")
|
||||
{
|
||||
numQuality = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/MinEvents/MinEventActionAnimatorGetBoolRebirth.cs
Normal file
43
Scripts/MinEvents/MinEventActionAnimatorGetBoolRebirth.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionAnimatorGetBoolRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
if (this.targets[i].emodel != null && this.targets[i].emodel.avatarController != null)
|
||||
{
|
||||
bool bResult = false;
|
||||
this.targets[i].emodel.avatarController.TryGetBool(this.property, out bResult);
|
||||
Log.Out("MinEventActionAnimatorGetBoolRebirth-Execute bResult: " + bResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "property")
|
||||
{
|
||||
this.property = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (name == "value")
|
||||
{
|
||||
this.value = StringParsers.ParseBool(_attribute.Value, 0, -1, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected string property;
|
||||
protected bool value;
|
||||
}
|
||||
43
Scripts/MinEvents/MinEventActionAnimatorGetIntRebirth.cs
Normal file
43
Scripts/MinEvents/MinEventActionAnimatorGetIntRebirth.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionAnimatorGetIntRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
if (this.targets[i].emodel != null && this.targets[i].emodel.avatarController != null)
|
||||
{
|
||||
int numResult = 0;
|
||||
this.targets[i].emodel.avatarController.TryGetInt(this.property, out numResult);
|
||||
//Log.Out("MinEventActionAnimatorGetIntRebirth-Execute numResult: " + numResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "property")
|
||||
{
|
||||
this.property = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (name == "value")
|
||||
{
|
||||
this.value = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected string property;
|
||||
protected int value;
|
||||
}
|
||||
157
Scripts/MinEvents/MinEventActionAoEEffectRebirth.cs
Normal file
157
Scripts/MinEvents/MinEventActionAoEEffectRebirth.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using Audio;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionAoEEffectRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string strEffect = "";
|
||||
private string strDistance = "";
|
||||
private string strHeight = "";
|
||||
private string strSound = "";
|
||||
public int minMax = 40;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute START");
|
||||
|
||||
if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute IS CLIENT");
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 transformPos = MinEventParams.CachedEventParam.Position;
|
||||
|
||||
bool canPlaySound = false;
|
||||
|
||||
if (strEffect == "MindControl")
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 1");
|
||||
List<Entity> entitiesInBounds = GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityZombieSDX), BoundsUtils.BoundsForMinMax(transformPos.x - this.minMax, transformPos.y - 50, transformPos.z - this.minMax, transformPos.x + this.minMax, transformPos.y + 30, transformPos.z + this.minMax), new List<Entity>());
|
||||
//List<Entity> entitiesInBounds2 = GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityZombieCopRebirth), BoundsUtils.BoundsForMinMax(transformPos.x - this.minMax, transformPos.y - 50, transformPos.z - this.minMax, transformPos.x + this.minMax, transformPos.y + 30, transformPos.z + this.minMax), new List<Entity>());
|
||||
|
||||
var player = _params.Self as EntityPlayer;
|
||||
|
||||
if (player)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute player: " + player.name);
|
||||
|
||||
int progressionLevel = 0;
|
||||
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("FuriousRamsayPerkBlackMagic");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 2");
|
||||
progressionLevel = progressionValue.Level;
|
||||
}
|
||||
else
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 3");
|
||||
return;
|
||||
}
|
||||
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 4");
|
||||
if (entitiesInBounds != null && entitiesInBounds.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < entitiesInBounds.Count; i++)
|
||||
{
|
||||
EntityZombieSDX entity = (EntityZombieSDX)entitiesInBounds[i];
|
||||
///Log.Out("===============================================================");
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 5 entity: " + entity.EntityClass.entityClassName);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 6");
|
||||
bool isFeral = entity.HasAnyTags(FastTags<TagGroup.Global>.Parse("feral"));
|
||||
bool isRadiated = entity.HasAnyTags(FastTags<TagGroup.Global>.Parse("radiated"));
|
||||
bool isTainted = entity.HasAnyTags(FastTags<TagGroup.Global>.Parse("tainted"));
|
||||
bool isBear = entity.HasAnyTags(FastTags<TagGroup.Global>.Parse("bear"));
|
||||
|
||||
bool isBoss = entity.HasAnyTags(FastTags<TagGroup.Global>.Parse("boss"));
|
||||
bool hasMindControl1 = entity.Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier1");
|
||||
bool hasMindControl2 = entity.Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier2");
|
||||
bool hasMindControl3 = entity.Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier3");
|
||||
bool hasBossBuff = entity.Buffs.HasBuff("FuriousRamsayBossBuff");
|
||||
|
||||
bool canExecute = (!isBoss &&
|
||||
!hasMindControl1 &&
|
||||
!hasMindControl2 &&
|
||||
!hasMindControl3 &&
|
||||
!isTainted &&
|
||||
!hasBossBuff
|
||||
);
|
||||
|
||||
string buff = "FuriousRamsayRangedMindControlBuffTier3";
|
||||
|
||||
if (progressionLevel < 4)
|
||||
{
|
||||
canExecute = canExecute &&
|
||||
(!isFeral &&
|
||||
!isRadiated &&
|
||||
!isBear
|
||||
);
|
||||
buff = "FuriousRamsayRangedMindControlBuffTier1";
|
||||
}
|
||||
else if (progressionLevel >= 4 && progressionLevel < 7)
|
||||
{
|
||||
canExecute = canExecute &&
|
||||
(!isRadiated &&
|
||||
!isBear
|
||||
);
|
||||
buff = "FuriousRamsayRangedMindControlBuffTier2";
|
||||
}
|
||||
|
||||
if (canExecute)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute 7");
|
||||
entity.Buffs.AddBuff("FuriousRamsayMindControlBonus" + progressionLevel);
|
||||
entity.Buffs.AddBuff(buff);
|
||||
entity.Buffs.AddBuff("FuriousRamsayMindControlParticle");
|
||||
canPlaySound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strSound.Trim().Length > 0 && canPlaySound)
|
||||
{
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute PLAY SOUND");
|
||||
Manager.BroadcastPlay(strSound);
|
||||
}
|
||||
///Log.Out("MinEventActionAoEEffectRebirth-Execute END");
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "effect")
|
||||
{
|
||||
strEffect = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "minMax")
|
||||
{
|
||||
minMax = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "sound")
|
||||
{
|
||||
strSound = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
991
Scripts/MinEvents/MinEventActionChangeClassRebirth.cs
Normal file
991
Scripts/MinEvents/MinEventActionChangeClassRebirth.cs
Normal file
@@ -0,0 +1,991 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionChangeClassRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private int classID = 1;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute IS CLIENT");
|
||||
|
||||
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute NO Player");
|
||||
return;
|
||||
}
|
||||
|
||||
string className = RebirthUtilities.GetClassNameFromID(classID);
|
||||
|
||||
player.Buffs.SetCustomVar("$FR_SelectedClass", 0f);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute className: " + className);
|
||||
|
||||
float currentClassID = player.Buffs.GetCustomVar("$ActiveClass_FR");
|
||||
string optionJumpstart = RebirthVariables.customJumpstart;
|
||||
|
||||
player.Buffs.SetCustomVar("$ActiveClass_FR", classID);
|
||||
RebirthVariables.localConstants["$varFuriousRamsayClassPercUnit"] = RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
||||
RebirthVariables.RefreshVariables(player);
|
||||
|
||||
if (classID == 1) //HUNTER
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("craftingRifles");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "LongRangeRifles";
|
||||
int PerkLevel = 3;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute key: " + key);
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute categoryValue: " + categoryValue);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipeRifle");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "PipeRifle";
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute key: " + key);
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute categoryValue: " + categoryValue);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingBows");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Bows";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute key: " + key);
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute categoryValue: " + categoryValue);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingSpears");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Spears";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute key: " + key);
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute categoryValue: " + categoryValue);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnSpearT1IronSpear"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnSpearT1IronSpear"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunBowT1WoodenBow"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunBowT1WoodenBow"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammoArrowIron"), player, 50, "");
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunRifleT1HuntingRifle"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunRifleT1HuntingRifle"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo762mmBulletBall"), player, 100, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("LongRangeRifles", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModHunter"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 2) // THUG
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("craftingShotguns");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Shotguns";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipeShotgun");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipeShotgun";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingClubs");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Clubs";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnClubT1BaseballBat"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnClubT1BaseballBat"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunShotgunT1DoubleBarrel"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunShotgunT1DoubleBarrel"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammoShotgunShell"), player, 75, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("Shotguns", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModThug"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 3) // BUTCHER
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingAssaultRifles");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "AssaultRifles";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipeMachinegun");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipeMachinegun";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingSwords");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Swords";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnBladeT3Machete"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnBladeT3Machete"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunMGT1AK47"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunMGT1AK47"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo762mmBulletBall"), player, 100, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("AssaultRifles", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModButcher"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 4) // SOLDIER
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("craftingMachineGuns");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "MachineGuns";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipeMachinegun");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipeMachinegun";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingAxes");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Axes";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeToolAxeT1IronFireaxe"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeToolAxeT1IronFireaxe"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunMGT3M60"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunMGT3M60"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo762mmBulletBall"), player, 100, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("MachineGuns", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModSoldier"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 5) // TECHNOGEEK
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingRevolvers");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Revolvers";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipePistol");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipePistol";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingBatons");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Batons";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingDeployableTurrets");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "DeployableTurrets";
|
||||
int PerkLevel = 3;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayPerkDeployableTurrets");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
progressionValue.Level = 0;
|
||||
}
|
||||
}
|
||||
else if (progressionValue.Level == 50)
|
||||
{
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayPerkDeployableTurrets");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
progressionValue.Level = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnSpearT1meleeWpnBatonT0PipeBatonIronSpear"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnBatonT0PipeBaton"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunHandgunT2Magnum44"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunHandgunT2Magnum44"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo44MagnumBulletBall"), player, 100, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("Revolvers", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModTechnogeek"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 6) // MADMAN
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingSubmachineGuns");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "SubmachineGuns";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipeMachinegun");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipeMachinegun";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingKnuckles");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Knuckles";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnKnucklesT1IronKnuckles"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnKnucklesT1IronKnuckles"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunHandgunT3SMG5"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunHandgunT3SMG5"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo9mmBulletBall"), player, 150, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("SubmachineGuns", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModMadman"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 7) // BUILDER
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("craftingHandguns");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Pistols";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipePistol");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipePistol";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingSledgehammers");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Hammers";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnSledgeT1IronSledgehammer"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnSledgeT1IronSledgehammer"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunHandgunT1Pistol"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunHandgunT1Pistol"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo9mmBulletBall"), player, 150, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("Pistols", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModBuilder"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 8) // CHEF
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingHeavyHandguns");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "HeavyHandguns";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipePistol");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipePistol";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingBlades");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Knives";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnBladeT1HuntingKnife"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnBladeT1HuntingKnife"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunHandgunT3DesertVulture"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunHandgunT3DesertVulture"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo44MagnumBulletBall"), player, 100, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("HeavyHandguns", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayAuraModChef"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 9) // WITCH DOCTOR
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingTacticalRifles");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "TacticalRifles";
|
||||
int PerkLevel = 2;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingPipeMachinegun");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
string key = "PipeMachinegun";
|
||||
|
||||
progressionValue.Level = 50;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingScythes");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Scythes";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("ItemsWeaponsScythe004_FR"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ItemsWeaponsScythe004_FR"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("gunMGT2TacticalAR"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunMGT2TacticalAR"), player, 1, "", 1, true, 2);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo762mmBulletBall"), player, 100, "");
|
||||
|
||||
RebirthUtilities.InitWeapon("TacticalRifles", player);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
//RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsaySpawnNPCHorrorPanther_FR"), player, 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (classID == 10) // BERSERKER
|
||||
{
|
||||
ProgressionValue progressionValue = player.Progression.GetProgressionValue("craftingSpears");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Spears";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingClubs");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Clubs";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingSwords");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Swords";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingAxes");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Axes";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingBatons");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Batons";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingKnuckles");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Knuckles";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingSledgehammers");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Hammers";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("craftingBlades");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Knives";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayCraftingScythes");
|
||||
if (progressionValue != null)
|
||||
{
|
||||
if (progressionValue.Level < 50)
|
||||
{
|
||||
progressionValue.Level = 50;
|
||||
|
||||
string key = "Scythes";
|
||||
int PerkLevel = 1;
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, progressionValue.Level);
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + key + "PercUnit"] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + key + "PercUnit");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + PerkLevel + "PercUnit"] = categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart != "none" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnSpearT1IronSpear"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnSpearT1IronSpear"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnClubT1BaseballBat"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnClubT1BaseballBat"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnBladeT3Machete"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnBladeT3Machete"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeToolAxeT1IronFireaxe"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeToolAxeT1IronFireaxe"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnBatonT0PipeBaton"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnBatonT0PipeBaton"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnKnucklesT1IronKnuckles"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnKnucklesT1IronKnuckles"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnSledgeT1IronSledgehammer"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnSledgeT1IronSledgehammer"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("meleeWpnBladeT1HuntingKnife"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("meleeWpnBladeT1HuntingKnife"), player, 1, "", 1, true, 2);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("ItemsWeaponsScythe004_FR"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ItemsWeaponsScythe004_FR"), player, 1, "", 1, true, 2);
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
//RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsaySpawnNPCRagePanther_FR"), player, 1, "");
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("gunMGT0PipeMachineGun"), player, 1, "", 1, true, 1);
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("ammo762mmBulletBall"), player, 100, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentClassID == 0 && optionJumpstart == "classbookessentials")
|
||||
{
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("armorPrimitiveHelmet"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("armorPrimitiveHelmet"), player, 1, "", 1, true, 1);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("armorPrimitiveOutfit"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("armorPrimitiveOutfit"), player, 1, "", 1, true, 1);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("armorPrimitiveGloves"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("armorPrimitiveGloves"), player, 1, "", 1, true, 1);
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("armorPrimitiveBoots"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("armorPrimitiveBoots"), player, 1, "", 1, true, 1);
|
||||
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("FuriousRamsayHammerPliers"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayHammerPliers"), player, 1, "");
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("FuriousRamsayScrewdriver"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayScrewdriver"), player, 1, "");
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("WorkbenchToolbox001_FR"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("WorkbenchToolbox001_FR"), player, 1, "");
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("toolCookingPot"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("toolCookingPot"), player, 1, "");
|
||||
if (!RebirthUtilities.hasItem(ItemClass.GetItem("vehicleBicyclePlaceable"), player))
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("vehicleBicyclePlaceable"), player, 1, "");
|
||||
}
|
||||
|
||||
if (optionJumpstart == "classbookessentials" || (RebirthVariables.customScenario == "purge" && currentClassID == 0))
|
||||
{
|
||||
RebirthUtilities.addToPlayerInventory(ItemClass.GetItem("FuriousRamsayLootCorpses"), player, 1, "");
|
||||
}
|
||||
|
||||
GameManager.Instance.StartCoroutine(RebirthUtilities.UpdateActiveClasses(player));
|
||||
|
||||
foreach (var localAuras in RebirthVariables.localAuras.Keys)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute localAuras: " + localAuras);
|
||||
|
||||
bool remove = true;
|
||||
bool add = false;
|
||||
|
||||
if (RebirthVariables.localAuras[localAuras].className == className)
|
||||
{
|
||||
remove = false;
|
||||
add = true;
|
||||
}
|
||||
|
||||
foreach (string classMetaKey in RebirthVariables.localClassMeta.Keys)
|
||||
{
|
||||
if (classMetaKey == RebirthVariables.localAuras[localAuras].className)
|
||||
{
|
||||
if (RebirthVariables.localClassMeta[classMetaKey].isActive)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute classMetaKey: " + classMetaKey);
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (RebirthVariables.localAuras[localAuras].className == "")
|
||||
{
|
||||
remove = false;
|
||||
}
|
||||
|
||||
if (remove)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute REMOVE");
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute AURA: " + RebirthVariables.localAuras[localAuras].allyAura);
|
||||
|
||||
bool hasBuff = player.Buffs.HasBuff(RebirthVariables.localAuras[localAuras].allyAura);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute hasBuff: " + hasBuff);
|
||||
|
||||
if (hasBuff)
|
||||
{
|
||||
player.Buffs.RemoveBuff(RebirthVariables.localAuras[localAuras].allyAura);
|
||||
}
|
||||
}
|
||||
|
||||
if (add)
|
||||
{
|
||||
bool hasMod = RebirthUtilities.HasMod(player, "FuriousRamsayAuraMod" + className);
|
||||
|
||||
//Log.Out("MinEventActionChangeClassRebirth-Execute HasMod: " + HasMod);
|
||||
|
||||
if (RebirthUtilities.HasMod(player, "FuriousRamsayAuraMod" + className))
|
||||
{
|
||||
player.Buffs.AddBuff(RebirthVariables.localAuras[localAuras].allyAura);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "classID")
|
||||
{
|
||||
classID = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Scripts/MinEvents/MinEventActionChangeModelLayer.cs
Normal file
103
Scripts/MinEvents/MinEventActionChangeModelLayer.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
public class MinEventActionChangeModelLayer : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute strOption: " + strOption);
|
||||
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 2");
|
||||
if (strOption == "player")
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 3");
|
||||
if (player.Buffs.GetCustomVar("$SetModelLayerPlayer") == 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 4");
|
||||
player.Buffs.SetCustomVar("$SetModelLayerPlayer", 1f);
|
||||
player.SetModelLayer(2, true, null);
|
||||
GameManager.ShowTooltip(player, "SET PLAYER MODEL LAYER TO 2");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 5");
|
||||
player.Buffs.SetCustomVar("$SetModelLayerPlayer", 0f);
|
||||
player.SetModelLayer(24, true, null);
|
||||
GameManager.ShowTooltip(player, "SET PLAYER MODEL LAYER TO 24");
|
||||
}
|
||||
}
|
||||
else if (strOption == "zombies")
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 6");
|
||||
int minMax = 50;
|
||||
List<Entity> entitiesInBounds = player.world.GetEntitiesInBounds(typeof(EntityZombieSDX), BoundsUtils.BoundsForMinMax(player.position.x - minMax, player.position.y - 50, player.position.z - minMax, player.position.x + minMax, player.position.y + 30, player.position.z + minMax), new List<Entity>());
|
||||
|
||||
float getValue = player.Buffs.GetCustomVar("$SetModelLayerZombies");
|
||||
|
||||
if (player.Buffs.GetCustomVar("$SetModelLayerZombies") == 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 7");
|
||||
player.Buffs.SetCustomVar("$SetModelLayerZombies", 1f);
|
||||
GameManager.ShowTooltip(player, "SET SURROUNDING ZOMBIE MODEL LAYERS TO 2");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 8");
|
||||
player.Buffs.SetCustomVar("$SetModelLayerZombies", 0f);
|
||||
GameManager.ShowTooltip(player, "SET SURROUNDING ZOMBIE MODEL LAYERS TO 0");
|
||||
}
|
||||
|
||||
foreach (EntityZombieSDX entity in entitiesInBounds)
|
||||
{
|
||||
if (getValue == 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 9");
|
||||
entity.SetModelLayer(2, true, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-Execute 10");
|
||||
entity.SetModelLayer(0, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeModelLayer-ParseXmlAttribute START");
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "option")
|
||||
{
|
||||
strOption = _attribute.Value;
|
||||
//Log.Out("MinEventActionChangeModelLayer-ParseXmlAttribute strOption: " + strOption);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private string strOption = "";
|
||||
}
|
||||
36
Scripts/MinEvents/MinEventActionChangeSizeRebirth.cs
Normal file
36
Scripts/MinEvents/MinEventActionChangeSizeRebirth.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionChangeSizeRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private float flSize = (float)1.4;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
for (var i = 0; i < targets.Count; i++)
|
||||
{
|
||||
var entity = targets[i];
|
||||
if (entity != null)
|
||||
{
|
||||
EntityClass entityClass = EntityClass.GetEntityClass(entity.entityClass);
|
||||
entity.SetScale(entityClass.SizeScale * flSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
var name = _attribute.Name;
|
||||
if (name != null)
|
||||
if (name == "value")
|
||||
{
|
||||
flSize = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
88
Scripts/MinEvents/MinEventActionChangeWeatherRebirth.cs
Normal file
88
Scripts/MinEvents/MinEventActionChangeWeatherRebirth.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionChangeWeatherRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
string fogColor = "";
|
||||
float windForce = 0f;
|
||||
float rain = -1f;
|
||||
float clouds = -1f;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string[] fogColors = fogColor.Split(',', (char)StringSplitOptions.None);
|
||||
|
||||
if (fogColor.Trim().Length > 0)
|
||||
{
|
||||
if (fogColor == "clear")
|
||||
{
|
||||
SkyManager.SetFogDebugColor(Color.grey);
|
||||
}
|
||||
else
|
||||
{
|
||||
SkyManager.SetFogDebugColor(new Color(float.Parse(fogColors[0]), float.Parse(fogColors[1]), float.Parse(fogColors[2])));
|
||||
}
|
||||
}
|
||||
|
||||
if (windForce > 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeWeatherRebirth-Execute windForce: " + windForce);
|
||||
WeatherManager.forceWind = Mathf.Clamp(windForce, -1f, 200f);
|
||||
//Log.Out("MinEventActionChangeWeatherRebirth-Execute WeatherManager.forceWind: " + WeatherManager.forceWind);
|
||||
}
|
||||
|
||||
if (rain > -1f)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeWeatherRebirth-Execute rain: " + rain);
|
||||
WeatherManager.forceRain = Mathf.Clamp(rain, -1f, 1f);
|
||||
//Log.Out("MinEventActionChangeWeatherRebirth-Execute WeatherManager.forceRain: " + WeatherManager.forceRain);
|
||||
}
|
||||
|
||||
if (clouds > -1f)
|
||||
{
|
||||
//Log.Out("MinEventActionChangeWeatherRebirth-Execute clouds: " + clouds);
|
||||
WeatherManager.forceClouds = Mathf.Clamp(clouds, -1f, 1f);
|
||||
//Log.Out("MinEventActionChangeWeatherRebirth-Execute WeatherManager.forceClouds: " + WeatherManager.forceClouds);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "fogColor")
|
||||
{
|
||||
fogColor = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "windForce")
|
||||
{
|
||||
windForce = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "rain")
|
||||
{
|
||||
rain = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "clouds")
|
||||
{
|
||||
clouds = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
134
Scripts/MinEvents/MinEventActionCheckAttackTrigger.cs
Normal file
134
Scripts/MinEvents/MinEventActionCheckAttackTrigger.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
#nullable disable
|
||||
[Preserve]
|
||||
public class MinEventActionCheckAttackTrigger : MinEventActionBuffModifierBase
|
||||
{
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public float duration;
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public bool durationAltered;
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public bool cvarRef;
|
||||
[PublicizedFrom(EAccessModifier.Private)]
|
||||
public string refCvarName = string.Empty;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
bool _netSync = !_params.Self.isEntityRemote | _params.IsLocal;
|
||||
int _instigatorId = -1;
|
||||
if (_params.Buff != null)
|
||||
_instigatorId = _params.Buff.InstigatorId;
|
||||
if (_instigatorId == -1)
|
||||
_instigatorId = _params.Self.entityId;
|
||||
for (int index1 = 0; index1 < this.targets.Count; ++index1)
|
||||
{
|
||||
float previousAttackIndex = _params.Self.Buffs.GetCustomVar("$attackIndex_FR");
|
||||
float currentAttackIndex = 0f;
|
||||
float numSecondary = _params.Self.Buffs.GetCustomVar("$numSecondary_FR");
|
||||
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute previousAttackIndex: " + previousAttackIndex);
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute currentAttackIndex: " + currentAttackIndex);
|
||||
|
||||
if (_params.Self.inventory.holdingItemItemValue.ItemClass.Actions[0] != null && _params.Self.inventory.holdingItemItemValue.ItemClass.Actions[0].IsActionRunning(_params.Self.inventory.GetItemActionDataInSlot(_params.Self.inventory.holdingItemIdx, 0)))
|
||||
{
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute PRIMARY");
|
||||
_params.Self.Buffs.SetCustomVar("$attackIndex_FR", 1f);
|
||||
_params.Self.Buffs.SetCustomVar("$numSecondary_FR", 0f);
|
||||
currentAttackIndex = 1f;
|
||||
}
|
||||
else if (_params.Self.inventory.holdingItemItemValue.ItemClass.Actions[1] != null && _params.Self.inventory.holdingItemItemValue.ItemClass.Actions[1].IsActionRunning(_params.Self.inventory.GetItemActionDataInSlot(_params.Self.inventory.holdingItemIdx, 1)))
|
||||
{
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute SECONDARY");
|
||||
_params.Self.Buffs.SetCustomVar("$attackIndex_FR", 2f);
|
||||
numSecondary++;
|
||||
_params.Self.Buffs.SetCustomVar("$numSecondary_FR", numSecondary);
|
||||
currentAttackIndex = 2f;
|
||||
}
|
||||
|
||||
bool canProceed = false;
|
||||
|
||||
if ((previousAttackIndex == 1 && currentAttackIndex == 2) || numSecondary >= 4)
|
||||
{
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute CAN PROCEED");
|
||||
canProceed = true;
|
||||
}
|
||||
|
||||
#region Rebirth
|
||||
if (!canProceed || !RebirthUtilities.CanAttackExecute(this.targets[index1], 1.25f))
|
||||
{
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute SKIP");
|
||||
continue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//Log.Out("RebirthUtilities-CanAttackExecute PROCEEDING target: " + this.targets[index1].EntityClass.entityClassName);
|
||||
|
||||
string[] strArray = this.buffNames;
|
||||
if (this.buffOneOnly && this.buffWeights != null)
|
||||
{
|
||||
float randomFloat = this.targets[index1].rand.RandomFloat;
|
||||
float num = 0.0f;
|
||||
for (int index2 = 0; index2 < this.buffWeights.Length; ++index2)
|
||||
{
|
||||
num += this.buffWeights[index2];
|
||||
if ((double) num >= (double) randomFloat)
|
||||
{
|
||||
strArray = new string[1]
|
||||
{
|
||||
this.buffNames[index2]
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.buffWeights != null)
|
||||
{
|
||||
List<string> stringList = new List<string>();
|
||||
for (int index3 = 0; index3 < this.buffWeights.Length; ++index3)
|
||||
{
|
||||
float randomFloat = this.targets[index1].rand.RandomFloat;
|
||||
if ((double) this.buffWeights[index3] >= (double) randomFloat)
|
||||
stringList.Add(this.buffNames[index3]);
|
||||
}
|
||||
strArray = stringList.ToArray();
|
||||
}
|
||||
for (int index4 = 0; index4 < strArray.Length; ++index4)
|
||||
{
|
||||
string _name = strArray[index4];
|
||||
BuffClass buff = BuffManager.GetBuff(_name);
|
||||
if (buff != null)
|
||||
{
|
||||
if (this.durationAltered && this.cvarRef)
|
||||
this.duration = !this.targets[index1].Buffs.HasCustomVar(this.refCvarName) ? buff.InitialDurationMax : this.targets[index1].Buffs.GetCustomVar(this.refCvarName);
|
||||
if (this.durationAltered)
|
||||
{
|
||||
int num1 = (int) this.targets[index1].Buffs.AddBuff(_name, _instigatorId, _netSync, _buffDuration: this.duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = (int) this.targets[index1].Buffs.AddBuff(_name, _instigatorId, _netSync);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool xmlAttribute = base.ParseXmlAttribute(_attribute);
|
||||
if (xmlAttribute || !(_attribute.Name.LocalName == "duration"))
|
||||
return xmlAttribute;
|
||||
if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.cvarRef = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
this.duration = StringParsers.ParseFloat(_attribute.Value);
|
||||
this.durationAltered = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
39
Scripts/MinEvents/MinEventActionClearMapRebirth.cs
Normal file
39
Scripts/MinEvents/MinEventActionClearMapRebirth.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
public class MinEventActionClearMapRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
private const BindingFlags _NonPublicFlags = BindingFlags.NonPublic | BindingFlags.Instance;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
ClearMap(this.targets[0] as EntityPlayer);
|
||||
}
|
||||
|
||||
public static void ClearMap(EntityPlayer player)
|
||||
{
|
||||
if (player != null
|
||||
&& player.ChunkObserver != null
|
||||
&& player.ChunkObserver.mapDatabase != null)
|
||||
ClearMapChunkDatabase(player.ChunkObserver.mapDatabase as MapChunkDatabase);
|
||||
}
|
||||
|
||||
private static void ClearMapChunkDatabase(MapChunkDatabase mapDatabase)
|
||||
{
|
||||
mapDatabase.catalog.Clear();
|
||||
mapDatabase.database.Clear();
|
||||
mapDatabase.dirty.Clear();
|
||||
/*
|
||||
var type = typeof(MapChunkDatabase).BaseType;
|
||||
|
||||
var catalog = (DictionaryKeyList<int, int>)type.GetField("catalog", _NonPublicFlags).GetValue(mapDatabase);
|
||||
if (catalog != null)
|
||||
catalog.Clear();
|
||||
|
||||
var database = (DictionarySave<int, ushort[]>)type.GetField("database", _NonPublicFlags).GetValue(mapDatabase);
|
||||
if (database != null)
|
||||
database.Clear();
|
||||
|
||||
var dirty = (Dictionary<int, bool>)type.GetField("dirty", _NonPublicFlags).GetValue(mapDatabase);
|
||||
if (dirty != null)
|
||||
dirty.Clear();
|
||||
*/
|
||||
}
|
||||
}
|
||||
50
Scripts/MinEvents/MinEventActionDespawnEntity.cs
Normal file
50
Scripts/MinEvents/MinEventActionDespawnEntity.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
//using static RebirthManager;
|
||||
|
||||
public class MinEventActionDespawnEntity : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute START");
|
||||
EntityAlive entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity is EntityTurret)
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 2");
|
||||
EntityTurret entityTurret = (EntityTurret)entity;
|
||||
|
||||
entity.Buffs.SetCustomVar("$FR_Turret_Temp", 2f);
|
||||
entity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(entity.entityId, EnumRemoveEntityReason.Killed);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 3");
|
||||
RebirthUtilities.DespawnEntity(entity);
|
||||
|
||||
/*entity.bIsChunkObserver = false;
|
||||
|
||||
if (entity is EntityNPCRebirth)
|
||||
{
|
||||
EntityNPCRebirth npc = (EntityNPCRebirth)entity;
|
||||
|
||||
if (npc != null && npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
npc.LeaderUtils.Owner.Companions.Remove(npc);
|
||||
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute REMOVE HIRE/OWNED ENTITY, hire: " + npc.entityId);
|
||||
RebirthManager.RemoveHire(npc.entityId, true);
|
||||
}
|
||||
}
|
||||
|
||||
entity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(entity.entityId, EnumRemoveEntityReason.Despawned);*/
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 4");
|
||||
}
|
||||
}
|
||||
40
Scripts/MinEvents/MinEventActionDismemberWindow.cs
Normal file
40
Scripts/MinEvents/MinEventActionDismemberWindow.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionDismemberWindow : MinEventActionRemoveBuff
|
||||
{
|
||||
private string action = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
uiforPlayer.windowManager.Open("", true, false, true);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "action")
|
||||
{
|
||||
action = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Scripts/MinEvents/MinEventActionFactionChangeSDX.cs
Normal file
54
Scripts/MinEvents/MinEventActionFactionChangeSDX.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionFactionChangeSDX : MinEventActionRemoveBuff
|
||||
{
|
||||
private string Faction = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionFactionChangeSDX-Execute START");
|
||||
|
||||
for (var i = 0; i < targets.Count; i++)
|
||||
{
|
||||
var entity = targets[i];
|
||||
|
||||
//Log.Out("MinEventActionFactionChangeSDX-Execute entityClassName:" + entity.EntityClass.entityClassName);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
//Log.Out("MinEventActionFactionChangeSDX-Execute 1");
|
||||
// If the faction name is original, try to find the original faction of the entity, stored via cvar.
|
||||
if (Faction == "original")
|
||||
{
|
||||
//Log.Out("MinEventActionFactionChangeSDX-Execute 2");
|
||||
entity.Buffs.SetCustomVar("$faction", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionFactionChangeSDX-Execute 3");
|
||||
entity.Buffs.SetCustomVar("$faction", RebirthUtilities.GetFactionID(Faction));
|
||||
}
|
||||
|
||||
entity.attackTarget = (EntityAlive) null;
|
||||
entity.SetRevengeTarget((EntityAlive) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
var name = _attribute.Name;
|
||||
if (name != null)
|
||||
if (name == "value")
|
||||
{
|
||||
Faction = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
14
Scripts/MinEvents/MinEventActionGetServerVariablesRebirth.cs
Normal file
14
Scripts/MinEvents/MinEventActionGetServerVariablesRebirth.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
public class MinEventActionGetServerVariablesRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionGetServerVariablesRebirth-Execute START");
|
||||
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer(NetPackageManager.GetPackage<NetPackageGetServerVariablesRebirth>().Setup(_params.Self.entityId, 0), false);
|
||||
}
|
||||
}
|
||||
70
Scripts/MinEvents/MinEventActionGiveQuestRebirth.cs
Normal file
70
Scripts/MinEvents/MinEventActionGiveQuestRebirth.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionGiveQuestRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string ID = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionGiveQuestRebirth-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionGiveQuestRebirth-Execute IS CLIENT");
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
Quest newQuest = QuestClass.CreateQuest(ID);
|
||||
if (newQuest == null)
|
||||
return;
|
||||
|
||||
if (newQuest != null)
|
||||
{
|
||||
QuestClass questClass = newQuest.QuestClass;
|
||||
if (questClass != null)
|
||||
{
|
||||
for (int i = 0; i < player.QuestJournal.quests.Count; i++)
|
||||
{
|
||||
//Log.Out("QUEST ID: " + player.QuestJournal.quests[i].ID);
|
||||
//Log.Out("QUEST STATE: " + player.QuestJournal.quests[i].CurrentState);
|
||||
if (player.QuestJournal.quests[i].CurrentState == Quest.QuestState.InProgress)
|
||||
{
|
||||
if (player.QuestJournal.quests[i].ID.ToLower() == ID.ToLower())
|
||||
{
|
||||
GameManager.ShowTooltip((EntityPlayerLocal)player, Localization.Get("questunavailable"));
|
||||
//Log.Out("YOU ALREADY HAVE THIS QUEST");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
player.QuestJournal.AddQuest(newQuest);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "ID")
|
||||
{
|
||||
ID = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Scripts/MinEvents/MinEventActionIncreasePerkRebirth.cs
Normal file
62
Scripts/MinEvents/MinEventActionIncreasePerkRebirth.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionIncreasePerkRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string perkName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionIncreasePerkRebirth-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionIncreasePerkRebirth-Execute IS CLIENT");
|
||||
|
||||
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
//Log.Out("MinEventActionIncreasePerkRebirth-Execute NO Player");
|
||||
return;
|
||||
}
|
||||
|
||||
ProgressionValue perkProgressionValue = player.Progression.GetProgressionValue(perkName);
|
||||
|
||||
if (perkProgressionValue == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int maxLevel = perkProgressionValue.ProgressionClass.MaxLevel;
|
||||
|
||||
if (perkProgressionValue.Level < maxLevel)
|
||||
{
|
||||
perkProgressionValue.Level = perkProgressionValue.Level + 1;
|
||||
player.Progression.bProgressionStatsChanged = true;
|
||||
player.bPlayerStatsChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "perkName")
|
||||
{
|
||||
perkName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
161
Scripts/MinEvents/MinEventActionInitiateClassesRebirth.cs
Normal file
161
Scripts/MinEvents/MinEventActionInitiateClassesRebirth.cs
Normal file
@@ -0,0 +1,161 @@
|
||||
public class MinEventActionInitiateClassesRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private int numItems = 1;
|
||||
private int numLocation = 0;
|
||||
private int numQuality = 0;
|
||||
private string itemName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute IS CLIENT");
|
||||
|
||||
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute NO Player");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute SCENARIO: " + RebirthVariables.customScenario);
|
||||
|
||||
if (RebirthUtilities.ScenarioSkip())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(RebirthVariables.customBiomeSpawn == "random") && RebirthVariables.customScenario == "none")
|
||||
{
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute NOT RANDOM AND NO SCENARIO");
|
||||
|
||||
/*Log.Out("MinEventActionInitiateClassesRebirth-Execute NOT RANDOM");
|
||||
Quest starterQuest = QuestClass.CreateQuest("quest_BasicSurvival1");
|
||||
|
||||
if (starterQuest != null)
|
||||
{
|
||||
player.QuestJournal.AddQuest(starterQuest);
|
||||
|
||||
starterQuest.Tracked = true;
|
||||
player.QuestJournal.TrackedQuest = starterQuest;
|
||||
player.QuestJournal.RefreshTracked();
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
//player.Buffs.AddBuff("spawn_GameStart");
|
||||
//player.Buffs.AddBuff("spawn_GameStart_companion");
|
||||
int entityID = player.entityId;
|
||||
int entityPlayerID = player.entityId;
|
||||
string strEntity = "";
|
||||
string strDistance = "";
|
||||
string strHeight = "";
|
||||
string strSpawner = "static";
|
||||
string strDirection = "";
|
||||
string strSound = "";
|
||||
float numStartScale = 1;
|
||||
int minion = -1;
|
||||
int numEntities = 1;
|
||||
bool attackPlayer = true;
|
||||
int checkMaxEntities = 0;
|
||||
int minMax = 40;
|
||||
int maxEntities = 20;
|
||||
int repeat = 1;
|
||||
int allNames = 1;
|
||||
bool atPlayerLevel = false;
|
||||
bool randomRotation = true;
|
||||
int numRotation = -1;
|
||||
int isBoss = -1;
|
||||
int handParticle = -1;
|
||||
string lootListName = "";
|
||||
string lootDropClass = "";
|
||||
int lootDropChance = 1;
|
||||
string navIcon = "";
|
||||
string buffList = "";
|
||||
|
||||
strDistance = "1";
|
||||
minion = 1;
|
||||
attackPlayer = false;
|
||||
|
||||
string restrictiveHire = RebirthVariables.customRestrictHires;
|
||||
|
||||
string scenario = RebirthVariables.customScenario;
|
||||
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute RANDOM OR SCENARIO: " + scenario);
|
||||
|
||||
if (scenario == "none" && !GameUtils.IsPlaytesting())
|
||||
{
|
||||
if (restrictiveHire != "nofollowers")
|
||||
{
|
||||
allNames = 0;
|
||||
strEntity = "FuriousRamsayNPCShepherd001_FR,FuriousRamsayNPCPitbull001_FR,FuriousRamsayNPCLabrador001_FR,FuriousRamsayNPCHusky001_FR,FuriousRamsayNPCGoldenRetriever001_FR,FuriousRamsayNPCDoberman001_FR,FuriousRamsayNPCDalmatian001_FR,FuriousRamsayNPCBullTerrier001_FR";
|
||||
//strSound = "FuriousRamsayDogSense";
|
||||
strSound = "";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
}
|
||||
|
||||
attackPlayer = true;
|
||||
strSound = "";
|
||||
strDistance = "1";
|
||||
minion = 0;
|
||||
allNames = 1;
|
||||
|
||||
strDistance = "30";
|
||||
strEntity = "zombieBoe";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
|
||||
strEntity = "zombieBoe";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieJoe";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieArlene";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieDarlene";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieMarlene";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieYo";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieSteve";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strEntity = "zombieBusinessMan";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
|
||||
strDistance = "25";
|
||||
strEntity = "FuriousRamsayWindTornado";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strDistance = "30";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strDistance = "35";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
strDistance = "40";
|
||||
RebirthUtilities.SpawnEntity(entityID, strEntity, numEntities, "", "", strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, randomRotation, atPlayerLevel, attackPlayer, entityPlayerID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList);
|
||||
}
|
||||
}
|
||||
|
||||
ProgressionValue progressionValue;
|
||||
|
||||
foreach (var classKey in RebirthVariables.localClasses.Keys)
|
||||
{
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + classKey + "PercUnit"] = 1f;
|
||||
player.Buffs.SetCustomVar("$varFuriousRamsay" + classKey + "PercUnit", 1f);
|
||||
|
||||
//Log.Out("MinEventActionInitiateClassesRebirth-Execute $varFuriousRamsay" + classKey + "PercUnit: " + RebirthVariables.localVariables["$varFuriousRamsay" + classKey + "PercUnit"]);
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("furiousramsayatt" + classKey.ToLower());
|
||||
progressionValue.Level = 1;
|
||||
|
||||
RebirthUtilities.ProcessAttribute(player, "$varFuriousRamsay" + classKey + "PercUnit", true);
|
||||
}
|
||||
|
||||
progressionValue = player.Progression.GetProgressionValue("FuriousRamsayPerkChoiceIsMine");
|
||||
progressionValue.Level = 1;
|
||||
progressionValue = player.Progression.GetProgressionValue("furiousramsayattachievements");
|
||||
progressionValue.Level = 1;
|
||||
}
|
||||
}
|
||||
64
Scripts/MinEvents/MinEventActionInjectDNA.cs
Normal file
64
Scripts/MinEvents/MinEventActionInjectDNA.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class MinEventActionInjectDNA : MinEventActionTargetedBase
|
||||
{
|
||||
public string cvarName { get; private set; }
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionInjectDNA-Execute START");
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
//Log.Out("MinEventActionInjectDNA-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
string cvar = "$varFuriousRamsay" + this.genetic + "PercUnit";
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute cvar: " + cvar);
|
||||
|
||||
float geneticsMultiplierOption = float.Parse(RebirthVariables.customGeneticsXPMultiplier) / 100;
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute geneticsMultiplierOption: " + geneticsMultiplierOption);
|
||||
|
||||
float increase = RebirthVariables.localConstants["$varFuriousRamsay" + this.genetic + "UnitPercIncrease_Cst"];
|
||||
|
||||
float currentValue = RebirthVariables.localVariables[cvar];
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute currentValue: " + currentValue);
|
||||
|
||||
increase = RebirthUtilities.GetModifiedIncrease(currentValue, increase);
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute increase: " + increase);
|
||||
|
||||
float newValue = currentValue + increase * geneticsMultiplierOption;
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute BEFORE newValue: " + newValue);
|
||||
|
||||
RebirthUtilities.GetMaxGeneticsProgression(ref newValue, this.genetic);
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute AFTER newValue: " + newValue);
|
||||
|
||||
RebirthVariables.localVariables[cvar] = newValue;
|
||||
|
||||
RebirthUtilities.ProcessAttribute(_params.Self, cvar);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "genetic")
|
||||
{
|
||||
this.genetic = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
private string genetic = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using Audio;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionInstantiateParticleEffectRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
RebirthUtilities.InstantiateParticleEffect(particleName, impactPosition, soundName, _params.Self, _params.Position);
|
||||
|
||||
/*Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute START");
|
||||
|
||||
if (particleName == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute particleName: " + particleName);
|
||||
|
||||
bool isPositionAoE = false;
|
||||
|
||||
if (impactPosition != "")
|
||||
{
|
||||
isPositionAoE = true;
|
||||
}
|
||||
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute isPositionAoE: " + isPositionAoE);
|
||||
|
||||
var entityAlive = _params.Self as EntityAlive;
|
||||
if (entityAlive == null && !isPositionAoE)
|
||||
{
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
float lightBrightness = 0;
|
||||
Vector3 position = entityAlive.position;
|
||||
|
||||
if (entityAlive != null && !isPositionAoE)
|
||||
{
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute 2");
|
||||
position = entityAlive.position;
|
||||
}
|
||||
else if (isPositionAoE)
|
||||
{
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute 3");
|
||||
position = _params.Position;
|
||||
}
|
||||
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute position: " + position);
|
||||
|
||||
lightBrightness = entityAlive.world.GetLightBrightness(new Vector3i(position.x, position.y, position.z));
|
||||
|
||||
bool isAvailable = ParticleEffect.IsAvailable(particleName);
|
||||
|
||||
if (!isAvailable)
|
||||
{
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute 4");
|
||||
ParticleEffect.LoadAsset(particleName);
|
||||
}
|
||||
|
||||
ParticleEffect particleEffect = new ParticleEffect(particleName, position, lightBrightness, Color.white, null, null, false);
|
||||
|
||||
particleEffect.ParticleId = ParticleEffect.ToId(particleName);
|
||||
|
||||
if (soundName != "")
|
||||
{
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute soundName: " + soundName);
|
||||
Manager.BroadcastPlayByLocalPlayer(position, soundName);
|
||||
}
|
||||
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute particleName: " + particleName + " / id: " + particleName.GetHashCode());
|
||||
Log.Out("MinEventActionInstantiateParticleEffectRebirth-Execute _params.Self.entityId: " + _params.Self.entityId);
|
||||
entityAlive.world.GetGameManager().SpawnParticleEffectServer(particleEffect, _params.Self.entityId, false, true);*/
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
//Log.Out("MinEventActionInstantiateParticleEffectRebirth-ParseXmlAttribute START");
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "particleName")
|
||||
{
|
||||
particleName = _attribute.Value;
|
||||
//Log.Out("MinEventActionInstantiateParticleEffectRebirth-ParseXmlAttribute particleName: " + particleName);
|
||||
return true;
|
||||
}
|
||||
if (localName == "soundName")
|
||||
{
|
||||
soundName = _attribute.Value;
|
||||
//Log.Out("MinEventActionInstantiateParticleEffectRebirth-ParseXmlAttribute soundName: " + soundName);
|
||||
return true;
|
||||
}
|
||||
if (localName == "impactPosition")
|
||||
{
|
||||
impactPosition = _attribute.Value;
|
||||
//Log.Out("MinEventActionInstantiateParticleEffectRebirth-ParseXmlAttribute soundName: " + soundName);
|
||||
return true;
|
||||
}
|
||||
if (localName == "buffName")
|
||||
{
|
||||
buffName = _attribute.Value;
|
||||
//Log.Out("MinEventActionInstantiateParticleEffectRebirth-ParseXmlAttribute soundName: " + soundName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected string particleName = "";
|
||||
protected string soundName = "";
|
||||
protected string impactPosition = "";
|
||||
protected string buffName = "";
|
||||
}
|
||||
13
Scripts/MinEvents/MinEventActionLogStatsRebirth.cs
Normal file
13
Scripts/MinEvents/MinEventActionLogStatsRebirth.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
public class MinEventActionLogStatsRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RebirthUtilities.LogStats(entity);
|
||||
}
|
||||
}
|
||||
38
Scripts/MinEvents/MinEventActionLoseInventoryRebirth.cs
Normal file
38
Scripts/MinEvents/MinEventActionLoseInventoryRebirth.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
public class MinEventActionLoseInventoryRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
var playerInventory = uiforPlayer.xui.PlayerInventory;
|
||||
|
||||
//Log.Out("MinEventActionLoseInventoryRebirth-Execute Clearing Backpack");
|
||||
playerInventory.Backpack.Clear();
|
||||
//Log.Out("MinEventActionLoseInventoryRebirth-Execute Clearing Toolbelt");
|
||||
playerInventory.Toolbelt.Clear();
|
||||
|
||||
int numIndex;
|
||||
|
||||
float flClass = player.Buffs.GetCustomVar("$ActiveClass_FR");
|
||||
|
||||
foreach (var classKey in RebirthVariables.localClasses.Keys)
|
||||
{
|
||||
if (RebirthVariables.localClasses[classKey] == flClass)
|
||||
{
|
||||
player.Buffs.AddBuff("FuriousRamsayGive" + classKey + "Weapon");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
string ID = "PermadeathRebirth";
|
||||
|
||||
//Log.Out("MinEventActionLoseInventoryRebirth-Execute OPENING WINDOW: " + ID);
|
||||
uiforPlayer.windowManager.Open(ID, true, false, true);
|
||||
}
|
||||
}
|
||||
441
Scripts/MinEvents/MinEventActionMadmanExplosion.cs
Normal file
441
Scripts/MinEvents/MinEventActionMadmanExplosion.cs
Normal file
@@ -0,0 +1,441 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionMadmanExplosion : MinEventActionTargetedBase
|
||||
{
|
||||
public static FastTags<TagGroup.Global> explosionTag = FastTags<TagGroup.Global>.Parse("explosion");
|
||||
public static Dictionary<int, DamageRecord> hitEntities = new Dictionary<int, DamageRecord>();
|
||||
|
||||
float _initialForceStrength = 40f;
|
||||
Vector2Int _XZMultiplier = new Vector2Int(4, 10); // side to side range - x and z coord
|
||||
Vector2Int _heightMultiplier = new Vector2Int(6, 10); // y coord
|
||||
|
||||
int blastPower = 0;
|
||||
int blockDamage = 0;
|
||||
int blockRadius = 0;
|
||||
int entityDamage = 0;
|
||||
int entityRadius = 0;
|
||||
int ParticleIndex = 13;
|
||||
int explosionType = 0;
|
||||
int ignoreHeatmap = 0;
|
||||
string blockTags = "";
|
||||
string particleName = "";
|
||||
string impactPosition = "";
|
||||
string soundName = "";
|
||||
ExplosionData explosionData;
|
||||
Vector3 TargetPos = Vector3.zero;
|
||||
|
||||
public int SourceEntityID;
|
||||
public EntityAlive SourceEntity;
|
||||
public bool IsNPC = false;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var entityAlive = _params.Self as EntityAlive;
|
||||
//Log.Out($"MinEventActionMadmanExplosion::Execute - this Entity: {entityAlive}, other: {_params.Other}, others: {_params.Others}");
|
||||
|
||||
if (entityAlive == null) return;
|
||||
|
||||
EntityNPCRebirth npc = entityAlive as EntityNPCRebirth;
|
||||
|
||||
if (npc != null)
|
||||
{
|
||||
IsNPC = true;
|
||||
//Log.Out($"Npc initiated explosion: {npc}");
|
||||
}
|
||||
|
||||
SourceEntity = entityAlive;
|
||||
SourceEntityID = entityAlive.entityId;
|
||||
int entityId = EntityClass.FromString("FuriousRamsayNoEarthDamage");
|
||||
|
||||
DynamicProperties properties = EntityClass.list[entityId].Properties;
|
||||
|
||||
ExplosionData tmpExplosionData = new ExplosionData(properties);
|
||||
|
||||
bool ignore = false;
|
||||
|
||||
if (ignoreHeatmap == 1)
|
||||
{
|
||||
ignore = true;
|
||||
}
|
||||
|
||||
explosionData = new ExplosionData
|
||||
{
|
||||
BlastPower = blastPower,
|
||||
BlockDamage = (float)blockDamage,
|
||||
BlockRadius = (float)blockRadius,
|
||||
BlockTags = blockTags,
|
||||
EntityDamage = (float)entityDamage,
|
||||
EntityRadius = entityRadius,
|
||||
ParticleIndex = ParticleIndex,
|
||||
damageMultiplier = tmpExplosionData.damageMultiplier,
|
||||
IgnoreHeatMap = ignore
|
||||
|
||||
};
|
||||
|
||||
ItemValue itemExplosion = null;
|
||||
|
||||
if (explosionType == 1)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("thrownGrenadeContact", false);
|
||||
}
|
||||
else if (explosionType == 9997)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("otherExplosion2", false);
|
||||
}
|
||||
else if (explosionType == 9998)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("otherExplosion", false);
|
||||
}
|
||||
else if (explosionType == 9999)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("auraExplosion", false);
|
||||
}
|
||||
else if (explosionType == 9996)
|
||||
{
|
||||
itemExplosion = ItemClass.GetItem("auraExplosion2", false);
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionMadmanExplosion-Execute instigatorId: " + _params.Buff.instigatorId);
|
||||
//Log.Out("MinEventActionMadmanExplosion-Execute instigatorId: " + _params.Buff.instigatorPos);
|
||||
|
||||
if (_params.Buff.instigatorId != -1)
|
||||
{
|
||||
//Log.Out("MinEventActionMadmanExplosion-Execute 1");
|
||||
TargetPos = _params.Position;
|
||||
}
|
||||
else if (_params.Other != null)
|
||||
{
|
||||
//Log.Out("MinEventActionMadmanExplosion-Execute 2");
|
||||
TargetPos = _params.Other.position;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionMadmanExplosion-Execute 2");
|
||||
TargetPos = _params.Position;
|
||||
}
|
||||
|
||||
if (blastPower == 201)
|
||||
{
|
||||
RebirthUtilities.InstantiateParticleEffect(particleName, impactPosition, soundName, _params.Self, TargetPos);
|
||||
//Log.Out($"InstantiateParticleEffect: {particleName}, impactPosition: {impactPosition}, TargetPos: {TargetPos}");
|
||||
}
|
||||
|
||||
Explode(itemExplosion);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name.LocalName;
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "blastPower")
|
||||
{
|
||||
blastPower = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "blockDamage")
|
||||
{
|
||||
blockDamage = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "blockRadius")
|
||||
{
|
||||
blockRadius = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "entityDamage")
|
||||
{
|
||||
entityDamage = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "entityRadius")
|
||||
{
|
||||
entityRadius = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "ParticleIndex")
|
||||
{
|
||||
ParticleIndex = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "explosionType")
|
||||
{
|
||||
explosionType = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "blockTags")
|
||||
{
|
||||
blockTags = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "ignoreHeatmap")
|
||||
{
|
||||
ignoreHeatmap = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "particleName")
|
||||
{
|
||||
particleName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "impactPosition")
|
||||
{
|
||||
impactPosition = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "soundName")
|
||||
{
|
||||
soundName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode(ItemValue _itemValueExplosionSource)
|
||||
{
|
||||
//Log.Out($"MadmanExplosion::AttackEntities - _entityThatCausedExplosion: {SourceEntityID}, _itemValueExplosionSource: {_itemValueExplosionSource}, damageType: {damageType}");
|
||||
|
||||
FastTags<TagGroup.Global> tags = explosionTag;
|
||||
|
||||
if (_itemValueExplosionSource != null)
|
||||
{
|
||||
ItemClass itemClass = _itemValueExplosionSource.ItemClass;
|
||||
tags |= itemClass.ItemTags;
|
||||
}
|
||||
|
||||
float value = EffectManager.GetValue(PassiveEffects.ExplosionEntityDamage, _itemValueExplosionSource, explosionData.EntityDamage, SourceEntity, null, tags);
|
||||
float value2 = EffectManager.GetValue(PassiveEffects.ExplosionRadius, _itemValueExplosionSource, explosionData.EntityRadius, SourceEntity, null, tags);
|
||||
int layerMask = -295563285;// ~(1 << 2 | 1 << 4 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16 | 1 << 18 | 1 << 19 | 1 << 20 | 1 << 23 | 1 << 24 | 1 << 28); // -18739221;
|
||||
int prevLayer = SourceEntity.GetModelLayer();
|
||||
SourceEntity.SetModelLayer(2, true);
|
||||
Collider[] allColliders = Physics.OverlapSphere(TargetPos - Origin.position, value2, layerMask);// -538480645);
|
||||
//Log.Out($"Found allColliders: {allColliders.Length}, layerMask: {layerMask}");
|
||||
SourceEntity.SetModelLayer(prevLayer, true);
|
||||
bool flag = false;
|
||||
|
||||
foreach (Collider collider in allColliders)
|
||||
{
|
||||
if (collider == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Transform transform = collider.transform;
|
||||
string tag = transform.tag;
|
||||
|
||||
if (!tag.StartsWith("E_BP_"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
flag = true;
|
||||
Transform hitRootTransform = GameUtils.GetHitRootTransform(tag, transform);
|
||||
EntityAlive entityAlive2 = (hitRootTransform ? hitRootTransform.GetComponent<EntityAlive>() : null);
|
||||
|
||||
if (entityAlive2 == null || entityAlive2.entityId == SourceEntityID)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
entityAlive2.ConditionalTriggerSleeperWakeUp();
|
||||
Vector3 vector = transform.position + Origin.position - TargetPos;
|
||||
float magnitude = vector.magnitude;
|
||||
vector.Normalize();
|
||||
|
||||
// check for collision with terrain layer 16
|
||||
if (Voxel.Raycast(GameManager.Instance.World, new Ray(TargetPos, vector), magnitude, 65536, 66, 0f))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
EntityClass entityClass = EntityClass.list[entityAlive2.entityClass];
|
||||
float num = ((!transform.CompareTag("E_BP_LArm") && !transform.CompareTag("E_BP_RArm")) ? ((transform.CompareTag("E_BP_LLeg") || transform.CompareTag("E_BP_RLeg")) ? entityClass.LegsExplosionDamageMultiplier : ((!transform.CompareTag("E_BP_Head")) ? entityClass.ChestExplosionDamageMultiplier : entityClass.HeadExplosionDamageMultiplier)) : entityClass.ArmsExplosionDamageMultiplier);
|
||||
float num2 = value * num;
|
||||
num2 *= 1f - magnitude / value2;
|
||||
num2 = (int)EffectManager.GetValue(PassiveEffects.ExplosionIncomingDamage, null, num2, entityAlive2);
|
||||
|
||||
if (num2 >= 3f)
|
||||
{
|
||||
if (!hitEntities.TryGetValue(entityAlive2.entityId, out var value3))
|
||||
{
|
||||
value3.entity = entityAlive2;
|
||||
}
|
||||
|
||||
EnumBodyPartHit enumBodyPartHit = DamageSource.TagToBodyPart(tag);
|
||||
|
||||
if (num2 > value3.damage)
|
||||
{
|
||||
value3.damage = num2;
|
||||
value3.dir = vector;
|
||||
value3.hitTransform = transform;
|
||||
value3.mainPart = enumBodyPartHit;
|
||||
}
|
||||
|
||||
value3.parts |= enumBodyPartHit;
|
||||
hitEntities[entityAlive2.entityId] = value3;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<int, DamageRecord> hitEntity in hitEntities)
|
||||
{
|
||||
EntityAlive entity = hitEntity.Value.entity;
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bool bIsDead = entity.IsDead();
|
||||
int health = entity.Health;
|
||||
bool bCrit = hitEntity.Value.damage > (float)entity.GetMaxHealth() * 0.1f;
|
||||
EnumBodyPartHit mainPart = hitEntity.Value.mainPart;
|
||||
EnumBodyPartHit parts = hitEntity.Value.parts;
|
||||
parts &= ~mainPart;
|
||||
float num3 = (bIsDead ? 0.85f : 0.6f);
|
||||
|
||||
for (int j = 0; j < 11; j++)
|
||||
{
|
||||
int num4 = 1 << j;
|
||||
|
||||
if (((uint)parts & (uint)num4) != 0 && entity.rand.RandomFloat <= num3)
|
||||
{
|
||||
parts = (EnumBodyPartHit)((int)parts & ~num4);
|
||||
}
|
||||
}
|
||||
|
||||
DamageSourceEntity damageSourceEntity = new DamageSourceEntity(EnumDamageSource.External, EnumDamageTypes.KnockDown, SourceEntityID, hitEntity.Value.dir, hitEntity.Value.hitTransform.name, Vector3.zero, Vector2.zero);
|
||||
damageSourceEntity.bodyParts = mainPart | parts;
|
||||
damageSourceEntity.AttackingItem = _itemValueExplosionSource;
|
||||
damageSourceEntity.DismemberChance = (bCrit ? 0.5f : 0f);
|
||||
|
||||
int dmgDone = entity.DamageEntity(damageSourceEntity, (int)hitEntity.Value.damage, bCrit);
|
||||
|
||||
if (dmgDone > 0)
|
||||
{
|
||||
Vector3 force = GetRandomForce();
|
||||
entity.emodel.DoRagdoll(1f, EnumBodyPartHit.LowerLegs, force, Vector3.zero, entity.isEntityRemote);
|
||||
}
|
||||
|
||||
//Log.Out($"entity: {entity}, hitEntity.Value.damage: {hitEntity.Value.damage}, bCrit: {bCrit}, dmgDone: {dmgDone}, dmg source entity id: {SourceEntityID}, {SourceEntity}");
|
||||
|
||||
if (SourceEntity != null)
|
||||
{
|
||||
MinEventTypes eventType = ((health != entity.Health) ? MinEventTypes.onSelfExplosionDamagedOther : MinEventTypes.onSelfExplosionAttackedOther);
|
||||
SourceEntity.MinEventContext.Self = SourceEntity;
|
||||
SourceEntity.MinEventContext.Other = entity;
|
||||
SourceEntity.MinEventContext.ItemValue = _itemValueExplosionSource;
|
||||
_itemValueExplosionSource?.FireEvent(eventType, SourceEntity.MinEventContext);
|
||||
SourceEntity.FireEvent(eventType, useInventory: false);
|
||||
}
|
||||
|
||||
if (explosionData.BuffActions != null)
|
||||
{
|
||||
for (int k = 0; k < explosionData.BuffActions.Count; k++)
|
||||
{
|
||||
BuffClass buff = BuffManager.GetBuff(explosionData.BuffActions[k]);
|
||||
|
||||
if (buff != null)
|
||||
{
|
||||
float originalValue = 1f;
|
||||
originalValue = EffectManager.GetValue(PassiveEffects.BuffProcChance, null, originalValue, SourceEntity, null, FastTags<TagGroup.Global>.Parse(buff.Name));
|
||||
|
||||
if (entity.rand.RandomFloat <= originalValue)
|
||||
{
|
||||
entity.Buffs.AddBuff(explosionData.BuffActions[k], SourceEntityID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bIsDead || !entity.IsDead())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AddKillExp(entity);
|
||||
|
||||
if (SourceEntity != null)
|
||||
{
|
||||
if (SourceEntity.isEntityRemote)
|
||||
{
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendPackage(NetPackageManager.GetPackage<NetPackageMinEventFire>().Setup(SourceEntity.entityId, entity.entityId, MinEventTypes.onSelfKilledOther, _itemValueExplosionSource), _onlyClientsAttachedToAnEntity: false, SourceEntity.entityId);
|
||||
}
|
||||
else
|
||||
{
|
||||
SourceEntity.FireEvent(MinEventTypes.onSelfKilledOther);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag && SourceEntity != null)
|
||||
{
|
||||
if (SourceEntity.isEntityRemote)
|
||||
{
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendPackage(NetPackageManager.GetPackage<NetPackageMinEventFire>().Setup(SourceEntity.entityId, -1, MinEventTypes.onSelfExplosionMissEntity, _itemValueExplosionSource), _onlyClientsAttachedToAnEntity: false, SourceEntity.entityId);
|
||||
}
|
||||
else
|
||||
{
|
||||
SourceEntity.MinEventContext.Self = SourceEntity;
|
||||
SourceEntity.MinEventContext.Other = null;
|
||||
SourceEntity.MinEventContext.ItemValue = _itemValueExplosionSource;
|
||||
SourceEntity.FireEvent(MinEventTypes.onSelfExplosionMissEntity);
|
||||
}
|
||||
}
|
||||
|
||||
hitEntities.Clear();
|
||||
}
|
||||
|
||||
public void AddKillExp(EntityAlive entity)
|
||||
{
|
||||
EntityPlayer entityPlayer = SourceEntity as EntityPlayer;
|
||||
|
||||
if (entityPlayer == null && IsNPC)
|
||||
{
|
||||
EntityNPCRebirth npc = SourceEntity as EntityNPCRebirth;
|
||||
int leader = (int)npc.Buffs.GetCustomVar("$Leader", 0);
|
||||
|
||||
//entityPlayer = npc.Owner;
|
||||
if (entityPlayer == null && leader > 0)
|
||||
entityPlayer = GameManager.Instance.World.GetEntity(leader) as EntityPlayer;
|
||||
|
||||
//Log.Out($"Found leader: {leader}, npc owner: {entityPlayer}");
|
||||
}
|
||||
|
||||
if (entityPlayer != null)
|
||||
{
|
||||
entityPlayer.AddKillXP(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 GetRandomForce()
|
||||
{
|
||||
int xSign = UnityEngine.Random.Range(0, 2) * 2 - 1; // randomly go in the negative direction
|
||||
int zSign = UnityEngine.Random.Range(0, 2) * 2 - 1;
|
||||
int xStr = UnityEngine.Random.Range(_XZMultiplier.x, _XZMultiplier.y) * xSign;
|
||||
int yStr = UnityEngine.Random.Range(_heightMultiplier.x, _heightMultiplier.y);
|
||||
int zStr = UnityEngine.Random.Range(_XZMultiplier.x, _XZMultiplier.y) * zSign;
|
||||
Vector3 force = new Vector3(_initialForceStrength * xStr, _initialForceStrength * yStr, _initialForceStrength * zStr);
|
||||
//Log.Out($"force: {force}");
|
||||
return force;
|
||||
}
|
||||
|
||||
public struct DamageRecord
|
||||
{
|
||||
public EntityAlive entity;
|
||||
public float damage;
|
||||
public Vector3 dir;
|
||||
public Transform hitTransform;
|
||||
public EnumBodyPartHit mainPart;
|
||||
public EnumBodyPartHit parts;
|
||||
}
|
||||
|
||||
}
|
||||
180
Scripts/MinEvents/MinEventActionModifyCVarRebirth.cs
Normal file
180
Scripts/MinEvents/MinEventActionModifyCVarRebirth.cs
Normal file
@@ -0,0 +1,180 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class MinEventActionModifyCVarRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public string cvarName { get; private set; }
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute START");
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 1");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 2");
|
||||
if (this.cvarRef)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 3 BEFORE this.value: " + this.value);
|
||||
this.value = this.targets[i].Buffs.GetCustomVar(this.refCvarName, 0f);
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 3 AFTER this.value: " + this.value);
|
||||
}
|
||||
else if (this.rollType == MinEventActionModifyCVarRebirth.RandomRollTypes.randomInt)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 4 BEFORE this.value: " + this.value);
|
||||
this.value = Mathf.Clamp((float)_params.Self.rand.RandomRange((int)this.minValue, (int)this.maxValue + 1), this.minValue, this.maxValue);
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 4 AFTER this.value: " + this.value);
|
||||
}
|
||||
else if (this.rollType == MinEventActionModifyCVarRebirth.RandomRollTypes.randomFloat)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 5 BEFORE this.value: " + this.value);
|
||||
this.value = Mathf.Clamp(_params.Self.rand.RandomRange(this.minValue, this.maxValue + 1f), this.minValue, this.maxValue);
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 5 AFTER this.value: " + this.value);
|
||||
}
|
||||
float num = this.targets[i].Buffs.GetCustomVar(this.cvarName, 0f);
|
||||
switch (this.operation)
|
||||
{
|
||||
case MinEventActionModifyCVarRebirth.OperationTypes.set:
|
||||
case MinEventActionModifyCVarRebirth.OperationTypes.setvalue:
|
||||
num = this.value;
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 6, num: " + num);
|
||||
break;
|
||||
case MinEventActionModifyCVarRebirth.OperationTypes.add:
|
||||
num += this.value;
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 7, num: " + num);
|
||||
break;
|
||||
case MinEventActionModifyCVarRebirth.OperationTypes.subtract:
|
||||
num -= this.value;
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 8, num: " + num);
|
||||
break;
|
||||
case MinEventActionModifyCVarRebirth.OperationTypes.multiply:
|
||||
num *= this.value;
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 9, num: " + num);
|
||||
break;
|
||||
case MinEventActionModifyCVarRebirth.OperationTypes.divide:
|
||||
num /= ((this.value == 0f) ? 0.0001f : this.value);
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 10, num: " + num);
|
||||
break;
|
||||
}
|
||||
//Log.Out("MinEventActionModifyCVarRebirth-Execute 11, num: " + num);
|
||||
this.targets[i].Buffs.SetCustomVar(this.cvarName, num, (this.targets[i].isEntityRemote && !_params.Self.isEntityRemote) || _params.IsLocal);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "cvar")
|
||||
{
|
||||
this.cvarName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (localName == "operation")
|
||||
{
|
||||
this.operation = EnumUtils.Parse<MinEventActionModifyCVarRebirth.OperationTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
if (localName == "value")
|
||||
{
|
||||
this.rollType = MinEventActionModifyCVarRebirth.RandomRollTypes.none;
|
||||
this.cvarRef = false;
|
||||
if (_attribute.Value.StartsWith("randomint", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Vector2 vector = StringParsers.ParseVector2(_attribute.Value.Substring(_attribute.Value.IndexOf('(') + 1, _attribute.Value.IndexOf(')') - (_attribute.Value.IndexOf('(') + 1)));
|
||||
this.minValue = (float)((int)vector.x);
|
||||
this.maxValue = (float)((int)vector.y);
|
||||
this.rollType = MinEventActionModifyCVarRebirth.RandomRollTypes.randomInt;
|
||||
}
|
||||
else if (_attribute.Value.StartsWith("randomfloat", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Vector2 vector2 = StringParsers.ParseVector2(_attribute.Value.Substring(_attribute.Value.IndexOf('(') + 1, _attribute.Value.IndexOf(')') - (_attribute.Value.IndexOf('(') + 1)));
|
||||
this.minValue = vector2.x;
|
||||
this.maxValue = vector2.y;
|
||||
this.rollType = MinEventActionModifyCVarRebirth.RandomRollTypes.randomFloat;
|
||||
}
|
||||
else if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.cvarRef = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (localName == "seed_type")
|
||||
{
|
||||
this.seedType = EnumUtils.Parse<MinEventActionModifyCVarRebirth.SeedType>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override bool CanExecute(MinEventTypes _eventType, MinEventParams _params)
|
||||
{
|
||||
if (this.cvarName != null && this.cvarName.StartsWith("_"))
|
||||
{
|
||||
Log.Out("CVar '{0}' is readonly", new object[]
|
||||
{
|
||||
this.cvarName
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return base.CanExecute(_eventType, _params);
|
||||
}
|
||||
|
||||
public float GetValueForDisplay()
|
||||
{
|
||||
if (this.operation == MinEventActionModifyCVarRebirth.OperationTypes.add)
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
if (this.operation == MinEventActionModifyCVarRebirth.OperationTypes.subtract)
|
||||
{
|
||||
return -this.value;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private MinEventActionModifyCVarRebirth.SeedType seedType;
|
||||
private MinEventActionModifyCVarRebirth.OperationTypes operation;
|
||||
private float value;
|
||||
private float minValue;
|
||||
private float maxValue;
|
||||
private bool cvarRef;
|
||||
private string refCvarName = string.Empty;
|
||||
private MinEventActionModifyCVarRebirth.RandomRollTypes rollType;
|
||||
private enum OperationTypes
|
||||
{
|
||||
set,
|
||||
setvalue,
|
||||
add,
|
||||
subtract,
|
||||
multiply,
|
||||
divide
|
||||
}
|
||||
|
||||
private enum SeedType
|
||||
{
|
||||
Item,
|
||||
Player,
|
||||
Random
|
||||
}
|
||||
|
||||
private enum RandomRollTypes : byte
|
||||
{
|
||||
none,
|
||||
randomInt,
|
||||
randomFloat
|
||||
}
|
||||
}
|
||||
129
Scripts/MinEvents/MinEventActionModifyConstantRebirth.cs
Normal file
129
Scripts/MinEvents/MinEventActionModifyConstantRebirth.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class MinEventActionModifyConstantRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public string cvarName { get; private set; }
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
float num = RebirthVariables.localConstants[this.cvarName];
|
||||
switch (this.operation)
|
||||
{
|
||||
case MinEventActionModifyConstantRebirth.OperationTypes.set:
|
||||
case MinEventActionModifyConstantRebirth.OperationTypes.setvalue:
|
||||
num = this.value;
|
||||
break;
|
||||
case MinEventActionModifyConstantRebirth.OperationTypes.add:
|
||||
num += this.value;
|
||||
break;
|
||||
case MinEventActionModifyConstantRebirth.OperationTypes.subtract:
|
||||
num -= this.value;
|
||||
break;
|
||||
case MinEventActionModifyConstantRebirth.OperationTypes.multiply:
|
||||
num *= this.value;
|
||||
break;
|
||||
case MinEventActionModifyConstantRebirth.OperationTypes.divide:
|
||||
num /= ((this.value == 0f) ? 0.0001f : this.value);
|
||||
break;
|
||||
}
|
||||
|
||||
RebirthVariables.localConstants[this.cvarName] = num;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "cvar")
|
||||
{
|
||||
this.cvarName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (localName == "operation")
|
||||
{
|
||||
this.operation = EnumUtils.Parse<MinEventActionModifyConstantRebirth.OperationTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
if (localName == "value")
|
||||
{
|
||||
this.rollType = MinEventActionModifyConstantRebirth.RandomRollTypes.none;
|
||||
this.cvarRef = false;
|
||||
if (_attribute.Value.StartsWith("randomint", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Vector2 vector = StringParsers.ParseVector2(_attribute.Value.Substring(_attribute.Value.IndexOf('(') + 1, _attribute.Value.IndexOf(')') - (_attribute.Value.IndexOf('(') + 1)));
|
||||
this.minValue = (float)((int)vector.x);
|
||||
this.maxValue = (float)((int)vector.y);
|
||||
this.rollType = MinEventActionModifyConstantRebirth.RandomRollTypes.randomInt;
|
||||
}
|
||||
else if (_attribute.Value.StartsWith("randomfloat", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Vector2 vector2 = StringParsers.ParseVector2(_attribute.Value.Substring(_attribute.Value.IndexOf('(') + 1, _attribute.Value.IndexOf(')') - (_attribute.Value.IndexOf('(') + 1)));
|
||||
this.minValue = vector2.x;
|
||||
this.maxValue = vector2.y;
|
||||
this.rollType = MinEventActionModifyConstantRebirth.RandomRollTypes.randomFloat;
|
||||
}
|
||||
else if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.cvarRef = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (localName == "seed_type")
|
||||
{
|
||||
this.seedType = EnumUtils.Parse<MinEventActionModifyConstantRebirth.SeedType>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private MinEventActionModifyConstantRebirth.SeedType seedType;
|
||||
private MinEventActionModifyConstantRebirth.OperationTypes operation;
|
||||
private float value;
|
||||
private float minValue;
|
||||
private float maxValue;
|
||||
private bool cvarRef;
|
||||
private string refCvarName = string.Empty;
|
||||
private MinEventActionModifyConstantRebirth.RandomRollTypes rollType;
|
||||
|
||||
private enum OperationTypes
|
||||
{
|
||||
set,
|
||||
setvalue,
|
||||
add,
|
||||
subtract,
|
||||
multiply,
|
||||
divide
|
||||
}
|
||||
|
||||
private enum SeedType
|
||||
{
|
||||
Item,
|
||||
Player,
|
||||
Random
|
||||
}
|
||||
|
||||
private enum RandomRollTypes : byte
|
||||
{
|
||||
none,
|
||||
randomInt,
|
||||
randomFloat
|
||||
}
|
||||
}
|
||||
602
Scripts/MinEvents/MinEventActionModifyVariableRebirth.cs
Normal file
602
Scripts/MinEvents/MinEventActionModifyVariableRebirth.cs
Normal file
@@ -0,0 +1,602 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class MinEventActionModifyVariableRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public string cvarName { get; private set; }
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute START");
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 1");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
if (this.cvarRef)
|
||||
{
|
||||
if (this.refVariable == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute cvarRef, " + this.refCvarName + ": " + RebirthVariables.localVariables[this.refCvarName]);
|
||||
this.value = RebirthVariables.localVariables[this.refCvarName];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute cvarRef, " + this.refCvarName + ": " + RebirthVariables.localConstants[this.refCvarName]);
|
||||
this.value = RebirthVariables.localConstants[this.refCvarName];
|
||||
}
|
||||
}
|
||||
else if (this.rollType == MinEventActionModifyVariableRebirth.RandomRollTypes.randomInt)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 2");
|
||||
this.value = Mathf.Clamp((float)_params.Self.rand.RandomRange((int)this.minValue, (int)this.maxValue + 1), this.minValue, this.maxValue);
|
||||
}
|
||||
else if (this.rollType == MinEventActionModifyVariableRebirth.RandomRollTypes.randomFloat)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 3");
|
||||
this.value = Mathf.Clamp(_params.Self.rand.RandomRange(this.minValue, this.maxValue + 1f), this.minValue, this.maxValue);
|
||||
}
|
||||
|
||||
float num = 0;
|
||||
|
||||
if (setConstant == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute SOURCE: localConstants");
|
||||
|
||||
num = RebirthVariables.localConstants[this.cvarName];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute SOURCE: localVariables");
|
||||
num = RebirthVariables.localVariables[this.cvarName];
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute num: " + num);
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute this.value: " + this.value);
|
||||
|
||||
int isClass = 0;
|
||||
string keyName = "";
|
||||
float value = this.value;
|
||||
|
||||
float classID = 0;
|
||||
float activeClassID = this.targets[i].Buffs.GetCustomVar("$ActiveClass_FR");
|
||||
|
||||
if (this.cvarName.Contains("PercUnit"))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute cvarName.Contains(PercUnit)");
|
||||
|
||||
if (RebirthUtilities.HasGeneticsKey(this.cvarName))
|
||||
{
|
||||
foreach (var key in RebirthVariables.localGenetics.Keys)
|
||||
{
|
||||
if (this.cvarName.Contains(key))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Genetics A BEFORE value: " + value);
|
||||
float geneticsMultiplierOption = float.Parse(RebirthVariables.customGeneticsXPMultiplier) / 100;
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Class geneticsMultiplierOption: " + geneticsMultiplierOption);
|
||||
keyName = key;
|
||||
value *= geneticsMultiplierOption;
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Genetics A AFTER value: " + value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var key in RebirthVariables.localClasses.Keys)
|
||||
{
|
||||
if (this.cvarName.Contains(key))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Class B BEFORE value: " + value);
|
||||
float classMultiplierOption = float.Parse(RebirthVariables.customClassXPMultiplier) / 100;
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Class classMultiplierOption: " + classMultiplierOption);
|
||||
isClass = 1;
|
||||
keyName = key;
|
||||
value *= classMultiplierOption;
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Class B AFTER value: " + value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isClass == 0)
|
||||
{
|
||||
foreach (var key in RebirthVariables.localExpertise.Keys)
|
||||
{
|
||||
if (this.cvarName.Contains(key))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise key: " + key);
|
||||
|
||||
string pipeWeapon = "";
|
||||
string starterMeleeWeapon = "";
|
||||
|
||||
if (key == "LongRangeRifles")
|
||||
{
|
||||
pipeWeapon = "PipeRifle";
|
||||
}
|
||||
else if (key == "Shotguns")
|
||||
{
|
||||
pipeWeapon = "PipeShotgun";
|
||||
}
|
||||
else if (key == "AssaultRifles" ||
|
||||
key == "MachineGuns" ||
|
||||
key == "SubmachineGuns" ||
|
||||
key == "TacticalRifles"
|
||||
)
|
||||
{
|
||||
pipeWeapon = "PipeMachinegun";
|
||||
}
|
||||
else if (key == "Revolvers" ||
|
||||
key == "Pistols" ||
|
||||
key == "HeavyHandguns"
|
||||
)
|
||||
{
|
||||
pipeWeapon = "PipePistol";
|
||||
}
|
||||
else
|
||||
{
|
||||
starterMeleeWeapon = key;
|
||||
}
|
||||
|
||||
if (starterMeleeWeapon != "" && key.ToLower() != "melee")
|
||||
{
|
||||
this.cvarName = "$varFuriousRamsay" + key + "PercUnit";
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise this.cvarName: " + this.cvarName);
|
||||
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, 50);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise categoryValue: " + categoryValue);
|
||||
|
||||
if (RebirthVariables.localVariables[this.cvarName] < categoryValue)
|
||||
{
|
||||
RebirthVariables.localVariables[this.cvarName] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (pipeWeapon != "")
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise pipeWeapon: " + pipeWeapon);
|
||||
|
||||
ProgressionValue craftingProgressionValue = this.targets[i].Progression.GetProgressionValue("FuriousRamsayCrafting" + pipeWeapon);
|
||||
int craftingProgressionLevel = craftingProgressionValue.Level;
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise craftingProgressionLevel: " + craftingProgressionLevel);
|
||||
|
||||
if (craftingProgressionLevel < 50)
|
||||
{
|
||||
this.cvarName = "$varFuriousRamsay" + pipeWeapon + "PercUnit";
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise this.cvarName: " + this.cvarName);
|
||||
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(pipeWeapon, 50);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise categoryValue: " + categoryValue);
|
||||
|
||||
RebirthVariables.localVariables[this.cvarName] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
|
||||
craftingProgressionValue.Level = 50;
|
||||
|
||||
this.cvarName = "$varFuriousRamsay" + key + "PercUnit";
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise this.cvarName: " + this.cvarName);
|
||||
|
||||
categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, 50);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise categoryValue: " + categoryValue);
|
||||
|
||||
RebirthVariables.localVariables[this.cvarName] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.cvarName = "$varFuriousRamsay" + key + "PercUnit";
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise this.cvarName: " + this.cvarName);
|
||||
|
||||
float categoryValue = RebirthUtilities.GetDirectCraftingPerksCategoryValue(key, 50);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Expertise categoryValue: " + categoryValue);
|
||||
|
||||
if (RebirthVariables.localVariables[this.cvarName] < categoryValue)
|
||||
{
|
||||
RebirthVariables.localVariables[this.cvarName] = categoryValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise BEFORE value: " + value);
|
||||
|
||||
int currentValue = (int)RebirthVariables.localVariables[this.cvarName];
|
||||
|
||||
float classMultiplierOption = float.Parse(RebirthVariables.customClassXPMultiplier) / 100;
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Class classMultiplierOption: " + classMultiplierOption);
|
||||
|
||||
keyName = key;
|
||||
isClass = 2;
|
||||
value *= classMultiplierOption;
|
||||
|
||||
if (isPerc == 1)
|
||||
{
|
||||
float categoryFloor = RebirthUtilities.GetCategoryFloorFromXP(key, RebirthVariables.localVariables[this.cvarName]);
|
||||
float categoryCeiling = RebirthUtilities.GetCategoryCeilingFromXP(key, RebirthVariables.localVariables[this.cvarName]);
|
||||
|
||||
value = (categoryCeiling - categoryFloor) * this.value;
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise Current XP: " + RebirthVariables.localVariables[this.cvarName]);
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise categoryFloor: " + categoryFloor);
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise categoryCeiling: " + categoryCeiling);
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise AFTER value: " + value);
|
||||
|
||||
int newValue = (int)(RebirthVariables.localVariables[this.cvarName] + value);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise currentValue: " + currentValue);
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise newValue: " + newValue);
|
||||
|
||||
string className = RebirthUtilities.GetClassFromPerk(key);
|
||||
classID = RebirthUtilities.GetIDFromClassName(className);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise className: " + className);
|
||||
|
||||
int classValue = (int)RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
||||
|
||||
if (newValue > currentValue)
|
||||
{
|
||||
float residual = (RebirthVariables.localVariables[this.cvarName] + value) - newValue;
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise residual: " + residual);
|
||||
|
||||
if (newValue < (int)classValue)
|
||||
{
|
||||
residual = 0;
|
||||
}
|
||||
|
||||
RebirthVariables.localVariables[this.cvarName] = newValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise classID: " + classID);
|
||||
|
||||
if (perkLevel > 0 && activeClassID == classID)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute C Expertise perkLevel > 0");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + perkLevel + "PercUnit"] = newValue;
|
||||
}
|
||||
|
||||
int currentClassValue = (int)RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
||||
|
||||
float projectedValue = RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"] + (residual * 3f);
|
||||
|
||||
int newClassValue = (int)projectedValue;
|
||||
|
||||
if (newClassValue > currentClassValue)
|
||||
{
|
||||
projectedValue = newClassValue;
|
||||
}
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"] = projectedValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], "$varFuriousRamsay" + className + "PercUnit");
|
||||
|
||||
return;
|
||||
}
|
||||
else if (currentValue == classValue)
|
||||
{
|
||||
RebirthVariables.localVariables[this.cvarName] = newValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute D Expertise classID: " + classID);
|
||||
if (perkLevel > 0 && activeClassID == classID)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute D Expertise perkLevel > 0");
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + perkLevel + "PercUnit"] = newValue;
|
||||
}
|
||||
|
||||
int currentClassValue = (int)RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"];
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute D Expertise currentClassValue: " + currentClassValue);
|
||||
|
||||
float projectedValue = RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"] + (value * 3f);
|
||||
|
||||
if (projectedValue > currentClassValue + 1)
|
||||
{
|
||||
projectedValue = currentClassValue + 1;
|
||||
}
|
||||
|
||||
if (activeClassID == 10)
|
||||
{
|
||||
if (projectedValue > 15)
|
||||
{
|
||||
projectedValue = 15;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectedValue > 10)
|
||||
{
|
||||
projectedValue = 10;
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute D Expertise projectedValue: " + projectedValue);
|
||||
|
||||
int newClassValue = (int)projectedValue;
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute D Expertise newClassValue: " + newClassValue);
|
||||
|
||||
if (newClassValue > currentClassValue)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute D Expertise newClassValue > currentClassValue");
|
||||
projectedValue = newClassValue;
|
||||
}
|
||||
|
||||
RebirthVariables.localVariables["$varFuriousRamsay" + className + "PercUnit"] = projectedValue;
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], "$varFuriousRamsay" + className + "PercUnit");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (this.operation)
|
||||
{
|
||||
case MinEventActionModifyVariableRebirth.OperationTypes.set:
|
||||
case MinEventActionModifyVariableRebirth.OperationTypes.setvalue:
|
||||
num = value;
|
||||
break;
|
||||
case MinEventActionModifyVariableRebirth.OperationTypes.add:
|
||||
num += value;
|
||||
break;
|
||||
case MinEventActionModifyVariableRebirth.OperationTypes.subtract:
|
||||
num -= value;
|
||||
break;
|
||||
case MinEventActionModifyVariableRebirth.OperationTypes.multiply:
|
||||
num *= value;
|
||||
break;
|
||||
case MinEventActionModifyVariableRebirth.OperationTypes.divide:
|
||||
num /= ((value == 0f) ? 0.0001f : value);
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.maxValue > 0f && num > this.maxValue)
|
||||
{
|
||||
num = this.maxValue;
|
||||
}
|
||||
|
||||
if (setConstant == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 1, num: " + num);
|
||||
RebirthVariables.localConstants[this.cvarName] = num;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 2");
|
||||
|
||||
if (this.cvarName.Contains("PercUnit"))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 3");
|
||||
if (RebirthUtilities.HasGeneticsKey(this.cvarName))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 4");
|
||||
RebirthUtilities.GetMaxGeneticsProgression(ref num, keyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 7");
|
||||
if (isClass == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 8");
|
||||
int maxProgression = 10;
|
||||
|
||||
foreach (var classKey in RebirthVariables.localClassProgressionMax.Keys)
|
||||
{
|
||||
if (classKey == keyName)
|
||||
{
|
||||
maxProgression = RebirthVariables.localClassProgressionMax[classKey];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (num > maxProgression)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 9");
|
||||
RebirthVariables.localVariables[this.cvarName] = maxProgression;
|
||||
num = maxProgression;
|
||||
}
|
||||
}
|
||||
else if (isClass == 2)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 11");
|
||||
int maxProgression = 10;
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute " + this.cvarName + ": " + RebirthVariables.localVariables[this.cvarName]);
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute num: " + num);
|
||||
|
||||
foreach (var classKey in RebirthVariables.localExpertise.Keys)
|
||||
{
|
||||
if (classKey == keyName)
|
||||
{
|
||||
maxProgression = RebirthVariables.localExpertise[classKey];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute maxProgression: " + maxProgression);
|
||||
|
||||
if (num > maxProgression)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 12");
|
||||
RebirthVariables.localVariables[this.cvarName] = maxProgression;
|
||||
num = maxProgression;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 15");
|
||||
RebirthVariables.localVariables[this.cvarName] = num;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute Z classID: " + classID);
|
||||
|
||||
if (perkLevel > 0 && activeClassID == classID)
|
||||
{
|
||||
RebirthVariables.localConstants["$varFuriousRamsayPerk" + perkLevel + "PercUnit"] = num;
|
||||
//Log.Out("MinEventActionModifyCVarLBD-Execute $varFuriousRamsayPerk" + perkLevel + "PercUnit: " + RebirthVariables.localConstants["$varFuriousRamsayPerk" + perkLevel + "PercUnit"]);
|
||||
}
|
||||
|
||||
if (processAttribute == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute 16");
|
||||
RebirthUtilities.ProcessAttribute(this.targets[i], this.cvarName);
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-Execute " + this.cvarName + ": " + RebirthVariables.localVariables[this.cvarName]);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "cvar")
|
||||
{
|
||||
this.cvarName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (localName == "operation")
|
||||
{
|
||||
this.operation = EnumUtils.Parse<MinEventActionModifyVariableRebirth.OperationTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
if (localName == "processAttribute")
|
||||
{
|
||||
this.processAttribute = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (localName == "refVariable")
|
||||
{
|
||||
this.refVariable = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (localName == "setConstant")
|
||||
{
|
||||
this.setConstant = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (localName == "maxValue")
|
||||
{
|
||||
this.maxValue = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (localName == "perkLevel")
|
||||
{
|
||||
this.perkLevel = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (localName == "isPerc")
|
||||
{
|
||||
this.isPerc = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (localName == "value")
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-ParseXmlAttribute 1");
|
||||
|
||||
this.rollType = MinEventActionModifyVariableRebirth.RandomRollTypes.none;
|
||||
this.cvarRef = false;
|
||||
if (_attribute.Value.StartsWith("randomint", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-ParseXmlAttribute 2");
|
||||
Vector2 vector = StringParsers.ParseVector2(_attribute.Value.Substring(_attribute.Value.IndexOf('(') + 1, _attribute.Value.IndexOf(')') - (_attribute.Value.IndexOf('(') + 1)));
|
||||
this.minValue = (float)((int)vector.x);
|
||||
this.maxValue = (float)((int)vector.y);
|
||||
this.rollType = MinEventActionModifyVariableRebirth.RandomRollTypes.randomInt;
|
||||
}
|
||||
else if (_attribute.Value.StartsWith("randomfloat", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-ParseXmlAttribute 3");
|
||||
Vector2 vector2 = StringParsers.ParseVector2(_attribute.Value.Substring(_attribute.Value.IndexOf('(') + 1, _attribute.Value.IndexOf(')') - (_attribute.Value.IndexOf('(') + 1)));
|
||||
this.minValue = vector2.x;
|
||||
this.maxValue = vector2.y;
|
||||
this.rollType = MinEventActionModifyVariableRebirth.RandomRollTypes.randomFloat;
|
||||
}
|
||||
else if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-ParseXmlAttribute 4");
|
||||
this.cvarRef = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
//Log.Out("MinEventActionModifyVariableRebirth-ParseXmlAttribute 5, this.value: " + this.value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (localName == "seed_type")
|
||||
{
|
||||
this.seedType = EnumUtils.Parse<MinEventActionModifyVariableRebirth.SeedType>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private MinEventActionModifyVariableRebirth.SeedType seedType;
|
||||
private MinEventActionModifyVariableRebirth.OperationTypes operation;
|
||||
private float value;
|
||||
private float minValue;
|
||||
private float maxValue;
|
||||
private int processAttribute = 1;
|
||||
private int refVariable = 0;
|
||||
private int setConstant = 0;
|
||||
private bool cvarRef;
|
||||
private int perkLevel = 0;
|
||||
private int isPerc = 0;
|
||||
private string refCvarName = string.Empty;
|
||||
private MinEventActionModifyVariableRebirth.RandomRollTypes rollType;
|
||||
|
||||
private enum OperationTypes
|
||||
{
|
||||
set,
|
||||
setvalue,
|
||||
add,
|
||||
subtract,
|
||||
multiply,
|
||||
divide
|
||||
}
|
||||
|
||||
private enum SeedType
|
||||
{
|
||||
Item,
|
||||
Player,
|
||||
Random
|
||||
}
|
||||
|
||||
private enum RandomRollTypes : byte
|
||||
{
|
||||
none,
|
||||
randomInt,
|
||||
randomFloat
|
||||
}
|
||||
}
|
||||
76
Scripts/MinEvents/MinEventActionPermadeathRebirth.cs
Normal file
76
Scripts/MinEvents/MinEventActionPermadeathRebirth.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class MinEventActionPermadeathRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
player.Buffs.AddBuff("FuriousRamsayPermadeath");
|
||||
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
var playerInventory = uiforPlayer.xui.PlayerInventory;
|
||||
|
||||
playerInventory.Backpack.Clear();
|
||||
playerInventory.Toolbelt.Clear();
|
||||
|
||||
int numIndex;
|
||||
|
||||
for (numIndex = 0; numIndex < player.equipment.GetSlotCount(); numIndex++)
|
||||
{
|
||||
player.equipment.SetSlotItem(numIndex, ItemValue.None.Clone(), true);
|
||||
}
|
||||
|
||||
player.Buffs.SetCustomVar("$LastPlayerLevel", 1);
|
||||
player.Buffs.SetCustomVar("$PlayerLevelBonus", 1);
|
||||
|
||||
player.Progression.Level = 1;
|
||||
player.Progression.ResetProgression(true);
|
||||
player.Progression.ExpToNextLevel = player.Progression.GetExpForNextLevel();
|
||||
player.Progression.SkillPoints = 0;
|
||||
player.Progression.ExpDeficit = 0;
|
||||
List<Recipe> recipes = CraftingManager.GetRecipes();
|
||||
for (int i = 0; i < recipes.Count; i++)
|
||||
{
|
||||
if (recipes[i].IsLearnable)
|
||||
{
|
||||
player.Buffs.SetCustomVar(recipes[i].GetName(), 0f);
|
||||
}
|
||||
}
|
||||
|
||||
player.classMaxHealth = 100;
|
||||
player.classMaxStamina = 100;
|
||||
player.classMaxFood = 100;
|
||||
player.classMaxWater = 100;
|
||||
|
||||
player.Health = 100;
|
||||
player.Stamina = 100;
|
||||
player.Water = 100;
|
||||
|
||||
List<ProgressionValue> skills = new List<ProgressionValue>();
|
||||
player.Progression.GetDict().CopyValuesTo(skills);
|
||||
foreach (ProgressionValue progressionValue in skills)
|
||||
{
|
||||
if (progressionValue.Name == "furiousramsayperkchoiceismine")
|
||||
{
|
||||
progressionValue.Level = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
progressionValue.Level = 0;
|
||||
}
|
||||
//Log.Out("progressionValue: " + progressionValue.Name + ", Level: " + progressionValue.Level);
|
||||
}
|
||||
|
||||
string ID = "PermadeathRebirth";
|
||||
|
||||
player.Buffs.AddBuff("FuriousRamsayGiveClassBook");
|
||||
|
||||
uiforPlayer.windowManager.Open(ID, true, false, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using Audio;
|
||||
using DynamicMusic;
|
||||
|
||||
public class MinEventActionPlaySoundDismemberedRebirth : MinEventActionSoundBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
string soundGroupForTarget = base.GetSoundGroupForTarget();
|
||||
if (this.localPlayerOnly && this.targets[0] as EntityPlayerLocal != null)
|
||||
{
|
||||
//Log.Out("EntityAlivePatches-damageEntityLocal PLAYER EXISTS");
|
||||
if (soundGroupForTarget == "DismemberedHeadRangedMale")
|
||||
{
|
||||
//Log.Out("EntityAlivePatches-damageEntityLocal 1");
|
||||
int num = UnityEngine.Random.Range(1, 12);
|
||||
string strSound = "DismemberedHeadRanged" + num;
|
||||
Manager.PlayInsidePlayerHead(strSound, this.targets[0].entityId, 0f, false);
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadRangedFemale")
|
||||
{
|
||||
//Log.Out("EntityAlivePatches-damageEntityLocal 2");
|
||||
int num = UnityEngine.Random.Range(1, 12);
|
||||
string strSound = "DismemberedHeadRanged" + num;
|
||||
Manager.PlayInsidePlayerHead(strSound, this.targets[0].entityId, 0f, false);
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadRanged")
|
||||
{
|
||||
//Log.Out("EntityAlivePatches-damageEntityLocal 3");
|
||||
int num = UnityEngine.Random.Range(1, 12);
|
||||
string strSound = "DismemberedHeadRanged" + num;
|
||||
Manager.PlayInsidePlayerHead(strSound, this.targets[0].entityId, 0f, false);
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadMeleeMale")
|
||||
{
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadMeleeFemale")
|
||||
{
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadMelee")
|
||||
{
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadEnemyRobot")
|
||||
{
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadBanditMale")
|
||||
{
|
||||
}
|
||||
else if (soundGroupForTarget == "DismemberedHeadBanditFemale")
|
||||
{
|
||||
}
|
||||
if (this.toggleDMS)
|
||||
{
|
||||
SectionSelector.IsDMSTempDisabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Scripts/MinEvents/MinEventActionPlayerChecksRebirth.cs
Normal file
21
Scripts/MinEvents/MinEventActionPlayerChecksRebirth.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
public class MinEventActionPlayerChecksRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
player.Buffs.SetCustomVar("EntityID", player.entityId);
|
||||
//Log.Out("MinEventActionPlayerChecksRebirth-Execute EntityID: " + player.entityId);
|
||||
|
||||
RebirthUtilities.CheckNPCMode(player, false);
|
||||
RebirthUtilities.CheckNPCOrder(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Scripts/MinEvents/MinEventActionPrePermadeathRebirth.cs
Normal file
23
Scripts/MinEvents/MinEventActionPrePermadeathRebirth.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
public class MinEventActionPrePermadeathRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionPrePermadeathRebirth-Execute START");
|
||||
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
// BEDROLL
|
||||
PersistentPlayerData playerDataFromEntityID2 = GameManager.Instance.persistentPlayers.GetPlayerDataFromEntityID(player.entityId);
|
||||
player.RemoveSpawnPoints(false);
|
||||
playerDataFromEntityID2.ClearBedroll();
|
||||
|
||||
// WAYPOINTS
|
||||
player.Waypoints.Collection.Clear();
|
||||
player.WaypointInvites.Clear();
|
||||
}
|
||||
}
|
||||
83
Scripts/MinEvents/MinEventActionProcessRespawn.cs
Normal file
83
Scripts/MinEvents/MinEventActionProcessRespawn.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
public class MinEventActionProcessRespawn : MinEventActionRemoveBuff
|
||||
{
|
||||
private int numItems = 1;
|
||||
private int numLocation = 0;
|
||||
private int numQuality = 0;
|
||||
private string itemName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionProcessRespawn-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionProcessRespawn-Execute IS CLIENT");
|
||||
|
||||
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
//Log.Out("MinEventActionProcessRespawn-Execute NO Player");
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.Progression.Level >= 5)
|
||||
{
|
||||
int random = UnityEngine.Random.Range(45, 66);
|
||||
player.Stats.Water.Value = player.Stats.Water.Max * random / 100;
|
||||
|
||||
random = UnityEngine.Random.Range(45, 66);
|
||||
player.Stats.Food.Value = player.Stats.Food.Max * random / 100;
|
||||
|
||||
player.Buffs.AddBuff("triggerAbrasion");
|
||||
|
||||
if (player.Progression.Level >= 10 && player.Progression.Level < 20)
|
||||
{
|
||||
random = UnityEngine.Random.Range(0, 2);
|
||||
if (random == 0)
|
||||
{
|
||||
player.Buffs.AddBuff("triggerSprainedArm");
|
||||
}
|
||||
else if (random == 1)
|
||||
{
|
||||
player.Buffs.AddBuff("triggerSprainedLeg");
|
||||
}
|
||||
}
|
||||
else if (player.Progression.Level >= 20)
|
||||
{
|
||||
random = UnityEngine.Random.Range(0, 3);
|
||||
if (random == 0)
|
||||
{
|
||||
player.Buffs.AddBuff("triggerFatigued");
|
||||
}
|
||||
else if (random == 1)
|
||||
{
|
||||
player.Buffs.AddBuff("triggerSprainedArm");
|
||||
}
|
||||
else if (random == 2)
|
||||
{
|
||||
player.Buffs.AddBuff("triggerSprainedLeg");
|
||||
}
|
||||
}
|
||||
|
||||
float zombieKilledMe = player.Buffs.GetCustomVar("$ZombieKilledMe");
|
||||
|
||||
if (zombieKilledMe == 1f)
|
||||
{
|
||||
player.Buffs.AddBuff("buffInfectionCatchRebirth-5");
|
||||
}
|
||||
else if (zombieKilledMe == 2f)
|
||||
{
|
||||
player.Buffs.AddBuff("buffInfectionCatchRebirth-10");
|
||||
}
|
||||
else if (zombieKilledMe == 3f)
|
||||
{
|
||||
player.Buffs.AddBuff("buffInfectionCatchRebirth-25");
|
||||
}
|
||||
|
||||
player.Buffs.SetCustomVar("$ZombieKilledMe", 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Scripts/MinEvents/MinEventActionPushRebirth.cs
Normal file
54
Scripts/MinEvents/MinEventActionPushRebirth.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionPushRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionPushRebirth-Execute 1");
|
||||
DamageResponse dmResponse = DamageResponse.New(false);
|
||||
dmResponse.StunDuration = this.duration;
|
||||
dmResponse.Strength = (int)this.force;
|
||||
Vector3 vector = _params.StartPosition;
|
||||
if (vector.y == 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionPushRebirth-Execute 2");
|
||||
vector = _params.Self.position;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
//Log.Out("MinEventActionPushRebirth-Execute 3");
|
||||
EntityAlive entityAlive = this.targets[i];
|
||||
Vector3 vector2 = entityAlive.position - vector;
|
||||
vector2.y = 0f;
|
||||
dmResponse.Source = new DamageSource(EnumDamageSource.External, EnumDamageTypes.Bashing, vector2.normalized);
|
||||
entityAlive.DoRagdoll(dmResponse);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "duration")
|
||||
{
|
||||
this.duration = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
return true;
|
||||
}
|
||||
if (name == "force")
|
||||
{
|
||||
this.force = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private float duration = 2.5f;
|
||||
private float force;
|
||||
}
|
||||
129
Scripts/MinEvents/MinEventActionRagdollRebirth.cs
Normal file
129
Scripts/MinEvents/MinEventActionRagdollRebirth.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionRagdollRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute START");
|
||||
DamageResponse dmResponse = DamageResponse.New(false);
|
||||
dmResponse.StunDuration = this.duration;
|
||||
dmResponse.Strength = (int)this.force;
|
||||
if (this.cvarRef && this.targets.Count > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute 1");
|
||||
dmResponse.StunDuration = this.targets[0].Buffs.GetCustomVar(this.refCvarName, 0f);
|
||||
}
|
||||
Vector3 vector = _params.StartPosition;
|
||||
if (vector.y == 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute 2");
|
||||
vector = _params.Self.position;
|
||||
}
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute i: " + i);
|
||||
EntityAlive entityAlive = this.targets[i];
|
||||
|
||||
if (entityAlive != null)
|
||||
{
|
||||
bool shouldAttack = RebirthUtilities.VerifyFactionStanding(_params.Self, entityAlive);
|
||||
|
||||
if (!shouldAttack)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var text in excludeTags.Split(','))
|
||||
{
|
||||
if (entityAlive.HasAnyTags(FastTags<TagGroup.Global>.Parse(text)))
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute entity cannot be ragdolled: " + entityAlive.EntityClass.entityClassName);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAlive.emodel.IsRagdollActive)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (entityAlive.AttachedToEntity != null)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute 3");
|
||||
entityAlive.Detach();
|
||||
}
|
||||
Vector3 vector2 = entityAlive.position - vector;
|
||||
if (this.scaleY == 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute 4");
|
||||
vector2.y = 0f;
|
||||
dmResponse.Source = new DamageSource(EnumDamageSource.External, EnumDamageTypes.Bashing, vector2.normalized);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute 5");
|
||||
vector2.y = _params.Self.GetLookVector().y * this.scaleY;
|
||||
float num = this.force;
|
||||
if (this.massScale > 0f)
|
||||
{
|
||||
//Log.Out("MinEventActionRagdollRebirth-Execute 6");
|
||||
num *= EntityClass.list[entityAlive.entityClass].MassKg * this.massScale;
|
||||
}
|
||||
dmResponse.Source = new DamageSource(EnumDamageSource.External, EnumDamageTypes.Falling, vector2.normalized * num);
|
||||
}
|
||||
entityAlive.DoRagdoll(dmResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "duration")
|
||||
{
|
||||
if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.cvarRef = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.duration = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (localName == "force")
|
||||
{
|
||||
this.force = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
return true;
|
||||
}
|
||||
if (localName == "massScale")
|
||||
{
|
||||
this.massScale = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
return true;
|
||||
}
|
||||
if (localName == "scaleY")
|
||||
{
|
||||
this.scaleY = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
return true;
|
||||
}
|
||||
if (localName == "excludetags")
|
||||
{
|
||||
this.excludeTags = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private float duration = 2.5f;
|
||||
private bool cvarRef;
|
||||
private string refCvarName = string.Empty;
|
||||
private float force;
|
||||
private float scaleY;
|
||||
private float massScale;
|
||||
private string excludeTags = "";
|
||||
}
|
||||
378
Scripts/MinEvents/MinEventActionRandomEntitySpawn.cs
Normal file
378
Scripts/MinEvents/MinEventActionRandomEntitySpawn.cs
Normal file
@@ -0,0 +1,378 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
//using static RebirthManager;
|
||||
|
||||
public class MinEventActionRandomEntitySpawn : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute START");
|
||||
EntityAlive entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (RebirthUtilities.IsHordeNight())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int targetEntityID = -1;
|
||||
EntityAlive targetEntity = entity.GetAttackTarget();
|
||||
EntityPlayer closestPlayer = null;
|
||||
|
||||
if (targetEntity != null)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute targetEntity: " + targetEntity.EntityName);
|
||||
|
||||
float distance = Vector3.Distance(entity.position, targetEntity.position);
|
||||
|
||||
if (distance > playerDistance)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute TOO FAR FROM THE PLAYER");
|
||||
return;
|
||||
}
|
||||
|
||||
targetEntityID = targetEntity.entityId;
|
||||
|
||||
if (targetEntity is EntityPlayer)
|
||||
{
|
||||
closestPlayer = targetEntity as EntityPlayer;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
closestPlayer = entity.world.GetClosestPlayer(entity.position, 120f, false);
|
||||
|
||||
if (closestPlayer != null)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute closestPlayer: " + closestPlayer.EntityName);
|
||||
targetEntityID = closestPlayer.entityId;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
string newEntityName = entityName;
|
||||
|
||||
if (newEntityName == "")
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute RANDOM ENTITY");
|
||||
if (closestPlayer != null)
|
||||
{
|
||||
List<int> entities = RebirthUtilities.BuildEntityGroup(closestPlayer.gameStage);
|
||||
|
||||
int randomValue = GameManager.Instance.World.GetGameRandom().RandomRange(0, entities.Count - 1);
|
||||
|
||||
newEntityName = EntityClass.GetEntityClassName(entities[randomValue]);
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute RANDOM newEntityName: " + newEntityName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute BEFORE newEntityName: " + newEntityName);
|
||||
if (hasFeralRadiated == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute hasFeralRadiated: " + hasFeralRadiated);
|
||||
if (closestPlayer != null)
|
||||
{
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute closestPlayer.gameStage: " + closestPlayer.gameStage);
|
||||
if (closestPlayer.gameStage >= 380)
|
||||
{
|
||||
newEntityName = newEntityName + "Tainted";
|
||||
}
|
||||
else if (closestPlayer.gameStage >= 260)
|
||||
{
|
||||
newEntityName = newEntityName + "Radiated";
|
||||
}
|
||||
else if (closestPlayer.gameStage >= 140)
|
||||
{
|
||||
newEntityName = newEntityName + "Feral";
|
||||
}
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute AFTER entityName: " + entityName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (maxTotalEntities > 0 || maxEntities > 0)
|
||||
{
|
||||
List<Entity> entitiesInBounds = GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityZombieSDX), BoundsUtils.BoundsForMinMax(entity.position.x - this.minMax, entity.position.y - this.minMaxY, entity.position.z - this.minMax, entity.position.x + this.minMax, entity.position.y + this.minMaxY, entity.position.z + this.minMax), new List<Entity>());
|
||||
List<Entity> entitiesInBounds2 = GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityZombieCopRebirth), BoundsUtils.BoundsForMinMax(entity.position.x - this.minMax, entity.position.y - this.minMaxY, entity.position.z - this.minMax, entity.position.x + this.minMax, entity.position.y + this.minMaxY, entity.position.z + this.minMax), new List<Entity>());
|
||||
|
||||
int numTotalEntities = 0;
|
||||
int numEntities = 0;
|
||||
|
||||
List<Entity> entities = new List<Entity>();
|
||||
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute entitiesInBounds.Count: " + entitiesInBounds.Count);
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute entitiesInBounds2.Count: " + entitiesInBounds2.Count);
|
||||
|
||||
foreach (Entity validateEntity in entitiesInBounds)
|
||||
{
|
||||
if (validateEntity != null && !validateEntity.IsDead())
|
||||
{
|
||||
entities.Add(validateEntity);
|
||||
}
|
||||
}
|
||||
foreach (Entity validateEntity in entitiesInBounds2)
|
||||
{
|
||||
if (validateEntity != null && !validateEntity.IsDead() && !entities.Contains(validateEntity))
|
||||
{
|
||||
entities.Add(validateEntity);
|
||||
}
|
||||
}
|
||||
foreach (Entity validateEntity in entities)
|
||||
{
|
||||
if (validateEntity.EntityClass.entityClassName.ToLower().Contains(entityName.ToLower()))
|
||||
{
|
||||
numEntities++;
|
||||
}
|
||||
numTotalEntities++;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute maxEntities: " + maxEntities);
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute numEntities: " + numEntities);
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute maxTotalEntities: " + maxTotalEntities);
|
||||
//Log.Out("MinEventActionRandomEntitySpawn-Execute numTotalEntities: " + numTotalEntities);
|
||||
|
||||
if (numEntities >= this.maxEntities ||
|
||||
numTotalEntities >= this.maxTotalEntities)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool shouldAttackPlayer = false;
|
||||
|
||||
if (attackPlayer == 1)
|
||||
{
|
||||
shouldAttackPlayer = true;
|
||||
}
|
||||
|
||||
bool spawnAtPlayerLevel = false;
|
||||
|
||||
if (atPlayerLevel == 1)
|
||||
{
|
||||
spawnAtPlayerLevel = true;
|
||||
}
|
||||
|
||||
bool spawnAtRandomRotation = true;
|
||||
|
||||
if (randomRotation == 0)
|
||||
{
|
||||
spawnAtRandomRotation = false;
|
||||
}
|
||||
|
||||
RebirthUtilities.SpawnEntity(entity.entityId, newEntityName, numEntities, entityPos, entityRot, strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, spawnAtRandomRotation, spawnAtPlayerLevel, shouldAttackPlayer, targetEntityID, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList, false, forceSpawn);
|
||||
}
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "maxEntities")
|
||||
{
|
||||
maxEntities = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "maxTotalEntities")
|
||||
{
|
||||
maxTotalEntities = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "entityName")
|
||||
{
|
||||
entityName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "hasFeralRadiated")
|
||||
{
|
||||
hasFeralRadiated = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "playerDistance")
|
||||
{
|
||||
playerDistance = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "numEntities")
|
||||
{
|
||||
numEntities = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "StartScale")
|
||||
{
|
||||
float.TryParse(_attribute.Value, out numStartScale);
|
||||
return true;
|
||||
}
|
||||
else if (name == "distance")
|
||||
{
|
||||
strDistance = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "height")
|
||||
{
|
||||
strHeight = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "spawner")
|
||||
{
|
||||
strSpawner = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "direction")
|
||||
{
|
||||
strDirection = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "sound")
|
||||
{
|
||||
strSound = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "minion")
|
||||
{
|
||||
minion = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "checkMaxEntities")
|
||||
{
|
||||
checkMaxEntities = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "minMax")
|
||||
{
|
||||
minMax = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "maxEntities")
|
||||
{
|
||||
maxEntities = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "attackPlayer")
|
||||
{
|
||||
attackPlayer = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "repeat")
|
||||
{
|
||||
repeat = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "allNames")
|
||||
{
|
||||
allNames = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "atplayerlevel")
|
||||
{
|
||||
atPlayerLevel = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "rotation")
|
||||
{
|
||||
numRotation = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "randomRotation")
|
||||
{
|
||||
randomRotation = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "isBoss")
|
||||
{
|
||||
isBoss = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "handParticle")
|
||||
{
|
||||
handParticle = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "lootListName")
|
||||
{
|
||||
lootListName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "lootDropClass")
|
||||
{
|
||||
lootDropClass = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "lootDropChance")
|
||||
{
|
||||
lootDropChance = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "navIcon")
|
||||
{
|
||||
navIcon = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "buffList")
|
||||
{
|
||||
buffList = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "forceSpawn")
|
||||
{
|
||||
if (_attribute.Value == "true")
|
||||
{
|
||||
forceSpawn = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected int playerDistance = 20;
|
||||
protected int minMax = 80;
|
||||
protected int minMaxY = 40;
|
||||
protected int maxEntities = 6;
|
||||
protected int maxTotalEntities = 20;
|
||||
protected int hasFeralRadiated = 0;
|
||||
protected string entityName = "";
|
||||
private string strEntity = "";
|
||||
private string entityPos = "";
|
||||
private string entityRot = "";
|
||||
private string strDistance = "";
|
||||
private string strHeight = "";
|
||||
private string strSpawner = "";
|
||||
private string strDirection = "random";
|
||||
private string strSound = "";
|
||||
private float numStartScale = 0;
|
||||
private int minion = 0;
|
||||
private int numEntities = 1;
|
||||
private int attackPlayer = 0;
|
||||
private int checkMaxEntities = 0;
|
||||
public int repeat = 1;
|
||||
public int allNames = 1;
|
||||
public int atPlayerLevel = 0;
|
||||
public int randomRotation = 1;
|
||||
public int numRotation = -1;
|
||||
public int isBoss = -1;
|
||||
public int handParticle = -1;
|
||||
public string lootListName = "";
|
||||
public string lootDropClass = "";
|
||||
public int lootDropChance = 1;
|
||||
public string navIcon = "";
|
||||
public string buffList = "";
|
||||
public bool forceSpawn = false;
|
||||
}
|
||||
41
Scripts/MinEvents/MinEventActionSetBaseJumpHeightRebirth.cs
Normal file
41
Scripts/MinEvents/MinEventActionSetBaseJumpHeightRebirth.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetBaseJumpHeightRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private float flMaxBaseJumpHeight = 1;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityZombieSDX theEntity = _params.Self as EntityZombieSDX;
|
||||
|
||||
if (theEntity != null)
|
||||
{
|
||||
theEntity.flMaxBaseJumpHeight = flMaxBaseJumpHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionSetBaseJumpHeightRebirth-Execute ENTITY == null");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "MaxBaseJumpHeight")
|
||||
{
|
||||
flMaxBaseJumpHeight = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/MinEvents/MinEventActionSetCVarRebirth.cs
Normal file
52
Scripts/MinEvents/MinEventActionSetCVarRebirth.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetCVarRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
string strCVar = "";
|
||||
float numCVar = 0;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player.Buffs.HasCustomVar(strCVar))
|
||||
{
|
||||
player.Buffs.SetCustomVar(strCVar, numCVar);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.Buffs.AddCustomVar(strCVar, numCVar);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "CVarValue")
|
||||
{
|
||||
numCVar = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "CVarName")
|
||||
{
|
||||
strCVar = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/MinEvents/MinEventActionSetFogRebirth.cs
Normal file
33
Scripts/MinEvents/MinEventActionSetFogRebirth.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetFogRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
float flDensity = 0;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionSetFogRebirth-Execute Density: " + flDensity);
|
||||
SkyManager.SetFogDensity(flDensity);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "Density")
|
||||
{
|
||||
flDensity = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/MinEvents/MinEventActionSetJumpHeightRebirth.cs
Normal file
52
Scripts/MinEvents/MinEventActionSetJumpHeightRebirth.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetJumpHeightRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private float flMaxJumpHeight = 1;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityZombieSDX theEntity = _params.Self as EntityZombieSDX;
|
||||
|
||||
if (theEntity != null)
|
||||
{
|
||||
if (flMaxJumpHeight == 0)
|
||||
{
|
||||
theEntity.flMaxJumpHeight = theEntity.flMaxBaseJumpHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionSetJumpHeightRebirth-Execute flMaxJumpHeight: " + flMaxJumpHeight);
|
||||
if (theEntity.flMaxBaseJumpHeight < flMaxJumpHeight)
|
||||
{
|
||||
theEntity.flMaxJumpHeight = flMaxJumpHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionSetJumpHeightRebirth-Execute ENTITY == null");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "MaxJumpHeight")
|
||||
{
|
||||
flMaxJumpHeight = float.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/MinEvents/MinEventActionSetNumSpawns.cs
Normal file
81
Scripts/MinEvents/MinEventActionSetNumSpawns.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetNumSpawns : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionSetNumSpawns-Execute START");
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
//Log.Out("MinEventActionSetNumSpawns-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
string optionMutatedSpawns = RebirthVariables.customMutatedSpawns;
|
||||
|
||||
int numDays = 0;
|
||||
|
||||
if (optionMutatedSpawns == "never")
|
||||
{
|
||||
numDays = 99999;
|
||||
}
|
||||
else if (optionMutatedSpawns == "afterday07")
|
||||
{
|
||||
numDays = 7;
|
||||
}
|
||||
else if (optionMutatedSpawns == "afterday14")
|
||||
{
|
||||
numDays = 14;
|
||||
}
|
||||
else if (optionMutatedSpawns == "afterday21")
|
||||
{
|
||||
numDays = 21;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
//Log.Out("MinEventActionSetNumSpawns-Execute 2, i: " + i);
|
||||
|
||||
EntityAlive entity = this.targets[i];
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
//Log.Out("MinEventActionSetNumSpawns-Execute 3 entity: " + entity.EntityClass.entityClassName);
|
||||
int currentDay = GameUtils.WorldTimeToDays(GameManager.Instance.World.worldTime);
|
||||
|
||||
//Log.Out("MinEventActionSetNumSpawns-Execute 3 currentDay: " + currentDay);
|
||||
|
||||
int numSpawns = 0;
|
||||
|
||||
if (currentDay > numDays)
|
||||
{
|
||||
numSpawns = GameManager.Instance.World.GetGameRandom().RandomRange(1, this.value);
|
||||
//Log.Out("MinEventActionSetNumSpawns-Execute numSpawns: " + numSpawns);
|
||||
}
|
||||
|
||||
entity.Buffs.SetCustomVar(".varFuriousRamsayRandomZombieMutatedSpawn", numSpawns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "value")
|
||||
{
|
||||
this.value = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected int value = 1;
|
||||
|
||||
}
|
||||
76
Scripts/MinEvents/MinEventActionSetProgression.cs
Normal file
76
Scripts/MinEvents/MinEventActionSetProgression.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetProgression : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
//Log.Out("MinEventActionSetProgression-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
List<categoryCrafting> CategoryCraftingList = RebirthVariables.localOtherCrafting[progressionName];
|
||||
|
||||
bool processAttribute = false;
|
||||
|
||||
foreach (var craftingList in CategoryCraftingList)
|
||||
{
|
||||
List<craftingLevels> craftingLevelsList = craftingList.levels;
|
||||
|
||||
bool gotResult = false;
|
||||
|
||||
foreach (var craftingLevel in craftingLevelsList)
|
||||
{
|
||||
if (craftingLevel.craftingLevel == progressionValue)
|
||||
{
|
||||
//Log.Out("MinEventActionSetProgression-Execute 2");
|
||||
if (RebirthVariables.localVariables["$varFuriousRamsaySalvageToolsPercUnit"] < craftingLevel.categoryLevel)
|
||||
{
|
||||
//Log.Out("MinEventActionSetProgression-Execute 3");
|
||||
RebirthVariables.localVariables["$varFuriousRamsaySalvageToolsPercUnit"] = craftingLevel.categoryLevel;
|
||||
processAttribute = true;
|
||||
}
|
||||
|
||||
gotResult = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (gotResult)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (processAttribute)
|
||||
{
|
||||
//Log.Out("MinEventActionSetProgression-Execute 4");
|
||||
RebirthUtilities.ProcessAttribute(this.targets[0], "$varFuriousRamsay" + progressionName + "PercUnit");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
|
||||
if (localName == "progressionName")
|
||||
{
|
||||
this.progressionName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (localName == "progressionValue")
|
||||
{
|
||||
this.progressionValue = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private int progressionValue = 0;
|
||||
private string progressionName = "";
|
||||
}
|
||||
113
Scripts/MinEvents/MinEventActionSetSilencerSoundsRebirth.cs
Normal file
113
Scripts/MinEvents/MinEventActionSetSilencerSoundsRebirth.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
public class MinEventActionSetSilencerSoundsRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var myEntity = _params.Self as EntityAlive;
|
||||
if (myEntity == null)
|
||||
return;
|
||||
|
||||
ItemValue item = ItemClass.GetItem("modGunSoundSuppressorSilencer", false);
|
||||
ItemClass itemClass = item.ItemClass;
|
||||
if (itemClass != null)
|
||||
{
|
||||
ItemActionAttack itemActionRanged = myEntity.inventory.GetHoldingGun();
|
||||
|
||||
string weaponName = myEntity.inventory.holdingItem.GetItemName().ToLower().Trim();
|
||||
|
||||
if (weaponName == "gunnpcsmg5")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "smg_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "smg_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
|
||||
}
|
||||
else if (weaponName == "gunnpcpipepistol")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pistol_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pistol_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcpipeshotgun")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcpiperifle")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "hunting_rifle_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "hunting_rifle_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcpipemg")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "m60_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "m60_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
|
||||
}
|
||||
else if (weaponName == "gunnpcm60")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "m60_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "m60_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
|
||||
}
|
||||
else if (weaponName == "gunnpcpistol")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pistol_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pistol_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcdpistol")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcak47")
|
||||
{
|
||||
//Log.Out("MinEventActionSetSilencerSoundsRebirth-Execute: 2");
|
||||
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "ak47_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "ak47_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
|
||||
}
|
||||
else if (weaponName == "furiousramsaygunak47")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[0].Properties.Values["Sound_start"] = "ak47_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[0].Properties.Values["Sound_loop"] = "ak47_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[0].Properties.Values["Sound_end"] = "silencefiller";
|
||||
}
|
||||
else if (weaponName == "gunnpctrifle")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "ak47_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "ak47_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
|
||||
}
|
||||
else if (weaponName == "gunnpchrifle")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "hunting_rifle_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "hunting_rifle_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcsrifle")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "sniperrifle_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "sniperrifle_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcpshotgun")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
else if (weaponName == "gunnpcashotgun")
|
||||
{
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
|
||||
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
|
||||
}
|
||||
|
||||
myEntity.inventory.ForceHoldingItemUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Scripts/MinEvents/MinEventActionSetTimeRebirth.cs
Normal file
50
Scripts/MinEvents/MinEventActionSetTimeRebirth.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetTimeRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
string timeFormat = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionSetTimeRebirth-Execute START");
|
||||
if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
|
||||
{
|
||||
//Log.Out("MinEventActionSetTimeRebirth-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (timeFormat.Trim().Length > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionSetTimeRebirth-Execute 1");
|
||||
string[] timeFormats = timeFormat.Split(',', (char)StringSplitOptions.None);
|
||||
|
||||
//Log.Out("MinEventActionSetTimeRebirth-Execute Int16.Parse(timeFormats[0]): " + Int16.Parse(timeFormats[0]));
|
||||
//Log.Out("MinEventActionSetTimeRebirth-Execute Int16.Parse(timeFormats[1]): " + Int16.Parse(timeFormats[1]));
|
||||
//Log.Out("MinEventActionSetTimeRebirth-Execute Int16.Parse(timeFormats[2]): " + Int16.Parse(timeFormats[2]));
|
||||
|
||||
ulong time = GameUtils.DayTimeToWorldTime(Int16.Parse(timeFormats[0]), Int16.Parse(timeFormats[1]), Int16.Parse(timeFormats[2]));
|
||||
GameManager.Instance.World.SetTimeJump(time, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "timeFormat")
|
||||
{
|
||||
timeFormat = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
86
Scripts/MinEvents/MinEventActionSetTransformActiveRebirth.cs
Normal file
86
Scripts/MinEvents/MinEventActionSetTransformActiveRebirth.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSetTransformActiveRebirth : MinEventActionBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: Start");
|
||||
Transform transform;
|
||||
if (this.parent_transform.EqualsCaseInsensitive("#HeldItemRoot"))
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: 1");
|
||||
transform = _params.Self.inventory.GetHoldingItemTransform();
|
||||
}
|
||||
else if (this.parent_transform != "")
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: 2");
|
||||
transform = GameUtils.FindDeepChildActive(_params.Self.RootTransform, this.parent_transform);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: 3");
|
||||
transform = _params.Self.RootTransform;
|
||||
}
|
||||
if (transform == null)
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: 4");
|
||||
return;
|
||||
}
|
||||
Transform transform2 = GameUtils.FindDeepChild(transform, this.transformPath);
|
||||
if (transform2 == null)
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: 5");
|
||||
return;
|
||||
}
|
||||
//Log.Out("SetTransformActiveRebirth-Execute: 6");
|
||||
|
||||
//Log.Out("localPosition.x: " + transform2.localPosition.x);
|
||||
//Log.Out("localPosition.y: " + transform2.localPosition.y);
|
||||
//Log.Out("localPosition.z: " + transform2.localPosition.z);
|
||||
//Log.Out("localRotation.x: " + transform2.localRotation.x);
|
||||
//Log.Out("localRotation.y: " + transform2.localRotation.y);
|
||||
//Log.Out("localRotation.z: " + transform2.localRotation.z);
|
||||
|
||||
transform2.gameObject.SetActive(this.isActive);
|
||||
|
||||
LightManager.LightChanged(transform2.position + Origin.position);
|
||||
}
|
||||
|
||||
public override bool CanExecute(MinEventTypes _eventType, MinEventParams _params)
|
||||
{
|
||||
//Log.Out("SetTransformActiveRebirth-CanExecute: Start");
|
||||
return base.CanExecute(_eventType, _params) && _params.Self != null && _params.ItemValue != null && this.transformPath != null && this.transformPath != "";
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "active")
|
||||
{
|
||||
this.isActive = StringParsers.ParseBool(_attribute.Value, 0, -1, true);
|
||||
return true;
|
||||
}
|
||||
if (name == "parent_transform")
|
||||
{
|
||||
this.parent_transform = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (name == "transform_path")
|
||||
{
|
||||
this.transformPath = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private string transformPath;
|
||||
private string parent_transform = "";
|
||||
private bool isActive;
|
||||
}
|
||||
40
Scripts/MinEvents/MinEventActionShowDialogRebirth.cs
Normal file
40
Scripts/MinEvents/MinEventActionShowDialogRebirth.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionShowDialogRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string ID = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
uiforPlayer.windowManager.Open(ID, true, false, true);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "ID")
|
||||
{
|
||||
ID = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
453
Scripts/MinEvents/MinEventActionSpawnBlockRebirth.cs
Normal file
453
Scripts/MinEvents/MinEventActionSpawnBlockRebirth.cs
Normal file
@@ -0,0 +1,453 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSpawnBlockRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string blockName = "";
|
||||
private string duration = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 transformPos = MinEventParams.CachedEventParam.Position;
|
||||
|
||||
Vector3i blockPos = World.worldToBlockPos(transformPos);
|
||||
|
||||
Chunk chunk = (Chunk)GameManager.Instance.World.GetChunkFromWorldPos(blockPos);
|
||||
|
||||
BlockValue blockValue;
|
||||
byte rotationNew = 0;
|
||||
byte blockRotation = 1;
|
||||
|
||||
if (blockName == "smalltower")
|
||||
{
|
||||
int initialBlockY = 1;
|
||||
int posX = blockPos.x;
|
||||
int posY = blockPos.y;
|
||||
int posZ = blockPos.z;
|
||||
|
||||
//blockValue = Block.GetBlockValue("FuriousRamsayExplodingBlock:cube", true);
|
||||
blockValue = Block.GetBlockValue("FuriousRamsayExplodingBlock", true);
|
||||
blockValue.Block.blockMaterial = MaterialBlock.fromString("Mbrick");
|
||||
blockValue.Block.MaxDamage = 1200;
|
||||
blockValue.Block.SetSideTextureId(7);
|
||||
blockValue.Block.Properties.Values["Duration"] = duration;
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("brickShapes:cube", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("brickShapes:cube", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 1;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("brickShapes:cube", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("brickShapes:3mTubeCorner", true);
|
||||
blockValue.rotation = 7;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("brickShapes:3mTubeCorner", true);
|
||||
blockValue.rotation = 5;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 3;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 1;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 1;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 1;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 3;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 1;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true);
|
||||
blockValue.rotation = 2;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 1;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 2;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 3;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
DynamicMeshManager.ChunkChanged(blockPos, -1, blockValue.type);
|
||||
}
|
||||
else if (blockName == "smalltowerconcrete")
|
||||
{
|
||||
int initialBlockY = 1;
|
||||
int posX = blockPos.x;
|
||||
int posY = blockPos.y;
|
||||
int posZ = blockPos.z;
|
||||
|
||||
blockValue = Block.GetBlockValue("FuriousRamsayExplodingBlock", true);
|
||||
blockValue.Block.Properties.Values["Duration"] = duration;
|
||||
blockValue.rotation = 0;
|
||||
blockValue.Block.blockMaterial = MaterialBlock.fromString("Mconcrete_shapes");
|
||||
blockValue.Block.MaxDamage = 5000;
|
||||
blockValue.Block.SetSideTextureId(8);
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("concreteShapes:cube", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("concreteShapes:cube", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 1;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("concreteShapes:cube", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("concreteShapes:3mTubeCorner", true);
|
||||
blockValue.rotation = 7;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("concreteShapes:3mTubeCorner", true);
|
||||
blockValue.rotation = 5;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 3;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 1;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 1;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 1;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 3;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:ladderSquare", true);
|
||||
blockValue.rotation = 1;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 2;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true);
|
||||
blockValue.rotation = 2;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1RailSingle", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 0;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 1;
|
||||
posX = blockPos.x + 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 2;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z - 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
blockValue = Block.GetBlockValue("woodShapes:catwalkV1Corner", true);
|
||||
blockValue.rotation = 3;
|
||||
posX = blockPos.x - 1;
|
||||
posY = blockPos.y + initialBlockY + 3;
|
||||
posZ = blockPos.z + 1;
|
||||
rotationNew = blockValue.rotation;
|
||||
RebirthUtilities.ConvertRotatedPosition(1, blockRotation, blockPos.x, blockPos.z, ref posX, ref posZ, ref rotationNew);
|
||||
blockValue.rotation = rotationNew;
|
||||
blockValue = BlockPlaceholderMap.Instance.Replace(blockValue, GameManager.Instance.World.GetGameRandom(), chunk, posX, posY, posZ, FastTags<TagGroup.Global>.none, false);
|
||||
GameManager.Instance.World.SetBlockRPC(chunk.ClrIdx, new Vector3i(posX, posY, posZ), blockValue);
|
||||
|
||||
DynamicMeshManager.ChunkChanged(blockPos, -1, blockValue.type);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "blockname")
|
||||
{
|
||||
blockName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "duration")
|
||||
{
|
||||
duration = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
298
Scripts/MinEvents/MinEventActionSpawnEntityRebirth.cs
Normal file
298
Scripts/MinEvents/MinEventActionSpawnEntityRebirth.cs
Normal file
@@ -0,0 +1,298 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSpawnEntityRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string strEntity = "";
|
||||
private string entityPos = "";
|
||||
private string entityRot = "";
|
||||
private string strDistance = "";
|
||||
private string strHeight = "";
|
||||
private string strSpawner = "";
|
||||
private string strDirection = "random";
|
||||
private string strSound = "";
|
||||
private float numStartScale = 0;
|
||||
private int minion = 0;
|
||||
private int numEntities = 1;
|
||||
private int attackPlayer = 0;
|
||||
private int checkMaxEntities = 0;
|
||||
public int minMax = 40;
|
||||
public int maxEntities = 20;
|
||||
public int repeat = 1;
|
||||
public int allNames = 1;
|
||||
public int atPlayerLevel = 0;
|
||||
public int randomRotation = 1;
|
||||
public int numRotation = -1;
|
||||
public int isBoss = -1;
|
||||
public int handParticle = -1;
|
||||
public string lootListName = "";
|
||||
public string lootDropClass = "";
|
||||
public int lootDropChance = 1;
|
||||
public string navIcon = "";
|
||||
public string buffList = "";
|
||||
public bool forceSpawn = false;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute START");
|
||||
|
||||
/*if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute IS CLIENT");
|
||||
return;
|
||||
}*/
|
||||
|
||||
Vector3 transformPos = MinEventParams.CachedEventParam.Position;
|
||||
|
||||
int numDistance = 0;
|
||||
int numHeight = 0;
|
||||
|
||||
if (strDistance != "")
|
||||
{
|
||||
numDistance = Int16.Parse(strDistance);
|
||||
}
|
||||
|
||||
if (strHeight != "")
|
||||
{
|
||||
numHeight = Int16.Parse(strHeight);
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute numDistance: " + numDistance);
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute numHeight: " + numHeight);
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute this.targets.Count: " + this.targets.Count);
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute entityClassName: " + this.targets[0].EntityClass.entityClassName);
|
||||
|
||||
EntityAlive entity = _params.Self as EntityAlive;
|
||||
EntityAlive entityPlayer = _params.Self as EntityAlive;
|
||||
|
||||
if (targetType == TargetTypes.other)
|
||||
{
|
||||
entity = this.targets[0];
|
||||
}
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute 0");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute entityPlayer: " + entityPlayer.EntityClass.entityClassName);
|
||||
}
|
||||
|
||||
if (checkMaxEntities == 1)
|
||||
{
|
||||
List<Entity> entitiesInBounds = GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityZombieSDX), BoundsUtils.BoundsForMinMax(entity.position.x - this.minMax, entity.position.y - 50, entity.position.z - this.minMax, entity.position.x + this.minMax, entity.position.y + 30, entity.position.z + this.minMax), new List<Entity>());
|
||||
List<Entity> entitiesInBounds2 = GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityZombieCopRebirth), BoundsUtils.BoundsForMinMax(entity.position.x - this.minMax, entity.position.y - 50, entity.position.z - this.minMax, entity.position.x + this.minMax, entity.position.y + 30, entity.position.z + this.minMax), new List<Entity>());
|
||||
|
||||
int numEntities = 0;
|
||||
|
||||
List<Entity> entities = new List<Entity>();
|
||||
|
||||
foreach (Entity validateEntity in entitiesInBounds)
|
||||
{
|
||||
if (validateEntity != null && !validateEntity.IsDead())
|
||||
{
|
||||
entities.Add(validateEntity);
|
||||
}
|
||||
}
|
||||
foreach (Entity validateEntity in entitiesInBounds2)
|
||||
{
|
||||
if (validateEntity != null && !validateEntity.IsDead() && !entities.Contains(validateEntity))
|
||||
{
|
||||
entities.Add(validateEntity);
|
||||
}
|
||||
}
|
||||
foreach (Entity validateEntity in entities)
|
||||
{
|
||||
numEntities++;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute entitiesInBounds.Count: " + (entitiesInBounds.Count + entitiesInBounds2.Count));
|
||||
if (numEntities > this.maxEntities)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool shouldAttackPlayer = false;
|
||||
|
||||
if (attackPlayer == 1)
|
||||
{
|
||||
shouldAttackPlayer = true;
|
||||
}
|
||||
|
||||
bool spawnAtPlayerLevel = false;
|
||||
|
||||
if (atPlayerLevel == 1)
|
||||
{
|
||||
spawnAtPlayerLevel = true;
|
||||
}
|
||||
|
||||
bool spawnAtRandomRotation = true;
|
||||
|
||||
if (randomRotation == 0)
|
||||
{
|
||||
spawnAtRandomRotation = false;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute entity: " + entity.EntityClass.entityClassName);
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute strDistance: " + strDistance);
|
||||
|
||||
//Log.Out("MinEventActionSpawnEntityRebirth-Execute entityPlayer.entityId: " + entityPlayer.entityId);
|
||||
|
||||
RebirthUtilities.SpawnEntity(entity.entityId, strEntity, numEntities, entityPos, entityRot, strDistance, strSpawner, strHeight, strDirection, numStartScale, numRotation, spawnAtRandomRotation, spawnAtPlayerLevel, shouldAttackPlayer, entityPlayer.entityId, minion, strSound, maxEntities, checkMaxEntities, minMax, repeat, allNames, isBoss, handParticle, lootListName, lootDropClass, lootDropChance, navIcon, buffList, false, forceSpawn);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "entityname")
|
||||
{
|
||||
strEntity = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "numEntities")
|
||||
{
|
||||
numEntities = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "StartScale")
|
||||
{
|
||||
float.TryParse(_attribute.Value, out numStartScale);
|
||||
return true;
|
||||
}
|
||||
else if (name == "distance")
|
||||
{
|
||||
strDistance = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "height")
|
||||
{
|
||||
strHeight = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "spawner")
|
||||
{
|
||||
strSpawner = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "direction")
|
||||
{
|
||||
strDirection = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "sound")
|
||||
{
|
||||
strSound = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "minion")
|
||||
{
|
||||
minion = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "checkMaxEntities")
|
||||
{
|
||||
checkMaxEntities = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "minMax")
|
||||
{
|
||||
minMax = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "maxEntities")
|
||||
{
|
||||
maxEntities = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "attackPlayer")
|
||||
{
|
||||
attackPlayer = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "repeat")
|
||||
{
|
||||
repeat = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "allNames")
|
||||
{
|
||||
allNames = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "atplayerlevel")
|
||||
{
|
||||
atPlayerLevel = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "rotation")
|
||||
{
|
||||
numRotation = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "randomRotation")
|
||||
{
|
||||
randomRotation = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "isBoss")
|
||||
{
|
||||
isBoss = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "handParticle")
|
||||
{
|
||||
handParticle = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "lootListName")
|
||||
{
|
||||
lootListName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "lootDropClass")
|
||||
{
|
||||
lootDropClass = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "lootDropChance")
|
||||
{
|
||||
lootDropChance = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "navIcon")
|
||||
{
|
||||
navIcon = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "buffList")
|
||||
{
|
||||
buffList = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "forceSpawn")
|
||||
{
|
||||
if (_attribute.Value == "true")
|
||||
{
|
||||
forceSpawn = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/MinEvents/MinEventActionStopMusic.cs
Normal file
39
Scripts/MinEvents/MinEventActionStopMusic.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
public class MinEventActionStopMusic : MinEventActionRemoveBuff
|
||||
{
|
||||
private int numItems = 1;
|
||||
private int numLocation = 0;
|
||||
private int numQuality = 0;
|
||||
private string itemName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionStopMusic-Execute START");
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionStopMusic-Execute IS SERVER");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionStopMusic-Execute IS CLIENT");
|
||||
|
||||
EntityPlayerLocal player = _params.Self as EntityPlayerLocal;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
//Log.Out("MinEventActionStopMusic-Execute NO Player");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionStopMusic-Execute player.AttachedToEntity: " + player.AttachedToEntity);
|
||||
//Log.Out("MinEventActionStopMusic-Execute HAS WALKMAN MOD: " + RebirthUtilities.HasMod(player, "FuriousRamsayWalkmanMod"));
|
||||
|
||||
if (RebirthUtilities.HasMod(player, "FuriousRamsayWalkmanMod"))
|
||||
{
|
||||
//Log.Out("MinEventActionStopMusic-Execute HAS WALKMAN MOD");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionStopMusic-Execute STOP MUSIC");
|
||||
RebirthVariables.musicMode = 0;
|
||||
}
|
||||
}
|
||||
16
Scripts/MinEvents/MinEventActionTargetResetSDX.cs
Normal file
16
Scripts/MinEvents/MinEventActionTargetResetSDX.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
public class MinEventActionTargetResetSDX : MinEventActionRemoveBuff
|
||||
{
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
for (var i = 0; i < targets.Count; i++)
|
||||
{
|
||||
var entity = targets[i];
|
||||
if (entity != null)
|
||||
{
|
||||
entity.attackTarget = (EntityAlive) null;
|
||||
entity.SetRevengeTarget((EntityAlive) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
56
Scripts/MinEvents/MinEventActionTimerNavSDX.cs
Normal file
56
Scripts/MinEvents/MinEventActionTimerNavSDX.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
// <triggered_effect trigger = "onSelfBuffUpdate" action="TimerNavSDX, RebirthUtils" />
|
||||
public class MinEventActionTimerNavSDX : MinEventActionTargetedBase
|
||||
{
|
||||
private string NavObjectName = "";
|
||||
private int TimerLength = 0;
|
||||
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
|
||||
var entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (NavObjectName != "")
|
||||
{
|
||||
if (entity.NavObject == null)
|
||||
{
|
||||
NavObjectClass navObjectClass = NavObjectClass.GetNavObjectClass(NavObjectName);
|
||||
entity.NavObject.AddNavObjectClass(navObjectClass);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "NavObjectName")
|
||||
{
|
||||
NavObjectName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "TimerLength")
|
||||
{
|
||||
TimerLength = (int)StringParsers.ParseFloat(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
88
Scripts/MinEvents/MinEventActionTriggerRageAuras.cs
Normal file
88
Scripts/MinEvents/MinEventActionTriggerRageAuras.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class MinEventActionTriggerRageAuras : MinEventActionBuffModifierBase
|
||||
{
|
||||
string strTriggerAction = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionTriggerRageAuras-Execute 1");
|
||||
bool flag = !_params.Self.isEntityRemote | _params.IsLocal;
|
||||
int num = -1;
|
||||
if (_params.Buff != null)
|
||||
{
|
||||
//Log.Out("MinEventActionTriggerRageAuras-Execute 2");
|
||||
num = _params.Buff.InstigatorId;
|
||||
}
|
||||
if (num == -1)
|
||||
{
|
||||
//Log.Out("MinEventActionTriggerRageAuras-Execute 3");
|
||||
num = _params.Self.entityId;
|
||||
}
|
||||
|
||||
if (strTriggerAction == "self")
|
||||
{
|
||||
for (int i = 0; i < this.targets.Count; i++)
|
||||
{
|
||||
//Log.Out("MinEventActionTriggerRageAuras-Execute i: " + i);
|
||||
RebirthUtilities.SetAuraChance(ItemClass.GetItem("meleeWpnBladeT0BoneKnife", false), "meleeWpnBladeT0BoneKnife", _params.Buff.InstigatorId, _params.Self.Buffs.GetCustomVar("$ActiveClass_FR"), this.targets[i].entityId, true, true, -1, true, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)_params.Self;
|
||||
|
||||
if (player.Party != null)
|
||||
{
|
||||
if (player.Party.MemberList != null)
|
||||
{
|
||||
string optionAuraRange = RebirthVariables.customAuraRange;
|
||||
|
||||
for (int j = 0; j < player.Party.MemberList.Count; j++)
|
||||
{
|
||||
EntityPlayer partyMember = player.Party.MemberList[j] as EntityPlayer;
|
||||
|
||||
bool isWithinRange = Vector3.Distance(partyMember.position, player.position) < (float)GameStats.GetInt(EnumGameStats.PartySharedKillRange);
|
||||
|
||||
if (optionAuraRange == "always")
|
||||
{
|
||||
isWithinRange = true;
|
||||
}
|
||||
else if (optionAuraRange == "never")
|
||||
{
|
||||
isWithinRange = false;
|
||||
}
|
||||
|
||||
if (partyMember.entityId != player.entityId && isWithinRange)
|
||||
{
|
||||
partyMember.Buffs.AddBuff("FuriousRamsayFullAura");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "triggeraction")
|
||||
{
|
||||
strTriggerAction = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
84
Scripts/MinEvents/MinEventActionTriggerSkill.cs
Normal file
84
Scripts/MinEvents/MinEventActionTriggerSkill.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionTriggerSkill : MinEventActionRemoveBuff
|
||||
{
|
||||
private string type = "";
|
||||
private string strEntity = "";
|
||||
private string entityPos = "";
|
||||
private string entityRot = "";
|
||||
private string strDistance = "";
|
||||
private string strHeight = "";
|
||||
private string strSpawner = "";
|
||||
private string strDirection = "random";
|
||||
private string strSound = "";
|
||||
private float numStartScale = 0;
|
||||
private int minion = 0;
|
||||
private int numEntities = 1;
|
||||
private int attackPlayer = 0;
|
||||
private int checkMaxEntities = 0;
|
||||
public int minMax = 40;
|
||||
public int maxEntities = 20;
|
||||
public int repeat = 1;
|
||||
public int allNames = 1;
|
||||
public int atPlayerLevel = 0;
|
||||
public int randomRotation = 1;
|
||||
public int numRotation = -1;
|
||||
public int isBoss = -1;
|
||||
public int handParticle = -1;
|
||||
public string lootListName = "";
|
||||
public string lootDropClass = "";
|
||||
public int lootDropChance = 1;
|
||||
public string navIcon = "";
|
||||
public string buffList = "";
|
||||
public bool forceSpawn = false;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionTriggerSkill-Execute START");
|
||||
|
||||
/*if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
//Log.Out("MinEventActionTriggerSkill-Execute IS CLIENT");
|
||||
return;
|
||||
}*/
|
||||
|
||||
EntityAlive entity = _params.Self as EntityAlive;
|
||||
EntityAlive entityPlayer = _params.Self as EntityAlive;
|
||||
|
||||
if (targetType == TargetTypes.other)
|
||||
{
|
||||
entity = this.targets[0];
|
||||
}
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == "offensiverage")
|
||||
{
|
||||
RebirthUtilities.TriggerOffensiveRage(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "type")
|
||||
{
|
||||
type = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionUpdateLocalVariablesRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
protected int replaceVariables = 0;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var entity = _params.Self as EntityAlive;
|
||||
|
||||
if (entity is EntityPlayerLocal)
|
||||
{
|
||||
EntityPlayerLocal ___entityPlayerLocal = (EntityPlayerLocal)entity;
|
||||
|
||||
GameManager.Instance.StartCoroutine(RebirthVariables.UpdateLocalVariables(___entityPlayerLocal, this.replaceVariables));
|
||||
GameManager.Instance.StartCoroutine(RebirthUtilities.UpdateActiveClasses(___entityPlayerLocal));
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "replaceVariables")
|
||||
{
|
||||
this.replaceVariables = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionViewStructuralIntegrityRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private int numActive = 0;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionViewStructuralIntegrityRebirth-Execute START");
|
||||
|
||||
if (GameManager.IsDedicatedServer)
|
||||
{
|
||||
//Log.Out("MinEventActionViewStructuralIntegrityRebirth-Execute IS CLIENT");
|
||||
return;
|
||||
}
|
||||
|
||||
var entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionViewStructuralIntegrityRebirth-Execute 0");
|
||||
return;
|
||||
}
|
||||
|
||||
if (numActive == 1)
|
||||
{
|
||||
MeshDescription.SetDebugStabilityShader(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MeshDescription.SetDebugStabilityShader(false);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "active")
|
||||
{
|
||||
numActive = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
104
Scripts/MinEvents/NPCs/MinEventActionChangeWeaponRebirth.cs
Normal file
104
Scripts/MinEvents/NPCs/MinEventActionChangeWeaponRebirth.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionChangeWeaponRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private string itemName = "";
|
||||
private string jointName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var theEntity = _params.Self as EntityNPCRebirth;
|
||||
|
||||
int i = 0;
|
||||
|
||||
Transform transform = theEntity.RootTransform.FindInChilds(theEntity.GetRightHandTransformName(), true);
|
||||
|
||||
float currentX = transform.localPosition.x;
|
||||
float currentY = transform.localPosition.y;
|
||||
float currentZ = transform.localPosition.z;
|
||||
|
||||
float newX = 0;
|
||||
float newY = 0;
|
||||
float newZ = 0;
|
||||
|
||||
//Log.Out("TRANSFORM Local Position X: " + transform.localPosition.x);
|
||||
//Log.Out("TRANSFORM Local Position Y: " + transform.localPosition.y);
|
||||
//Log.Out("TRANSFORM Local Position Z: " + transform.localPosition.z);
|
||||
//Log.Out("TRANSFORM GameObject Name: " + transform.gameObject.name);
|
||||
|
||||
foreach (string text in itemName.Split(new char[]
|
||||
{
|
||||
','
|
||||
}))
|
||||
{
|
||||
ItemStack itemStack = ItemStack.FromString(text.Trim());
|
||||
|
||||
var forId = ItemClass.GetForId(itemStack.itemValue.type);
|
||||
|
||||
if (forId.HasQuality)
|
||||
{
|
||||
itemStack.itemValue = new ItemValue(itemStack.itemValue.type, 1, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStack.count = forId.Stacknumber.Value;
|
||||
}
|
||||
|
||||
//Log.Out("Item Name: " + text.Trim());
|
||||
if (i == 0)
|
||||
{
|
||||
Transform transform2 = theEntity.RootTransform.FindInChilds(jointName, true);
|
||||
|
||||
newX = transform2.localPosition.x;
|
||||
newX = transform2.localPosition.y;
|
||||
newX = transform2.localPosition.z;
|
||||
|
||||
newX = newX - currentX;
|
||||
newY = newY - currentY;
|
||||
newZ = newZ - currentZ;
|
||||
|
||||
//Log.Out("Joint Name: " + jointName);
|
||||
theEntity.rightHandTransformName = jointName;
|
||||
theEntity.emodel.SetInRightHand(transform2);
|
||||
|
||||
//Log.Out("TRANSFORM2 Local Position X: " + transform2.localPosition.x);
|
||||
//Log.Out("TRANSFORM2 Local Position Y: " + transform2.localPosition.y);
|
||||
//Log.Out("TRANSFORM2 Local Position Z: " + transform2.localPosition.z);
|
||||
//Log.Out("TRANSFORM2 GameObject Name: " + transform2.gameObject.name);
|
||||
}
|
||||
|
||||
theEntity.inventory.SetItem(i, itemStack);
|
||||
i++;
|
||||
}
|
||||
|
||||
theEntity.inventory.ForceHoldingItemUpdate();
|
||||
|
||||
//Log.Out("NEW TRANSFORM NAME: " + theEntity.GetRightHandTransformName());
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "itemName")
|
||||
{
|
||||
itemName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "jointName")
|
||||
{
|
||||
jointName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
98
Scripts/MinEvents/NPCs/MinEventActionGiveNPCItemRebirth.cs
Normal file
98
Scripts/MinEvents/NPCs/MinEventActionGiveNPCItemRebirth.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using Audio;
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionGiveNPCItemRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
private int numItems = 1;
|
||||
private string strNumItems = "";
|
||||
private int numMining = 0;
|
||||
private string itemName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var entity = _params.Self as EntityNPCRebirth;
|
||||
|
||||
ItemValue item = ItemClass.GetItem(itemName, false);
|
||||
ItemValue itemValue = new ItemValue(ItemClass.GetItem(itemName, false).type, true);
|
||||
|
||||
if (strNumItems.Contains("-"))
|
||||
{
|
||||
string[] array = strNumItems.Split(new char[]
|
||||
{
|
||||
'-'
|
||||
});
|
||||
int min = StringParsers.ParseSInt32(array[0], 0, -1, NumberStyles.Integer);
|
||||
int maxExclusive = StringParsers.ParseSInt32(array[1], 0, -1, NumberStyles.Integer) + 1;
|
||||
numItems = Manager.random.RandomRange(min, maxExclusive);
|
||||
}
|
||||
else
|
||||
{
|
||||
numItems = StringParsers.ParseSInt32(strNumItems, 0, -1, NumberStyles.Integer);
|
||||
}
|
||||
|
||||
int num = numItems;
|
||||
|
||||
if (itemValue.HasQuality)
|
||||
{
|
||||
itemValue = new ItemValue(item.type, num, num, true, null, 1f);
|
||||
num = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemValue = new ItemValue(item.type, true);
|
||||
}
|
||||
|
||||
if (numMining > 0)
|
||||
{
|
||||
float flNPCMiningLevel = entity.Buffs.GetCustomVar("$FR_NPC_MiningLevel");
|
||||
|
||||
num = (int)((1 + (flNPCMiningLevel / 5)) * num);
|
||||
}
|
||||
|
||||
if (entity.lootContainer != null)
|
||||
{
|
||||
//Log.Out("MinEventActionGiveNPCItemRebirth-Execute Item Nalue: " + itemValue.ItemClass.GetItemName());
|
||||
ValueTuple<bool, bool> tryStack = entity.lootContainer.TryStackItem(0, new ItemStack(itemValue, num));
|
||||
|
||||
if (!tryStack.Item1)
|
||||
{
|
||||
if (!entity.lootContainer.AddItem(new ItemStack(itemValue, num)))
|
||||
{
|
||||
entity.world.gameManager.ItemDropServer(new ItemStack(itemValue, num), entity.GetPosition(), Vector3.zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "numMining")
|
||||
{
|
||||
numMining = numItems = StringParsers.ParseSInt32(_attribute.Value, 0, -1, NumberStyles.Integer);
|
||||
return true;
|
||||
}
|
||||
else if (name == "numItems")
|
||||
{
|
||||
strNumItems = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "itemName")
|
||||
{
|
||||
itemName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/MinEvents/NPCs/MinEventActionGiveOrder.cs
Normal file
33
Scripts/MinEvents/NPCs/MinEventActionGiveOrder.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionGiveOrder : MinEventActionTargetedBase
|
||||
{
|
||||
private int order;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityAliveV2 entity = _params.Self as EntityAliveV2;
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionGiveOrder-Execute order: " + order);
|
||||
entity.Buffs.SetCustomVar("CurrentOrder", order);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
var name = _attribute.Name;
|
||||
if (name != null)
|
||||
if (name == "order")
|
||||
this.order = int.Parse((_attribute.Value));
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
14
Scripts/MinEvents/NPCs/MinEventActionGuardHereRebirth.cs
Normal file
14
Scripts/MinEvents/NPCs/MinEventActionGuardHereRebirth.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
public class MinEventActionGuardHereRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityNPCRebirth entityAlive = _params.Self as EntityNPCRebirth;
|
||||
if (entityAlive == null) return;
|
||||
|
||||
if (entityAlive.LeaderUtils.Owner == null) return;
|
||||
|
||||
entityAlive.guardPosition = entityAlive.LeaderUtils.Owner.position;
|
||||
entityAlive.bWillRespawn = true;
|
||||
entityAlive.guardLookPosition = entityAlive.LeaderUtils.Owner.position + entityAlive.LeaderUtils.Owner.GetForwardVector();
|
||||
}
|
||||
}
|
||||
12
Scripts/MinEvents/NPCs/MinEventActionGuardThereRebirth.cs
Normal file
12
Scripts/MinEvents/NPCs/MinEventActionGuardThereRebirth.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
public class MinEventActionGuardThereRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
EntityNPCRebirth entityAlive = _params.Self as EntityNPCRebirth;
|
||||
if (entityAlive == null) return;
|
||||
|
||||
entityAlive.guardPosition = _params.Self.position;
|
||||
entityAlive.bWillRespawn = true;
|
||||
entityAlive.guardLookPosition = _params.Self.position + _params.Self.GetLookVector();
|
||||
}
|
||||
}
|
||||
53
Scripts/MinEvents/NPCs/MinEventActionHideNPCRebirth.cs
Normal file
53
Scripts/MinEvents/NPCs/MinEventActionHideNPCRebirth.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionHideNPCRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
private bool hide;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var entity = _params.Self as EntityNPCRebirth;
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float flHidden = entity.Buffs.GetCustomVar("$FR_NPC_Hidden");
|
||||
|
||||
//Log.Out("MinEventActionHideNPCRebirth-Execute flHidden: " + flHidden);
|
||||
|
||||
if (hide)
|
||||
{
|
||||
//Log.Out("MinEventActionHideNPCRebirth-Execute HIDE 1");
|
||||
if (flHidden == 0)
|
||||
{
|
||||
//Log.Out("MinEventActionHideNPCRebirth-Execute HIDE 2");
|
||||
entity.HideNPC(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionHideNPCRebirth-Execute SHOW 1");
|
||||
if (flHidden == 1)
|
||||
{
|
||||
//Log.Out("MinEventActionHideNPCRebirth-Execute SHOW 2");
|
||||
entity.HideNPC(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
var name = _attribute.Name;
|
||||
if (name != null)
|
||||
if (name == "hide")
|
||||
hide = StringParsers.ParseBool(_attribute.Value);
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
60
Scripts/MinEvents/NPCs/MinEventActionNPCGiveItemRebirth.cs
Normal file
60
Scripts/MinEvents/NPCs/MinEventActionNPCGiveItemRebirth.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionNPCGiveItemRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
private int numItems = 1;
|
||||
private string itemName = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
var myEntity = _params.Self as EntityAlive;
|
||||
if (myEntity == null)
|
||||
return;
|
||||
|
||||
if (myEntity.Buffs.HasBuff("FuriousRamsayNPCSilencer"))
|
||||
{
|
||||
EntityPlayerLocal player = myEntity.world.GetPrimaryPlayer();
|
||||
|
||||
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
|
||||
var playerInventory = uiforPlayer.xui.PlayerInventory;
|
||||
if (playerInventory == null) return;
|
||||
|
||||
var item = ItemClass.GetItem(itemName);
|
||||
if (item == null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCGiveItemRebirth: Item Not Found: " + ID);
|
||||
return;
|
||||
}
|
||||
var itemStack = new ItemStack(item, numItems);
|
||||
if (!playerInventory.AddItem(itemStack, true))
|
||||
player.world.gameManager.ItemDropServer(itemStack, player.GetPosition(), Vector3.zero);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "numItems")
|
||||
{
|
||||
numItems = Int32.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else if (name == "itemName")
|
||||
{
|
||||
itemName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
314
Scripts/MinEvents/NPCs/MinEventActionNPCSoundTrigger.cs
Normal file
314
Scripts/MinEvents/NPCs/MinEventActionNPCSoundTrigger.cs
Normal file
@@ -0,0 +1,314 @@
|
||||
using Audio;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionNPCSoundTrigger : MinEventActionBuffModifierBase
|
||||
{
|
||||
string strAction = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute strAction: " + strAction);
|
||||
|
||||
if (_params.Self is EntityNPCRebirth)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 1");
|
||||
EntityNPCRebirth npc = (EntityNPCRebirth)_params.Self;
|
||||
|
||||
if (npc != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute npc: " + npc.EntityClass.entityClassName);
|
||||
|
||||
if (this.targets[0] != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 2");
|
||||
if (strAction == "onOtherAttackedSelf")
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3");
|
||||
|
||||
if (this.targets[0].HasAllTags(FastTags<TagGroup.Global>.Parse("bandit,ranged")) &&
|
||||
!npc.Buffs.HasBuff("FuriousRamsayNPCCanSeeTarget") &&
|
||||
!npc.Buffs.HasBuff("FuriousRamsayNPCOtherDamagedSelf")
|
||||
)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3a");
|
||||
npc.Buffs.AddBuff("FuriousRamsayNPCOtherAttackedSelf");
|
||||
|
||||
List<string> myTags = npc.EntityTags.GetTagNames();
|
||||
List<string> myRandomSounds = new List<string>();
|
||||
|
||||
foreach (string tag in myTags)
|
||||
{
|
||||
if (tag.Contains("-OAS-"))
|
||||
{
|
||||
myRandomSounds.Add(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (myRandomSounds.Count > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3b");
|
||||
int index = UnityEngine.Random.Range(0, myRandomSounds.Count - 1);
|
||||
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3c");
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3f");
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strAction == "onOtherDamagedSelf")
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4");
|
||||
|
||||
if (this.targets[0].HasAllTags(FastTags<TagGroup.Global>.Parse("bandit,ranged")) &&
|
||||
!npc.Buffs.HasBuff("FuriousRamsayNPCCanSeeTarget") &&
|
||||
!npc.Buffs.HasBuff("FuriousRamsayNPCOtherAttackedSelf") &&
|
||||
!npc.Buffs.HasBuff("FuriousRamsayNPCOtherDamagedSelf")
|
||||
)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4a");
|
||||
npc.Buffs.AddBuff("FuriousRamsayNPCOtherDamagedSelf");
|
||||
|
||||
List<string> myTags = npc.EntityTags.GetTagNames();
|
||||
List<string> myRandomSounds = new List<string>();
|
||||
|
||||
foreach (string tag in myTags)
|
||||
{
|
||||
if (tag.Contains("-ODS-"))
|
||||
{
|
||||
myRandomSounds.Add(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (myRandomSounds.Count > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4b");
|
||||
int index = UnityEngine.Random.Range(0, myRandomSounds.Count - 1);
|
||||
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4c");
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
//Manager.BroadcastPlay(leader.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 4f");
|
||||
//var leader = EntityUtilities.GetLeaderOrOwner(npc.entityId) as EntityAlive;
|
||||
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (strAction == "onSelfKilledOther" && !RebirthUtilities.IsHordeNight())
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5");
|
||||
|
||||
if (!npc.Buffs.HasBuff("FuriousRamsayNPCCanSeeTarget") &&
|
||||
!npc.Buffs.HasBuff("FuriousRamsayNPCSelfKilledOther")
|
||||
)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5a");
|
||||
npc.Buffs.AddBuff("FuriousRamsayNPCSelfKilledOther");
|
||||
npc.Buffs.AddBuff("FuriousRamsayNPCSelfKilledOtherKillingSpree");
|
||||
|
||||
List<string> myTags = npc.EntityTags.GetTagNames();
|
||||
List<string> myRandomSounds = new List<string>();
|
||||
|
||||
foreach (string tag in myTags)
|
||||
{
|
||||
if (tag.Contains("-SKOD-"))
|
||||
{
|
||||
myRandomSounds.Add(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (myRandomSounds.Count > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5b");
|
||||
int index = UnityEngine.Random.Range(0, myRandomSounds.Count - 1);
|
||||
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5c");
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 5f");
|
||||
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (strAction == "killingSpree")
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6");
|
||||
|
||||
if (!npc.Buffs.HasBuff("FuriousRamsayNPCCanSeeTarget") &&
|
||||
!(npc.Buffs.HasBuff("FuriousRamsayNPCKillingSpree") || npc.Buffs.HasBuff("FuriousRamsayNPCKillingSpreeHN") || npc.Buffs.HasBuff("FuriousRamsayNPCSelfKilledOtherKillingSpree"))
|
||||
)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6a");
|
||||
|
||||
npc.killingSpree = npc.killingSpree + 1;
|
||||
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute npc.killingSpree: " + npc.killingSpree);
|
||||
|
||||
if (npc.killingSpree < 3)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6a1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (RebirthUtilities.IsHordeNight())
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6a2");
|
||||
npc.Buffs.AddBuff("FuriousRamsayNPCKillingSpreeHN");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6a3");
|
||||
npc.Buffs.AddBuff("FuriousRamsayNPCKillingSpree");
|
||||
}
|
||||
|
||||
List<string> myTags = npc.EntityTags.GetTagNames();
|
||||
List<string> myRandomSounds = new List<string>();
|
||||
|
||||
foreach (string tag in myTags)
|
||||
{
|
||||
if (tag.Contains("-KS-"))
|
||||
{
|
||||
myRandomSounds.Add(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (myRandomSounds.Count > 0)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6b");
|
||||
int index = UnityEngine.Random.Range(0, myRandomSounds.Count - 1);
|
||||
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6c");
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 6f");
|
||||
if (npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3d");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionNPCSoundTrigger-Execute 3e");
|
||||
Manager.BroadcastPlay(npc.position, myRandomSounds[index], 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
npc.killingSpree = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "NPCAction")
|
||||
{
|
||||
strAction = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
90
Scripts/MinEvents/NPCs/MinEventActionRespawnEntity.cs
Normal file
90
Scripts/MinEvents/NPCs/MinEventActionRespawnEntity.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
public class MinEventActionRespawnEntity : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute START");
|
||||
|
||||
if (!GameManager.IsDedicatedServer)
|
||||
{
|
||||
EntityNPCRebirth entity = _params.Self as EntityNPCRebirth;
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute Entity: " + entity.EntityName);
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity.LeaderUtils.Owner)
|
||||
{
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute flLeader: " + flLeader);
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute 3");
|
||||
float flX = 0; //entity.Buffs.GetCustomVar("$FR_NPC_RespawnX");
|
||||
float flY = 0; //entity.Buffs.GetCustomVar("$FR_NPC_RespawnY");
|
||||
float flZ = 0; //entity.Buffs.GetCustomVar("$FR_NPC_RespawnZ");
|
||||
float flRotY = 0; //entity.Buffs.GetCustomVar("$FR_NPC_RespawnRotY");
|
||||
|
||||
foreach (RebirthManager.hireInfo hire in RebirthManager.playerHires)
|
||||
{
|
||||
if (hire.hireID == entity.entityId)
|
||||
{
|
||||
flX = hire.reSpawnPosition.x;
|
||||
flY = hire.reSpawnPosition.y;
|
||||
flZ = hire.reSpawnPosition.z;
|
||||
flRotY = hire.reSpawnRotation.y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute X: " + flX);
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute Y: " + flY);
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute Z: " + flZ);
|
||||
|
||||
if (flX != 0 && flY != 0 && flZ != 0)
|
||||
{
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute 4");
|
||||
Vector3 vector = new Vector3(flX, flY, flZ);
|
||||
|
||||
if (entity.PhysicsTransform != null)
|
||||
{
|
||||
entity.PhysicsTransform.gameObject.layer = 15;
|
||||
}
|
||||
entity.emodel.SetAlive();
|
||||
|
||||
entity.motion = Vector3.zero;
|
||||
entity.navigator?.clearPath();
|
||||
entity.moveHelper?.Stop();
|
||||
entity.speedForward = 0;
|
||||
entity.speedStrafe = 0;
|
||||
//entity.motion = Vector3.zero;
|
||||
//entity.navigator?.clearPath();
|
||||
entity.LeaderUtils.IsTeleporting = true;
|
||||
entity.isHirable = false;
|
||||
entity.SetPosition(vector, true);
|
||||
entity.rotation.y = flRotY;
|
||||
entity.ClearDamagedTarget();
|
||||
entity.ClearStun();
|
||||
entity.numReposition = 1;
|
||||
|
||||
entity.LeaderUtils.IsTeleporting = false;
|
||||
|
||||
entity.Buffs.AddBuff("FuriousRamsayDeathParticle");
|
||||
|
||||
entity.Buffs.SetCustomVar("$FR_NPC_RespawnCommandActivation", 0);
|
||||
////Log.Out("MinEventActionRespawnEntity-Execute EntityID: " + entity.entityId);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute 5");
|
||||
entity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(entity.entityId, EnumRemoveEntityReason.Unloaded);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionRespawnEntity-Execute 7");
|
||||
entity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(entity.entityId, EnumRemoveEntityReason.Unloaded);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/MinEvents/NPCs/MinEventActionReturnNPCFromRebirth.cs
Normal file
81
Scripts/MinEvents/NPCs/MinEventActionReturnNPCFromRebirth.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionReturnNPCFromRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
private bool hide;
|
||||
private string task = "";
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute");
|
||||
|
||||
switch (task)
|
||||
{
|
||||
case null:
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 1");
|
||||
return;
|
||||
case "mine":
|
||||
{
|
||||
var entity = _params.Self as EntityNPCRebirth;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 2");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 3");
|
||||
entity.bMine = false;
|
||||
entity.HideNPC(false);
|
||||
return;
|
||||
}
|
||||
case "repair":
|
||||
{
|
||||
var entity = _params.Self as EntityPlayerLocal;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 4");
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 5");
|
||||
|
||||
float flRepairNPCID = entity.Buffs.GetCustomVar("$FR_NPC_Repair");
|
||||
//Log.Out("$varFuriousRamsayHelpRepairNPC: " + flRepairNPCID);
|
||||
|
||||
var myNPC = entity.world.GetEntity((int)flRepairNPCID) as EntityNPCRebirth;
|
||||
if (myNPC)
|
||||
{
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 6");
|
||||
myNPC.bRepair = false;
|
||||
myNPC.HideNPC(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
default:
|
||||
//Log.Out("MinEventActionReturnNPCFromRebirth-Execute 5");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "task")
|
||||
{
|
||||
task = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
76
Scripts/MinEvents/NPCs/MinEventActionSendNPCForRebirth.cs
Normal file
76
Scripts/MinEvents/NPCs/MinEventActionSendNPCForRebirth.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MinEventActionSendNPCForRebirth : MinEventActionTargetedBase
|
||||
{
|
||||
private bool hide;
|
||||
private string task = "";
|
||||
private float duration = 600;
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute START");
|
||||
|
||||
var entity = _params.Self as EntityNPCRebirth;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (task)
|
||||
{
|
||||
case null:
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute 2");
|
||||
return;
|
||||
case "mine":
|
||||
{
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute 3");
|
||||
entity.GameTimerTicks = GameTimer.Instance.ticks;
|
||||
entity.HideDuration = ((int)GameManager.Instance.World.worldTime / GameStats.GetInt(EnumGameStats.TimeOfDayIncPerSec)) + duration;
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute entity.HideDuration: " + entity.HideDuration);
|
||||
entity.bMine = true;
|
||||
entity.HideNPC(true);
|
||||
return;
|
||||
}
|
||||
case "repair":
|
||||
{
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute 4");
|
||||
entity.GameTimerTicks = GameTimer.Instance.ticks;
|
||||
entity.HideDuration = ((int)GameManager.Instance.World.worldTime / GameStats.GetInt(EnumGameStats.TimeOfDayIncPerSec)) + duration;
|
||||
entity.bRepair = true;
|
||||
entity.HideNPC(true);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-Execute 5");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXmlAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "task")
|
||||
{
|
||||
task = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (name == "duration")
|
||||
{
|
||||
duration = float.Parse(_attribute.Value); //Convert.ToUInt64(_attribute.Value) * 20UL;
|
||||
//Log.Out("MinEventActionSendNPCForRebirth-ParseXmlAttribute duration: " + duration);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Scripts/MinEvents/NPCs/MinEventActionSetPositionRebirth.cs
Normal file
21
Scripts/MinEvents/NPCs/MinEventActionSetPositionRebirth.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
public class MinEventActionSetPositionRebirth : MinEventActionRemoveBuff
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
for (var i = 0; i < targets.Count; i++)
|
||||
{
|
||||
var entity = targets[i];
|
||||
if (entity != null)
|
||||
{
|
||||
foreach (RebirthManager.hireInfo hire in RebirthManager.playerHires)
|
||||
{
|
||||
if (hire.hireID == entity.entityId)
|
||||
{
|
||||
hire.reSpawnPosition = entity.position;
|
||||
hire.reSpawnRotation = entity.rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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