Jump to content
  • 0

LMS POINTS


Jade

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

how to add #LMSPOINTS on the winner? (lmspoints can be used in lms shop)
im currently using this script but the winner doesnt get any lms points
 

prontera,150,150,5	script	Last Man Standing	100,{
	if ( !.start ) {
		mes "no event at the moment";
		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 "guild_vs5", 0,0;
	.register_aid[ .register_count ] = getcharid(3);
	.register_count+++;
	end;
OnWhisperGlobal:
	if ( getgmlevel() < 60 ) end;
//OnClock0000: // put all your start timer here
OnClock0030:
OnClock0430:
OnClock0730:
OnClock1030:
OnClock1230:
OnClock1630:
OnClock1930:
OnClock2230:
//OnMinute30:
	if ( .start == 2 )
		callsub L_resetmap;
	else if ( .start == 1 )
		end;
	announce "LMS event registration start", 0;
	.start = 1;
	sleep 120000; // registration timer here
	announce "LMS event registration close", 0;
	.start = 2;
	sleep 3000;
	mapannounce "guild_vs5", "THIS IS SPARTA !!!!!", 0;
	if ( .register_count < .register_min ) {
		announce "not enough participants for LMS event", 0;
		mapwarp "guild_vs5", .map$, .x, .y;
		callsub L_resetmap;
		end;
	}
	gvgon "guild_vs5";
	pvpon "guild_vs5";
	end;
OnPCDieEvent:
OnPCLogoutEvent:
	if ( .start != 2 || strcharinfo(3) != "guild_vs5" ) end;
	while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;
	deletearray .register_aid[.@i], 1;
	.register_count--;
	warp "SavePoint", 0,0;
	if ( .register_count > 1 ) end;
	killmonsterall "guild_vs5";
	announce "congratulations ~ the winner of LMS event is "+ rid2name( .register_aid ), 0;
	getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize
	set #lmspoints,#lmspoints+1;
	dispbottom "Total LMS Points = "+#lmspoints;
	warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) );
	callsub L_reset;
	end;
L_resetmap:
	mapwarp "guild_vs5", .map$, .x, .y;
L_reset:
	.start = 0;
	deletearray .register_aid;
	.register_count = 0;
	pvpoff "guild_vs5";
	gvgoff "guild_vs5";
	return;
OnInit:
	getmapxy .map$, .x, .y, 1;
	.register_min = 4; // minimum amount of players to start this event, or else it auto-abort
	.register_limit = 50; // maximum amount of players able to participate in this event
	.reward_item_id = 674;
	.reward_item_amount = 2;
	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	nobranch
guild_vs5	mapflag	noicewall
guild_vs5	mapflag	pvp_noparty
guild_vs5	mapflag	pvp_noguild

 

Edited by Jade
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

No need to change the the register_aid saving or the point giving. 

You're just currently giving the points to the wrong person. Right now, you're checking the logout / die event, so you're on "losing char", and give points to him. You need to attach the script to the remaining char before completing the final stage.

Add this line:

	attachrid(.register_aid[0]);

After this one

killmonsterall "guild_vs5";

 

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

change this line.

set #lmspoints,#lmspoints+1;

to

set #lmspoints,#lmspoints + 1,.register_aid;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

21 minutes ago, crazyarashi said:

change this line.


set #lmspoints,#lmspoints+1;

to

set #lmspoints,#lmspoints + 1,.register_aid;

 

still no points on the winner ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  06/09/17
  • Last Seen:  

   You probably need to save the Char Id, instead of the Account ID, when you use: 

	.register_aid[ .register_count ] = getcharid(3);

    Change it to: 

	.register_aid[ .register_count ] = getcharid(0);

   And also use the solution @crazyarashi appointed. Sorry for my bad english and good luck ? 

*getcharid(<type>{,"<character name>"})

This function will return a unique ID number of the invoking character, or, if a
character name is specified, of that player.

Type is the kind of associated ID number required:

 0 - Character ID
 1 - Party ID
 2 - Guild ID
 3 - Account ID
 4 - Battle Ground ID
 5 - Clan ID

*set <variable>,<expression>{,<char_id>};
 

Edited by Wickedknight2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

when i changed it to this.. 

Quote

 You probably need to save the Char Id, instead of the Account ID, when you use: 


	.register_aid[ .register_count ] = getcharid(3);

    Change it to: 


	.register_aid[ .register_count ] = getcharid(0);

congratulations ~ the winner of LMS event is (null)    (stuck in the map, no rewards and no points given)

----
also whenever i checked .... there's still no points given ... 

i added dispbottom message...

dispbottom "Total LMS Points = "+#lmspoints,.register_aid;

but it can only be seen on the losing person ..

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

thank you @Alayne . fixed...

just also deleted this line in setting a point.

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