1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

About another spell

Discussion in 'World Editor Help Zone' started by DaDDyWitch, Feb 16, 2014.

  1. DaDDyWitch

    DaDDyWitch

    Joined:
    Sep 13, 2013
    Messages:
    143
    Resources:
    0
    Resources:
    0
    Im making a simple spell. But it's not working.

    Reverse Sanity
    Description: Steals 200 experience from all enemy heroes in the map and gives 200 bonus experience to all allied heroes.

    I tried to create it in a simple trigger with simple functions and it didn't work.
    the second attempt i did was that I made two triggers, with a dummy spell, to steal the 200 experience, and it didn't work. This came into my mind that maybe some values like experience can't be subtracted (Oh_ou). Is it possible to subtract experience ?
     
  2. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,506
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
  3. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Ye, in order to subtract XP, you need to use AddHeroXP with a negative value, because SetHeroXP refuses to subtract (silly Blizzard). You may run into other problems though, the thread DaDDyWitch posted covers all of that.
     
  4. DaDDyWitch

    DaDDyWitch

    Joined:
    Sep 13, 2013
    Messages:
    143
    Resources:
    0
    Resources:
    0
    How ?
     
  5. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    • Hero - Add -200 experience to (Triggering unit), Hide level-up graphics


    So you're adding negative 200, which is the same as subtracting.

    Or in JASS:
    call AddHeroXP( GetTriggerUnit(), -200, false)