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 > Resources > Code Resources > Systems
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-02-2010, 09:01 PM   #181
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

No, you need to code this functionality yourself either on a spell by spell basis or with a wrapper function for ABuffApply (provided you need this functionality only for buff spells and not regular spells).
__________________
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-13-2010, 01:10 PM   #182
Sinnergy
User
 
Sinnergy's Avatar
 
Join Date: Apr 2009
Posts: 173

Sinnergy has little to show at this moment (8)

Default

Collapse from ABuffHeroSkill documentation:
//*  If you have the StatusEvents library in your map, then this
//*  library will also detect reincarnation events and correctly
//*  reapply the buff on those events as well.

grim updated StatusEvents to AutoEvents, will this still works?
__________________
Current Project:
Rise of Sinnergy v1.00

Last edited by Sinnergy : 01-13-2010 at 01:10 PM.
Sinnergy is offline   Reply With Quote
Old 01-13-2010, 02:11 PM   #183
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

I didn't change the API when I changed the name.
grim001 is offline   Reply With Quote
Old 02-03-2010, 03:22 AM   #184
cosmicat
Probably AFK
 
cosmicat's Avatar
 
Join Date: Feb 2009
Posts: 635

cosmicat will become famous soon enough (71)cosmicat will become famous soon enough (71)cosmicat will become famous soon enough (71)

Default

