β¨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)
mob_item_drop){{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)
merc_item_drop)Same placeholders as Mob Item Drop - used when a player's mercenary gets the kill.
{{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)
hom_item_drop)Same placeholders as Mob Item Drop - used when a player's homunculus gets the kill.
{{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)
mob_death)Used for MVP/boss kill announcements.
{{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)
at_command)Used for GM command audit logging.
{{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:
: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 workPlaceholders 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/italicIf you want formatting, don't wrap your template in code blocks
Last updated
