HELP ( Making Job Based Server)
Hi guys! i searched stored procedures and i found a stored procedure for trade reward!
stored procedure name : _Reward_3Job_Related_Item
and I saw, some servers have job point on item mall.
job point is Silk point normally.
Men changed it to jobpoint.
in the _Reward_3Job_Related_Item procedure, i noticed a think;
-- º¸»ó
if (@TotalReward > 0)
begin
update _char set remaingold = remaingold + @TotalReward where charid = @CharID
end
now, i understand for here : when i complete a trade, if my total reward >0, total reward is adding my gold.
now my problem is here
as the other servers , i want to add here silk point but i will change it's name -> JobPoint.
I Tried to Add new procedure = AddJobPoint and AddJobPointLog
addjobpoint:
CREATE PROCEDURE [dbo].[AddJobPoint]
@USERNAME varchar(32),
@POINTS INT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @JID INT
DECLARE @EXISTS INT
DECLARE @ACCOUNT_EXISTS INT
DECLARE @POINTS_ADD INT
DECLARE @TIME VARCHAR(100) = (SELECT GETDATE())
SET @POINTS_ADD = @POINTS
SET @JID = (select JID from TB_User where StrUserID=@USERNAME)
SET @EXISTS = (select COUNT(*) from SK_Silk where JID=@JID)
SET @ACCOUNT_EXISTS = (select count(JID) from TB_User where StrUserID=@USERNAME)
IF @ACCOUNT_EXISTS < 1
BEGIN
insert into AddSilkLog(username,silk_point,time,status) values(@USERNAME,@POINTS_ADD,@TIME,'FAILED [invalid uname]')
END
ELSE
BEGIN -- if account exists [start]
if @EXISTS > 0
BEGIN
update SK_Silk set silk_point = (silk_point+@POINTS_ADD) where JID=@JID
insert into AddSilkLog(username,silk_point,time,status) values(@USERNAME,@POINTS_ADD,@TIME,'CHARGED')
END
ELSE
BEGIN
insert into SK_Silk(JID,silk_own,silk_gift,silk_point) values(@JID,0,0,@POINTS_ADD)
insert into AddSilkLog(username,silk_point,time,status) values(@USERNAME,@POINTS_ADD,@TIME,'CHARGED')
END
END
END -- if account exists
AddJobPointLog:
USE [SRO_VT_ACCOUNT]
GO
/****** Object: Table [dbo].[AddJobPointLog] Script Date: 01/28/2012 00:56:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AddSilkLog](
[username] [nvarchar](max) NULL,
[silk_point] [bigint] NULL,
[time] [ntext] NULL,
[status] [nvarchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SO if I execute the query ; exec AddJobPoint 'Charname', 'Amount'
i have x amount of silk point.
i tried this query in _Reward_3Job_Related_Item procedure in shard database
MY NOTICED CODE: -- º¸»ó
if (@TotalReward > 0)
begin
update _char set remaingold = remaingold + @TotalReward where charid = @CharID
end
And i changed it to ->
-- º¸»ó
if (@TotalReward > 0)
begin
update _char set remaingold = remaingold + @TotalReward where charid = @CharID
exec AddJobPoint '@CharID', '1'
end
IT WORKED!
BUT THE PROBLEM IS HERE!
IDK HOW the GAIN MORE POİNTS ACCORDİNG TO * ( DIFFICULT OF TRADE)
I am waiting your reply thanks all.
and my english may be bad, sorry for this
EDIT: ANOTHER PROBLEM:
when i make items in item mall, items can be bought with job point ( silk point)
but i dont know what the payment device for silk point? in refpricepolicyofitem
like = 1= gold 2 4 16 = silk 256 = iron coin vs. vs.