wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 08-01-2007, 12:31 PM   #46
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

There is no "a unit leaves range" event, Gorman.

And yes, I was planning on using a modified Slow Poison for Envenom.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-01-2007, 12:54 PM   #47
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Don't make that spell MUI.
Overlaps of it will cause more problems than you can hope to deal with over summer vacation.

Because if one unit is in range of two people casting it --
Who gets the unit?
__________________
Rising_Dusk is offline   Reply With Quote
Old 08-01-2007, 12:57 PM   #48
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I was going to just leave that up to chance and whoever had the faster timer... but... argh!

Non-MUI spells that should be MUI make me cry.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 08-01-2007, 01:10 PM   #49
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Leave it up to chance?
My guess is that you're attaching a handle to each public unit object to store the "original owner" to that unit..
Then you're checking that that variable attached to any one unit exists, to see if you need to convert it, etc.
You also need to do checks to make sure the unit is still in range of the spell, and you also need to make checks to change the original owner in case it changes. (Charm, anyone?)

Spell overlap on this type of thing is also terribly bad.
__________________
Rising_Dusk is offline   Reply With Quote
Old 08-01-2007, 01:32 PM   #50
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

Quote:
but I just can't figure out how to detect which units are out of range of any instance of the spell

groupenumunitsinrange
__________________
emjlr3 is offline   Reply With Quote
Old 08-01-2007, 01:36 PM   #51
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

That spell is going to use like 500 handle atachments in any one instance.
Lol.
__________________
Rising_Dusk is offline   Reply With Quote
Old 08-01-2007, 01:50 PM   #52
Pyritie
Doesn't come here often
 
Pyritie's Avatar
 
Join Date: Jan 2007
Posts: 451

Submissions (9)

Pyritie will become famous soon enough (47)Pyritie will become famous soon enough (47)

Send a message via MSN to Pyritie
Default

Okay here's mine.

Name: Cloud (just use the same icon, doesn't matter)
Levels: Just 1
Type: Target area, non-channeling, not MUI, JASS/GUI (whichever you prefer)
What it does: Summons a cloud of fog so thick that the units inside are confused and attack any other unit, whether it is in the cloud or not, and irrespective of whether it's friendly or foe. If a unit leaves the cloud, then it attacks units like normal. Duration: 15 secs.

Tell me if you need any more info.
Pyritie is offline   Reply With Quote
Old 08-01-2007, 02:02 PM   #53
Gorman
.▲▼▲&#9
 
Gorman's Avatar
 
Join Date: Apr 2007
Posts: 1,087

Submissions (2)

Gorman will become famous soon enough (70)Gorman will become famous soon enough (70)Gorman will become famous soon enough (70)

Send a message via MSN to Gorman
Default

@pyro: i had an idea, make distance between a charmed dude and the caster a variable, and use the event "Value of real variable becuomes Greater then ..... (watever range)" and then bam! no more charmed!
__________________
Gorman is offline   Reply With Quote
Old 08-01-2007, 05:49 PM   #54
Fulla
Evil Overlord
 
Fulla's Avatar
 
Join Date: Jan 2006
Posts: 1,416

Submissions (3)

Fulla has a spectacular aura about (79)Fulla has a spectacular aura about (79)Fulla has a spectacular aura about (79)

Default

Dont worry about MUI Pyro, doesnt have to be.
Just do the best you can :)
__________________
Fulla is offline   Reply With Quote
Old 08-01-2007, 06:51 PM   #55
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

A fast idea about the Fulla spell, I think this MUI can be solved by adding a buff to the target units, so the spell can't affect them if they don't have already that buff. At the end, this is a triggered and complex aura, but not impossible to develop IMO.

