Jump to content
  • 0
behemothcze

item shower

Question

-	script	Sample	-1,{
	OnInit:
		set .amount, 40; // amount of item to shower
		set .item_id, 7227; // item id to shower
		set .item_id2, 1234; // next item id to shower
		set .map$, "prontera"; // map to shower
		bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";
		end;
	OnShower:
		while ( .count < .amount ) {
			do {
				.@x = rand(1,500);
				.@y = rand(1,500);
			} while (!checkcell(.map$,.@x,.@y,cell_chkpass));
			.@var = rand(2);
			makeitem .@var?.item_id:.item_id2,1,.map$,.@x,.@y;
			set .count, .count + 1;
		}
		set .count, 0;
		end;
}

 

 

can anyone change this to area only where i use @itemshower instead of random area thanks.

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 1

-	script	Sample	-1,{
	OnInit:
		set .amount, 40; // amount of item to shower
		set .item_id, 7227; // item id to shower
		set .item_id2, 1234; // next item id to shower
		bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";
		end;
	OnShower:

		getmapxy [email protected]$, [email protected], [email protected], UNITTYPE_PC;

		while ( .count < .amount ) {
			do {
				[email protected]_diff = [email protected] + rand(1,5);
				[email protected]_diff = [email protected] + rand(1,5);
			} while (!checkcell([email protected]$,[email protected]_diff,[email protected]_diff,cell_chkpass));
			[email protected] = rand(2);
			makeitem [email protected]?.item_id:.item_id2,1,[email protected]$,[email protected]_diff,[email protected]_diff;
			set .count, .count + 1;
		}
		set .count, 0;
		end;

This will make the command @itemshow  ... start with the characters position, then it will consider a differential between 1 and 5 from their X,Y coordinates to "shower" around them...

 

  • Upvote 1
Link to comment
Share on other sites

  • 0
-	script	Sample	-1,{
	OnInit:
		set .amount, 40; // amount of item to shower
		set .item_id, 7227; // item id to shower
		set .item_id2, 1234; // next item id to shower
		bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";
		end;
	OnShower:

		getmapxy [email protected]$, [email protected], [email protected], UNITTYPE_PC;

		while ( .count < .amount ) {
			do {
				[email protected]_diff = [email protected] + rand(1,5);
				[email protected]_diff = [email protected] + rand(1,5);
			} while (!checkcell([email protected]$,[email protected]_diff,[email protected]_diff,cell_chkpass));
			[email protected] = rand(2);
			makeitem [email protected]?.item_id:.item_id2,1,.map$,[email protected],[email protected];
			set .count, .count + 1;
		}
		set .count, 0;
		end;

This will make the command @itemshow  ... start with the characters position, then it will consider a differential between 1 and 5 from their X,Y coordinates to "shower" around them...

Edited by Z3R0
Link to comment
Share on other sites

  • 0
19 hours ago, Z3R0 said:
-	script	Sample	-1,{
	OnInit:
		set .amount, 40; // amount of item to shower
		set .item_id, 7227; // item id to shower
		set .item_id2, 1234; // next item id to shower
		bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";
		end;
	OnShower:

		getmapxy [email protected]$, [email protected], [email protected], UNITTYPE_PC;

		while ( .count < .amount ) {
			do {
				[email protected]_diff = [email protected] + rand(1,5);
				[email protected]_diff = [email protected] + rand(1,5);
			} while (!checkcell([email protected]$,[email protected]_diff,[email protected]_diff,cell_chkpass));
			[email protected] = rand(2);
			makeitem [email protected]?.item_id:.item_id2,1,.map$,[email protected],[email protected];
			set .count, .count + 1;
		}
		set .count, 0;
		end;

This will make the command @itemshow  ... start with the characters position, then it will consider a differential between 1 and 5 from their X,Y coordinates to "shower" around them...

where can i edit the character position ?

Link to comment
Share on other sites

  • 0
2 hours ago, AnnieRuru said:

why doesn't work ? /hmm

screenRuru_Server007.thumb.jpg.f42ce110ace565215fe0a02fe067cfe5.jpg

maybe change the (1,5) into (-5,5) will make it spawn around the player instead of top right position

and sometimes can infinite loop ... adding freeloop works

image.png.98e0df5b1932a59196fba4b6c070233f.png
igot this debug error everytime i use @itemshower 😞

Link to comment
Share on other sites

  • 0
3 hours ago, Z3R0 said:

Use the 2nd one I wrote, not the first... the first had a glitch in it... check all map variables.. make sure they match 😄

+1 thanks mate its working 🙂 hope you can teach me how to put some more items on it, just want to make it 4 and if its posible to control it drop
i mean for item 1 =20pcs item2=20pcs item3=30pcs item4=30pcs.

 

sorry for my bad english

Link to comment
Share on other sites

  • 0
On 4/27/2018 at 10:23 PM, Z3R0 said:

fyi, I think I missed a closing } at the bottom (but if I edit it, it screws up the code...)

hello sir, can you edit it command where only gm can used it. even a normal player can use that shower 

Link to comment
Share on other sites

  • 0

bindatcmd "itemshower",strnpcinfo(3)+"::OnShower", 99, 100;

doc
 

Quote

*bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};

This command will bind a NPC event label to an atcommand. Upon execution of the
atcommand, the user will invoke the NPC event label. Each atcommand is only allowed
one binding. If you rebind, it will override the original binding.
Note: The default level for atcommand is 0 while the default level for charcommand is 100.

 

Edited by AnnieRuru
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.