- Joined
- Sep 26, 2009
- Messages
- 9,534
I'm really thankful that you are a part of the WC3 community, Tank-Commander.
Well I did say I had a week, got to put in the extra hours!You are just scary, man.
I appreciate the sentiment it means a lot coming from youBribe said:I'm really thankful that you are a part of the WC3 community, Tank-Commander.
Got any screenshots? I'm curious to see how that idea pans out visually - it sounds really interesting
...
Bah, all ideas I got are either too simple or 'copied'
I'll do it in the morning, it's 1:20am here.Image or two would be good too
library Dispersion requires Alloc RegisterPlayerUnitEvent SpellEffectEvent
globals
private constant integer ABIL_ID = 'mrge'
private constant integer IMAGE_ID = 'mirg'
private constant real TIMEOUT = 0.031250000
/*
* Spell Radius (On Cast)
*/
private constant real MIN_RADIUS = 500
private constant real BASE_CAST_RADIUS = 600
private constant real CAST_RADIUS_PER_LVL = 200
/*
* Spell Radius (On Hit)
*/
private constant real BASE_DMG_RADIUS = 400
private constant real DMG_RADIUS_PER_LVL = 0
/*
* Damage (Target)
*/
private constant real BASE_DAMAGE = 100
private constant real DAMAGE_PER_LVL = 100
/*
* Bonus Damage
*/
private constant real BASE_BONUS_DMG = 0
private constant real BONUS_DMG_PER_LVL = 10
/*
* Damage (AoE)
*/
private constant real BASE_AOE_DMG = BASE_DAMAGE
private constant real AOE_DMG_PER_LVL = DAMAGE_PER_LVL
/*
* Mirage Duration
*/
private constant real MIRAGE_DURATION = 1.5
/*
* SFX
*/
/*
* On Cast
*/
private constant string ON_CAST_SFX = "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl"
/*
* Target Unit Mark
*/
private constant string TARGET_MARK_SFX = "Abilities\\Spells\\Items\\PotionOfOmniscience\\CrystalBallCaster.mdl"
private constant string TARGET_MARK_ATTACH = "overhead"
/*
* Illusion Speed
*/
private constant real ILLUSION_SPEED = 522
/*
* Illusion Disappear SFX
*/
private constant string ON_IMAGE_DEATH_SFX = "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl"
/*
* Illusion Trail Interval
*/
private constant real TRAIL_INTERVAL = 0.2
/*
* Illusion Trail Duration
*/
private constant real TRAIL_DURATION = 0.5
/*
* Image RGB color (0 to 255)
*/
private constant real TRAIL_R = 255
private constant real TRAIL_G = 255
private constant real TRAIL_B = 255
endglobals
private struct Trail extends array
implement Alloc
private real time
private unit u
private static integer array n
private static integer array p
private static integer count = 0
private static timer t = CreateTimer()
method destroy takes nothing returns nothing
call deallocate()
call RemoveUnit(u)
set u = null
set time = 0
set n[p[this]] = n[this]
set p[n[this]] = p[this]
set count = count - 1
if count == 0 then
call PauseTimer(t)
endif
endmethod
private static method period takes nothing returns nothing
local integer this = n[0]
loop
exitwhen this == 0
if time > 0 then
call SetUnitVertexColor(u, 255, 255, 255, 255*time/TRAIL_DURATION)
set time = time - TIMEOUT
else
call destroy()
endif
set this = n[this]
endloop
endmethod
endstruct
endlibrary
scope SpiritPain
native UnitAlive takes unit u returns boolean
globals
//-----------------------------------------------------------------
//-------------------------CONFIGURABLES---------------------------
//-----------------------------------------------------------------
private constant integer SPIRIT_PAIN = 'AspP'
private constant integer SPIRIT_TRANSFER = 'Assw'
private constant integer SILENCE = 'Asil'
private constant real SWAP_CD = 3.0
private constant integer FIRE_ID = 'fire'
private constant integer EARTH_ID = 'eart'
private constant integer STORM_ID = 'strm'
private constant boolean RANDOM_INITIAL_BODY = true
private integer initialBody = STORM_ID //Where the spirit of the caster will be at start, will not work if RANDOM_INITIAL_BODY = true
private constant boolean DAMAGE_ON_EXPIRE = false //Set whether a Spirit expiring will return all damage taken
private constant real DAMAGE_FACTOR = 1.50 //All damage taken by a non-occupied spirit will return to the source scaled to DAMAGE_FACTOR
private constant real KILLER_DAMAGE_FACTOR = 2.00 //All damage taken by a non-ocuupied dying spirit will return damage to its killer scaled to KILLER_DAMAGE_FACTOR
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
//-----------------------------------------------------------------
//-------------------------SYSTEM VARIABLES------------------------
//-----------------------------------------------------------------
endglobals
private struct DmgHandler extends array
implement List
unit source //Source of the Damage
real damage //Total Damage Taken from the Source
endstruct
globals
private Body tempBody
private Table tbId //Table for Instance Id
private trigger uponSummon = CreateTrigger()
private trigger uponDeath = CreateTrigger()
private boolean linkBody
endglobals
struct Body extends array
implement Alloc
private DmgHandler dmgList //List of units that damages the body
private Table dmgTb
private unit caster
private unit body
private real hp //for detecting if body dies due to timer expiration
private boolean hasCaster
private timer cdTimer
private trigger uponDamage
private thistype next
private static method addSwap takes nothing returns nothing
endmethod
private static method onSwap takes nothing returns nothing
local unit new = GetSpellTargetUnit()
local integer unitType = GetUnitTypeId(new)
local thistype this
if unitType == FIRE_ID or unitType == EARTH_ID or unitType == STORM_ID then
set this = tbId[GetHandleId(GetTriggerUnit())]
set hasCaster = false
set thistype[tbId[GetHandleId(new)]].hasCaster = true
call SetUnitVertexColor(new, 255, 255, 255, 255)
if IsUnitAlly(body, GetLocalPlayer()) then
call SetUnitVertexColor(body, 0, 0, 255, 255)
endif
call UnitRemoveAbility(body, SPIRIT_TRANSFER)
call UnitAddAbility(new, SPIRIT_TRANSFER)
endif
endmethod
private static method onDeath takes nothing returns boolean
local unit u = GetTriggerUnit()
local integer unitType = GetUnitTypeId(u)
local thistype this
local unit killer
local DmgHandler dmg //dmg is a temp List
local integer i = 1
if unitType == FIRE_ID or unitType == EARTH_ID or unitType == STORM_ID then
set this = tbId[GetHandleId(u)]
call BJDebugMsg("Body dies")
set killer = GetKillingUnit()
set dmg = dmgList.first
if hasCaster then
if hp < 0.405 then
//Kill other panda bodies
call BJDebugMsg(GetUnitName(next.body))
call BJDebugMsg(GetUnitName(next.next.body))
if UnitAlive(next.body) then
call KillUnit(next.body)
endif
if UnitAlive(next.next.body) then
call KillUnit(next.next.body)
endif
if killer != null then
call UnitDamageTarget(killer, caster, 9999999.9, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
else
call KillUnit(caster)
endif
call SetUnitX(caster, GetUnitX(u))
call SetUnitY(caster, GetUnitY(u))
endif
else
static if not DAMAGE_ON_EXPIRE then
if hp >= 0.405 then
set dmg.damage = 0.0
endif
endif
loop
exitwhen dmg == dmg.sentinel
if dmg.source == killer then
call UnitDamageTarget(caster, dmg.source, KILLER_DAMAGE_FACTOR*dmg.damage, false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
else
call UnitDamageTarget(caster, dmg.source, DAMAGE_FACTOR*dmg.damage, false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
endif
set dmg = dmg.next//Move on to the next node
endloop
endif
call DestroyTrigger(uponDamage)
call dmgTb.destroy()
call dmgList.destroy()
call deallocate()
set killer = null
endif
set u = null
return false
endmethod
private static method onDamage takes nothing returns boolean
//find the instance of the damaged unit
local thistype this = tbId[GetHandleId(GetTriggerUnit())]
local unit u = GetEventDamageSource()
local integer handleId = GetHandleId(u)
local real damageTaken = GetEventDamage()
local DmgHandler dmg //temp damage list node
if not(dmgTb.has(handleId)) then //If the Damage Source is new
set dmg = dmgList.enqueue() //add node to the damage list
set dmgTb[handleId] = dmg //store the node to the Table, for retrieval later
set dmg.source = u
set dmg.damage = damageTaken
elseif not hasCaster then
set dmg = dmgTb[handleId] //retrieve the node based on the damage source
set dmg.damage = dmg.damage + damageTaken
endif
set hp = GetWidgetLife(body) - damageTaken
set u = null
return false
endmethod
private static method onSummon takes nothing returns boolean
local thistype this
local unit u = GetTriggerUnit()
local integer unitType = GetUnitTypeId(u)
local integer i
if unitType == FIRE_ID or unitType == EARTH_ID or unitType == STORM_ID then
set this = allocate()
set body = u
if unitType == initialBody then
set hasCaster = true
call UnitAddAbility(body, SPIRIT_TRANSFER)
call UnitAddAbility(body, SILENCE)
call SetUnitState(body, UNIT_STATE_MANA, 500)
else
if IsUnitAlly(body, GetLocalPlayer()) then
call SetUnitVertexColor(body, 0, 0, 255, 255)
endif
endif
set caster = GetSummoningUnit() //store the caster into the struct for certain purposes
set dmgTb = dmgTb.create() //damage table is for checking if the damage source is in the dmgList; avoids redundant nodes
set dmgList = dmgList.create() //create a list of units to damage on death, initially empty
set hp = 1 //doesn't matter what value as long as it is not less than 0.405
//instance number recovery
set tbId[GetHandleId(body)] = this
//Linking
if linkBody then
if tempBody.caster == caster then
set next = tempBody
if tempBody.next.caster == caster then
set tempBody.next.next = this
endif
endif
else
set linkBody = true
endif
//Built-in DDS
set uponDamage = CreateTrigger()
call TriggerRegisterUnitEvent(uponDamage, body, EVENT_UNIT_DAMAGED)
call TriggerAddCondition(uponDamage, Condition(function thistype.onDamage))
//store the last instance for linking purposes
set tempBody = this
endif
set u = null
return false
endmethod
private static method onCast takes nothing returns nothing
local unit u = GetTriggerUnit()
static if RANDOM_INITIAL_BODY then
//if initial body is random, then resets initialBody at every cast
local integer rand = GetRandomInt(1,3)
call BJDebugMsg("Rand = " + I2S(rand))
if rand == 1 then
set initialBody = STORM_ID
elseif rand == 2 then
set initialBody = EARTH_ID
else
set initialBody = FIRE_ID
endif
endif
set linkBody = false //Tells the spell system that the spell was cast
set u = null
endmethod
private static method onInit takes nothing returns nothing
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(uponSummon, Player(i), EVENT_PLAYER_UNIT_SUMMON, null)
call TriggerRegisterPlayerUnitEvent(uponDeath, Player(i), EVENT_PLAYER_UNIT_DEATH, null)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(uponSummon, Condition(function thistype.onSummon))
call TriggerAddCondition(uponDeath, Condition(function thistype.onDeath))
call RegisterSpellEffectEvent(SPIRIT_TRANSFER, function thistype.onSwap)
call RegisterSpellEffectEvent(SPIRIT_PAIN, function thistype.onCast)
set tbId = tbId.create()
//set tempBody = allocate()
endmethod
endstruct
endscope
Dont give up man. Keep kicking like your avatar.![]()
WIP#2
I just feel like posting it.
Have fun..
I think it was said 'The spell should lead your enemy to wrong decisions.' or what do you mean ? It basically just has to make your enemy a wrong turn.Can someone please define the deception for this contest? Does it mean my spell has to do something else? Other than the main effect?
I would like to participate. Looking at other entries, mine would look weak. Please dont flame me for this.
Yes, the more the merrier.Hm, I think I participate with my idea I posted earlier, even if it is nothing great or unique.
So, my idea, the casting hero becomes invisible and 'all' orders being executed while he has the specific buff will create a dummy unit casting the ability instead, not having any actual effect.
I will see what exactly I am going to do, as there are some options I have to choose from and its extends. Posting a WIP soon.
@Empirean - Deception
Let's pretent you are the pro here. The way you have been pretending that you are not and asking about everything all around is THE perfect deception - because when it comes to serious thing, you would show who's the real pro here.
Get it?
True... he might join last minute and destroy us all.![]()
![]()
WIP meaning still in progress. you would be able to finish it in the last minute?Rules said:You must show at least one unfinished preview of your submission (Wip), before the deadline, as proof that it’s yours.
Why would anyone flame you for participating?
Eh, I hope I can solve my issues, the animation transfer between a caster and a dummy is quite challenging, though I have already an idea.Yes, the more the merrier.
Looking forward to it.
http://dictionary.reference.com/browse/deceive said:verb (used with object), deceived, deceiving.
1.
to mislead by a false appearance or statement; delude: