- Joined
- Apr 24, 2012
- Messages
- 9,802
Autocast? If the third skill is activated and used by normal attacks, there would be no way to detect that. 

Did you test the one I uploaded, BunnyAng?
Oh, did you want the shadow trail to stay behind until the possession is finished?
scope ShadowPossession
// =====
// START OF CONFIGURABLES
// =====
globals
public constant integer SPELL_ID = 'A000' // "Shadow Possession" hero ability.
private constant integer SHADOW_ID = 'e001' // "Shadow" unit.
private constant integer MANA_DRAIN = 5 // How much mana is drained while the shadow/caster is moving.
private constant real POSSESSION_DUR = 10.0 // Duration of possession.
private constant real BREAK_DISTANCE = 1000.0 // Possession ends if distance between caster and target is greater than this in the first few seconds.
private constant real EFFECT_DIST = 50.0 // Distance between each shadow effect.
private constant real SHADOW_SPEED = 450 // How fast the shadow travels.
// Effect created on caster while possession is active:
private constant string POSSESS_CAST = "Abilities\\Spells\\Undead\\Possession\\PossessionCaster.mdl"
// Effect created on target while possession is active:
private constant string POSSESS_TARG = "Abilities\\Spells\\Undead\\Possession\\PossessionTarget.mdl"
// Attachment point of POSSESS_CAST on caster:
private constant string CASTER_ATTACH = "overhead"
// Attachment point of POSSESS_TARG on target:
private constant string TARGET_ATTACH = "overhead"
endglobals
/**
* When the shadow travels this much distance, mana is drained.
*/
private function GetDistancePerMana takes integer level returns real
// Level 1 -> 50
// Level 2 -> 100
// Level 3 -> 150
return 50.0 * level
endfunction
/**
* If the distance between the caster and target exceeds BREAK_DISTANCE
* within this amount of time, the possession ends.
*/
private function GetCheckTime takes integer level returns real
// Level 1 -> 2
// Level 2 -> 3
// Level 3 -> 4
return 1.0 + level
endfunction
// =====
// END OF CONFIGURABLES
// =====
globals
private constant real INCREMENT = SHADOW_SPEED * XE_ANIMATION_PERIOD
endglobals
private struct Possession
unit source
unit target
group shadows
effect sFx
effect tFx
real lastX
real lastY
real manaDrain
real time = POSSESSION_DUR
boolean check = true
real checkTime
private method destroy takes nothing returns nothing
for source in shadows
call RemoveUnit(source)
endfor
call ReleaseGroup(shadows)
call UnitStopMimickingOrders(target)
call IssueImmediateOrder(target, "stop")
call DestroyEffect(sFx)
call DestroyEffect(tFx)
set target = null
set sFx = null
set tFx = null
endmethod
private method getDistance takes nothing returns real
local real dx = GetUnitX(source) - lastX
local real dy = GetUnitY(source) - lastY
return SquareRoot((dx * dx) + (dy * dy))
endmethod
private method getTargetDistance takes nothing returns real
local real dx = GetUnitX(source) - GetUnitX(target)
local real dy = GetUnitY(source) - GetUnitY(target)
return SquareRoot((dx * dx) + (dy * dy))
endmethod
private method periodic takes nothing returns nothing
local real dist
local real cost
local real mana
// If still checking distance between caster and target:
if (check) then
set checkTime = checkTime - T32_PERIOD
// If they exceed maximum distance, stop spell:
if (getTargetDistance() > BREAK_DISTANCE) then
call stopPeriodic()
call destroy()
return
// Otherwise if the time is up, remember this:
elseif (checkTime <= 0.0) then
set check = false
endif
endif
set dist = getDistance()
// If the caster has moved:
if (dist > 0.0) then
set lastX = GetUnitX(source)
set lastY = GetUnitY(source)
set cost = dist * manaDrain
set mana = GetUnitState(source, UNIT_STATE_MANA)
// If the caster has enough mana:
if (cost <= mana) then
// Drain mana:
call SetUnitState(source, UNIT_STATE_MANA, mana - cost)
// Otherwise, cancel possession:
else
call stopPeriodic()
call destroy()
endif
endif
// Cancel possession if time is up:
set time = time - T32_PERIOD
if (time <= 0.0) then
call stopPeriodic()
call destroy()
endif
endmethod
implement T32x
static method create takes unit s, unit t, group g returns thistype
local thistype this = allocate()
set source = s
set target = t
set shadows = g
set lastX = GetUnitX(source)
set lastY = GetUnitY(source)
set checkTime = GetCheckTime(GetUnitAbilityLevel(source, SPELL_ID))
set manaDrain = MANA_DRAIN / GetDistancePerMana(GetUnitAbilityLevel(source, SPELL_ID))
set sFx = AddSpecialEffectTarget(POSSESS_CAST, source, CASTER_ATTACH)
set tFx = AddSpecialEffectTarget(POSSESS_TARG, target, TARGET_ATTACH)
call UnitMimicOrders(target, source)
call startPeriodic()
return this
endmethod
endstruct
private struct SpellData extends xemissile
unit caster
integer level
boolean remove = true
real manaDist
real curDist = 0.0
real effDist = 0.0
group shadows
private method onDestroy takes nothing returns nothing
// Remove shadows if caster ran out of mana:
if (remove) then
for caster in shadows
call RemoveUnit(caster)
endfor
call ReleaseGroup(shadows)
else
set caster = null
endif
endmethod
private method onHit takes nothing returns nothing
call Possession.create(caster, targetUnit, shadows)
set remove = false
endmethod
private method loopControl takes nothing returns nothing
local real mana
local real ang
local unit temp
set curDist = curDist + INCREMENT
set effDist = effDist + INCREMENT
if (effDist >= EFFECT_DIST) then
set effDist = effDist - EFFECT_DIST
set ang = Atan2(GetUnitY(targetUnit) - y, GetUnitX(targetUnit) - x)
set temp = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), SHADOW_ID, x, y, Rad2Deg(ang))
call GroupAddUnit(shadows, temp)
endif
// Time to drain mana:
if (curDist >= manaDist) then
set mana = GetUnitState(caster, UNIT_STATE_MANA)
// Caster has enough mana:
if (mana >= MANA_DRAIN) then
call SetUnitState(caster, UNIT_STATE_MANA, mana - MANA_DRAIN)
set curDist = curDist - manaDist
// Not enough mana:
else
call terminate()
endif
endif
endmethod
private static method create takes nothing returns thistype
local unit c = GetTriggerUnit()
local thistype this = allocate(GetUnitX(c), GetUnitY(c), 0.0, 0.0, 0.0, 0.0)
set caster = c
set targetUnit = GetSpellTargetUnit()
set shadows = NewGroup()
set level = GetUnitAbilityLevel(caster, SPELL_ID)
set manaDist = GetDistancePerMana(level)
call launch(SHADOW_SPEED, 0.0)
return this
endmethod
private static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function thistype.create)
call Preload(POSSESS_CAST)
call Preload(POSSESS_TARG)
endmethod
endstruct
endscope
Hesoyham |
Type: Active Target Ground Description: Collect all water from underground or nearby water. Then release it into a ball that bursh away enemy on your sight!! Effect: Channel for 2 second, then release it with direction of targeted ground. Damaging unit for 200 damage ( Pure ) Within 240 range from the ball, pull for 400 range. After it reach the end / Final destination, it will splash and damaging unit on 400 area for 400 damage ( Pure ) And pull for 400 range. The ball has 1000 Range, moving with 500 Speed. Manacost: 200 Mana Cooldown: 40 Second Casting Range: 1000 Range Concept ( UPDATED ): ![]() |
@Mr_Bean I don't have one... is that required?
uhmm can all the units just recieve the damage at the same time? if not then carrion swarm is alright![]()
@FRENGERS: ~Accepted. Do you want the spell in vJASS?
@Zyne: ~Accepted. Which damage detection system do you have? Also, is Siphon of Destruction basically Carrion Swarm?
Restart |
Type: Active Target Ally Self Description: Restart your life if you die. If you don't die, then nothing. Effect: If you die ( You can't die while affected with this, it keep your hp to 1 ( Just like Shallow Grave on DotA ) Within the duration, you will regain back your life ( Reset the HP and Mana to full, removing all kind buff ). But, if you not dying ( Or NOT reach 1 hp ( Just like I mention ) ) You'v got nothing. Last 2/3/4 Second Manacost: 400 Mana Cooldown: 60 Second Casting Range: 800/1000/1200 Range Concept: ![]() |
It's in vJASS; I suppose all that's needed is the dummy unit's and the ability's id.
@FRENGERS: Please try to wait a week before making requests. Next time, make a spell pack request.
Spell pack request
Spell Name: Needle of Death
Coded in: vJASS
Number of Levels: 4
Mana Cost: 90
Cooldown: 12 seconds
Cast Type: active
Target Type: unit
Description: Hanzo use this skill to make the enemy could not escape
1 - slows Ms by 20% for 2 second and Reduces` enemies strength by 6
2 - slows Ms by 30% for 2.5 second and Reduces` enemies strength by 7
3 - slows Ms by 40% for 3 second and Reduces` enemies strength by 8
4 - slows Ms by 50% for 4 second and Reduces` enemies strength by 10
c range: 1300
Spell pack request
Spell Name: Shadow Leap
Coded in: vJASS
Number of Levels: 4
Mana Cost: 75
Cooldown: 12/9/7/5 seconds
Cast Type: active
Target Type: Point
Description: Hanzo tried to Attack while jump(Blink), 900 Range, an enemy that elapsed be exposed to damage, dealing critical Damage
1 - 1.5x crit
2 - 1.75x crit
3 - 2x crit
4 - 2.5x crit
Spell Name: Hide in Darkness
Coded in: vJASS
Number of Levels: 4
Mana Cost: -
Cooldown: -
Cast Type: -
Target Type: -
Description: if Hanzo not move for 5/4/3/2 seconds Hanzo will be invisible and + HP regen, and staying in position, if Hanzo move will be seen again
1 - 5 second fade time, + 5 HP and mana regeneration per seccond
2 - 4 second fade time, + 7 HP and mana regeneration per second
3 - 3 second fade time, + 8 HP and mana regeneration per second
4 - 2 second fade time, + 9 HP and mana regeneration per second
Spell Name: Sight of Assassin
Coded in: vJASS
Number of Levels: 3
Mana Cost: 100
Cooldown: 35 seconds
Cast Type: active
Target Type: instant
Description: add 20/30/40 damage, reduce enemy armor by 5/10/15 armor in 500/600/700 aoe and trus sight