AP Coin

02/03/2012 23:57 Foxyz#1
Does Anybody Know How To Make The Ap Coin Work???
02/04/2012 00:44 RebeccaBlack#2
There isn't a special item for "AP" as far as I know, and how to make a custom one is done in the SQL.

I can't really tell you the full way, I can tell you the partial and you figure out where to go from there, but that's about it. I've forgotten it over time.

PHP Code:
IF( @ActionType 114 
  
BEGIN 
      
IF( @Value2 100001 
        
BEGIN 
            UPDATE PS_UserData
.dbo.Users_Master
            SET    Point 
Point + ( 100 * @Value4 
            
WHERE  UserUID = @UserUID 
        END 
  END 
A little explanation is needed:
@ActionType = 114 - This means you are doing action 114 (Selling to an NPC)
@Value2 = 100001 - in action 114, Value2 = ItemID of the item being sold.
@Value4 - in action 114, Value4 is the amount sold, so I times it by 4, if more than one is sold.

Now to edit this for you, you'd need to change the 100 to your own custom amount.

Also, if you'd like to add more, you'd do it something like this
PHP Code:
IF( @ActionType 114 )
  
BEGIN
      
IF( @Value2 100001 )
        
BEGIN
            UPDATE ps_userdata
.dbo.users_master
            SET    point 
point + ( 100 * @Value4 )
            
WHERE  useruid = @UserUID
        END

      
IF( @Value2 100002 )
        
BEGIN
            UPDATE ps_userdata
.dbo.users_master
            SET    point 
point + ( 100 * @Value4 )
            
WHERE  useruid = @UserUID
        END
  END 
Please note, this must be inserted in PS_GameLog.dbo.usp_Insert_Action_Log_E
02/04/2012 01:42 Foxyz#3
ok... so i make a query and put that in or sutin? lol
02/04/2012 02:27 ·Tyler·#4
Quote:
Originally Posted by RebeccaBlack View Post
Please note, this must be inserted in PS_GameLog.dbo.usp_Insert_Action_Log_E
Please read what the user posted. :rtfm:

Tyler
02/04/2012 02:56 Foxyz#5
im blind

Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@ActionType".
Msg 137, Level 15, State 2, Line 3
Must declare the scalar variable "@Value2".
Msg 137, Level 15, State 2, Line 6
Must declare the scalar variable "@Value4".
Msg 137, Level 15, State 2, Line 10
Must declare the scalar variable "@Value2".
Msg 137, Level 15, State 2, Line 13
Must declare the scalar variable "@Value4".

do i delete all and put that or jsut add that to what is alredy there
02/04/2012 05:54 KarmaIsMe#6
Its amazing Foxyz there are probably over 20+ threads started by you asking people "where is this" when you can just as easily use the search function or look through all of the dev releases like everyone else has done in the past when creating a server. If you cant even copy and paste properly maybe you shouldn't be attempting to release a server.

Karma
02/04/2012 06:16 RebeccaBlack#7
Foxyz, by reading the error I see you're trying to add it to the very top. I said insert it into, not append to. Use trial and error.

It doesn't work at the top, so look for the insert function and add it above that
02/05/2012 00:55 Foxyz#8
karma i have used the search ....

it doesnt work well the query does but didnt work lol
02/05/2012 15:19 RebeccaBlack#9
What do you mean "it doesn't work"? You have to give me more than that so I can help you. Otherwise I could only give you a multitude of random answers that might not match your question.

I used that exact snippet of a script for my own server when I ran it, and I never had an issue. It just needs to be inserted into the stored procedure properly. I would post mine, but as mine is just a local, it doesn't have any of the "Dupe Fix" and I wouldn't want you to accidentally remove that if you had it in your database.
02/07/2012 06:36 Foxyz#10
wen i sell i dont get ap...
02/07/2012 06:49 RebeccaBlack#11
Okay, how about this. Post the procedure I had you enter it into, and I'll look at it myself and fix it if something is wrong.
02/07/2012 06:58 Foxyz#12
USE [PS_GameLog]
GO
/****** Object: StoredProcedure [dbo].[usp_Insert_Action_Log_E] Script Date: 02/07/2012 00:46:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Insert_Action_Log_E Script Date: 2008-6-7 18:32:40 ******/

/****** Object: Stored Procedure dbo.usp_Insert_Action_Log_E Script Date: 2008/3/15 下午 05:16:53 ******/



ALTER Proc [dbo].[usp_Insert_Action_Log_E]

/*
Created by [Only registered and activated users can see links. Click Here To Register...], 2004-08-17
Modified by [Only registered and activated users can see links. Click Here To Register...], 2004-08-19

게임내 행동 로그 남기기 */


/*

*/

@UserID varchar(18),
@UserUID int,
@CharID int,
@CharName varchar(50),
@CharLevel tinyint,
@CharExp int,
@MapID smallint,
@PosX real,
@PosY real,
@PosZ real,
@ActionTime datetime,
@ActionType tinyint,
@Value1 bigint = null,
@Value2 int = null,
@Value3 int = null,
@Value4 bigint = null,
@Value5 int = null,
@Value6 int = null,
@Value7 int = null,
@Value8 int = null,
@Value9 int = null,
@Value10 int = null,
@Text1 varchar(100) = '',
@Text2 varchar(100) = '',
@Text3 varchar(100) = '',
@Text4 varchar(100) = '',
@Sql nvarchar(4000) = '',
@yyyy varchar(4) = '',
@mm varchar(2) = '',
@dd varchar(2) = '',
@Bucket smallint = -1

AS

SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)


IF(LEN(@mm) = 1)
BEGIN
SET @mm = '0' + @mm
END

IF(LEN(@dd) = 1)
BEGIN
SET @dd = '0' + @dd
END

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.ActionLog
(UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID, PosX, PosY, PosZ, ActionTime, ActionType,
Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4)
VALUES(@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType,
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4)'

EXEC sp_executesql @Sql,
N'@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50),
@CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint,
@Value1 bigint, @Value2 int, @Value3 int, @Value4 bigint, @Value5 int, @Value6 int, @Value7 int, @Value8 int,
@Value9 int, @Value10 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)',
@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType,
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4

IF( @ActionType = 114 )
BEGIN
IF( @Value2 = 100001 )
BEGIN
UPDATE ps_userdata.dbo.users_master
SET point = point + ( 100 * @Value4 )
WHERE useruid = @UserUID
END

IF( @Value2 = 100002 )
BEGIN
UPDATE ps_userdata.dbo.users_master
SET point = point + ( 100 * @Value4 )
WHERE useruid = @UserUID
END
END
02/07/2012 07:47 RebeccaBlack#13
PHP Code:
USE [PS_GameLog]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER Proc 
[dbo].[usp_Insert_Action_Log_E]

@
UserID varchar(18),
@
UserUID int,
@
CharID int,
@
CharName varchar(50),
@
CharLevel tinyint,
@
CharExp int,
@
MapID smallint,
@
PosX real,
@
PosY real,
@
PosZ real,
@
ActionTime datetime,
@
ActionType tinyint,
@
Value1 bigint null,
@
Value2 int null,
@
Value3 int null,
@
Value4 bigint null,
@
Value5 int null,
@
Value6 int null,
@
Value7 int null,
@
Value8 int null,
@
Value9 int null,
@
Value10 int null,
@
Text1 varchar(100) = '',
@
Text2 varchar(100) = '',
@
Text3 varchar(100) = '',
@
Text4 varchar(100) = '',
@
Sql nvarchar(4000) = '',
@
yyyy varchar(4) = '',
@
mm varchar(2) = '',
@
dd varchar(2) = '',
@
Bucket smallint = -1

AS

IF( @
ActionType 114 )
BEGIN
    
IF( @Value2 100001 )
    
BEGIN
        UPDATE PS_UserData
.dbo.Users_Master
        SET Point 
Point + ( 100 * @Value4 )
        
WHERE UserUID = @UserUID
    END

    
IF( @Value2 100002 )
    
BEGIN
        UPDATE PS_UserData
.dbo.Users_Master
        SET Point 
Point + ( 100 * @Value4 )
        
WHERE UserUID = @UserUID
    END
END

SET 
@Sql N'
INSERT INTO PS_GameLog.dbo.ActionLog
(UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID, PosX, PosY, PosZ, ActionTime, ActionType, 
Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4)
VALUES(@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, 
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4)'

EXEC sp_executesql @Sql
N'@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50), 
@CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint, 
@Value1 bigint, @Value2 int, @Value3 int, @Value4 bigint, @Value5 int, @Value6 int, @Value7 int, @Value8 int, 
@Value9 int, @Value10 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)'
,
@
UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType
@
Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4 
02/07/2012 08:04 Foxyz#14
ty will check it out

does this have anything to do with item.sdata at all?
02/07/2012 08:16 RebeccaBlack#15
No. I rely fully on the database for this. You, however, can edit your Item.SData to change the name and description (plus sell price, if you'd like).