• 0
max65

lucky spin problems

Question

hi all ^^, I have a small problem, this NPC works, but when the event is over, it does not close ". Bmp" and the window of the npc.

can you help me plz.

 

1242622024_screenTheFairiesOfRo001.thumb.jpg.a22bdfb9034cebbb3c645ea972526be7.jpg

//===== Hercules Script ======================================
//= Wheel of Fortune
//===== By ===================================================
//= Habilis
//= Edited by Myriad
//===== Version ==============================================
//= 1.02 - June 15, 2018
//  - Made the script work with zeny, to be more accesibly to everyone.
//= 1.01 - June 14, 2018
//    - Added @wheel_of_fortune GM command (level 98+).
//    - Merged S_Pay and S_Loop subs into main line of text.
//    - S_Gamble is now S_Spin and it will 'return' instead of
//    calling back to the initial sub.
//= 1.00 - June 13, 2018
//    - Initial script edit for Habilis.
//===== Description ==========================================
//= Wheel of fortune something.
//============================================================

-    script    Wheel_of_Fortune    FAKE_NPC ,{

OnInit:
    disablenpc("Wheel of Fortune#Main");
    .EventName$ = "[Wheel Of Fortune]";
    end;


OnClock0900:
OnClock1600:
OnClock2200:
OnStart:
    .Start = true;
    announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all);
    initnpctimer();
    end;

OnTimer60000: // 1 min
    enablenpc("Wheel of Fortune#Main");
    announce(sprintf("%s : Come to Prontera and test your luck", .EventName$), bc_yellow | bc_all);
    end;

OnTimer60500: // 1 mins
    announce(sprintf("%s : One minute, do your last spin!", .EventName$), bc_yellow | bc_all);
    end;

OnTimer120000: // 2 mins
OnStop:
    .Start = false;
    stopnpctimer();
    disablenpc("Wheel of Fortune#Main");
    end;

OnCommand:
    if ([email protected]_numparameters != 1) {
        dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00);
        dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
        end;
    }

    if ([email protected]_parameters$[0] == "start") {
        if (!.Start)
            donpcevent(sprintf("%s::OnStart", strnpcinfo(NPC_NAME)));
        else {
            dispbottom("The Wheel of Fortune has already started.", 0x00FF00);
            dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
        }
    } else if ([email protected]_parameters$[0] == "end") {
        if (.Start)
            donpcevent(sprintf("%s::OnEnd", strnpcinfo(NPC_NAME)));
        else {
            dispbottom("The Wheel of Fortune is not active.", 0x00FF00);
            dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
        }
    } else {
        dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00);
        dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
    }
    end;
}

prontera,164,169,1    script    Wheel of Fortune#Main    2_SLOT_MACHINE,{
    
OnTalk:

