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

[Spell] Need help on abillities!!

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
Hi,
I'am using a spell multiple times, and I don't want them to interfere with each other for example both spells use tornado as cast abillty, once you click it both will be activated somehow, so i already use stampede and tornado i need another channel spell, do any of you have an idea of what i can use?!

EDIT:needs a target point
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Basing spells off "Channel" is best (unless you want to do simple things). When a unit has 2 abilities both based of Channel, you must set the "Data - Base Order ID" to something different for both spells. Make sure that you change to following things under your Channel spells:
- Disable Other Abilities: FALSE
- Options: VISIBLE (and TARGETING IMAGE if needed)
- Target Type: Appropriate option
 
Level 12
Joined
Apr 26, 2008
Messages
830
Basing spells off "Channel" is best (unless you want to do simple things). When a unit has 2 abilities both based of Channel, you must set the "Data - Base Order ID" to something different for both spells. Make sure that you change to following things under your Channel spells:
- Disable Other Abilities: FALSE
- Options: VISIBLE (and TARGETING IMAGE if needed)
- Target Type: Appropriate option

In some spells there isn't Data - Basre order ID

EDIT: can you do it in a map and upload it pls?!
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
In some spells there isn't Data - Basre order ID

EDIT: can you do it in a map and upload it pls?!

he mean use channel ability instead ur ability coz only at spellbook and channel ability could change the base order id.


u can customize channel ability well (u can do point(both area like blizard or just a point)/unit(firebolt)/instant(like berserk) target ability)

after u made custom channel ability just make the effect with trigger, example if u unit cast ur dummy channel ability then u can have more way, i list 2:

1. add ability to hero, order it with trigger and remove it
2. create a dummy invisble unit, add ability (example ur tornade)m, order it to enemy and a short expiration timer

1.st work like in screenshot, the differentce between 1st and 2nd, for 2nd need 1 dummy unit (any unit, just set model to none, collision to 0, movement:fly,food cost:0, mana to enough) add the ability to him after u created dummy to ur position, order it and add expiration timer (u dont need wait, remove ability coz with expiration timer he die after x second and since invisble its look like u cast)
 

Attachments

  • 1.jpg
    1.jpg
    147.6 KB · Views: 76
  • 2.JPG
    2.JPG
    100.1 KB · Views: 121
Level 12
Joined
Apr 26, 2008
Messages
830
he mean use channel ability instead ur ability coz only at spellbook and channel ability could change the base order id.


u can customize channel ability well (u can do point(both area like blizard or just a point)/unit(firebolt)/instant(like berserk) target ability)

after u made custom channel ability just make the effect with trigger, example if u unit cast ur dummy channel ability then u can have more way, i list 2:

1. add ability to hero, order it with trigger and remove it
2. create a dummy invisble unit, add ability (example ur tornade)m, order it to enemy and a short expiration timer

1.st work like in screenshot, the differentce between 1st and 2nd, for 2nd need 1 dummy unit (any unit, just set model to none, collision to 0, movement:fly,food cost:0, mana to enough) add the ability to him after u created dummy to ur position, order it and add expiration timer (u dont need wait, remove ability coz with expiration timer he die after x second and since invisble its look like u cast)

Ouh yea i tried, but it doesn't work because it needs casting time like tornado or stampede. it stops when the caster moves, does something else. Looks like i casted, but you still don't get the stats of the caster since it was casted by a dummy. My spells work with stats.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Ouh yea i tried, but it doesn't work because it needs casting time like tornado or stampede. it stops when the caster moves, does something else. Looks like i casted, but you still don't get the stats of the caster since it was casted by a dummy. My spells work with stats.

1st off all, if u make a trigger where ur hero cast the dummy channel then trigger unit till the end of that trigger is same casting unit (so ur main hero) even u created a dummy for cast another skill, because in condition the ability casted is dummy ability not the real, so after all u can check the triggering unit stat when u want in that trigger with dummy unit

that possible with timer or triggersleep loop (i used trigger sleep for malfurion healing rain/Tranquility)
its check ~every sec if unit is channeling or not
Warning triggersleep not too accurated

