Jump to content
  • 0

Requesting Random Card Collector


fictionx

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

Hi, rathena im looking for a random card collector npc, every 2 hours the npc will be announce a randomly card that he is looking for. The players can change the card that has required and change the card for 'collector points'.

 

# Normal Cards will  give to the player 5 points

# MvP Cards will give to the player 10 points.

 

the limit points that the player can acquire per day is 100 points

 

 

Thank you, hope someone can help me with this request.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  



prontera,155,181,5	script	Sample#card_collect	757,{
	
	mes "Give me "+getitemname( .card_id );
	if ( select( "Give Card(s)","Cancel" ) == 1 ) {
		mes "how many?";
		input .@amount,0,countitem( .card_id );
		if ( .@amount ) {
			delitem .@amount;
			#CARDPOINTS += ( .@amount * .card_point );
		}
	}
	close;
	
	L_is_mvp:
		switch ( getarg( 0,0 ) ) {
			default: return 0;
			// case <mvp card id>:
			case 4001:
			case 4002:
			case 4003:
				return 1;
		}
		
	OnMinute00:
		if ( gettime(3) % 2 )
	OnInit:
		.card_id = rand( 4001,4500 );
		if ( callsub( L_is_mvp,.card_id ) ) {
			.card_point = 10;
		}
		else {
			.card_point = 1;
		}
		end;
}

something like this.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

up

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

ok, abusing SQL query

https://rathena.org/board/topic/73478-requesting-card-seller-script/?p=154617

 

prontera,155,185,5	script	Card collector	1_F_MARIA,{
	mes "["+ strnpcinfo(0) +"]";
	if ( !.start ) {
		mes "I'm not looking for any card right now.";
		close;
	}
	mes "Hi, I'm looking for "+ getitemname(.look4card) +", do you have it ?";
	next;
	.@count = countitem(.look4card);
	if ( !.@count ) {
		mes "["+ strnpcinfo(0) +"]";
		mes "Unfortunately you don't have the card I'm looking for";
		close;
	}
	input .@give, 0, .@count;
	mes "["+ strnpcinfo(0) +"]";
	if ( !.@give ) {
		mes "You are not giving me ? ... sob..";
		close;
	}
	mes "Thank You !!";
	delitem .look4card, .@give;
	collector_points += ( 5 + .checkmvp * 5 )* .@give;
	close;
OnMinute00:
	if ( gettime(3) % 1 ) end;
OnStart:
	.look4card = .allcardid[ rand( .allcards ) ];
	announce "["+ strnpcinfo(0) +"] I'm looking for "+ getitemname( .look4card ) +" !!!", bc_all;
	while ( .mvpcardid[.@i] != .look4card && .@i < .mvpcards ) .@i++;
	.checkmvp = ( .@i < .mvpcards )? 1 : 0;
	.start = true;
	sleep 30000; // last 30 seconds
	.start = false;
	announce "["+ strnpcinfo(0) +"] Thank you everyone for the participation.", bc_all;
	end;
OnInit:
	.@mobdb$ = checkre(0)? "mob_db_re" : "mob_db";
	.@itemdb$ = checkre(0)? "item_db_re" : "item_db";
	.allcards = query_sql("select "+ .@itemdb$ +".id from "+ .@itemdb$ +" right join "+ .@mobdb$ +" on "+ .@itemdb$ +".id = "+ .@mobdb$ +".dropcardid where type = 6 group by name_japanese", .allcardid);
	.mvpcards = query_sql("select "+ .@itemdb$ +".id from "+ .@itemdb$ +" right join "+ .@mobdb$ +" on "+ .@itemdb$ +".id = "+ .@mobdb$ +".dropcardid where mexp > 0 and type = 6 group by name_japanese;", .mvpcardid);
//	bindatcmd "test", strnpcinfo(0)+"::OnStart", 99, 100;
//	bindatcmd "value", strnpcinfo(0)+"::OnValue", 99, 100;
	end;
OnValue:
	dispbottom "Your currently collector points is "+ collector_points;
	if ( .start )
		dispbottom "looking for ID "+ .look4card;
	end;
}
... have to use codebox because this rathena script doesn't compatible with hercules ...

ok I stop play here for today, might come back here some other day again

EDIT: yeah Emistry ...

	OnMinute00:
		if ( gettime(3) % 2 )
	OnInit:
		.card_id = rand( 4001,4500 );
you know that, you missing the curly bracket right ?

this means ... it will trigger every hour, always read the line below this

but the rand only execute when Hour is 1,3,5,7,9,11

on other hour time, it doesn't random change the card ID

EDIT: when I was about to publish in hercules forum, I found I mess up @count and @give, fixed

Edited by AnnieRuru
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...