Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by Capuche

  1. Untested

    getpartymember getcharid(1),1;
    getpartymember getcharid(1),2;
    
    for ( .@i = 0; .@i < $@partymembercount; .@i++ )
    	if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) == 0)
    		continue;
    	.@class = readparam( Class, $@partymembercid[.@i] );
    	if (compare( .@job_list$, "|" + .@class + "|" ) == 1) {
    		mes "Sorry, only one " + jobname(.@class) + " is allowed.";
    		close;
    	}
    	.@job_list$ += "|" + .@class + "|";
    }

     

    EDIT : should still work

     

    • Upvote 1
  2. Untested

    // instance_db.txt
    // 100,Bossnia,1800,1800,guild_vs2,0,0
    
    
    prontera,154,187,5	script	test5	100,{
    	.@party_id = getcharid(1);
    	.@p_name$ = getpartyname(.@party_id);
    	.@md_name$ = "Bossnia";
    
    	if (!instance_check_party(.@party_id)) {
    		mes "Why don't you make a party with more than 1 person and talk to me again?";
    		close;
    	}
    	if (getcharid(0) == getpartyleader(.@party_id,2))
    		.@menu$ = "Generate Instance";
    	switch( select( .@menu$, "Enter " + .@md_name$ + "", "Cancel" ) ) {
    	case 1:
    		switch( instance_create(.@md_name$) ) {
    		case -3:
    			dispbottom "Memorial Dungeon, '" + .@md_name$ + "' is already in progress.",0xFFFFFF;
    			end;
    		case -4:
    		case -2:
    		case -1:
    			mes "Party Name: " + .@p_name$;
    			mes "Party Leader: " + strcharinfo(0);
    			mes "^0000ff" + .@md_name$ + "^000000 - time gap generation failed.";
    			close;
    		}
    		end;
    	case 2:
    		switch( instance_enter(.@md_name$) ) {
    		case IE_OTHER:
    			mes "An unknown error has occurred.";
    			close;
    		case IE_NOINSTANCE:
    			mes "The time gap is not yet open.";
    			close;
    		case IE_NOMEMBER:
    			mes "Your body is not fit to enter the time gap. You won't be able to get in if you're not in a party.";
    			close;
    		case IE_OK:
    			mapannounce strnpcinfo(4), .@p_name$ + " party member " + strcharinfo(0) + " enters " + .@md_name$ + "",bc_map,"0x00ff99";
    			end;
    		}
    	case 3:
    		end;
    	}
    }

    The script create an instance attached to the party. All party member can enter.

  3. *getareausers("<map name>",<x1>,<y1>,<x2>,<y2>)
    
    This function will return the count of connected characters which are located
    within the specified area - an x1/y1-x2/y2 square on the specified map.
    
    This is useful for maps that are split into many buildings, such as all the
    "*_in" maps, due to all the shops and houses.

     

    • Upvote 1
  4. setarray .ID[0],501,502,503,504,505;
    setarray .AM[0],1,2,3,4,5;
    
    for ( .@i = 0; .@i < 5; .@i++ ) {
    	if (countitem(.ID[.@i]) < .AM[.@i])
    		.@missing$ += (.AM[.@i] - countitem(.ID[.@i])) + " x " + getitemname(.ID[.@i]) + "\n";
    }
    if (.@missing$ != "") {
    	mes "You are missing the following items:";
    	mes .@missing$;
    	close;
    }

     

    • Upvote 1
  5. if (strcharinfo(3) == "prontera")
    	mes "you're already at prontera";
    else if (strcharinfo(3) == "payon")
    	mes "you're already at payon";
    else if (strcharinfo(3) == "aldebaran" || strcharinfo(3) == "geffen" || strcharinfo(3) == "yuno")
    	mes "you're already at aldebaran or geffen or yuno";

     

  6. Like this? (untested)

    //Charity NPC//
    //Ryonin//
    
    izlude,124,139,6    script    Lucy    101,{
    function Display_Timer;	// define function
    
    	if ($totaldonate >= 75000000)
    		end;
    
    	// Variables
    	set .@n$, "[Lucy]";
    	setarray .@donation_Zeny[0],
    		5000000,
    		10000000,
    		15000000,
    		25000000;
    	
    	// Zeny Detector
    	if (Zeny < .@donation_Zeny[0]) {
    		mes .@n$;
    		mes "Sorry, you dont have enough money to talk to me.";
    		mes "You need to have atleast ^FF00005,000,000z^000000.";
    		mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";		// '$' for permanent server variable
    		close;		// don't need end after close
    	}        
    	// Start
    	mes .@n$;
    	mes "Hello, Citizen of Ragnarok Offline.";
    	mes "Can I help you with something?";
    	next;
    	if (select("Yes, I would like to donate:No, Thank you") == 1) {
    		mes .@n$;
    		mes "Okay then. See you later.";
    		close;
    	}
    	mes .@n$;
    	mes "I was assigned by the ^DAA520 GM Team^000000 to collect the donation money.";
    	mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";
    	next;
    	mes .@n$;
    	mes "You can only donate 1,000,000z or 5,000,000z.";// different from menu
    	next;
    	mes .@n$;
    	mes "If I collected a total amount of ^FF000075,000,000^000000z.";
    	mes "I can activate this event:";
    	mes "Event: ^8B008BComodo Hat Festival Quest^000000.";
    	mes "Event Duration: ^006400[2 DAYS]^000000.";
    	next;
    	mes .@n$;
    	mes "How much money you want to donate?";
    	mes "Once you donate, I can't your money back.";
    	next;
    	.@size = getarraysize( .@donation_Zeny );
    	for ( .@i = 0; .@i < .@size; .@i++ )
    		.@menu$ += callfunc( "F_InsertComma", .@donation_Zeny[.@i] ) + ":";		// dynamical menu
    	.@s = select(.@menu$) - 1;
    
    	if ($totaldonate >= 75000000) {		// already on
    		mes .@n$;
    		mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";
    		close;
    	}
    	if (Zeny < .@donation_Zeny[.@s]) {	// re-check player zeny amount
    		mes .@n$;
    		mes "Sorry, you dont have enough money to talk to me.";
    		mes "You need to have atleast ^FF00005,000,000z^000000.";
    		mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";
    		close;
    	}     
    	set Zeny, Zeny - .@donation_Zeny[.@s];
    	set $totaldonate, $totaldonate + .@donation_Zeny[.@s];
    	mes .@n$;
    	mes "Thank you for donating " + callfunc( "F_InsertComma", .@donation_Zeny[.@s] ) + "z!";
    	mes "We appreciate your generosity.";
    	announce "[Charity Lucy: "+strcharinfo(0)+"] has donated [" + callfunc( "F_InsertComma", .@donation_Zeny[.@s] ) + "z] to Charity! We appreciate your generosity.",0;
    	if ($totaldonate >= 75000000) {
    		$donation_timer = gettimetick(2) + 86400;	// 86400 seconds = 2 days
    		donpcevent strnpcinfo(3) + "::OnInit";
    	}
    	next;
    	mes .@n$;
    	mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";
    	close;
    
    function Display_Timer {
    	.@time = getarg(0);
    	.@hour = .@time / 3600;
    	.@mins = ( .@time % 3600 ) / 60;
    	.@secs = .@time % 60;
    	.@string$ = (.@hour ? .@hour + " hour" : "");
    	.@string$ += (.@string$ != "" ? " " : "") + (.@mins ? .@mins + " min" + (.@mins > 1 ? "s" : "" ) : "");
    	.@string$ += (.@string$ != "" ? " " : "") + (.@secs + " sec") + (.@secs > 1 ? "s" : "" );
    	return .@string$;
    }
    
    OnInit:
    	if ($totaldonate < 75000000)
    		end;
    	.@time_left = $donation_timer - gettimetick(2);
    	if (.@time_left <= 0)
    		$totaldonate = 0;
    	else {
    		// unhide npc
    		while (.@time_left > 0) {
    			waitingroom Display_Timer( .@time_left ),0;
    			sleep 1000;
    			delwaitingroom;
    			.@time_left--;
    		}
    		// hidenpc
    		set $totaldonate, 0;
    		$donation_timer = 0;
    		announce "Charity Lucy: Charity Event for 2 Days has ended. Don't forget to donate to activate.",0;
    		sleep 10000;
    		announce "Charity Lucy: Thank you for your generosity.",0;
    	}
    	end;
    }

     

    EDIT : oh well I wasn't supposed to post the whole script in support section >.<

    • Upvote 3
×
×
  • Create New...