Last edited by moyack : 08-01-2007 at 06:53 PM.
moyack is offline   Reply With Quote
Old 08-01-2007, 11:41 PM   #56
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Actually, the spell doesn't use like a billion HandleVars... only 1 on each unit when it's affected by the spell. But, due to those MUI problems, I'll just stop making it MUI. Here's what I had so far (and yes I was using converted player indexes to save handle usage):
Collapse JASS:
constant function Beguile_AbilityId takes nothing returns integer
    return 'A000'
endfunction

constant function Beguile_DummyAbilityId takes nothing returns integer
    return 'A001'
endfunction

constant function Beguile_DummyUnitId takes nothing returns integer
    return 'h000'
endfunction

constant function Beguile_Radius takes integer Level returns real
    return 200.00+(35.00*Level)
endfunction

constant function Beguile_AffectHeroes takes integer Level returns boolean
    return false
endfunction

constant function Beguile_AffectUnits takes integer Level returns boolean
    return true
endfunction

constant function Beguile_AffectStructures takes integer Level returns boolean
    return false
endfunction

constant function Beguile_AffectOrganics takes integer Level returns boolean
    return true
endfunction

constant function Beguile_AffectMechanicals takes integer Level returns boolean
    return false
endfunction

constant function Beguile_AffectMagicImmunes takes integer Level returns boolean
    return true
endfunction

constant function Beguile_ChangeColor takes nothing returns boolean
    return true
endfunction




function Beguile_CastConditions takes nothing returns boolean
    return GetSpellAbilityId() == Beguile_AbilityId()
endfunction

function Beguile_Filter takes nothing returns boolean
    local unit U = GetFilterUnit()
    local boolean Hero = bj_slotControlUsed[101] and (IsUnitType(U, UNIT_TYPE_HERO) == true)
    local boolean Unit = bj_slotControlUsed[102] and (IsUnitType(U, UNIT_TYPE_HERO) == false)
    local boolean Structure = bj_slotControlUsed[103] and (IsUnitType(U, UNIT_TYPE_STRUCTURE) == true)
    local boolean Organic = bj_slotControlUsed[104] and (IsUnitType(U, UNIT_TYPE_MECHANICAL) == false)
    local boolean Mechanical = bj_slotControlUsed[105] and (IsUnitType(U, UNIT_TYPE_MECHANICAL) == true)
    local boolean MagicImmune = IsUnitType(U, UNIT_TYPE_MAGIC_IMMUNE) == true
    local boolean OtherPlayer = GetOwningPlayer(U) != bj_groupEnumOwningPlayer

    set U = null
    return (Hero or Unit or Structure or Organic or Mechanical) and (bj_slotControlUsed[106] or (not(bj_slotControlUsed[106]) and not(MagicImmune))) and OtherPlayer
endfunction

function Beguile_Callback takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local string Table = GetAttachmentTable(T)
    local group G = GetTableGroup(Table, "Beguile Group")
    local boolexpr B
    local integer I = 0
    local unit U
    local unit Dummy
    local real X = GetTableReal(Table, "Beguile X")
    local real Y = GetTableReal(Table, "Beguile Y")
    local boolean ColorChange = Beguile_ChangeColor()
    local integer Level = GetTableInt(Table, "Beguile Level")
    local integer DummyId = Beguile_DummyUnitId()
    local integer DummyAbility = Beguile_DummyAbilityId()

    set bj_groupEnumOwningPlayer = Player(GetTableInt(Table, "Beguile Player Index"))
    loop
        set I = I+1
        exitwhen I > 6
        set bj_slotControlUsed[100+I] = GetTableBoolean(Table, "Beguile Boolean "+I2S(I))
    endloop
    set B = Condition(function Beguile_Filter)

    call GroupEnumUnitsInRange(G, X, Y, GetTableReal(Table, "Beguile Radius"), B)

    loop
        set U = FirstOfGroup(G)
        exitwhen U == null

        set Table = GetAttachmentTable(U)
        if GetTableInt(Table, "Beguile Previous Owner Index") == 0 then
            call SetTableInt(Table, "Beguile Previous Owner Index", GetPlayerId(GetOwningPlayer(U))+1)
        endif
        call SetUnitOwner(U, bj_groupEnumOwningPlayer, ColorChange)
        set Dummy = CreateUnit(bj_groupEnumOwningPlayer, DummyId, X, Y, 0.00)
        call UnitAddAbility(Dummy, DummyAbility)
        call SetUnitAbilityLevel(Dummy, DummyAbility, Level)
        call IssueTargetOrder(Dummy, "innerfire", U)
        call UnitApplyTimedLife(Dummy, 'BTLF', 2.00)

        call GroupRemoveUnit(G, U)
    endloop

    set Dummy = null
    set G = null
    call DestroyBoolExpr(B)
    set B = null
