1
0
EQ2Emu/docs/lua_functions/CanHarvest.md
2025-05-28 21:48:33 -04:00

19 lines
718 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Function: CanHarvest(Player, GroundSpawn)
**Description:** Determines if the specified spawn (which should be a player) is currently able to harvest resources (i.e., not in combat and has the required skill/tool). This function checks general conditions for harvesting.
**Parameters:**
`Player`: Spawn The player to check.
`GroundSpawn`: Spawn The groundspawn to apply the check on.
**Returns:** Boolean true if the player can harvest at the moment; false if something prevents harvesting (lacking skill).
**Example:**
```lua
-- Example usage (before starting an auto-harvest routine, verify the player can harvest)
if CanHarvest(Player, GroundSpawn) then
Harvest(Player, GroundSpawn)
end
```