Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Development
You last visited: Today at 13:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Killtransfer by selling in the npc (need only little fix)

Discussion on Killtransfer by selling in the npc (need only little fix) within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2012
Posts: 152
Received Thanks: 15
Killtransfer by selling in the npc (need only little fix)

Trigger

PHP Code:
USE [PS_GameData]
GO
/****** Object:  Trigger [dbo].[Killtransfer]    Script Date: 02.12.2014 19:32:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER TRIGGER 
[dbo].[Killtransfer]
on [PS_GameData].[dbo].[Chars]
for 
insert
as


DECLARE
@
ActionType tinyint,
@
AT int,
@
UserUID int,
@
ItemID int,
@
K1 int


/*    
Action_Trigger_v2.sql    RELEASE: 2014-10-13

Scripted by blabla
Made for: blabla / Elitepvpers
*/

-- ActionType114 Get Killtransfer by Selling Item to NPC
-- ActionType112 Get Killtransfer by using it
SET 
@AT 114

SET 
@ItemID = (SELECT Value2 FROM PS_GameLog.dbo.Actionlog)
SET @ActionType = (SELECT ActionType FROM PS_GameLog.dbo.Actionlog)
-- -------------------------------------------------

IF ( @
ActionType = @AT )
BEGIN
-- -----------------------------------------

-- 
Killtransfer

IF (@ItemID 100239)
BEGIN 
SET 
@UserUID = (SELECT UserUID FROM PS_GameLog.dbo.Actionlog)

UPDATE PS_GameData.dbo.Chars
SET K1 
= (SELECT top 5 K1 FROM [PS_GameData].[dbo].[Chars]
ORDER BY K1 DESC)
WHERE UserUID = @UserUID
END

-- -----------------------------------------
End 
PHP Code:
USE [PS_GameLog]
GO
/****** Object:  Trigger [dbo].[Killtransfer]    Script Date: 02.12.2014 20:35:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER TRIGGER 
[dbo].[Killtransfer]
on [PS_GameLog].[dbo].[ActionLog]
for 
insert
as


DECLARE
@
ActionType tinyint,
@
AT int,
@
UserUID int,
@
ItemID int,
@
K1 int


/*    
Action_Trigger_v2.sql    RELEASE: 2014-10-13

Scripted by blabla
Made for: blabla / Elitepvpers
*/

-- ActionType114 Get Killtransfer by Selling Item to NPC
-- ActionType112 Get Killtransfer by using it
SET 
@AT 114

SET 
@ItemID = (SELECT Value2 FROM PS_GameLog.dbo.Actionlog)
SET @ActionType = (SELECT ActionType FROM PS_GameLog.dbo.Actionlog)
-- -------------------------------------------------

IF ( @
ActionType = @AT )
BEGIN
-- -----------------------------------------

-- 
Killtransfer

IF (@ItemID 100239)
BEGIN 
SET 
@UserUID = (SELECT UserUID FROM inserted)

UPDATE PS_GameData.dbo.Chars
SET K1 
= (SELECT top 5 K1 FROM [PS_GameData].[dbo].[Chars]
ORDER BY K1 DESC)
WHERE UserUID = @UserUID
END

-- -----------------------------------------
End 
Dont know whats wrong. Its dont work. I hope anyone can help me.
Lordritter is offline  
Thanks
2 Users
Old 12/02/2014, 23:46   #2
 
killer2p's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 417
Received Thanks: 159
Well have you tried just doing it like ap coin
killer2p is offline  
Old 12/03/2014, 00:06   #3
 
wallerus's Avatar
 
elite*gold: 0
Join Date: Apr 2014
Posts: 300
Received Thanks: 472
You could probably rewrite it and put it into usp_Insert_Action_Log_E with all the other ActionLog code such as DP coins, seems like a better fit to me. Rewriting it to fit there would be really simple as it's just changing a couple of the lines.

Also, I think it might not work because you have to actually be logged in to sell your item to an NPC but you need to be logged out (of the char at least) to update it's kills in the database (i'm pretty certain about that).

If the last part holds true then your script would be redundant and wouldn't work, you'd sell the item, it would change the kills in the database but most likely when you logout of the char it reupdates back to the last value. I haven't actually tested it but that's what is in my head.

It would work better as a script from a website where you're not actually logged in the character/account for it.
wallerus is offline  
Thanks
2 Users
Old 12/03/2014, 13:11   #4
 
elite*gold: 0
Join Date: Aug 2012
Posts: 152
Received Thanks: 15
Its work guys. I found it what gave error. Change the top 5 to top 1. Its work 100%. Need only to relogg
Lordritter is offline  
Old 12/03/2014, 21:34   #5
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
Thanks Lordritter
But this should be
Code:
WHERE UserUID = @UserUID and del='0' and level >31
SnickQ is offline  
Thanks
1 User
Old 12/05/2014, 14:07   #6
 
elite*gold: 0
Join Date: Aug 2012
Posts: 152
Received Thanks: 15
snick check my private messages pls xD
Lordritter is offline  
Thanks
1 User
Old 04/11/2015, 18:57   #7
 
