Welcome!

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!

Scroll to Remove PK from Char

Skilled Illusionist
Joined
Oct 24, 2011
Messages
331
Reaction score
202
RefObjCommon
PHP:
1	43605	ITEM_MALL_PKREMOVER	???? ???? ??? (???)	xxx	SN_ITEM_MALL_PKREMOVER	SN_ITEM_MALL_PKREMOVER_TT_DESC	1	0	3	3	13	14	180000	3	0	1	1	1	255	0	1	0	0	129	0	0	0	0	0	0	0	-1	0	-1	0	-1	0	-1	0	-1	0	0	0	0	0	0	0	100	0	0	0	xxx	item\etc\drop_mall_scroll.bsr	Premium\etc\pkremover.ddj	xxx	xxx	22005

RefObjItem
PHP:
22005	1	2	0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1000	????(?)	1	[USU1:SKILL_MALL_PKREMOVER]                                                                                                      	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	0	0	0

RefSkill
PHP:
1	34005	1013	SKILL_MALL_PKREMOVER	???? ????	SKILL_MALL_PKREMOVER	0	1	1	0	0	0	0	0	1000	0	0	0	3599	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	3	0	0	255	255	0	0	0	0	0	255	255	255	255	item\etc\mall_optlevel_upgrade_scroll_1.ddj	SN_SKILL_MALL_PKREMOVER	xxx	SN_SKILL_MALL_PKREMOVER_TT_DESC	xxx	0	0	3	1667396966	1851946342	1685418593	1500	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0

Procedure

_TimedJob
PHP:
		if(@JobID = '34005') -- Pk Remover
		begin

                        Update _Char Set DailyPK = 0 Where CharID = @CharID
                        Update _Char Set TotalPK = 0 Where CharID = @CharID
                        Update _Char Set PKPenaltyPoint = 0 Where CharID = @CharID
			return -3
		end
 
Initiate Mage
Joined
Jan 9, 2009
Messages
0
Reaction score
424
Instead of giving them Fish and making 10+ threads why you can't simply do that?
Code:
        if(@JobID = '34005') -- Pk Remover 
        begin 
             --code goes here
            return -3 
        end
 
Joined
Jul 18, 2007
Messages
1,054
Reaction score
1,039
erm... can you just reduce the above code to this.

