public void SetAlwaysWalk(NwCreature creature, bool forceWalk)
        {
            CNWSCreature         nativeCreature = creature.Creature;
            InternalVariableBool alwaysWalk     = InternalVariables.AlwaysWalk(creature);

            if (forceWalk)
            {
                nativeCreature.m_bForcedWalk = true.ToInt();
                alwaysWalk.Value             = true;
            }
            else
            {
                alwaysWalk.Delete();

                if (creature.ActiveEffects.Any(activeEffect => activeEffect.EffectType == EffectType.MovementSpeedDecrease))
                {
                    return;
                }

                if (!nativeCreature.m_bForcedWalk.ToBool())
                {
                    nativeCreature.UpdateEncumbranceState(false.ToInt());
                    nativeCreature.m_bForcedWalk = (nativeCreature.m_nEncumbranceState != 0).ToInt();
                }

                nativeCreature.m_bForcedWalk = false.ToInt();
            }
        }
        /// <summary>
        /// Gets the override that is set for the creature's damage level.<br/>
        /// </summary>
        public DamageLevelEntry?GetDamageLevelOverride(NwCreature creature)
        {
            InternalVariableInt damageLevelOverride = InternalVariables.DamageLevelOverride(creature);

            if (damageLevelOverride.HasValue)
            {
                return(NwGameTables.DamageLevelTable[damageLevelOverride.Value]);
            }

            return(null);
        }
        private int OnRemoveLimitMovementSpeed(void *pEffectListHandler, void *pObject, void *pEffect)
        {
            NwObject?nwObject = CNWSObject.FromPointer(pObject).ToNwObject();

            if (nwObject != null && InternalVariables.AlwaysWalk(nwObject))
            {
                return(1);
            }

            return(removeLimitMovementSpeedHook.CallOriginal(pEffectListHandler, pObject, pEffect));
        }
        private float OnGetWalkRate(void *pCreature)
        {
            NwCreature?creature = CNWSCreature.FromPointer(pCreature).ToNwObject <NwCreature>();

            if (creature == null)
            {
                return(walkRateHook.CallOriginal(pCreature));
            }

            InternalVariableFloat rateCap = InternalVariables.WalkRateCap(creature);

            return(rateCap.HasValue ? rateCap.Value : walkRateHook.CallOriginal(pCreature));
        }
        public void SetWalkRateCap(NwCreature creature, float?newValue)
        {
            InternalVariableFloat overrideValue = InternalVariables.WalkRateCap(creature);

            if (newValue.HasValue)
            {
                overrideValue.Value = newValue.Value;
            }
            else
            {
                overrideValue.Delete();
            }
        }
Exemple #6
0
        public void SetPersonalOverride(NwPlayer player, NwObject target, VisibilityMode visibilityMode)
        {
            InternalVariableEnum <VisibilityMode> value = InternalVariables.PlayerVisibilityOverride(player, target);

            value.Value = visibilityMode;
        }
Exemple #7
0
        public void SetGlobalOverride(NwGameObject target, VisibilityMode visibilityMode)
        {
            InternalVariableEnum <VisibilityMode> value = InternalVariables.GlobalVisibilityOverride(target);

            value.Value = visibilityMode;
        }
Exemple #8
0
 public VisibilityMode GetPersonalOverride(NwPlayer player, NwObject target)
 {
     return(InternalVariables.PlayerVisibilityOverride(player, target).Value);
 }
Exemple #9
0
 public VisibilityMode GetGlobalOverride(NwGameObject target)
 {
     return(InternalVariables.GlobalVisibilityOverride(target));
 }
 /// <summary>
 /// Sets the override that is set for the creature's damage level.<br/>
 /// </summary>
 public void SetDamageLevelOverride(NwCreature creature, DamageLevelEntry damageLevel)
 {
     InternalVariables.DamageLevelOverride(creature).Value = damageLevel.RowIndex;
 }
 /// <summary>
 /// Clears any override that is set for the creature's damage level.<br/>
 /// </summary>
 public void ClearDamageLevelOverride(NwCreature creature)
 {
     InternalVariables.DamageLevelOverride(creature).Delete();
 }
        public float?GetWalkRateCap(NwCreature creature)
        {
            InternalVariableFloat overrideValue = InternalVariables.WalkRateCap(creature);

            return(overrideValue.HasValue ? overrideValue.Value : null);
        }
Exemple #13
0
 public void RemoveVariable(string key)
 {
     InternalVariables.Remove(key);
     Contract.Assume(Variables.PureContainsKey(key) == false);
 }
 public bool GetAlwaysWalk(NwCreature creature)
 {
     return(InternalVariables.AlwaysWalk(creature));
 }
Exemple #15
0
        public Object Lookup(String variableName)
        {
            InternalVariables.TryGetValue(variableName, out Object value);

            return(value);
        }