Jump to content
  • 0

Reque auto get item when killed mob


PapaZola

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

hello how i can make automatic get item on eventory when kill mob example id 2200 & 2201

will get yggdrasil berry & poring coin

 

Link to comment
Share on other sites

22 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


OnNPCKillEvent:

if( killedrid == 2200 || killedrid == 2201 ){

    getitem 607,1;

    getitem 7539,1;

}

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

thanks emistry

:)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

how about when a party kills a mob (ex. boss) every party member will get  item "itemID"..

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


getpartymember getcharid(1),2;

for( .@i = 0; .@i < $@partymembercount; .@i++ )

getitem 607,1,$@partymemberaid[.@i];

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

-    script    baklakadung    -1,{
 
OnNPCKillEvent:
if( killedrid == 2200 || killedrid == 2201 ){
getpartymember getcharid(1),2;
for( .@i = 0; .@i < $@partymembercount; .@i++ )
    getitem 607,1,$@partymemberaid[.@i];
}
end;
}
 

something like this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

getpartymember getcharid(1),2;
for( .@i = 0; .@i < $@partymembercount; .@i++ )
	getitem 607,1,$@partymemberaid[.@i];
end;	

 

hellow emistry, a little bump from me

 

theres a little problem on the script you gave to me about the party, it gives also items to players which are not on same map as the killed mob, and how can i make it give items only to those who are also alive

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

-	script	#sample	-1,{

OnNPCKillEvent:

if (killedrid == 2200 || killedrid == 2201) {

set .@map$, strcharinfo(3);

getpartymember getcharid(1),2;

for (set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) {

if (attachrid($@partymemberaid[.@i])) {

if (strcharinfo(3) == .@map$ && Hp > 0)

getitem 607,1;

detachrid;

}

}

}

end;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

like this will do too..

 

getpartymember getcharid(1);
for( .@i = 0; .@i < $@partymembercount; .@i++ ){
	getmapxy( .@map$,.@x,.@y,$@partymembername$[.@i],0 );
	if( .@map$ == "map" ){
		getitem 607,1,getcharid( 3,$@partymembername$[.@i] );
	}
}
end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@Emistry: There's no way to check if a player is alive without attaching their RID.

and how can i make it give items only to those who are also alive

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

thanks mr.tyranitar /pat  & Emistry for always helping

 

@off emistry can you check your Advanced Stylist (read my last post)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@Euphy

Your script doesn't prevent multi char with the same account in the party

 

-	script	#sample	-1,{
OnNPCKillEvent:
	if (killedrid == 2200 || killedrid == 2201) {
		set .@map$, strcharinfo(3);
		getpartymember getcharid(1),1;
		getpartymember getcharid(1),2;
		for (set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) {
			if ( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) ) {
				attachrid($@partymemberaid[.@i]);
				if (strcharinfo(3) == .@map$ && Hp > 0)
					getitem 607,1;
				detachrid;
			}
		}
	}
	end;
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

wah. if we want to see many mob. so have to write many ? 

 

killedrid == 2200 || killedrid == 2201

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

wah. if we want to see many mob. so have to write many ? 

 

killedrid == 2200 || killedrid == 2201

Yes

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

@Euphy

Your script doesn't prevent multi char with the same account in the party

nice one, very keen, that would be very much abused if not checked

 

any potential for this being on the custom script or event script? simple but usefu

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Euphy

Your script doesn't prevent multi char with the same account in the party

i dont think this is needed....it's impossible for you to login 2 characters within the same account at the same times.

so, i believe this part can be skipped.

 

 

 

wah. if we want to see many mob. so have to write many ? 

 

killedrid == 2200 || killedrid == 2201

you can set an array for it.

like this

http://pastebin.com/raw.php?i=buDg5PJY

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@Euphy

Your script doesn't prevent multi char with the same account in the party

i dont think this is needed....it's impossible for you to login 2 characters within the same account at the same times.

so, i believe this part can be skipped.

It's possible to invite 2 characters of the same account in the same party, sure both of them can't be online at the same time

So the script attachrid the same account id twice

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

@Euphy

Your script doesn't prevent multi char with the same account in the party

i dont think this is needed....it's impossible for you to login 2 characters within the same account at the same times.

so, i believe this part can be skipped.

 

did i read/get it wrong? i thought Capuche's additional check prevents dual client users from getting more than one item (like single pc, with 2 different account ofcourse playing on same party will only get 1 item)

.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

did i read/get it wrong? i thought Capuche's additional check prevents dual client users from getting more than one item (like single pc, with 2 different account ofcourse playing on same party will only get 1 item)

You get wrong. It doesn't prevent dual client, it prevents multi char from the same account in the same party to get multi items

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

so checks in acquiring item are now like this?

 

1. if mob is in the list

2. if the player is on same map as the killed monster

3. if hp>0 (alive)

4. if 2 or more chars (single account) is on same party - prevent from getting two or more items

 

can we add one more check like this?

 if 2 or more chars/account (single pc) on same party - prevent getting more that one item (priority is the 1st invited)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

-	script	#sample	-1,{
OnNPCKillEvent:
	if (killedrid == 2200 || killedrid == 2201) {
		set .@map$, strcharinfo(3);
		getpartymember getcharid(1),2;
		for (set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) {
			if ( attachrid($@partymemberaid[.@i]) && !compare( .@ip$,getcharip( $@partymemberaid[.@i] ) ) ) {
				.@ip$ = .@ip$ +"|"+ getcharip();// !! config 15 players max in the party
				if (strcharinfo(3) == .@map$ && Hp > 0)
					getitem 607,1;
				detachrid;
			}
		}
	}
	end;
}

+ prevent dual account from getting more than 1 item

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

-	script	#sample	-1,{
OnNPCKillEvent:
	if (killedrid == 2200 || killedrid == 2201) {
		set .@map$, strcharinfo(3);
		getpartymember getcharid(1),2;
		for (set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) {
			if ( attachrid($@partymemberaid[.@i]) && !compare( .@ip$,getcharip( $@partymemberaid[.@i] ) ) ) {
				.@ip$ = .@ip$ +"|"+ getcharip();// !! config 15 players max in the party
				if (strcharinfo(3) == .@map$ && Hp > 0)
					getitem 607,1;
				detachrid;
			}
		}
	}
	end;
}

+ prevent dual account from getting more than 1 item

 

last question, so it's ip check? how about if my players are playing on a net cafe (ex: 10 players), only one of them get an item?

 

i only want to prevent dual client users from one single pc to get more than one item.

 

thanks Capuche

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

last question, so it's ip check? how about if my players are playing on a

net cafe (ex: 10 players), only one of them get an item?

Yes only one of them get an item if they have the same ip

 

i only want to prevent dual client users from one single pc to get more than one item.

Sorry I don't know other way than check the ip to prevent dual client with script commands

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...