Jump to content
  • 0

Gacha Pull - Sink Zeny System


Eternity

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/01/12
  • Last Seen:  

Dear All,

I took and modify the script below for gacha pull @500.000 z for each pull and gain reward as described.
I want to modify the npc so we can customize the number of pull and charged based on the number of pull
Need to add check of the zeny as well to check if zeny amount owned is sufficient.

So the flow will be
npc init -> show the dialog -> how many pull ? -> Insert number -> Check zeny -> Give reward based on how many pull

I hope anyone can help to modify the script or you also may contribute to revamp the script.

 

xxx,167,163,4	script	Lotto	72,{
	mes "[Lotto]";
	mes "I'm Lotto! I'll exchange";
	mes "Random Prizes for every";
	mes "^ff0000500,000 zeny^000000.";
	next;
	mes "[Lotti Girl]";
	mes "Our Grand prize is:";
	mes "^ff0000 x1 TCG Card^000000";
	mes "^ff0000 x1 Costume set^000000";
	mes "Consolations are:";
	mes "^ff0000 x?? Gold Coin^000000";
	mes "^ff0000 x?? Gold^000000";
	mes "^ff0000 x?? Treasure Box^000000";
	mes "^ff0000 x?? Oridecon^000000";
	mes "^ff0000 x?? Elunium^000000";
	mes "And many more!!";
	if (Zeny < 500000)
		close;
	next;
	if(select("Let's Do This!!:No thanks...")==2) close;
	mes "[Lotti Girl]";
	mes "Here we go...";
	set Zeny, Zeny - 500000;
	set .@Total,15;
	//<%>,<ItemID>,<Amount>
	setarray .@P1[0],1,35031,1; //demoniac mid
	setarray .@P2[0],1,35081,1; //demoniac upper
	setarray .@P3[0],1,35099,1; //demoniac low
	setarray .@P4[0],2,7227,1; //tcg
	setarray .@P5[0],5,7539,rand(1,2); //diablocoin
	setarray .@P6[0],8,969,rand(1,3); //gold
	setarray .@P7[0],10,604,rand(1,3); //deadbranch
	setarray .@P8[0],8,7444,rand(1,3); //treasurebox
	setarray .@P9[0],8,12208,rand(1,2); //battle manual
	setarray .@P10[0],20,985,rand(3,8); //elu
	setarray .@P11[0],25,7063,rand(2,5); //alice apron
	setarray .@P12[0],25,7047,rand(2,5); // soft feather
	setarray .@P13[0],20,984,rand(3,8); //ori
	setarray .@P14[0],15,748,rand(1,3); //witherless
	setarray .@Default[0],rand(901,926),rand(5,15);
	set .@i, rand(1,.@Total);
	if (rand(1,100) > getd(".@P"+.@i+"[0]"))
	{
		for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2)
		{
			getitem .@Default[.@j], .@Default[.@j+1];
			if(!.@k[0])
				setarray .@k[0], .@Default[.@j], .@Default[.@j+1];
		}
	}
	else{
		for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2)
		{
			getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
			if (!.@k[0])
			{
				set .@gz,.@i;
				setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
				break;
			}
		}
	}
	if(1<=.@gz&&.@gz<=4)
		announce "Hey! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl!",0;
	specialeffect2 248;
	close;
	
	OnInit:
	delwaitingroom;
	waitingroom "Try your Luck?",0;
	end;
}

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

