Warcraft III resources & community, 2003–2006 · archived

help me with JASS

17 posts
#1

help me with JASS

can someone tell me how to make a script that prevent player to change position or drop an item that currently cooldown likes in DotA???
#2
Event - Unit uses Item
Condition - Itemtype of Item being manipulated equal to SUPER_HAXS_ITEM_OK


function droppable takes nothing returns nothing
local timer t = GetExpiredTimer()
local item used = GetHandleItem(t,"Item")
call SetItemDroppable(used,true)
call FlushHandleLocals(t)
call DestroyTimer(t)
set = null
set used = null
endfunction


function ACTIONS takes nothing returns nothing
...
local timer t = CreateTimer()
call SetItemDroppable(GetManipulatedItem(),false)
call TimerStart(t,10.00,false, function droppable) //10.00 would be a cooldown of 10 seconds
call SetHandleHandle(t,"Item",GetManipulatedItem())
...

Oh and, I really don't feel to explain Handle Vars again...if you don't know what they are, use TriggerSleepAction(COOLDOWN) >>[/jass][/code]
#3
10.00 = 10 ( dont use unneeded .00s )

set = null?

and you leak a timer :P

also, isnt their some GetItemCooldown or something?
#4
You wish :lol:
#5
ouch!

anywayz, im sure there is, cause i dont think DotA would go to all that trouble just to make a cooling down item undroppable if there needed to be a seperate trigger for each item :shock:
#6
Eh? One trigger would be enough, the cooldown will be varied within the trigger using comparisons.
#7

what is Handle???

what is handle???
#8
"handle" is the mother class of "event", "player", "widget", "force", "group", "trigger", "triggercondition", "triggeraction", "timer", "location", "region", "rect", "boolexpr", "sound", "unitpool", "itempool", "race", "alliancetype", "racepreference", "gamestate", "playerstate", "playergameresult", "unitstate", "aidifficulty", "eventid", "unittype", "gamespeed", "gamedifficulty", "gametype", "mapflag", "mapvisibility", "mapsetting", "mapdensity", "mapcontrol", "playerslotstate", "volumegroup", "camerafield", "camerasetup", "playercolor", "placement", "startlocprio", "raritycontrol", "blendmode", "texmapflags", "effect", "effecttype", "weathereffect", "terraindeformation", "fogstate", "fogmodifier", "dialog", "button", "quest", "questitem", "defeatcondition", "timerdialog", "leaderboard", "multiboard", "multiboarditem", "trackable", "gamecache", "version", "itemtype" and "texttag".

So, I suppose that you know exactly now, what a "handle" is. ^^
#9
I still don't know how handle work...
Is handle need a game cache??? :?:
#10
UnMi - umm... if you like if/thens

(kinda like this)

if A then
A
elseif B then
B

and soooo on............
#11
Handle, Handle, Handle....
I don't know why everyone is talking about Handle....
Is Handle so Important?????
#12
yes it is
#13
PurplePootUnMi - umm... if you like if/thens

(kinda like this)

if A then
A
elseif B then
B

and soooo on............

...
You prefer one Trigger for each Item?
There are most likely not more than 20 items, so.. like

local real duration
...
if A then
set duration = 5
elseif B then
set duration = 3
...
endif
call TimerStart(t,duration,false,function OK)
...

Well, if it's more than 20 comparisions, then I would use GameCache.
(Because people keep talking about how slow GameCache is, I myself never noticed any difference, and I use GameCache a lot.)
#14
i prefer neither! :P
#15
:shock:
Dammit, what kind of cheats do you use this time?