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

Really Hard Request, +rep and credits given

Status
Not open for further replies.
Level 3
Joined
Apr 21, 2009
Messages
27
I need a spell that first summons many peasants, around the hero, then they begin to fly and transform into hawks.

LEVELS
Level 1: summons 10 peasants that transform into hawk, the hawks takes 2 damage and have 100 hp
Level 2: summons 11 peasants that transform into hawk, the hawks takes 4 damage and have 100 hp
Level 3: summons 12 peasants that transform into hawk, the hawks takes 6 damage and have 200 hp
Level 4: summons 13 peasants that transform into hawk, the hawks takes 8 damage and have 300 hp
Level 5: summons 14 peasants that transform into hawk, the hawks takes 14 damage and have 400hp
Level 6: summons 15 peasants that transform into hawk, the hawks takes 20 damage and have 500 hp

if anyone could do this they are pro :p
 
Level 11
Joined
Nov 15, 2007
Messages
800
This is not possible in a way that would look good or like a transformation effect. You'd need to create a custom model.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Use this:
JASS:
function spell takes nothing returns nothing
local group g = CreateGroup()
local unit u = GetSpellAbilityUnit()
local unit h
local location l = GetUnitLoc(u)
local player p = GetOwningPlayer(u)
local integer i = 0
loop
set i = i + 1
call GroupAddUnit(g,CreateUnitAtLoc(p,'hpea',l,270))
exitwhen i == (8 + GetUnitAbilityLevel(u,'A000'))
endloop
call TriggerSleepAction(1.00)
loop
set h = FirstOfGroup(g)
if IsUnitDeadBJ(h) == false then
call GroupRemoveUnit(g,h)
if GetUnitAbilityLevelSwapped('A000',h) == 1 then
call CreateUnitAtLoc(p,'h000',GetUnitLoc(h),GetUnitFacing(h))
else
if GetUnitAbilityLevelSwapped('A000',h) == 2 then
call CreateUnitAtLoc(p,'h000',GetUnitLoc(h),GetUnitFacing(h))
else
if GetUnitAbilityLevelSwapped('A000',h) == 3 then
call CreateUnitAtLoc(p,'h000',GetUnitLoc(h),GetUnitFacing(h))
else
call CreateUnitAtLoc(p,'h000',GetUnitLoc(h),GetUnitFacing(h))
endif
endif
endif
call RemoveUnit(h) // 'A000' is the spell id, replace it with yours
else // 'hpea' is the peasant id, should be the same, if its not custom
call GroupRemoveUnit(g,h) // 'h000' has to be a different unit for each level, with the properties you want
endif // To see the codes, press Ctrl+D it the object Editor
exitwhen IsUnitGroupEmptyBJ(g) == true
endloop
set i = 0
call DestroyGroup(g)
set u = null
set h = null
set p = null
call RemoveLocation(l)
endfunction

function condition takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction

function InitTrig_Spell takes nothing returns nothing
    set gg_trg_Spell = CreateTrigger( )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Spell, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Spell, Condition( function condition ) )
    call TriggerAddAction( gg_trg_Spell, function spell)
endfunction
Trigger name must be Spell for this to work.
 
Status
Not open for further replies.
Top