HELP with items!! and hero reviving

Axtyler#1

New Member
Reaction score
1
ok so im making a map where there are item recipies. I get how to make recipies but what i dont get is how to make it say in the information box that it requires certain items to make it. For example in dota when u want to buy an item it says in the information tab
Requires
Ring of Regeneration
Ring of Protection

My other question is how to make it so that heroes revive in 20 seconds after they die. Again i use the example from dota. When your hero dies in dota, it shows a timer telling you that you have 20 seconds left until you hero is revived

Any help is greatly appreciated:D
 

Komaqtion

You can change this now in User CP.
Reaction score
469
1. You just add those line to the tooltip in the object editor ;)
2. Does it have to be MUI ?? (MUI = Multi Unit Instanceable = Can be cast by several unit at the same time AND WORKING FOR ALL OF THEM) or can it just be MPI ? ((MPI = Multi Player Instanceable = Can be cast by one unit per player at the same time AND WORKING FOR ALL OF THEM)
 

Axtyler#1

New Member
Reaction score
1
Thanks and Confused

1. ok i get what ur saying bout my 1st question but, do you kno how to make the letters yellow like in dota? In dota it says in yellow "Requires" and then what it requires in white.
2. Im not sure if the MUI thing is what i want or not=/ all i want to do is if lets say Blues hero dies in the middle of the map then he will revive in 20 seconds at the top of the map.
 

Danis[h]

New Member
Reaction score
19
For hero revival I use this in my map

Just add a timer window and change the wait to 20 seconds.
It will work even if the player has more than one hero.
Trigger:
  • Hero Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
    • Actions
      • Custom script: local player HeroOwner = GetOwningPlayer(GetDyingUnit())
      • Custom script: local unit ress = GetDyingUnit()
      • Custom script: local location t = udg_HeroRespawnLoc[GetConvertedPlayerId(GetOwningPlayer(ress))]
      • Game - Display to (Player group((Owner of (Dying unit)))) the text: |c00ffcc00Your hero...
      • Wait 15.00 seconds
      • Custom script: call ReviveHeroLoc( ress, t, true )
      • Custom script: call PanCameraToTimedLocForPlayer( HeroOwner, t, 0.00 )
      • Custom script: set ress = null
      • Custom script: set t = null
      • Custom script: set HeroOwner = null
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Here's a little more efficient trigger :D
JASS:
function Trig_Revive_Heroes_Conditions takes nothing returns boolean
    if IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true then
        return true
    endif
    return false
endfunction

function Trig_Revive_Heroes_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player p =GetOwningPlayer(u)
    local location loc = Location(GetRectCenterX(gg_rct_Revive_Area),GetRectCenterY(gg_rct_Revive_Area))
    call TriggerSleepAction(20)
    call ReviveHeroLoc( u, loc,true )
    call PanCameraTo(GetLocationX(loc),GetLocationY(loc))
    call RemoveLocation(loc)
    set u = null
    set p = null
endfunction

//===========================================================================
function InitTrig_Revive_Heroes takes nothing returns nothing
    set gg_trg_Revive_Heroes = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_Heroes, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Revive_Heroes, Condition( function Trig_Revive_Heroes_Conditions ) )
    call TriggerAddAction( gg_trg_Revive_Heroes, function Trig_Revive_Heroes_Actions )
endfunction


or

Trigger:
  • Revive Heroes Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local player p =GetOwningPlayer(u)
      • Custom script: local location loc = Location(GetRectCenterX(gg_rct_Revive_Area),GetRectCenterY(gg_rct_Revive_Area))
      • Custom script: call TriggerSleepAction(20)
      • Custom script: call ReviveHeroLoc( u, loc,true )
      • Custom script: call PanCameraTo(GetLocationX(loc),GetLocationY(loc))
      • Custom script: call RemoveLocation(loc)
      • Custom script: set u = null
      • Custom script: set p = null


The only thing that needs changing is:
JASS:
gg_rct_Revive_Area

change that to gg_rct_(Your_Region) and it should work ;)
 

Danis[h]

New Member
Reaction score
19
I didn't remove the location because it's pointing to a different udg_ variable that I have to use later :)
 

simonake

New Member
Reaction score
72
Too hard?

Why not
Trigger:
  • Events
    • Unit - A Unit Dies
    • Conditions
      • (Triggering unit) is a Hero Equal to TRUE
    • Actions
      • Wait 10 seconds
      • Unit - Revive (Triggering unit) Instantly at <>
 

Danis[h]

New Member
Reaction score
19
Too hard?

Why not
Trigger:
  • Events
    • Unit - A Unit Dies
    • Conditions
      • (Triggering unit) is a Hero Equal to TRUE
    • Actions
      • Wait 10 seconds
      • Unit - Revive (Triggering unit) Instantly at <>

what will happen then if two heroes die within the timeframe of 10 seconds.
the first hero dies at 0, and the second hero dies 3 seconds later? The second hero would revive 7 seconds later, leaving the first dying hero dead indefinately?
 

simonake

New Member
Reaction score
72
No that's not what's happening.

(Triggering unit) is like a local. It has the same property of a local. It work for unit respawn it should for hero too.
 

Danis[h]

New Member
Reaction score
19
No that's not what's happening.

(Triggering unit) is like a local. It has the same property of a local. It work for unit respawn it should for hero too.

I just tested this, and it seems that you're right... Didn't know :)
 

Axtyler#1

New Member
Reaction score
1
Thank YOU!!

No that's not what's happening.

(Triggering unit) is like a local. It has the same property of a local. It work for unit respawn it should for hero too.

Yea his does work. And thanks for the other guys for trying. Yours probably worked fine im just not familiar enough with Editor to get custom scripts yet D=. If i could id give rep to each of ya thanks again:thup:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just so you know, triggering unit can get a little unstable after too long waits :S
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top