Achievements & Quests System

Complete Quest System with Multiple Reward Types

Tutorial Video

What is Achievements & Quests System?

Achievements & Quests System is a comprehensive quest management platform that allows players to accept challenges, track progress in real-time, and claim valuable rewards upon completion. Features multiple achievement types from monster hunting to PVP, arena, and leveling goals with support for Silk, Gold, Items, and Title rewards!

How It Works

Quest Acceptance Flow

  • Browse available achievements in the quest list with full descriptions
  • Players must manually accept quests before progress tracking begins
  • Only ONE active quest allowed at a time - complete current quest first
  • Real-time progress updates displayed in the interface

Progress Tracking System

  • Automatic progress tracking once quest is accepted
  • Kill unique monsters, regular mobs, job players, or complete specific objectives
  • Progress bar shows completion percentage (Current / Required)
  • Completion notification when quest requirements are met

Reward Claiming Process

  • Claim button becomes active when quest is completed
  • Supports multiple reward types: Silk (Own/Gift/Point), Gold, Items, Titles
  • Instant delivery - rewards appear immediately in inventory or account
  • Quest can be re-accepted after claiming if auto-reset is enabled

Database Architecture

📊 _RefAchievements Table

Purpose: Stores achievement definitions and configurations

Key Fields:

  • ID: Unique achievement identifier (auto-increment)
  • Name: Achievement display name (e.g., "Unique Slayer")
  • AchievementType: KILL_UNIQUE, KILL_MOB, KILL_JOB, REACH_LEVEL, ARENA, TRADE
  • TargetCodeName: Specific monster CodeName (NULL for any monster)
  • RequirementMax: Target count to complete quest
  • Description: Quest description text for players
  • SilkReward/SilkAmount: Silk rewards (SILK, SILK_GIFT, SILK_POINT)
  • GoldReward/GoldAmount: Gold rewards
  • Coin1/2/3Reward + Amount: Item rewards (up to 3 different items)
  • TitleReward: HwanLevel title (1-255)
  • AutoResetEnabled/ResetIntervalDays: Auto-reset configuration

👤 _CharAchievements Table

Purpose: Tracks player progress for each achievement

Key Fields:

  • CharID: Player character identifier
  • AchievementID: Reference to _RefAchievements
  • IsAccepted: Quest accepted flag (must be 1 to track progress)
  • AcceptedDate: When player accepted the quest
  • CurrentProgress: Current completion count
  • IsCompleted: Quest completion flag
  • CompletedDate: When quest was completed
  • RewardClaimed: Reward claimed flag
  • ClaimedDate: When reward was claimed
  • LastResetDate: Last auto-reset timestamp

📦 _InstantItemDelivery Table

Purpose: Queue for instant item delivery (read by GameServer)

Key Fields:

  • CharID: Target player for item delivery
  • CodeName: Item CodeName from _RefObjCommon
  • Count: Item quantity (1-255)
  • StorageType: 0 = Inventory, 1 = Storage

Stored Procedures

_AcceptAchievement

Purpose: Player accepts a quest to start tracking

Parameters: @CharID, @AchievementID

Logic: Validates quest availability, enforces 1 active quest limit, marks quest as accepted

_UpdateAchievementProgress

Purpose: Updates quest progress when player completes objectives

Parameters: @CharID, @AchievementType, @TargetCodeName (optional), @IncrementAmount

Logic: Finds accepted quests matching criteria, increments progress, auto-completes when target reached, checks monster rarity for KILL_UNIQUE/KILL_MOB types

_GetCharacterAchievements

Purpose: Retrieves all available quests and player progress

Parameters: @CharID

Returns: Quest list with acceptance status, progress, completion status, and formatted reward text

_ClaimAchievementReward

Purpose: Processes reward delivery for completed quests

Parameters: @CharID, @AchievementID, @ShardDatabase, @AccountDatabase

Logic: Validates completion, delivers Silk (SK_Silk table), Gold (via Filter SendGold), Items (_InstantItemDelivery), Titles (HwanLevel), marks reward as claimed

Achievement Types

🎯 KILL_UNIQUE

  • Purpose: Kill unique monsters (Rarity = 3)
  • TargetCodeName = NULL: Any unique monster counts
  • TargetCodeName = Specific: Only that unique counts
  • Example: "Kill 100 Unique Monsters" → 1000 Silk reward

⚔️ KILL_MOB

  • Purpose: Kill regular monsters (Rarity 1-8)
  • TargetCodeName = NULL: Any monster with Rarity 1-8 counts
  • TargetCodeName = Specific: Only that monster type (e.g., MOB_DF_TIGER)
  • Example: "Kill 100 Tigers" → 5M Gold reward

🔪 KILL_JOB

  • Purpose: Kill job players in PVP/Trade routes
  • TargetCodeName: Not used (always NULL)
  • Example: "Kill 50 Job Players" → Title reward

📈 REACH_LEVEL

  • Purpose: Reach specific character level
  • RequirementMax: Target level (e.g., 110)
  • Example: "Reach Level 110" → Title HwanLevel 8

🏆 ARENA

  • Purpose: Win arena matches
  • Example: "Win 20 Arena Matches" → 50 Arena Coins

💰 TRADE

  • Purpose: Complete trade transactions
  • Example: "Complete 100 Trades" → 10M Gold

Key Features

Quest Acceptance System

  • Manual Acceptance: Players must explicitly accept quests before tracking begins
  • One Active Quest Limit: Forces focus - complete current quest before accepting another
  • Quest Description: Full quest details displayed before acceptance
  • Acceptance Validation: Prevents duplicate acceptance and validates quest availability

