Bosskills

  • community
  • events
  • by Mad
  • Takaro v0.0.21
  • all
View export JSON

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

  1. 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.
  2. 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.

SettingTypeDefaultDescription
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
    import { data, takaro } from '@takaro/helpers';
    
    async function main() {
        const { gameServerId, eventData } = data;
    
        const pattern = /Steam_(\d+)/;
        const match = data.eventData.msg.match(pattern);
        const steamIdx = match[1];
        const playerid = (await takaro.player.playerControllerSearch({ filters: { steamId: [steamIdx] } })).data.data[0].id;
        const mainPlayer = (await takaro.playerOnGameserver.playerOnGameServerControllerSearch({
            filters: { gameServerId: [gameServerId], playerId: [playerid] },
        })).data.data[0];
    
        // Send the message with backticks
        await takaro.gameserver.gameServerControllerSendMessage(gameServerId, {
            message: `[FFFF33] just killed a [-][00FEED]Devourer[-] and received 300 [D49F69]Twinkies[-]`
        });
    
        // Grant currency to the player
        await takaro.playerOnGameserver.playerOnGameServerControllerAddCurrency(gameServerId, playerid, {
            currency: 300
        });
        await mainPlayer.pm(`TEST!!!!!!!`)
    }
    
    await main();