if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) {
        mes("[^0055FFLucky Spin^000000]", .EventName$);
        mes("You are out of Zeny");
        mes("and have no more");
        mes("free spins. Come back");
        mes("next time for more!");
        close();
    }

    [email protected]$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : ".";
    addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME)));
    mes("[^0055FFLucky Spin^000000]", .EventName$);
    mes("Do you want to spin the wheel?");
    mes("It costs ^FF000050.000 Zeny^000000 to play", [email protected]$);
    next();

    while (true) {
        if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0)
            callsub(S_End);
        switch (select(
            (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "",
            (Zeny >= .Zeny_Cost ) ? sprintf("Yes! Use Zeny. (costs %dz)", .Zeny_Cost) : "",
            "No (Leave)"
        )) {
        // pay with free spin
        case 1:
            if (#freewheelfortunespin > 0) {
                if ((#freewheelfortunespin -= 1) < 0)
                    #freewheelfortunespin = 0;
                callsub(S_Spin);
            } else
                callsub(S_End);
            break;

        // Pay with zeny
        case 2:
            if (Zeny >= .Zeny_Cost) {
                Zeny -= .Zeny_Cost;
                callsub(S_Spin);
            } else {
                cutin("aca_salim02", 2);
                mes("[^0055FFLucky Spin^000000]", .EventName$);
                mes("Awww, you don't have enough to gamble...");
                mes(" ");
                mes("Have you ever heard?");
                mes("'Money isn't all that matters' Got it?");
                mes("Byeeeeeeeeeeeeee ;)");
                callsub(S_End);
            }
            break;

        default:
            callsub(S_End);
        }
    }

// Wheel spin animation
S_Spin:
    [email protected] = rand(.Sector_Range[0], .Sector_Range[1]);
    [email protected] = [email protected] * 2 - 1;
    [email protected] = .Spin_Speed;
    
    for ([email protected] = 0; [email protected] < .nbTurns; [email protected]++) {
        [email protected] = .Cutin_Range[0];
        while ([email protected] <= .Cutin_Range[1]) {
            cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);
            sleep2([email protected]);
            [email protected]++;
            [email protected] += 1; // not ++, because  you may want to adjust the stopping +1 +2 +3
        }
    }
    
    [email protected] = .Cutin_Range[0];
    while ([email protected] < [email protected]) {
        cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);
        sleep2([email protected]);
        [email protected]++;
    }

    cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);

    if (.Prize_ID[[email protected]] == -1) {
        // Free spin
        if (.Sound_Effects)
            soundeffect("wheel_jackpot.wav", 0);
        announce(sprintf("[%s] : Wow, %dx more Free spins!!!", .EventName$, .Prize_Qty[[email protected]]), bc_blue | bc_self);
        #freewheelfortunespin = #freewheelfortunespin == 0 ? .Prize_Qty[[email protected]] : #freewheelfortunespin + .Prize_Qty[[email protected]];
    } else if (.Prize_ID[[email protected]] == 0) {
        // Nothing
        if (.Sound_Effects)
            soundeffect("wheel_lost.wav", 0);
        announce(sprintf("[%s] : Awwww, no luck in your gamble, more luck in love...", .EventName$), bc_blue | bc_self);
    } else {
        // Item
        if (.Sound_Effects)
            soundeffect("wheel_won.wav", 0);
        announce(sprintf("[%s] : %dx %s - enjoy your prize!", .EventName$, .Prize_Qty[[email protected]], getitemname(.Prize_ID[[email protected]])), bc_blue | bc_self);
        getitem(.Prize_ID[[email protected]], .Prize_Qty[[email protected]]);
    }

    sleep2(1000);
    if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) {
        mes("[^0055FFLucky Spin^000000]", .EventName$);
        mes("You are out of Zeny");
        mes("and have no more");
        mes("free spins. Come back");
        mes("next time for more!");
        close();
    }
    return;
    
S_End:
    close2();
OnEnd:
    cutin("", 255);
    end;
    
OnInit:
    .EventName$ = "Wheel Of Fortune";
    bindatcmd("wheel_of_fortune", "Wheel_of_Fortune::OnCommand", 98,false);
    .Spin_Speed = 50; // What is the base spin speed? (ms)
    .nbTurns = 2; // How many times the arrow makes a complete turn, before entering the stopping routine
    .Zeny_Cost = 50000; // How much zeny does it cost for a spin?
    .Sound_Effects = true; // Enable sound effects? (true/false)

    // You must have a total of 10 prizes. DO NOT remove 0 or -1 from the array and do not
    // change their order.
    setarray(.Prize_ID[1], -1, 7539, 14345, 7539,   617,   607, 7539,   604, 0,  12214);
    setarray(.Prize_Qty[1], 2,     3,     1,     1,     3,     3,     1,     3, 0,     1);

    // Don't touch below
    .Cutin$ = "WheelOfFortune_";
    setarray(.Sector_Range, 1, 10); // Sector range
    setarray(.Cutin_Range, 0, 19); // Cutin range
    end;
}

thx for your reply

screenThe Fairies Of Ro001.jpg

Edited by Emistry
Please use codebox

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

this a herc script

 

I am not sure if you use rathena or but if you use rathena you can use close3; to close any image on the screen

Share this post


Link to post
Share on other sites
  • 0

i will try thx for you repply ^^

 

 

i have remplace close2 ==> close3 but have a same problem's =s

Share this post


Link to post
Share on other sites
  • 0

I believe it is necessary to make many changes, the script was not made for this emulator.

Edited by Kakaroto

Share this post


Link to post
Share on other sites
  • 0

I use latest rathena, and i can convert it to rathena, but not completely fixed,

no error for image, but still, i stuck in "while (true) {"

