|
|
|
|
 |
|
07-03-2009, 07:52 PM
|
#1 (permalink)
|
|
User
Join Date: Jun 2009
Posts: 140
|
Healing a thousand HP
I decided to make a personalized pot, but I couldnt find anything in a trigger that healed 1000 hp for a especific unit (if you know, please let me know)
So Ive decided to learn JASS, and I got this far:
Jass:
//Start
Function Potion takes unit u returns noting
local unit u
loop
set u = Player(1)
exitwhen u == null
call unitstate(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
endloop
endfunction
//End
But that would only heal all the HP of a unit, wich I dont want...
What do I do next?
Thnks
|
|
|
07-03-2009, 07:57 PM
|
#2 (permalink)
|
|
Greek JASSer...
Join Date: Jul 2008
Posts: 1,165
|
Jass:
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u,UNIT_STATE_LIFE) + 1000)
|
|
|
07-03-2009, 08:09 PM
|
#3 (permalink)
|
|
The One and Only
Join Date: Feb 2009
Posts: 469
|
Quote:
Originally Posted by Craphter
Jass:
//Start
Function Potion takes unit u returns noting
local unit u
loop
set u = Player(1)// u cant set unit to a player u need GetTriggerUnit()
exitwhen u == null// and not a loop
call unitstate(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
endloop
endfunction
//End
|
so thats what it should be
Jass:
function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call SetUnitState( u , UNIT_STATE_LIFE , GetUnitState( u , UNIT_STATE_LIFE) + 1000 )
endfunction
__________________
Last edited by Saia_Djinn; 07-03-2009 at 09:46 PM.
|
|
|
07-03-2009, 08:58 PM
|
#4 (permalink)
|
|
Shee[P]roductions
Join Date: Apr 2008
Posts: 1,481
|
@ Saia_Djinn: you forgot one bracket in line 3:
Jass:
call SetUnitState( u , UNIT_STATE_LIFE , GetUnitState( u , UNIT_STATE_LIFE) + 1000 )
|
|
|
07-03-2009, 09:45 PM
|
#5 (permalink)
|
|
The One and Only
Join Date: Feb 2009
Posts: 469
|
yeah i made this pseudo so fails can happen but thx ill fix =D
__________________
|
|
|
07-03-2009, 10:17 PM
|
#6 (permalink)
|
|
Back to normal again. . .
Join Date: Jan 2005
Posts: 6,559
|
Why does he not just set the standard pot abilities to heal 1000 and give it to an item?
|
|
|
07-03-2009, 10:35 PM
|
#7 (permalink)
|
|
User
Join Date: May 2008
Posts: 46
|
why not just
 Unit - set life of (triggering unit) to (life of (triggering unit) + 1000)
replace (triggering unit) with whatever is needed in your trigger
|
|
|
07-03-2009, 11:02 PM
|
#8 (permalink)
|
|
iashdiashdiuashdiashidash
Join Date: Oct 2006
Posts: 2,217
|
Because he is trying to learn JASS? Everybody start from the bottom.
|
|
|
07-03-2009, 11:13 PM
|
#9 (permalink)
|
|
STARCRAFT 2 :D
Join Date: Jan 2008
Posts: 2,438
|
isnt jass First gui, then fixed up in Jass?
|
|
|
07-03-2009, 11:14 PM
|
#10 (permalink)
|
|
iashdiashdiuashdiashidash
Join Date: Oct 2006
Posts: 2,217
|
Okay I didnt read the "but I couldnt find anything in a trigger that healed 1000 hp for a especific unit" part.
|
|
|
07-03-2009, 11:28 PM
|
#11 (permalink)
|
|
GUI sucks. Don't use it.
Join Date: Nov 2007
Posts: 687
|
Quote:
|
isnt jass First gui, then fixed up in Jass?
|
No. "Fixing" GUI-JASS means rewriting the whole deal.
|
|
|
07-04-2009, 07:00 AM
|
#12 (permalink)
|
|
User
Join Date: Jun 2009
Posts: 140
|
actually, im trying to learn JASS to actually do this pot...
i just didnt look well enough....
thnks a lot guys (specially Marsmallos)
Now i have one last problem:
Now each time a hero moves the pot, itll give him 1000 htps =(
|
|
|
07-04-2009, 10:26 AM
|
#13 (permalink)
|
|
iashdiashdiuashdiashidash
Join Date: Oct 2006
Posts: 2,217
|
Utilizaaaa?
|
|
|
07-04-2009, 10:45 AM
|
#14 (permalink)
|
|
Greek JASSer...
Join Date: Jul 2008
Posts: 1,165
|
Base it on a tome, and give it an ability that permanently adds 0 whatever.
|
|
|
07-04-2009, 10:52 AM
|
#15 (permalink)
|
|
STARCRAFT 2 :D
Join Date: Jan 2008
Posts: 2,438
|
if its A unit gets an item, you could simply make it like this:
Drop Item Being Manipulated
Remove Item being manipulated
Turn off This trigger
maybe?
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|