Jump to content

Patskie

Community Contributors
  • Content Count

    366
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Patskie


  1. prontera,150,150,0	script	Sample	100,{	mes "Input your message";	next;	input .@m$;	close2;	if ( .@m$ != "" ) {		query_sql "SELECT `account_id` FROM `char` WHERE `base_level` < 20 AND `online` = '1'",.@aid;		while ( .@i < getarraysize(.@aid) ) {			if ( attachrid( .@aid[.@i] ) )				dispbottom "" + .@m$ + "";			detachrid;			.@i++;		}	}	end;}

  2. Maybe query all account id's on char table whose base level is < 20 and online <> 0 and then have a loop through those data gathered from the query_sql and attach their rid one by one? Not sure if this will work as i am not in my pc to test :P


  3. Credits to @Emistry he posted this on rA

    -	script	Sample	-1,{OnInit:// mob id range + target kill rangesetarray .mob_id_range,1001,2000;setarray .mob_kill_count,100,200;end;OnPCLoginEvent:.@gettime = atoi( gettimestr("%Y%m%d",21) );if( .@gettime != #today_mob ){	#today_mob = rand( .mob_id_range[0],.mob_id_range[1] );	#today_mob_count = rand( .mob_kill_count[0],.mob_kill_count[1] );}if( #today_mob_count )	dispbottom "Today you need to kill "+#today_mob_count+"x "+getmonsterinfo( #today_mob,MOB_NAME )+".";end;OnNPCKillEvent:if( killedrid == #today_mob && #today_mob_count ){	#today_mob_count--;	if( #today_mob_count ){		dispbottom "Left : "+#today_mob_count+"x "+getmonsterinfo( #today_mob,MOB_NAME )+".";	}else{		dispbottom "DONE";		getitem 512,1;		getitem 512,2;		getitem 512,3;	}}end;}

  4. prontera,150,150,0	script	Sample	123,{	if ( #timer > gettimetick(2) ) {		mes "[Sample]";		mes "Time left before you can use me : " +(#timer - gettimetick(2))+ " seconds.";		close;	}	mes "[Sample]";	mes "What you want to do?";	next;	if (select("Refresh Monster:Cancel") - 1) close;	mes "[Sample]";	mes "Done!";	#timer = gettimetick(2) + 3600000;	close2;	atcommand "@killmonster2";	end;}

  5. setarray :

    *setarray <array name>[<first value>],<value>{,<value>...<value>};This command will allow you to quickly fill up an array in one go. Checkthe Kafra scripts in the distribution to see this used a lot.	setarray @array[0], 100, 200, 300, 400, 500, 600;First value is the index of the first element of the array to alter. Forexample:	setarray @array[0],200,200,200;	setarray @array[1],300,150;will produce:@array[0]=200@array[1]=300@array[2]=150

     

    and getarraysize :

     

    *getarraysize(<array name>)This function returns the number of values that are contained inside thespecified array. Notice that zeros and empty strings at the end of thisarray are not counted towards this number.For example:	setarray @array[0], 100, 200, 300, 400, 500, 600;	set @arraysize,getarraysize(@array);This will make @arraysize == 6. But if you try this:	setarray @array[0], 100, 200, 300, 400, 500, 600, 0;	set @arraysize,getarraysize(@array);@arraysize will still equal 6, even though you've set 7 values.

     

    - set .Map$,"payon";- setmapflag .Map$,mf_loadevent;+ setarray .Map$,"payon","prontera";+	 for ( .@x = 0; .@x < getarraysize(.Map$); .@x++ )+		 setmapflag .Map$[.@x],mf_loadevent;

    This time since it triggers multiple maps via loadevent. You need to check if both players with same ip are in the same map.


  6. All job number :

     

     

    Job_Novice	0Job_Swordman	1Job_Mage	2Job_Archer	3Job_Acolyte	4Job_Merchant	5Job_Thief	6Job_Knight	7Job_Priest	8Job_Wizard	9Job_Blacksmith	10Job_Hunter	11Job_Assassin	12Job_Knight2	13Job_Crusader	14Job_Monk	15Job_Sage	16Job_Rogue	17Job_Alchem	18Job_Alchemist	18Job_Bard	19Job_Dancer	20Job_Crusader2	21Job_Wedding	22Job_SuperNovice	23Job_Gunslinger	24Job_Ninja	25Job_Xmas	26Job_Summer	27Job_Hanbok	28Job_Novice_High	4001Job_Swordman_High	4002Job_Mage_High	4003Job_Archer_High	4004Job_Acolyte_High	4005Job_Merchant_High	4006Job_Thief_High	4007Job_Lord_Knight	4008Job_High_Priest	4009Job_High_Wizard	4010Job_Whitesmith	4011Job_Sniper	4012Job_Assassin_Cross	4013Job_Lord_Knight2	4014Job_Paladin	4015Job_Champion	4016Job_Professor	4017Job_Stalker	4018Job_Creator	4019Job_Clown	4020Job_Gypsy	4021Job_Paladin2	4022Job_Baby	4023Job_Baby_Swordman	4024Job_Baby_Mage	4025Job_Baby_Archer	4026Job_Baby_Acolyte	4027Job_Baby_Merchant	4028Job_Baby_Thief	4029Job_Baby_Knight	4030Job_Baby_Priest	4031Job_Baby_Wizard	4032Job_Baby_Blacksmith	4033Job_Baby_Hunter	4034Job_Baby_Assassin	4035Job_Baby_Knight2	4036Job_Baby_Crusader	4037Job_Baby_Monk	4038Job_Baby_Sage	4039Job_Baby_Rogue	4040Job_Baby_Alchem	4041Job_Baby_Alchemist	4041Job_Baby_Bard	4042Job_Baby_Dancer	4043Job_Baby_Crusader2	4044Job_Super_Baby	4045Job_Taekwon	4046Job_Star_Gladiator	4047Job_Star_Gladiator2	4048Job_Soul_Linker	4049Job_Gangsi	4050Job_Death_Knight	4051Job_Dark_Collector	4052Job_Rune_Knight	4054Job_Warlock	4055Job_Ranger	4056Job_Arch_Bishop	4057Job_Mechanic	4058Job_Guillotine_Cross	4059Job_Rune_Knight_T	4060Job_Warlock_T	4061Job_Ranger_T	4062Job_Arch_Bishop_T	4063Job_Mechanic_T	4064Job_Guillotine_Cross_T	4065Job_Royal_Guard	4066Job_Sorcerer	4067Job_Minstrel	4068Job_Wanderer	4069Job_Sura	4070Job_Genetic	4071Job_Shadow_Chaser	4072Job_Royal_Guard_T	4073Job_Sorcerer_T	4074Job_Minstrel_T	4075Job_Wanderer_T	4076Job_Sura_T	4077Job_Genetic_T	4078Job_Shadow_Chaser_T	4079Job_Rune_Knight2	4080Job_Rune_Knight_T2	4081Job_Royal_Guard2	4082Job_Royal_Guard_T2	4083Job_Ranger2	4084Job_Ranger_T2	4085Job_Mechanic2	4086Job_Mechanic_T2	4087Job_Baby_Rune	4096Job_Baby_Warlock	4097Job_Baby_Ranger	4098Job_Baby_Bishop	4099Job_Baby_Mechanic	4100Job_Baby_Cross	4101Job_Baby_Guard	4102Job_Baby_Sorcerer	4103Job_Baby_Minstrel	4104Job_Baby_Wanderer	4105Job_Baby_Sura	4106Job_Baby_Genetic	4107Job_Baby_Chaser	4108Job_Baby_Rune2	4109Job_Baby_Guard2	4110Job_Baby_Ranger2	4111Job_Baby_Mechanic2	4112Job_Super_Novice_E	4190Job_Super_Baby_E	4191Job_Kagerou	4211Job_Oboro	4212Job_Rebellion 4215

     

     

     

    prontera,150,150,0	script	Sample	123,{	// Set all job number to allow to warp	setarray .Job[0],23,24,25;	.size = getarraysize(.Job);	while ( .@i < .size ) {		if ( .Job[.@i] != Class ) end;		 warp "prontera",0,0;		.@i++;	}	end;}

  7. Note that querying through the database is not updated from time to time. It has an interval. I intended to use query_sql though there are some commands like storagelist, cartlist etc. to be able to cater offline players.

    prontera,150,150,0	script	Sample	123,{	.npc$ = "[ " +strnpcinfo(1)+ " ]";	mes .npc$;	mes "Enter a character name";	next;	input .@name$;	if ( !query_sql("SELECT `char_id` FROM `char` WHERE `name` = '" +escape_sql(.@name$)+ "'") ) {		mes .npc$;		mes "Character doesn't exist";		close;	}	query_sql "SELECT `account_id`, `char_id` FROM `char` WHERE `name` = '" +escape_sql(.@name$)+ "'",.@aid,.@cid;	query_sql "SELECT `nameid`, `amount` FROM `storage` WHERE `account_id` = '" +.@aid+ "'",.@items, .@sa;	query_sql "SELECT `nameid`, `amount` FROM `inventory` WHERE `char_id` = '" +.@cid+ "'",.@invitems, .@ia;	mes .npc$;	mes "Here are the list of " +.@name$+ "'s items";	next;	mes .npc$;	mes "Storage inventory : ";	for ( .@i = 0; .@i < getarraysize(.@items); .@i++ )		mes "> (" +.@sa[.@i]+ ") " +getitemname(.@items[.@i]);	next;	mes .npc$;	mes "Item inventory : ";	for ( .@x = 0; .@x < getarraysize(.@invitems); .@x++ )		mes "> (" +.@ia[.@x]+ ") " +getitemname(.@invitems[.@x]);	if ( checkcart() ) {		next;		mes .npc$;		mes "Cart inventory : ";		query_sql "SELECT `nameid`, `amount` FROM `cart_inventory` WHERE `char_id` = '" +.@cid+ "'",.@ci, .@ca;		for ( .@y = 0; .@y < getarraysize(.@ci); .@y++ )			 mes "> (" +.@ca[.@y]+ ") " +getitemname(.@ci[.@y]);	}	close;}

  8. prontera,150,150,0	script	Sample	123,{	specialeffect2 313;    percentheal 100,100;	switch(select(""+(countitem(7227)>=1?"Level 1":"")+":"+(countitem(7227)>=2?"Level 2":"")+":"+(countitem(7227)>=3?"Level 3":""))) {		case 1: specialeffect2 37;				 sc_start SC_INC_AGI,600000,10;				specialeffect2 42;				 sc_start SC_BLESSING,600000,10;				delitem 7227, 1;				close;		case 2: for (.@i = 204; .@i < 209; .@i++ ) {					sc_start .@i,600000,10;				}				delitem 7227, 2;				close;		case 3: for (.@i = 204; .@i < 209; .@i++ ) {					sc_start .@i,600000,20;				}				delitem 7227, 3;				close;			}	end;}

  9. Hmm?

    prontera,150,150,0	script	Sample	-1,{	if (!countitem(7227)) end;	if ( BaseLevel == 2 ) {		specialeffect2 313;		percentheal 100,100;	} else if ( BaseLevel == 3 ) {		specialeffect2 313;		percentheal 100,100;		specialeffect2 37;		 sc_start SC_INC_AGI,600000,10;	} else if ( BaseLevel == 4 ) {		specialeffect2 313;		percentheal 100,100;		specialeffect2 37;		 sc_start SC_INC_AGI,600000,10;		specialeffect2 42;		 sc_start SC_BLESSING,600000,10;	}	delitem 7227, 1;	end;}

  10. prontera,150,150,0	script	Sample	123,{	if (!countitem(7227)) end;	specialeffect2 313;	percentheal 100,100;	specialeffect2 37;	 sc_start SC_INC_AGI,600000,10;	specialeffect2 42;	 sc_start SC_BLESSING,600000,10;    delitem 7227, 1;	end;}

  11. -	script	Sample	-1,{	OnInit:		bindatcmd "monster",strnpcinfo(3)+"::OnAtcommand",0,99;		end;	OnAtcommand:		atcommand "@monster " +implode(.@atcmd_parameters$, " ");		announce "[ "+strcharinfo(0)+" ] spawned "+(.@atcmd_parameters$[1]==""?1:.@atcmd_parameters$[1])+" "+getmonsterinfo(.@atcmd_parameters$[0], 0)+" on "+strcharinfo(3)+"!",0;		end;}

  12. Execute this on your database :

    CREATE TABLE IF NOT EXISTS `ragnarok`.`item_command` (	`char_name` VARCHAR(30) NOT NULL DEFAULT '',	 `won_id` VARCHAR(50) NOT NULL DEFAULT '',	`nameid` INT(11) NOT NULL DEFAULT '0',	`amount` INT(11) NOT NULL DEFAULT '0',	`date` DATE NOT NULL) ENGINE=MyISAM;

  13. Not sure about your idea to give 1 cash point whenever a certain player kills monster who's level is less than the baselevel - 10. It can be abuse :P

    -	script	Sample	-1,{	OnNPCKillEvent:		if (getmonsterinfo(killedrid, MOB_LV) > (BaseLevel + 10) || getmonsterinfo(killedrid, MOB_LV) < (BaseLevel - 10)) {			if (rand(100) < 5)				 #CASHPOINTS++;			dispbottom "You now have " +#CASHPOINTS+ " cash points.";		}		end;}
×
×
  • Create New...

Important Information

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