• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

1 Player Messages

Status
Not open for further replies.
Level 13
Joined
Oct 27, 2008
Messages
1,176
  • Gold NonHero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to False
    • Actions
      • Set Gold = ((Integer((Max life of (Triggering unit)))) / (Random integer number between 10 and 100))
      • Player - Add Gold to (Owner of (Killing unit)) Current gold
      • Game - Display to (All players matching ((Owner of (Killing unit)) Equal to Player 1 (Red))) the text: (+ + ((String(Gold)) + Gold))
      • Game - Display to (All players matching ((Owner of (Killing unit)) Equal to Player 2 (Blue))) the text: (+ + ((String(Gold)) + Gold))
      • Game - Display to (All players matching ((Owner of (Killing unit)) Equal to Player 3 (Teal))) the text: (+ + ((String(Gold)) + Gold))
      • Etc
I made this thinking it was setup correctly but was wrong
Everytime someone kills a unit every player gets a message saying they earned X amount of gold.
(I didn't add in the past part of the trigger
I need it to just message the owner of the Killing Unit
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Try to find under "Game - " this little diddy:

  • Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: :)
It should be Display Text to Player (Auto or Elicit Timed) It's a little farther down too seperate from just show text message (Which is to a force.)

I havent found Display to player in GUI. Only display to force.

So do this:
  • Untitled Trigger 019
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set PlayerGroup = (Player group((Owner of (Killing unit)))) // Convert player t0 player group
      • Game - Display to PlayerGroup for 5.00 seconds the text: Something here
      • Custom script: call DestroyForce(udg_PlayerGroup)
or
  • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetKillingUnit()) , 0 , 0 , "+" + I2S(udg_Gold) + " Gold" )
or add the colour code, the gold amount becomes coloured with this:
  • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetKillingUnit()) , 0 , 0 , "+|cffffcc00" + I2S(udg_Gold) + "|r Gold" )
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
thanks maker
so the custom script is to send a message to owner of killing unit that they earned X gold
Wont be able to test it right now but anyways thanks
 
Last edited:
Level 13
Joined
Oct 27, 2008
Messages
1,176
Just checking if this works too, not use to playing with Custom scripts much
  • Death Strike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Death's Guardian) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Death Strike 1
            • Then - Actions
              • Set Attacking = (Triggering unit)
              • Set DeathStrikeX = 2.00
              • Set DeathStrike = ((Strength of (Triggering unit) (Include bonuses)) x (Integer(DeathStrikeX)))
              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DeathStrike)) damage of attack type Normal and damage type Enhanced
              • Set DeathStrikeGained = (DeathStrike / 10)
              • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetAttackingUnit()) , 0 , 0 , "+You healed" + I2S(udg_DeathStrikeGained))
              • Unit - Set life of Attacking to ((Life of Attacking) + ((Real(DeathStrike)) / 10.00))
            • Else - Actions
Its to show amount of damage done / 10 healed
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Unit - A unit Begins casting an ability
-> Starts the effect of an ability

Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetAttackingUnit()) , 0 , 0 , "+You healed" + I2S(udg_DeathStrikeGained))
-> GetOwningPlayer(udg_Attacking)

There's also no need to have to if/then/elses there. Just use one and make it have both of those conditions.
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
its a 4 part thing
if hero has a item that effects it it gains +1 to the damage
and the skills 2 lvls as well
  • Death Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Death's Guardian) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Death Strike 1
            • Then - Actions
              • Set Attacking = (Triggering unit)
              • Set DeathStrikeX = 2.00
              • Set DeathStrike = ((Strength of (Triggering unit) (Include bonuses)) x (Integer(DeathStrikeX)))
              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DeathStrike)) damage of attack type Normal and damage type Enhanced
              • Set DeathStrikeGained = (DeathStrike / 10)
              • Unit - Set life of Attacking to ((Life of Attacking) + ((Real(DeathStrike)) / 10.00))
              • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetAttacking()) , 0 , 0 , "+You healed" + I2S(udg_DeathStrikeGained)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Death Strike 2
                • Then - Actions
                  • Set Attacking = (Triggering unit)
                  • Set DeathStrikeX = 2.50
                  • Set DeathStrike = ((Strength of (Triggering unit) (Include bonuses)) x (Integer(DeathStrikeX)))
                  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DeathStrike)) damage of attack type Normal and damage type Enhanced
                  • Game - Display to (All players) the text: (You healed + (String((DeathStrike / 10))))
                  • Unit - Set life of Attacking to ((Life of Attacking) + ((Real(DeathStrike)) / 10.00))
                  • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetAttacking()) , 0 , 0 , "+You healed" + I2S(udg_DeathStrikeGained)
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Death's Guardian) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Death Strike 1
                • Then - Actions
                  • Set Attacking = (Triggering unit)
                  • Set DeathStrikeX = 3.00
                  • Set DeathStrike = ((Strength of (Triggering unit) (Include bonuses)) x (Integer(DeathStrikeX)))
                  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DeathStrike)) damage of attack type Normal and damage type Enhanced
                  • Game - Display to (All players) the text: (You healed + (String((DeathStrike / 10))))
                  • Unit - Set life of Attacking to ((Life of Attacking) + ((Real(DeathStrike)) / 10.00))
                  • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetAttacking()) , 0 , 0 , "+You healed" + I2S(udg_DeathStrikeGained)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ability being cast) Equal to Death Strike 2
                    • Then - Actions
                      • Set Attacking = (Triggering unit)
                      • Set DeathStrikeX = 3.50
                      • Set DeathStrike = ((Strength of (Triggering unit) (Include bonuses)) x (Integer(DeathStrikeX)))
                      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DeathStrike)) damage of attack type Normal and damage type Enhanced
                      • Game - Display to (All players) the text: (You healed + (String((DeathStrike / 10))))
                      • Unit - Set life of Attacking to ((Life of Attacking) + ((Real(DeathStrike)) / 10.00))
                      • Custom script: call DisplayTextToPlayer( GetOwningPlayer(GetAttacking()) , 0 , 0 , "+You healed" + I2S(udg_DeathStrikeGained)
                    • Else - Actions
            • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top