Another spell problem

Gwafu

Active Member
Reaction score
12
Map download Link

Well got another problem >:|

When the second time the spell is cast, the three priest faces different directions instead of the center of the triangle.

Help fix please :)

(You need to select exactly three priests to make the ability show.)
 

Gwafu

Active Member
Reaction score
12
What do you mean by details? You mean what the spell does?

Well, it will just spawn a dummy with endurance aura. That's all. But it will need exactly three priests selected to show the ability.
 

sentrywiz

New Member
Reaction score
25
What do you mean by details? You mean what the spell does?

Well, it will just spawn a dummy with endurance aura. That's all. But it will need exactly three priests selected to show the ability.

Well, its easier if you just copy the triggers to look at. Yes I mean what the spell does.
 

Nickdzul

New Member
Reaction score
1
well how can peoples help you if you doesn't give enough details?
copy your triggers and posts it here..
 

Gwafu

Active Member
Reaction score
12
Sigh, on the other thread they want a test map (I gave the triggers), now vice versa -_-.
Anyways:

GroupCast:
JASS:
function GroupCast_Ability takes nothing returns integer
   return 'A000'
endfunction

function GroupCast_IsPriest takes nothing returns boolean
    return GetUnitTypeId(GetFilterUnit()) == 'hmpr'
endfunction

function GroupCast_Range takes nothing returns real
    return 500.00
endfunction

function GroupCast_Count takes nothing returns integer
    return 3
endfunction

function GroupCast_SpellId takes nothing returns integer
    return OrderId("channel")
endfunction

function GroupCast_Filter takes nothing returns boolean
    if GetWidgetLife(GetFilterUnit()) > 0.405 and GroupCast_IsPriest() and GetOwningPlayer(udg_u) == GetOwningPlayer(GetFilterUnit()) and IsUnitSelected(GetFilterUnit(), GetOwningPlayer(udg_u)) then
        set udg_i = udg_i + 1
        return true
    endif
    return false
endfunction

function GroupCast_LoopActions takes nothing returns nothing
    set udg_u = GetEnumUnit()
    if GetUnitCurrentOrder(udg_u) != GroupCast_SpellId() then
        set udg_i = 0
        call GroupEnumUnitsInRange(udg_g, GetUnitX(udg_u), GetUnitY(udg_u), GroupCast_Range(), Condition(function GroupCast_Filter))
        if udg_i == GroupCast_Count() then
            call UnitAddAbility   (udg_u, GroupCast_Ability())
        else
            call UnitRemoveAbility(udg_u, GroupCast_Ability())
        endif
    endif
endfunction

function GroupCast_Check takes nothing returns nothing
    call ForGroup(udg_GroupCast_Check, function GroupCast_LoopActions)
endfunction

function GoupCast_Select takes nothing returns nothing
    call GroupAddUnit(udg_GroupCast_Check, GetTriggerUnit())
    call EnableTrigger(gg_trg_GroupCast)
endfunction

function GroupCast_Deselect takes nothing returns nothing
    call GroupRemoveUnit(udg_GroupCast_Check, GetTriggerUnit())
    if FirstOfGroup(udg_GroupCast_Check) == null then
        call DisableTrigger(gg_trg_GroupCast)
    endif
endfunction

function InitTrig_GroupCast takes nothing returns nothing
    local trigger   select = CreateTrigger()
    local trigger deselect = CreateTrigger()
    set   gg_trg_GroupCast = CreateTrigger()
    set   udg_Litany_Count = GroupCast_Count()

    call TriggerRegisterTimerEvent(gg_trg_GroupCast, 0.1, true)
    call TriggerAddAction(gg_trg_GroupCast, function GroupCast_Check)
    call TriggerAddAction(  select, function GoupCast_Select)
    call TriggerAddAction(deselect, function GroupCast_Deselect)

    set udg_i = 0
    loop
        call TriggerRegisterPlayerUnitEvent(  select, Player(udg_i), EVENT_PLAYER_UNIT_SELECTED,   Condition(function GroupCast_IsPriest))
        call TriggerRegisterPlayerUnitEvent(deselect, Player(udg_i), EVENT_PLAYER_UNIT_DESELECTED, Condition(function GroupCast_IsPriest))
        call TriggerRegisterPlayerUnitEvent(deselect, Player(udg_i), EVENT_PLAYER_UNIT_DEATH,      Condition(function GroupCast_IsPriest))
        set udg_i = udg_i + 1
        exitwhen udg_i >= bj_MAX_PLAYER_SLOTS
    endloop
endfunction


The Triggers:
Trigger:
  • Litany Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Litany
    • Actions
      • Unit Group - Add (Triggering unit) to Litany_Group
      • Trigger - Turn on Litany Count Caster <gen>


