public static void OnFindMineral(BaseAbility ba, Mobile c) { AuraEffect st = (AuraEffect)ba; Aura aura = new Aura(EffectTypes.FindMineral); c.CumulativeAuraEffects[EffectTypes.FindMineral] = true; c.AddAura(st, aura); c.SendSmallUpdate(new int[] { (int)UpdateFields.PLAYER_TRACK_RESOURCES }, new object[] { 4 }); }
/// <summary> /// Adds a <see cref='BaseAbility'/> with the specified value to the /// <see cref='SpellsList'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to add.</param> /// <returns>The index at which the new element was inserted.</returns> /// <seealso cref='SpellsList.AddRange'/> public int Add(BaseAbility val) { return(List.Add(val)); }
/// <summary> /// Removes a specific <see cref='BaseAbility'/> from the <see cref='SpellsList'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to remove from the <see cref='SpellsList'/>.</param> /// <exception cref='ArgumentException'><paramref name='val'/> is not found in the Collection.</exception> public void Remove(BaseAbility val) { List.Remove(val); }
/// <summary> /// Copies the <see cref='SpellsList'/> values to a one-dimensional <see cref='Array'/> instance at the /// specified index. /// </summary> /// <param name='array'>The one-dimensional <see cref='Array'/> that is the destination of the values copied from <see cref='SpellsList'/>.</param> /// <param name='index'>The index in <paramref name='array'/> where copying begins.</param> /// <exception cref='ArgumentException'> /// <para><paramref name='array'/> is multidimensional.</para> /// <para>-or-</para> /// <para>The number of elements in the <see cref='SpellsList'/> is greater than /// the available space between <paramref name='arrayIndex'/> and the end of /// <paramref name='array'/>.</para> /// </exception> /// <exception cref='ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception> /// <exception cref='ArgumentOutOfRangeException'><paramref name='arrayIndex'/> is less than <paramref name='array'/>'s lowbound. </exception> /// <seealso cref='Array'/> public void CopyTo(BaseAbility[] array, int index) { List.CopyTo(array, index); }
public CastTrainerSpell( BaseAbility i, Character t, Mobile teachr ) : base( WowTimer.Priorities.Milisec100 , 500, "CastTrainerSpell" ) { to = t; teach = i; teacher = teachr; byte []buff = { 0,0, 0,0, 0xD9, 0xDB, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, 0xDB, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //int offset = 4; int spell = 0; if ( i is Teach ) spell = ( i as Teach ).TeachId; else spell = i.Id; /* Converter.ToBytes( t.Guid, buff, ref offset ); Converter.ToBytes( teacher.Guid, buff, ref offset ); Converter.ToBytes( spell, buff, ref offset ); Converter.ToBytes( 0x100, buff, ref offset ); Converter.ToBytes( 0, buff, ref offset ); to.Send( OpCodes.SMSG_SPELL_START, buff ); */ teacher.FakeCast( spell, t ); Start(); }
public static void OnUseHandler( BaseAbility ba, Mobile c, GameObject go ) { go.OnUse( c ); }
public void SendSpellLogExecute(BaseAbility ba) { int offset = 4; Converter.ToBytes( (ulong)this.Guid, tempBuff, ref offset ); Converter.ToBytes( (ushort)ba.Id, tempBuff, ref offset ); Converter.ToBytes( (ushort)0, tempBuff, ref offset ); Converter.ToBytes( (ushort)1, tempBuff, ref offset ); Converter.ToBytes( (ushort)0, tempBuff, ref offset ); Converter.ToBytes( (ushort)30, tempBuff, ref offset ); Converter.ToBytes( (ushort)0, tempBuff, ref offset ); Converter.ToBytes( (ushort)1, tempBuff, ref offset ); Converter.ToBytes( (ushort)0, tempBuff, ref offset ); Converter.ToBytes( (ulong)this.Guid, tempBuff, ref offset ); Converter.ToBytes( (ushort)90, tempBuff, ref offset ); Converter.ToBytes( (ushort)0, tempBuff, ref offset ); Converter.ToBytes( (ushort)1, tempBuff, ref offset ); Converter.ToBytes( (ushort)0, tempBuff, ref offset ); ToAllPlayerNear( OpCodes.SMSG_SPELLLOGEXECUTE, tempBuff, offset ); // Console.WriteLine("SMSG_SPELLLOGEXECUTE"); // HexViewer.View( tempBuff, 0, offset ); }
public virtual bool HaveSpell( BaseAbility ba ) { if ( ba == null ) return false; if ( knownAbilities[ ba.Id ] != null ) return true; return false; }
/// <summary> /// Copies the elements of an array to the end of the <see cref='SpellsList'/>. /// </summary> /// <param name='val'> /// An array of type <see cref='BaseAbility'/> containing the objects to add to the collection. /// </param> /// <seealso cref='SpellsList.Add'/> public void AddRange(BaseAbility[] val) { for (int i = 0; i < val.Length; i++) { this.Add(val[i]); } }
/// <summary> /// Adds a <see cref='BaseAbility'/> with the specified value to the /// <see cref='SpellsList'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to add.</param> /// <returns>The index at which the new element was inserted.</returns> /// <seealso cref='SpellsList.AddRange'/> public int Add(BaseAbility val) { return List.Add(val); }
/// <summary> /// Initializes a new instance of <see cref='SpellsList'/> containing any array of <see cref='BaseAbility'/> objects. /// </summary> /// <param name='val'> /// A array of <see cref='BaseAbility'/> objects with which to intialize the collection /// </param> public SpellsList(BaseAbility[] val) { this.AddRange(val); }
/// <summary> /// Inserts a <see cref='BaseAbility'/> into the <see cref='SpellsList'/> at the specified index. /// </summary> /// <param name='index'>The zero-based index where <paramref name='val'/> should be inserted.</param> /// <param name='val'>The <see cref='BaseAbility'/> to insert.</param> /// <seealso cref='SpellsList.Add'/> public void Insert(int index, BaseAbility val) { List.Insert(index, val); }
/// <summary> /// Returns the index of a <see cref='BaseAbility'/> in /// the <see cref='SpellsList'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to locate.</param> /// <returns> /// The index of the <see cref='BaseAbility'/> of <paramref name='val'/> in the /// <see cref='SpellsList'/>, if found; otherwise, -1. /// </returns> /// <seealso cref='SpellsList.Contains'/> public int IndexOf(BaseAbility val) { return List.IndexOf(val); }
public static void OnUseHandler(BaseAbility ba, Mobile c, GameObject go) { go.OnUse(c); }
public NextAttackEffect( BaseAbility af, NextAttackEffectDelegateMultiple OnEffect ) { this.number = 0; this.spell = af; this.onEffect = OnEffect; }
public NextAttackEffect(BaseAbility af, NextAttackEffectDelegateMultiple OnEffect) { this.number = 0; this.spell = af; this.onEffect = OnEffect; }
public void OnSpellTemplateResults( BaseAbility ba, Object target ) { SpellTemplate st = (SpellTemplate)ba; if( ( cast.type & 0x2 ) != 0 || ( cast.type & 0x800 ) != 0 || ( cast.type & 0x8000 ) != 0 ) // single target st.SpellResult(cast.manacost,cast.id, this, target as Mobile ); else if( ( cast.type & 0x10 ) != 0 || (cast.type & 0x1000 ) != 0 ) // Item target st.SpellResult(cast.manacost,cast.id, this, target as Item ); else { st.SpellResult(cast.manacost,cast.id, this ); } SendSmallUpdateToPlayerNearMe( new int[]{ (int)UpdateFields.UNIT_FIELD_POWER1 + ManaType }, new object[] { Mana } ); }
/// <summary> /// Gets a value indicating whether the /// <see cref='SpellsList'/> contains the specified <see cref='BaseAbility'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to locate.</param> /// <returns> /// <see langword='true'/> if the <see cref='BaseAbility'/> is contained in the collection; /// otherwise, <see langword='false'/>. /// </returns> /// <seealso cref='SpellsList.IndexOf'/> public bool Contains(BaseAbility val) { return(List.Contains(val)); }
public static void OnFindMineral( BaseAbility ba, Mobile c ) { AuraEffect st = (AuraEffect)ba; Aura aura = new Aura( EffectTypes.FindMineral ); c.CumulativeAuraEffects[ EffectTypes.FindMineral ] = true; c.AddAura( st, aura ); c.SendSmallUpdate( new int[] { (int)UpdateFields.PLAYER_TRACK_RESOURCES }, new object[] { 4 } ); }
/// <summary> /// Returns the index of a <see cref='BaseAbility'/> in /// the <see cref='SpellsList'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to locate.</param> /// <returns> /// The index of the <see cref='BaseAbility'/> of <paramref name='val'/> in the /// <see cref='SpellsList'/>, if found; otherwise, -1. /// </returns> /// <seealso cref='SpellsList.Contains'/> public int IndexOf(BaseAbility val) { return(List.IndexOf(val)); }
public static void OnCastInvisibility( BaseAbility ba, Mobile c, Mobile m ) { }
public void TrainerBuyAck( BaseAbility teach ) { if ( !OnTrainningAck() ) return; int id = 0; if ( teach is Teach ) LearnSpell( id = ( teach as Teach ).TeachId ); else LearnSpell( id = teach.Id ); castTrainerSpell = null; BaseAbility ba = null; if ( teach is Teach ) ba = (BaseAbility)Abilities.abilities[ ( teach as Teach ).TeachId ]; else ba = (BaseAbility)teach; // apprentissage des sorts liés ArrayList addon = (ArrayList)CustomSpellHandlers.spellAddons[ id ]; if ( addon != null && addon.Count > 0 ) foreach( int sp in addon ) LearnSpell( sp ); int price = 0; if ( onSpellPrice != null ) price = onSpellPrice( this, id ); if ( price == 0 ) price = CustomSpellHandlers.SpellCost( id ); Copper -= (uint)price; if ( ba is Profession ) { Profession prof = (Profession)ba; if ( onLearn != null ) { if ( onLearn( this, prof.Level, prof.ProfessionType ) ) prof.OnLearn( this ); } else prof.OnLearn( this ); Skill sk = AllSkills[ (ushort)prof.Id ]; if ( sk != null )// met a jour avec le skill connu { int start = sk.Index; sk = prof.Clone( sk.Current, (ushort)start ); AllSkills[ (ushort)prof.Id ] = sk; SendSmallUpdate( new int[]{ start, start + 1, start + 2, (int)UpdateFields.PLAYER_FIELD_COINAGE }, new object[]{ (int)sk.Id, (short)sk.CurrentVal(this), (short)sk.Cap( this ), (int)0, Copper } ); return; } else {// Ajoute la nouvelle profession/Skill int start = Profession.Slots( nProfessions ); nProfessions++; AllSkills[ (ushort)prof.Id ] = sk = prof.Clone( 1, (ushort)start ); SendSmallUpdate( new int[]{ start, start + 1, start + 2, (int)UpdateFields.PLAYER_FIELD_COINAGE }, new object[]{ (int)sk.Id, (short)sk.CurrentVal(this), (short)sk.Cap( this ), (int)0, Copper } ); return; } } SendSmallUpdate( new int[]{ (int)UpdateFields.PLAYER_FIELD_COINAGE }, new object[]{ Copper } ); }
/// <summary> /// Gets a value indicating whether the /// <see cref='SpellsList'/> contains the specified <see cref='BaseAbility'/>. /// </summary> /// <param name='val'>The <see cref='BaseAbility'/> to locate.</param> /// <returns> /// <see langword='true'/> if the <see cref='BaseAbility'/> is contained in the collection; /// otherwise, <see langword='false'/>. /// </returns> /// <seealso cref='SpellsList.IndexOf'/> public bool Contains(BaseAbility val) { return List.Contains(val); }