Tholdalf
New Member
- Reaction score
- 2
Hi i´m currently learning the ropes of jass and so far i have managed to make a spell that belive it or not works .
Its similar to greater bash exept that its a castable spell (Stormbolt based) and i need some advises on how to improve it.. and if someone would like to try it for themself and see if it works for them.
Its similar to greater bash exept that its a castable spell (Stormbolt based) and i need some advises on how to improve it.. and if someone would like to try it for themself and see if it works for them.
Code:
function Trig_Ability_cast_Copy_Conditions takes nothing returns boolean
local unit t= GetSpellTargetUnit
local point c= GetUnitLoc(GetTriggerUnit())
local point m= GetUnitLoc(GetTriggerUnit())
local integer d= GetUnitFacing(GetTriggerUnit())
if ( not ( GetSpellAbilityId() == 'A03V' ) ) then
return false
endif
return true
endfunction
function Trig_Ability_cast_Copy_Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetSpellTargetUnit(), UNIT_TYPE_FLYING) == true ) ) then
return false
endif
return true
endfunction
function Trig_Ability_cast_Copy_Actions takes nothing returns nothing
if ( Trig_Ability_cast_Copy_Func001C() ) then
call IssueImmediateOrderBJ( GetTriggerUnit(), "stop" )
call DisplayTimedTextToForce( GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())), 2.00, "You can´t bash flying units!" )
else
set c = GetUnitLoc(GetTriggerUnit())
set m = GetUnitLoc(GetTriggerUnit())
set d = GetUnitFacing(GetTriggerUnit())
set t = GetSpellTargetUnit()
call TriggerSleepAction( 2.00 )
call RemoveLocation (t)
call RemoveLocation (m)
call DestroyEffect (udg_GB_SFX)
endif
endfunction
//===========================================================================
function InitTrig_Greater_Bash_Jass takes nothing returns nothing
set gg_trg_Greater_Bash_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Greater_Bash_Jass, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Greater_Bash_Jass, Condition( function Trig_Ability_cast_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Greater_Bash_Jass, function Trig_Ability_cast_Copy_Actions )
endfunction
function Trig_Movement_Copy_Actions takes nothing returns nothing
call DestroyEffect (udg_GB_SFX)
call DestroyEffectBJ( udg_GB_SFX )
call SetUnitPositionLoc( t, PolarProjectionBJ(m, ( DistanceBetweenPoints(m, GetUnitLoc(t)) + 10.00 ), AngleBetweenPoints(m, GetUnitLoc(t))) )
call AddSpecialEffectLocBJ( GetUnitLoc(t), "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl" )
set udg_GB_SFX = GetLastCreatedEffectBJ()
endfunction
//===========================================================================
function InitTrig_Movement_Copy takes nothing returns nothing
set gg_trg_Movement_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Movement_Copy )
call TriggerRegisterTimerEventPeriodic( gg_trg_Movement_Copy, 0.04 )
call TriggerAddAction( gg_trg_Movement_Copy, function Trig_Movement_Copy_Actions )
endfunction