prontera,167,163,4	script	Lotto Girl	72,{
    mes "[ " + .npc_name$ + " ]";
    mes "I'm " + .npc_name$ + "! I'll exchange";
    mes "Random Prizes for every";
    mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000.";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Our Grand prize is:";
    mes "^ff0000 x1 TCG Card^000000";
    mes "^ff0000 x1 Costume set^000000";
    mes "Consolations are:";
    mes "^ff0000 x?? Gold Coin^000000";
    mes "^ff0000 x?? Gold^000000";
    mes "^ff0000 x?? Treasure Box^000000";
    mes "^ff0000 x?? Oridecon^000000";
    mes "^ff0000 x?? Elunium^000000";
    mes "And many more!!";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Do you want to pull?";
    next;
    if(select("Sure!:No.") == 2) {
        mes "[ " + .npc_name$ + " ]";
        mes "Come back if you change";
        mes "your mind.";
        close;
    }

    mes "[ " + .npc_name$ + " ]";
    mes "How many pulls do you want?";
    next;
    .@range = input(.@pullAmt, .min_pulls, .max_pulls);

    if(.@range != 0) {
        mes "[ " + .npc_name$ + " ]";
        mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls)  + ".";
        close;
    }

    if (Zeny < .pull_price * .@pullAmt) {
        mes "[ " + .npc_name$ + " ]";
        mes "You don't have enough zeny.";
        close;
    }     

    freeloop(1);
    for(.@i = 0; .@i < .@pullAmt; .@i++) {
        if (Weight * 100 / MaxWeight >= .weight_cap) {
            mes "[ " + .npc_name$ + " ]";
            mes "You can't do anymore";
            mes "pulls because you are";
            mes "nearing your weight limit";
            close;
        }

        Zeny -= .pull_price;
        .@priceNo = rand(0, getarraysize(.prices) - 1);
        .@priceIdx = .@priceNo * 4;

        if (rand(1, 100) <= .prices[.@priceIdx]) {
            .@itemId = .prices[.@priceIdx + 1];
            .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]);

            if(.prices[.@priceIdx] <= .announce_limit) {
                announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all);
                specialeffect2(248);
            }
        } else {
            .@itemId = rand(.default[0], .default[1]);
            .@itemAmt = rand(.default[2], .default[3]);
        }

        getitem(.@itemId, .@itemAmt);
    }
    freeloop(0);

    mes "[ " + .npc_name$ + " ]";
    mes "Here you go!";
    close;
    
    OnInit:
        .npc_name$ = strnpcinfo(1);
        .pull_price = 50000;
        .announce_limit = 5;
        .weight_cap = 90;
        .min_pulls = 1;
        .max_pulls = 500;

        //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount>
        setarray(.prices[0], 
            1, 35031, 1, 1, // demoniac mid
            1, 35081, 1, 1, // demoniac upper
            1, 35099, 1, 1, // demoniac low
            2, 7227, 1, 1, // tcg
            5, 7539, 1, 2, // diablo coin
            8, 969, 1, 3, // gold
            10, 604, 1, 3, // deadbranch
            8, 7444, 1, 3, // treasurebox
            8, 12208, 1, 2, // battle manual
            20, 985, 3, 8, // elu
            25, 7063, 2, 5, // alice apron
            25, 7047, 2, 5, // soft feather
            20, 984, 3, 8, // ori
            15, 748, 1, 3 // witherless
        );

        //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount>
        setarray(.default[0], 901, 926, 5, 15);

        delwaitingroom;
        waitingroom("Try your Luck?", 0);
}

 

  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  862
  • Reputation:   115
  • Joined:  05/23/12
  • Last Seen:  

Do u want that the player will get more prices when he pay more Zeny?

As ex.:

Invest Zeny / 500.000 = amount or more random prices?

 

Or do u want that the player will have a higher chance to get better prices?

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/01/12
  • Last Seen:  

20 hours ago, Rynbef said:

Do u want that the player will get more prices when he pay more Zeny?

As ex.:

Invest Zeny / 500.000 = amount or more random prices?

 

Or do u want that the player will have a higher chance to get better prices?

 

Rynbef~

Yes, it's the number of pull, for example, 1 pull is 500.000 zeny then, 10 pulls is 5.000.000
The chances per pull are as described on script above.

I just want to customize the script so they can pull as many times as they want if they have the zeny without click the npc, again and again.
We can also use multiple option also whether it's 5 pulls/10 pulls/15 pulls/20 pulls, depend on the player have the zeny or not.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

