Jump to content
  • 0
ThyroDree

Item Shower around player

Question

Hello, anyone can help me edit this?

This is from Patskie

https://pastebin.com/raw/aCAbAM1E

 

I think possible to make the shower is only around the gm? like setting how many cell far around the gm

and make the item customizable ingame like @itemshower "item","qty"

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hey, i think this will work like that...
Just an Freestyle Script in this Forum Code snippet :D
I hope it will work, this is my Fast Solution,

you can Improve this by Callfuncs to Config everything by typing the command once.

so you can Configure the Itemshower with the command itmshoconf

and let it rain with the command itemshower

 

the Items will Rain Around the Player Who use the command, so it isnt bind on an map.

 

The Command is only useable for GroupId 99 and Above so normal players wont see this in their command list :D

 

and in the Itemshower theres everytime an 1,7 random chance on whish place around the player who use the command the item will appear.

 

Please Test it before u use it and fix some errors :D
 

-	script	Sample	-1,{
	OnInit:
	bindatcmd "itemshower",strnpcinfo(0)+"::OnShower",99; //Fires The Configurated ItemShower
	bindatcmd "itmshoconf",strnpcinfo(0)+"::OnShowerC",99; //For Configurating the ItemShower
		end;

	OnShowerC:
		mes("Hey There, What would you do?");
		switch(select("Change Item ID","Change Shower amount","Change Item Quantity","Nothing, Boy!")){
			case 1:
					mes("Type in the Item ID!");
					input .itemidIS;
					next;
					mes("The Item with the ID "+.itemidIS+" would "+getitemname(.itemidIS)+" is this correct?");
					if(select("Yep!","Nope!")==1)close();
						set .itemidIS,0;
						close();
			case 2:
					mes("Type in the Shower amount!");
					input .amount;
					next;
					mes("The Item Shower will rain about "+.amount+" is this correct?");
					if(select("Yep!","Nope!")==2)close();
						set .amount,.amount+1;
						close();
			case 3:
					mes("Type in the Item Quantity every Item will Appear!");
					input .quantityIS;
					next;
					mes("The Item Shower will drop every time "+.quantityIS+" items is this correct?");
					if(select("Yep!","Nope!")==1)close();
						set .quantityIS,0;
						close();
			case 4:
				mes("Come back again if you need my help!Boy!");
				close();
				}
		end;

	OnShower:
	getmapxy(.@map$,.@mapx,.@mapy, UNITTYPE_PC, strcharinfo(0));
           	for(set .@i,0; .@i<.amount; .@i++){
                .@r = rand (1,7);
				if(.@r == 1){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy;
						sleep2 50;
               } else if(.@r == 2){             
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy;
						sleep2 50;
               } else if(.@r == 3){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy-1;
						sleep2 50;
              } else if(.@r == 4){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
						sleep2 50;
              } else if(.@r == 5){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy;
						sleep2 50;
              } else if(.@r == 6){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy+1;
						sleep2 50;
              } else if(.@r == 7){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
						sleep2 50;
                    }
              end;
		}
		end;
                                        
}

 

Edited by Zarbony

Share this post


Link to post
Share on other sites
  • 0
On 3/27/2020 at 12:02 PM, Zarbony said:

Hey, i think this will work like that...
Just an Freestyle Script in this Forum Code snippet :D
I hope it will work, this is my Fast Solution,

you can Improve this by Callfuncs to Config everything by typing the command once.

so you can Configure the Itemshower with the command itmshoconf

and let it rain with the command itemshower

 

the Items will Rain Around the Player Who use the command, so it isnt bind on an map.

 

The Command is only useable for GroupId 99 and Above so normal players wont see this in their command list :D

 

and in the Itemshower theres everytime an 1,7 random chance on whish place around the player who use the command the item will appear.

 

Please Test it before u use it and fix some errors :D
 

