• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Pls help me find a bug

Status
Not open for further replies.
Level 5
Joined
Aug 20, 2015
Messages
133
  • poziranie
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to (Unit-type of poziranie_caster)
      • (Level of Пожирание for poziranie_caster) Greater than 0
    • Actions
      • Unit - Set life of poziranie_caster to ((Life of poziranie_caster) + (((Max life of (Dying unit)) / 100.00) x (Real((2 x (Level of Пожирание for poziranie_caster))))))
      • Special Effect - Create a special effect at (Position of poziranie_caster) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • poziranie_str_real Less than 1.00
        • Then - Actions
          • Set poziranie_str_real = (poziranie_str_real + (0.08 + (0.03 x (Real((Level of Пожирание for (Killing unit)))))))
        • Else - Actions
          • Set poziranie_str_real = (poziranie_str_real - 1.00)
          • Hero - Modify Strength of (Killing unit): Add 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to (4 + (Level of Пожирание for (Killing unit)))
        • Then - Actions
        • Else - Actions
          • Hero - Modify Strength of (Killing unit): Add 1
This passive spell heals hero for % of killed unit max health, and add some Strength. To avoid have such op spell, i made a real variable, that increases each time my hero kills a unit, u can see it in the triggers. When this variable becomes 1.00 or bigger, i substract 1.00 from variable and add 1 point of Str to my hero. Also i added a small chance to earn additional 1 point of Str, depending on the lvl of this spell.

The bug is - my hero earn 1 point of str EACH TIME he kills a unit.'


Oh my god thsi si so fucing stupid mistake. Please delete this thread someone. What a shame
 
Level 5
Joined
Aug 20, 2015
Messages
133
What is the default value of poziranie_str_real? 0?

I would advise that when you do Set poziranie_str_real = (poziranie_str_real - 1.00), just to set it to 0, and see if that works.

my mistake was here

  • poziranie Copy
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • poziranie_str_real Greater than 1.00
        • Then - Actions
          • Set poziranie_str_real = (poziranie_str_real + (0.08 + (0.03 x (Real((Level of Пожирание for (Killing unit)))))))
        • Else - Actions
          • Set poziranie_str_real = (poziranie_str_real - 1.00)
          • Hero - Modify Strength of (Killing unit): Add 1
poziranie_str_real Greater than 1.00 it must be like this :D
and i substract from my variable 1.00 instead of setting it to 0 because u may have some point left, if u have 0.99 and earns 0.3, so u will have 1 point of STR added and ur variable will save 0.29 point left
 
Status
Not open for further replies.
Top