Jump to content

Patskie

Community Contributors
  • Content Count

    366
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Patskie


  1. -	script	Sample	-1,{	OnInit:		bindatcmd "giveitems",strnpcinfo( 3 )+"::OnCommnad",99,99;		end;	OnPCLoginEvent:		.players[ getarraysize( .players ) ] = getcharid( 3 );		end;	OnPCLogoutEvent:		for ( .@i = 0; .@i < getarraysize( .players ); .@i++ ) {			if ( getcharid( 3 ) == .players[ .@i ] )				deletearray .players[ .@i ], 1;		}		end;	OnCommnad:		if ( .@atcmd_numparameters < 2 )			message strcharinfo( 0 ),"Usage: @giveitems <item id> <item amount>";		else {			.@id = atoi( .@atcmd_parameters$[ 0 ] );			.@amount = atoi( .@atcmd_parameters$[ 1 ] );			.@map$ = strcharinfo( 3 );			.@origin = getcharid( 3 );			.c = 0;			if ( getitemname( .@id ) == "null" ) {				message strcharinfo( 0 ),"Ivalid item id";				end;			}			for ( .@i = 0; .@i < getarraysize( .players ); .@i++ ) {				if ( attachrid( .players[ .@i ] ) ) {					if ( strcharinfo( 3 ) == .@map$ && !getgmlevel() ) {						getitem .@id, .@amount;						.c++;					}				}			}			attachrid( .@origin );			message strcharinfo( 0 ),"Gave items to " + .c + " character" + ( .c > 1 ? "s" : "" );		}		end;}

    Try :3


  2. Change : 
    OnAtcommand:        atcommand "@me " +.Messages$[rand(getarraysize(.Messages$))];        end; 

    to :

    OnAtcommand:		if ( gettimetick(2) < #timer ) end;        atcommand "@me " +.Messages$[rand(getarraysize(.Messages$))];		#timer = gettimetick(2) + 10;        end;

  3. -	script	Sample	-1,{	OnInit:		bindatcmd "buff", strnpcinfo( 3 )+"::OnBuff";		end;	OnBuff:		if ( getgroupid() > 40 ) end;		specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10;		specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;		end;}

  4. -	script	Sample	-1,{	OnInit:		setarray .Maps$[0], "prontera","Prontera Midgard",							"payon","Payon Forest";		.size = getarraysize( .Maps$ );		for ( .@i = 0; .@i < .size; .@i += 2 )			setmapflag .Maps$[ .@i ], mf_loadevent;		end;	OnPCLoadMapEvent:		getmapxy( .@map$, .@x, .@y, 0 );		for ( .@i = 0; .@i < .size; .@i += 2 ) {			if ( .@map$ == .Maps$[ .@i ] )			announce "You entered map : " + .Maps$[ .@i + 1 ] + ".",bc_self;		}		end;}

  5. Replace : 

    for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {	if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {		attachrid $@partymemberaid[.@i];		if ( strcharinfo(3) != .@map$ || checkidle() > 10 )			continue;		if ( rand(4000) < 25 ) // .@rand_gc_drop ... 25/4000 = 1/160			getitem 512,1;		if ( rand(2000) < 5 ) // .@rand_sc_drop .... 5/2000 = 1/400			getitem 513,1;		if ( rand(1000) < 1 ) // .@rand_gc_drop .... 1/1000			getitem 511,1;	}}

    by :

    for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {	if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )		.c++;}for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {	if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {		attachrid $@partymemberaid[.@i];		if ( strcharinfo(3) != .@map$ || checkidle() > 10 || .c < 2 )			continue;		if ( rand(4000) < 25 ) // .@rand_gc_drop ... 25/4000 = 1/160			getitem 512,1;		if ( rand(2000) < 5 ) // .@rand_sc_drop .... 5/2000 = 1/400			getitem 513,1;		if ( rand(1000) < 1 ) // .@rand_gc_drop .... 1/1000			getitem 511,1;	}}.c = 0;

  6. -	script	Sample	-1,{	OnNPCKillEvent:		if ( getmonsterinfo( killedrid, MOB_MODE ) & 0x0020 ) {			if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {				if ( getmonsterinfo( killedrid, MOB_LV ) < 71 ) #CASHPOINTS += rand( 1, 50 );				else #CASHPOINTS += rand( 50, 100 );			} else #CASHPOINTS += rand( 1, 10 );		}		end;}

  7. prontera,150,150,0	script	Sample	100,{	if ( getcharid( 1 ) ) {		getpartymember getcharid( 1 ), 1;		getpartymember getcharid( 1 ), 2;		do {			.index = rand( $@partymembercount );			.random_member$ = rid2name( $@partymemberaid[ .index ] );		} while ( !isloggedin( $@partymemberaid[ .index ], $@partymembercid[ .index ] ) );		mes "Random member : " +.random_member$;	}	close;}

    A template


  8. -	script	custom_drop	-1,{	OnNPCKillEvent:		// Global Monster Kill Rewards		set .@rand_gc_drop, rand(1,4000);		if (.@rand_gc_drop <= 25) {			if ( !getcharid( 1 ) )				getitem 512, 1;			else {				getpartymember getcharid( 1 ), 1;				getpartymember getcharid( 1 ), 2;				for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {					if ( isloggedin( $@partymemberaid[ .@i ], $@partymembercid[ .@i ] ) ) {						if ( attachrid( $@partymemberaid[ .@i ] ) )							getitem 512, 1;					}				}			}		}		set .@rand_sc_drop, rand(1,2000);		if (.@rand_sc_drop <= 5) {			if ( !getcharid( 1 ) )				getitem 513, 1;			else {				getpartymember getcharid( 1 ), 1;				getpartymember getcharid( 1 ), 2;				for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {					if ( isloggedin( $@partymemberaid[ .@i ], $@partymembercid[ .@i ] ) ) {						if ( attachrid( $@partymemberaid[ .@i ] ) )							getitem 513, 1;					}				}			}		}		set .@rand_bc_drop, rand(1,1000);		if (.@rand_bc_drop <= 1) {			if ( !getcharid( 1 ) )				getitem 511, 1;			else {				getpartymember getcharid( 1 ), 1;				getpartymember getcharid( 1 ), 2;				for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {					if ( isloggedin( $@partymemberaid[ .@i ], $@partymembercid[ .@i ] ) ) {						if ( attachrid( $@partymemberaid[ .@i ] ) )							getitem 511, 1;					}				}			}		}		end;}

  9. Let me try :

     

    -	script	Sample	-1,{	OnAgitEnd:		query_sql "SELECT `account_id`, `char_id` FROM `guild_member` WHERE `guild_id` = '" + getcastledata( "prtg_cas01", 1 ) + "'",.@aid,.@cid;		for ( .@i = 0; .@i < getarraysize( .@aid ); .@i++ ) {			if ( isloggedin( .@aid[ .@i ], .@cid[ .@i ] ) ) {				if ( attachrid( .@aid[ .@i ] ) ) {					if ( !checkvending() ) {						for ( .@x = 0; .@x < getarraysize( .Items ); .@x+=2 ) 							getitem .Items[ .@x ], .Items[ .@x + 1 ];					}				}			}			if ( .include_offline ) {				for ( .@x = 0; .@x < getarraysize( .Items ); .@x+=2 ) {					if ( query_sql( "SELECT `nameid` FROM `inventory` WHERE `char_id` = '" + .@cid[ .@i ] + "' AND `nameid` = '" +.Items[ .@x ]+ "'" ) )						query_sql "UPDATE `inventory` SET `amount` = `amount` + " + .Items[ .@x + 1 ] + " WHERE `char_id` = '" + .@cid[ .@i ] + "' AND `nameid` = '" +.Items[ .@x ]+ "'";					else 						query_sql "INSERT INTO `inventory` ( `char_id`, `nameid`, `amount`, `identify` ) VALUES ( '" +.@cid[ .@i ]+ "' , '" +.Items[ .@x ]+ "', '" +.Items[ .@x + 1 ]+ "', '1')";				}			}		}			end;		OnInit:		.include_offline = 0; // Include offline guild members? ( 1 = Enabled | 0 = Disabled )		setarray .Items[0],501,5,7227,5; // Item Id, Item Amount		end;}
×
×
  • Create New...

Important Information

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