prontera,167,163,4	script	Lotto Girl	72,{
    mes "[ " + .npc_name$ + " ]";
    mes "I'm " + .npc_name$ + "! I'll exchange";
    mes "Random Prizes for every";
    mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000.";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Our Grand prize is:";
    mes "^ff0000 x1 TCG Card^000000";
    mes "^ff0000 x1 Costume set^000000";
    mes "Consolations are:";
    mes "^ff0000 x?? Gold Coin^000000";
    mes "^ff0000 x?? Gold^000000";
    mes "^ff0000 x?? Treasure Box^000000";
    mes "^ff0000 x?? Oridecon^000000";
    mes "^ff0000 x?? Elunium^000000";
    mes "And many more!!";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Do you want to pull?";
    next;
    if(select("Sure!:No.") == 2) {
        mes "[ " + .npc_name$ + " ]";
        mes "Come back if you change";
        mes "your mind.";
        close;
    }

    mes "[ " + .npc_name$ + " ]";
    mes "How many pulls do you want?";
    next;
    .@range = input(.@pullAmt, .min_pulls, .max_pulls);

    if(.@range != 0) {
        mes "[ " + .npc_name$ + " ]";
        mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls)  + ".";
        close;
    }

    if (Zeny < .pull_price * .@pullAmt) {
        mes "[ " + .npc_name$ + " ]";
        mes "You don't have enough zeny.";
        close;
    }     

    freeloop(1);
    for(.@i = 0; .@i < .@pullAmt; .@i++) {
        if (Weight * 100 / MaxWeight >= .weight_cap) {
            mes "[ " + .npc_name$ + " ]";
            mes "You can't do anymore";
            mes "pulls because you are";
            mes "nearing your weight limit";
            close;
        }

        Zeny -= .pull_price;
        .@priceNo = rand(0, getarraysize(.prices) - 1);
        .@priceIdx = .@priceNo * 4;

        if (rand(1, 100) <= .prices[.@priceIdx]) {
            .@itemId = .prices[.@priceIdx + 1];
            .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]);

            if(.prices[.@priceIdx] <= .announce_limit) {
                announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all);
                specialeffect2(248);
            }
        } else {
            .@itemId = rand(.default[0], .default[1]);
            .@itemAmt = rand(.default[2], .default[3]);
        }

        getitem(.@itemId, .@itemAmt);
    }
    freeloop(0);

    mes "[ " + .npc_name$ + " ]";
    mes "Here you go!";
    close;
    
    OnInit:
        .npc_name$ = strnpcinfo(1);
        .pull_price = 50000;
        .announce_limit = 5;
        .weight_cap = 90;
        .min_pulls = 1;
        .max_pulls = 500;

        //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount>
        setarray(.prices[0], 
            1, 35031, 1, 1, // demoniac mid
            1, 35081, 1, 1, // demoniac upper
            1, 35099, 1, 1, // demoniac low
            2, 7227, 1, 1, // tcg
            5, 7539, 1, 2, // diablo coin
            8, 969, 1, 3, // gold
            10, 604, 1, 3, // deadbranch
            8, 7444, 1, 3, // treasurebox
            8, 12208, 1, 2, // battle manual
            20, 985, 3, 8, // elu
            25, 7063, 2, 5, // alice apron
            25, 7047, 2, 5, // soft feather
            20, 984, 3, 8, // ori
            15, 748, 1, 3 // witherless
        );

        //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount>
        setarray(.default[0], 901, 926, 5, 15);

        delwaitingroom;
        waitingroom("Try your Luck?", 0);
}

 

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/01/12
  • Last Seen:  

10 hours ago, Winterfox said:
prontera,167,163,4	script	Lotto Girl	72,{
    mes "[ " + .npc_name$ + " ]";
    mes "I'm " + .npc_name$ + "! I'll exchange";
    mes "Random Prizes for every";
    mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000.";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Our Grand prize is:";
    mes "^ff0000 x1 TCG Card^000000";
    mes "^ff0000 x1 Costume set^000000";
    mes "Consolations are:";
    mes "^ff0000 x?? Gold Coin^000000";
    mes "^ff0000 x?? Gold^000000";
    mes "^ff0000 x?? Treasure Box^000000";
    mes "^ff0000 x?? Oridecon^000000";
    mes "^ff0000 x?? Elunium^000000";
    mes "And many more!!";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Do you want to pull?";
    next;
    if(select("Sure!:No.") == 2) {
        mes "[ " + .npc_name$ + " ]";
        mes "Come back if you change";
        mes "your mind.";
        close;
    }

    mes "[ " + .npc_name$ + " ]";
    mes "How many pulls do you want?";
    next;
    .@range = input(.@pullAmt, .min_pulls, .max_pulls);

    if(.@range != 0) {
        mes "[ " + .npc_name$ + " ]";
        mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls)  + ".";
        close;
    }

    if (Zeny < .pull_price * .@pullAmt) {
        mes "[ " + .npc_name$ + " ]";
        mes "You don't have enough zeny.";
        close;
    }     

    freeloop(1);
    for(.@i = 0; .@i < .@pullAmt; .@i++) {
        if (ceil(Weight * 100 / MaxWeight) >= .weight_cap) {
            mes "[ " + .npc_name$ + " ]";
            mes "You can't do anymore";
            mes "pulls because you are";
            mes "nearing your weight limit";
            close;
        }

        Zeny -= .pull_price;
        .@priceNo = rand(0, getarraysize(.prices) - 1);
        .@priceIdx = .@priceNo * 4;

        if (rand(1, 100) <= .prices[.@priceIdx]) {
            .@itemId = .prices[.@priceIdx + 1];
            .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]);

            if(.prices[.@priceIdx] <= .announce_limit) {
                announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all);
                specialeffect2(248);
            }
        } else {
            .@itemId = rand(.default[0], .default[1]);
            .@itemAmt = rand(.default[2], .default[3]);
        }

        getitem(.@itemId, .@itemAmt);
    }
    freeloop(0);

    mes "[ " + .npc_name$ + " ]";
    mes "Here you go!";
    close;
    
    OnInit:
        .npc_name$ = strnpcinfo(1);
        .pull_price = 50000;
        .announce_limit = 5;
        .weight_cap = 90;
        .min_pulls = 1;
        .max_pulls = 500;

        //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount>
        setarray(.prices[0], 
            1, 35031, 1, 1, // demoniac mid
            1, 35081, 1, 1, // demoniac upper
            1, 35099, 1, 1, // demoniac low
            2, 7227, 1, 1, // tcg
            5, 7539, 1, 2, // diablo coin
            8, 969, 1, 3, // gold
            10, 604, 1, 3, // deadbranch
            8, 7444, 1, 3, // treasurebox
            8, 12208, 1, 2, // battle manual
            20, 985, 3, 8, // elu
            25, 7063, 2, 5, // alice apron
            25, 7047, 2, 5, // soft feather
            20, 984, 3, 8, // ori
            15, 748, 1, 3 // witherless
        );

        //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount>
        setarray(.default[0], 901, 926, 5, 15);

        delwaitingroom;
        waitingroom("Try your Luck?", 0);
}

 