anyone can help me to solve it?

 

1540358234242.gif

 

i stuck in here

  while (true) {
        if ( (zeny < .Zeny_Cost) && (#freewheelfortunespin < 0))
            callsub S_End;
        switch (select(
            (#freewheelfortunespin > 0)?"Yes! Use free spin! ("+#freewheelfortunespin+" left)":
            (Zeny >= .Zeny_Cost)?"Yes! Use Zeny. (costs "+.Zeny_Cost+"z)":
            "No (Leave)"
        )) {
        // pay with free spin
        case 1:
            if (#freewheelfortunespin > 0) {
                if ((#freewheelfortunespin -= 1) < 0)
                    #freewheelfortunespin = 0;
                callsub S_Spin;
            } else
                callsub S_End;
            break;

        // Pay with zeny
        case 2:
            if (zeny >= .Zeny_Cost) {
                set zeny,zeny-.Zeny_Cost;
                callsub S_Spin;
            } else {
                cutin "aca_salim02",2;
                mes .EventName$;
                mes "Awww, you don't have enough to gamble...";
                mes " ";
                mes "Have you ever heard?";
                mes "'Money isn't all that matters' Got it?";
                mes "Byeeeeeeeeeeeeee ;)";
                callsub S_End;
            }
            break;

        default:
            callsub S_End;
        }
    }

 

Edited by Emistry
Please use codebox

Share this post


Link to post
Share on other sites
  • 0

Thx emistry but now have that in my console

148131500_Sanstitre.png.3dec021b953ffba16cf9886bf4f51d55.png

//= Wheel of Fortune
//===== By ===================================================
//= Habilis
//= Edited by Myriad
//===== Version ==============================================
//= 1.02 - June 15, 2018
//  - Made the script work with zeny, to be more accesibly to everyone.
//= 1.01 - June 14, 2018
//    - Added @wheel_of_fortune GM command (level 98+).
//    - Merged S_Pay and S_Loop subs into main line of text.
//    - S_Gamble is now S_Spin and it will 'return' instead of
//    calling back to the initial sub.
//= 1.00 - June 13, 2018
//    - Initial script edit for Habilis.
//===== Description ==========================================
//= Wheel of fortune something.
//============================================================

-	script	Wheel_of_Fortune	FAKE_NPC ,{

OnInit:
    disablenpc("Wheel of Fortune#Main");
    .EventName$ = "[Wheel Of Fortune]";
    end;


OnClock0900:
OnClock1600:
OnClock2200:
OnStart:
    .Start = true;
    announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all);
    initnpctimer();
    end;

OnTimer60000: // 1 min
    enablenpc("Wheel of Fortune#Main");
    announce(sprintf("%s : Come to Prontera and test your luck", .EventName$), bc_yellow | bc_all);
    end;

OnTimer60500: // 1 mins
    announce(sprintf("%s : One minute, do your last spin!", .EventName$), bc_yellow | bc_all);
    end;

OnTimer120000: // 2 mins
OnStop:
    .Start = false;
    stopnpctimer();
    disablenpc("Wheel of Fortune#Main");
    end;

OnCommand:
    if ([email protected]_numparameters != 1) {
        dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00);
        dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
        end;
    }

    if ([email protected]_parameters$[0] == "start") {
        if (!.Start)
            donpcevent(sprintf("%s::OnStart", strnpcinfo(NPC_NAME)));
        else {
            dispbottom("The Wheel of Fortune has already started.", 0x00FF00);
            dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
        }
    } else if ([email protected]_parameters$[0] == "end") {
        if (.Start)
            donpcevent(sprintf("%s::OnEnd", strnpcinfo(NPC_NAME)));
        else {
            dispbottom("The Wheel of Fortune is not active.", 0x00FF00);
            dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
        }
    } else {
        dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00);
        dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
    }
    end;
}

prontera,164,169,1	script	Wheel of Fortune#Main	2_SLOT_MACHINE,{
    
OnTalk:

if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) {
        mes("[^0055FFLucky Spin^000000]", .EventName$);
        mes("You are out of Zeny");
        mes("and have no more");
        mes("free spins. Come back");
        mes("next time for more!");
        close();
    }

    [email protected]$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : ".";
    addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME)));
    mes("[^0055FFLucky Spin^000000]", .EventName$);
    mes("Do you want to spin the wheel?");
    mes("It costs ^FF000050.000 Zeny^000000 to play", [email protected]$);
    next();

    while (true) {
        if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0)
            callsub(S_End);
        switch (select(
            (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "",
            (Zeny >= .Zeny_Cost ) ? sprintf("Yes! Use Zeny. (costs %dz)", .Zeny_Cost) : "",
            "No (Leave)"
        )) {
        // pay with free spin
        case 1:
            if (#freewheelfortunespin > 0) {
                if ((#freewheelfortunespin -= 1) < 0)
                    #freewheelfortunespin = 0;
                callsub(S_Spin);
            } else
                callsub(S_End);
            break;

        // Pay with zeny
        case 2:
            if (Zeny >= .Zeny_Cost) {
                Zeny -= .Zeny_Cost;
                callsub(S_Spin);
            } else {
                cutin("aca_salim02", 2);
                mes("[^0055FFLucky Spin^000000]", .EventName$);
                mes("Awww, you don't have enough to gamble...");
                mes(" ");
                mes("Have you ever heard?");
                mes("'Money isn't all that matters' Got it?");
                mes("Byeeeeeeeeeeeeee ;)");
                callsub(S_End);
            }
            break;

        default:
            break;
        }
        callsub(S_End);
    }

// Wheel spin animation
S_Spin:
    [email protected] = rand(.Sector_Range[0], .Sector_Range[1]);
    [email protected] = [email protected] * 2 - 1;
    [email protected] = .Spin_Speed;
    
    for ([email protected] = 0; [email protected] < .nbTurns; [email protected]++) {
        [email protected] = .Cutin_Range[0];
        while ([email protected] <= .Cutin_Range[1]) {
            cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);
            sleep2([email protected]);
            [email protected]++;
            [email protected] += 1; // not ++, because  you may want to adjust the stopping +1 +2 +3
        }
    }
	[email protected] = .Cutin_Range[0];
    while ([email protected] < [email protected]) {
        cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);
        sleep2([email protected]);
        [email protected]++;
    }

    cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);

    if (.Prize_ID[[email protected]] == -1) {
        // Free spin
        if (.Sound_Effects)
            soundeffect("wheel_jackpot.wav", 0);
        announce(sprintf("[%s] : Wow, %dx more Free spins!!!", .EventName$, .Prize_Qty[[email protected]]), bc_blue | bc_self);
        #freewheelfortunespin = #freewheelfortunespin == 0 ? .Prize_Qty[[email protected]] : #freewheelfortunespin + .Prize_Qty[[email protected]];
    } else if (.Prize_ID[[email protected]] == 0) {
        // Nothing
        if (.Sound_Effects)
            soundeffect("wheel_lost.wav", 0);
        announce(sprintf("[%s] : Awwww, no luck in your gamble, more luck in love...", .EventName$), bc_blue | bc_self);
    } else {
        // Item
        if (.Sound_Effects)
            soundeffect("wheel_won.wav", 0);
        announce(sprintf("[%s] : %dx %s - enjoy your prize!", .EventName$, .Prize_Qty[[email protected]], getitemname(.Prize_ID[[email protected]])), bc_blue | bc_self);
        getitem(.Prize_ID[[email protected]], .Prize_Qty[[email protected]]);
    }

    sleep2(1000);
    if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) {
        mes("[^0055FFLucky Spin^000000]", .EventName$);
        mes("You are out of Zeny");
        mes("and have no more");
        mes("free spins. Come back");
        mes("next time for more!");
        close();
    }
    return;
    
