• 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.

[Trigger] Summons

Status
Not open for further replies.
Level 3
Joined
Feb 21, 2012
Messages
38
Guys i want a trigger in which-
-A hero summons a unit
-the summon is also a hero
-the summon has attributes as-
- str of caster/2
-agi of cast/2
-int of caster/2
the hero isnt revivable and when he dies he is revived by casting the skill again
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
-A hero summons a unit
What do you mean by "summons"?

-the summon is also a hero
Make a new Unit object entry based on a hero entry like the human paladin and customize it however you want.

-the summon has attributes as-
- str of caster/2
-agi of cast/2
-int of caster/2
Simple integer division. You set the unit's stats to the stats of the hero divided by 2.

the hero isnt revivable and when he dies he is revived by casting the skill again
What skill? You have mentioned nothing about a skill before now.

Anyway you could probably implement the behaviour you want here using a conditional statement.

Do remember that multiple heroes will leach EXP unless you use a custom experience system or make it so that leaching heroes do not reduce the experience awarded.
 
Level 3
Joined
Feb 21, 2012
Messages
38
sry.........................

A hero summons a unit means that a hero uses a skill to summon (like feral spirit summons 2 dire wolves)
the summon is a hero................................ i did till here

gimme the trigger for -
stats of unit as -
int(of summoning hero)/2
str/2
agi/2
and when this summon dies he cannto be revived by altar and can be revived by using the skill by which he was summoned
 
if i remember rightly it goes somthing like this

Event:
unit - unit begins casting an ability
Conditions
Ability - Ability being cast = [your ability]
Actions:
unit - create 1 [your summon] at the possition of TempLoc
unit - add a 30 second generic timer to last created unit
set - Stats = strength/2 (your formula here)
unit - set unit stats = stats

i think this is how it goes but i cant be sure till i get ome and check with world editor
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
and when this summon dies he cannto be revived by altar and can be revived by using the skill by which he was summoned
There is no way, as far as I remember, to retain a hero while making it un-revivable at an alter.

The script you are after using for a single unit looks somewhat like this.
JASS:
// globals
unit summon = null

// body of code that you put into the function run when casting the ability
local unit caster = GetTriggerUnit()
if summon == null then
    // change 'H000' to the type of hero you want spawned
    set summon = CreateUnit(GetOwningPlayer(caster), 'H000', GetWidgetX(caster), GetWidgetY(caster), 0)
endif
call ReviveHero(summon, GetWidgetX(caster), GetWidgetY(caster), true)
call SetHeroStr(summon, GetHeroStr(caster, true)/2, true)
call SetHeroAgi(summon, GetHeroAgi(caster, true)/2, true)
call SetHeroInt(summon, GetHeroInt(caster, true)/2, true)
Ofcourse the global is placed where appropiate and the rest is placed inside the function that runs when the ability is cast. Not MUI and does not hanlde experience or revival problems.
 
Status
Not open for further replies.
Top