- Joined
- Nov 23, 2008
- Messages
- 512
lol i did such a spell some time ago (in gui and with lightnings)
lol i did such a spell some time ago (in gui and with lightnings)
It's funny, nobody is clever enough to change the stupid rules. What a bad way to produce stupid redundant codes.
That's a really nice spell equal. Congratz ^^
can't test it yet though :/
Spells must be at least MPI. You will be marked down for not having a MUI spell. If it's not at least MPI your submission will not be counted.
Antimatter ShiverThe Marine launches a beam of a secret substance at the target area.
Once the beam reaches its target it releases pure antimatter, which pulls every unit in range.
If a unit comes to close it is lifted in the air and circles around the antimatter sphere, damaged constantly by the active forces.
After a few seconds the antimatter sphere explodes, throwing all lifted units away!
While a unit brakes on the ground after being thrown it receives, of course, damage too!
scope AntimatterShiver
// version 1.1
// Spell << Antimatter Shiver >> by The_Witcher
// created for the Hiveworkshop Starcraft II Beta Key Spell Contest
//
//The Marine launches a beam of a secret substance at the target area.
//
//Once the beam reaches its target it releases pure antimatter, which pulls every unit in range.
//
//If a unit comes to close it is lifted in the air and circles around the antimatter sphere, damaged constantly by the active forces.
//
//After a few seconds the antimatter sphere explodes, throwing all lifted units away!
//
//While a unit brakes on the ground after being thrown it receives, of course, damage too!
// !!THIS SPELL IS IN vJass SO IT NEEDS JASS NEWGEN PACK TO WORK WELL!!
//THE SETUP
globals
// -------- SYSTEM SETUP --------
// rawcode of the used dummy unit
private constant integer DUMMY_ID = 'e000'
//rawcode of the dummy ability which triggers this spell
private constant integer ABILITY_ID = 'A000'
// the timer interval
private constant real INTERVAL = 0.025
// the gravity (-9.81 on earth)
private constant real GRAVITY = -9.81
// the min/max height for the motion around the sphere
private constant real SPHERE_MOVEMENT_MIN_HEIGHT = 70
private constant real SPHERE_MOVEMENT_MAX_HEIGHT = 90
// the min/max size of the motion around the sphere
private constant real SPHERE_MOVEMENT_MIN_SIZE = 200
private constant real SPHERE_MOVEMENT_MAX_SIZE = 300
// the max spin angle of the motion around the sphere
private constant real SPHERE_MAX_SPIN_ANGLE = 80
// are only enemies affected??
private constant boolean ENEMIES_ONLY = false
// the attack type of the damage all damaged units receive
private constant attacktype DPS_ATTACK_TYPE = ATTACK_TYPE_NORMAL
// the damage type of the damage all damaged units receive
private constant damagetype DPS_DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
// the model of the beam
// -------- GRAPHICS SETUP --------
private constant string BEAM_MODEL = "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl"
// the model of the sphere
private constant string SPHERE_MODEL = "war3mapImported\\BlackHoleSpell.mdx"
// effect when a unit hits the ground after thrown away
private constant string BRAKE_EFFECT = "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl"
// effect when the sphere is created
private constant string SPHERE_BIRTH_EFFECT = "Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl"
// effect when the sphere explodes
private constant string SPHERE_DEATH_EFFECT = "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl"
// effect on all units which are caught by the sphere
private constant string VICTIM_EFFECT = "Abilities\\Spells\\Items\\ClarityPotion\\ClarityTarget.mdl"
// effect on all units which are dragged to the sphere
private constant string DRAG_EFFECT = "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl"
endglobals
// -------- ABILITY SETUP --------
// velocity of the beam, shot at the target location
private function GetBeamVelocity takes integer lvl returns real
return 300. + 100. * lvl
endfunction
// size of the beam
private function GetBeamSize takes integer lvl returns real
return 1. + 0.3 * lvl
endfunction
// size of the sphere
private function GetSphereSize takes integer lvl returns real
return 0.45 + 0.1 * lvl
endfunction
// flying height of the sphere
private function GetSphereHeight takes integer lvl returns real
return 100. + 20. * lvl
endfunction
// how long the sphere lasts before exploding
private function GetSphereDuration takes integer lvl returns real
return 5. + lvl
endfunction
// distance to the sphere at which units will be lifted in the air
private function GetLiftRange takes integer lvl returns real
return 100. + 50. * lvl
endfunction
// range to the sphere in which units are pulled
private function GetPullRange takes integer lvl returns real
return 250. + 50. * lvl
endfunction
// speed with which units are pulled
private function GetPullSpeed takes integer lvl returns real
return 200. + 30. * lvl
endfunction
// speed with which units are thrown away on explosion
private function GetThrowSpeed takes integer lvl returns real
return 500. + 100. * lvl
endfunction
// damage per second each unit takes when lifted by the sphere
private function GetSphereDamagePerSecond takes integer lvl returns real
return 50. + 10. * lvl
endfunction
// damage when a unit brakes on the ground after thrown away by the spheres explosion
private function GetImpactDamagePerSecond takes integer lvl returns real
return 80. + 50. * lvl
endfunction
// your custom conditions a unit has to comply with to be pulled and lifted by the sphere
private function DragCondition takes unit u returns boolean
return true
endfunction
// END OF SETUP
//-----------Don't modify anything below this line---------
private struct spell
private static spell array all[500]
private static spell temp
private static integer total = 0
private static boolexpr filter
private static timer tim
private static location loc = Location(0,0)
private static group g
private static hashtable h = InitHashtable()
private static item ite
unit u
unit caster
effect model
group affected
real t
real d
real V
real Vx
real Vy
real Vz
real x
real y
real z
real pullDist
real pullSpeed
real throwSpeed
real sphereZ
real liftDist
real life
real size
real dps
real impactDmg
private static method IsCoordPathable takes real x, real y returns boolean
local real xx
local real yy
call SetItemVisible(.ite,true)
call SetItemPosition(.ite,x,y)
set xx = GetItemX( .ite ) - x
set yy = GetItemY( .ite ) - y
call SetItemVisible(.ite,false)
return xx < 1 and xx > -1 and yy < 1 and yy > -1
endmethod
private static method boolFilter takes nothing returns boolean
local spell s = LoadInteger(.h,GetHandleId(GetFilterUnit()),7)
if ENEMIES_ONLY then
return GetFilterUnit() != .temp.u and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(.temp.u)) and (s == .temp or s == 0) and DragCondition(GetFilterUnit())
endif
return GetFilterUnit() != .temp.u and (s == .temp or s == 0) and DragCondition(GetFilterUnit())
endmethod
private static method throwEnum takes nothing returns nothing
local unit u = GetEnumUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real a = Atan2(y-.temp.y, x-.temp.x)
local real t = LoadReal(.h,GetHandleId(u),8)
local real z = GetUnitFlyHeight(u) + GRAVITY/2*t*t
if not (IsUnitType(u,UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0 ) or LoadInteger(.h,GetHandleId(u),7) == .temp then
// unit is affected by the specific antimatter and/or alive
if LoadInteger(.h,GetHandleId(u),5) == 1 then
call DestroyEffect(LoadEffectHandle(.h, GetHandleId(u),6))
call SaveInteger(.h,GetHandleId(u),5,0)
endif
set t = t + INTERVAL
call SaveReal(.h,GetHandleId(u),8,t)
call SetUnitFacing(u,a*bj_RADTODEG)
if .IsCoordPathable(x+.temp.throwSpeed * Cos(a),y+.temp.throwSpeed * Sin(a)) then
// x/y movement only if path isn't blocked
call SetUnitX(u,x+.temp.throwSpeed * Cos(a))
call SetUnitY(u,y+.temp.throwSpeed * Sin(a))
endif
call SetUnitFlyHeight(u,z,0)
if z <= 0 then
// unit hits the ground --> damage from braking
call UnitDamageTarget(.temp.caster, u, .temp.impactDmg, true, false, DPS_ATTACK_TYPE, DPS_DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect(BRAKE_EFFECT,x,y))
call SaveInteger(.h,GetHandleId(u),7,0)
if z <= -20 or (IsUnitType(u,UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0 ) then
// unit has breaked long enough --> end the effects
call SetUnitPosition(u,GetUnitX(u),GetUnitY(u))
call GroupRemoveUnit(.temp.affected, u)
call PauseUnit(u,false)
endif
endif
endif
set u = null
endmethod
private static method pullEnum takes nothing returns nothing
local unit u = GetEnumUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real a
local real d = SquareRoot((x-.temp.x)*(x-.temp.x)+(y-.temp.y)*(y-.temp.y))
local real array R
if LoadInteger(.h,GetHandleId(u),5) == 1 then
// unit is lifted so circle around antimatter
call UnitDamageTarget(.temp.caster, u, .temp.dps, true, false, DPS_ATTACK_TYPE, DPS_DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
set R[3] = LoadReal(.h,GetHandleId(u),0)//angle
set R[4] = LoadReal(.h,GetHandleId(u),1)//d
set R[5] = LoadReal(.h,GetHandleId(u),2)//size
set R[6] = LoadReal(.h,GetHandleId(u),3)//height
set R[7] = LoadReal(.h,GetHandleId(u),4)//spin
set R[3] = R[3] + R[7] //Credits to Paladon for this incredibly great calculations
set R[4] = R[4] + .temp.pullSpeed
set R[0] = (R[4]/(R[5]/90))*bj_DEGTORAD
set R[1] = R[5]*Sin(R[0])
set R[2] = R[3]*bj_DEGTORAD
call SetUnitX(u,GetUnitX(.temp.u)+R[1]*Cos(R[2]))
call SetUnitY(u,GetUnitY(.temp.u)+R[1]*Sin(R[2]))
call SetUnitFlyHeight(u,(R[5]-R[6])*Cos(R[0])+R[6]+GetUnitFlyHeight(.temp.u),0)
if R[3] >= 360 then
set R[3] = R[3] - 360
endif
call SaveReal(.h,GetHandleId(u),0,R[3]) //angle
call SaveReal(.h,GetHandleId(u),1,R[4]) //d
elseif d > .temp.pullSpeed and not (IsUnitType(u,UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0 ) then
// unit is in pull range
set a = Atan2(.temp.y-y, .temp.x-x)
call SetUnitX(u,x+.temp.pullSpeed * Cos(a))
call SetUnitY(u,y+.temp.pullSpeed * Sin(a))
if d < .temp.liftDist then
// unit is in lift range
if LoadInteger(.h,GetHandleId(u),7) != .temp then
call SaveEffectHandle(.h, GetHandleId(u),6,AddSpecialEffectTarget(DRAG_EFFECT,u,"chest"))
call SaveInteger(.h,GetHandleId(u),7,.temp)
call SaveReal(.h,GetHandleId(u),0,a*bj_RADTODEG) //angle
if UnitAddAbility(u, 'Amrf') then
call UnitRemoveAbility(u, 'Amrf')
endif
call PauseUnit(u,true)
endif
call SetUnitFlyHeight(u,GetUnitFlyHeight(u)+(GetUnitFlyHeight(.temp.u)+SPHERE_MOVEMENT_MAX_HEIGHT*3-GetUnitDefaultFlyHeight(u))/(.temp.liftDist/.temp.pullSpeed),0)
endif
elseif not (IsUnitType(u,UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0 ) then
// setup the lift
call DestroyEffect(LoadEffectHandle(.h, GetHandleId(u),6))
call SaveEffectHandle(.h, GetHandleId(u),6,AddSpecialEffectTarget(VICTIM_EFFECT,u,"chest"))
call SaveReal(.h,GetHandleId(u),1,0) //d
call SaveReal(.h,GetHandleId(u),2,GetRandomReal(SPHERE_MOVEMENT_MIN_SIZE,SPHERE_MOVEMENT_MAX_SIZE)) //size
call SaveReal(.h,GetHandleId(u),3,GetRandomReal(SPHERE_MOVEMENT_MIN_HEIGHT,SPHERE_MOVEMENT_MAX_HEIGHT)) //height
call SaveReal(.h,GetHandleId(u),4,GetRandomReal(-SPHERE_MAX_SPIN_ANGLE,SPHERE_MAX_SPIN_ANGLE)*bj_DEGTORAD) //spin
call SaveInteger(.h,GetHandleId(u),5,1) //circle around sphere
call SaveReal(.h,GetHandleId(u),8,0)
endif
set u = null
endmethod
private static method update takes nothing returns nothing
local integer i = 0
local spell s
local real x
local real y
loop
exitwhen i >= .total
set s = .all[i]
if s.d > s.V then
//move beam
set s.d = s.d - s.V
set s.x = s.x + s.Vx
set s.y = s.y + s.Vy
call MoveLocation(.loc,s.x,s.y)
set s.z = s.z + s.Vz - GetLocationZ(.loc)
call SetUnitX(s.u, s.x )
call SetUnitY(s.u, s.y)
call SetUnitFlyHeight(s.u, s.z, 0)
set s.z = s.z + GetLocationZ(.loc)
elseif s.t == 0 then
// Create the antimatter
set s.t = s.t + INTERVAL
call DestroyEffect(AddSpecialEffectTarget(SPHERE_BIRTH_EFFECT, s.u, "chest"))
call DestroyEffect(s.model)
set s.model = AddSpecialEffectTarget(SPHERE_MODEL, s.u, "chest")
call SetUnitScale(s.u, s.size, s.size, s.size)
elseif s.t < s.life then
// pull units in range
set s.t = s.t + INTERVAL
set .temp = s
call GroupEnumUnitsInRange(.g, s.x, s.y, s.pullDist, .filter)
call ForGroup(.g, function spell.pullEnum)
else
// throw lifted units away
set s.t = s.t + INTERVAL
if s.model != null then
call DestroyEffect(s.model)
call DestroyEffect(AddSpecialEffectTarget(SPHERE_DEATH_EFFECT, s.u, "chest"))
set .temp = s
call GroupEnumUnitsInRange(s.affected, s.x, s.y, s.pullDist, .filter)
set s.model = null
endif
set .temp = s
call ForGroup(s.affected, function spell.throwEnum)
if FirstOfGroup(s.affected) == null and s.t >= s.life + 5 then
// nothing more to process so destroy
call RemoveUnit(s.u)
call DestroyGroup(s.affected)
set s.u = null
set s.affected = null
set s.caster = null
call s.destroy()
set .total = .total - 1
set .all[i] = .all[.total]
set i = i - 1
endif
endif
set i = i + 1
endloop
if .total == 0 then
call PauseTimer(.tim)
endif
endmethod
private static method create takes nothing returns spell
local spell this = spell.allocate()
local unit u = GetTriggerUnit()
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local real tx = GetSpellTargetX()
local real ty = GetSpellTargetY()
local real a = Atan2(ty - uy, tx - ux)
local integer lvl = GetUnitAbilityLevel(u, ABILITY_ID)
// level stuff
set .pullDist = GetPullRange(lvl)
set .pullSpeed = GetPullSpeed(lvl)*INTERVAL
set .sphereZ = GetSphereHeight(lvl)
set .throwSpeed = GetThrowSpeed(lvl)*INTERVAL
set .liftDist = GetLiftRange(lvl)
set .life = GetSphereDuration(lvl)
set .size = GetSphereSize(lvl)
set .dps = GetSphereDamagePerSecond(lvl)*INTERVAL
set .impactDmg = GetImpactDamagePerSecond(lvl)*INTERVAL
set .V = GetBeamVelocity(lvl)*INTERVAL
// rest of struct data
set .caster = u
set .u = CreateUnit(GetOwningPlayer(u), DUMMY_ID, ux, uy, a * bj_RADTODEG)
set .d = SquareRoot((ux-tx)*(ux-tx)+(uy-ty)*(uy-ty))
call MoveLocation(.loc,ux,uy)
set .Vx = .V*Cos(a)
set .Vy = .V*Sin(a)
set .Vz = .V*Sin(Atan2(.sphereZ+GetLocationZ(.loc),.d))
set .t = 0
set .x = ux
set .y = uy
set .z = GetLocationZ(.loc)
set .model = AddSpecialEffectTarget(BEAM_MODEL,.u,"chest")
set .affected = CreateGroup()
// functions for eye candy and functionality
call SetUnitAnimationByIndex(.u,252)
set a = GetBeamSize(lvl)
call SetUnitScale(.u, a, a, a)
call UnitAddAbility(.u, 'Amrf')
call UnitAddAbility(.u, 'Aloc')
// indexing
set .all[.total] = this
set .total = .total + 1
if .total == 1 then
call TimerStart(.tim, INTERVAL, true, function spell.update)
endif
set u = null
return this
endmethod
private static method cast takes nothing returns boolean
if GetSpellAbilityId() == ABILITY_ID then
call spell.create()
endif
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i + 1
exitwhen i >= 12
endloop
call TriggerAddCondition(t,function spell.cast)
set .tim = CreateTimer()
set .g = CreateGroup()
set .filter = Condition( function spell.boolFilter)
set .ite = CreateItem('wolg',0,0)
call SetItemVisible(.ite, false)
call Preload(BEAM_MODEL)
call Preload(SPHERE_MODEL)
call Preload(BRAKE_EFFECT)
call Preload(SPHERE_BIRTH_EFFECT)
call Preload(SPHERE_DEATH_EFFECT)
call Preload(VICTIM_EFFECT)
call Preload(DRAG_EFFECT)
call PreloadStart()
set t = null
endmethod
endstruct
endscope
Okay guys here is my submission:
This spell is:Antimatter ShiverThe Marine launches a beam of a secret substance at the target area.
Once the beam reaches its target it releases pure antimatter, which pulls every unit in range.
If a unit comes to close it is lifted in the air and circles around the antimatter sphere, damaged constantly by the active forces.
After a few seconds the antimatter sphere explodes, throwing all lifted units away!
While a unit brakes on the ground after being thrown it receives, of course, damage too!
- MUI
- in vJass
- NOT in GUI or Jass and NOT transformable into GUI or Jass You just proved that you don't know how vJass works. You wont get any respect from me for this...
- efficient Basic thing.
- leakfree Basic thing.
- bugfree Basic thing.
- easily customizable +
You need JNGP to get this working!!! http://www.wc3c.net/showthread.php?t=90999
Good luck to all other contestants ;D
The reason why the units in my "Tornado" spell are not being thrown away is the risk of getting some of them blocked in doodads. So this is 100% of my Tornado as he was planned first...
//Edit: I tested it some more now. Units move around the orbs which is a bit different to my tornado.
Somehow, the spell is bugging over and over. You tried, but not hard enough. You got no idea of what amount of work i put into my tornado spell or into my submission spell.
You also use vJass since you simply cannot do things in Gui/Jass, what for me is something to be highly disrespected. I prefer someone that does nice GUI work instead of someone that is messing around with vJass, having no clue of the systems behind.
I recommend to modify the basic principles and the idea of your submission. On one hand I've got the impression you are poorly trying to fake my own spell that took me a lot of work long time ago and on the other hand you seemingly cannot cope properly with that complexity, which was also hard to do for me that time...
Massive Air Strike
Description:
HELL YEAHHundreds of thousands of planes coming from the sky destroying the whole goddamn map and blasting every forsaken base to smithereens. Other than that, the spell is intended to be leakless, MUI, optimized, inlined and all that stuff.
Special Effects:
The planes might get shot down before they release all of their stuff on the enemy and will fall.
Bombs will throw infantry units after dealing them some extra shrapnel damage.
Bombs and planes are moving according some pseudo-physic laws.
You could actually own yourself with bombs.
Credits:
Wraith Model: http://www.hiveworkshop.com/forums/models-530/wraith2-47327/ by Killst4r
Rocket Model: http://www.hiveworkshop.com/forums/models-530/rocket-95964/ by WILL THE ALMIGHTY
Good luck to all!!![]()
Originally posted by The_Witcher
hmm I think you should calm down a bit and look at the facts:
i think gui is nice but jass and vjass will always be more efficient than gui...
That's how it is supposed to be when the coding is at high effeciancy.
thats just because most of the gui functions are just wrappers for jass functions...
Did you know that kittens make "miao"? Thats another astonishing fact that was completely new to me!
and you have to be good at gui before thinking about starting with jass!!
I recommend to do it that way, but it is not really necessary
Well i have never seen or tried your tornado spell, i swear!
and i am not trying to copy anything!!
How shall I know? Your spell uses exactly the same uncommon principle. Another fact is that my spell already exists for a long time and my map got quite some downloads, so I cannot be sure about that.
but if you would be so kind and tell me what is so "bugging over and over" so i can fix it, instead of affronting and accusing me??
Seriously. Try your own testmap and you must see.
Piranha89 said:On one hand I've got the impression you are poorly trying to fake my own spell that took me a lot of work long time ago and on the other hand you seemingly cannot cope properly with that complexity, which was also hard to do for me that time...
Piranha89 said:fake my own spell that took me a lot of work long time ago
Piranha89 said:The reason why the units in my "Tornado" spell are not being thrown away is the risk of getting some of them blocked in doodads.
Piranha89 said:You tried, but not hard enough. You got no idea of what amount of work i put into my tornado spell or into my submission spell.