• 🏆 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!

Warcraft ][ Heal 1.05

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
I am inspirated in "Heal" of Paladins from Warcraft 2. Spell is maded like "mana for hit points".(1 mana will heal someone for 1 hp)

1)maximum heal 100 hp
2)maximum heal 200 hp
3)maximum heal 300 hp

  • Heal Loop
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Heal
    • Actions
      • Unit Group - Add (Triggering unit) to Casters
      • Unit Group - Pick every unit in Casters and do (Actions)
        • Loop - Actions
          • Set LifeMana[1] = ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))
          • Set LifeMana[2] = (Mana of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LifeMana[1] Greater than ((Real((Level of Heal for (Picked unit)))) x 100.00)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LifeMana[2] Less than ((Real((Level of Heal for (Picked unit)))) x 100.00)
                • Then - Actions
                  • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + LifeMana[2])
                  • Unit - Set mana of (Picked unit) to (LifeMana[2] - LifeMana[2])
                • Else - Actions
                  • Set XXXXX = ((Real((Level of Heal for (Picked unit)))) x 100.00)
                  • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + XXXXX)
                  • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - XXXXX)
            • Else - Actions
              • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + LifeMana[1])
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - LifeMana[1])
      • Unit Group - Remove (Picked unit) from Casters

version 1.05 - removed hashtable + triggers 1 and 2


Keywords:
Warcraft, 2, Heal, Paladin, Holy
Contents

Heal (Map)

Reviews
18:40, 20th Apr 2010 The_Reborn_Devil: Sorry, but this spell is too simple and why are you using a unit group? Status: Rejected Rating: N/A

Moderator

M

Moderator

18:40, 20th Apr 2010
The_Reborn_Devil:

Sorry, but this spell is too simple and why are you using a unit group?


Status: Rejected
Rating: N/A
 
Level 10
Joined
Jan 19, 2010
Messages
393
where's the leaks? anyway the normal Heal spell can do this, just set the mana cost and heal amount to the same value for each level...

what heal you mean? this is doing : if you have 65 mana it will heal 65 health if is HP of target between full hp and this HP 45 and you have 45 mana it will heal 45 hp and will take 45 mana

Why is the heal start trigger needed? Since the spell is instant, it shouldn't need a hashtable.

hmm... Yes thx for tip +rep
 
Level 10
Joined
Jan 19, 2010
Messages
393
u can do this without any triggers ... it's just Holy Light ...

they updated Holy Light? sorry but Holy Light will take you 100 mana or i dont know how much all the time it will take you 100 mana and will heal max 300hp this will take you 100 mana if it will heal 100hp if you have 40 mana that will heal 40 hp and will take all your mana... If Blizzard updated it then fine...
 
Level 9
Joined
Jun 7, 2007
Messages
195
The spell is quite simple, here's the JASS version I made of it.

Link to pastebin for testmap download
http://www.hiveworkshop.com/forums/pastebin.php?id=itrntc

JASS:
function WC2HealConditions takes nothing returns boolean
    if ( GetSpellAbilityId() == 'A000') then
        return true
    endif
    return false
endfunction

function WC2Heal takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local real mana = GetUnitState( caster, UNIT_STATE_MANA )
    local real health = GetUnitState( target, UNIT_STATE_LIFE )
    local real healing = GetUnitState( target, UNIT_STATE_MAX_LIFE ) - health
    local real maxhealing = 100 * I2R( GetUnitAbilityLevel( caster, 'A000' ) )
    
    if ( healing > mana ) then
        set healing = mana
        if ( healing > maxhealing ) then
            set healing = maxhealing
        endif
    endif   
    
    call SetUnitState( target, UNIT_STATE_LIFE, RMaxBJ( 0, health + healing ) )
    call SetUnitState( caster, UNIT_STATE_MANA, RMaxBJ( 0, mana - healing ) )
endfunction

//===========================================================================
function InitTrig_WC2Heal takes nothing returns nothing
    local trigger trg_WC2Heal = CreateTrigger()
//  call TriggerRegisterAnyUnitEventBJ( trg_WC2Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT ) //For All Players
    call TriggerRegisterPlayerUnitEvent( trg_WC2Heal, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null ) //For One Player
    call TriggerAddCondition( trg_WC2Heal, Condition( function WC2HealConditions ) )
    call TriggerAddAction( trg_WC2Heal, function WC2Heal )
endfunction
EDIT: Replaced BJs with natives. Left 'TriggerRegisterAnyUnitEventBJ' and 'RMaxBJ' because they couldn't be done much more simplier way.
 
