Jump to content
  • 0
Sign in to follow this  
tokenacc001

R> monster vs monster

Question

hello! anyone has a working script of a monster vs monster? 

i want to make it automated and players can bet on which monster who will win.

but just a working script of monster vs monster will be much appreciated.

 

thanks in advance!!

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 1
-	script	MVP_vs_MVP	FAKE_NPC,{
	
	OnMinute00:
		if (gettime(DT_HOUR) % 2 || .start) end;
		goto OnStart;
		end;
	
	OnStart:
		mapwarp "[email protected]", "prontera", 150, 150;
		killmonster "[email protected]", "All";
		.start = 1;
		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
		sleep 7000;
		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
		sleep 7000;
		announce .npc$ + " We will start the event after 1 minute", bc_all;
		sleep 60000;
		announce .npc$ + " The entry to the event is now closed", bc_all;
		.start = 2;
		sleep 7000;
		
		if (getmapusers("[email protected]") < 1) {
			announce .npc$ + " Not enough participants to continue the event", 0;
			.start = 0;
			end;
		}
		
		mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
		
		.start = 3;
		sleep 55000;
		mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 4...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 3...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 2...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 1...", bc_map;
		sleep 1000;
		.start = 4;
		mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map;
		
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
		
		[email protected] = .MVP[rand(.size)];
		monster "[email protected]", 68, 68, "MVP A", [email protected], 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
		.ma = [email protected];
		monster "[email protected]", 71, 68, "MVP B", [email protected], 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
		.mb = [email protected];
		
		unitattack .ma, .mb;
		unitattack .mb, .ma;
		
		end;
		
	OnDie1:
		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (2 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
		warp "SavePoint", 0, 0;
		end;
		
	OnDie2:
		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (1 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
		warp "SavePoint", 0, 0;
		end;
	
	OnEventBet:
		mes .npc$;
		if (!.start)
			mes "The event is not active.";
		else if (.start != 3)
			mes "The event cannot accept bets at the moment.";
		else if (Zeny < .bet_cost)
			mes "You don't have enough zeny to make a bet.";
		else if (@mvp_bet)
			mes "You already placed your bet.";
		else if (strcharinfo(3) != "[email protected]")
			mes "Hmm~";
		else {
			mes "Which mvp will you bet on this match???";
			next;
			[email protected] = select("MVP A:MVP B");
			mes .npc$;
			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + ([email protected] == 1 ? "MVP A" : "MVP B") + "?";
			next;
			if (select("Yes:No") & 2) end;
			if (.start != 3) { // in case they delay the select ???
				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
				warp "SavePoint", 0, 0;
				end;
			}
			mes .npc$;
			mes "Good luck and have fun!";
			Zeny -= .bet_cost;
			@mvp_bet = [email protected];
		}
		end;
	
	OnEventJoin:
		if (!.start)
			message strcharinfo(0), "The event is not active.";
		else if (.start != 1)
			message strcharinfo(0), "The event is not yet allowing participants to enter.";
		else {
			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
			switch (rand(1,4)) {
				case 1:
					warp "[email protected]", 49, 50;
					break;
				case 2:
					warp "[email protected]", 49, 88;
					break;
				case 3:
					warp "[email protected]", 89, 88;
					break;
				case 4:
					warp "[email protected]", 89, 50;
					break;
			}
		}
		end;
	
	OnInit:
		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
		
		// List of MVP's
		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
		.size = getarraysize(.MVP);
	
		.npc$ = "[MVP vs MVP Event]";
		
		.bet_cost = 5000; // 5,000z to bet in the event
		.bet_rewd = 1000000; // 1,000,000z if bet wins
		
		end;
}

[email protected]	mapflag	monster_noteleport
[email protected]	mapflag	noskill
[email protected]	mapflag	noloot
[email protected]	mapflag	noitemconsumption
[email protected]	mapflag	nomemo
[email protected]	mapflag	nosave	SavePoint
[email protected]	mapflag	nowarpto
[email protected]	mapflag	nowarp
[email protected]	mapflag	noteleport

 

  • Upvote 2

Share this post


Link to post
Share on other sites
  • 0

Try below script. I didn't test it too much

-	script	MVP_vs_MVP	FAKE_NPC,{
	
	OnMinute00:
		if (gettime(DT_HOUR) % 2 || .start) end;
		goto OnStart;
		end;
	
	OnStart:
		mapwarp "[email protected]", "prontera", 150, 150;
		killmonster "[email protected]", "All";
		.start = 1;
		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
		sleep 7000;
		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
		sleep 7000;
		announce .npc$ + " We will start the event after 1 minute", bc_all;
		sleep 60000;
		announce .npc$ + " The entry to the event is now closed", bc_all;
		.start = 2;
		sleep 7000;
		
		if (getmapusers("[email protected]") < 1) {
			announce .npc$ + " Not enough participants to continue the event", 0;
			.start = 0;
			end;
		}
		
		mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
		
		.start = 3;
		sleep 55000;
		mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 4...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 3...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 2...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 1...", bc_map;
		sleep 1000;
		.start = 4;
		mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map;
		
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
		
		[email protected] = .MVP[rand(.size)];
		monster "[email protected]", 68, 68, "MVP A", [email protected], 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
		.ma = [email protected];
		monster "[email protected]", 71, 68, "MVP B", [email protected], 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
		.mb = [email protected];
		end;
		
	OnDie1:
		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (2 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
		warp "SavePoint", 0, 0;
		end;
		
	OnDie2:
		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (1 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
		warp "SavePoint", 0, 0;
		end;
	
	OnEventBet:
		mes .npc$;
		if (!.start)
			mes "The event is not active.";
		else if (.start != 3)
			mes "The event cannot accept bets at the moment.";
		else if (Zeny < .bet_cost)
			mes "You don't have enough zeny to make a bet.";
		else if (@mvp_bet)
			mes "You already placed your bet.";
		else if (strcharinfo(3) != "[email protected]")
			mes "Hmm~";
		else {
			mes "Which mvp will you bet on this match???";
			next;
			[email protected] = select("MVP A:MVP B");
			mes .npc$;
			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + ([email protected] == 1 ? "MVP A" : "MVP B") + "?";
			next;
			if (select("Yes:No") & 2) end;
			if (.start != 3) { // in case they delay the select ???
				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
				warp "SavePoint", 0, 0;
				end;
			}
			mes .npc$;
			mes "Good luck and have fun!";
			Zeny -= .bet_cost;
			@mvp_bet = [email protected];
		}
		end;
	
	OnEventJoin:
		if (!.start)
			message strcharinfo(0), "The event is not active.";
		else if (.start != 1)
			message strcharinfo(0), "The event is not yet allowing participants to enter.";
		else {
			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
			switch (rand(1,4)) {
				case 1:
					warp "[email protected]", 49, 50;
					break;
				case 2:
					warp "[email protected]", 49, 88;
					break;
				case 3:
					warp "[email protected]", 89, 88;
					break;
				case 4:
					warp "[email protected]", 89, 50;
					break;
			}
		}
		end;
	
	OnInit:
		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
		
		// List of MVP's
		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
		.size = getarraysize(.MVP);
	
		.npc$ = "[MVP vs MVP Event]";
		
		.bet_cost = 5000; // 5,000z to bet in the event
		.bet_rewd = 1000000; // 1,000,000z if bet wins
		
		end;
}

[email protected]	mapflag	monster_noteleport
[email protected]	mapflag	noskill
[email protected]	mapflag	noloot
[email protected]	mapflag	noitemconsumption
[email protected]	mapflag	nomemo
[email protected]	mapflag	nosave	SavePoint
[email protected]	mapflag	nowarpto
[email protected]	mapflag	nowarp
[email protected]	mapflag	noteleport

 

Edited by Patskie
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, Patskie said:

Try below script. I didn't test it too much

-	script	MVP_vs_MVP	FAKE_NPC,{
	
	OnMinute00:
		if (gettime(DT_HOUR) % 2 || .start) end;
		goto OnStart;
		end;
	
	OnStart:
		mapwarp "[email protected]", "prontera", 150, 150;
		killmonster "[email protected]", "All";
		.start = 1;
		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
		sleep 7000;
		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
		sleep 7000;
		announce .npc$ + " We will start the event after 1 minute", bc_all;
		sleep 60000;
		announce .npc$ + " The entry to the event is now closed", bc_all;
		.start = 2;
		sleep 7000;
		
		if (getmapusers("[email protected]") < 1) {
			announce .npc$ + " Not enough participants to continue the event", 0;
			.start = 0;
			end;
		}
		
		mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
		
		.start = 3;
		sleep 55000;
		mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 4...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 3...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 2...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 1...", bc_map;
		sleep 1000;
		.start = 4;
		mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map;
		
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
		
		[email protected] = .MVP[rand(.size)];
		monster "[email protected]", 68, 68, "MVP A", [email protected], 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
		.ma = [email protected];
		monster "[email protected]", 71, 68, "MVP B", [email protected], 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
		.mb = [email protected];
		end;
		
	OnDie1:
		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (2 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
		warp "SavePoint", 0, 0;
		end;
		
	OnDie2:
		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (1 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
		warp "SavePoint", 0, 0;
		end;
	
	OnEventBet:
		mes .npc$;
		if (!.start)
			mes "The event is not active.";
		else if (.start != 3)
			mes "The event cannot accept bets at the moment.";
		else if (Zeny < .bet_cost)
			mes "You don't have enough zeny to make a bet.";
		else if (@mvp_bet)
			mes "You already placed your bet.";
		else if (strcharinfo(3) != "[email protected]")
			mes "Hmm~";
		else {
			mes "Which mvp will you bet on this match???";
			next;
			[email protected] = select("MVP A:MVP B");
			mes .npc$;
			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + ([email protected] == 1 ? "MVP A" : "MVP B") + "?";
			next;
			if (select("Yes:No") & 2) end;
			if (.start != 3) { // in case they delay the select ???
				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
				warp "SavePoint", 0, 0;
				end;
			}
			mes .npc$;
			mes "Good luck and have fun!";
			Zeny -= .bet_cost;
			@mvp_bet = [email protected];
		}
		end;
	
	OnEventJoin:
		if (!.start)
			message strcharinfo(0), "The event is not active.";
		else if (.start != 1)
			message strcharinfo(0), "The event is not yet allowing participants to enter.";
		else {
			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
			switch (rand(1,4)) {
				case 1:
					warp "[email protected]", 49, 50;
					break;
				case 2:
					warp "[email protected]", 49, 88;
					break;
				case 3:
					warp "[email protected]", 89, 88;
					break;
				case 4:
					warp "[email protected]", 89, 50;
					break;
			}
		}
		end;
	
	OnInit:
		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
		
		// List of MVP's
		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
		.size = getarraysize(.MVP);
	
		.npc$ = "[MVP vs MVP Event]";
		
		.bet_cost = 5000; // 5,000z to bet in the event
		.bet_rewd = 1000000; // 1,000,000z if bet wins
		
		end;
}

[email protected]	mapflag	monster_noteleport
[email protected]	mapflag	noskill
[email protected]	mapflag	noloot
[email protected]	mapflag	noitemconsumption
[email protected]	mapflag	nomemo
[email protected]	mapflag	nosave	SavePoint
[email protected]	mapflag	nowarpto
[email protected]	mapflag	nowarp
[email protected]	mapflag	noteleport

 

during the fight, the map got crashed... 

Share this post


Link to post
Share on other sites
  • 0
5 minutes ago, tokenacc001 said:

during the fight, the map got crashed... 

Does not from my local server. Are you using latest rAthena?

Share this post


Link to post
Share on other sites
  • 0
On 8/25/2020 at 6:11 PM, Patskie said:

Does not from my local server. Are you using latest rAthena?

yea, it's the latest.

weird, it worked now without crashing hahaha, thanks!!!!!!!!!!!!!!!!!!!!

 

On 8/25/2020 at 2:51 PM, Patskie said:

Try below script. I didn't test it too much

-	script	MVP_vs_MVP	FAKE_NPC,{
	
	OnMinute00:
		if (gettime(DT_HOUR) % 2 || .start) end;
		goto OnStart;
		end;
	
	OnStart:
		mapwarp "[email protected]", "prontera", 150, 150;
		killmonster "[email protected]", "All";
		.start = 1;
		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
		sleep 7000;
		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
		sleep 7000;
		announce .npc$ + " We will start the event after 1 minute", bc_all;
		sleep 60000;
		announce .npc$ + " The entry to the event is now closed", bc_all;
		.start = 2;
		sleep 7000;
		
		if (getmapusers("[email protected]") < 1) {
			announce .npc$ + " Not enough participants to continue the event", 0;
			.start = 0;
			end;
		}
		
		mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
		
		.start = 3;
		sleep 55000;
		mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 4...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 3...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 2...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 1...", bc_map;
		sleep 1000;
		.start = 4;
		mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map;
		
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
		
		[email protected] = .MVP[rand(.size)];
		monster "[email protected]", 68, 68, "MVP A", [email protected], 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
		.ma = [email protected];
		monster "[email protected]", 71, 68, "MVP B", [email protected], 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
		.mb = [email protected];
		end;
		
	OnDie1:
		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (2 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
		warp "SavePoint", 0, 0;
		end;
		
	OnDie2:
		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (1 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
		warp "SavePoint", 0, 0;
		end;
	
	OnEventBet:
		mes .npc$;
		if (!.start)
			mes "The event is not active.";
		else if (.start != 3)
			mes "The event cannot accept bets at the moment.";
		else if (Zeny < .bet_cost)
			mes "You don't have enough zeny to make a bet.";
		else if (@mvp_bet)
			mes "You already placed your bet.";
		else if (strcharinfo(3) != "[email protected]")
			mes "Hmm~";
		else {
			mes "Which mvp will you bet on this match???";
			next;
			[email protected] = select("MVP A:MVP B");
			mes .npc$;
			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + ([email protected] == 1 ? "MVP A" : "MVP B") + "?";
			next;
			if (select("Yes:No") & 2) end;
			if (.start != 3) { // in case they delay the select ???
				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
				warp "SavePoint", 0, 0;
				end;
			}
			mes .npc$;
			mes "Good luck and have fun!";
			Zeny -= .bet_cost;
			@mvp_bet = [email protected];
		}
		end;
	
	OnEventJoin:
		if (!.start)
			message strcharinfo(0), "The event is not active.";
		else if (.start != 1)
			message strcharinfo(0), "The event is not yet allowing participants to enter.";
		else {
			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
			switch (rand(1,4)) {
				case 1:
					warp "[email protected]", 49, 50;
					break;
				case 2:
					warp "[email protected]", 49, 88;
					break;
				case 3:
					warp "[email protected]", 89, 88;
					break;
				case 4:
					warp "[email protected]", 89, 50;
					break;
			}
		}
		end;
	
	OnInit:
		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
		
		// List of MVP's
		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
		.size = getarraysize(.MVP);
	
		.npc$ = "[MVP vs MVP Event]";
		
		.bet_cost = 5000; // 5,000z to bet in the event
		.bet_rewd = 1000000; // 1,000,000z if bet wins
		
		end;
}

[email protected]	mapflag	monster_noteleport
[email protected]	mapflag	noskill
[email protected]	mapflag	noloot
[email protected]	mapflag	noitemconsumption
[email protected]	mapflag	nomemo
[email protected]	mapflag	nosave	SavePoint
[email protected]	mapflag	nowarpto
[email protected]	mapflag	nowarp
[email protected]	mapflag	noteleport

 

uhm, 1 question pls, i changed the mob to non-agresive, how can I make them fight each other?

 

On 8/25/2020 at 7:26 PM, Patskie said:
-	script	MVP_vs_MVP	FAKE_NPC,{
	
	OnMinute00:
		if (gettime(DT_HOUR) % 2 || .start) end;
		goto OnStart;
		end;
	
	OnStart:
		mapwarp "[email protected]", "prontera", 150, 150;
		killmonster "[email protected]", "All";
		.start = 1;
		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
		sleep 7000;
		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
		sleep 7000;
		announce .npc$ + " We will start the event after 1 minute", bc_all;
		sleep 60000;
		announce .npc$ + " The entry to the event is now closed", bc_all;
		.start = 2;
		sleep 7000;
		
		if (getmapusers("[email protected]") < 1) {
			announce .npc$ + " Not enough participants to continue the event", 0;
			.start = 0;
			end;
		}
		
		mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
		
		.start = 3;
		sleep 55000;
		mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 4...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 3...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 2...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 1...", bc_map;
		sleep 1000;
		.start = 4;
		mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map;
		
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
		
		.@mid = .MVP[rand(.size)];
		monster "[email protected]", 68, 68, "MVP A", .@mid, 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
		.ma = [email protected];
		monster "[email protected]", 71, 68, "MVP B", .@mid, 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
		.mb = [email protected];
		
		unitattack .ma, .mb;
		unitattack .mb, .ma;
		
		end;
		
	OnDie1:
		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (2 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
		warp "SavePoint", 0, 0;
		end;
		
	OnDie2:
		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (1 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
		warp "SavePoint", 0, 0;
		end;
	
	OnEventBet:
		mes .npc$;
		if (!.start)
			mes "The event is not active.";
		else if (.start != 3)
			mes "The event cannot accept bets at the moment.";
		else if (Zeny < .bet_cost)
			mes "You don't have enough zeny to make a bet.";
		else if (@mvp_bet)
			mes "You already placed your bet.";
		else if (strcharinfo(3) != "[email protected]")
			mes "Hmm~";
		else {
			mes "Which mvp will you bet on this match???";
			next;
			.@s = select("MVP A:MVP B");
			mes .npc$;
			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + (.@s == 1 ? "MVP A" : "MVP B") + "?";
			next;
			if (select("Yes:No") & 2) end;
			if (.start != 3) { // in case they delay the select ???
				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
				warp "SavePoint", 0, 0;
				end;
			}
			mes .npc$;
			mes "Good luck and have fun!";
			Zeny -= .bet_cost;
			@mvp_bet = .@s;
		}
		end;
	
	OnEventJoin:
		if (!.start)
			message strcharinfo(0), "The event is not active.";
		else if (.start != 1)
			message strcharinfo(0), "The event is not yet allowing participants to enter.";
		else {
			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
			switch (rand(1,4)) {
				case 1:
					warp "[email protected]", 49, 50;
					break;
				case 2:
					warp "[email protected]", 49, 88;
					break;
				case 3:
					warp "[email protected]", 89, 88;
					break;
				case 4:
					warp "[email protected]", 89, 50;
					break;
			}
		}
		end;
	
	OnInit:
		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
		
		// List of MVP's
		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
		.size = getarraysize(.MVP);
	
		.npc$ = "[MVP vs MVP Event]";
		
		.bet_cost = 5000; // 5,000z to bet in the event
		.bet_rewd = 1000000; // 1,000,000z if bet wins
		
		end;
}

[email protected]	mapflag	monster_noteleport
[email protected]	mapflag	noskill
[email protected]	mapflag	noloot
[email protected]	mapflag	noitemconsumption
[email protected]	mapflag	nomemo
[email protected]	mapflag	nosave	SavePoint
[email protected]	mapflag	nowarpto
[email protected]	mapflag	nowarp
[email protected]	mapflag	noteleport

 

works like a charm! thanks!!
one last question
i tried changing the bet and reward into credits which is id 3050,

i put the bet placement in

Quote
if (select("Yes:No") & 2) end;
            if (.start != 3) { // in case they delay the select ???
                setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
                warp "SavePoint", 0, 0;
                end;
            }
            mes .npc$;
            mes "How much will you bet? ^FF0000[[Maximum of 300 Credits]^000000";
            input .@betamount;
            if(.@betamount < 1 || .@betamount > countitem(3050))
                mes "You don't have enough credits!.";
            else if(.@betamount > 300)
                mes "Max of 300 credits only.";
                
            mes "Good luck and have fun!";
            delitem 3050,.@betamount;
            @mvp_bet = .@s;

 


i put the reward under 
 

Quote
      if (1 == @mvp_bet) {
            message strcharinfo(0),"Congratulations! You won the event, Good choice!";
            getitem 3050, 2*.@betamount;
        }

     if (2 == @mvp_bet) {
            message strcharinfo(0),"Congratulations! You won the event, Good choice!";
            getitem 3050, 2*.@betamount;
        }

 

the bet placement is working, where it will deduct the credit from inventory, 
but the reward when won is not given, can you pinpoint where I did wrong? thanks a lot!!

Share this post


Link to post
Share on other sites
  • 0
Quote
"[email protected]"     - A scope variable.
           They are unique to the instance and scope. Each instance has its
           own scope that ends when the script ends. Calling a function with
           callsub/callfunc starts a new scope, returning from the function
           ends it. When a scope ends, its variables are converted to values
           ('return [email protected];' returns a value, not a reference).

You have to used another way to store your bet amount. It's up to you to find out. I gave most of the mechanics already, besides you should detailed out your topic to prevent "1 question, last question" replies.

  • Love 1

Share this post


Link to post
Share on other sites
  • 0
Just now, Patskie said:

You have to used another way to store your bet amount. It's up to you to find out. I gave most of the mechanics already, besides you should detailed out your topic to prevent "1 question, last question" replies.

oh, i see, thanks a lot!!

sorry for the asking one question after another, i just happen to bump to it unexpectedly because I use the same [email protected] variable on another script and it's working...

thanks a lot!! it's working now!!!

Share this post


Link to post
Share on other sites
  • 0
On 8/25/2020 at 2:51 AM, Patskie said:

Try below script. I didn't test it too much

-	script	MVP_vs_MVP	FAKE_NPC,{
	
	OnMinute00:
		if (gettime(DT_HOUR) % 2 || .start) end;
		goto OnStart;
		end;
	
	OnStart:
		mapwarp "[email protected]", "prontera", 150, 150;
		killmonster "[email protected]", "All";
		.start = 1;
		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
		sleep 7000;
		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
		sleep 7000;
		announce .npc$ + " We will start the event after 1 minute", bc_all;
		sleep 60000;
		announce .npc$ + " The entry to the event is now closed", bc_all;
		.start = 2;
		sleep 7000;
		
		if (getmapusers("[email protected]") < 1) {
			announce .npc$ + " Not enough participants to continue the event", 0;
			.start = 0;
			end;
		}
		
		mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map;
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
		
		.start = 3;
		sleep 55000;
		mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 4...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 3...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 2...", bc_map;
		sleep 1000;
		mapannounce "[email protected]", .npc$ + " 1...", bc_map;
		sleep 1000;
		.start = 4;
		mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map;
		
		sleep 7000;
		mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
		
		[email protected] = .MVP[rand(.size)];
		monster "[email protected]", 68, 68, "MVP A", [email protected], 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
		.ma = [email protected];
		monster "[email protected]", 71, 68, "MVP B", [email protected], 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
		.mb = [email protected];
		end;
		
	OnDie1:
		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (2 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
		warp "SavePoint", 0, 0;
		end;
		
	OnDie2:
		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
		sleep 7000;
		killmonster "[email protected]", "All";
		.start = 0;
		addrid(5, 0, "[email protected]");
		
		if (1 == @mvp_bet) {
			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
			Zeny += .bet_rewd;
		}
		
		@mvp_bet = 0;
		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
		warp "SavePoint", 0, 0;
		end;
	
	OnEventBet:
		mes .npc$;
		if (!.start)
			mes "The event is not active.";
		else if (.start != 3)
			mes "The event cannot accept bets at the moment.";
		else if (Zeny < .bet_cost)
			mes "You don't have enough zeny to make a bet.";
		else if (@mvp_bet)
			mes "You already placed your bet.";
		else if (strcharinfo(3) != "[email protected]")
			mes "Hmm~";
		else {
			mes "Which mvp will you bet on this match???";
			next;
			[email protected] = select("MVP A:MVP B");
			mes .npc$;
			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + ([email protected] == 1 ? "MVP A" : "MVP B") + "?";
			next;
			if (select("Yes:No") & 2) end;
			if (.start != 3) { // in case they delay the select ???
				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
				warp "SavePoint", 0, 0;
				end;
			}
			mes .npc$;
			mes "Good luck and have fun!";
			Zeny -= .bet_cost;
			@mvp_bet = [email protected];
		}
		end;
	
	OnEventJoin:
		if (!.start)
			message strcharinfo(0), "The event is not active.";
		else if (.start != 1)
			message strcharinfo(0), "The event is not yet allowing participants to enter.";
		else {
			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
			switch (rand(1,4)) {
				case 1:
					warp "[email protected]", 49, 50;
					break;
				case 2:
					warp "[email protected]", 49, 88;
					break;
				case 3:
					warp "[email protected]", 89, 88;
					break;
				case 4:
					warp "[email protected]", 89, 50;
					break;
			}
		}
		end;
	
	OnInit:
		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
		
		// List of MVP's
		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
		.size = getarraysize(.MVP);
	
		.npc$ = "[MVP vs MVP Event]";
		
		.bet_cost = 5000; // 5,000z to bet in the event
		.bet_rewd = 1000000; // 1,000,000z if bet wins
		
		end;
}

[email protected]	mapflag	monster_noteleport
[email protected]	mapflag	noskill
[email protected]	mapflag	noloot
[email protected]	mapflag	noitemconsumption
[email protected]	mapflag	nomemo
[email protected]	mapflag	nosave	SavePoint
[email protected]	mapflag	nowarpto
[email protected]	mapflag	nowarp
[email protected]	mapflag	noteleport

 

Hello, is it possible to change (MVP A) and (MVP B) to MVPs Real Name?

 

Thanks!

Share this post


Link to post
Share on other sites
  • 0

Just wondering if it's possible to start when someone bet and
if only one there's a chance of winning 20% of the bet and if there's other better when someone win total of the bet in the npc will 20% deducted to the winner it's like tax

 

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.