Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: SQL queries: Castle Siege Winner  (Visto 144 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline bafta100 Posteado: February 03, 2026, 06:18:05 PM

  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 188
  • Gracias recibida: 79
  • gb
Use a scheduled SQL job to distribute WCoins to all characters belonging to the Castle Siege winning guild.
Configure the reward amount, then execute the job immediately after the Castle Siege event concludes.

Example: If Castle Siege ends at 22:00, configure the job to run at 22:01.


  • OWNER GUILD: ALL MEMBERS +10 WCoinC
  • ALLIED GUILDS: ALL MEMBERS +10 WCoinC

Code: [Select]
/* ============================================
  Castle Siege Rewards - Optimized
  ============================================ */

DECLARE @OwnerGuild VARCHAR(8)

-- Get castle owner guild
SELECT @OwnerGuild = OWNER_GUILD
FROM MuCastle_DATA

/* ============================================
  Reward OWNER Guild Members
  ============================================ */

UPDATE C
SET C.WCoinC = C.WCoinC + 10
FROM CashShopData C
INNER JOIN Character CH ON C.AccountID = CH.AccountID
INNER JOIN GuildMember GM ON CH.Name = GM.Name
WHERE GM.G_Name = @OwnerGuild


/* ============================================
  Reward ALLIED Guild Members
  ============================================ */

UPDATE C
SET C.WCoinC = C.WCoinC + 10
FROM CashShopData C
INNER JOIN Character CH ON C.AccountID = CH.AccountID
INNER JOIN GuildMember GM ON CH.Name = GM.Name
INNER JOIN Guild G ON GM.G_Name = G.G_Name
WHERE G.G_Union =
(
    SELECT G_Union
    FROM Guild
    WHERE G_Name = @OwnerGuild
)
AND GM.G_Name <> @OwnerGuild

  • Guild Master Extra Reward

Code: [Select]
UPDATE C
SET C.WCoinC = C.WCoinC + 500
FROM CashShopData C
INNER JOIN MEMB_INFO M ON C.AccountID = M.memb___id
INNER JOIN Guild G ON M.memb_name = G.G_Master
WHERE G.G_Name = @OwnerGuild

Before applying these queries, please test them on the beta/test version of MuOnline. Once verified, and then you can applied to the official version.


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
3 Replies
7682 Views
Last post July 04, 2017, 03:16:07 PM
by ToShirico
1 Replies
733 Views
Last post February 12, 2021, 12:38:18 AM
by ZabiinoOo
0 Replies
690 Views
Last post May 20, 2021, 03:03:28 PM
by snopke
83 Replies
9675 Views
Last post April 07, 2024, 07:31:41 PM
by castlemu
4 Replies
932 Views
Last post September 13, 2025, 03:49:46 PM
by Watuyusei