• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Help][Spell] Mass Teleport with Blink Elements?

Status
Not open for further replies.
Level 2
Joined
Jan 26, 2008
Messages
12
I would like a spell that is similar to blink.

It teleports the user to a target point instantly.

The only difference is it also teleports the nearest 24 units too.

Thanks !
 
Level 11
Joined
Dec 11, 2007
Messages
888
first make a dummy spell based on Carrion Swarm and set the damage dealt to 0.01 then make this little trigger:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your dummy spell
    • Actions
      • Unit - Move (Casting unit) instantly to (Target point of ability being cast)
when the hero casts the spell it will move him instantly to the targeted point
 
Level 5
Joined
May 27, 2007
Messages
144
first make a dummy spell based on Carrion Swarm and set the damage dealt to 0.01 then make this little trigger:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your dummy spell
    • Actions
      • Unit - Move (Casting unit) instantly to (Target point of ability being cast)
when the hero casts the spell it will move him instantly to the targeted point
^^ why damage ?? you can just use blink spell and pick nearest unis.

try this one:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your dummy spell
    • Actions
      • Set teleportgroup - units in range (eg 300) of position of casting unit matching condiction ( enemy of hero or ally)
      • Set teleportplace - (Target point of ability being cast)
      • Unit Group - pick every unit in teleportgroup and do multiple actions
        • Actions
          • Special Effect - Create specialeffect on picked unit .... blink
          • Special Effect - Destroy last created specialeffect
          • Unit - Move (picked unit) instantly to teleportplace
      • Custom script - Call DestroyGroup (udg_teleportgroup)
      • Custom script - Call RemoveLocation (udg_teleportplace)
this should work if not tell me and i do this spell 4 u
 
Level 9
Joined
Mar 25, 2005
Messages
252
JASS:
function Trig_MTWBE_Conditions takes nothing returns boolean
	return GetSpellAbilityId() == 'AOsh'
endfunction
function Trig_MTWBE_Radius takes nothing returns real
	return 500.00
endfunction
function Trig_MTWBE_Filters takes nothing returns boolean
	return GetOwningPlayer(GetFilterUnit()) == bj_groupEnumOwningPlayer and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false
endfunction
function Trig_MTWBE_Actions takes nothing returns boolean
	local location loc = GetSpellTargetLoc()
	local unit u = GetTriggerUnit()
	local real dx = GetLocationX(loc) - GetUnitX(u)
	local real dy = GetLocationY(loc) - GetUnitY(u)
    local integer i = 0
    local group g = CreateGroup()
    set bj_groupEnumOwningPlayer = GetOwningPlayer(u)
    call GroupEnumUnitsInRange(g, GetUnitX(u), GetUnitY(u), Trig_MTWBE_Radius(), Filter(function Trig_MTWBE_Filters))
    loop
        exitwhen u == null or i == 24
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", GetUnitX(u), GetUnitY(u)))
        call SetUnitX(u, GetUnitX(u) + dx)
        call SetUnitY(u, GetUnitY(u) + dy)
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", GetUnitX(u), GetUnitY(u)))
        call GroupRemoveUnit(g, u)
        set u = FirstOfGroup(g)
        set i = i + 1
    endloop
	call RemoveLocation(loc)
	set loc = null
	set u = null
	call DestroyGroup(g)
	set g = null
	return false