endfunction

function Beguile_EndCast takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local string Table = GetAttachmentTable(U)
    local timer T = GetTableTimer(Table, "Beguile Timer")

    call DestroyGroup(GetAttachedGroup(T, "Beguile Group"))

    call PauseTimer(T)
    call CleanAttachedVars(T)
    call DestroyTimer(T)

    call AttachObject(U, "Beguile Timer", null)

    set U = null
    set T = null
endfunction

function Beguile_Cast takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local integer Level = GetUnitAbilityLevel(U, Beguile_AbilityId())
    local real X = GetUnitX(U)
    local real Y = GetUnitY(U)
    local group G = CreateGroup()
    local real R = Beguile_Radius(Level)
    local boolexpr B
    local unit U2
    local string Table
    local boolean ColorChange = Beguile_ChangeColor()
    local timer T = CreateTimer()
    local unit Dummy
    local integer DummyId = Beguile_DummyUnitId()
    local integer DummyAbility = Beguile_DummyAbilityId()
    local integer I = 0

    set bj_groupEnumOwningPlayer = GetOwningPlayer(U)
    set bj_slotControlUsed[101] = Beguile_AffectHeroes(Level)
    set bj_slotControlUsed[102] = Beguile_AffectUnits(Level)
    set bj_slotControlUsed[103] = Beguile_AffectStructures(Level)
    set bj_slotControlUsed[104] = Beguile_AffectOrganics(Level)
    set bj_slotControlUsed[105] = Beguile_AffectMechanicals(Level)
    set bj_slotControlUsed[106] = Beguile_AffectMagicImmunes(Level)
    set B = Condition(function Beguile_Filter)

    call GroupEnumUnitsInRange(G, X, Y, R, B)

    loop
        set U2 = FirstOfGroup(G)
        exitwhen U2 == null

        set Table = GetAttachmentTable(U2)
        if GetTableInt(Table, "Beguile Previous Owner Index") == 0 then
            call SetTableInt(Table, "Beguile Previous Owner Index", GetPlayerId(GetOwningPlayer(U2))+1)
        endif
        call SetUnitOwner(U2, bj_groupEnumOwningPlayer, ColorChange)
        set Dummy = CreateUnit(bj_groupEnumOwningPlayer, DummyId, X, Y, 0.00)
        call UnitAddAbility(Dummy, DummyAbility)
        call SetUnitAbilityLevel(Dummy, DummyAbility, Level)
        call IssueTargetOrder(Dummy, "innerfire", U2)
        call UnitApplyTimedLife(Dummy, 'BTLF', 2.00)

        call GroupRemoveUnit(G, U2)
    endloop

    call AttachObject(U, "Beguile Timer", T)

    set Table = GetAttachmentTable(T)
    call SetTableObject(Table, "Beguile Group", G)
    call SetTableReal(Table, "Beguile X", X)
    call SetTableReal(Table, "Beguile Y", Y)
    call SetTableReal(Table, "Beguile Radius", R)
    call SetTableInt(Table, "Beguile Level", Level)
    call SetTableInt(Table, "Beguile Player Index", GetPlayerId(bj_groupEnumOwningPlayer))
    loop
        set I = I+1
        exitwhen I > 6
        call SetTableBoolean(Table, "Beguile Boolean "+I2S(I), bj_slotControlUsed[100+I])
    endloop

    call TimerStart(T, 0.20, true, function Beguile_Callback)

    set U = null
    set Dummy = null
    set G = null
    call DestroyBoolExpr(B)
    set B = null
    set T = null
