Jayz Posted August 31, 2020 Posted August 31, 2020 Can the "killedrid" be used instead of the mob id to be job id? or want another way or idea Quote
0 sader1992 Posted August 31, 2020 Posted August 31, 2020 what do you mean by job id ? you want the job id of the player who is killed ? you can do readparam() OnPCKillEvent: debugmes "" + readparam(Class,convertpcinfo(killedrid,CPC_CHAR)); end; readparam(Class,convertpcinfo(killedrid,CPC_CHAR)) will return the class of the killed if it's a player ofc , hint OnPCKillEvent 1 1 Quote
0 Jayz Posted August 31, 2020 Author Posted August 31, 2020 16 minutes ago, sader1992 said: what do you mean by job id ? you want the job id of the player who is killed ? you can do readparam() OnPCKillEvent: debugmes "" + readparam(Class,convertpcinfo(killedrid,CPC_CHAR)); end; readparam(Class,convertpcinfo(killedrid,CPC_CHAR)) will return the class of the killed if it's a player ofc , hint OnPCKillEvent Great thank you btw it possible certain class job? Quote
0 sader1992 Posted August 31, 2020 Posted August 31, 2020 2 hours ago, Zack- said: Great thank you btw it possible certain class job? I didn't understand The player's class is his job id Quote
0 Jayz Posted August 31, 2020 Author Posted August 31, 2020 (edited) 1 hour ago, sader1992 said: I didn't understand The player's class is his job id Sorry if you did not understand what I said, I want to make a pvp event challenge and the challenge will kill specific jobs like kill 5 assassin cross or kill 1 sniper / high wizard etc. I want to know how he can kill count every job Edited August 31, 2020 by Zack- Quote
0 Patskie Posted August 31, 2020 Posted August 31, 2020 You have to add up something like this OnPCKillEvent: .@self = getcharid(3); if (killedrid == .@self) end; attachrid killedrid; .@class = Class; attachrid .@self; .@index = inarray(class_arr, .@class); if (.@index == -1) { .@size = getarraysize(class_arr); class_arr[.@size] = .@class; count_arr[.@size] = 1; } else cleararray count_arr[.@index], count_arr[.@index] + 1, 1; end; and then you can create npc to fetch all the details like below .@size = getarraysize(class_arr); if (!.@size) mes "No data"; else { mes "Your kills per class"; for (.@i = 0; .@i < .@size; .@i++) mes "> Job:" + jobname(class_arr[.@i]) + " | Kill Count:" + count_arr[.@i]; } close; 1 Quote
0 Jayz Posted August 31, 2020 Author Posted August 31, 2020 11 hours ago, Patskie said: You have to add up something like this OnPCKillEvent: .@self = getcharid(3); if (killedrid == .@self) end; attachrid killedrid; .@class = Class; attachrid .@self; .@index = inarray(class_arr, .@class); if (.@index == -1) { .@size = getarraysize(class_arr); class_arr[.@size] = .@class; count_arr[.@size] = 1; } else cleararray count_arr[.@index], count_arr[.@index] + 1, 1; end; and then you can create npc to fetch all the details like below .@size = getarraysize(class_arr); if (!.@size) mes "No data"; else { mes "Your kills per class"; for (.@i = 0; .@i < .@size; .@i++) mes "> Job:" + jobname(class_arr[.@i]) + " | Kill Count:" + count_arr[.@i]; } close; I see. im gonna try thank you Quote
0 Jayz Posted September 2, 2020 Author Posted September 2, 2020 On 8/31/2020 at 6:55 PM, Patskie said: You have to add up something like this OnPCKillEvent: .@self = getcharid(3); if (killedrid == .@self) end; attachrid killedrid; .@class = Class; attachrid .@self; .@index = inarray(class_arr, .@class); if (.@index == -1) { .@size = getarraysize(class_arr); class_arr[.@size] = .@class; count_arr[.@size] = 1; } else cleararray count_arr[.@index], count_arr[.@index] + 1, 1; end; and then you can create npc to fetch all the details like below .@size = getarraysize(class_arr); if (!.@size) mes "No data"; else { mes "Your kills per class"; for (.@i = 0; .@i < .@size; .@i++) mes "> Job:" + jobname(class_arr[.@i]) + " | Kill Count:" + count_arr[.@i]; } close; Its working, btw can you give me an idea how can i make it similar here OnNPCKillEvent: if( killedrid == 1002 ){ set #PoringKill,#PoringKill + 1; end; Quote
0 Jayz Posted September 2, 2020 Author Posted September 2, 2020 1 hour ago, Patskie said: OnNPCKillEvent is for monster. Yah thanks for correction, everything is working fine and im using it now, i try to edit your code 4 hours ago, Zack- said: OnNPCKillEvent: if( killedrid == 1002 ){ set #PoringKill,#PoringKill + 1; end; i want to make similar this i tried to modified your code and change the Class to JobID 4010 and class_arr[.@size] = .@class; to class_arr[.@size] = .@class, set #HWPoints,#HWPoints +1; but not working - script test123 -1,{ OnPCKillEvent: .@self = getcharid(3); if (killedrid == .@self) end; attachrid killedrid; .@class = 4010; attachrid .@self; .@index = inarray(class_arr, .@class); if (.@index == -1) { .@size = getarraysize(class_arr); class_arr[.@size] = .@class, set #HWPoints,#HWPoints + 1; count_arr[.@size] = 1; } else cleararray count_arr[.@index], count_arr[.@index] + 1, 1; end; } Quote
Question
Jayz
Can the "killedrid" be used instead of the mob id to be job id? or want another way or idea
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.