endfunction
function InitTrig_MTWBE takes nothing returns nothing
	set gg_trg_MTWBE = CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(gg_trg_MTWBE, EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddCondition(gg_trg_MTWBE, And(Filter(function Trig_MTWBE_Conditions), Filter(function Trig_MTWBE_Actions)))
endfunction
This version retains the formation of the blinked units.

You can implement it like this:
  • create a dummy spell in the object editor based on any spell that has a target
  • create a new trigger in the trigger editor and name it MTWBE
  • while having your new trigger selected go to Edit --> Convert to Custom Text
  • replace the text inside the editor with my script
  • replace the AOsh part at the top of the script with the rawcode of your dummy spell
  • to get that rawcode go to the object editor, find your spell and press Ctrl+D
  • the rawcode is the first 4 characters after the ability's icon
 
Last edited:
Level 2
Joined
Jan 26, 2008
Messages
12
first make a dummy spell based on Carrion Swarm and set the damage dealt to 0.01 then make this little trigger:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your dummy spell
    • Actions
      • Unit - Move (Casting unit) instantly to (Target point of ability being cast)
when the hero casts the spell it will move him instantly to the targeted point

Uhm, if I wanted a spell that would simply move the caster to a target point, I would use Blink. What I need is a spell that is just like MASS TELEPORT except it targets any point (Like Blink!) no offense intended

The hell ? ever played wc3 and saw the spell "Mass Teleport" ? -.-

Yes and you are aware that Mass Teleport targets a friendly/allied unit/building and what I want is for it to target a point of terrain. Sorry if I was unclear.

mass teleport leaves a small special effect on the ground even if you remove all the special effects

I tried MT and changing targets allowed to "terrain" but it didn't seem to work. I want the range to be way smaller and the MT instant like blink.

^^ why damage ?? you can just use blink spell and pick nearest unis.

try this one:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your dummy spell
    • Actions
      • Set teleportgroup - units in range (eg 300) of position of casting unit matching condiction ( enemy of hero or ally)
      • Set teleportplace - (Target point of ability being cast)
      • Unit Group - pick every unit in teleportgroup and do multiple actions
        • Actions
          • Special Effect - Create specialeffect on picked unit .... blink
          • Special Effect - Destroy last created specialeffect
          • Unit - Move (picked unit) instantly to teleportplace
      • Custom script - Call DestroyGroup (udg_teleportgroup)
      • Custom script - Call RemoveLocation (udg_teleportplace)
this should work if not tell me and i do this spell 4 u

Does this keep them in the same formation like Mass Teleport? Thanks !


Set also a point for the units position as it leaks.

Thanks !

Whats the point giving a Jass code which can be done easly in GUI to people who do not know (I guess) Jass ?

*burns with shame*

I dont make spells in GUI. It's either jass or nothing.

How do I put Jass in? I would totally use it I'm just a Jass noob and only have used WEU. THANKS a lot though
 
Level 9
Joined
Mar 25, 2005
Messages
252
How do I put Jass in? I would totally use it I'm just a Jass noob and only have used WEU. THANKS a lot though

When you are in the trigger editor you can select any trigger, go to Edit --> Convert to Custom Text. What you see next is where you put jass in.
If you follow the steps explained in my first post you should be able to get it working even if you dont know anything about jass. If you have troubles with that you can always send the map to me and I can put the spell in it if you want.
 
Level 3
Joined
Mar 25, 2008
Messages
56
sorry to bring this topic up but when i use this spell it blinks buildings along too.how to i remove this?
 
Level 9
Joined
Mar 25, 2005
Messages
252
The actions function is used in a boolexpr which is why it has to return a boolean. Conditions are faster than actions which is why I use it in a boolexpr. The difference in this case is practically insignificant, but I see no reason to change it.

Your other suggestion would be better than what I do when there are only a few units around. When there are more it pays off to use the variable instead of calling those 2 natives once per each filtered unit.
 
Level 3
Joined
Mar 25, 2008
Messages
56
thanks it works now.but i have another noob problem,i need a GUI to make the skill cooldown cause after i successfully cast it, it does not cool down.not sure why
 
Level 9
Joined
Mar 25, 2005
Messages
252
It was caused by a bug in the script, which has now been fixed.
In theory the new version can crash your map if you blink units outside the map but I tested it and wasn't able to crash my map. Maybe I wasn't able to blink them far enough but in that case neither should you :).
 
Status
Not open for further replies.
Top