Skip to content

Commit

Permalink
General update (#135)
Browse files Browse the repository at this point in the history
* Update main.lua

- Changed BuyTack event to callback
- Changed UpdateComponents from event to callback
- Changed horse death trigger to IsEntityDead check from entity damaged event
- simplified code for managing horse death
- updated flaming hooves functions with added checks and setting a duration to stop it

* Update main.lua

- reformatted flaming hooves settings
- added flaming hooves duration setting

* update languages

* Update main.lua

- optimizing server functions

* update languages

* Update main.lua

- add variable to prevent using item while flaming hooves are active

* Update main.lua

- add code to initialize item on first use if durability is enabled

* update languages

* Update bcc_stables.sql

* Update main.lua

- updated format of horsebrush config

* Update main.lua

- added function to clear horse prompts
- spawn horse in writhe if stored in database
- changed whistle horse functions to events to prevent locking up the code
- updated horse death event to correctly work with config settings
- updated horse monitor to fix horse stats saving
- updated brush horse function to prevent durability being removed when out of range
-

* Update main.lua

- added function to set horse writhe status in database
- updated functions to handle new writhe column in database
- updated/added function for using horsebrush

* Update main.lua

- updated lantern config

* Update main.lua

- updated horse lantern function to remove durability only after use
- durability is removed only when equipped not removed

* Update main.lua

- updated horse lantern function to remove durability only after use

* Create horse_info.lua

- moved horse info menu to separate file

* Update fxmanifest.lua

* Update main.lua

* Update main.lua

- code cleanup

* Update main.lua

* Update fxmanifest.lua

* Update package.json

* Update version

* Update bcc_stables.sql

* Update README.md

* Update README.md
  • Loading branch information
JusCampin authored Jan 31, 2025
1 parent 2b1f518 commit 63bb096
Show file tree
Hide file tree
Showing 15 changed files with 1,431 additions and 1,336 deletions.
89 changes: 41 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,64 @@
# bcc-stables

## Description
Are you ready to embark on a journey through the untamed wilderness of the Old West? Look no further than bcc-stables, where your trusty steed awaits!
Personalize your horse with unique mane styles, tail variations, coat colors, and stylish accessories.
Groom, feed, and clean your horse to keep them at peak performance.
Embark on an adventure through the untamed wilderness of the Old West with bcc-stables! Here, your trusty steed awaits, ready to be personalized with unique mane styles, tail variations, coat colors, and stylish accessories. Groom, feed, and clean your horse to keep them at peak performance.

## Features
- Buy and sell horses through the stables.
- Cash and/or gold may be used for payments in the menu.
- Max owned horses set separately for players and trainers in the config.
- Individual inventory size for each horse model.
- Choose horse gender at purchase.
- Use oil lantern from inventory to equip a lantern to your horse.
- Shop hours may be set individually for each stable or disabled to allow the stable to remain open.
- Stable blips are colored and changeable per stable location.
- Blips can change color reflecting if stable is open, closed or job locked.
- Stable access can be limited by job and jobgrade.
- Return horse at stable (when open) or using the flee button in the horse menu.
- Feed and water your horse to increase horse's health and stamina.
- Brushing your horse will clean him and give a slight increase in health and stamina.
- Horse Health and Stamina core values are saved in the database.
- Configurable cooldown time selling tamed horses.
- Distance-based NPC spawns.
- Horse Training System.
- Horse Trading between players.
- Config option: Only trainers can buy horses from a stable (set per stable).
- Revive your downed horse using the horse reviver item.
- Allow player horse looting.
- Horse death management set in main config file.
- **Horse Management**: Buy and sell horses through the stables using cash and/or gold.
- **Ownership Limits**: Maximum owned horses can be set separately for players and trainers in the config.
- **Inventory Management**: Individual inventory size for each horse model.
- **Customization**: Choose horse gender at purchase and use oil lanterns from inventory to equip a lantern to your horse.
- **Shop Hours**: Set individually for each stable or disable to keep the stable open.
- **Blips**: Colored and changeable per stable location, reflecting if the stable is open, closed, or job-locked.
- **Access Control**: Stable access can be limited by job and job grade.
- **Horse Return**: Return horse at stable (when open) or using the flee button in the horse menu.
- **Care and Maintenance**: Feed and water your horse to increase health and stamina. Brushing your horse will clean it and give a slight increase in health and stamina.
- **Data Persistence**: Horse Health and Stamina core values are saved in the database.
- **Cooldown**: Configurable cooldown time for selling tamed horses.
- **NPC Spawns**: Distance-based NPC spawns.
- **Training System**: Horse Training System and Horse Trading between players.
- **Config Options**: Only trainers can buy horses from a stable (set per stable).
- **Revival**: Revive your downed horse using the horse reviver item.
- **Looting**: Allow player horse looting.
- **Death Management**: Horse death management set in the main config file.

## Horse Training
### XP System
- Ride, feed, water and brush your horse to gain XP. As xp is gained, bonding levels will increase (0-4) for better horse stats and tricks.
Gain XP by riding, feeding, watering, and brushing your horse. As XP is gained, bonding levels will increase (0-4) for better horse stats and tricks.

### Bonding Levels
- Level 1
- Horse can drink from rivers and lakes.
- Level 2
- **Level 1**: Horse can drink from rivers and lakes.
- **Level 2**:
- Horse can rest. *(Future update will regain stamina)*
- Shocking events disabled for a calmer horse.
- Trick: **Rear-Up** by pressing `left-ctrl` + `space`
- Level 3
- **Level 3**:
- Horse can sleep. *(Future update will regain health and stamina)*
- Gunshot flee response disabled.
- Trick: **Skid/Slide** by pressing `left-ctrl`
- Level 4
- **Level 4**:
- Horse can wallow.
- Trick: **Dance** by pressing `space`
- Trick: **Side-Pass** by pressing `space` + `A` or `D`

## Horse Taming
- Tame wild horses and return to a trainer area to sell or register your tamed horse.
- If you want to keep the tame, if you have room in your stable, you'll pay a registration fee and it will be added to your stable.
- If you want to keep the tame and have room in your stable, pay a registration fee, and it will be added to your stable.
- Job check if Trainer job is required.
- If player does not have Trainer job, the tamed horse can be given to a trainer to sell or register.
- If the player does not have the Trainer job, the tamed horse can be given to a trainer to sell or register.

## Horse Trading
- While leading your horse, approach another player and a trade prompt will appear.
- While leading your horse, approach another player, and a trade prompt will appear.

## Tips
- Whistleing -- A short whistle will call your horse. A long one will set your horse to follow you. A second whistle or mounting your horse will cancel following.
- Horse Info -- Press `Q` in the horse prompts to view standard horse info.
- **Whistling**: A short whistle will call your horse. A long one will set your horse to follow you. A second whistle or mounting your horse will cancel following.
- **Horse Info**: Press `Q` in the horse prompts to view standard horse info.

## Commands
- `/horseRespawn` Respawn your horse while bypassing the distance check.
- `/horseInfo` View more detailed horse info than standard **Show Info** display.
- `/horseSetWild` *Dev Mode Only* - Set a tamed horse wild to test taming.
- `/horseWrithe` *Dev Mode Only* - Set horse to writhe state to test reviving.
- `/horseRespawn`: Respawn your horse while bypassing the distance check.
- `/horseInfo`: View more detailed horse info than the standard **Show Info** display.
- `/horseSetWild`: *Dev Mode Only* - Set a tamed horse wild to test taming.
- `/horseWrithe`: *Dev Mode Only* - Set horse to writhe state to test reviving.

## Dependencies
- [vorp_core](https://github.com/VORPCORE/vorp-core-lua)
Expand All @@ -74,13 +67,13 @@ Groom, feed, and clean your horse to keep them at peak performance.
- [feather-menu](https://github.com/FeatherFramework/feather-menu/releases)

## Installation
- Make sure dependencies are installed/updated and ensured before this script
- Download the latest release `bcc-stables.zip` at [/releases/latest](https://github.com/BryceCanyonCounty/bcc-stables/releases/latest)
- Add `bcc-stables` folder to your resources folder
- Add `ensure bcc-stables` to your `resources.cfg`
- Run the included database file `bcc-stables.sql`
- Add images from `img` folder to: `...\vorp_inventory\html\img\items`
- Restart server
1. Make sure dependencies are installed/updated and ensured before this script.
2. Download the latest release `bcc-stables.zip` at [/releases/latest](https://github.com/BryceCanyonCounty/bcc-stables/releases/latest).
3. Add the `bcc-stables` folder to your resources folder.
4. Add `ensure bcc-stables` to your `resources.cfg`.
5. Run the included database file `bcc-stables.sql`.
6. Add images from the `img` folder to: `...\vorp_inventory\html\img\items`.
7. Restart the server.

## Credits
- lrp_stables
Expand All @@ -90,4 +83,4 @@ Groom, feed, and clean your horse to keep them at peak performance.
- [Dokoboe](https://github.com/dokoboe)

## GitHub
- https://github.com/BryceCanyonCounty/bcc-stables
- [bcc-stables](https://github.com/BryceCanyonCounty/bcc-stables)
11 changes: 8 additions & 3 deletions bcc_stables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ CREATE TABLE IF NOT EXISTS `player_horses` (
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `gender` ENUM('male', 'female') DEFAULT 'male';
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `xp` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `captured` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `born` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP();
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `born` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `health` INT(11) NOT NULL DEFAULT 50;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `stamina` INT(11) NOT NULL DEFAULT 50;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `dead` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `writhe` INT(11) NOT NULL DEFAULT 0 AFTER `stamina`;

CREATE INDEX IF NOT EXISTS `idx_charid` ON `player_horses` (`charid`);
CREATE INDEX IF NOT EXISTS `idx_identifier` ON `player_horses` (`identifier`);

INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`)
VALUES
('oil_lantern', 'Oil Lantern', 1, 1, 'item_standard', 1, 'A portable light source.'),
('consumable_horse_reviver', 'Horse Reviver', 3, 1, 'item_standard', 1, 'Curative compound for injured horse.'),
('consumable_haycube', 'Haycube', 10, 1, 'item_standard', 1, 'A compact cube of hay.'),
('consumable_apple', 'Apple', 10, 1, 'item_standard', 1, 'A juicy and deliciuos fruit.'),
('consumable_carrots', 'Carrots', 10, 1, 'item_standard', 1, 'An orange root vegetable commonly used in cooking.')
('consumable_apple', 'Apple', 10, 1, 'item_standard', 1, 'A juicy and delicious fruit.'),
('consumable_carrots', 'Carrots', 10, 1, 'item_standard', 1, 'An orange root vegetable commonly used in cooking.'),
('diamond', 'Diamond', 20, 1, 'item_standard', 1, 'A precious gemstone known for its brilliance and value.')
ON DUPLICATE KEY UPDATE
`label`=VALUES(`label`),
`limit`=VALUES(`limit`),
Expand Down
Loading

0 comments on commit 63bb096

Please sign in to comment.