elite*gold: 0
Join Date: Jan 2012
Posts: 428
Received Thanks: 33
can you explain the fix lordritter?what sniq means?
Cansas59 is offline  
Old 04/12/2015, 16:46   #8
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
Idk Cansas where you have problem, but i gussing you not read carefully

Code:
UPDATE PS_GameData.dbo.Chars
SET K1 = (SELECT top 1 K1 FROM [PS_GameData].[dbo].[Chars]
ORDER BY K1 DESC)
WHERE UserUID = @UserUID
SnickQ is offline  
Old 04/12/2015, 21:18   #9
 
elite*gold: 0
Join Date: May 2010
Posts: 342
Received Thanks: 87
need to add again something,

-> the reset point of base
-> reset kill rank

because without these 2, same the toon at '0' kill will still get the bonification of Vet manager from rank precedent.
And in more again, the update of the rest of character. because the proper sense if i don't do mistake, is to Add the kill of all the character to 1, the seller of the special rune...
So without to update the rank K1 of each character... will be some problem i think ^^

Kind Regards,
_Diavolino_ is offline  
Old 04/13/2015, 00:37   #10
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
Code:
Declare @Slot1 int =(Select top 1 k1 From PS_GameData.dbo.chars where UserID =@UserrID and slot ='0')
Declare @Slot2 int =(Select top 1 k1 From PS_GameData.dbo.chars where UserID =@UserrID and slot ='1')
Declare @Slot3 int =(Select top 1 k1 From PS_GameData.dbo.chars where UserID =@UserrID and slot ='2')
Declare @Slot4 int =(Select top 1 k1 From PS_GameData.dbo.chars where UserID =@UserrID and slot ='3')
Declare @Slot5 int =(Select top 1 k1 From PS_GameData.dbo.chars where UserID =@UserrID and slot ='4')
Declare @Toon1 int =(Select top 1 CharID From PS_GameData.dbo.chars where UserID =@UserrID and slot ='0')
Declare @Toon2 int =(Select top 1 CharID From PS_GameData.dbo.chars where UserID =@UserrID and slot ='1')
Declare @Toon3 int =(Select top 1 CharID From PS_GameData.dbo.chars where UserID =@UserrID and slot ='2')
Declare @Toon4 int =(Select top 1 CharID From PS_GameData.dbo.chars where UserID =@UserrID and slot ='3')
Declare @Toon5 int =(Select top 1 CharID From PS_GameData.dbo.chars where UserID =@UserrID and slot ='4')
DECLARE @Slocik tinyint =(Select top 1 Slot from PS_gamedata.dbo.chars where CharID = @CharID)

update PS_GameData.dbo.chars
Set K1 =k1+ @Slot1
Where CharID=@CharID and Slot=@Slocik and @Slot1 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot2
Where CharID=@CharID and Slot=@Slocik and @Slot2 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot3
Where CharID=@CharID and Slot=@Slocik and @Slot3 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot4
Where CharID=@CharID and Slot=@Slocik and @Slot4 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot5
Where CharID=@CharID and Slot=@Slocik  and @Slot5 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 = '0'
Where CharID=@Toon1

update PS_GameData.dbo.chars
Set K1 = '0'
Where CharID=@Toon2

update PS_GameData.dbo.chars
Set K1 = '0'
Where CharID=@Toon3

update PS_GameData.dbo.chars
Set K1 = '0'
Where CharID=@Toon4

update PS_GameData.dbo.chars
Set K1 = '0'
Where CharID=@Toon5

update PS_GameData.dbo.chars
Set K1 =k1+ @Slot1
Where CharID=@CharID and Slot=@Slocik and @Slot1 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot2
Where CharID=@CharID and Slot=@Slocik and @Slot2 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot3
Where CharID=@CharID and Slot=@Slocik and @Slot3 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot4
Where CharID=@CharID and Slot=@Slocik and @Slot4 IS NOT NULL

update PS_GameData.dbo.chars
Set K1 =k1+  @Slot5
Where CharID=@CharID and Slot=@Slocik  and @Slot5 IS NOT NULL
That should update kills with 1+1
SnickQ is offline  
Old 04/17/2015, 15:08   #11
 
elite*gold: 0
Join Date: Jan 2013
Posts: 449
Received Thanks: 552
Quote:
Originally Posted by SnickQ View Post
That should update kills with 1+1
and what happen if there is a death character? miss

Code:
AND Del = 0
beetols is offline  
Old 04/17/2015, 17:58   #12
 
SkuulCandy's Avatar
 
elite*gold: 0
Join Date: Apr 2015
Posts: 424
Received Thanks: 113
Quote:
Originally Posted by SnickQ View Post
That should update kills with 1+1
Why update kills 1+1 ?
SkuulCandy is offline  
Reply


Similar Threads Similar Threads
Selling code for items in some mmorpg + account leveling and selling! [OPEN]
09/07/2013 - Trading - 0 Replies
Hi guys,I'm selling a bit 'of codes that do not use won in some specific events on ebay! Eden Eternal Reawakening EXP+CP Items Code: Eden Eternal Reawakening EXP+CP Items Code | eBay Ministry of War Server 40 Items Code: Ministry of War Server 40 Items Code | eBay



All times are GMT +2. The time now is 13:02.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.