JASS:
function Trig_Tranquility_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A03M' 
endfunction

function Trig_Tranquility_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetTriggerPlayer()
local unit pu 
local integer a = 0
local integer mpcost = GetUnitAbilityLevel(u, 'A03M') * 10
local real heal = GetUnitAbilityLevel(u, 'A03M') * 100 + udg_TotalSpellPower[GetPlayerId(p)+1]
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local group gr = bj_lastCreatedGroup 
local string s = "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl"


loop
exitwhen (GetWidgetLife(u)<0.435 or (OrderId2String(GetUnitCurrentOrder(u)) != "tranquility") or GetUnitState(u,UNIT_STATE_MANA)<5)
call GroupEnumUnitsInRange(gr, x, y, 250.00, null)
   loop
     set pu = FirstOfGroup(gr)
     exitwhen (pu==null)
    if ((IsUnitEnemy(pu, p)==false) and (GetWidgetLife(pu) > 0.435)) then
       call DestroyEffect(AddSpecialEffectTarget(s, pu, "origin"))
       call SetWidgetLife(pu, GetWidgetLife(u)+heal)
    endif
   call GroupRemoveUnit(gr, pu)
   endloop
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u,UNIT_STATE_MANA) - mpcost)
call TriggerSleepAction(1)
endloop

set u = null
set gr = null
set p = null
set s = null
endfunction

//===========================================================================
function InitTrig_Tranquility takes nothing returns nothing
    set gg_trg_Tranquility = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Tranquility, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Tranquility, Condition( function Trig_Tranquility_Conditions ) )
    call TriggerAddAction( gg_trg_Tranquility, function Trig_Tranquility_Actions )
endfunction
 
Level 12
Joined
Apr 26, 2008
Messages
830
1st off all, if u make a trigger where ur hero cast the dummy channel then trigger unit till the end of that trigger is same casting unit (so ur main hero) even u created a dummy for cast another skill, because in condition the ability casted is dummy ability not the real, so after all u can check the triggering unit stat when u want in that trigger with dummy unit

that possible with timer or triggersleep loop (i used trigger sleep for malfurion healing rain/Tranquility)
its check ~every sec if unit is channeling or not
Warning triggersleep not too accurated

JASS:
function Trig_Tranquility_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A03M' 
endfunction

function Trig_Tranquility_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetTriggerPlayer()
local unit pu 
local integer a = 0
local integer mpcost = GetUnitAbilityLevel(u, 'A03M') * 10
local real heal = GetUnitAbilityLevel(u, 'A03M') * 100 + udg_TotalSpellPower[GetPlayerId(p)+1]
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local group gr = bj_lastCreatedGroup 
local string s = "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl"


loop
exitwhen (GetWidgetLife(u)<0.435 or (OrderId2String(GetUnitCurrentOrder(u)) != "tranquility") or GetUnitState(u,UNIT_STATE_MANA)<5)
call GroupEnumUnitsInRange(gr, x, y, 250.00, null)
   loop
     set pu = FirstOfGroup(gr)
     exitwhen (pu==null)
    if ((IsUnitEnemy(pu, p)==false) and (GetWidgetLife(pu) > 0.435)) then
       call DestroyEffect(AddSpecialEffectTarget(s, pu, "origin"))
       call SetWidgetLife(pu, GetWidgetLife(u)+heal)
    endif
   call GroupRemoveUnit(gr, pu)
   endloop
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u,UNIT_STATE_MANA) - mpcost)
call TriggerSleepAction(1)
endloop

set u = null
set gr = null
set p = null
set s = null
endfunction

//===========================================================================
function InitTrig_Tranquility takes nothing returns nothing
    set gg_trg_Tranquility = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Tranquility, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Tranquility, Condition( function Trig_Tranquility_Conditions ) )
    call TriggerAddAction( gg_trg_Tranquility, function Trig_Tranquility_Actions )
endfunction

So you are saying that i need to make a dummy for everyspell i make?! that's insane =D
 
Status
Not open for further replies.
Top