- Joined
- Jul 12, 2010
- Messages
- 1,737
WARNING! Beginner JASSer alert!
So with that out of the way, I'm trying to make a bunch of jass functions to use in conjunction with GUI and "AddBuff" is one of them.
So my method works BUT I wanted to get some opinions from more advanced users IF there's a faster/better way to execute this.
Also yes I know that in JASS most people prefer to use X/Y instead of loc but I prefer the GUI "standard"
Thanks in advance to those that help!
So with that out of the way, I'm trying to make a bunch of jass functions to use in conjunction with GUI and "AddBuff" is one of them.
JASS:
//===============================================================================
//Because I'm bad at naming stuff I will explain here my "naming scheme"
// unit u = caster unit
// integer a = the ability to cast for buff
// unit t = target unit
// unit lu = last created unit
function addbuff takes unit u, integer a, unit t returns nothing
local location p = GetUnitLoc(u)
local unit lu
call CreateNUnitsAtLoc( 1, 'buf0', GetOwningPlayer(u), p, 0.00 )
set lu = GetLastCreatedUnit()
call UnitAddAbility( lu, a )
call IssueTargetOrder( lu, "slow", t )
call UnitApplyTimedLife( lu, 'BTLF', 2.00 )
call RemoveLocation(p)
set u = null
set t = null
set lu = null
endfunction
//===============================================================================
-
chat
-
Events
-
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Entered chat string) Equal to addbuff1
-
-
Then - Actions
-
Set VariableSet AddBuff = Add Buff (Slow)
-
Custom script: call addbuff ( udg_u , udg_AddBuff, udg_t)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Entered chat string) Equal to addbuff2
-
-
Then - Actions
-
Set VariableSet AddBuff = Add Buff (Wind Walk)
-
Custom script: call addbuff ( udg_u , udg_AddBuff, udg_t)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Entered chat string) Equal to addbuff3
-
-
Then - Actions
-
Set VariableSet AddBuff = Add Buff (Breath of Fire)
-
Custom script: call addbuff ( udg_u , udg_AddBuff, udg_t)
-
-
Else - Actions
-
-
-
-
-
-
-
-
map init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set VariableSet u = Arthas (wielding Frostmourne) 0001 <gen>
-
Set VariableSet t = Paladin 0014 <gen>
-
-
So my method works BUT I wanted to get some opinions from more advanced users IF there's a faster/better way to execute this.
Also yes I know that in JASS most people prefer to use X/Y instead of loc but I prefer the GUI "standard"
Thanks in advance to those that help!