endfunction

//===========================================================================
function InitTrig_Beguile takes nothing returns nothing
    local trigger EndCast = CreateTrigger()

    set gg_trg_Beguile = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Beguile, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Beguile, Condition(function Beguile_CastConditions))
    call TriggerAddAction(gg_trg_Beguile, function Beguile_Cast)

    call TriggerRegisterAnyUnitEventBJ(EndCast, EVENT_PLAYER_UNIT_SPELL_FINISH)
    call TriggerRegisterAnyUnitEventBJ(EndCast, EVENT_PLAYER_UNIT_SPELL_ENDCAST)
    call TriggerAddCondition(EndCast, Condition(function Beguile_CastConditions))
    call TriggerAddAction(EndCast, function Beguile_EndCast)

    set EndCast = null
endfunction


Edit: Yeah, Moyack, I was trying to make channel give a buff to affected units so that there wouldn't be that horrible aura refresh rate, but no luck.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

Last edited by Pyrogasm : 08-01-2007 at 11:46 PM.
Pyrogasm is offline   Reply With Quote
Old 08-02-2007, 02:34 AM   #57
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Ok, I was bored and I did my Beguile spell version. check it if it works, and if you like it and want to improve it, then use it as you want.

Collapse JASS:
// This spell will require CSSafety and HandleVars LOL!!

constant function Beguile_SpellID takes nothing returns integer
    return 'A000' // normal spell, I'll base it on WarStomp
endfunction

constant function Beguile_BuffAbilID takes nothing returns integer
    return 'A001' // ability which carry the buff, based on slow aura, so the target units will have buff and a way to idetify yeah!!
endfunction

constant function Beguile_AOE takes nothing returns real
    return 500. // AOE
endfunction

constant function Beguile_dt takes nothing returns real
    return 0.5 // timer rate
endfunction

constant function Beguile_dur takes nothing returns real
    return 20. // Spell duration
endfunction

constant function Beguile_fx takes nothing returns string
    return "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl"
endfunction


function Beguile_GetUnits takes nothing returns boolean
    local unit U = GetFilterUnit()
    local boolean Hero = IsUnitType(U, UNIT_TYPE_HERO) == true
    local boolean Unit = IsUnitType(U, UNIT_TYPE_HERO) == false
    local boolean Structure = IsUnitType(U, UNIT_TYPE_STRUCTURE) == true
    local boolean Organic = IsUnitType(U, UNIT_TYPE_MECHANICAL) == false
    local boolean Mechanical = IsUnitType(U, UNIT_TYPE_MECHANICAL) == true
    local boolean MagicImmune = IsUnitType(U, UNIT_TYPE_MAGIC_IMMUNE) == true
    local boolean OtherPlayer = IsUnitEnemy(U, bj_groupEnumOwningPlayer)

    set U = null
    return (Hero or Unit or Structure or Organic or Mechanical) and (bj_slotControlUsed[106] or (not(bj_slotControlUsed[106]) and not(MagicImmune))) and OtherPlayer
endfunction

function Beguile_GetPreviousOwner takes unit u returns player
    local integer i = GetUnitUserData(u)
    if i > 15 then
        return Player(15)
    else
        return Player(i)
    endif
endfunction

function Beguile_AddBuff takes nothing returns nothing
    call UnitAddAbility(GetEnumUnit(), Beguile_BuffAbilID())
    call SetUnitUserData(GetEnumUnit(), GetPlayerId(GetOwningPlayer(GetEnumUnit())))
    call SetUnitOwner(GetEnumUnit(), bj_groupEnumOwningPlayer, true)
    call SetUnitUseFood(GetEnumUnit(), false) // with this the target unit won't affect the food capacity of your town
    call DestroyEffect(AddSpecialEffect(Beguile_fx(), GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit())))