S_End:
    close2();
OnEnd:
    cutin("", 255);
    end;
    
OnInit:
    .EventName$ = "Wheel Of Fortune";
    bindatcmd("wheel_of_fortune", "Wheel_of_Fortune::OnCommand", 98,false);
    .Spin_Speed = 50; // What is the base spin speed? (ms)
    .nbTurns = 2; // How many times the arrow makes a complete turn, before entering the stopping routine
    .Zeny_Cost = 50000; // How much zeny does it cost for a spin?
    .Sound_Effects = true; // Enable sound effects? (true/false)

    // You must have a total of 10 prizes. DO NOT remove 0 or -1 from the array and do not
    // change their order.
    setarray(.Prize_ID[1], -1, 7539, 14345, 7539,   617,   607, 7539,   604, 0,  12214);
    setarray(.Prize_Qty[1], 2,     3,     1,     1,     3,     3,     1,     3, 0,     1);

    // Don't touch below
    .Cutin$ = "WheelOfFortune_";
    setarray(.Sector_Range, 1, 10); // Sector range
    setarray(.Cutin_Range, 0, 19); // Cutin range
    end;
}

 

Edited by max65

Share this post


Link to post
Share on other sites
  • 0
//===== Hercules Script ======================================
//= Wheel of Fortune
//===== By ===================================================
//= Habilis
//= Edited by Myriad
//===== Version ==============================================
//= 1.02 - June 15, 2018
//  - Made the script work with zeny, to be more accesibly to everyone.
//= 1.01 - June 14, 2018
//	- Added @wheel_of_fortune GM command (level 98+).
//	- Merged S_Pay and S_Loop subs into main line of text.
//	- S_Gamble is now S_Spin and it will 'return' instead of
//	calling back to the initial sub.
//= 1.00 - June 13, 2018
//	- Initial script edit for Habilis.
//===== Description ==========================================
//= Wheel of fortune something.
//============================================================

