Jump to content
  • 0

Run or Die event (BUG HELP !)


fallen0519

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

This is an automated event "Run or Die" event, I think there is something wrong with the script, whenever the last winner won, the prize goes to the 2nd players, whats wrong with the script, can anyone check it our for me please, hope there is pro scripter who can help me fix the script. Thank you.

prontera,150,138,5	script	Run Or Die	461,{
	if ( !.start ) {
		mes "no event atm";
		close;
	}
	if ( .start == 2 ) {
		mes "event is running";
		close;
	}
	if ( .register_count >= .register_limit ) {
		mes "this event has reach the maximum player participations";
		close;
	}
	percentheal 100,100;
	warp .map$, 0,0;
	.register_aid[ .register_count ] = getcharid(3);
	.register_count+++;
	end;
OnCommand:
OnClock1230: // put all your start timer here
OnClock1430:
OnClock1630:
OnClock1830:
	if ( .start ) end;
	announce "Run or Die event registration start", bc_all;
	.start = 1;
	sleep 50000; // registration timer here
	announce "Run or Die event registration close", bc_all;
	.start = 2;
	sleep 3000;
	mapannounce .map$, "Survive as long as you can !", bc_map;
	if ( .register_count < .register_min ) {
		announce "Not enough participants for Run or Die event", 0;
		getmapxy .@map$, .@x, .@y, 1;
		mapwarp .map$, .@map$, .@x, .@y;
		goto L_reset;
	}
	while ( .start == 2 ) {
		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;
		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;
		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;
		sleep 5000;
	}
	end;
OnPCDieEvent:
OnPCLogoutEvent:
	if ( !.start || strcharinfo(3) != .map$ ) end;
	while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;
	if ( .@i == .register_count ) end;
	deletearray .register_aid[.@i], 1;
	.register_count--;
	warp "SavePoint", 0,0;
	if ( .register_count > 1 ) end;
	killmonsterall .map$;
	announce "Congratulations ~ the winner of Run Or Die event got 3 TCG Card. - "+ rid2name( .register_aid ), bc_all;
	getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize
	warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) );
L_reset:
	deletearray .register_aid;
	.start = .register_count = 0;
	end;
OnInit:
	.map$ = "guild_vs5";
	.register_min = 1; // minimum amount of players to start this event, or else it auto-abort
	.register_limit = 100; // maximum amount of players able to participate in this event
	.reward_item_id = 7227; // reward item id
	.reward_item_amount = 3; // reward item amount to the sole winner

	bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;
	end;
}
guild_vs5	mapflag	nosave	SavePoint
guild_vs5	mapflag	nowarp
guild_vs5	mapflag	nowarpto
guild_vs5	mapflag	noteleport
guild_vs5	mapflag	nomemo
guild_vs5	mapflag	nopenalty
guild_vs5	mapflag	noicewall
//guild_vs5	mapflag	nobranch
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  281
  • Reputation:   14
  • Joined:  10/14/13
  • Last Seen:  

Hello!
Did you try removing that .registered_aid at getitem line?

 

Try this one

prontera,150,138,5	script	Run Or Die	461,{
	if ( !.start ) {
		mes "no event atm";
		close;
	}
	if ( .start == 2 ) {
		mes "event is running";
		close;
	}
	if ( .register_count >= .register_limit ) {
		mes "this event has reach the maximum player participations";
		close;
	}
	percentheal 100,100;
	warp .map$, 0,0;
	.register_aid[ .register_count ] = getcharid(3);
	.register_count+++;
	end;
OnCommand:
OnClock1230: // put all your start timer here
OnClock1430:
OnClock1630:
OnClock1830:
	if ( .start ) end;
	announce "Run or Die event registration start", bc_all;
	.start = 1;
	sleep 50000; // registration timer here
	announce "Run or Die event registration close", bc_all;
	.start = 2;
	sleep 3000;
	mapannounce .map$, "Survive as long as you can !", bc_map;
	if ( .register_count < .register_min ) {
		announce "Not enough participants for Run or Die event", 0;
		getmapxy .@map$, .@x, .@y, 1;
		mapwarp .map$, .@map$, .@x, .@y;
		goto L_reset;
	}
	while ( .start == 2 ) {
		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;
		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;
		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;
		sleep 5000;
	}
	end;
OnPCDieEvent:
OnPCLogoutEvent:
	if ( !.start || strcharinfo(3) != .map$ ) end;
	while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;
	if ( .@i == .register_count ) end;
	deletearray .register_aid[.@i], 1;
	.register_count--;
	warp "SavePoint", 0,0;
	if ( .register_count > 1 ) end;
	killmonsterall .map$;
	announce "Congratulations ~ the winner of Run Or Die event got 3 TCG Card. - "+ rid2name( .register_aid ), bc_all;
	getitem .reward_item_id, .reward_item_amount; // winner prize
	warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) );
L_reset:
	deletearray .register_aid;
	.start = .register_count = 0;
	end;
OnInit:
	.map$ = "guild_vs5";
	.register_min = 1; // minimum amount of players to start this event, or else it auto-abort
	.register_limit = 100; // maximum amount of players able to participate in this event
	.reward_item_id = 7227; // reward item id
	.reward_item_amount = 3; // reward item amount to the sole winner

	bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;
	end;
}
guild_vs5	mapflag	nosave	SavePoint
guild_vs5	mapflag	nowarp
guild_vs5	mapflag	nowarpto
guild_vs5	mapflag	noteleport
guild_vs5	mapflag	nomemo
guild_vs5	mapflag	nopenalty
guild_vs5	mapflag	noicewall
//guild_vs5	mapflag	nobranch
Edited by Ares
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Change :

.register_count+++;

to :

.register_count++;

The .register_aid array variable doesn't add players who register.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

Sorry Patskie, I did try to change to .register_count++; but still the WINNER will be the second player. Let me explain how the 2nd player won.

 

Player A and Player B join the event, Player B die from the Bomb Poring and shows (Return to Save Point) (Exit Game), that's why he can watch the other players who is playing still. When left only Player A in the event, when Player A died, automatic warped to the save point. Player B will automatically got the reward as Last Man Standing. 

 

I don't know how to solve it, hope anyone can help me wit this script.

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