Summon spell - help

Status
Not open for further replies.
Level 5
Joined
Nov 29, 2007
Messages
106
How to do:
ability that summons for 60 seconds 2 pets (first pet is other than second) i based on summon spirit wolves.
 
Moin moin =)

JASS:
function SummonActions takes nothing returns nothing
    local real x
    local real y
    local unit u  
    
    if GetSpellAbilityId() == 'AUan' then //'AUan' <-- You have to change this into the rawcode of your ability
        // This is the first summoned unit 'h000' <-- you have to change this into the rawcode of your unit you want to summon
        set x = GetLocationX(Location(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))) + 100 * Cos(GetUnitFacing(GetTriggerUnit()) - 20.00 * bj_DEGTORAD)
        set y = GetLocationY(Location(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))) + 100 * Sin(GetUnitFacing(GetTriggerUnit()) - 20.00 * bj_DEGTORAD)
        set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h000',x,y,GetUnitFacing(GetTriggerUnit()))
        call UnitApplyTimedLife(u,'BTLF',60.00)
        set u = null
        // This is the second summoned unit 'h001' <-- you have to change this into the rawcode of your unit you want summon
        set x = GetLocationX(Location(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))) + 100 * Cos(GetUnitFacing(GetTriggerUnit()) + 20.00 * bj_DEGTORAD)
        set y = GetLocationY(Location(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))) + 100 * Sin(GetUnitFacing(GetTriggerUnit()) + 20.00 * bj_DEGTORAD)
        set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h001',x,y,GetUnitFacing(GetTriggerUnit()))
        call UnitApplyTimedLife(u,'BTLF',60.00)
        set u = null
    endif
endfunction

function InitTrig_Summon takes nothing returns nothing
    set gg_trg_Summon = CreateTrigger(  ) // The name of the trigger is Summon
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Summon, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddAction(gg_trg_Summon,function SummonActions)
endfunction

Edit: "Same" in GUI =S
  • Summon GUI
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Animate Dead
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempLoc2 = (TempLoc offset by 100.00 towards ((Facing of (Triggering unit)) - 20.00) degrees)
      • -------- The first unit --------
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at TempLoc2 facing (Facing of (Triggering unit)) degrees
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • -------- The second unit --------
      • Set TempLoc2 = (TempLoc offset by 100.00 towards ((Facing of (Triggering unit)) + 20.00) degrees)
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at TempLoc2 facing (Facing of (Triggering unit)) degrees
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • Custom script: call RemoveLocation(udg_TempLoc1)
Greetings
~ The Bomb King > Dr. Boom
 
Last edited:
that's JAss.

Events:
Unit - A unit starts the effect of an ability
Conditions:
Actions:
Set Temp_Point = (Position of (Trigger Unit))
Unit - Create 2 Pets a Temp_Point
Custom Script: call RemoveLocation (udg_Temp_Point)

~_~ I just type this since I got no world edit here.
 
  • Actions
    • For each (Integer A) from 1 to 2, do (Actions)
      • Loop - Actions
        • Set YourPoint = ((Position of (Triggering unit)) offset by 200.00 towards 0.00 degrees)
        • Unit - Create 1 Footman for Player 1 (Red) at YourPoint facing Default building facing degrees
        • Custom script: call RemoveLocation (udg_YourPoint)
 
Moin moin =)

Yes that's the easiest way to do this. My trigger summon the units at the left and right side of the casting unit.. thought this looks better ;)

But you don't should use "..0.00 degrees".., use the degrees of the current facing of the casting unit.

Greetings
~ The Bomb King > Dr. Boom
 
that's JAss.

Events:
Unit - A unit starts the effect of an ability
Conditions:
Actions:
Set Temp_Point = (Position of (Trigger Unit))
Unit - Create 2 Pets a Temp_Point
Custom Script: call RemoveLocation (udg_Temp_Point)

~_~ I just type this since I got no world edit here.

  • Actions
    • For each (Integer A) from 1 to 2, do (Actions)
      • Loop - Actions
        • Set YourPoint = ((Position of (Triggering unit)) offset by 200.00 towards 0.00 degrees)
        • Unit - Create 1 Footman for Player 1 (Red) at YourPoint facing Default building facing degrees
        • Custom script: call RemoveLocation (udg_YourPoint)

Dr.Booms trigger will do it fine while your methods cannot be used... why? because:

How to do:
ability that summons for 60 seconds 2 pets (first pet is other than second) i based on summon spirit wolves.

he needs the two summoned units to be different from each other...

and if he wants it to be the same, he will just use the normal summon spirit wolf spell...
 
I changed his trigger some
1. i added condition with level of ability for unit = 1/2/3/4
2. Bug ;( first used spell works good, second too but in third it summons 4 animals (2 pigs 2 birds) used it fourth it no summoning :)


EDIT:

Ok Fixed ;) Works perfectly
 
Status
Not open for further replies.
Back
Top