Trigger:
  • Litany Count Caster
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set i = 0
      • Set x = 0.00
      • Set y = 0.00
      • Set Litany_Max = (Litany_Max + 1)
      • Unit Group - Pick every unit in Litany_Group and do (Actions)
        • Loop - Actions
          • Set loc = (Position of (Picked unit))
          • Set x = (x + (X of loc))
          • Set y = (y + (Y of loc))
          • Set Litany_X[((Litany_Max x Litany_Count) + i)] = (X of loc)
          • Set Litany_Y[((Litany_Max x Litany_Count) + i)] = (Y of loc)
          • Set Litany_Caster[((Litany_Max x Litany_Count) + i)] = (Picked unit)
          • Custom script: call RemoveLocation(udg_loc)
          • Set i = (i + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i Equal to Litany_Count
        • Then - Actions
          • Set x = (x / (Real(Litany_Count)))
          • Set y = (y / (Real(Litany_Count)))
          • Set Litany_Center[Litany_Max] = (Point(x, y))
          • Set a = 90.00
          • Set r = 250.00
          • Unit Group - Pick every unit in Litany_Group and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face Litany_Center[Litany_Max] over 0.00 seconds
              • Custom script: call SetUnitX(GetEnumUnit(), udg_x+udg_r*Cos(udg_a*bj_DEGTORAD))
              • Custom script: call SetUnitY(GetEnumUnit(), udg_y+udg_r*Sin(udg_a*bj_DEGTORAD))
              • Set a = (a + (360.00 / (Real(Litany_Count))))
          • Custom script: set udg_u = FirstOfGroup(udg_Litany_Group)
          • Custom script: call GroupEnumUnitsInRect(udg_g, GetWorldBounds(), null)
          • Set loc = (Point(0.00, 0.00))
          • Unit - Create 1 Dummy for (Owner of u) at Litany_Center[Litany_Max] facing 0.00 degrees
          • Set Litany_Dummy[Litany_Max] = (Last created unit)
          • Custom script: call RemoveLocation(udg_loc)
          • Trigger - Turn on Litany Loop <gen>
        • Else - Actions
          • Set Litany_Max = (Litany_Max - 1)
      • Unit Group - Remove all units from Litany_Group
      • Trigger - Turn off (This trigger)


Trigger:
  • Litany Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer i) from 1 to Litany_Max, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at Litany_Center<i> using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • For each (Integer i2) from (i x Litany_Count) to ((i x Litany_Count) + (Litany_Count - 1)), do (Actions)
            • Loop - Actions
              • Set u = Litany_Caster[i2]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • u Not equal to No unit
                  • (Life of u) Greater than 0.00
                  • (Mana of u) Greater than or equal to 75.00
                  • (Current order of u) Equal to (Order(channel))
                • Then - Actions
                  • Unit - Set mana of u to ((Mana of u) - 75.00)
                • Else - Actions
                  • Unit - Kill Litany_Dummy<i>
                  • Set Litany_Dummy<i> = Litany_Dummy[Litany_Max]
                  • For each (Integer i2) from 0 to (Litany_Count - 1), do (Actions)
                    • Loop - Actions
                      • Set loc = (Point(Litany_X[((i x Litany_Count) + i2)], Litany_Y[((i x Litany_Count) + i2)]))
                      • Unit - Move Litany_Caster[((i x Litany_Count) + i2)] instantly to loc
                      • Custom script: call RemoveLocation(udg_loc)
                      • Set Litany_X[((i x Litany_Count) + i2)] = Litany_X[((Litany_Max x Litany_Count) + i2)]
                      • Set Litany_Y[((i x Litany_Count) + i2)] = Litany_Y[((Litany_Max x Litany_Count) + i2)]
                      • Set Litany_Caster[((i x Litany_Count) + i2)] = Litany_Caster[((Litany_Max x Litany_Count) + i2)]
                  • Custom script: call RemoveLocation(udg_Litany_Center[udg_i])
                  • Set Litany_Center<i> = (Point((X of Litany_Center[Litany_Max]), (Y of Litany_Center[Litany_Max])))
                  • Custom script: call RemoveLocation(udg_Litany_Center[udg_Litany_Max])
                  • Set i = (i - 1)
                  • Set Litany_Max = (Litany_Max - 1)
                  • Custom script: exitwhen true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Litany_Max Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
    • </i></i></i></i>
 

0WN3D

New Member
Reaction score
15
Trigger:
  • Unit - Move (Priest) instantly to (Whereever You Want)), facing (Center of Triangle)

Not Sure If This Will Work...
Ps: I Am Still Novice In coding so i dun know your trigger :p
 

hgkjfhfdsj

Active Member
Reaction score
55
issue may lie in the SetUnitFacing().. it was never that reliable anyway...especially when you forced him to face angle while channeling. i could be wrong.
 

Gwafu

Active Member
Reaction score
12
I have tested it and yes, it bugs (Tested with blizzard).
Any suggestions?
 

hgkjfhfdsj

Active Member
Reaction score
55
it bugs
what bugs?

EDIT
oh.. angle??

SetUnitLookAt() is more reliable (and instant) than SetUnitFacing, but it requires modification of the model (a bone or something..)
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
move unit facing angle does work alot better as far as i know.
 

Gwafu

Active Member
Reaction score
12
/@ hg : sometimes, the archmage doesn't face the angle I ordered

/@ Acc : The GUI action?
 

King.Sky_Gem

New Member
Reaction score
2
what is the effect of this spell supposed to be? What does it do?

Ex:
Death coil:
Throws a skull..

EDIT: My bad, didn't see that you already said, I got confused.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top