Last edited:
Level 10
Joined
Jan 19, 2010
Messages
393
The spell is quite simple, here's the JASS version I made of it.

Link to pastebin for testmap download
http://www.hiveworkshop.com/forums/pastebin.php?id=itrntc

JASS:
function WC2HealConditions takes nothing returns boolean
    if ( GetSpellAbilityId() == 'A000') then
        return true
    endif
    return false
endfunction

function WC2Heal takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local real mana = GetUnitStateSwap(UNIT_STATE_MANA, caster )
    local real health = GetUnitStateSwap(UNIT_STATE_LIFE, target )
    local real healing = GetUnitStateSwap(UNIT_STATE_MAX_LIFE, target ) - health
    local real maxhealing = 100 * I2R( GetUnitAbilityLevelSwapped('A000', caster ) )
    
    if ( healing > mana ) then
        set healing = mana
        if ( healing > maxhealing ) then
            set healing = maxhealing
        endif
    endif   
    
    call SetUnitLifeBJ( target, health + healing )
    call SetUnitManaBJ( caster, GetUnitStateSwap(UNIT_STATE_MANA, caster ) - healing )
endfunction

//===========================================================================
function InitTrig_WC2Heal takes nothing returns nothing
    set gg_trg_WC2Heal = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_WC2Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_WC2Heal, Condition( function WC2HealConditions ) )
    call TriggerAddAction( gg_trg_WC2Heal, function WC2Heal )
endfunction

hmm yeah its easy...i didnt want this spell hard i have only idea then i made it :)
PS: Thx for jass script i can learn on it :)
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
That script sucks, no offense.

Bj's are useless and stupid, you should change the following:
JASS:
GetUnitStateSwap - GetUnitState()

GetUnitAbilityLevelSwapped - GetUnitAbilityLevel()

SetUnitLifeBJ - SetUnitState()/SetWidgetLife()

SetUnitManaBJ - SetUnitState()

gg_trg_WC2Heal - local trigger t = CreateTrigger()
 
Level 18
Joined
Feb 28, 2009
Messages
1,970
@Furiontti
Don`t tell you wrote it at all. It`s just GUI conversion with changed variables to locals. Oh, you also changed functions names.

@Zanekok
I don`t really see why you used 2 triggers. Also you`re not cleaning the hashtable.
 
Level 9
Joined
Jun 7, 2007
Messages
195
@Furiontti
Don`t tell you wrote it at all. It`s just GUI conversion with changed variables to locals. Oh, you also changed functions names.

Umm, actually I did not convert it, I wrote this using JassCraft that's where I got the non-BJ functions from. And I left that Condition function because I thought that incase it returns false, no locals will be needlessly created.
And how are you supposed to give the same functionality with minimal code using basic JASS if not this way.

Anyways the point was just to show Zanekok that the same functionality can be achieved more easily. Although I must say that JASS is still kind of new to me since I started learning it last weekend, so you or many other might know better.
 
Excuse me, but isn't there an ability that does that already?
I think it was Replenish.
Or a modified drain-type ability?

I thought so at the start but his spell was made so that if you cast it, no mana is wasted...

example: heal has maximum of 100 points to heal which takes 100 mana, if the target has only 50 hit points to heal then you would only use 50 mana instead of 100...
 
Level 4
Joined
Nov 30, 2008
Messages
31
dudeee... warcraft 2 healing spell - For every 6 mana, you can heal 1 hit point of damage. Since a Paladin has 255 mana, it can heal 42.5 hit points because 255/6=42.5
Because a Paladin has 90 hit points, it can take over 2 full casts of Healing to Heal another Paladin. i think u have to fix it... 6 mana for one hit point...
EDIT: tested your spell and it bugged trie to place 2 paladins and heal each other and look at paladins mana.... 1 will be with full other with 0 or more... FIX PLEASE!
 
Level 10
Joined
Jan 19, 2010
Messages
393
dudeee... warcraft 2 healing spell - For every 6 mana, you can heal 1 hit point of damage. Since a Paladin has 255 mana, it can heal 42.5 hit points because 255/6=42.5
Because a Paladin has 90 hit points, it can take over 2 full casts of Healing to Heal another Paladin. i think u have to fix it... 6 mana for one hit point...
EDIT: tested your spell and it bugged trie to place 2 paladins and heal each other and look at paladins mana.... 1 will be with full other with 0 or more... FIX PLEASE!

1) I didnt say this spell is same like warcraft 2 heal-i said this is on same system like warcraft 2 heal(mana for HP)
2) What is bugging with 2 paladins? its working normal
 
Top