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() callFunctionsWithAnnotation([color=77FF77]"objgen"[/color]) init callFunctionsWithAnnotation([color=77FF77]"objgen"[/color]) [color=7777FF][b]public[/b][/color] int TEST_BUFF_ID @objgen [color=7777FF][b]function[/b][/color] genBuff() TEST_BUFF_ID [b]=[/b] createBuffObject([color=77FF77]"Test"[/color][b],[/b] [color=77FF77]"for testing"[/color][b],[/b] [color=77FF77]"ReplaceableTextures\\CommandButtons\\BTNUnbroken.blp"[/color]) [b]/[/b]** Creates an ability based [color=7777FF][b]on[/b][/color] Tornado aura that allows [color=7777FF][b]to[/b][/color] display a buff without side effects *[b]/[/b] [color=7777FF][b]public[/b][/color] [color=7777FF][b]function[/b][/color] createBuffObject([color=AA77FF]string[/color] name[b],[/b] [color=AA77FF]string[/color] tooltip[b],[/b] [color=AA77FF]string[/color] iconpath) returns int let abilId [b]=[/b] ABIL_ID_GEN[b].[/b]next() let buffId [b]=[/b] BUFF_ID_GEN[b].[/b]next() [color=7777FF][b]if[/b][/color] compiletime new BuffDefinition(buffId[b],[/b] [color=77FF77]'Basl'[/color]) [b].[/b][b].[/b]setName([color=FFFF77]1[/color][b],[/b] name) [b].[/b][b].[/b]setTooltipNormal([color=FFFF77]1[/color][b],[/b] name) [b].[/b][b].[/b]setTooltipNormalExtended([color=FFFF77]1[/color][b],[/b] tooltip) [b].[/b][b].[/b]setIcon(iconpath) new AbilityDefinitionAuraSlow(abilId) [b].[/b][b].[/b]setName([color=77FF77]"Aura Dummy: "[/color] [b]+[/b] name) [b].[/b][b].[/b]setMovementSpeedFactor([color=FFFF77]1[/color][b],[/b] [color=FFFF77]0[/color]) [b].[/b][b].[/b]setBuffs([color=FFFF77]1[/color][b],[/b] int2fourchar(buffId)) [b].[/b][b].[/b]presetIcon(iconpath) return 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