Hi Winter,

Thanks for your help let me try and get back to you.
 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/01/12
  • Last Seen:  

11 hours ago, Winterfox said:
prontera,167,163,4	script	Lotto Girl	72,{
    mes "[ " + .npc_name$ + " ]";
    mes "I'm " + .npc_name$ + "! I'll exchange";
    mes "Random Prizes for every";
    mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000.";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Our Grand prize is:";
    mes "^ff0000 x1 TCG Card^000000";
    mes "^ff0000 x1 Costume set^000000";
    mes "Consolations are:";
    mes "^ff0000 x?? Gold Coin^000000";
    mes "^ff0000 x?? Gold^000000";
    mes "^ff0000 x?? Treasure Box^000000";
    mes "^ff0000 x?? Oridecon^000000";
    mes "^ff0000 x?? Elunium^000000";
    mes "And many more!!";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Do you want to pull?";
    next;
    if(select("Sure!:No.") == 2) {
        mes "[ " + .npc_name$ + " ]";
        mes "Come back if you change";
        mes "your mind.";
        close;
    }

    mes "[ " + .npc_name$ + " ]";
    mes "How many pulls do you want?";
    next;
    .@range = input(.@pullAmt, .min_pulls, .max_pulls);

    if(.@range != 0) {
        mes "[ " + .npc_name$ + " ]";
        mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls)  + ".";
        close;
    }

    if (Zeny < .pull_price * .@pullAmt) {
        mes "[ " + .npc_name$ + " ]";
        mes "You don't have enough zeny.";
        close;
    }     

    freeloop(1);
    for(.@i = 0; .@i < .@pullAmt; .@i++) {
        if (ceil(Weight * 100 / MaxWeight) >= .weight_cap) {
            mes "[ " + .npc_name$ + " ]";
            mes "You can't do anymore";
            mes "pulls because you are";
            mes "nearing your weight limit";
            close;
        }

        Zeny -= .pull_price;
        .@priceNo = rand(0, getarraysize(.prices) - 1);
        .@priceIdx = .@priceNo * 4;

        if (rand(1, 100) <= .prices[.@priceIdx]) {
            .@itemId = .prices[.@priceIdx + 1];
            .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]);

            if(.prices[.@priceIdx] <= .announce_limit) {
                announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all);
                specialeffect2(248);
            }
        } else {
            .@itemId = rand(.default[0], .default[1]);
            .@itemAmt = rand(.default[2], .default[3]);
        }

        getitem(.@itemId, .@itemAmt);
    }
    freeloop(0);

    mes "[ " + .npc_name$ + " ]";
    mes "Here you go!";
    close;
    
    OnInit:
        .npc_name$ = strnpcinfo(1);
        .pull_price = 50000;
        .announce_limit = 5;
        .weight_cap = 90;
        .min_pulls = 1;
        .max_pulls = 500;

        //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount>
        setarray(.prices[0], 
            1, 35031, 1, 1, // demoniac mid
            1, 35081, 1, 1, // demoniac upper
            1, 35099, 1, 1, // demoniac low
            2, 7227, 1, 1, // tcg
            5, 7539, 1, 2, // diablo coin
            8, 969, 1, 3, // gold
            10, 604, 1, 3, // deadbranch
            8, 7444, 1, 3, // treasurebox
            8, 12208, 1, 2, // battle manual
            20, 985, 3, 8, // elu
            25, 7063, 2, 5, // alice apron
            25, 7047, 2, 5, // soft feather
            20, 984, 3, 8, // ori
            15, 748, 1, 3 // witherless
        );

        //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount>
        setarray(.default[0], 901, 926, 5, 15);

        delwaitingroom;
        waitingroom("Try your Luck?", 0);
}

 

