public static void CreateAuraFile(AuraType type) { string fname = type + ".cs"; FileInfo[] files = auraDir.GetFiles(fname, SearchOption.AllDirectories); if (files.Length == 0) { throw new Exception("AuraFile not found: " + fname); } using (var writer = new StreamWriter(files[0].FullName, false)) { writer.WriteLine("using System;"); writer.WriteLine("using System.Collections.Generic;"); writer.WriteLine("using System.Linq;"); writer.WriteLine("using System.Text;"); writer.WriteLine(); writer.WriteLine("using WCell.RealmServer.Entities;"); writer.WriteLine("using WCell.RealmServer.Spells;"); writer.WriteLine("using WCell.RealmServer.Spells.Auras;"); writer.WriteLine(); writer.WriteLine("namespace WCell.RealmServer.Spells.Auras.Handlers"); writer.WriteLine("{"); writer.WriteLine(" public class {0}Handler : AuraEffectHandler", type); writer.WriteLine(" {"); writer.WriteLine(); writer.WriteLine(" protected internal override void Apply()"); writer.WriteLine(" {"); writer.WriteLine(); writer.WriteLine(" }"); writer.WriteLine(); writer.WriteLine(" }"); writer.WriteLine("};"); } }
public static bool CanBeHarmedByAura( Mobile owner, Mobile mob, AuraType type ) { if( BaseAI.AreAllies(owner, mob) || mob == null || mob.Deleted || !mob.Alive || mob.Blessed ) return false; return true; }
public AuraBase(AuraType modifierType, AuraControlEffect controlEffect, float seconds) { ControlEffect = controlEffect; ModifierType = modifierType; Duration = seconds; if (seconds == -1) { TimeLeft = TimeSpan.FromSeconds(1); } else { TimeLeft = TimeSpan.FromSeconds(seconds); } }
private void AuraModTypeName(int index) { AuraType aura = (AuraType)spell.EffectApplyAuraName[index]; int misc = spell.EffectMiscValue[index]; if (spell.EffectApplyAuraName[index] == 0) { rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", spell.EffectMiscValue[index]); rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", spell.EffectMiscValueB[index]); rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", spell.EffectAmplitude[index]); return; } rtb.AppendFormat("Aura Id {0:D} ({0})", aura); rtb.AppendFormat(", value = {0}", spell.EffectBasePoints[index] + 1); rtb.AppendFormat(", misc = {0} (", misc); switch (aura) { case AuraType.SPELL_AURA_MOD_STAT: rtb.Append((UnitMods)misc); break; case AuraType.SPELL_AURA_MOD_RATING: rtb.Append((CombatRating)misc); break; case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER: case AuraType.SPELL_AURA_ADD_PCT_MODIFIER: rtb.Append((SpellModOp)misc); break; // todo: more case default: rtb.Append(misc); break; } rtb.AppendFormat("), miscB = {0}", spell.EffectMiscValueB[index]); rtb.AppendFormatLine(", periodic = {0}", spell.EffectAmplitude[index]); switch (aura) { default: break; } }
/// <summary> /// Gets the total modifiers of an AuraType in this AuraCollection. /// Takes only auras with a given miscvalue into account. /// </summary> public int GetTotalAuraModifier(AuraType type, int miscvalue) { int totalmods = 0; foreach (var aura in this) { foreach (var effect in aura.Spell.Effects) { if (effect.AuraType == type && effect.MiscValue == miscvalue) { totalmods += effect.CalcEffectValue(); } } } return(totalmods); }
public static void FindSpellsWithAura(AuraType aura) { var spells = GetSpells(); foreach (var spell in spells) { if (spell.HasEffectWith(effect => effect.AuraType == aura)) { Console.WriteLine("{0}: {1}", spell.Id, spell.Name); foreach (var eff in spell.Effects) { eff.DumpInfo(Console.Out, "\t"); } } } }
/// <summary> /// Returns the first visible (not passive) Aura with the given Type (if any). /// </summary> /// <remarks>Requires map context.</remarks> /// <param name="type"></param> /// <returns></returns> public Aura this[AuraType type] { get { foreach (Aura visibleAura in m_visibleAuras) { if (visibleAura != null && visibleAura.Spell.HasEffectWith(effect => effect.AuraType == type)) { return(visibleAura); } } return(null); } }
/// <summary> /// Returns the first visible (not passive) Aura with the given Type (if any). /// </summary> /// <remarks>Requires map context.</remarks> /// <param name="type"></param> /// <returns></returns> public Aura this[AuraType type] { get { foreach (Aura visibleAura in this.m_visibleAuras) { if (visibleAura != null && visibleAura.Spell.HasEffectWith((Predicate <SpellEffect>)(effect => effect.AuraType == type))) { return(visibleAura); } } return((Aura)null); } }
/// <summary> /// Gets the total modifiers of an AuraType in this AuraCollection. /// Takes only auras with a given miscvalue into account. /// </summary> public int GetTotalAuraModifier(AuraType type, int miscvalue) { int num = 0; foreach (Aura aura in this) { foreach (SpellEffect effect in aura.Spell.Effects) { if (effect.AuraType == type && effect.MiscValue == miscvalue) { num += effect.CalcEffectValue(); } } } return(num); }
IEnumerator _Set(AuraType auratype, bool on, float alpha) { float how_fast = 0.2f; if (on) { auratype.aura.gameObject.SetActive(on); } LeanTween.cancel(auratype.aura.gameObject); LeanTween.alpha(auratype.aura.gameObject, alpha, how_fast).setEase(LeanTweenType.easeInQuad); if (!on) { yield return(new WaitForSeconds(how_fast)); auratype.aura.gameObject.SetActive(on); } yield return(null); }
public static AuraType FindHighestAuraType() { var spells = GetSpells(); AuraType highest = AuraType.None; foreach (var spell in spells) { foreach (var effect in spell.Effects) { if (effect.AuraType > highest) { highest = effect.AuraType; } } } Console.WriteLine("Highest AuraType: {0}", highest); return(highest); }
public int GetTotalAuraModifier(AuraType auratype) { var totalAuraList = GetAuraEffectsByType(auratype); if (totalAuraList.Count == 0) { return(0); } int modifier = 0; /*std::map<SpellGroup, int32> SameEffectSpellGroup; * * for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) * if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) * modifier += (*i)->GetAmount(); * * for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) * modifier += itr->second;*/ return(modifier); }
public void Set(AuraType auratype, float time, bool on, bool instantly) { auratype.timer = time; if (on && on == auratype.am_running) { return; } float alpha = (on) ? 1f : 0f; auratype.am_running = on; if (instantly) { Show.SetAlpha(auratype.aura, alpha); auratype.aura.gameObject.SetActive(on); } else { StartCoroutine(_Set(auratype, true, alpha)); return; } }
private string AuraModTypeName(SpellEntry spell, int index) { AuraType aura = (AuraType)spell.EffectApplyAuraName[index]; int mod = spell.EffectMiscValue[index]; StringBuilder sb = new StringBuilder(); if (spell.EffectApplyAuraName[index] == 0) { sb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", spell.EffectMiscValue[index]); sb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", spell.EffectMiscValueB[index]); sb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", spell.EffectAmplitude[index]); return(sb.ToString()); } sb.AppendFormat("Aura Id {0:D} ({0})", aura); sb.AppendFormat(", value = {0}", spell.EffectBasePoints[index] + 1); sb.AppendFormat(", misc = {0} (", mod); switch (aura) { case AuraType.SPELL_AURA_MOD_STAT: sb.Append((UnitMods)mod); break; case AuraType.SPELL_AURA_MOD_RATING: sb.Append((CombatRating)mod); break; case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER: case AuraType.SPELL_AURA_ADD_PCT_MODIFIER: sb.Append((SpellModOp)mod); break; // todo: more case default: sb.Append(mod); break; } sb.AppendFormat("), miscB = {0}", spell.EffectMiscValueB[index]); sb.AppendFormatLine(", periodic = {0}", spell.EffectAmplitude[index]); return(sb.ToString()); }
private void AuraModTypeName(int index) { SpellEffectEntry effect = spell.GetEffect(index); AuraType aura = (AuraType)effect.EffectApplyAuraName; int misc = effect.EffectMiscValue; if (effect.EffectApplyAuraName == 0) { rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", effect.EffectMiscValue); rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", effect.EffectMiscValueB); rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", effect.EffectAmplitude); return; } rtb.AppendFormat("Aura Id {0:D} ({0})", aura); rtb.AppendFormat(", value = {0}", effect.EffectBasePoints); rtb.AppendFormat(", misc = {0} (", misc); switch (aura) { case AuraType.SPELL_AURA_MOD_STAT: rtb.Append((UnitMods)misc); break; case AuraType.SPELL_AURA_MOD_RATING: rtb.Append((CombatRating)misc); break; case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER: case AuraType.SPELL_AURA_ADD_PCT_MODIFIER: rtb.Append((SpellModOp)misc); break; // todo: more case default: rtb.Append(misc); break; } rtb.AppendFormat("), miscB = {0}", effect.EffectMiscValueB); rtb.AppendFormatLine(", periodic = {0}", effect.EffectAmplitude); switch (aura) { case AuraType.SPELL_AURA_OVERRIDE_SPELLS: if (!DBC.OverrideSpellData.ContainsKey((uint)misc)) { rtb.SetStyle(Color.Red, FontStyle.Bold); rtb.AppendFormatLine("Cannot find key {0} in OverrideSpellData.dbc", (uint)misc); } else { rtb.AppendLine(); rtb.SetStyle(Color.DarkRed, FontStyle.Bold); rtb.AppendLine("Overriding Spells:"); OverrideSpellDataEntry Override = DBC.OverrideSpellData[(uint)misc]; for (int i = 0; i < 10; ++i) { if (Override.Spells[i] == 0) { continue; } rtb.SetStyle(Color.DarkBlue, FontStyle.Regular); rtb.AppendFormatLine("\t - #{0} ({1}) {2}", i + 1, Override.Spells[i], DBC.Spell.ContainsKey(Override.Spells[i]) ? DBC.Spell[Override.Spells[i]].SpellName : "?????"); } rtb.AppendLine(); } break; case AuraType.SPELL_AURA_SCREEN_EFFECT: rtb.SetStyle(Color.DarkBlue, FontStyle.Bold); rtb.AppendFormatLine("ScreenEffect: {0}", DBC.ScreenEffect.ContainsKey((uint)misc) ? DBC.ScreenEffect[(uint)misc].Name : "?????"); break; default: break; } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); int test = 0; if (version > 57) { m_Orders = new List<OrderInfo>(); int orderCount = reader.ReadInt(); for (int i = 0; i < orderCount; i++) { OrderInfo newOrder = new OrderInfo("", 1, 1, this); OrderInfo.Deserialize(reader, newOrder); m_Orders.Add(newOrder); } } if (version > 55) { m_Deadly = reader.ReadInt(); } if (version > 54) { m_Nation = (Nation)reader.ReadInt(); m_Government = (GovernmentEntity)reader.ReadItem(); m_Organization = (CustomGuildStone)reader.ReadItem(); } if( version > 53 ) m_AuraType = (AuraType)reader.ReadInt(); if( version > 52 ) m_CustomBreathType = (CustomBreathType)reader.ReadInt(); if( version > 51 ) m_ManeuverResistance = reader.ReadInt(); if( version > 50 ) { m_CantInterrupt = reader.ReadBool(); m_CantParry = reader.ReadBool(); m_HasNoCorpse = reader.ReadBool(); } if( version > 49 ) { int count = reader.ReadInt(); for( int i = 0; i < count; i++ ) m_SecondaryWikiConfigs.Add( reader.ReadString() ); count = reader.ReadInt(); for( int i = 0; i < count; i++ ) { XMLEventType eventType = (XMLEventType)reader.ReadInt(); List<string> list = new List<string>(); int codeCount = reader.ReadInt(); for( int a = 0; a < codeCount; a++ ) list.Add( reader.ReadString() ); m_XMLEventsDatabase.Add( eventType, list ); } } if( version > 48 ) m_RangedAttackType = (RangedAttackType)reader.ReadInt(); if( version > 47 ) m_CustomSkinnableParts = reader.ReadStrongItemList(); if( version > 46 ) { m_NoWoundedMovePenalty = reader.ReadBool(); m_MeleeAttackType = (MeleeAttackType)reader.ReadInt(); } if( version > 45 ) m_WikiConfig = reader.ReadString(); if( version > 44 ) { m_Technique = reader.ReadString(); m_TechniqueLevel = reader.ReadInt(); } if( version > 43 ) m_StableTicket = reader.ReadItem(); if( version > 41 ) m_StabledOwner = reader.ReadMobile(); if( version > 40 ) m_ReceivedNewLoot = reader.ReadBool(); if( version > 39 ) { m_TimeOfDeath = reader.ReadDeltaTime(); if( reader.ReadBool() ) BeginRess( reader.ReadDeltaTime() - DateTime.Now, this.Corpse ); m_Lives = reader.ReadInt(); } if( version > 38 ) m_ReleaseTime = reader.ReadDateTime(); if( version > 37 ) m_MarkedForTermination = reader.ReadBool(); if( version > 36 ) { m_FavouriteStance = reader.ReadString(); m_FavouriteManeuver = reader.ReadString(); } if( version > 34 ) m_CombatStyles = new CombatStyles( reader ); if( version > 32 ) m_Feats = new Feats( reader, true ); if( version > 33 ) m_FixedScales = reader.ReadBool(); if( version > 31 ) { m_NoDeathCondition = reader.ReadBool(); m_NoDeath = reader.ReadBool(); m_NoDeathMsg = reader.ReadString(); m_NoDeathSound = reader.ReadInt(); } if( version > 30 ) this.Frozen = reader.ReadBool(); if( version > 27 ) { m_VanishTime = reader.ReadDateTime(); m_VanishEmote = reader.ReadString(); } m_CreatureGroup = (CreatureGroup)reader.ReadInt(); if( version < 29 ) { test = reader.ReadInt(); m_IsSneaky = test > 0; } else m_IsSneaky = reader.ReadBool(); if( version < 29 ) { test = reader.ReadInt(); m_TakesLifeOnKill = test > 0; } else m_TakesLifeOnKill = reader.ReadBool(); m_Description = reader.ReadString(); m_Intimidated = reader.ReadInt(); if( version < 29 ) { test = reader.ReadInt(); m_IsHuntingHound = test > 0; } else m_IsHuntingHound = reader.ReadBool(); m_XPScale = reader.ReadInt(); m_StatScale = reader.ReadInt(); m_SkillScale = reader.ReadInt(); m_Level = reader.ReadInt(); m_XP = reader.ReadInt(); m_NextLevel = reader.ReadInt(); if( version < 29 ) { test = reader.ReadInt(); m_Warned = test > 0; } else m_Warned = reader.ReadBool(); m_WarningTime = reader.ReadDateTime(); m_BribingTime = reader.ReadDateTime(); m_EmployerFeatLevel = reader.ReadInt(); m_TargetsName = reader.ReadString(); m_Employer = reader.ReadMobile(); m_HiringTime = reader.ReadDateTime(); if( version < 29 ) { test = reader.ReadInt(); m_Bribed = test > 0; } else m_Bribed = reader.ReadBool(); m_LastSeen = reader.ReadDateTime(); if( version < 29 ) { test = reader.ReadInt(); m_CanBeInformant = test > 0; } else m_CanBeInformant = reader.ReadBool(); m_CurrentAI = (AIType)reader.ReadInt(); m_DefaultAI = (AIType)reader.ReadInt(); m_iRangePerception = reader.ReadInt(); m_iRangeFight = reader.ReadInt(); m_iTeam = reader.ReadInt(); m_dActiveSpeed = reader.ReadDouble(); m_dPassiveSpeed = reader.ReadDouble(); m_dCurrentSpeed = reader.ReadDouble(); if ( m_iRangePerception == OldRangePerception ) m_iRangePerception = DefaultRangePerception; m_pHome.X = reader.ReadInt(); m_pHome.Y = reader.ReadInt(); m_pHome.Z = reader.ReadInt(); if ( version >= 1 ) { m_iRangeHome = reader.ReadInt(); int i, iCount; iCount = reader.ReadInt(); for ( i=0; i< iCount; i++ ) { string str = reader.ReadString(); Type type = Type.GetType( str ); if ( type != null ) { m_arSpellAttack.Add( type ); } } iCount = reader.ReadInt(); for ( i=0; i< iCount; i++ ) { string str = reader.ReadString(); Type type = Type.GetType( str ); if ( type != null ) { m_arSpellDefense.Add( type ); } } } else { m_iRangeHome = 0; } if ( version >= 2 ) { m_FightMode = ( FightMode )reader.ReadInt(); m_bControlled = reader.ReadBool(); m_ControlMaster = reader.ReadMobile(); m_ControlTarget = reader.ReadMobile(); m_ControlDest = reader.ReadPoint3D(); m_ControlOrder = (OrderType) reader.ReadInt(); m_dMinTameSkill = reader.ReadDouble(); if ( version < 9 ) reader.ReadDouble(); m_bTamable = reader.ReadBool(); m_bSummoned = reader.ReadBool(); if ( m_bSummoned ) { m_SummonEnd = reader.ReadDeltaTime(); new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start(); } m_iControlSlots = reader.ReadInt(); } else { m_FightMode = FightMode.Closest; m_bControlled = false; m_ControlMaster = null; m_ControlTarget = null; m_ControlOrder = OrderType.None; } if ( version >= 3 ) m_Loyalty = reader.ReadInt(); else m_Loyalty = MaxLoyalty; // Wonderfully Happy if ( version >= 4 ) m_CurrentWayPoint = reader.ReadItem() as WayPoint; if ( version >= 5 ) m_SummonMaster = reader.ReadMobile(); if ( version >= 6 ) { //m_HitsMax = reader.ReadInt(); //m_StamMax = reader.ReadInt(); //m_ManaMax = reader.ReadInt(); m_DamageMin = reader.ReadInt(); m_DamageMax = reader.ReadInt(); } if ( version >= 7 ) { m_PhysicalResistance = reader.ReadInt(); m_PhysicalDamage = reader.ReadInt(); m_FireResistance = reader.ReadInt(); m_FireDamage = reader.ReadInt(); m_ColdResistance = reader.ReadInt(); m_ColdDamage = reader.ReadInt(); m_PoisonResistance = reader.ReadInt(); m_PoisonDamage = reader.ReadInt(); m_EnergyResistance = reader.ReadInt(); m_EnergyDamage = reader.ReadInt(); } if ( version >= 8 ) m_Owners = reader.ReadStrongMobileList(); else m_Owners = new List<Mobile>(); if ( version >= 10 ) { m_IsDeadPet = reader.ReadBool(); m_IsBonded = reader.ReadBool(); m_BondingBegin = reader.ReadDateTime(); m_OwnerAbandonTime = reader.ReadDateTime(); } if ( version >= 11 ) m_HasGeneratedLoot = reader.ReadBool(); else m_HasGeneratedLoot = true; if ( version >= 12 ) m_Paragon = reader.ReadBool(); else m_Paragon = false; if ( version >= 13 && reader.ReadBool() ) m_Friends = reader.ReadStrongMobileList(); else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend ) ++m_ControlOrder; if ( version < 16 ) Loyalty *= 10; double activeSpeed = m_dActiveSpeed; double passiveSpeed = m_dPassiveSpeed; SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed ); bool isStandardActive = false; for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i ) isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] ); bool isStandardPassive = false; for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i ) isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] ); if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed ) m_dCurrentSpeed = activeSpeed; else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed ) m_dCurrentSpeed = passiveSpeed; if ( isStandardActive && !m_Paragon ) m_dActiveSpeed = activeSpeed; if ( isStandardPassive && !m_Paragon ) m_dPassiveSpeed = passiveSpeed; if ( version >= 14 ) { m_RemoveIfUntamed = reader.ReadBool(); m_RemoveStep = reader.ReadInt(); } if( version <= 14 && m_Paragon && Hue == 0x31 ) { Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501. } m_BluntResistance = reader.ReadInt(); m_BluntDamage = reader.ReadInt(); m_SlashingResistance = reader.ReadInt(); m_SlashingDamage = reader.ReadInt(); m_PiercingResistance = reader.ReadInt(); m_PiercingDamage = reader.ReadInt(); CheckStatTimers(); Timer.DelayCall( TimeSpan.FromSeconds( 5 ), new TimerCallback( WaitToChangeAI ) ); AddFollowers(); if ( IsAnimatedDead ) Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this ); if( this.Level < 1 ) this.Level = 1; if( this.Blessed && this.Alive ) this.CanBeInformant = true; m_Intimidated = 0; if( !( this is Mercenary ) && version < 34 && this.Level > 1 ) { int bonus = this.Level / 2; int rest = this.Level % 2; this.DamageMax += bonus + rest; this.DamageMin += bonus; } LevelSystem.FixStatsAndSkills( this ); m_Deserialized = true; }
public bool HasAura(AuraType aura) { return(Effects.Where(eff => eff != null && eff.ApplyAuraName == (uint)aura).Count() > 0); }
/// <summary> /// Adds a SpellEffect that will be applied to an Aura to be casted on oneself /// </summary> public SpellEffect AddAuraEffect(AuraType type) { return AddAuraEffect(type, ImplicitTargetType.Self); }
/// <summary> /// Returns the first visible (not passive) Aura with the given Type (if any). /// </summary> /// <remarks>Requires region context.</remarks> /// <param name="type"></param> /// <returns></returns> public Aura this[AuraType type] { get { foreach (var aura in m_visibleAuras) { if (aura != null && aura.Spell.HasEffectWith(effect => effect.AuraType == type)) { return aura; } } return null; } }
public EnrageEffect(AuraType type, params Effect[] effects) : base(type, effects) { }
private AuraType _type; // The type, debuff or buff, of this aura. #endregion Fields #region Constructors /// <summary> /// This is the base constructor used by the programmer when designing a new status effect for prototyping. The programmer will provide all input /// except the ID which will be passed by derived class's constructor so the ID which will be the integer key mapped to this effect in the /// manager storing all status effect protoypes. The status effect will inherit the Aura class. Strict input validation is performed and /// exceptions are thrown for invalid input. Since the instance of this object created by this constructor will only be used as a protoype, /// not a functional aura, all input must be correct.</summary> /// <param name="id">The unique integer ID for this aura. Cannot be negative.</param> /// <param name="name">The name of this aura. This must be unique just like the integer ID.</param> /// <param name="description">The description of the aura. Can be empty.</param> /// <param name="flavorText">The flavor text of the aura. Can be empty.</param> /// <param name="textureFileName">The name of the texture for the GUI representation.</param> /// <param name="type">The type of aura: buff or debuff.</param> /// <param name="duration">The duration of the aura. If the given value is 0, the aura will be treated as static and will /// remain on the entity until it is removed by a manager. Otherwise, the given value will be used as the duration for the effect and will /// be treated as a non-static aura. The maxium duration for non-static auras is 1 hour. Static auras will have their stack limit clamped to /// one and will restrict an entity to only having one instance of this aura for any caster. Non-static auras may be applied multiple times /// to the same entity given that they are from differing sources (external stacking). Non-static auras applied by the same caster will /// stack up to the stack limit defined below (internal stacking).</param> /// <param name="stackLimit">The maximum number of stacks for this aura. Clamped between 1 and 99. This will only affect non-static /// auras. Static auras always have a stack limit of 1.</param> protected Aura(string name, string description, string flavorText, string textureFileName, string particleEffectFileName, AuraType type, int duration, int stackLimit, int initialStackCount, params Module[] auraMods) { if (String.IsNullOrEmpty(name)) { throw new FormatException("The name cannot be null or empty"); } _name = name; _description = ""; if (description != null) { _description = description; } _flavorText = ""; if (flavorText != null) { _flavorText = flavorText; } _icon = (Texture2D)Resources.Load(DEFAULT_AURA_TEXTURE_FILE_PATH + textureFileName, typeof(Texture2D)); if (_icon == null) { _icon = (Texture2D)Resources.Load(DEFAULT_AURA_TEXTURE_FILE_PATH + DEFAULT_ICON_TEXTURE_FILE_NAME, typeof(Texture2D)); Debug.LogWarning("Could not load texture asset '" + textureFileName + "' for the " + _name + " aura. Using default texture."); } _particleEffect = (GameObject)Resources.Load(DEFAULT_AURA_PARTICLE_EFFECT_FILE_PATH + particleEffectFileName, typeof(GameObject)); if (_particleEffect == null) { _particleEffect = (GameObject)Resources.Load(DEFAULT_AURA_PARTICLE_EFFECT_FILE_PATH + DeFAULT_AURA_PARTICLE_EFFECT_FILE_NAME, typeof(GameObject)); Debug.LogWarning("Could not load particle effect '" + particleEffectFileName + "' for the " + _name + " aura. Using default particle effect."); } _type = type; if (duration <= 0) { _isStaticAura = true; _duration = 0; _stackLimit = MINIMUM_NUMBER_OF_STACKS; _initialStackCount = 1; } else { _isStaticAura = false; _duration = Mathf.Clamp(duration, MINIMUM_DURATION, MAXIMUM_DURATION); _stackLimit = Mathf.Clamp(stackLimit, MINIMUM_NUMBER_OF_STACKS, MAXIMUM_NUMBER_OF_STACKS); _initialStackCount = Mathf.Clamp(initialStackCount, MINIMUM_NUMBER_OF_STACKS, _stackLimit); } _allModules = new List<Module>(); _tickModules = new List<Tick>(); foreach (Module module in auraMods) { _allModules.Add(module); if (module.GetType().BaseType.BaseType == typeof(Tick)) { _tickModules.Add((Tick)module); } } _timeRemaining = 0; _stackCount = 0; _isPrototype = true; _caster = null; _target = null; }
public EnrageEffect(AuraType type, string enchantmentId) : base(type, enchantmentId) { }
public AuraModifier(AuraType modifierType, float addAmount, float mulAmount, float seconds, AuraControlEffect controlEffect = AuraControlEffect.None) : base(modifierType, controlEffect, seconds) { AddAmount = addAmount; MulAmount = mulAmount; }
public void Apply() { AddStack(); AuraType.Applied(this); }
public void RemoveStack() { Stacks -= 1; AuraType.RemovedStack(this); OnStackRemoved?.Invoke(Stacks); }
public bool HasAura(AuraType aura) { return(Effects.Any(eff => eff != null && eff.EffectAura == (uint)aura)); }
public bool IsAura(AuraType aura) { return(IsAura() && AuraType == aura); }
void EnableAura() { emitsAura = true; emittedAura = SetEmittedAura(); }
protected Aura(Entity target, Entity caster, Aura protoType) { if (target == null) { throw new ArgumentNullException("The target entity is null."); } else if (caster == null) { throw new ArgumentNullException("The caster entity is null."); } _target = target; _caster = caster; _name = protoType.Name; _description = protoType.Description; _flavorText = protoType.FlavorText; _icon = protoType.Icon; _particleEffect = protoType.ParticleEffect; _type = protoType.Type; _duration = protoType.Duration; _isStaticAura = protoType.IsStaticAura; _stackLimit = protoType.StackLimit; _allModules = new List<Module>(); _tickModules = new List<Tick>(); foreach (Module mod in protoType._allModules) { Module modCopy = mod.Copy(); if (RecursiveCheckModule(modCopy) == true) { _tickModules.Add((Tick)modCopy); } /* if (modCopy.GetType().BaseType.BaseType == typeof(Tick)) { _tickModules.Add((Tick)modCopy); } */ _allModules.Add(modCopy); } Debug.Log("length of tickmodules: " + _tickModules.Count); _timeRemaining = 0; _stackCount = 0; _initialStackCount = protoType.InitialStackCount; _isPrototype = false; }
public List <AuraEffect> GetAuraEffectsByType(AuraType type) { return(modifierAuras[type]); }
private static void WriteMaskedModSpells(AuraType type) { using (StreamWriter writer = new StreamWriter(ToolConfig.OutputDir + "" + type + ".txt", false)) { var spells = new Dictionary<string, Spell>(); SpellEffect statEffect = null; foreach (var spell in SpellHandler.ById) { if (spell == null) continue; if (spell.HasEffectWith((effect) =>{ if (effect.AuraType == type) { statEffect = effect; return true; } return false; })) { spells[spell.Name] = spell; } } foreach (Spell spell in spells.Values) { spell.HasEffectWith((effect) =>{ if (effect.AuraType == type) { statEffect = effect; return true; } return false; }); writer.WriteLine("{0} (Id: {1}), Type: {2}{3}", spell.Name, spell.Id, (SpellModifierType) statEffect.MiscValue, statEffect.ItemId != 0 ? ", ItemType: " + statEffect.ItemId.ToString("X8") : ""); } writer.WriteLine(); writer.WriteLine(); foreach (Spell spell in spells.Values) { DumpSpell(writer, spell); } } }
public static void SetAuraEffectMiscValueBType(AuraType auraType, Type type) { AuraEffectMiscValueBTypes[(int)auraType] = type; }
/// <summary> /// Returns the first SpellEffect of the given Type within this Spell /// </summary> public SpellEffect GetEffect(AuraType type) { return GetEffect(type, ContentMgr.ForceDataPresence); }
public static Type GetAuraEffectMiscValueBType(AuraType type) { if (type >= AuraType.End) { log.Warn("Found invalid AuraType {0}.", type); return null; } return AuraEffectMiscValueBTypes[(int)type]; }
public SpellEffect RemoveEffect(AuraType type) { var effect = GetEffect(type); RemoveEffect(effect); return effect; }
public bool HasEffect(AuraType type) { return GetEffect(type, false) != null; }
public void AddAura(IMinion activator, AuraType aura) { BoardAuras.Add(activator, aura); }
/// <summary> /// Returns the first SpellEffect of the given Type within this Spell /// </summary> public SpellEffect GetEffect(AuraType type, bool force) { foreach (var effect in Effects) { if (effect.AuraType == type) { return effect; } } //ContentHandler.OnInvalidClientData("Spell {0} does not contain Aura Effect of type {1}", this, type); //return null; if (!init1 && force) { throw new ContentException("Spell {0} does not contain Aura Effect of type {1}", this, type); } return null; }
private void AuraModTypeName(int index) { AuraType aura = (AuraType)spell.EffectApplyAuraName[index]; int misc = spell.EffectMiscValue[index]; if (spell.EffectApplyAuraName[index] == 0) { SpellEffects effect = (SpellEffects)spell.Effect[index]; switch (effect) { case SpellEffects.SPELL_EFFECT_ACTIVATE_RUNE: rtb.AppendFormatLine("EffectMiscValueA ={0} ({1})", misc, (RuneType)misc); break; case SpellEffects.SPELL_EFFECT_DISPEL_MECHANIC: rtb.AppendFormatLine("EffectMiscValueA ={0} ({1})", misc, (Mechanics)misc); break; case SpellEffects.SPELL_EFFECT_ENERGIZE: case SpellEffects.SPELL_EFFECT_ENERGIZE_PCT: case SpellEffects.SPELL_EFFECT_POWER_DRAIN: rtb.AppendFormatLine("EffectMiscValueA ={0} ({1})", misc, (Powers)misc); break; case SpellEffects.SPELL_EFFECT_DISPEL: rtb.AppendFormatLine("EffectMiscValueA ={0} ({1})", misc, (DispelType)misc); break; case SpellEffects.SPELL_EFFECT_OPEN_LOCK: rtb.AppendFormatLine("EffectMiscValueA ={0} ({1})", misc, (LockType)misc); break; default: rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", spell.EffectMiscValue[index]); break; } rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", spell.EffectMiscValueB[index]); rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", spell.EffectAmplitude[index]); return; } rtb.AppendFormat("Aura Id {0:D} ({0})", aura); rtb.AppendFormat(", value = {0}", spell.EffectBasePoints[index] + 1); rtb.AppendFormat(", misc = {0} (", misc); switch (aura) { case AuraType.SPELL_AURA_MOD_STAT: case AuraType.SPELL_AURA_MOD_PERCENT_STAT: case AuraType.SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE: case AuraType.SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT: case AuraType.SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT: case AuraType.SPELL_AURA_MOD_MANA_REGEN_FROM_STAT: case AuraType.SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT: rtb.Append((UnitMods)misc); break; case AuraType.SPELL_AURA_MOD_RATING: case AuraType.SPELL_AURA_MOD_RATING_FROM_STAT: rtb.Append((CombatRating)misc); break; case AuraType.SPELL_AURA_MOD_DAMAGE_DONE: case AuraType.SPELL_AURA_MOD_DAMAGE_TAKEN: case AuraType.SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: case AuraType.SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: case AuraType.SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT: case AuraType.SPELL_AURA_SHARE_DAMAGE_PCT: case AuraType.SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER: case AuraType.SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE: case AuraType.SPELL_AURA_SPLIT_DAMAGE_PCT: case AuraType.SPELL_AURA_DAMAGE_IMMUNITY: case AuraType.SPELL_AURA_MOD_CRIT_DAMAGE_BONUS: case AuraType.SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE: case AuraType.SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE: case AuraType.SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE: case AuraType.SPELL_AURA_MOD_HEALING: case AuraType.SPELL_AURA_MOD_HEALING_PCT: case AuraType.SPELL_AURA_MOD_HEALING_DONE: case AuraType.SPELL_AURA_MOD_HEALING_DONE_PERCENT: case AuraType.SPELL_AURA_MOD_DAMAGE_FROM_CASTER: case AuraType.SPELL_AURA_MOD_HEALING_RECEIVED: case AuraType.SPELL_AURA_MOD_PERIODIC_HEAL: case AuraType.SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER: case AuraType.SPELL_AURA_MOD_RESISTANCE: case AuraType.SPELL_AURA_MOD_BASE_RESISTANCE: case AuraType.SPELL_AURA_MOD_RESISTANCE_PCT: case AuraType.SPELL_AURA_MOD_TARGET_RESISTANCE: case AuraType.SPELL_AURA_MOD_BASE_RESISTANCE_PCT: case AuraType.SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE: case AuraType.SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT: case AuraType.SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE: case AuraType.SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE: case AuraType.SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT: case AuraType.SPELL_AURA_SCHOOL_IMMUNITY: case AuraType.SPELL_AURA_SCHOOL_ABSORB: case AuraType.SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL: case AuraType.SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: case AuraType.SPELL_AURA_MOD_POWER_COST_SCHOOL: case AuraType.SPELL_AURA_REFLECT_SPELLS_SCHOOL: case AuraType.SPELL_AURA_MOD_IGNORE_ABSORB_SCHOOL: case AuraType.SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL: case AuraType.SPELL_AURA_MOD_IGNORE_DAMAGE_REDUCTION_SCHOOL: case AuraType.SPELL_AURA_MOD_IGNORE_ABSORB_FOR_SPELL: case AuraType.SPELL_AURA_MOD_THREAT: case AuraType.SPELL_AURA_MOD_CRITICAL_THREAT: case AuraType.SPELL_AURA_REDUCE_PUSHBACK: case AuraType.SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE: case AuraType.SPELL_AURA_HASTE_SPELLS: case AuraType.SPELL_AURA_MANA_SHIELD: case AuraType.SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT: rtb.Append((SpellSchoolMask)misc); break; case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER: case AuraType.SPELL_AURA_ADD_PCT_MODIFIER: rtb.Append((SpellModOp)misc); break; case AuraType.SPELL_AURA_MOD_POWER_REGEN: case AuraType.SPELL_AURA_MOD_POWER_REGEN_PERCENT: case AuraType.SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT: case AuraType.SPELL_AURA_MOD_INCREASE_ENERGY: case AuraType.SPELL_AURA_PERIODIC_ENERGIZE: rtb.Append((Powers)misc); break; case AuraType.SPELL_AURA_MECHANIC_IMMUNITY: case AuraType.SPELL_AURA_MOD_MECHANIC_RESISTANCE: case AuraType.SPELL_AURA_MECHANIC_DURATION_MOD: case AuraType.SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK: case AuraType.SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT: rtb.Append((Mechanics)misc); break; case AuraType.SPELL_AURA_MECHANIC_IMMUNITY_MASK: rtb.Append(misc.FlagToString <Mechanics>().Replace("MECHANIC_", "")); break; case AuraType.SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS: case AuraType.SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS: case AuraType.SPELL_AURA_MOD_DAMAGE_DONE_VERSUS: case AuraType.SPELL_AURA_MOD_CRIT_PERCENT_VERSUS: case AuraType.SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS: case AuraType.SPELL_AURA_MOD_DAMAGE_DONE_CREATURE: rtb.Append((CreatureTypeMask)misc); break; case AuraType.SPELL_AURA_TRACK_CREATURES: rtb.Append((CreatureTypeMask)((int)(1 << (misc - 1)))); break; case AuraType.SPELL_AURA_DISPEL_IMMUNITY: case AuraType.SPELL_AURA_MOD_DEBUFF_RESISTANCE: case AuraType.SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS: case AuraType.SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL: rtb.Append((DispelType)misc); break; case AuraType.SPELL_AURA_TRACK_RESOURCES: rtb.Append((LockType)misc); break; case AuraType.SPELL_AURA_MOD_SHAPESHIFT: rtb.Append((ShapeshiftFormMask)(1 << (misc - 1))); break; case AuraType.SPELL_AURA_EFFECT_IMMUNITY: rtb.Append((SpellEffects)misc); break; case AuraType.SPELL_AURA_CONVERT_RUNE: rtb.Append((RuneType)misc); break; case AuraType.SPELL_AURA_IGNORE_COMBAT_RESULT: case AuraType.SPELL_AURA_MOD_COMBAT_RESULT_CHANCE: rtb.Append((MeleeHitOutcome)misc); break; // todo: more case default: rtb.Append(misc); break; } int miscB = spell.EffectMiscValueB[index]; rtb.AppendFormat("), miscB = {0}", miscB); switch (aura) { case AuraType.SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT: case AuraType.SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT: case AuraType.SPELL_AURA_MOD_RATING_FROM_STAT: rtb.AppendFormat("({0})", (UnitMods)miscB); break; case AuraType.SPELL_AURA_CONVERT_RUNE: rtb.AppendFormat("({0})", (RuneType)miscB); break; } rtb.AppendFormatLine(", periodic = {0}", spell.EffectAmplitude[index]); switch (aura) { case AuraType.SPELL_AURA_OVERRIDE_SPELLS: if (!DBC.OverrideSpellData.ContainsKey((uint)misc)) { rtb.SetStyle(Color.Red, FontStyle.Bold); rtb.AppendFormatLine("Cannot find key {0} in OverrideSpellData.dbc", (uint)misc); } else { rtb.AppendLine(); rtb.SetStyle(Color.DarkRed, FontStyle.Bold); rtb.AppendLine("Overriding Spells:"); OverrideSpellDataEntry Override = DBC.OverrideSpellData[(uint)misc]; for (int i = 0; i < 10; ++i) { if (Override.Spells[i] == 0) { continue; } rtb.SetStyle(Color.DarkBlue, FontStyle.Regular); rtb.AppendFormatLine("\t - #{0} ({1}) {2}", i + 1, Override.Spells[i], DBC.Spell.ContainsKey(Override.Spells[i]) ? DBC.Spell[Override.Spells[i]].SpellName : "?????"); } rtb.AppendLine(); } break; case AuraType.SPELL_AURA_SCREEN_EFFECT: rtb.SetStyle(Color.DarkBlue, FontStyle.Bold); rtb.AppendFormatLine("ScreenEffect: {0}", DBC.ScreenEffect.ContainsKey((uint)misc) ? DBC.ScreenEffect[(uint)misc].Name : "?????"); break; default: break; } }
/// <summary> /// Returns the first SpellEffect of the given Type within this Spell /// </summary> public SpellEffect GetEffect(AuraType type) { foreach (var effect in Effects) { if (effect.AuraType == type) { return effect; } } return null; }
public SwitchingAura(AuraType type, SelfCondition initCondition, TriggerType offTrigger, params IEffect[] effects) : base(type, effects) { _initialisationCondtion = initCondition; _offTrigger = offTrigger; }
/// <summary> /// Adds a SpellEffect that will be applied to an Aura to be casted on the given type of target /// </summary> public SpellEffect AddAuraEffect(AuraType type, ImplicitTargetType targetType) { var effect = AddEffect(SpellEffectType.ApplyAura); effect.AuraType = type; effect.ImplicitTargetA = targetType; return effect; }
public SwitchingAura(AuraType type, SelfCondition initCondition, TriggerType offTrigger, string enchantmentId) : base(type, enchantmentId) { _initialisationCondtion = initCondition; _offTrigger = offTrigger; }