Magic Raise's side effect[solved it myself]

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2017
Messages
251
I thought of a better trigger code for the spell. The problem is that the following text 'You don't have enough hit points for the spell.' must show up if the Spell Breaker's health (((Life of (Casting Unit))-160.00 => 1) isn't enough. I know I'm asking a dumb question.
 
Level 6
Joined
Aug 5, 2017
Messages
251
Well, guess what? I fixed the trigger almost instantly, but...
  • The bad news
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Raise
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of (Casting unit)) - 160.00) Greater than 1.00
        • Then - Actions
          • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) - 160.00)
          • Special Effect - Create a special effect attached to the overhead of (Casting unit) using war3mapImported\RedSadEmoji.mdx
          • Wait 17.00 seconds
          • Special Effect - Destroy (Last created special effect)
          • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 160.00)
          • Special Effect - Create a special effect attached to the origin of (Casting unit) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Unit - Order (Casting unit) to Stop
          • Game - Display to (All players controlled by a User player) for 8.00 seconds the text: You don't have enou...
The effect is there, but I still use the 17 mana. Does anyone know a way to fix?
 
Level 6
Joined
Aug 5, 2017
Messages
251
Remember when
pick-a-chew said my formar Magic Raise code was very weird? I made the code way better and fixed the mana issue myself. See code below:
  • The bad news
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Raise
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of (Casting unit)) - 160.00) Greater than 1.00
        • Then - Actions
          • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) - 160.00)
          • Special Effect - Create a special effect attached to the overhead of (Casting unit) using war3mapImported\RedSadEmoji.mdx
          • Wait 17.00 seconds
          • Special Effect - Destroy (Last created special effect)
          • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 160.00)
          • Special Effect - Create a special effect attached to the origin of (Casting unit) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Unit - Order (Casting unit) to Stop
          • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 17.00)
          • Game - Display to (All players controlled by a User player) for 5.00 seconds the text: You don't have enou...
I guess most of you already know the solution, but for those who don't:
  • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 17.00)
Edit: The white text doesn't bother me.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
Wc3 uses html colour codes for text

Simply use |c to initiate the use of colors then its a 8 didget code the the first 2 are transparency the next 6 are the red blue green % colour codes

Its best to just leav the first 2 as "ff" (the transparency)

Use |r to stop the color change

So you would use
|cffffcc00 (your text) |r
This is the yellow your after for your text

There is a list of the team colours somewhere here on the hive also u can even google "html colour codes" to find what ever colours u want.



Also note that ur trigger is not MUI meaning if muitiple units use this it will not work properly
 
Level 6
Joined
Aug 5, 2017
Messages
251
I'm using method 1, since method's 2 and 3 are difficult.
I created HashTable as a hashtable and HashTimer as a Real variable. I placed these 2 at the Melee Initialization trigger:
  • Hashtable - Save 17.00 as 0 of 0 in HashTable
  • Set HashTimer = (Load 0 of 0 from HashTable)
After that, I replaced the Wait from the Actions slot with:
  • Wait HashTimer seconds
Either that will work or I screwed it up.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
that will not work u cant use a wait.

ull need a 1 second periodic trigger for ur timer setting the hashtimer=hashtimer +1 then if = 17 do your other triggers
your also saving it wrong it will overight when the next 1 is cast

ill do it for you tomorrow if u havent worked it out
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
ok well iv created the spell

the thing is the spell will still go on cool down if not enough hp. i do not know hot to get around this i tried to stop the casting like this but it didnt do anything


  • Magic raise low hp
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Life of (Triggering unit)) Less than 161.00
      • (Ability being cast) Equal to Magic Raise
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • Game - Display to (All players matching ((Owner of (Casting unit)) Equal to (Matching player))) the text: |cffffcc00 Not enou...
 

Attachments

  • magic raise.w3x
    20.1 KB · Views: 63
Status
Not open for further replies.
Top