Hatebreeder
So many apples
- Reaction score
- 381
Hey again,
I was bored, so I started to create a Spell and to model. I created a Model for the Spell, so it has something appealing about it.
Anyways, this is the Model I made:
Burning Coil
Model Viewer Screenshot:
In-Game Screen Shot:
NOTE: I changed the animation of the Coil a bit... I hope you like it =)
And here, the Spell for the Model:
Malicious Spawn
JASS / vJASS: vJASS
import difficulty: easy
MUI / MPI / Non-MUI: MUI
Jesp? Guess so
Requires: Jass New Gen Pack; TT (Timer Ticker) by Cohadar
Describtion: Creates a burning coil, that jumps from unit to unit. Heals friendly units and Damages enemies.
Now, to the Code:
Please tell me of what you think about this =)
I was bored, so I started to create a Spell and to model. I created a Model for the Spell, so it has something appealing about it.
Anyways, this is the Model I made:
Burning Coil
Model Viewer Screenshot:
In-Game Screen Shot:
NOTE: I changed the animation of the Coil a bit... I hope you like it =)
And here, the Spell for the Model:
Malicious Spawn
JASS / vJASS: vJASS
import difficulty: easy
MUI / MPI / Non-MUI: MUI
Jesp? Guess so
Requires: Jass New Gen Pack; TT (Timer Ticker) by Cohadar
Describtion: Creates a burning coil, that jumps from unit to unit. Heals friendly units and Damages enemies.
Now, to the Code:
JASS:
scope MaliciousSpawn initializer Init
//===============================================================================
//=== M A L I C I O U S S P A W N ===
//=== B Y H A T E B R E E D E R ===
//===============================================================================
//=== To Check raw-codes, open Object manager and press Control + D ===
//===============================================================================
//=== Have fun with the Spell & The Model ===
//===============================================================================
globals
private constant integer ID = 039;A000039; //Raw Code of the Spell
private constant integer DUMMY = 039;u001039; // Dummy ID
private constant integer JUMPS = 8 // How often it should jump
private constant real AOE = 325. // determines the AOE, of targeting the next Unit
private constant real SPEED = 12. // Speed of the Missle
private constant string SFX = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" // Damage/Heal SFX
private constant string ATTACHMENT = "origin" // SFX attachmentpoint
//===========================================
private constant group GROUP = CreateGroup()
endglobals
private constant function Damage takes integer Level returns real
return (75. * Level) / JUMPS //Max Damage of the Spell
endfunction
private constant function Heal takes real Dam, integer Level returns real
return (Dam * (0.2 * Level)) //Healing of the Spell
endfunction
//==================================================================================
//================== Do not Edit below, unless you know what you are doing =========
//==================================================================================
private struct Spawn
unit Caster
unit Dummy
unit Target
integer Count = JUMPS
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == ID
endfunction
private function Group_Filter takes nothing returns boolean
return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) == false and IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction
private function Timer takes nothing returns boolean
local Spawn Data = TT_GetData()
local real DummyX = GetUnitX(Data.Dummy)
local real DummyY = GetUnitY(Data.Dummy)
local real TargetX = GetUnitX(Data.Target)
local real TargetY = GetUnitY(Data.Target)
local real Angle = bj_RADTODEG * Atan2(TargetY - DummyY,TargetX - DummyX)
local real X = DummyX + SPEED * Cos(Angle * bj_DEGTORAD)
local real Y = DummyY + SPEED * Sin(Angle * bj_DEGTORAD)
local real DX
local real DY
local real Dist
local unit P
local unit D
call SetUnitXY(Data.Dummy,X,Y)
call SetUnitFacing(Data.Dummy,Angle)
set DX = TargetX - X
set DY = TargetY - Y
set Dist = SquareRoot(DX * DX + DY * DY)
if Dist <= SPEED then
set Data.Count = Data.Count - 1
if IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == true then
call UnitDamageTarget(Data.Caster,Data.Target,Damage(GetUnitAbilityLevel(Data.Caster,ID)),false,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
elseif IsUnitEnemy(Data.Target,GetOwningPlayer(Data.Caster)) == false then
call SetUnitState(Data.Target,UNIT_STATE_LIFE,GetUnitState(Data.Target,UNIT_STATE_LIFE) + Heal(Damage(GetUnitAbilityLevel(Data.Caster,ID)),GetUnitAbilityLevel(Data.Caster,ID)))
endif
call DestroyEffect(AddSpecialEffectTarget(SFX,Data.Target,ATTACHMENT))
call GroupEnumUnitsInRange(GROUP,X,Y,AOE,Condition(function Group_Filter))
set D = Data.Target
set Data.Target = null
loop
set P = FirstOfGroup(GROUP)
exitwhen P == null
if P != D then
set Data.Target = P
endif
call GroupRemoveUnit(GROUP,P)
endloop
set P = null
set D = null
if Data.Count <= 0 or Data.Target == null then
call KillUnit(Data.Dummy)
call Data.destroy()
return true
endif
endif
return false
endfunction
private function Actions takes nothing returns nothing
local Spawn Data = Spawn.create()
local real CasterX
local real CasterY
local real TargetX
local real TargetY
local real X
local real Y
local real Angle
set Data.Caster = GetTriggerUnit()
set Data.Target = GetSpellTargetUnit()
set CasterX = GetUnitX(Data.Caster)
set CasterY = GetUnitY(Data.Caster)
set TargetX = GetUnitX(Data.Target)
set TargetY = GetUnitY(Data.Target)
set Angle = bj_RADTODEG * Atan2(TargetY - CasterY,TargetX - CasterX)
set X = CasterX + 100 * Cos(Angle * bj_DEGTORAD)
set Y = CasterY + 100 * Sin(Angle * bj_DEGTORAD)
set Data.Dummy = CreateUnit(GetOwningPlayer(Data.Caster),DUMMY,X,Y,Angle)
call TT_Start(function Timer,Data)
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger Trig = CreateTrigger( )
call Preload(SFX)
call TriggerRegisterAnyUnitEventBJ( Trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( Trig, Condition( function Conditions ) )
call TriggerAddAction( Trig, function Actions )
set Trig = null
endfunction
endscope
Please tell me of what you think about this =)