endfunction

function Beguile_RemoveBuff takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), Beguile_BuffAbilID())
    call SetUnitOwner(GetEnumUnit(), Beguile_GetPreviousOwner(GetEnumUnit()), true)
    call SetUnitUseFood(GetEnumUnit(), true)
endfunction



function Beguile_loop takes nothing returns nothing
    local timer tm = GetExpiredTimer()
    local unit c = GetHandleUnit(tm, "caster")
    local group g = GetHandleGroup(tm, "group")
    local real cg = GetHandleReal(tm, "countgroup")
    local real dur = GetHandleReal(tm, "dur") 
    local boolexpr b = Condition(function Beguile_GetUnits)
    local unit u
    set bj_groupAddGroupDest = CreateGroup() // used temporally to add or remove units in the spell
    set bj_groupEnumOwningPlayer = GetOwningPlayer(c)
    
    // if group is empty, then fill it and add the ability buff to those units
    if cg == 0 then
        call GroupEnumUnitsInRange(g, GetUnitX(c), GetUnitY(c), Beguile_AOE(), b)
        call ForGroup(g, function Beguile_AddBuff)
        set cg = CountUnitsInGroup(g)
        call SetHandleReal(tm, "countgroup", cg)
    endif
    
    // if any unit doesn't have the buff and is in the AOE then it's added to the target group
    call GroupEnumUnitsInRange(bj_groupAddGroupDest, GetUnitX(c), GetUnitY(c), Beguile_AOE(), b)
    loop
        set u = FirstOfGroup(bj_groupAddGroupDest)
        exitwhen u == null
        if GetUnitAbilityLevel(u, Beguile_BuffAbilID()) < 1 and IsUnitInRange(u, c, Beguile_AOE()) then
            call UnitAddAbility(u, Beguile_BuffAbilID())
            call SetUnitUserData(u, GetPlayerId(GetOwningPlayer(u)))
            call SetUnitOwner(u, bj_groupEnumOwningPlayer, true)
            call SetUnitUseFood(u, false)
            call GroupAddUnit(g, u)
            call SetHandleReal(tm, "countgroup", GetHandleReal(tm, "countgroup") + 1)    
        endif
        call GroupRemoveUnit(bj_groupAddGroupDest, u)     
    endloop
    
    // if any unit in the target group is farder than the AOE, then the buff is removed and the control is returned to the previous player
    call ForGroup(g, function GroupAddGroupEnum)
    loop
        set u = FirstOfGroup(bj_groupAddGroupDest)
        exitwhen u == null
        if GetUnitAbilityLevel(u, Beguile_BuffAbilID()) > 0 and not IsUnitInRange(u, c, Beguile_AOE()) then
            call UnitRemoveAbility(u, Beguile_BuffAbilID())
            call SetUnitOwner(u, Beguile_GetPreviousOwner(u), true)
            call SetUnitUseFood(u, true)
            call GroupRemoveUnit(g, u)
            call SetHandleReal(tm, "countgroup", GetHandleReal(tm, "countgroup") - 1)    
        endif
        call GroupRemoveUnit(bj_groupAddGroupDest, u)
    endloop
    call DestroyGroup( bj_groupAddGroupDest )
    // increases the timer counter and checks if the spell must finish
    call SetHandleReal(tm, "dur", dur + Beguile_dt())
    if dur > Beguile_dur() then
        call ForGroup(g, function Beguile_RemoveBuff)
        call DestroyGroup(g)
        set g = null
        set c = null
        call FlushHandleLocals(tm)
        call ReleaseTimer(tm)
    endif 
    call DestroyBoolExpr(b)
    set b = null
    set bj_groupAddGroupDest = null 
endfunction