Multiple Reward Types

  • Silk Rewards: SILK (own), SILK_GIFT, SILK_POINT with customizable amounts
  • Gold Rewards: Direct gold delivery via Filter SendGold method
  • Item Rewards: Up to 3 different item types per quest (Arena Coins, Potions, etc.)
  • Title Rewards: HwanLevel titles (1-255) for prestigious achievements
  • Combined Rewards: Quests can give multiple reward types simultaneously

Advanced Progress Tracking

  • Real-Time Updates: Progress updates instantly as objectives are completed
  • Monster Rarity Detection: Automatically validates unique monsters (Rarity = 3)
  • Specific Target Tracking: Track kills of specific monster types by CodeName
  • Auto-Completion: Quest automatically marks complete when target reached
  • Progress Persistence: All progress saved in database for reliability

Admin Control Panel

  • X9 Filter Panel: Complete achievement management via visual interface
  • CRUD Operations: Add, edit, delete achievements through Filter UI
  • Progress Monitoring: View all player progress in real-time
  • Bulk Operations: Delete all achievements with one click
  • Database Toggle: Switch between RefAchievements and CharAchievements tables
  • Auto-Reset Configuration: Set daily/hourly quest resets via SQL

Configuration Options

Quest Settings

  • IsActive: Enable/disable quests globally (1 = active, 0 = disabled)
  • NoTagReward: Hide quest from UI while keeping it functional
  • Description: Custom quest description text (max 500 characters)
  • RequirementMax: Target count for quest completion

Auto-Reset System

  • AutoResetEnabled: Enable automatic quest reset (1 = enabled, 0 = disabled)
  • ResetIntervalDays: Reset every X days (e.g., 1 = daily quest)
  • ResetIntervalMinutes: Reset every X minutes (e.g., 60 = hourly quest)
  • AccountLimit: Max characters per account (0 = unlimited, 1 = one char only)

Reward Configuration

  • Silk: Set SilkReward (SILK/SILK_GIFT/SILK_POINT) and SilkAmount
  • Gold: Set GoldReward = 'GOLD' and GoldAmount
  • Items: Set Coin1/2/3Reward (ItemCodeName), Amount, and display Name
  • Title: Set TitleReward (HwanLevel 1-255) and optional TitleText

Professional Tips

For Players

  • Read Descriptions: Check quest requirements and rewards before accepting
  • Focus on One Quest: Complete current quest before accepting another
  • Track Progress: Monitor progress bar to see how close you are to completion
  • Claim Promptly: Don't forget to claim rewards after completion
  • Daily Quests: Check for auto-reset quests that refresh daily for consistent rewards

For Administrators

  • Balance Rewards: Scale rewards appropriately to quest difficulty
  • Use Descriptions: Write clear, motivating quest descriptions
  • Test Thoroughly: Verify quest tracking and reward delivery before going live
  • Monitor Progress: Check CharAchievements table to see player engagement
  • Daily Quests: Use AutoReset for recurring content and player retention
  • Multiple Rewards: Combine reward types for more exciting quest completion

Practical Example

Scenario: You want to earn Silk by completing a unique hunting quest

  1. Open Achievements Panel: Access quest system via F9 Filter interface
  2. Browse Quests: See "Unique Slayer" quest - Kill 5 Unique Monsters for 1000 Silk
  3. Accept Quest: Click Accept button to start tracking progress
  4. Hunt Uniques: Kill unique monsters - progress updates automatically (e.g., 3/5)
  5. Quest Complete: After killing 5 uniques, quest marked complete
  6. Claim Reward: Click Claim button to receive 1000 Silk instantly!

Technical Implementation

GameServer Integration

C++ Hook System: AchievementTracker.cpp monitors damage events

  • Hooks 6 different damage functions for comprehensive monster death detection
  • Detects monster death (HP = 0) and extracts monster CodeName
  • Sends packet 0x1338 type 0x6B to Filter with RefObjID and killer CharID
  • Prevents duplicate logging with monster UID tracking

Filter Processing

C# Achievement Module: AchievementDBSet_UpdateProgress.cs

  • Receives monster kill notification from GameServer
  • Queries _RefObjCommon to get monster rarity (determines if unique/regular)
  • Calls _UpdateAchievementProgress stored procedure with kill data
  • Updates player progress for all matching accepted quests
  • Sends completion notification to client when quest finished

Reward Delivery System

  • Silk: Direct update to AccountDatabase.SK_Silk table (silk_own/gift/point)
  • Gold: Filter SendGold method updates ShardDatabase._Char.RemainGold
  • Items: Inserted into _InstantItemDelivery, GameServer reads and delivers
  • Titles: Direct update to ShardDatabase._Char.HwanLevel
  • Dynamic Databases: Uses Config.GetSql for flexible database naming

Admin Panel Features

  • MainWindow.Achievements.cs provides complete UI management
  • Switch between RefAchievements (definitions) and CharAchievements (progress)
  • Real-time field updates with LostFocus auto-save
  • Formatted list display with dynamic column widths
  • Bulk delete functionality for database maintenance

Summary

Achievements & Quests System provides a complete quest framework with manual acceptance, real-time tracking, multiple reward types, and full administrative control. Perfect for increasing player engagement and providing clear progression goals!

Core Benefits

Manual quest acceptance

📊

Real-time progress tracking

🎁

Multiple reward types

Complete quest tracking with Silk, Gold, Items, and Title rewards - all managed through an intuitive interface!

by X9 Filter New Feature!

Enhancing your Silkroad Online experience