Toxic Slith 2017-03-22

Mobile, Mob, Toxic, Slith, Creature

  1. gametec
    *******************************************************************************
    [x] DEVELOPER(S):
    ----------------------------------------------------------------------------------------------
    gametec


    *******************************************************************************
    [x] FILE CONTENT:
    ----------------------------------------------------------------------------------------------
    ToxicSlith.cs


    *******************************************************************************
    [x] DESCRIPTION:
    ----------------------------------------------------------------------------------------------
    This in-game creature lives on the TerMur facet.
    In the commercial game this creature gives off area poison damage, so now that ability has been added.


    *******************************************************************************
    [x] DISTRO EDIT:
    ----------------------------------------------------------------------------------------------
    Edited files have been included in the 'ToxicSlith\Modifications' directory.
    Do NOT overwrite your original server files with the ones that have been included in the folder above.
    Use a program like 'WinMerge' to help you combine the edits from those files into your originals.
    Please remember to ALWAYS BACKUP your original files before editing them!
    *Do NOT remove, replace, or comment out lines or blocks of code unless it has been stated below*

    ----------------------------------------------------------------------------------------------
    MODIFICATION [01-01] >> TOXICSLITH.cs: EDIT [01-01]
    /////////////////////////////////////////////////////////////// - SEARCH CODE FOR THIS METHOD - ///// - STEP 01
    `````````````````````````````````````````````````````````````````````````````````
    Code:
    public override void GenerateLoot()
    ...............................................................................................................
    /////////////////////////////////////////////////////////////// - JUST ABOVE THAT METHOD ADD: - ///// - STEP 02
    `````````````````````````````````````````````````````````````````````````````````
    Code:
    public override void OnGaveMeleeAttack(Mobile defender)
    {
          base.OnGaveMeleeAttack(defender);
    
          if (0.2 >= Utility.RandomDouble())
              ApplyPoison();
    }
    
    public void ApplyPoison()
    {
          Map map = this.Map;
    
          if (map == null)
             return;
    
          ArrayList targets = new ArrayList();
    
          foreach (Mobile m in this.GetMobilesInRange(25))
          {
               if (m == this || !CanBeHarmful(m))
                  continue;
    
               if (m is BaseCreature && (((BaseCreature)m).Controlled ||((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                  targets.Add(m);
               else if (m.Player)
                  targets.Add(m);
    
               PlaySound(0x231);
               Effects.SendLocationEffect(m, m.Map, 0x113A, 20, 10);
               m.ApplyPoison(m, Poison.Lethal);
               LocalOverheadMessage(MessageType.Regular, 0x44, 1010523); // A toxic vapor envelops thee.
          }
    }


    *******************************************************************************
    [x] INSTALLATION:
    ----------------------------------------------------------------------------------------------
    Place the 'ToxicSlith.cs' file anywhere inside your server 'Scripts' directory.
    <or>
    If your server already contains this file then merge the edit(s) above with it.


    *******************************************************************************
    [?] SYSTEM USAGE:
    ----------------------------------------------------------------------------------------------
    To spawn this creature in game simply type:
    [add ToxicSlith

    Then target anywhere you want to place it on your game screen.


    *******************************************************************************
    [!] SUPPORT INFO:
    ----------------------------------------------------------------------------------------------
    This system comes AS-IS and will not be supported by the developer at this time.
    maybeshewill likes this.