//********************
// casting functions
function Beguile_CastConditions takes nothing returns boolean
    return GetSpellAbilityId() == Beguile_SpellID()
endfunction

function Beguile_Cast takes nothing returns nothing
    local timer tm = NewTimer()
    call SetHandleHandle(tm, "caster", GetTriggerUnit())
    call SetHandleHandle(tm, "group", CreateGroup()) // saves the group of units controlled by the spell
    call SetHandleReal(tm, "countgroup", 0.)
    call SetHandleReal(tm, "dur", 0.)
    call TimerStart(tm, Beguile_dt(), true, function Beguile_loop)
    set tm = null
endfunction

function InitTrig_Beguile takes nothing returns nothing
    set gg_trg_Beguile = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Beguile, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Beguile, Condition(function Beguile_CastConditions))
    call TriggerAddAction(gg_trg_Beguile, function Beguile_Cast)
endfunction

Last edited by moyack : 08-02-2007 at 02:36 AM.
moyack is offline   Reply With Quote
Old 08-02-2007, 03:33 AM   #58
xombie
Banned
 
Join Date: Oct 2006
Posts: 858

xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)

Default

Why not just check to see which caster the unit is closer to, and whoever is closer gets respective control of the unit. It makes sense because the "influence" that the aura would have on the unit would be stronger if it were closer. Its up to you, but thats what would make most sense to me.

Oh and I'm not trying to steal Pyro's thunder or anything like that, but if somebody has a spell idea and Pyro is not up to it or they would prefer somebody else do it, I could also be of help. Pyro's probably going to be a lot more consistant because his attendance on this site is a lot more than mine, but nonetheless I can make some spiffy spells too.
  • vJass will be used, in addition spells I make will only be in JASS.
  • Requirements are pretty much the same, but it would be nice if extreme clarity is provided when explaining your spell, because more diverse spells are usually harder to get
  • I will be taking DotA spells as requests, as Pyro did not. Most of them will probably be more efficient/better than the original as well.

Don't worry Pyro, your thunder is still intact.

Bastard. :P ~Pyrogasm

Last edited by Pyrogasm : 08-02-2007 at 12:21 PM.
xombie is offline   Reply With Quote
Old 08-02-2007, 04:38 AM   #59
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft.
To avoid these restrictions Log in or Register

Naw thanks, Moyack, I'll stick to my own version which, by the way, is now finished!
Beguile:
BeguileWhile channeling, constantly gains control of all nearby organic, non-hero, non-structure units. When channeling ends, all units are returned to their respective owners.

Level 1 - Lasts 20 seconds and affects units in a 235 radius.
Level 2 - Lasts 23 seconds and affects units in a 270 radius.
Level 3 - Lasts 26 seconds and affects units in a 305 radius.
Level 4 - Lasts 29 seconds and affects units in a 340 radius.
Beguile.zip
Attached Files
File Type: zip Beguile.zip (117.3 KB, 209 views)
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 08-02-2007, 09:10 AM   #60
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Done again.
Envenom & Enholy:
EnvenomInfuses the Assassin's glaive with vituperative poison for 15 seconds. This poison has a 65% chance to slow afflicted targets' attack and movement speed by 10% and deal 15 damage per second for 10 seconds.

Attack speed reduction effects stack up to 5 times.
Envenom & Enholy.zip
EnholyInfuses the Protector's sword a with mighty reckoning for 15 seconds. Gives the Protector a 55% chance to heal himself for 35 health upon attacking a foe.Envenom & Enholy.zip


Oh, and a question about your spell, Pyritie: should they constantly attack random units (like, ordered by a trigger to attack random units nearby every few seconds), or should they just auto-acquire all units as though they were enemies? If it's the former, how long do you want the units to stay on the same target?
Attached Files
File Type: zip Envenom & Enholy.zip (181.4 KB, 260 views)
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

Last edited by Pyrogasm : 08-02-2007 at 09:16 AM.
Pyrogasm is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 05:13 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services