- Joined
- Jul 12, 2010
- Messages
- 1,737
In the ending poll or following this thread.
i have no idea what you are talking about
In the ending poll or following this thread.
Just wait until the contest is over, I will then create the poll with the submissions listed.
You can, but will have to be checking this very thread, every time a contestant posts an attached file or you can wait till the end, to check every finished and official submission, because people tend to drop out the contests sometimes.
Appointed judges must be experienced in the coding area and/or should at least have 1 spell or system approved in the Spells section.
^ I think that's included by the first part in the statement.![]()
and/or
Lol details baassee^^
I guess Pharaoh_ meant to hire the most unexperienced users in triggering as could get. Guys from modeling/texturing or terraining section would be brilliant here. They got 'commond knowledge', just not the coding one. But eh.. you cares?
Eye-candy? ^^
Thats the problem, find a judgeMeaby Spell contests should be approved after finding decent judges, not before? xD
@Pharaoh_ What a response.
@@@@@Offtop:
Don't you think that kinda of fsjal disease corrupts too many ppl? I don't wanna be here when any of spell mods changes his avatar into fsjal. Maker, Pharaoh_.. Bribe? I can't even imagen that xD
with the ultimate aim of tricking enemies.
//==========================================================================================
// ShadowDistraction v1.00 by watermelon_1234
//******************************************************************************************
// Libraries required: (Libraries with * are optional)
// - DummyCaster [url]http://www.thehelper.net/forums/showthread.php/133873-DummyCaster[/url]
// - T32 [url]http://www.thehelper.net/forums/showthread.php/132538-Timer32[/url]
// * BoundSentinel [url]http://www.wc3c.net/showthread.php?t=102576[/url]
//##########################################################################################
// Importing:
// 1. Copy the abilities: Shadow Distraction, Blind (SD), Illusions (SD), and Invis (SD)
// 2. Copy the buff, Shadow Distraction
// 3. Copy the unit, Shadow (SD)
// 4. Implement the required libraries
// 5. Copy this trigger
// 6. Configure the spell
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Notes:
// - N/A
//==========================================================================================
scope ShadowDistraction
//==========================================================================================
// CONSTANTS
//==========================================================================================
globals
//------------------------------------------------------------------------------------------
// Raw ID of spells and order ID configuration
//------------------------------------------------------------------------------------------
private constant integer SPELL_ID = 'A000' // Raw id of the Shadow Distraction ability
private constant integer ILLUSION_SID = 'A001' // Raw id of the Illusion (SD) ability
private constant integer ILLUSION_OID = 852274 // Order id of the Illusion (SD) ability
private constant integer INVIS_SID = 'A002' // Raw id of the Invis (SD) ability
private constant integer INVIS_OID = 852069 // Order id of the Invis (SD) ability
private constant integer BLIND_SID = 'A003' // Raw id of teh Blind (SD) ability
private constant integer BLIND_OID = 852592 // Order id of the Blind (SD) ability
//------------------------------------------------------------------------------------------
// General Settings for both shadow and illusion
//------------------------------------------------------------------------------------------
private constant boolean PRELOAD = true // Determines if the spell should preload the Shadow unit and abilities
private constant integer MAX_IMAGES = 6 // The max number of shadows/illusions that the spell will make
private constant real IMAGE_ANG_ROTATE = bj_PI/4 // The radians the shadows/illusions will be rotated from their offset position
//------------------------------------------------------------------------------------------
// Shadow settings
//------------------------------------------------------------------------------------------
private constant integer SHADOW_ID = 'e000' // Unit id of the Shadow unit
private constant real SHADOW_OFFSET = 600. // Offset that shadows will be created from target point
private constant string SHADOW_BIRTH_SFX = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" // The sfx played when a shadow is created
private constant integer SHADOW_WALK_INDEX = 1 // Animation index played when the shadow is homing in on the target point
private constant real SHADOW_MOVE_SPEED = 500. // Movement speed of the shadows
private constant boolean EXACT_SHADOW_COORD = true // Ensures that shadows will be created exactly where they're supposed to be if true
private constant boolean RECYCLE_SHADOWS = false // Enables recycling for shadows instead of removing them, note that their facing may look awkward
//------------------------------------------------------------------------------------------
// Illusion settings
//------------------------------------------------------------------------------------------
private constant real ILLUS_OFFSET = 125. // Offset that illusions will be created from target point
private constant integer ILLUS_SHOW_INDEX = 6 // Animation index played when the illusions are shown
endglobals
//==========================================================================================
// OTHER CONFIGURATION
//==========================================================================================
// Number of shadows/illusions per spell
private constant function ImageNumber takes integer lvl returns integer
return 3 + 1*lvl
endfunction
//==========================================================================================
// END OF CONFIGURATION
//==========================================================================================
private struct dat
unit caster // Casting unit
player owner // Owner of caster
integer lvl // Level of Shadow Distraction when it was cast
integer count // Used to count how many illusions the spell has created
boolean hasTarget // Checks if the spell has targetted an enemy unit and slightly changes how the spell works
real x // x coord of target point
real y // y coord of target point
real dist = 0 // Tracks the distance of the shadows so that they home in properly
unit array shadows[MAX_IMAGES] // Stores the shadows that will home in on the target point
unit array illusions[MAX_IMAGES] // Stores the illusions. They're created early so that they will have proper facing when shown
static thistype data = 0 // Used to pass information from the struct to the illusions being created
// Controls shadow movement and when to make the illusions appear
method periodic takes nothing returns nothing
local integer i = 0
local real ux
local real uy
local real dx
local real dy
local real sx
local real sy
local real scale
if .dist < SHADOW_OFFSET - ILLUS_OFFSET then
set .dist = .dist + SHADOW_MOVE_SPEED * T32_PERIOD
call SetUnitOwner(DUMMY, .owner, false) // Make the blind spell properly target enemy units of the caster
call UnitAddAbility(DUMMY, BLIND_SID)
call SetUnitAbilityLevel(DUMMY, BLIND_SID, .lvl)
loop
// Moving the shadow
set ux = GetUnitX(.shadows[i])
set uy = GetUnitY(.shadows[i])
set dx = .x - ux
set dy = .y - uy
set scale = (SHADOW_MOVE_SPEED*T32_PERIOD)/SquareRoot(dx*dx+dy*dy+0.1)
set sx = ux+dx*scale
set sy = uy+dy*scale
call SetUnitX(.shadows[i], sx)
call SetUnitY(.shadows[i], sy)
call IssuePointOrderById(DUMMY, BLIND_OID, sx, sy) // Cast blind spell on the new coords
set i = i + 1
exitwhen i == .count
endloop
call UnitRemoveAbility(DUMMY, BLIND_SID)
call SetUnitOwner(DUMMY, DUMMY_OWNER, false)
else
loop
// Showing the illusion and playing the animation
call ShowUnit(.illusions[i], true)
call SetUnitX(.illusions[i], GetUnitX(.shadows[i]))
call SetUnitY(.illusions[i], GetUnitY(.shadows[i]))
call SetUnitAnimationByIndex(.illusions[i], ILLUS_SHOW_INDEX)
call QueueUnitAnimation(.illusions[i], "stand")
static if RECYCLE_SHADOWS then
call ShowUnit(.shadows[i], false) // Done like this so it can work for all units without visual bugs
else
call RemoveUnit(.shadows[i])
endif
set i = i + 1
exitwhen i == .count
endloop
// Only make the owner select the caster if the spell had a target unit and
// if the owner is not selecting anything else
if .hasTarget and GetLocalPlayer() == .owner then
call GroupEnumUnitsSelected(bj_lastCreatedGroup, .owner, null)
if FirstOfGroup(bj_lastCreatedGroup) == null then
call SelectUnit(.caster, true)
endif
endif
call .stopPeriodic()
call .destroy()
endif
endmethod
implement T32x
// Actual spell actions, creates the shadows and illusions, hides or makes the caster invisible as needed
static method startSpell takes nothing returns nothing
local thistype this = thistype.allocate()
local integer i = 0
local real ang
local real sx
local real sy
local integer num // Keeps track of how many times the illusion spell must be cast
set .caster = GetTriggerUnit()
set .owner = GetTriggerPlayer()
call UnitRemoveBuffs(.caster, true, true) // Dispel buffs from the user like Mirror Image
set .lvl = GetUnitAbilityLevel(.caster, SPELL_ID)
// Sets DUMMY owner to .owner so that illusions will be created for the right owner
// and the invisibility spell will be treated as friendly
call SetUnitOwner(DUMMY, .owner, false)
set .hasTarget = GetSpellTargetUnit() != null
if .hasTarget then
// Makes the spell consider the caster as one of the illusions
// Actual images made will be one less
set .count = 1
set .illusions[0] = .caster
set .x = GetUnitX(GetSpellTargetUnit())
set .y = GetUnitY(GetSpellTargetUnit())
set num = ImageNumber(lvl) - 1
else
// Creates the actual number of illusions listed by the spell
// and makes the caster invisible
set .count = 0
set .x = GetSpellTargetX()
set .y = GetSpellTargetY()
call UnitAddAbility(DUMMY, INVIS_SID)
call IssueTargetOrderById(DUMMY, INVIS_OID, .caster)
call UnitRemoveAbility(DUMMY, INVIS_SID)
set num = ImageNumber(lvl)
endif
// Creating the illusions
set data = this // Since the spell will be cast instantly, a global can be used to pass info
// to the createIllusion method without conflicting
call UnitAddAbility(DUMMY, ILLUSION_SID)
call SetUnitAbilityLevel(DUMMY, ILLUSION_SID, .lvl)
loop
call IssueTargetOrderById(DUMMY, ILLUSION_OID, .caster)
set i = i + 1
exitwhen i == num
endloop
call UnitRemoveAbility(DUMMY, ILLUSION_SID)
call SetUnitOwner(DUMMY, DUMMY_OWNER, false)
set data = 0 // So that the illusion summon actions only work for this spell
set ang = bj_PI*2/.count * GetRandomInt(1, .count) + IMAGE_ANG_ROTATE
// Illusion and Shadow settings
set i = 0
loop
call SetUnitFacing(.illusions[i], 180 + ang * bj_RADTODEG)
call ShowUnit(.illusions[i], false)
set sx = .x + SHADOW_OFFSET*Cos(ang)
set sy = .y + SHADOW_OFFSET*Sin(ang)
static if RECYCLE_SHADOWS then
if .shadows[i] == null then
set .shadows[i] = CreateUnit(.owner, SHADOW_ID, sx, sy, 180 + ang * bj_RADTODEG)
else
call ShowUnit(.shadows[i], true)
call UnitRemoveAbility(.shadows[i], 'Aloc')
call UnitAddAbility(.shadows[i], 'Aloc')
call SetUnitFacing(.shadows[i], 180 + ang * bj_RADTODEG)
// Ensures that setting the shadow's coordinates won't be repeated if EXACT_SHADOW_COORD is true
static if not EXACT_SHADOW_COORD then
call SetUnitX(.shadows[i], sx)
call SetUnitY(.shadows[i], sy)
endif
endif
else
set .shadows[i] = CreateUnit(.owner, SHADOW_ID, sx, sy, 180 + ang * bj_RADTODEG)
endif
static if EXACT_SHADOW_COORD then
call SetUnitX(.shadows[i], sx)
call SetUnitY(.shadows[i], sy)
endif
call SetUnitAnimationByIndex(.shadows[i], SHADOW_WALK_INDEX)
call DestroyEffect(AddSpecialEffect(SHADOW_BIRTH_SFX, sx, sy))
set ang = ang + bj_PI*2/.count
set i = i + 1
exitwhen i == .count
endloop
call .startPeriodic()
endmethod
// Stores created illusions from this spell into the unit array of the respective struct
static method createIllusion takes nothing returns boolean
if data != 0 then
set data.illusions[data.count] = GetTriggerUnit()
set data.count = data.count + 1
endif
return false
endmethod
static method spellActions takes nothing returns boolean
if GetSpellAbilityId() == SPELL_ID then
call thistype.startSpell()
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.spellActions))
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(t, Condition(function thistype.createIllusion))
set t = null
static if PRELOAD then
set bj_lastCreatedUnit = CreateUnit(Player(15), SHADOW_ID, 0, 0, 0)
call UnitAddAbility(bj_lastCreatedUnit, ILLUSION_SID)
call UnitAddAbility(bj_lastCreatedUnit, INVIS_SID)
call UnitAddAbility(bj_lastCreatedUnit, BLIND_SID)
call RemoveUnit(bj_lastCreatedUnit)
endif
endmethod
endstruct
endscope
4 days left, is it so hard for you to create a single spell? :S
Pharaoh,where should i submit my spell (when i finished it)?
3 (three) weeks ->> 4 (four) weeks. If we stick to details tho, 4 weeks don't match month either ;>All submissions must be complete and submitted within 3 (three) weeks, after the launch of the contest, which begins on September 18th, 2011 and concludes on October 18th, 11:59 PM, 2011 UTC.