• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Hero gain exp through another unit.

Status
Not open for further replies.
Level 5
Joined
Jun 21, 2013
Messages
116
I made a hero who posesses units, and I need a way to make hero gain exp when the posessed unit kills a unit that has exp reward.

Basically, when unit X kills an enemy, unit Y gets exp reward.

I sense it's pretty simple and that I just can't find the right trigger.
 
This simple,but this thread should be in the triggers and scripts section,I think
[Trigger=the trigger]
Events
Units - A unit Dies

Conditions
(Killing unit) Equal to Possesed Unit <gen>
Actions
Hero - Add 100 experience to Posseser <gen>
[/trigger]
 
This simple,but this thread should be in the triggers and scripts section,I think
[Trigger=the trigger]
Events
Units - A unit Dies

Conditions
(Killing unit) Equal to Possesed Unit <gen>
Actions
Hero - Add 100 experience to Posseser <gen>
[/trigger]

I know about that way. I was wondering if there is a way to get the amount that killed unit would normally give instead of fixed amount?
 
try this.. ( note that unit X must be a hero unit - can aquire exp - too )

  • Events
    • Unit - A unit dies
  • Conditions
    • Condition - (Type of(Killing unit)) equals to - X unit type
  • Actions
    • Custom script: local unit u = GetKillingUnit()
    • Custom script: local int i = GetHeroXP(u)
    • Custom script: call SetHeroXP(udg_YUnitVar, GetHeroXP(udg_YUnitVar)+i , true)
    • Custom script: call SetHeroXP(u,0,false)
sry EDITED

It should work , unless unit dies event occures before xp distribution:/
 
if thats the situation then there is no other way AFAIK
I can only imagine a DDS which is able to change the damage source:P

If his skill can posses non-hero units there is 2 option

1)Moving a dummy hero with possessed unit.

2)When possesed unit kills a unit (or some alliance), calculate the amount of experience that possesed would receive if it was a hero.
 
Yeah there is a formula, you just need to know 4 values from gameplay constants.This is how default exp looks like.

xp bounty for level 1 creep = 25
xp bounty for level X creep = xp bounty for level X-1 creep + 5*X + 5

25,40,60,85..... and so on(+5 addition)

there is also a formula for heroes.
 
Status
Not open for further replies.
Back
Top