how to make negative skills

Discussion in 'Script Support' started by Nine_Coronas, Jun 4, 2007.

  1. Nine_Coronas

    Nine_Coronas Wanderer

    Joined:
    Dec 4, 2005
    Messages:
    390
    Likes Received:
    0
    how to make negative skills

    i want to make a brace that will be for training taming and drop the taming/lore skills by 100... is this possible?
    heres what i got so far and it didnt work...
     
  2. Lord_Greywolf

    Joined:
    Dec 29, 2005
    Messages:
    42,339
    Likes Received:
    60
    it does not like negative numbers for the skill levels

    what you can do is look at the training jewelry i submitted in the script release section (it mi9ght be in the recent archive files also, just below that section)

    it is set up for lower numbers than 100, but will show you best bet to do on it

    only other way whould be to get their origionl skills value, save it as a variable (make sure to serialize it), set the skill then to "1" (most skills to not train at 0 level) - habe them train
    then when they take it off - it sets their skill to the "new" level -1 + origional skill

    but my jewelry is designed to work with the skill once it is over that amount (i.e. 20 - which is buyable) so there is no need for the extra variable, etc
     
  3. Nine_Coronas

    Nine_Coronas Wanderer

    Joined:
    Dec 4, 2005
    Messages:
    390
    Likes Received:
    0
    huh?
    what are you talking about i cant find those scripts
     
  4. jumpnjahosofat

    jumpnjahosofat Sorceror

    Joined:
    Jun 13, 2005
    Messages:
    1,584
    Likes Received:
    2
    Try looking at how a mage weapon effects a players skill. Maybe that can give you an idea on how to do it?
     
  5. Lord_Greywolf

    Joined:
    Dec 29, 2005
    Messages:
    42,339
    Likes Received:
    60
    i can not find them either lol

    so here is one of them, they were all the same except the base jewelry parts
     

    Attached Files:

  6. Nine_Coronas

    Nine_Coronas Wanderer

    Joined:
    Dec 4, 2005
    Messages:
    390
    Likes Received:
    0
    ok but what exactly does this brace do? does it decrease all ur skills to 0?
     
  7. Lord_Greywolf

    Joined:
    Dec 29, 2005
    Messages:
    42,339
    Likes Received:
    60
    no - it only lowers the one skill that it gets assigned with

    to make something to lower all skills to 0 and then go back up when off - would be a royal pain in the arse to make - have to make 54 temp skill holder spots, record the skills, 0 them out, then when removed read the stored numbers and add them to the new skill amounts

    the only thing this bracelet does - is when made - it picks a random skill

    it then starts at "10" for the amount of skill to be lowered
    it checks to make sure they have at least 10 in that skill - if now they can not equip it
    if they do then it lowers the skill by 10
    when unequiped it add 10 bnack in
    it then lowers itself down to "9"

    so this way it has 10 wearings, and loses power each time - so they are only good for so long
     
  8. taebban

    taebban Sorceror

    Joined:
    Dec 2, 2004
    Messages:
    87
    Likes Received:
    0
    Nice script...I did find out though that if someone uses this (a 20 bracelet in skill) then they train to the skill cap with it on. After they take it off they will be 20 points higher than their skill cap in that skill. So a Mage could get to 120 Legendary Mage with only having a 100 skill cap.
     
  9. taebban

    taebban Sorceror

    Joined:
    Dec 2, 2004
    Messages:
    87
    Likes Received:
    0
    I been trying all day to write in a check so that if the skill on OnRemoved is greater than that skills cap then it sets the player to the cap for that skill, but if not then it gives still works the same way it does now, that way they can't exploit it to get past skill cap. I have tried different methods but it doesn't like any of them.
    I think I have to make it pull that individual skill cap from the player and assign that to an int. Then have that check against the skill.base OnRemoved.

    Please help!
     
  10. taebban

    taebban Sorceror

    Joined:
    Dec 2, 2004
    Messages:
    87
    Likes Received:
    0
    Ok....nevermind I got it to work! I was way over thinking it! I kept it simple and it worked!

    Code:
            public override void OnRemoved( object parent )
            {
                if (parent is Mobile)
                    {
                    PlayerMobile m = (PlayerMobile)parent;
                    Skill m_Skill = m.Skills[SkillBonuses.Skill_1_Name];
                    int i_value = this.Hue;
    
                    m_Skill.Base += i_value;
    
                    this.Hue -= 1;
                    if (this.Hue <= 0)
                        {
                        m.SendMessage("The piece of jewelry has lost all of its Magic, and it crumbles to dust");
                        this.Delete();
                        }
                        else
                            m.SendMessage("you have {0} uses left", this.Hue);
                 
    //added skill cap check by taebban
                        if (m_Skill.Cap <= m_Skill.Base)
                                    {
                                  m_Skill.Base = m_Skill.Cap;
                                    }
                }
    
    
                return;
            }
        }
    }
     

Share This Page