Skip to content
Home
Post Code
Jass (Warcraft III)
Wurst
GUI (Warcraft III)
Galaxy (StarCraft II)
GUI (StarCraft II)
C++
Java
Delphi
Text
Search Code
Compare Code
Uploads
Draw
Create New Drawing
View Drawings
Graph
Log in
[code]@compiletime [color=7777FF][b]function[/b][/color] compileGen[b]([/b][b])[/b] callFunctionsWithAnnotation[b]([/b][color=77FF77]"objgen"[/color][b])[/b] [color=7777FF][b]init[/b][/color] callFunctionsWithAnnotation[b]([/b][color=77FF77]"objgen"[/color][b])[/b] [color=7777FF][b]public[/b][/color] [color=AA77FF]int[/color] TEST_BUFF_ID @objgen [color=7777FF][b]function[/b][/color] genBuff[b]([/b][b])[/b] TEST_BUFF_ID [b]=[/b] createBuffObject[b]([/b][color=77FF77]"Test"[/color][b],[/b] [color=77FF77]"for testing"[/color][b],[/b] [color=77FF77]"ReplaceableTextures\\CommandButtons\\BTNUnbroken.blp"[/color][b])[/b] [color=999999][i]/** Creates an ability based on Tornado aura that allows to display a buff without side effects */[/i][/color] [color=7777FF][b]public[/b][/color] [color=7777FF][b]function[/b][/color] createBuffObject[b]([/b][color=AA77FF]string[/color] name[b],[/b] [color=AA77FF]string[/color] tooltip[b],[/b] [color=AA77FF]string[/color] iconpath[b])[/b] [color=7777FF][b]returns[/b][/color] [color=AA77FF]int[/color] [color=7777FF][b]let[/b][/color] abilId [b]=[/b] ABIL_ID_GEN.next[b]([/b][b])[/b] [color=7777FF][b]let[/b][/color] buffId [b]=[/b] BUFF_ID_GEN.next[b]([/b][b])[/b] [color=7777FF][b]if[/b][/color] compiletime [color=7777FF][b]new[/b][/color] BuffDefinition[b]([/b]buffId[b],[/b] [color=FFFF77]'Basl'[/color][b])[/b] ..setName[b]([/b][color=FFFF77]1[/color][b],[/b] name[b])[/b] ..setTooltipNormal[b]([/b][color=FFFF77]1[/color][b],[/b] name[b])[/b] ..setTooltipNormalExtended[b]([/b][color=FFFF77]1[/color][b],[/b] tooltip[b])[/b] ..setIcon[b]([/b]iconpath[b])[/b] [color=7777FF][b]new[/b][/color] AbilityDefinitionAuraSlow[b]([/b]abilId[b])[/b] ..setName[b]([/b][color=77FF77]"Aura Dummy: "[/color] [b]+[/b] name[b])[/b] ..setMovementSpeedFactor[b]([/b][color=FFFF77]1[/color][b],[/b] [color=FFFF77]0[/color][b])[/b] ..setBuffs[b]([/b][color=FFFF77]1[/color][b],[/b] int2fourchar[b]([/b]buffId[b])[/b][b])[/b] ..presetIcon[b]([/b]iconpath[b])[/b] [color=7777FF][b]return[/b][/color] abilId [/code]
select language
jass
java
delphi
C++
php
GSL
galaxy
visualBasic
> wurst
Text
Markdown
select style
default
> bbcode - default
Jasscraft
jasscraft html
visual
lightweight
lightweightNr
goto line:
Compare with:
text copy window
edit this code
post new code
@compiletime function compileGen() callFunctionsWithAnnotation("objgen") init callFunctionsWithAnnotation("objgen") public int TEST_BUFF_ID @objgen function genBuff() TEST_BUFF_ID = createBuffObject("Test", "for testing", "ReplaceableTextures\\CommandButtons\\BTNUnbroken.blp") /** Creates an ability based on Tornado aura that allows to display a buff without side effects */ public function createBuffObject(string name, string tooltip, string iconpath) returns int let abilId = ABIL_ID_GEN.next() let buffId = BUFF_ID_GEN.next() if compiletime new BuffDefinition(buffId, 'Basl') ..setName(1, name) ..setTooltipNormal(1, name) ..setTooltipNormalExtended(1, tooltip) ..setIcon(iconpath) new AbilityDefinitionAuraSlow(abilId) ..setName("Aura Dummy: " + name) ..setMovementSpeedFactor(1, 0) ..setBuffs(1, int2fourchar(buffId)) ..presetIcon(iconpath) return abilId