Trigger help.

K

KaiN2007

Guest
Can any1 make me a trigger for a item than when u die, respawns you at start like "Aegis of the Immortal" at dota?

this is aegis script:

Code:
// OpenDota 6.41
// inspired by everyone who posted on forum threads and feedback page

// Objects used:
// 'olig' = Aegis of the Immortal
// 'H00I' = Geomancer

// DEBUG Trigger Number : 203
function Trig_Aegis_Conditions takes nothing returns boolean
	if(GetItemTypeId(GetManipulatedItem())!='olig')then
		return false
	endif
	return true
endfunction

function kgkg takes unit pgF returns nothing
	local location lHS
	if(PlayerIsScourge(GetOwningPlayer(pgF)))then
		set lHS=GetRectCenter(gg_rct_ScourgeHeroSpawn)
	else
		set lHS=GetRectCenter(gg_rct_SentinelHeroSpawn)
	endif
	call HsHs(pgF,lHS)
	call RemoveLocation(lHS)
endfunction

function kGkG takes unit pEU returns nothing
	if GetUnitTypeId(pEU)=='H00I'then
		call kgkg(pEU)
	endif
endfunction

function Trig_Aegis_Actions takes nothing returns nothing
	local unit lfo=GetTriggerUnit()
	local location lfd
	if(PlayerIsSentinel(GetOwningPlayer(lfo)))then
		set lfd=GetRectCenter(gg_rct_SentinelHeroSpawn)
	else
		set lfd=GetRectCenter(gg_rct_ScourgeHeroSpawn)
	endif
	call PolledWait(3.)
	call PanCameraToTimedLocForPlayer(GetOwningPlayer(lfo),lfd,1.)
	call SetUnitPositionLoc(lfo,lfd)
	call kGkG(GetTriggerUnit())
	call RemoveLocation(lfd)
	if udg_A5 then
		call PauseUnit(lfo,true)
		call PolledWait(6)
		call PauseUnit(lfo,true)
	endif
	call gDgD(lfo)
endfunction

function StartTrigger_Aegis takes nothing returns nothing
	set gg_trg_Aegis=CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(gg_trg_Aegis,EVENT_PLAYER_UNIT_USE_ITEM)
	call TriggerAddCondition(gg_trg_Aegis,Condition(function Trig_Aegis_Conditions))
	call TriggerAddAction(gg_trg_Aegis,function Trig_Aegis_Actions)
endfunction

function InitTrig_Aegis takes nothing returns nothing
endfunction
thanks.
 

Duwenbasden

Ver 6 CREATE energy AS SELECT * FROM u.energy
Reaction score
165
Event
A unit dies

Condition
unit has item of type "Ankh" equals to true
unit is a hero = true

Action
Move the unit to the Altar
 
K

KaiN2007

Guest
thanks, but still cant find <<unit has item of type "Ankh">>


Edit - found it, ty :D
 
K

KaiN2007

Guest
but still dose not work :( i've try to remove hero condition. nothing, still respawn where he dies.
 

zll7

New Member
Reaction score
17
your probably having the item(ankh) do its action which is overriding the trigger... This is of course assuming that the item is using the revive action... Just a thought...
 

waaaks!

Zinctified
Reaction score
255
maybe theres a function that detects if the hero is revived by the ankh...
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
there isn't one (AFAIK)
but if i remember right there was an event like - Unit revives or something like that mabye this could help u
 
K

KaiN2007

Guest
ty all for helping, i've use:


Code:
    Events
        Unit - A unit Uses an item
    Conditions
        ((Triggering unit) has an item of type Ankh) Equal to True
    Actions
        Unit - Move (Triggering unit) instantly to (Center of Start <gen>)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
if the unit has used it the item won't be on the unit anymore try instead:
Code:
    Events
        Unit - A unit Uses an item
    Conditions
        (Item Being Manipulated) Equal to Ankh
    Actions
        Set Point = Center of Start <gen>
        Unit - Move (Triggering unit) instantly to Point
        Custom script:    call RemoveLocation(udg_Point)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top