-	script	Wheel_of_Fortune	-1,{

OnInit:
	disablenpc("Wheel of Fortune#Main");
	.EventName$ = "[Wheel Of Fortune]";
	end;


OnClock0900:
OnClock1600:
OnClock2200:
OnStart:
	.Start = true;
	announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all);
	initnpctimer();
	end;

OnTimer60000: // 1 min
	enablenpc("Wheel of Fortune#Main");
	announce(sprintf("%s : Come to Prontera and test your luck", .EventName$), bc_yellow | bc_all);
	end;

OnTimer60500: // 1 mins
	announce(sprintf("%s : One minute, do your last spin!", .EventName$), bc_yellow | bc_all);
	end;

OnTimer120000: // 2 mins
OnStop:
	.Start = false;
	stopnpctimer();
	disablenpc("Wheel of Fortune#Main");
	end;

OnCommand:
	if ([email protected]_numparameters != 1) {
		dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00);
		dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
		end;
	}

	if ([email protected]_parameters$[0] == "start") {
		if (!.Start)
			donpcevent(sprintf("%s::OnStart", strnpcinfo(NPC_NAME)));
		else {
			dispbottom("The Wheel of Fortune has already started.", 0x00FF00);
			dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
		}
	} else if ([email protected]_parameters$[0] == "end") {
		if (.Start)
			donpcevent(sprintf("%s::OnEnd", strnpcinfo(NPC_NAME)));
		else {
			dispbottom("The Wheel of Fortune is not active.", 0x00FF00);
			dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
		}
	} else {
		dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00);
		dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00);
	}
	end;
}

prontera,164,169,1	script	Wheel of Fortune#Main	2_SLOT_MACHINE,{
	
OnTalk:

