Warcraft III resources & community, 2003–2006 · archived

Spell Help

24 posts
#1

Spell Help

K i have absolutely no idea on how to do this spell, and ive seen somethign similar before (in EotA i think)
Chained Souls - Connects a target enemy hero's soul with that of the pitlord's, making the targeted hero take 60% of the pitlord's dmg when he is attaked. If the pitlord dies, the chained enemy will take the amount of damage the pitlord took from the start of the spell to when it ended.

The ending damage per is easy, but i have no idea how to make the enemy hero take 60% of the pitlord dmg.
#2
This is actually rather easy. All youre going to do is edit the spirit link spell used by the spirit walker (orc). Edit the number of units to 2 and change the valid targets to enemy heroes. Because the unit that uses the spell is automatically affected, the other hero will be spirit linked. The only problem is this goes 2 ways.

To have one that goes only 1 way, you will need to use triggers. I'll start making an example map and put it in the spell section asap
#3
First i don't know one thing,is it the pitlord do +60% dmg to the target or deal only 60% from his normal dmg or deal 60% of his dmg when targets attackes him.Second:
If the pitlord dies, the chained enemy will take the amount of damage the pitlord took from the start of the spell to when it ended.

i didn't understood that part very well!

[/code]
#4
'i..i'
#5
Nope spirit link wont work, cus then they will share the dmg taken, like each will take 50% of the others dmg taken. I want it so that the target enemy hero will take 80% of the damage taken by the pitlord, so the pitlord recieves only 20% of all damage taken during the duration of the spell. And Vicky dont worry about the end part, i got that covered.
#6
I'd have a nice idea but it would be best to do it in JASS but triggers are good as well. I will consider this spell for the beginning as a request since it is the most intriguing. I will get warcraft today. Anyway, I'll tell you my idea into a non-JASS way.

It is very simple. Just base the spell off Spirit Link with 1 target and NO damage, but with a buff. Set the Casting Unit to a variable, wait until (Target Unit of Ability being Cast) has BUff equal to false. The buff should be equal with the Spirit Link's spell buff. Oh, and the event of the trigger should be Event - An unit finishes casting an ability.

To the second trigger...

Event - An unit is attacked
Conditions - Attacked Unit has BUFF equal to true
Actions - Set Life of (Attacked Unit) to (Life of Attacked Unit) + ((Damage Taken)*0.60)
- Set Life of (VARIABLE_CASTING_UNIT) [this is the variable in which you stored the casting unit] to Life of (VARIABLE_CASTING_UNIT)-(Damage Taken *0.40).

To assure the bounty stuff, you can create a dummy unit and make it attack the casting unit with the damage taken*0.40 damage.

That is my main idea, but I can make it multi-instance with JASS.
#7
This is my genius daelin but you have some mistakes!How it will assure that the dummy unit will kill the unit when it's on 1 life and how you're gonna set the units life to *0.4.Second how you'll assure that is the exacly unit that hit the caster is the target of the ability.It can be anyone and he'll be inicent!So you must make a ability that effects both caster and target!And about the dmg make a if that will activate when when the targets life will be >=20 or >=10!Then make the dummy and make it damage the target for 100000 with chaos attack!Third daelin check your mistacke in the calculations.+/-It is supposed not the casting unit to take most damage but the target!The target will get 60/80% of the dmg it deals but the caster will take only 20/40%!You done all turned with the head down.
#8
Yeah yeah Vicky... This was just a small idea. Making it in JASS is MUCH easier. I'll just try it.
#9
Yeah i had thought of that but i wanted it so that he gets damaged AS the spell is happening, not all at the end.
#10
add a loop and add those action in thw loop
#11
You dont seem to understand...i want it done as the pitlord is attacked...not as periodic event and not all at the end

Hey actualy now that i think about it that might work.
i could make it so whent he spell is cast it sets his current hp to a variable(current_hp) and turns on a trigger which every .01 seconds does the following:
Dmg enemy_hero by ((current_hp - pitlord's current hp) x .60), then set pitlord hp to ((current_hp - pitlord's current hp) x .40), and again set current_hp to pitlord's current hp. Only problem is if he dies from the intitial attack it wont work.
#12
.01 second periodics will cripple your game
#13
It's much easyer with JASS!Dealin is now making your request btw!If he succeses your idea will be destroyed!
#14
Well thanks so much if you can do this daelin, you'll definitly geta credit in my map if you do :D
Would you mind explaining how you made it after? Im trying to learn jass but only know basic stuff from a tutorial i read, so this might help me somewhat.
#15
Ok... the script is almost done (with no tests though) but this is a new system I've tried so there is an error and probably some bugs. Check them out Vicky...


function Trig_Chained_Souls_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Attacked takes nothing returns nothing

local unit attacked
local real life
local real dmg
local real heal
local real dam
local unit caster
local trigger trg 

set trg = GetTriggeringTrigger()
set caster = GetHandleUnit(trg, "LABEL")
set attacked = GetAttackedUnitBJ()
set life = GetUnitState(attacked,UNIT_STATE_LIFE)
set dmg = GetEventDamage()*0.60
set heal = life+dmg
set dam = life-dmg

call SetUnitLifeBJ (attacked, heal)
call SetUnitLifeBJ (caster, dam)

set caster = null
set attacked = null

endfunction


function Trig_Chained_Souls_Actions takes nothing returns nothing

    local unit cast
    local unit targ
    local trigger trg

    set targ = GetSpellTargetUnit()
    set cast = GetSpellAbilityUnit()
    set trg = CreateTrigger()
    call SetHandleHandle(trg, "LABEL", targ)
    call TriggerRegisterUnitEvent(trg, cast, EVENT_UNIT_ATTACKED)
    call TriggerAddAction(trg, function Attacked)    

    loop
        exitwhen (UnitHasBuffBJ(targ,'B000')==false)
        call TriggerSleepAction (0.00)
    endloop

    set trg = null
    set targ = null
    set cast = null     

endfunction


There is still some error at the handle variable but I have no idea how it works (copied a script...).