• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Simple Revive Sys

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
[highlight]Revive System[/code]
* Version 1.00
spells_5417_screenshot.jpg


* Hero Die
JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
//
//________________________________________________________________________________________________
//
//           |-----\   |------| \        /  |---------|  \        / |-----|
//           |      |  |         \      /        |        \      /  |
//           |-----/   |---|      \    /         |         \    /   |---|
//           |    \    |           \  /          |          \  /    |
//           |     \   |------|     \/      |---------|      \/     |-----|
 //
//              by Silver Dust
//
//              Version 1.00
//
// -----------------------------------------------------------------------------------------------
//  What is Revive?
//  Revive is event that makes your hero life back.
// -----------------------------------------------------------------------------------------------
//
//________________________________________________________________________________________________
//      How to Import?
// -----------------------------------------------------------------------------------------------
//
//  1. Go to trigger editor, create a new trigger and go to Edit > Convert to Custom Text
//  2. Copy (Ctrl + C) and Paste (Ctrl + V) all the data here into that trigger
//  3. Go to Variables (Ctrl + B) and create a new variables, 
//                You're done!
// -----------------------------------------------------------------------------------------------
//
function Trig_Hero_Die_JASS_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Die_JASS_Actions takes nothing returns nothing
    // // //// // //// // //// // //// // //// // //// // //// // ////
    // // SPAWNING DUMMY
    // // //// // //// // //// // //// // //// // //// // //// // ////
    set udg_HR_HERO_DIE_LOC[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetUnitLoc(GetDyingUnit())
    set udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetDyingUnit()
    set udg_HR_DUMMY_LIFE_INCREASE[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( 0.40 - ( 0.01 * I2R(GetHeroLevel(udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])) ) )
    call CreateNUnitsAtLoc( 1, udg_HR_DUMMY, GetOwningPlayer(udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]), udg_HR_HERO_DIE_LOC[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))], GetUnitFacing(udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]) )
    call GroupAddUnitSimple( GetLastCreatedUnit(), udg_HR_UNITG )
    call SetUnitAnimation( GetLastCreatedUnit(), "birth" )
    call AddSpecialEffectLocBJ( GetUnitLoc(GetLastCreatedUnit()), "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call SetUnitLifeBJ( GetLastCreatedUnit(), 1.00 )
    // // //// // //// // //// // //// // //// // //// // //// // ////
    // // //// // //// // //// // //// // //// // //// // //// // ////
endfunction

//===========================================================================
function InitTrig_Hero_Die_JASS takes nothing returns nothing
    set gg_trg_Hero_Die_JASS = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Die_JASS, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Hero_Die_JASS, Condition( function Trig_Hero_Die_JASS_Conditions ) )
    call TriggerAddAction( gg_trg_Hero_Die_JASS, function Trig_Hero_Die_JASS_Actions )
endfunction
* Hero Die Loop
JASS:
//TESH.scrollpos=64
//TESH.alwaysfold=0
function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func001001001002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func003001001002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001Func001C takes nothing returns boolean
    if ( not ( udg_HR_EFFECT == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001Func002Func002001001002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001Func002C takes nothing returns boolean
    if ( not ( udg_HR_MANA == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001Func003C takes nothing returns boolean
    if ( not ( udg_HR_SELECT == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001Func004C takes nothing returns boolean
    if ( not ( udg_HR_CAMERA == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Die_Loop_JASS_Func002Func001C takes nothing returns boolean
    if ( not ( GetUnitLifePercent(GetEnumUnit()) == 100.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_Die_Loop_JASS_Func002A takes nothing returns nothing
    if ( Trig_Hero_Die_Loop_JASS_Func002Func001C() ) then
        if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func001C() ) then
            call ReviveHeroLoc( GroupPickRandomUnit(GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnumUnit()), Condition(function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func003001001002))), udg_HR_REVIVE_POINT[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], true )
        else
            call ReviveHeroLoc( GroupPickRandomUnit(GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnumUnit()), Condition(function Trig_Hero_Die_Loop_JASS_Func002Func001Func001Func001001001002))), udg_HR_REVIVE_POINT[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], false )
        endif
        if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func002C() ) then
            call SetUnitManaPercentBJ( GroupPickRandomUnit(GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnumUnit()), Condition(function Trig_Hero_Die_Loop_JASS_Func002Func001Func002Func002001001002))), 100 )
        else
        endif
        if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func003C() ) then
            call SelectUnitForPlayerSingle( udg_HR_HERO_PLAYER[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], GetOwningPlayer(GetEnumUnit()) )
        else
        endif
        if ( Trig_Hero_Die_Loop_JASS_Func002Func001Func004C() ) then
            call SmartCameraPanBJ( GetOwningPlayer(GetEnumUnit()), udg_HR_REVIVE_POINT[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))], 0.5 )
        else
        endif
        call SetUnitAnimation( GetEnumUnit(), "death" )
        call UnitApplyTimedLifeBJ( 0.75, 'BTLF', GetEnumUnit() )
    else
        call SetUnitLifePercentBJ( GetEnumUnit(), ( GetUnitLifePercent(GetEnumUnit()) + udg_HR_DUMMY_LIFE_INCREASE[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))] ) )
    endif
endfunction

function Trig_Hero_Die_Loop_JASS_Actions takes nothing returns nothing
    set udg_HR_UNITG = GetUnitsOfTypeIdAll(udg_HR_DUMMY)
    call ForGroupBJ( udg_HR_UNITG, function Trig_Hero_Die_Loop_JASS_Func002A )
    call DestroyGroup(udg_HR_UNITG)
endfunction

//===========================================================================
function InitTrig_Hero_Die_Loop_JASS takes nothing returns nothing
    set gg_trg_Hero_Die_Loop_JASS = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Hero_Die_Loop_JASS, 0.10 )
    call TriggerAddAction( gg_trg_Hero_Die_Loop_JASS, function Trig_Hero_Die_Loop_JASS_Actions )
endfunction

Keywords:
Revive
Contents

Revive Sys (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 19:45, 10th Oct 2014 Maker: Either post the GUI triggers or write the system in proper Jass. GUI code converte to Jass will not be accepted.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

19:45, 10th Oct 2014
Maker: Either post the GUI triggers or write the system in proper Jass.
GUI code converte to Jass will not be accepted.
 
It's not useful at all to submit this as a JASS system, so just post it as pure GUI.
This converted code scrap is just spaghetti code, unreadable, and not user friendly at all.

Why you try to convert the GUI/Trigger into vJass?
You only can convert GUI to normal JASS.

You mean JESP. vJass isn't anything like that.
JESP were old standards for JASS spells. It's just normal JASS.
 
Level 17
Joined
Jul 17, 2011
Messages
1,864
wow who ever made this has some serious skill just look at all those crazy words and symbols in there there is no one here who can understand what those mean

i mean just look at this:
JASS:
Trig_Hero_Die_Loop_JASS_Func002Func001Func003C
woah that is some serious hacker shit i mean when was the last time you saw a function that had JASS in it ?

also all those red and white highlighted D:D:D: pls dont hax me h4x0r
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
Before this is going any more harsh,

This is not hacked code or something like that but just simply converted GUI code. So there is no wonder about those functions naming.

@Author, if you don't know anything about Jass, at least not yet, so don't ever try to submit simply-converted GUI, there no chance of it to get approved here. Just submit it as GUI version and it will be alright.

However, we have enough revive system here with a better functionality, I mean a revive system should be able to revive a unit (both normal and hero) without re-creating them. I'm sorry to say but this is unacceptable in any way, since we have perfect-already revive system here :)

But this is not a bad attempt. Keep going.
 
Top