Hi Winter,

There are error on your script on line 48.
 

I lost the error log but it should said:  Expected less argument near ','
then it's skip the next line

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/01/12
  • Last Seen:  

On 8/10/2023 at 6:18 PM, Winterfox said:
prontera,167,163,4	script	Lotto Girl	72,{
    mes "[ " + .npc_name$ + " ]";
    mes "I'm " + .npc_name$ + "! I'll exchange";
    mes "Random Prizes for every";
    mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000.";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Our Grand prize is:";
    mes "^ff0000 x1 TCG Card^000000";
    mes "^ff0000 x1 Costume set^000000";
    mes "Consolations are:";
    mes "^ff0000 x?? Gold Coin^000000";
    mes "^ff0000 x?? Gold^000000";
    mes "^ff0000 x?? Treasure Box^000000";
    mes "^ff0000 x?? Oridecon^000000";
    mes "^ff0000 x?? Elunium^000000";
    mes "And many more!!";
    next;
    mes "[ " + .npc_name$ + " ]";
    mes "Do you want to pull?";
    next;
    if(select("Sure!:No.") == 2) {
        mes "[ " + .npc_name$ + " ]";
        mes "Come back if you change";
        mes "your mind.";
        close;
    }

    mes "[ " + .npc_name$ + " ]";
    mes "How many pulls do you want?";
    next;
    .@range = input(.@pullAmt, .min_pulls, .max_pulls);

    if(.@range != 0) {
        mes "[ " + .npc_name$ + " ]";
        mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls)  + ".";
        close;
    }

    if (Zeny < .pull_price * .@pullAmt) {
        mes "[ " + .npc_name$ + " ]";
        mes "You don't have enough zeny.";
        close;
    }     

    freeloop(1);
    for(.@i = 0; .@i < .@pullAmt; .@i++) {
        if (Weight * 100 / MaxWeight >= .weight_cap) {
            mes "[ " + .npc_name$ + " ]";
            mes "You can't do anymore";
            mes "pulls because you are";
            mes "nearing your weight limit";
            close;
        }

        Zeny -= .pull_price;
        .@priceNo = rand(0, getarraysize(.prices) - 1);
        .@priceIdx = .@priceNo * 4;

        if (rand(1, 100) <= .prices[.@priceIdx]) {
            .@itemId = .prices[.@priceIdx + 1];
            .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]);

            if(.prices[.@priceIdx] <= .announce_limit) {
                announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all);
                specialeffect2(248);
            }
        } else {
            .@itemId = rand(.default[0], .default[1]);
            .@itemAmt = rand(.default[2], .default[3]);
        }

        getitem(.@itemId, .@itemAmt);
    }
    freeloop(0);

    mes "[ " + .npc_name$ + " ]";
    mes "Here you go!";
    close;
    
    OnInit:
        .npc_name$ = strnpcinfo(1);
        .pull_price = 50000;
        .announce_limit = 5;
        .weight_cap = 90;
        .min_pulls = 1;
        .max_pulls = 500;

        //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount>
        setarray(.prices[0], 
            1, 35031, 1, 1, // demoniac mid
            1, 35081, 1, 1, // demoniac upper
            1, 35099, 1, 1, // demoniac low
            2, 7227, 1, 1, // tcg
            5, 7539, 1, 2, // diablo coin
            8, 969, 1, 3, // gold
            10, 604, 1, 3, // deadbranch
            8, 7444, 1, 3, // treasurebox
            8, 12208, 1, 2, // battle manual
            20, 985, 3, 8, // elu
            25, 7063, 2, 5, // alice apron
            25, 7047, 2, 5, // soft feather
            20, 984, 3, 8, // ori
            15, 748, 1, 3 // witherless
        );

        //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount>
        setarray(.default[0], 901, 926, 5, 15);

        delwaitingroom;
        waitingroom("Try your Luck?", 0);
}

 

Will try again and get back to you. Thank you.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/01/12
  • Last Seen:  

Thanks it's working now.

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