Bosskills
- community
- events
- by Mad
- Takaro v0.0.21
- all
Provides automated rewards and announcements upon the killing of specific boss entities in the game.
Key Functionality
- Boss Kill Detection: The module monitors game server logs for events indicating the death of designated boss entities.
- Player Identification: It extracts the name of the player who killed the boss.
- Currency Rewards: Configurable amounts of in-game currency are automatically awarded to the player who killed the boss.
- Chat Announcements: Customizable messages are broadcast to the server chat, congratulating the player on the kill and announcing the reward.
- Boss-Specific Configuration: Rewards and announcements can be configured independently for different boss types.
How to Use
- Configuration:
coinAmountDevourer,coinAmountMiniBoss,coinAmountBoss,coinAmountTinyBoss: Define the amount of currency to award for killing different categories of bosses.announceDevourer,announceGargul,announceBear,announceBitch,announceBurningFlesh,announceCholera,announceBull,announceShocker,announceVeteran,announceCarrier,announceOstiarius: Customize the messages that are broadcast to the chat when a specific boss is killed. Use{pname}as a placeholder for the player's name and{amount}for the currency amount.
- Module Operation:
- The module automatically monitors the server logs for boss kill events. No manual commands are required.
Important Considerations
- Log Format: This module relies on a specific format for the game server's log messages. Ensure that the log output contains the necessary information (e.g., player name, killed entity type) in a parsable format.
- Boss Names: Correctly configure the module with the exact entity names used by the game server logs.
- Currency System: This module assumes that your server has a functional currency system that can be accessed and modified via API calls.
- Performance: Log processing can potentially impact server performance, especially with high activity. Monitor server resources and adjust module settings if necessary.
Configuration 2
Settings you fill in when installing the module on a server.
| Setting | Type | Default | Description |
|---|---|---|---|
coinAmountDevourer required coinAmountDevourer | number | 0 | Amoint of Coin to award |
announceDevourer announceDevourer | string | — | Post in chat Boss Kill |
Raw config schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [
"coinAmountDevourer"
],
"additionalProperties": false,
"properties": {
"coinAmountDevourer": {
"title": "coinAmountDevourer",
"description": "Amoint of Coin to award",
"default": 0,
"type": "number"
},
"announceDevourer": {
"title": "announceDevourer",
"description": "Post in chat Boss Kill",
"type": "string"
}
}
} Raw UI schema
{} Hooks 1
Code that runs in reaction to a game or Takaro event.
-
Devourer
Hook for log events
Hook source
// Hook function for detecting boss kills and sending congratulatory PM import { data, takaro } from '@takaro/helpers'; async function main() { const { gameServerId, eventData } = data; // Check if eventData exists and contains the message if (!eventData || !eventData.msg) { console.log("Error: Expected log message not found in data structure"); return; } // Get the log message from the correct path in the data object const logLine = eventData.msg; console.log("Processing log line:", logLine); // Check if this is a bossDevourer kill line if (!logLine.includes("killed animal bossDevourer")) { console.log("Not a bossDevourer kill"); return; } // Extract player name using regex // Format: [CSMM_Patrons]entityKilled: Mad (Steam_76561198041959712) killed animal bossDevourer with Dev: Instant Death Pistol const playerMatch = logLine.match(/entityKilled: (\w+) \(Steam_/); if (!playerMatch || !playerMatch[1]) { console.log("Could not extract player name from kill log"); return; } const playerName = playerMatch[1]; console.log("Extracted player name:", playerName); try { // Search for players with this name const playerSearch = await takaro.player.playerControllerSearch({ filters: { name: [playerName] } }); console.log(`Found ${playerSearch.data.data.length} players matching name ${playerName}`); if (playerSearch.data.data.length === 0) { console.log("No player found with name:", playerName); return; } const playerId = playerSearch.data.data[0].id; // Send a global message about the kill await takaro.gameserver.gameServerControllerSendMessage(gameServerId, { message: `${playerName} made a good kill on that animal bossDevourer!` }); // Send a private message to the player await player.pm(`TEST!!!`); console.log("Successfully sent messages to player:", playerName); } catch (error) { console.log("Error:", error.message); } } await main();