- Joined
- Jan 24, 2009
- Messages
- 606
What's wrong with this script? it's not running, at all... There's "Nothing" wrong with the "script".
I'll add the map in the attachments.
JASS:
//************************************************************
//* Created by: Naitsirk
//*Credits to: TriggerHappy(TimedHandles), Vexorian(JassHelper, TimerUtils)
//* How to implant: Copy this trigger, change where it stands that you should change, and copy the spell
//* in the Object editor.
//************************************************************
//* No need to credit me if used. I do this just for the fun.
//* If credited, then credit me under Krisier.
//************************************************************
library FireyCircle initializer init needs TimerUtils, TimedHandles
globals
private constant string EFFECT = "Abilities\\Spells\\Items\\AIfb\\AIfbSpecialArt.mdl"
private group aGroup = CreateGroup()
private constant boolean DESTROY_DESTRUCTABLE = true//set this to false if you don't want destructables to be destroyed
private constant integer SPELLID = 'A001'//Change this to the RawCode of the ability.
private timer aTimer
private real time = 60.
private real EffectX
private real EffectY
private unit caster
private integer level
endglobals
private function damage takes integer level returns real
return 50. * I2R(level)
endfunction
struct action
unit u
static method LA takes nothing returns nothing
//please don't edit, this is the spell actions.(looping)
local action new = action.allocate()
call DestroyEffectTimed(AddSpecialEffect(EFFECT, EffectX, EffectY), time)
call GroupEnumUnitsInRange( aGroup, EffectX, EffectY, 150, null)
loop
set new.u = FirstOfGroup(aGroup)
exitwhen new.u == null
if IsUnitEnemy(new.u, GetOwningPlayer(caster)) == true then
call UnitDamageTarget(caster, new.u, damage(level), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endif
set new.u = null
endloop
if(DESTROY_DESTRUCTABLE) then
endif
endmethod
endstruct
private function C takes nothing returns boolean
return GetSpellAbilityId() == SPELLID
endfunction
private function A takes nothing returns nothing
local real CasterX
local real CasterY
local integer int = 12
local location loc = GetSpellTargetLoc()
set level = GetUnitAbilityLevel(caster, SPELLID)
set caster = GetTriggerUnit() //this is to set the Casting unit, don't change this.
set CasterX = GetUnitX(caster) //This is the Casting units X for the coordinates.
set CasterY = GetUnitY(caster) //This is the Casting units Y for the coordinates.
set EffectX = GetLocationX(loc) // This is the EffectX for the coordinates, don't change this.
set EffectY = GetLocationY(loc)// This is the EffectY for the coordinates, don't change this either.
set time = 60. // this is the time the SFX's lasts. Change this is wanted time is more or less.
//don't edit.
loop
set int = int - 1
exitwhen int == 0
call TimerStart(aTimer, 0.10, false, function action.LA)
set time = time - 5
set EffectX = EffectX + 10.
set EffectY = EffectY + 10.
endloop
//Cleaning the leaks.
call GroupClear(aGroup)
call RemoveLocation(loc)
set caster = null
endfunction
//===========================================================================
function init takes nothing returns nothing
local trigger gg_trg_Firey_Cricle// Please don't bug me that this has a typo.. I allready know, but it doesn't matter aslong as the code runs perfectly...
set aTimer = NewTimer()
set gg_trg_Firey_Cricle = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Firey_Cricle, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_Firey_Cricle, function A)
call TriggerAddCondition(gg_trg_Firey_Cricle, Condition(function C))
endfunction
endlibrary
I'll add the map in the attachments.