Use "target
point of ability being cast". Use an "if/then/else" check to see if it's on land.
-
WaterCheck
-
Events
-
Unit - A unit Begins casting an ability
-
Conditions
-
(Ability being cast) Equal to Fishing (fosjomg)
-
Actions
-
if
-
(Land <gen> contains (Target point of ability being cast)) Equal to True
-
then
-
Unit - Order (Casting unit) to Stop
-
Game - Display to (All allies of (Owner of (Casting unit))) the text: You cannot fish on ...
-
else
As for your triggers... do a search for "memory leaks".
Memory leaks are, mostly, temporary variables that hold information, if a leak isn't cleaned up then the memory that the variable was using isn't freed up... there are many kinds of leaks, and many ways to clean them up. GUI doesn't have access to these ways, however, you have to use what's called "custom scipt" to do it. Just remember that any variable used in custom script need to have "udg_" in front of them, and "_" where any spaces are.
Basicly, a "memory leak" is like a locker, you need the combination(variable) to open the locker(memory location), if you go into something else(different trigger/function), you forget that combination, and have to get a whole new locker... then, another & another, etc. Over time, the locker room runs out of space, and Wc3 starts lag.
These are the leaks in the above trigger:
-
(Land <gen> contains *leak*(Target point of ability being cast)) Equal to True
-
Unit - Order *leak*(Casting unit) to Stop
-
Game - Display to *leak*(All allies of (Owner of (Casting unit))) the text: You cannot fish on ...
To fix these leaks you need to assign them to variables to be able to clean them afterwards.
-
set <location variable> to (Target point of ability being cast)
-
(Land <gen> contains <location variable>) Equal to True
-
custom scipt: call DestroyLocation(<location variable>)
-
custom scipt: set udg_<location variable> = null
To do your text and "unit stop", you're better off just using only custom scipt:
-
set <unit variable> to (casting unit)
-
set <player variable> to (owner of <unit variable>)
-
custom scipt: call DisplayTextToPlayer(udg_<player variable>, 0, 0, <text>)
-
custom scipt: set udg_<player variable> = null
-
custom scipt: set udg_<unit variable> = null
This may not seem straight forward at first, but just work on it one line at a time.