- Joined
- Jul 18, 2009
- Messages
- 658
- Reaction score
- 75
anyone can help me how to add ecoins automatically add to thier account after finishing the dungeon
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!cabal_sp_DungeonRanking
Add
IF (@DungeonIdx = ?) -- If you want to add only one dungeon
BEGIN
Update DB..dbo.CashAccount set Cash = Cash + ? where UserNum = charidx/8
END
good luck
ill check it thank you
how about if i want to add it in all dungeon
up any can tell where i can find the store procedure for this
cabal_sp_DungeonRanking_Single_Clear_Set
Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]Idx/8
DECLARE @CNT int, @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id int
SET @CNT = 1
WHILE @CNT < DATALENGTH ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData )
BEGIN
SET @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id = dbo.BinToInt(SUBSTRING ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData,@CNT,4 ))
Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id/8
SET @CNT= @CNT+27
END
How about query for the party with specific dungeon (If I only want to do it with one dungeon)?For cabal_sp_DungeonRanking_Single_Clear_Set
Code:Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]Idx/8
There will be something like this for the party:
cabal_sp_DungeonRanking_Party_Clear_Set
Code:DECLARE @CNT int, @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id int SET @CNT = 1 WHILE @CNT < DATALENGTH ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData ) BEGIN SET @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id = dbo.BinToInt(SUBSTRING ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData,@CNT,4 )) Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id/8 SET @CNT= @CNT+27 END
DECLARE @CNT int, [USER=2000256504]mem[/USER]Id int
SET @CNT = 1
WHILE @CNT < DATALENGTH ( [USER=2000256504]mem[/USER]berData )
IF (@DungeonIdx = ?)
BEGIN
SET [USER=2000256504]mem[/USER]Id = dbo.BinToInt(SUBSTRING ( [USER=2000256504]mem[/USER]berData,@CNT,4 ))
Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = [USER=2000256504]mem[/USER]Id/8
SET @CNT= @CNT+27
END
How about query for the party with specific dungeon (If I only want to do it with one dungeon)?
Is this correct?
Code:DECLARE @CNT int, @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id int SET @CNT = 1 WHILE @CNT < DATALENGTH ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData ) IF @[I][B][URL="http://forum.ragezone.com/members/2000255614.html"]dung[/URL][/B][/I]eonIdx = ?) BEGIN SET @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id = dbo.BinToInt(SUBSTRING ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData,@CNT,4 )) Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id/8 SET @CNT= @CNT+27 END
DECLARE @CNT int, @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id int, @reward int
SET @reward =
CASE
WHEN @[I][B][URL="http://forum.ragezone.com/members/2000255614.html"]dung[/URL][/B][/I]eonIdx = 4252 THEN 100 --100 eCoins for DungeonIdx=4252
WHEN @[I][B][URL="http://forum.ragezone.com/members/2000255614.html"]dung[/URL][/B][/I]eonIdx = 4253 THEN 200 --200 eCoins for DungeonIdx=4253
WHEN @[I][B][URL="http://forum.ragezone.com/members/2000255614.html"]dung[/URL][/B][/I]eonIdx = 4254 THEN 300 --300 eCoins for DungeonIdx=4254
ELSE 0 --Default - 0 eCoins
END
IF (@reward>0)
BEGIN
SET @CNT = 1
WHILE @CNT < DATALENGTH ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData )
BEGIN
SET @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id = dbo.BinToInt(SUBSTRING ( @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]berData,@CNT,4 ))
Update CabalCash.dbo.CashAccount set Cash = Cash + @reward where UserNum = @[I][B][URL="http://forum.ragezone.com/members/2000256504.html"]mem[/URL][/B][/I]Id/8
SET @CNT= @CNT+27
END
END
If a dungeon is not on your list, no reward will be issued. For example, you want to reward for finishing B3F, but do not want to reward for finishing SoD. If the SoD ID is not in the list, the default setting (0 eCoins) will work.ELSE 0 --Default - 0 eCoins <<<< what is this for? if dungeon is not finished doesn't give ecoin or do I need to remove this so the function above will work?
USE [Server01]
GO
/****** Object: Table [dbo].[cabal_DungeonEcoin_Table] Script Date: 10/11/2020 8:13:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cabal_DungeonEcoin_Table](
[DungeonIdx] [int] NOT NULL,
[ecoin] [int] NOT NULL,
CONSTRAINT [PK_cabal_DungeonEcoin_Table] PRIMARY KEY CLUSTERED
(
[DungeonIdx] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
DECLARE [B]@ecoin[/B] int
SELECT [B]@ecoin[/B] = ecoin
FROM cabal_DungeonEcoin_Table
WHERE DungeonIdx = [USER=2000255614]dung[/USER]eonIdx
SET @CNT = 1
WHILE @CNT < DATALENGTH ( [USER=2000256504]mem[/USER]berData )
BEGIN
SET [USER=2000256504]mem[/USER]Id = dbo.BinToInt(SUBSTRING ( [USER=2000256504]mem[/USER]berData,@CNT,4 ))
UPDATE CabalCash.dbo.CashAccount set Cash = Cash + [B]@ecoin[/B] where UserNum = [USER=2000256504]mem[/USER]Id/8
SET @CNT= @CNT+27
END
Other method would be creating a table for Dungeon with corresponding ecoin reward and use select statement. its easier to update table values when you decided to change ecoin rewards for each dungeon.
DECLARE @ecoin int
SELECT @ecoin = ecoin
FROM cabal_DungeonEcoin_Table
WHERE DungeonIdx = 194<<< is correct?
SET @CNT = 1
WHILE @CNT < DATALENGTH ( @memberData )
BEGIN
SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
UPDATE CabalCash.dbo.CashAccount set Cash = Cash + @ecoin where UserNum = @memId/8
SET @CNT= @CNT+27
END
USE [Server01]
GO
/****** Object: Table [dbo].[cabal_DungeonEcoin_Table] Script Date: 10/11/2020 8:13:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cabal_DungeonEcoin_Table](
[DungeonIdx] [int] NOT NULL,
[ecoin] [int] NOT NULL,
CONSTRAINT [PK_cabal_DungeonEcoin_Table] PRIMARY KEY CLUSTERED
(
[DungeonIdx] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
|
I get it, thanks. Is this working both Party and Solo DG?Create a new table with dungeonid and ecoin value for that code to work.
Code:USE [Server01] GO /****** Object: Table [dbo].[cabal_DungeonEcoin_Table] Script Date: 10/11/2020 8:13:22 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[cabal_DungeonEcoin_Table]( [DungeonIdx] [int] NOT NULL, [ecoin] [int] NOT NULL, CONSTRAINT [PK_cabal_DungeonEcoin_Table] PRIMARY KEY CLUSTERED ( [DungeonIdx] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO
sample table content
293 is for Volcanic Citadel
DungeonIdx ecoin
293 50
4353 150
4353 id for Ancient Tomb
I hope you get the idea.
I get it, thanks. Is this working both Party and Solo DG?