• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

use enemy hero for 20s when you killed him

Status
Not open for further replies.
Level 3
Joined
May 12, 2012
Messages
41
hi guys!

some of you might have played LoL and do know mordekaiser & his ulti.
for those who don't, i want a spell that gives you control over the killed enemy hero (like a minion, no abilities, but level + attributes) for 20s.

i have tried alot of ways but none of them led to an end, so i'm kinda going crazy :s

guess the hint will be a custom script, cuz i can't handle JASS and also can't find a trigger-way...so, here are some of my thoughts:

can i use a cache? i want it to be playable in b-net, so i'm kinda unsure about storing and loading in a game cache (and also i wouldn't know how to)

changing the ownership & reviving instantly would also not work, cuz it would ruin the enemies revival time & you could use the abilities

my basic spell is Parasite, i think it gives more options in trigger.
the dmg is done directly by the ability and it summons a invisble InfectationDummy if the target unit dies.
i've also done a 2nd trigger just to set the dummy & caster variables by a "target unit creates a summoned unit" - caster is triggering unit, dummy is summoned unit.
for my main trigger, i got
  • Infectation
    • Ereignisse
      • Einheit - A unit Dies
    • Bedingungen
      • ((Triggering unit) has buff Infected ) Gleich True
    • Aktionen
      • Set InfectationTargetOriginalOwner = (Owner of (Dying unit))
      • Set InfectationTargetPosition = (Position of (Dying unit))
      • Set InfectationTarget = (Dying unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (InfectationCaster is alive) Gleich True
        • 'THEN'-Aktionen
        • 'ELSE'-Aktionen
          • Do nothing
now the big question,
what to do next??

i wonder alot if a simple variable-setting would also save attributes & skills & skill levels & items...got no clue how to go on and can't test the map alone...fast help very appreciated, i'll work another ability in meantime but be at the PC for the next hours! :3

oh and that "infected"-buff is a modified spell amplifier based off of parasite (not parasite (minion)), i used only this one for the spell because i think the one with (minion) would summon the skeletal minion
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
First of all, you want to prevent that unit from dying.
As I recall, Mordekaisers ultimate is instant on the target (not like Aatrox Passive or Guardian Angel) so you don't even have to add a custom ability of reincarnation.

When a unit is about to die (takes fatal damage... which is not an event in WC3), he will check if he has the buff "DONT KILL ME BECAUSE SOMEONE WANT ME ALIVE" and set his health to... maximum?
You also set some other stuff like vertex coloring, special effects (just a few visuals) and you change the owner of that unit.

Now you have another thing... after (...) seconds, that unit has to change back to it's original owner, change visuals back... and DIE!
So when that timer expires, you remove the buff, remove the visuals, kill the unit and change his ownership back.

I have a system that can do almost everything that you want.
In my signature is a link to it "Effect Over Time System".
It can give a unit buffs dynamically and can allow you to have un-dispellable buffs, etc.

Next to that, you need a Damage System. I would like to tell you that I know one that could help you but sorry. None that I have seen so far are actually working properly according to my tests.
However, Physical Damage Detection for GUI v1.2.0.1 by looking_for_help comes pretty close to that point.
All you have to do now is find out when a unit is taking fatal damage.
Now that there are a few problems with the order of the event responses, I would recommend you to use an event simulator.
I have one but it is JASS only.
Are you familiar with JASS? If so, I can just give you mine and it will all be settled.
If not... it would be hard.

Anyway I can make a simple trigger that would allow you to detect and prevent fatal damage.
 
Level 3
Joined
May 12, 2012
Messages
41
thanks so far, but as i said before,

changing the ownership & reviving instantly would also not work, cuz it would ruin the enemies revival time & you could use the abilities

and...

guess the hint will be a custom script, cuz i can't handle JASS and also can't find a trigger-way


the event of a dying unit is a generic one and it does declare fatal damage. afaik, the trigger i posted above does check for the buff on the dying unit. my question is, how to get a copy of the dying unit. all i've found was "create type of unit" and i could increase it's experience and take away it's abilites, but if the enemy hero would have bought some tomes, i want the copy to have these str/agi/int stats too.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
Let the hero die but disable add it to an exception to the revive system. You then instantly revive him at the point of death and change ownership to the person you want to control him. To prevent abilities being used I think the Ward ability can be used (not sure if reversible). 20 seconds later you remove the ability and restore ownership correctly. Might want to add the hero during that state to an exception list so that it cannot be re-applied in the case of an enemy with the ability using it one the animated hero.
 
Level 3
Joined
May 12, 2012
Messages
41
Let the hero die but disable add it to an exception to the revive system. You then instantly revive him at the point of death and change ownership to the person you want to control him. To prevent abilities being used I think the Ward ability can be used (not sure if reversible). 20 seconds later you remove the ability and restore ownership correctly. Might want to add the hero during that state to an exception list so that it cannot be re-applied in the case of an enemy with the ability using it one the animated hero.

thanks so far, but for the third time now, if i change the ownership of the dying hero for 20s at the point of time when his 30s revival timer should be starting, the killed player would have almost twice of the usual revival time, this is totally no option and i said so at the topic. sorta sad that the first 2 entries both want me to do exactly what i said not to possible....... v.v

*edit:
oh and there will be only one hero to use this ability, it's an ultimate, so don't worry about crashes^^
i'm just having a idea right in this moment...could i force the dying unit to cast a mirror image of itself and give the control to the enemy caster???
 
Level 3
Joined
May 12, 2012
Messages
41
You should start the revive timer as soon as you change the ownership, not when the 20 seconds run out. That should work ok as long as the revive time is longer than the control time.

can you go into details with that revive timer please...?
i thought it would be automated from the death of the hero.
 
Level 3
Joined
May 12, 2012
Messages
41
Maybe a dummy with resurrection kind of ability might work... however I never loved any of those spells without triggering.

triggering is absolutely okay, just not changing the ownership (out of my very noobish point of knowledge)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
thanks so far, but for the third time now, if i change the ownership of the dying hero for 20s at the point of time when his 30s revival timer should be starting, the killed player would have almost twice of the usual revival time, this is totally no option and i said so at the topic. sorta sad that the first 2 entries both want me to do exactly what i said not to possible....... v.v
In which case, you need not change the revive system much at all. Instead what you do is add an extra revive system which instantly revives the killed hero which should be controlled and then changes ownership for 20 seconds. After 20 seconds you revert ownership and kill it with ~10 seconds to spare for the revive timer. When the timer expires it gets revived where it should.

All that is needed is to prevent "double revives" from occurring with the main revive system, so that it registers only the first kill (before control) for the timer and the second one (reverting to dead) is ignored. A simple test for if the revive timer is running should suffice.
 
The way I see this is:
1.create new hero
2.run periodic loop /1sec for example/
3.order dummy to soul burn new hero to prevent casting spells /every 1sec/
4.kill new hero and remove from the game after 20sec

No need to touch original revieve system you have.
No need to touch original hero any more.

call this function in your If/then/else you show us /if infection caster is alive/:
JASS:
function Trig_mordekaiser_Actions takes nothing returns nothing
local unit target = GetTriggerUnit() //your target dying hero with buff
local real x = GetUnitX(target) // loc of dying hero
local real y = GetUnitY(target)
local integer i=0
local player pla = GetOwningPlayer(udg_InfectionCaster)

set udg_InfectionNewHero= CreateUnit(pla, GetUnitTypeId(target), x, y, 0.00) // new hero
call SetHeroLevelBJ( udg_InfectionNewHero, GetHeroLevel(target), true )
call SetHeroStr(udg_InfectionNewHero, GetHeroStr(target, false), true)
call SetHeroAgi(udg_InfectionNewHero, GetHeroAgi(target, false), true)
call SetHeroInt(udg_InfectionNewHero, GetHeroInt(target, false), true)
call SetHeroXP( udg_InfectionNewHero, GetHeroXP(target), true )

//add items:
    loop
        exitwhen i > 5
        set bj_lastCreatedItem = CreateItem(GetItemTypeId(UnitItemInSlot(target, i)), x, y)
        call UnitAddItem(udg_InfectionNewHero, bj_lastCreatedItem)
        call SetItemDroppable( bj_lastCreatedItem, false )
        call SetItemDropOnDeath( bj_lastCreatedItem, false )
        set i = i + 1
    endloop



set target=null
set pla=null
endfunction
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Have you ever played against mordekaiser in U.R.F?
Mordekaiser doesn't actually take control of a unit. Instead, a new unit of the exact type is created. This also fixes possible problems with reviving, as the clone and original unit can both exist simultaneously.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
@Xonok
Have you ever played taric on URF?
Stun duration 1.6.
Cooldown 2.8
Gemcraft: Reduces cooldown by 2 seconds on AA.
Actual gameplay: AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA
When you have 500 armor, you also deal 100 bonus damage on AA.

Try to 1v1 that!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
@Xonok
Have you ever played taric on URF?
Stun duration 1.6.
Cooldown 2.8
Gemcraft: Reduces cooldown by 2 seconds on AA.
Actual gameplay: AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA -> stun -> AA
When you have 500 armor, you also deal 100 bonus damage on AA.

Try to 1v1 that!

That actually seems like a good idea to try, lol.
 
Level 3
Joined
May 12, 2012
Messages
41
Have you ever played against mordekaiser in U.R.F?
Mordekaiser doesn't actually take control of a unit. Instead, a new unit of the exact type is created. This also fixes possible problems with reviving, as the clone and original unit can both exist simultaneously.

have you read my posts well?
i don't think so, because my detailed/abstractioned/exact problem is, that there are attribute increasing tombs on the map. so, if i just create a unit of the same type and set it's lvl up to the dying unit, it's strength might be 1000 less then the originals' strength. i really miss the "attribute comparison"...so i thought there might be a script for "call udg_SetStrength_to_#" or something similiar...
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Carrying over stats is not complicated really. With attributes you can use the appropriate GUI action, as Wietlol said.
With other stats such as health or damage(if you have them separately) you can use tomes or a bonusmod.

Furthermore, creating a new unit avoids any possibility of a double revive.
 
have you read my posts well?
i don't think so, because my detailed/abstractioned/exact problem is, that there are attribute increasing tombs on the map. so, if i just create a unit of the same type and set it's lvl up to the dying unit, it's strength might be 1000 less then the originals' strength. i really miss the "attribute comparison"...so i thought there might be a script for "call udg_SetStrength_to_#" or something similiar...

have you read anserws you get?
gave you complete soludion dude...
wont waste my time any more to try to help you again..
 
Status
Not open for further replies.
Top