1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Trying to make Eaters work like a second resist check

Discussion in 'Script Support' started by Darwin, Dec 27, 2018.

  1. Darwin
    Offline

    Darwin Member

    Joined:
    Sep 5, 2017
    Messages:
    389
    Likes Received:
    2
    Hi. So I've done some edits to the SAPropEffects script and I attempted to change Eaters from giving health after damage, to outright reducing the damage taken (like a second resist check). My goal is to make it so that if you have like 25 fire eater (for example) and say a flame strike would do 40 damage (after your normal resists check), the fire eater would then reduce it an additional 25% from 40 to 30 damage.

    I've done all of my conversions so that the script will compile without errors, but it's not having any effect in game and I'm wondering what I'm getting wrong. I'm self-taught with scripting and never took a class or read a book (and still quite nooby tbh), so if you could post an example code for me, it would probably help me more than telling me what I need to do. There's a lot of scripting concepts that I understand in my head conceptually, but that I don't know the official terms for. Here's what I did with my code:

    Code (C#):
    1.  
    2.          double pe = 0; double fe = 0;
    3.             double ce = 0; double poe = 0;
    4.             double ee = 0; double de = 0;
    5.  
    6.             double pd = 0; double fd = 0;
    7.             double cd = 0; double pod = 0;
    8.             double ed = 0; double dd = 0;
    9.  
    10.             double k = (double)GetValue(DamageType.Kinetic,  this.Mobile) / 100;
    11.             double f = (double)GetValue(DamageType.Fire, this.Mobile) / 100;
    12.             double c = (double)GetValue(DamageType.Cold, this.Mobile) / 100;
    13.             double p = (double)GetValue(DamageType.Poison, this.Mobile) / 100;
    14.             double e = (double)GetValue(DamageType.Energy, this.Mobile) / 100;
    15.             double a = (double)GetValue(DamageType.AllTypes, this.Mobile) / 100;
    16.  
    17.             if (phys > 0 && (k > 0 || a > 0))
    18.             {
    19.                 pd = damage * ((double)phys / 100);
    20.                 pe = k * pd;
    21.  
    22.                 if (k >= a)
    23.                     damage -= (int)(pe);
    24.                 else
    25.                     damage -= (int)(de);
    26.             }
     
  2. Darwin
    Offline

    Darwin Member

    Joined:
    Sep 5, 2017
    Messages:
    389
    Likes Received:
    2
    @Dexter_Lexia wouldn't happen to have a quick fix this, would ya? lol
     
Similar Threads: Trying Eaters
Forum Title Date
General Discussion Was trying to change Server Name Feb 10, 2019
Script Support Trying to Make Attunement Absorb Magical Damage as well Dec 27, 2018
Script Support Trying to add Tree Elementals to Lumberjacking Nov 16, 2018
Windows Support Trying to setup a clean servuo Oct 25, 2018
Script Support UO Architect -trying to update Oct 17, 2018
General Discussion Trying to find a server to play on until the day comes mine is running Sep 16, 2018
Script Support Trying to add a random piece of ranger armor as quest reward Jul 25, 2018