- script Sample -1,{ OnInit: bindatcmd "itemshower",strnpcinfo(0)+"::OnShower",99; //Fires The Configurated ItemShower bindatcmd "itmshoconf",strnpcinfo(0)+"::OnShowerC",99; //For Configurating the ItemShower end; OnShowerC: mes("Hey There, What would you do?"); switch(select("Change Item ID","Change Shower amount","Change Item Quantity","Nothing, Boy!")){ case 1: mes("Type in the Item ID!"); input .itemidIS; next; mes("The Item with the ID "+.itemidIS+" would "+getitemname(.itemidIS)+" is this correct?"); if(select("Yep!","Nope!")==1)close(); set .itemidIS,0; close(); case 2: mes("Type in the Shower amount!"); input .amount; next; mes("The Item Shower will rain about "+.amount+" is this correct?"); if(select("Yep!","Nope!")==2)close(); set .amount,.amount+1; close(); case 3: mes("Type in the Item Quantity every Item will Appear!"); input .quantityIS; next; mes("The Item Shower will drop every time "+.quantityIS+" items is this correct?"); if(select("Yep!","Nope!")==1)close(); set .quantityIS,0; close(); case 4: mes("Come back again if you need my help!Boy!"); close(); } end; OnShower: getmapxy(.@map$,.@mapx,.@mapy, UNITTYPE_PC, strcharinfo(0)); for(set .@i,0; .@i<.amount; .@i++){ .@r = rand (1,7); if(.@r == 1){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy; sleep2 50; } else if(.@r == 2){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy; sleep2 50; } else if(.@r == 3){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy-1; sleep2 50; } else if(.@r == 4){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1; sleep2 50; } else if(.@r == 5){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy; sleep2 50; } else if(.@r == 6){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy+1; sleep2 50; } else if(.@r == 7){ makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1; sleep2 50; } end; } end; }


-	script	Sample	-1,{
	OnInit:
	bindatcmd "itemshower",strnpcinfo(0)+"::OnShower",99; //Fires The Configurated ItemShower
	bindatcmd "itmshoconf",strnpcinfo(0)+"::OnShowerC",99; //For Configurating the ItemShower
		end;

	OnShowerC:
		mes("Hey There, What would you do?");
		switch(select("Change Item ID","Change Shower amount","Change Item Quantity","Nothing, Boy!")){
			case 1:
					mes("Type in the Item ID!");
					input .itemidIS;
					next;
					mes("The Item with the ID "+.itemidIS+" would "+getitemname(.itemidIS)+" is this correct?");
					if(select("Yep!","Nope!")==1)close();
						set .itemidIS,0;
						close();
			case 2:
					mes("Type in the Shower amount!");
					input .amount;
					next;
					mes("The Item Shower will rain about "+.amount+" is this correct?");
					if(select("Yep!","Nope!")==2)close();
						set .amount,.amount+1;
						close();
			case 3:
					mes("Type in the Item Quantity every Item will Appear!");
					input .quantityIS;
					next;
					mes("The Item Shower will drop every time "+.quantityIS+" items is this correct?");
					if(select("Yep!","Nope!")==1)close();
						set .quantityIS,0;
						close();
			case 4:
				mes("Come back again if you need my help!Boy!");
				close();
				}
		end;

	OnShower:
	getmapxy(.@map$,.@mapx,.@mapy, UNITTYPE_PC, strcharinfo(0));
           	for(set .@i,0; .@i<.amount; .@i++){
                .@r = rand (1,7);
				if(.@r == 1){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy;
						sleep2 50;
               } else if(.@r == 2){             
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy;
						sleep2 50;
               } else if(.@r == 3){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy-1;
						sleep2 50;
              } else if(.@r == 4){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
						sleep2 50;
              } else if(.@r == 5){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy;
						sleep2 50;
              } else if(.@r == 6){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy+1;
						sleep2 50;
              } else if(.@r == 7){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
						sleep2 50;
                    }
              end;
		}
		end;
                                        
}

 

Hi! I just tried this~ itemshower configure works

but itemshower trigger isn't

I got this error

 


[Debug]: mapindex_name2id: Map "" not found in index list!
[Error]: makeitem: creating map on unexistent map ''!
[Debug]: Source (NPC): showerdrop (invisible/not on a map)

 

Share this post


Link to post
Share on other sites
  • 0
8 hours ago, ThyroDree said:

Hi! I just tried this~ itemshower configure works

but itemshower trigger isn't

I got this error

 

[Debug]: mapindex_name2id: Map "" not found in index list! [Error]: makeitem: creating map on unexistent map ''! [Debug]: Source (NPC): showerdrop (invisible/not on a map)



[Debug]: mapindex_name2id: Map "" not found in index list!
[Error]: makeitem: creating map on unexistent map ''!
[Debug]: Source (NPC): showerdrop (invisible/not on a map)

 

Oh, found the error, thats why i told you to fix some issues :X

just replace 

 

.@map$ with .@mapname$ then it should work :X

 

-	script	Sample	-1,{
	OnInit:
	bindatcmd "itemshower",strnpcinfo(0)+"::OnShower",99; //Fires The Configurated ItemShower
	bindatcmd "itmshoconf",strnpcinfo(0)+"::OnShowerC",99; //For Configurating the ItemShower
		end;

	OnShowerC:
		mes("Hey There, What would you do?");
		switch(select("Change Item ID","Change Shower amount","Change Item Quantity","Nothing, Boy!")){
			case 1:
					mes("Type in the Item ID!");
					input .itemidIS;
					next;
					mes("The Item with the ID "+.itemidIS+" would "+getitemname(.itemidIS)+" is this correct?");
					if(select("Yep!","Nope!")==1)close();
						set .itemidIS,0;
						close();
			case 2:
					mes("Type in the Shower amount!");
					input .amount;
					next;
					mes("The Item Shower will rain about "+.amount+" is this correct?");
					if(select("Yep!","Nope!")==2)close();
						set .amount,.amount+1;
						close();
			case 3:
					mes("Type in the Item Quantity every Item will Appear!");
					input .quantityIS;
					next;
					mes("The Item Shower will drop every time "+.quantityIS+" items is this correct?");
					if(select("Yep!","Nope!")==1)close();
						set .quantityIS,0;
						close();
			case 4:
				mes("Come back again if you need my help!Boy!");
				close();
				}
		end;

	OnShower:
	getmapxy(.@mapname$,.@mapx,.@mapy, UNITTYPE_PC, strcharinfo(0));
           	for(set .@i,0; .@i<.amount; .@i++){
                .@r = rand (1,7);
				if(.@r == 1){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy;
						sleep2 50;
               } else if(.@r == 2){             
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy;
						sleep2 50;
               } else if(.@r == 3){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy-1;
						sleep2 50;
              } else if(.@r == 4){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
						sleep2 50;
              } else if(.@r == 5){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy;
						sleep2 50;
              } else if(.@r == 6){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy+1;
						sleep2 50;
              } else if(.@r == 7){
						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
						sleep2 50;
                    }
              end;
		}
		end;
                                        
}

 

Share this post


Link to post
Share on other sites
  • 1
-	script	asdfh	FAKE_NPC,{
	OnCmd:
		if (!.@atcmd_numparameters || .@atcmd_numparameters != 2) {
			message strcharinfo(0), "Usage: @itemshower <item_id> <item_quantity>";
			end;
		}
		.@item = atoi(.@atcmd_parameters$[0]);
		.@q = atoi(.@atcmd_parameters$[1]);
		if (!.@q || getitemname(.@item) == "null") {
			message strcharinfo(0), "Invalid item/amount";
			end;
		}
		getmapxy .@map$, .@x, .@y, UNITTYPE_PC;
		.@i = 0;
		while (.@i < .@q) {
			do {
				.@a = rand(.@x, .@x+200);
				.@b = rand(.@y, .@y+200);
			} while (!checkcell(.@map$, .@a, .@b, cell_chkpass));
			makeitem .@item, 1, .@map$, .@a, .@b;
			.@i++;
		}
		end;
		
	OnInit:
		bindatcmd "itemshower", strnpcinfo(3) + "::OnCmd", 99, 99, true;
		end;
}


 

Edited by Patskie

Share this post


Link to post
Share on other sites
  • 0
On 4/11/2020 at 11:03 PM, Patskie said:

- script asdfh FAKE_NPC,{ OnCmd: if (!.@atcmd_numparameters || .@atcmd_numparameters != 2) { message strcharinfo(0), "Usage: @itemshower <item_id> <item_quantity>"; end; } .@item = atoi(.@atcmd_parameters$[0]); .@q = atoi(.@atcmd_parameters$[1]); if (!.@q || getitemname(.@item) == "null") { message strcharinfo(0), "Invalid item/amount"; end; } getmapxy .@map$, .@x, .@y, UNITTYPE_PC; .@i = 0; while (.@i < .@q) { do { .@a = rand(.@x, .@x+200); .@b = rand(.@y, .@y+200); } while (!checkcell(.@map$, .@a, .@b, cell_chkpass)); makeitem .@item, 1, .@map$, .@a, .@b; .@i++; } end; OnInit: bindatcmd "itemshower", strnpcinfo(3) + "::OnCmd", 99, 99, true; end; }


-	script	asdfh	FAKE_NPC,{
	OnCmd:
		if (!.@atcmd_numparameters || .@atcmd_numparameters != 2) {
			message strcharinfo(0), "Usage: @itemshower <item_id> <item_quantity>";
			end;
		}
		.@item = atoi(.@atcmd_parameters$[0]);
		.@q = atoi(.@atcmd_parameters$[1]);
		if (!.@q || getitemname(.@item) == "null") {
			message strcharinfo(0), "Invalid item/amount";
			end;
		}
		getmapxy .@map$, .@x, .@y, UNITTYPE_PC;
		.@i = 0;
		while (.@i < .@q) {
			do {
				.@a = rand(.@x, .@x+200);
				.@b = rand(.@y, .@y+200);
			} while (!checkcell(.@map$, .@a, .@b, cell_chkpass));
			makeitem .@item, 1, .@map$, .@a, .@b;
			.@i++;
		}
		end;
		
	OnInit:
		bindatcmd "itemshower", strnpcinfo(3) + "::OnCmd", 99, 99, true;
		end;
}


 

Good day Sir! I'm just wondering is this the same as Giving out items in an entire map? or just the players around the GM? Please enlighten me. I'm looking for a command that will give out items to every players online in a specific map. Newbie here! Thanks you so much!

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, sootil said:

Good day Sir! I'm just wondering is this the same as Giving out items in an entire map? or just the players around the GM? Please enlighten me. I'm looking for a command that will give out items to every players online in a specific map. Newbie here! Thanks you so much!

 

The request says "around the gm". 

Share this post


Link to post
Share on other sites
  • 0
6 hours ago, Patskie said:

 

The request says "around the gm". 

Thanks for the immediate response Sir, may I ask how can I make it for an entire map rather than just around the GM? Thank you so much!

 

Share this post


Link to post
Share on other sites
  • 0
On 4/16/2020 at 8:01 AM, sootil said:

Thanks for the immediate response Sir, may I ask how can I make it for an entire map rather than just around the GM? Thank you so much!

 

-	script	asdfh	FAKE_NPC,{
	OnCmd:
		if (!.@atcmd_numparameters || .@atcmd_numparameters != 2) {
			message strcharinfo(0), "Usage: @itemshower <item_id> <item_quantity>";
			end;
		}
		.@item = atoi(.@atcmd_parameters$[0]);
		.@q = atoi(.@atcmd_parameters$[1]);
		if (!.@q || getitemname(.@item) == "null") {
			message strcharinfo(0), "Invalid item/amount";
			end;
		}
		.@i = 0;
		while (.@i < .@q) {
			do {
				.@x = rand(1000, 1000);
				.@y = rand(1000, 1000);
			} while (!checkcell(.@map$, .@x, .@y, cell_chkpass));
			makeitem .@item, 1, .@map$, .@x, .@y;
			.@i++;
		}
		end;
		
	OnInit:
		bindatcmd "itemshower", strnpcinfo(3) + "::OnCmd", 99, 99, true;
		end;
}

 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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