Not that I need them (since I've got so many versions of aBuff by now), but what happened to the templates? I found them useful for beginning to learn how the system works, particularly the simple (but not immediately obvious) examples/features, like making different versions of Inner Fire / Curse compatible.
__________________
+++++++++++[>++++++>++++++++++>++++++++++<<<-]>+.>+.++++.+>-.----.------.--.<.
cosmicat is offline   Reply With Quote
Old 07-26-2010, 02:36 AM   #185
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Version 1.6 has been released. Changelog can be found in the first post.
__________________
Anitarf is offline   Reply With Quote
Old 08-15-2010, 07:23 AM   #186
Dr.Killer
User
 
Join Date: Aug 2010
Posts: 2

Dr.Killer has little to show at this moment (0)

Question Errors when usnig the system

I use NewGen 1.5c.
I downloaded the sample map attached to the post, and tried saving it (to let it be compiled) but I get an error. I've tried using 2 other systems (BonusMod and Status) but they have error ,too. While others use the system with no problem. Can anyone help plz? I really need this.
Dr.Killer is offline   Reply With Quote
Old 08-15-2010, 07:29 AM   #187
Dr.Killer
User
 
Join Date: Aug 2010
Posts: 2

Dr.Killer has little to show at this moment (0)

Default

I use NewGen 1.5c and Warcraft 3 1.23 (for map development)
I downloaded the sample map attached to the post, and tried saving it (to let it be compiled) but I get an error. I've tried using 2 other systems (BonusMod and Status) but they have error ,too. While others use the system with no problem. Can anyone help plz? I really need this.

This is the error text:

library [DamageEvent initializer Init requires optional DamageModifiers, optional LightLeaklessDamageDetect, optional IntuitiveDamageSystem, optional xedamage]

Missing requirements :optional - (libraries can not require scopes.)
Dr.Killer is offline   Reply With Quote
Old 08-21-2010, 10:19 PM   #188
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Dr.Killer
I use NewGen 1.5c.
I downloaded the sample map attached to the post, and tried saving it (to let it be compiled) but I get an error. I've tried using 2 other systems (BonusMod and Status) but they have error ,too. While others use the system with no problem. Can anyone help plz? I really need this.
Even the latest NewGen pack (1.5d) does not have the latest version of JassHelper included, which many newer systems need, so you need to update your NewGen pack with the latest version of JassHelper yourself (there are instructions how to do that in the JassHelper thread).


Also, due to some bugs in the last version, I have released a new version of ABuff. Changelog is in the first post.
__________________
Anitarf is offline   Reply With Quote
Old 08-26-2010, 11:59 AM   #189
DanThanh
User
 
DanThanh's Avatar
 
Join Date: Apr 2009
Posts: 137

Submissions (1)

DanThanh has little to show at this moment (7)

Send a message via Yahoo to DanThanh
Default

Hello, i am learning how to use your system. Could you please give me some clues on how to, let say, a spell that remove poison effects (periodic damage using ABuff) on a unit ?
__________________
DanThanh is offline   Reply With Quote
Old 08-26-2010, 03:11 PM   #190
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by DanThanh
Hello, i am learning how to use your system. Could you please give me some clues on how to, let say, a spell that remove poison effects (periodic damage using ABuff) on a unit ?
First, you would need to make your poison buff type public:
Collapse JASS:
library Poision requires ABuff
    globals
        public aBuffType bufftype
    endglobals

    // add an initializer that creates the buff type and any other code needed for the buff to work here.
endlibrary
Then, a spell that is supposed to remove poison should do something like this:
Collapse JASS:
library PoisonRemovalSpell requires ABuff, Poison
    private function SpellEffect takes nothing returns nothing
        local aBuff a = GetABuffFromUnitByType( GetSpellTargetUnit(), Poison_bufftype )
        if a != 0 then // If the unit has the buff...
            call ABuffRemove( a ) // ...then remove it.
        endif
    endfunction

    // add other code needed by your spell here
endlibrary
__________________
Anitarf is offline   Reply With Quote
Old 09-13-2010, 03:52 AM   #191
DanThanh
User
 
DanThanh's Avatar
 
Join Date: Apr 2009
Posts: 137

Submissions (1)

DanThanh has little to show at this moment (7)

Send a message via Yahoo to DanThanh
Default

Hello, thanks for your help. May i ask you one more question, i intend to use Dusk's Damage Detection System as well as ABuff to create some poison effects for my Autocast spells. I learned your example and most of them are for Spell events only, can you give me some hints? i am so confused.

-Here is my spell, i want to apply a buff whenever a unit take damage, then change it's color to green, deal periodic damage, finally recolor it when the buff expires. Also with this spell, i do not need a custom buff (Object) for the poison effect, do i? And can i create a library for this buff so all other spells can use it for different effects and poison damage?

Collapse JASS:
public function InitTrig takes nothing returns nothing

scope shadowheart initializer Init

    // CALIBRATION SECTION

    globals
        private constant integer abiID           = 'A019' //Autocast spell
        private constant integer bufID           = 'B004'  //Buff of the Autocast spell
    endglobals


    globals
        public aBuffType rexpoison
    endglobals
    
    private function con takes nothing returns boolean
        return GetTriggerDamageType() == DAMAGE_TYPE_ATTACK and GetUnitAbilityLevel(GetTriggerUnit(), bufID) > 0
    endfunction

    private function Create takes aBuff eventBuff returns nothing
        call SetUnitVertexColor(eventBuff.target.u, 0, 255, 0, 255)
    endfunction
    private function Periodic takes aBuff eventBuff returns nothing
        call UnitDamageTargetEx(eventBuff.caster, eventBuff.target.u, 40., ATTACK_TYPE_HERO, DAMAGE_TYPE_EXTRA, true)
    endfunction
    private function Cleanup takes aBuff eventBuff returns nothing
        call SetUnitVertexColor(eventBuff.target.u, 255, 255, 255, 255)
    endfunction
    
    private function act takes nothing returns nothing
        local unit c = GetTriggerDamageSource()
        local unit t = GetTriggerDamageTarget()
        local real physdam = GetTriggerDamage()
        local player p = GetOwningPlayer(c)
        local integer ia = GetUnitAbilityLevel(c, abiID)
        //Actions
        //call TextTag_UnitPub(t, "+"+I2S(R2I(damage)), WHITE)
        call UnitRemoveAbility(t, bufID)
        call ABuffApply(rexpoison, t, c, 4.0, ia, 0)
        set c    = null
        set t    = null
        set p    = null
endfunction

    // SPELL INITIALIZATION

    private function Init takes nothing returns nothing
        local trigger trg = CreateTrigger()
        set rexpoison = aBuffType.create()
        set rexpoison.category = ABuff_STACKING
        set rexpoison.countsAsBuff = false
        //set rexpoison.eventDamaged = action
        set rexpoison.eventCreate = Create
        set rexpoison.eventCleanup = Cleanup
        set rexpoison.eventPeriodic = Periodic
        call TriggerAddAction(trg, function act)
        call TriggerAddCondition(trg, Condition(function con))
        call TriggerRegisterDamageEvent(trg, 1)
    endfunction

endscope
endfunction
__________________

Last edited by DanThanh : 09-13-2010 at 05:06 AM.
DanThanh is offline   Reply With Quote
Old 09-13-2010, 09:18 AM   #192
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

First of all, for the green vertex colouring, you need to use a REFCOUNT buff, otherwise the unit will turn non-green whenever a poison buff expires, even if the unit still has other poison buffs on it. You can then package this setup into a library which other spells can then use:

Collapse JASS:
library Poison initializer Init requires ABuff

    globals
        public aBuffType bufftype
        private aBuffType display
    endglobals
    
    private function DisplayCreate takes aBuff eventBuff returns nothing
        call SetUnitVertexColor(eventBuff.target.u, 0, 255, 0, 255)
    endfunction
    private function DisplayCleanup takes aBuff eventBuff returns nothing
        call SetUnitVertexColor(eventBuff.target.u, 255, 255, 255, 255)
    endfunction

    private function Create takes aBuff eventBuff returns nothing
        call ABuffApply(display, eventBuff.target.u, eventBuff.caster, 0.0, eventBuff.level, 0)
    endfunction
    private function Cleanup takes aBuff eventBuff returns nothing
        call ABuffRemove(GetABuffFromBuffedUnitByType(eventBuff, display))
    endfunction
    private function Periodic takes aBuff eventBuff returns nothing
        call UnitDamageTargetEx(eventBuff.caster, eventBuff.target.u, 40.*ABuff_PERIODIC_EVENT_PERIOD, ATTACK_TYPE_HERO, DAMAGE_TYPE_EXTRA, true)
    endfunction
    
    private function Init takes nothing returns nothing
        set bufftype = aBuffType.create()
        set bufftype.category = ABuff_STACKING
        set bufftype.countsAsBuff = false
        set bufftype.eventCreate = Create
        set bufftype.eventCleanup = Cleanup
        set bufftype.eventPeriodic = Periodic

        set display = aBuffType.create()
        set display.category = ABuff_REFCOUNT
        set display.ignoreAsBuff = true
        set display.eventCreate = DisplayCreate
        set dispaly.eventCleanup = DisplayCleanup
    endfunction

endscope
__________________

Last edited by Anitarf : 09-13-2010 at 12:39 PM.
Anitarf is offline   Reply With Quote
Old 09-13-2010, 11:42 AM   #193
DanThanh
User
 
DanThanh's Avatar
 
Join Date: Apr 2009
Posts: 137

Submissions (1)

DanThanh has little to show at this moment (7)

Send a message via Yahoo to DanThanh
Default

Thank you. So, i need two buffs for my spell, right?
I tried another way but my game crash when i try to test, can you take a look at my code?
The idea is simple, whenever a unit take damage and has a specific buff of the spell that dealing damage , i apply a poison buff on it for 4 seconds.

Collapse JASS:
scope shadowheart initializer Init


    // CALIBRATION SECTION

    globals
        private aBuffType rexpoison
        private aBuffType display
        private constant integer abiID           = 'A009' //Autocast Spell
        private constant integer bufID           = 'B004' //Buff of Autocast
    endglobals


    
    private function con takes nothing returns boolean
        return GetUnitAbilityLevel(GetTriggerUnit(), bufID) > 0
    endfunction

    private function DisplayCreate takes aBuff eventBuff returns nothing
        call SetUnitVertexColor(eventBuff.target.u, 0, 255, 0, 255)
    endfunction
    private function DisplayCleanup takes aBuff eventBuff returns nothing
        call SetUnitVertexColor(eventBuff.target.u, 255, 255, 255, 255)
    endfunction

    private function Periodic takes aBuff eventBuff returns nothing
        local integer i = GetUnitAbilityLevel(eventBuff.caster, abiID)
        local real damage = 40*i
        call UnitDamageTargetEx(eventBuff.caster, eventBuff.target.u, damage*ABuff_PERIODIC_EVENT_PERIOD, ATTACK_TYPE_HERO, DAMAGE_TYPE_EXTRA, true)
    endfunction
    
    private function Cleanup takes aBuff eventBuff returns nothing
        call ABuffRemove(GetABuffFromUnitByType(eventBuff.target.u, display))
    endfunction
    
    private function act takes nothing returns nothing
        local unit c = GetTriggerDamageSource()
        local unit t = GetTriggerDamageTarget()
        local player p = GetOwningPlayer(c)
        local integer lvl = GetUnitAbilityLevel(c, abiID)
        //Actions
        call UnitRemoveAbility(t, bufID)
        call ABuffApply(display, t, c, 4.0, lvl, 0)
        set c    = null
        set t    = null
        set p    = null
endfunction

    // SPELL INITIALIZATION

    private function Init takes nothing returns nothing
        local trigger trg = CreateTrigger()
        set rexpoison = aBuffType.create()
        set rexpoison.category = ABuff_STACKING
        set rexpoison.countsAsBuff = false
        set rexpoison.eventCleanup = Cleanup
        set rexpoison.eventPeriodic = Periodic
        
        set display = aBuffType.create()
        set display.category = ABuff_REFCOUNT
        set display.ignoreAsBuff = true
        set display.eventCreate = DisplayCreate
        set display.eventCleanup = DisplayCleanup

        call TriggerAddAction(trg, function act)
        call TriggerAddCondition(trg, Condition(function con))
        call TriggerRegisterDamageEvent(trg, 1)
    endfunction

endscope
__________________

Last edited by DanThanh : 09-13-2010 at 11:44 AM.
DanThanh is offline   Reply With Quote
Old 09-13-2010, 12:44 PM   #194
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

I'm not sure why your game crashes, but I can see why this wouldn't work. The display buff is not meant to be applied directly, but by the poison buff. That is why it is a REFCOUNT buff: it keeps track of how many poison buffs are on the unit.

Using the library I wrote previously, your spell would look something like this:

Collapse JASS:
library shadowheart initializer Init requires ABuff, Poison, IntuitiveDamageSystem

    // CALIBRATION SECTION

    globals
        private constant integer abiID           = 'A009' //Autocast Spell
        private constant integer bufID           = 'B004' //Buff of Autocast
    endglobals

    // SPELL CODE
    
    private function con takes nothing returns boolean
        return GetUnitAbilityLevel(GetTriggerUnit(), bufID) > 0
    endfunction
    
    private function act takes nothing returns nothing
        local unit c = GetTriggerDamageSource()
        local unit t = GetTriggerDamageTarget()
        local player p = GetOwningPlayer(c)
        local integer lvl = GetUnitAbilityLevel(c, abiID)
        //Actions
        call UnitRemoveAbility( t, bufID )
        call ABuffApply( Poison_bufftype, t, c, 4.0, lvl, 0 )
        set c    = null
        set t    = null
        set p    = null
    endfunction

    // SPELL INITIALIZATION

    private function Init takes nothing returns nothing
        local trigger trg = CreateTrigger()
        call TriggerAddAction(trg, function act)
        call TriggerAddCondition(trg, Condition(function con))
        call TriggerRegisterDamageEvent(trg, 1)
    endfunction

endscope
__________________
Anitarf is offline   Reply With Quote
Old 09-13-2010, 03:23 PM   #195
DanThanh
User
 
DanThanh's Avatar
 
Join Date: Apr 2009
Posts: 137

Submissions (1)

DanThanh has little to show at this moment (7)

Send a message via Yahoo to DanThanh
Default

Excellent, my spell works properly now, many thanks to you !
__________________
DanThanh 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 11:12 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