Jump to content
  • 0

item shower


DK77

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  06/30/17
  • Last Seen:  

hello guys , currently im using this itemshower script , but i want to make itemshower more than 2 item

here my example script

 

-    script    Sample    -1,{
    OnInit:
        set .amount, 10; // amount of item to shower
        set .item_id, 12903; // next item id to shower
        set .item_id2, 12904; // next item id to shower
        set .item_id3, 12905; // next item id to shower
        set .item_id4, 12906; // next item id to shower
        set .item_id5, 12907; // next item id to shower
        set .item_id6, 12908; // next item id to shower
        set .item_id7, 13576; // next item id to shower
        set .item_id8, 13584; // next item id to shower

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

        getmapxy .@map$, .@x, .@y, BL_PC;

        while ( .count < .amount ) {
            do {
                .@x_diff = .@x + rand(1,5);
                .@y_diff = .@y + rand(1,5);
            } while (!checkcell(.@map$,.@x_diff,.@y_diff,cell_chkpass));
            .@var = rand(2);
            makeitem .@var?.item_id:.item_id2,1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this
            set .count, .count + 1;
        }
        set .count, 0;
        end;
}

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

set .item_id, 12903; // next item id to shower

to

set .item_id1, 12903; // next item id to shower

and

.@var = rand(2);
makeitem .@var?.item_id:.item_id2,1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this

to

makeitem getd(".item_id" + rand(1,8)),1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this

 

 

And this is a better way to do your script

-	script	Sample	-1,{
OnInit:
	set .amount, 10; // amount of item to shower
	setarray .ItemID,12903,12904,12905,12906,12907,12908,13576,13584;
	.Size = getarraysize(.ItemID);

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

OnShower:
	getmapxy(.@map$, .@x, .@y, BL_PC);
	while ( .count < .amount ) {
		do {
			.@x_diff = .@x + rand(1,5);
			.@y_diff = .@y + rand(1,5);
		} while (!checkcell(.@map$,.@x_diff,.@y_diff,cell_chkpass));
		makeitem .ItemID[rand(.Size)],1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this
		set .count, .count + 1;
	}
	set .count, 0;
end;
}

 

 

btw "bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";" means any player can use the command

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  06/30/17
  • Last Seen:  

okay tq sir !

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.06
  • Content Count:  241
  • Reputation:   11
  • Joined:  08/12/20
  • Last Seen:  

On 5/15/2021 at 11:53 AM, sader1992 said:
set .item_id, 12903; // next item id to shower

to

set .item_id1, 12903; // next item id to shower

and

.@var = rand(2);
makeitem .@var?.item_id:.item_id2,1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this

to

makeitem getd(".item_id" + rand(1,8)),1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this

 

 

And this is a better way to do your script

-	script	Sample	-1,{
OnInit:
	set .amount, 10; // amount of item to shower
	setarray .ItemID,12903,12904,12905,12906,12907,12908,13576,13584;
	.Size = getarraysize(.ItemID);

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

OnShower:
	getmapxy(.@map$, .@x, .@y, BL_PC);
	while ( .count < .amount ) {
		do {
			.@x_diff = .@x + rand(1,5);
			.@y_diff = .@y + rand(1,5);
		} while (!checkcell(.@map$,.@x_diff,.@y_diff,cell_chkpass));
		makeitem .ItemID[rand(.Size)],1,.@map$,.@x_diff,.@y_diff;   // <<< im stuck on this
		set .count, .count + 1;
	}
	set .count, 0;
end;
}

 

 

btw "bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";" means any player can use the command

Hi @sader1992, just wanting to know how'd you enable the canShowEffect option on makeitem script command? I've tried True,Enable,1,dropEffect words trying to enable it but failed.

makeitem <item id>,<amount>,"<map name>",<X>,<Y>{,<canShowEffect>};

EDIT: Fixed, updated my emu

Edited by Almond Snicker
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...