if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) {
		mes("[^0055FFLucky Spin^000000]", .EventName$);
		mes("You are out of Zeny");
		mes("and have no more");
		mes("free spins. Come back");
		mes("next time for more!");
		close();
	}

	[email protected]$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : ".";
	addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME)));
	mes("[^0055FFLucky Spin^000000]", .EventName$);
	mes("Do you want to spin the wheel?");
	mes("It costs ^FF000050.000 Zeny^000000 to play", [email protected]$);
	next();

	while (true) {
		if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0)
			callsub(S_End);
		switch (select(
			(#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "",
			(Zeny >= .Zeny_Cost ) ? sprintf("Yes! Use Zeny. (costs %dz)", .Zeny_Cost) : "",
			"No (Leave)"
		)) {
		// pay with free spin
		case 1:
			if (#freewheelfortunespin > 0) {
				if ((#freewheelfortunespin -= 1) < 0)
					#freewheelfortunespin = 0;
				callsub(S_Spin);
			} else
				callsub(S_End);
			break;

		// Pay with zeny
		case 2:
			if (Zeny >= .Zeny_Cost) {
				Zeny -= .Zeny_Cost;
				callsub(S_Spin);
			} else {
				cutin("aca_salim02", 2);
				mes("[^0055FFLucky Spin^000000]", .EventName$);
				mes("Awww, you don't have enough to gamble...");
				mes(" ");
				mes("Have you ever heard?");
				mes("'Money isn't all that matters' Got it?");
				mes("Byeeeeeeeeeeeeee ;)");
				callsub(S_End);
			}
			break;

		default:
			break;
		}
		callsub(S_End);
	}

// Wheel spin animation
S_Spin:
	[email protected] = rand(.Sector_Range[0], .Sector_Range[1]);
	[email protected] = [email protected] * 2 - 1;
	[email protected] = .Spin_Speed;
	
	for ([email protected] = 0; [email protected] < .nbTurns; [email protected]++) {
		[email protected] = .Cutin_Range[0] - 1;
		while ([email protected] <= (.Cutin_Range[1] - 1)) {
			cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);
			sleep2([email protected]);
			[email protected]++;
			[email protected] += 1; // not ++, because  you may want to adjust the stopping +1 +2 +3
		}
	}
	
	[email protected] = .Cutin_Range[0] - 1;
	while ([email protected] < [email protected]) {
		cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);
		sleep2([email protected]);
		[email protected]++;
	}

	cutin(sprintf("%s%d", .Cutin$, [email protected]), 4);

	if (.Prize_ID[[email protected]] == -1) {
		// Free spin
		if (.Sound_Effects)
			soundeffect("wheel_jackpot.wav", 0);
		announce(sprintf("[%s] : Wow, %dx more Free spins!!!", .EventName$, .Prize_Qty[[email protected]]), bc_blue | bc_self);
		#freewheelfortunespin = #freewheelfortunespin == 0 ? .Prize_Qty[[email protected]] : #freewheelfortunespin + .Prize_Qty[[email protected]];
	} else if (.Prize_ID[[email protected]] == 0) {
		// Nothing
		if (.Sound_Effects)
			soundeffect("wheel_lost.wav", 0);
		announce(sprintf("[%s] : Awwww, no luck in your gamble, more luck in love...", .EventName$), bc_blue | bc_self);
	} else {
		// Item
		if (.Sound_Effects)
			soundeffect("wheel_won.wav", 0);
		announce(sprintf("[%s] : %dx %s - enjoy your prize!", .EventName$, .Prize_Qty[[email protected]], getitemname(.Prize_ID[[email protected]])), bc_blue | bc_self);
		getitem(.Prize_ID[[email protected]], .Prize_Qty[[email protected]]);
	}

	sleep2(1000);
	if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) {
		mes("[^0055FFLucky Spin^000000]", .EventName$);
		mes("You are out of Zeny");
		mes("and have no more");
		mes("free spins. Come back");
		mes("next time for more!");
		close();
	}
	return;
	
S_End:
	close2();
OnEnd:
	cutin("", 255);
	end;
	
OnInit:
	.EventName$ = "Wheel Of Fortune";
	bindatcmd("wheel_of_fortune", "Wheel_of_Fortune::OnCommand", 98,false);
	.Spin_Speed = 50; // What is the base spin speed? (ms)
	.nbTurns = 2; // How many times the arrow makes a complete turn, before entering the stopping routine
	.Zeny_Cost = 50000; // How much zeny does it cost for a spin?
	.Sound_Effects = true; // Enable sound effects? (true/false)

	// You must have a total of 10 prizes. DO NOT remove 0 or -1 from the array and do not
	// change their order.
	setarray(.Prize_ID[1], -1, 7539, 14345, 7539,   617,   607, 7539,   604, 0,  12214);
	setarray(.Prize_Qty[1], 2,	 3,	 1,	 1,	 3,	 3,	 1,	 3, 0,	 1);

	// Don't touch below
	.Cutin$ = "WheelOfFortune_";
	setarray .Sector_Range[0], 1, 10; // Sector range
	setarray .Cutin_Range[0], 1, 20; // Cutin range
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0

same problèms , have save with notepad++ on uncode --> UTF8 without BOM

171658561_Sanstitre.png.82ee20b502e8bcd4f0aa531a75292649.png

Share this post


Link to post
Share on other sites
  • 0

What if you erase that line and readd it manually?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now