Code:
[COLOR=#007700]if(@[/COLOR][COLOR=#0000BB]JobID [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'34005'[/COLOR][COLOR=#007700]) -- [/COLOR][COLOR=#0000BB]Pk Remover 
        begin 

                        Update _Char Set DailyPK [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0 Where CharID [/COLOR][COLOR=#007700]= @[/COLOR][COLOR=#0000BB]CharID 
                        Update _Char Set TotalPK [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0 Where CharID [/COLOR][COLOR=#007700]= @[/COLOR][COLOR=#0000BB]CharID 
                        Update _Char Set PKPenaltyPoint [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0 Where CharID [/COLOR][COLOR=#007700]= @[/COLOR][COLOR=#0000BB]CharID 
            [/COLOR][COLOR=#007700]return -[/COLOR][COLOR=#0000BB]3 
        end 
[/COLOR]

into

Code:
[COLOR=#007700]if(@[/COLOR][COLOR=#0000BB]JobID [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'34005'[/COLOR][COLOR=#007700]) -- [/COLOR][COLOR=#0000BB]Pk Remover 
        begin 
[/COLOR][COLOR=#0000BB]            Update _Char Set DailyPK [COLOR=#007700]= [/COLOR]0, TotalPK [COLOR=#007700]= [/COLOR]0, PKPenaltyPoint [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0 Where CharID [/COLOR][COLOR=#007700]= @[/COLOR][COLOR=#0000BB]CharID 
            [/COLOR][COLOR=#007700]return -[/COLOR][COLOR=#0000BB]3 
        end 
[/COLOR]
 
Newbie Spellweaver
Joined
Feb 27, 2013
Messages
18
Reaction score
0
if(@JobID = '34005') -- Pk Remover
begin

Update _Char Set DailyPK
= 0 Where CharID = @CharID
Update _Char Set TotalPK
= 0 Where CharID = @CharID
Update _Char Set PKPenaltyPoint
= 0 Where CharID = @CharID
return -3
end
when i run query it error
Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@JobID".
Msg 137, Level 15, State 2, Line 4
Must declare the scalar variable "@CharID".
Msg 137, Level 15, State 2, Line 5
Must declare the scalar variable "@CharID".
Msg 137, Level 15, State 2, Line 6
Must declare the scalar variable "@CharID".
Msg 178, Level 15, State 1, Line 7
A RETURN statement with a return value cannot be used in this context.
Vsro 1.88
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
the code does the same anyways but i prefer statements like the one you used too Jangan, but i dont like the way this works anyways .. i dont want my players to be disconnected when they use an item .. isnt there any other way to update their status? i tried makeing the items teleport to the recall point but when doing this the buff isnt applied so the sql isnt executed either .. any ideas?
 
Joined
Jul 18, 2007
Messages
1,054
Reaction score
1,039
of course there is ... if i had a sever to work with i can make you one.


what you basically do is use the cursor/transaction standards... "the same concept of my name changing method, or how guilds update levels everytime you level". http://forum.ragezone.com/f722/official-feature-perfect-fixed-character-810072/


this is just a theory.. if it does work with updating names and guild level, character level etc... it should work for the rest of the data.
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
well the cursor in sql is used for something that equals a for each loop and the transaction is used to do something only if no errors are thrown or things like that .. it doesnt actually send the packet to the client that updates the status or things like that i think its hardcoded like the client notices the name starts with @, then opens that window and then sends a packet to the server that tells the server to execute the changename sp and after it the server sends a packet to the client with new informations .. like when useing a return scroll for example you have to give the item all itemtype ids = 3 so the server knows what it should do when useing this item

i was thinking about an item that gives the buff AND uses a teleport to town .. but the typeid 3 and 4 need to be 13 and 14 for the buff item and both need to be 3 for a return item .. and i dont know how these typeid's work or what values do what ..
 
Junior Spellweaver
Joined
Jan 14, 2013
Messages
167
Reaction score
59
Lemoniscool, i personally havent tried it out yet, however why not a trigger on _inventory for refitemid from _items?

Also, there isn't actually a need of disconnecting the chars. Teleportation should work alright shouldnt it?
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
what do you mean Royalblade? didnt understand what youre suggesting but youre right teleporting would be enough thats what i was trying but its not possible to make one item give a buff AND teleport ..
 
Experienced Elementalist
Joined
Nov 9, 2011
Messages
264
Reaction score
54
Lemoniscool, i personally havent tried it out yet, however why not a trigger on _inventory for refitemid from _items?

Also, there isn't actually a need of disconnecting the chars. Teleportation should work alright shouldnt it?
Yep, tp works fine :)
 
In the Emperor name
Loyal Member
Joined
Jun 25, 2011
Messages
1,605
Reaction score
238
use any teleport or any teleport scroll, and teleport to same place or another place
 
In the Emperor name
Loyal Member
Joined
Jun 25, 2011
Messages
1,605
Reaction score
238
replace return -3 for
set @NewJobID = @@identity
return @NewJobID
 
Joined
Aug 18, 2012
Messages
511
Reaction score
174
replace return -3 for
set @NewJobID = @@identity
return @NewJobID

sorry i didn't get it
PHP:
if(@JobID = '35046') -- Pk Remover 
        begin 
            Update _Char Set DailyPK = 0, TotalPK = 0, PKPenaltyPoint = 0 Where CharID = @CharID 
            return -3 
        end
Tell me or re-send to me again
Thanks again ^^
 
In the Emperor name
Loyal Member
Joined
Jun 25, 2011
Messages
1,605
Reaction score
238
if(@JobID = '35046') -- Pk Remover
begin
Update _Char Set DailyPK
= 0, TotalPK = 0, PKPenaltyPoint = 0 Where CharID = @CharID
set @NewJobID = @@identity
return @NewJobID
end


like this
 
Joined
Aug 18, 2012
Messages
511
Reaction score
174
Msg 137, Level 15, State 1, Procedure _AddTimedJob, Line 57
Must declare the scalar variable "@NewJobID".
Msg 137, Level 15, State 2, Procedure _AddTimedJob, Line 58
Must declare the scalar variable "@NewJobID".


i got this when i execute
 
In the Emperor name
Loyal Member
Joined
Jun 25, 2011
Messages
1,605
Reaction score
238
my bad, leave it this way:

if(@JobID = '35046') -- Pk Remover
begin
Update _Char Set DailyPK
= 0, TotalPK = 0, PKPenaltyPoint = 0 Where CharID = @CharID
end

 
Back
Top