Item Shower around player

ThyroDree

New member
Messages
556
Points
0
Location
Philippines
Github
bosxkate23
Emulator
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"

 
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
 

Code:
-	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;
                                        
}
 
Last edited by a moderator:
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

Code:
[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)
 
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

Code:
-	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;
                                        
}
 
Code:
-	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;
}
 
Last edited by a moderator:
- 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!

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

 
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!
Code:
-	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;
}
 
Back
Top