✨Message Templates

Customize Discord messages with your own templates

Want to customize how your Discord messages look? Message templates let you create your own message format instead of using the default layout. This is completely optional - if you don't include a template, RagnaSync uses its standard formatting.

How It Works

Templates use placeholders wrapped in double curly braces like {{player_name}} that get replaced with actual values when the message is sent. Just add a [template: ...] field to your existing script.

Basic Example

Here's how to add a custom template to a mob item drop script:

Default (no template):

[action: mob_item_drop][channel: 123456789][player_name: Marky][mob_name: Poring][mob_id: 1002][item_name: Apple][item_id: 512][rate: 25][account_id: 1][char_id: 1]

This produces the standard formatted message:

πŸ’Ž Item Drop:     | Marky            | Poring           | Apple                | 0.25%

With custom template:

[action: mob_item_drop][channel: 123456789][player_name: Marky][mob_name: Poring][mob_id: 1002][item_name: Apple][item_id: 512][rate: 25][account_id: 1][char_id: 1][template: {{mob_name}} dropped {{item_name}}!]

This produces:

Poring dropped Apple!

Available Placeholders

Templates are supported on several script types. Each has its own set of placeholders you can use.

Mob Item Drop (mob_item_drop)

Placeholder
Description
Example

{{player_name}}

Character name

Marky

{{mob_name}}

Monster name

Poring

{{mob_id}}

Monster ID

1002

{{item_name}}

Dropped item name

Apple

{{item_id}}

Item ID

512

{{rate}}

Formatted drop rate

0.25%

{{rate_raw}}

Raw rate value

25

Mercenary Item Drop (merc_item_drop)

Same placeholders as Mob Item Drop - used when a player's mercenary gets the kill.

Placeholder
Description
Example

{{player_name}}

Character name (mercenary owner)

Marky

{{mob_name}}

Monster name

Poring

{{mob_id}}

Monster ID

1002

{{item_name}}

Dropped item name

Apple

{{item_id}}

Item ID

512

{{rate}}

Formatted drop rate

0.25%

{{rate_raw}}

Raw rate value

25

Homunculus Item Drop (hom_item_drop)

Same placeholders as Mob Item Drop - used when a player's homunculus gets the kill.

Placeholder
Description
Example

{{player_name}}

Character name (homunculus owner)

Marky

{{mob_name}}

Monster name

Poring

{{mob_id}}

Monster ID

1002

{{item_name}}

Dropped item name

Apple

{{item_id}}

Item ID

512

{{rate}}

Formatted drop rate

0.25%

{{rate_raw}}

Raw rate value

25

Mob Death (mob_death)

Used for MVP/boss kill announcements.

Placeholder
Description
Example

{{player_name}}

Character who killed the monster

Marky

{{mob_name}}

Monster name

Baphomet

{{mob_id}}

Monster ID

1039

{{account_id}}

Player's account ID

2000001

{{char_id}}

Player's character ID

150001

Example:

Result: πŸ† Marky defeated Baphomet!

@Command Log (at_command)

Used for GM command audit logging.

Placeholder
Description
Example

{{name}}

Character name

AdminName

{{command}}

The @command executed

@warp prontera

{{account_id}}

Player's account ID

2000001

{{char_id}}

Player's character ID

150001

{{time}}

Time of execution

14:30:25

Example:

Result: ⚠️ AdminName used @warp prontera at 14:30:25

Template Ideas

Here are some examples to get you started:

Simple announcement:

Result: Marky got Apple from Poring!

With drop rate:

Result: Apple (0.25%) dropped for Marky

Minimal - item only:

Result: Apple

Discord markdown formatting:

Result: Marky obtained Apple from Poring

Using Emojis in Templates

You can use Discord emoji shortcodes in your templates, and RagnaSync will automatically convert them to Unicode characters. This is especially useful when your template uses code blocks, since Discord doesn't parse emoji shortcodes inside code blocks.

How It Works

Just use Discord's standard emoji shortcodes like :gem: or :fire: in your template. RagnaSync automatically converts them to their Unicode equivalents so they display correctly everywhere - even inside code blocks!

Example with code block:

Result: πŸ”Έ Marky | Poring | Apple

Example without code block:

Result: πŸ’Ž Marky got Apple!

Supported Emojis

Here are some commonly used emojis you can use in your templates:

Shortcode
Emoji
Good For

:small_orange_diamond:

πŸ”Έ

Item drops, bullets

:small_blue_diamond:

πŸ”Ή

Info, secondary items

:gem:

πŸ’Ž

Rare drops, valuable items

:star:

⭐

Achievements, highlights

:fire:

πŸ”₯

Hot items, streaks

:trophy:

πŸ†

MVPs, winners

:sparkles:

✨

Special events

:crown:

πŸ‘‘

Top players, VIPs

:tada:

πŸŽ‰

Celebrations, jackpots

:gift:

🎁

Rewards, loot

:skull:

πŸ’€

Deaths, PvP

:zap:

⚑

Speed, critical hits

:crossed_swords:

βš”οΈ

Combat, WoE

:shield:

πŸ›‘οΈ

Defense, protection

:warning:

⚠️

Alerts, caution

:heart:

❀️

Health, love

:lock:

πŸ”’

Secured, locked

:key:

πŸ”‘

Access, keys

:money_bag:

πŸ’°

Zeny, wealth

:scroll:

πŸ“œ

Quests, items

Template Examples with Emojis

Simple drop announcement:

Formatted table in code block:

Card drop celebration:

PvP kill message:

Finding the Code in Your Source

To add custom templates, you'll need to modify your server's source code. Here's how to find the right spot:

Step 1: Open Your Project

Open your rAthena or Hercules source folder in Visual Studio Code (or your preferred editor).

Step 2: Search for the Action

Use Ctrl+Shift+F (or Cmd+Shift+F on Mac) to open "Search in Files", then search for:

This will show you all the places where RagnaSync sends item drop messages.

Step 3: Find the Right Location

Look for the line that builds the RagnaSync message - it will look something like:

This is where you'll add your [template: ...] field.

Step 4: Add Your Template

Append your template to the existing message. For example:

Advanced: Conditional Templates

The real power comes when you use conditional logic in your server source code to send different templates based on game conditions. Since you control what gets sent to RagnaSync, you can build the template string dynamically.

Example: VIP Player Announcements

Give your VIP players a special announcement format:

Example: Rare Item Highlights

Make ultra-rare drops stand out:

Example: Different Templates by Map

Customize announcements based on where the drop happened:

Example: Item Type-Based Templates

Different formats for different item types:

Tips

  • Keep it readable - Discord has character limits, so don't make templates too long

  • Test your templates - Make sure all your placeholders are spelled correctly

  • Use Discord formatting - Bold (**text**), italic (*text*), underline (__text__) all work

  • Placeholders are case-sensitive - Use {{player_name}} not {{Player_Name}}

  • Unknown placeholders stay as-is - If you typo a placeholder like {{playr_name}}, it won't be replaced

Troubleshooting

Template not working?

  • Make sure there are no spaces inside the curly braces: {{player_name}} not {{ player_name }}

  • Check that your placeholder names match exactly (see the table above)

  • Verify the template field is properly formatted: [template: your template here]

Message looks weird?

  • Remember that Discord code blocks (` ` `) don't support formatting like bold/italic

  • If you want formatting, don't wrap your template in code blocks

Last updated