Jump to content

Capuche

Developer
  • Posts

    2,407
  • Joined

  • Last visited

  • Days Won

    49

Posts posted by Capuche

  1. Untested

    getpartymember getcharid(1),1;
    getpartymember getcharid(1),2;
    
    for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )
    	if (isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) == 0)
    		continue;
    	[email protected] = readparam( Class, [email protected][[email protected]] );
    	if (compare( [email protected]_list$, "|" + [email protected] + "|" ) == 1) {
    		mes "Sorry, only one " + jobname([email protected]) + " is allowed.";
    		close;
    	}
    	[email protected]_list$ += "|" + [email protected] + "|";
    }

     

    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,{
    	[email protected]_id = getcharid(1);
    	[email protected]_name$ = getpartyname([email protected]_id);
    	[email protected]_name$ = "Bossnia";
    
    	if (!instance_check_party([email protected]_id)) {
    		mes "Why don't you make a party with more than 1 person and talk to me again?";
    		close;
    	}
    	if (getcharid(0) == getpartyleader([email protected]_id,2))
    		[email protected]$ = "Generate Instance";
    	switch( select( [email protected]$, "Enter " + [email protected]_name$ + "", "Cancel" ) ) {
    	case 1:
    		switch( instance_create([email protected]_name$) ) {
    		case -3:
    			dispbottom "Memorial Dungeon, '" + [email protected]_name$ + "' is already in progress.",0xFFFFFF;
    			end;
    		case -4:
    		case -2:
    		case -1:
    			mes "Party Name: " + [email protected]_name$;
    			mes "Party Leader: " + strcharinfo(0);
    			mes "^0000ff" + [email protected]_name$ + "^000000 - time gap generation failed.";
    			close;
    		}
    		end;
    	case 2:
    		switch( instance_enter([email protected]_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), [email protected]_name$ + " party member " + strcharinfo(0) + " enters " + [email protected]_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 ( [email protected] = 0; [email protected] < 5; [email protected]++ ) {
    	if (countitem(.ID[[email protected]]) < .AM[[email protected]])
    		[email protected]$ += (.AM[[email protected]] - countitem(.ID[[email protected]])) + " x " + getitemname(.ID[[email protected]]) + "\n";
    }
    if ([email protected]$ != "") {
    	mes "You are missing the following items:";
    	mes [email protected]$;
    	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 [email protected]$, "[Lucy]";
    	setarray [email protected]_Zeny[0],
    		5000000,
    		10000000,
    		15000000,
    		25000000;
    	
    	// Zeny Detector
    	if (Zeny < [email protected]_Zeny[0]) {
    		mes [email protected]$;
    		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 [email protected]$;
    	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 [email protected]$;
    		mes "Okay then. See you later.";
    		close;
    	}
    	mes [email protected]$;
    	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 [email protected]$;
    	mes "You can only donate 1,000,000z or 5,000,000z.";// different from menu
    	next;
    	mes [email protected]$;
    	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 [email protected]$;
    	mes "How much money you want to donate?";
    	mes "Once you donate, I can't your money back.";
    	next;
    	[email protected] = getarraysize( [email protected]_Zeny );
    	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )
    		[email protected]$ += callfunc( "F_InsertComma", [email protected]_Zeny[[email protected]] ) + ":";		// dynamical menu
    	[email protected] = select([email protected]$) - 1;
    
    	if ($totaldonate >= 75000000) {		// already on
    		mes [email protected]$;
    		mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";
    		close;
    	}
    	if (Zeny < [email protected]_Zeny[[email protected]]) {	// re-check player zeny amount
    		mes [email protected]$;
    		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 - [email protected]_Zeny[[email protected]];
    	set $totaldonate, $totaldonate + [email protected]_Zeny[[email protected]];
    	mes [email protected]$;
    	mes "Thank you for donating " + callfunc( "F_InsertComma", [email protected]_Zeny[[email protected]] ) + "z!";
    	mes "We appreciate your generosity.";
    	announce "[Charity Lucy: "+strcharinfo(0)+"] has donated [" + callfunc( "F_InsertComma", [email protected]_Zeny[[email protected]] ) + "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 [email protected]$;
    	mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny.";
    	close;
    
    function Display_Timer {
    	[email protected] = getarg(0);
    	[email protected] = [email protected] / 3600;
    	[email protected] = ( [email protected] % 3600 ) / 60;
    	[email protected] = [email protected] % 60;
    	[email protected]$ = ([email protected] ? [email protected] + " hour" : "");
    	[email protected]$ += ([email protected]$ != "" ? " " : "") + ([email protected] ? [email protected] + " min" + ([email protected] > 1 ? "s" : "" ) : "");
    	[email protected]$ += ([email protected]$ != "" ? " " : "") + ([email protected] + " sec") + ([email protected] > 1 ? "s" : "" );
    	return [email protected]$;
    }
    
    OnInit:
    	if ($totaldonate < 75000000)
    		end;
    	[email protected]_left = $donation_timer - gettimetick(2);
    	if ([email protected]_left <= 0)
    		$totaldonate = 0;
    	else {
    		// unhide npc
    		while ([email protected]_left > 0) {
    			waitingroom Display_Timer( [email protected]_left ),0;
    			sleep 1000;
    			delwaitingroom;
    			[email protected]_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...

Important Information

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