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

Problem with an Excellent Spell

Status
Not open for further replies.
Level 1
Joined
Sep 23, 2004
Messages
4
Code:
function InitTrig_My_Triger takes nothing returns nothing
    set gg_trg_My_Triger= CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_My_Triger, Player(0), EVENT_PLAYER_UNIT_SUMMON )
    call TriggerAddCondition( gg_trg_My_Triger, Condition( function Trig_My_Triger_Conditions ) )
    call TriggerAddAction( gg_trg_My_Triger, function Trig_My_Triger_Actions )
endfunction

"call TriggerRegisterPlayerUnitEventSimple( gg_trg_My_Triger, XXXXXXXXX, EVENT_PLAYER_UNIT_SUMMON )"
How I make for XXXXXXXXX returns exactly Player that it used the spell :(
I made an excellent spell, more only player that he will be between ( ) can use :cry:
 
Level 1
Joined
Sep 23, 2004
Messages
4
I try GetOwningPlayer(GetSpellAbilityUnit()) and GetOwningPlayer(GetSummoningUnit()), but dont work too :(
 
Level 1
Joined
Sep 23, 2004
Messages
4
I made a Spell on the basis of the Spell “Time Stop” of Darky28 to make mine, the Event is the same “Summon Unit” I changed the effect of the Spell plus it only work for player specified in “Player(X)” where X is the corresponding number to this player.

Already I tried with GetSpellAbilityUnit(), GetSummoningUnit() and does not function.

for nobody copy my Magic and saying who made him, I will use TimeStop how Example:
Code:
//===========================================================================
// Trigger:       TimeStop
// Script Author: Darky27
// Info:          Stops the time for 15 Seconds
//                only caster can move freely
//===========================================================================

function Trig_Time_Stop_Conditions takes nothing returns boolean
    return ( GetUnitTypeId(GetSummonedUnit()) == 'nrdr' )
endfunction

function Trig_Time_Stop_Actions takes nothing returns nothing
    local effect TimeStop
    local unit target
    local group targets = GetUnitsInRectAll(GetPlayableMapRect())
    local unit array units
    local integer num = 1
    local integer i = 1
    call RemoveUnit( GetSummonedUnit() )
    call SetTimeOfDayScalePercentBJ( 0.00 )
    call GroupRemoveUnitSimple( GetSummoningUnit() , targets )
    call AddSpecialEffectTargetUnitBJ( "overhead", GetSummoningUnit(), "Abilities\\Spells\\Items\\AIta\\CrystalBallCaster.mdl" )
    set TimeStop = GetLastCreatedEffectBJ()
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 3.00, "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp", 100.00, 100.00, 50.00, 10.00 )
    call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(GetSummoningUnit()), 0.50 )
    call TriggerSleepAction( 0.50 )
    call SetCameraTargetControllerNoZForPlayer( Player(0), GetSummoningUnit(), 0, 0, false )
    loop
        set units[num] = GroupPickRandomUnit(targets)
        exitwhen units[num] == null
        call PauseUnitBJ( true, units[num] )
        call SetUnitTimeScalePercent( units[num], 0.00 )
        call GroupRemoveUnitSimple( units[num], targets )
        set num = num + 1
    endloop
    call TriggerSleepAction( 15.00 )
    loop
        exitwhen i > (num - 1)
        call SetUnitTimeScalePercent( units[i], 100.00 )
        call PauseUnitBJ( false, units[i] )
        set i = i + 1
    endloop
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 3.00, "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp", 100.00, 100.00, 50.00, 10.00 )
    call DestroyEffectBJ( TimeStop )
    call ResetToGameCameraForPlayer( Player(0), 0 )
    call SetTimeOfDayScalePercentBJ( 100.00 )
endfunction

//===========================================================================
function InitTrig_Time_Stop takes nothing returns nothing
    set gg_trg_Time_Stop = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Time_Stop, Player(0), EVENT_PLAYER_UNIT_SUMMON )
    call TriggerAddCondition( gg_trg_Time_Stop, Condition( function Trig_Time_Stop_Conditions ) )
    call TriggerAddAction( gg_trg_Time_Stop, function Trig_Time_Stop_Actions )
endfunction

If you look to at TriggerRegisterPlayerUnitEventSimple this spell will work only for Player specified between ()

Sorry my English
 
Status
Not open for further replies.
Top