Jump to content
  • 0

Looking for clarification on "killedrid"


Jayz

Question


  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  395
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

Can the "killedrid" be used instead of the mob id to be job id? or want another way or idea

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

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

  • Upvote 1
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  395
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

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?

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  395
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

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 by Zack-
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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;

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  395
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  395
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

OnNPCKillEvent is for monster. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  395
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

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;
	}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...