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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

[Trigger] How do you edit a unit's hitpoints and base damage in game?

Discussion in 'Triggers & Scripts' started by l33t5up4h4x0r, Jan 8, 2007.

  1. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ive been mapping for over 4 years and still dunno how to do this. Ive done this in the past by using other ways but generally i need a more effective way to do this. Im making a spell that a summoned unit's hp and damage is based off a hero's int.
     
  2. Xelephant

    Xelephant

    Joined:
    Feb 2, 2005
    Messages:
    215
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Hmm you could to an Techtype for the Summoned Unit which will be the same as the Int. But there is an max Level of 50 tought, and you'll need one Techtree for each Player, plus you can't lower the Techlevel.

    Then just set an Trigger which Fires when the Spell is cast, and set the Tech to the suggested level. Maybe you could do at level increase for each 4int the Hero has..
     
  3. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Have you ever heared of the function SetUnitMaxState before? It sets the HP of the unit to the given level. Don't be afraid just because it's in JASS, it's easy to use, and has a tutorial.
    http://www.wc3jass.com/viewtopic.php?t=2652

    I don't know any solution for setting the damage... Only a lame one (using the Claws of Attack item ability with many-many levels).
     
  4. Orc_Tamer

    Orc_Tamer

    Joined:
    Jan 5, 2007
    Messages:
    41
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    They call it the Triggers (GUI) section for a reason paskovich.

    -Orc_Tamer
     
  5. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    paskovich since i know nothing on jass and planning to make a totally cool map w/o the help of jass, i guess i better break dat rule. Anyways i've figured out how to do the damage w/o abilities/items/upgrades/jass :) tnx for the hp thing...ill figure it out sometym hahaha
     
  6. Xelephant

    Xelephant

    Joined:
    Feb 2, 2005
    Messages:
    215
    Resources:
    1
    Maps:
    1
    Resources:
    1
    You could enlight us, and say how you solved it, so it can be done by other with the same Problem.
     
  7. MetalWarrior

    MetalWarrior

    Joined:
    Jul 14, 2006
    Messages:
    293
    Resources:
    6
    Maps:
    6
    Resources:
    6
    What I would do would simply give the unit an ability that increase the maximum of hit point:
    Item Life Bonus (Greater)
    Converted into an unit ability with your Hit Point modification value. You won't see the icon so it will be ok. And for the damage, add the ability:
    Item Attack Bonus (+X)
    It don't matter the number as you will modify it to the valu you want.

    That is what I would do... You could remove the hit point max and the damage increasement at any time...
     
  8. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    8,412
    Resources:
    87
    Models:
    61
    Icons:
    23
    Packs:
    1
    Tutorials:
    2
    Resources:
    87
    [edit]
     
    Last edited by a moderator: Jun 19, 2007
  9. Av3n

    Av3n

    Joined:
    Jul 18, 2005
    Messages:
    300
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Have you ever heard of using abilities...

    -Av3n
     
  10. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    i used custom ability variable in each to store a hero's stat and use triggers to deal that much damage each time the unit attacks....for the life bonus thing with abilities, i used the item ability life bonus and it dosent seem to work for normal non-hero units...why is dat?
     
  11. MetalWarrior

    MetalWarrior

    Joined:
    Jul 14, 2006
    Messages:
    293
    Resources:
    6
    Maps:
    6
    Resources:
    6
    Hum, think think... I don't know why it don't work with unit, cause in my map, it does...
     
  12. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Hmmm well i used upgrades instead so it works now, thanks anyways guys
     
  13. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Lame way! That trigger fires when the unit'a attack animation starts, and not when the Attacked Unit is damaged. It will even deal bonus damage when the attacker misses...
     
  14. Dalaran_Guard

    Dalaran_Guard

    Joined:
    Sep 13, 2006
    Messages:
    429
    Resources:
    1
    Maps:
    1
    Resources:
    1
    The only lame way is one that doesn't work. And while I agree that this is probably not the best way and that this method can cause problems, a simple wait function can fix many of the problems.
     
  15. paskovich

    paskovich

    Joined:
    Jul 12, 2005
    Messages:
    794
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Well, if you think so...