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

Drain HP

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
What is the base ability and the system of healing of rooftrelen's leech seed Dota ?ONly the heal system,don't need the special effects,the green "things" flying,nothing,only the system that damages enemies by a certain value and heals the caster by the same value.NOTE:this is for those that knows the spell.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Its completely triggered.

The green thing that comes out of the target towards nearby units, it's a Custom Model created with the animations to make it behave that way. The damage and healing is done with triggering, as the amount of models to create/move towards each unit around, and everything else.

The ability is probably based on Channel, wich is a dummy ability (does nothing) provided by Warcraft 3 for triggering purposes.

Here you get. This works enough. I don't know why the Floating Text has a 1 second delay, but the effect (Damage/heal) works. Be aware that damage is reduced by magical resistance (if damage type is magical), and healing is not, so, you may be healing by 50, but dealing 20 damage.


This goes in the Map Header (The first object of the Trigger List with a Map icon)
JASS:
function DHOTAction takes nothing returns nothing
    // Required Locals
    local timer t = GetExpiredTimer()
    local integer i = GetHandleId(t)
    local unit caster = LoadUnitHandle(udg_Hash, i, 0)
    local unit target = LoadUnitHandle(udg_Hash, i, 1)
    local integer times = LoadInteger(udg_Hash, i, 2)
    local real amount = LoadReal(udg_Hash, i, 3)
    local integer count = LoadInteger(udg_Hash, i, 4)+1
    local real life = GetUnitState(caster, UNIT_STATE_LIFE)
    local real maxlife = GetUnitState(caster, UNIT_STATE_MAX_LIFE)
    local texttag ctt = CreateTextTag()
    local texttag ttt = CreateTextTag()
    local real dir = 90*bj_DEGTORAD
    // If Target is Alive
    if GetUnitState(target, UNIT_STATE_LIFE) > 0 then
        call BJDebugMsg("Target is Alive")
        // Deal Damage
        call UnitDamageTarget(caster, target, amount, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
        call BJDebugMsg("Damage Dealt")
        // The Floating Text
        call SetTextTagPermanent(ttt, false)
        call SetTextTagText(ttt, "-" + SubString(R2S(udg_GDD_Damage), 0, StringLength(R2S(udg_GDD_Damage))-4), 0.028)
        call SetTextTagPos(ttt, GetUnitX(target), GetUnitY(target), 0)
        call SetTextTagColor(ttt, 255, 0, 0, 255)    
        call SetTextTagVelocity(ttt, 0.035*Cos(dir), 0.035*Sin(dir))
        call SetTextTagLifespan(ttt, 2)
        call SetTextTagFadepoint(ttt, 1)
        // Do the Heal
        if life >= maxlife then
            set life = maxlife
        endif
        // The Floating Text
        call SetUnitState(caster, UNIT_STATE_LIFE, life+amount)
        call BJDebugMsg("Caster Healed")
        call SetTextTagPermanent(ctt, false)
        call SetTextTagText(ctt, "+" + SubString(R2S(amount), 0, StringLength(R2S(amount))-4), 0.028)
        call SetTextTagPos(ctt, GetUnitX(caster), GetUnitY(caster), 0)
        call SetTextTagColor(ctt, 0, 255, 0, 255)
        call SetTextTagVelocity(ctt, 0.035*Cos(dir), 0.035*Sin(dir))
        call SetTextTagLifespan(ctt, 2)
        call SetTextTagFadepoint(ctt, 1)
        // Save increased Count
        call SaveInteger(udg_Hash, i, 4, count)
        call BJDebugMsg("Count is: " + I2S(count))
    else
        // This stops the effect if the target is dead
        set count = times
    endif
    // The actual Effect Stop
    if count >= times then
        call BJDebugMsg("Timer Stopped and Destroyed")
        call PauseTimer(t)
        call FlushChildHashtable(udg_Hash, i)
        call DestroyTimer(t)
    endif
    // Clean Leaks
    set t = null
    set caster = null
    set target = null
    set ctt = null
    set ttt = null
endfunction

function DHOTSet takes unit caster, unit target, integer count, real time, real amount returns nothing
    local timer t = CreateTimer()
    local integer i = GetHandleId(t)
    call TimerStart(t, time, true, function DHOTAction)
    call SaveUnitHandle(udg_Hash, i, 0, caster)
    call SaveUnitHandle(udg_Hash, i, 1, target)
    call SaveInteger(udg_Hash, i, 2, count)
    call SaveReal(udg_Hash, i, 3, amount)
    set t = null
endfunction

This action is required on Melee Initialization
  • Melee Intialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Hash = InitHashtable()
This is an example of How to use
  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DHOT
    • Actions
      • Set Target = (Target unit of ability being cast)
      • Set Caster = (Triggering unit)
      • -------- udg_Caster is the value you put in the Caster variable. --------
      • -------- udg_Target is the value you put in the Target variable. --------
      • -------- 4 is the numer of times that damage/heal will happen. --------
      • -------- 1 is the duration of the timer. Every 1 second damage/heal will happen. --------
      • -------- 50 is the amount of damage/heal that will happen. --------
      • Custom script: call DHOTSet(udg_Caster, udg_Target, 4, 1, 50)

I used a Weeps GDD Damage Detection System Emulator, but it's not needed if you don't want to detect/display damage with a floating text or anything. You don't need either the Debug Messages. Just let me know and I'll edit the script to fit your needs if you can't do it yourself. This is MUI and Leakless, You can cast it as many times you want with as many units you want at the same time, and even twice with the same unit, at the same time.

Here's a map example: http://www.hiveworkshop.com/forums/pastebin_data/t2mp68/_files/DHOT.w3x

You need JNPG (Jass NewGen Pack) to use this (I think, i'm not sure)

<< EDIT >>

Fixed the 1 second delay of the Floating Texts :)
 
Last edited:
Status
Not open for further replies.
Top