ThyroDree 3 Posted March 26, 2020 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" Quote Share this post Link to post Share on other sites
0 Zarbony 1 Posted March 27, 2020 (edited) Hey, i think this will work like that... Just an Freestyle Script in this Forum Code snippet 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 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 - 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 March 27, 2020 by Zarbony 1 ThyroDree reacted to this Quote Share this post Link to post Share on other sites
0 ThyroDree 3 Posted March 30, 2020 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 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 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 - 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) Quote Share this post Link to post Share on other sites
0 Zarbony 1 Posted March 30, 2020 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; } Quote Share this post Link to post Share on other sites
1 Patskie 88 Posted April 11, 2020 (edited) - 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 April 11, 2020 by Patskie 1 ThyroDree reacted to this Quote Share this post Link to post Share on other sites
0 sootil 0 Posted April 15, 2020 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! Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted April 15, 2020 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". Quote Share this post Link to post Share on other sites
0 sootil 0 Posted April 16, 2020 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! Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted April 17, 2020 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; } Quote Share this post Link to post Share on other sites
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