Jump to content

cahadeyelo

Members
  • Posts

    170
  • Joined

  • Last visited

Posts posted by cahadeyelo

  1. BUILDIN_FUNC(mobcount)
    {
    	const char *mapname,*event;
    	int16 m;
    	mapname=script_getstr(st,2);
    	event=script_getstr(st,3);
    
    	if( strcmp(event, "all") == 0 )
    		event = NULL;
    	else
    		check_event(st, event);
    
    	if( strcmp(mapname, "this") == 0 ) {
    		struct map_session_data *sd;
    		if( script_rid2sd(sd) )
    			m = sd->bl.m;
    		else {
    			script_pushint(st,-1);
    			return SCRIPT_CMD_SUCCESS;
    		}
    	}
    	else if( (m = map_mapname2mapid(mapname)) < 0 ) {
    		script_pushint(st,-1);
    		return SCRIPT_CMD_SUCCESS;
    	}
    
    	script_pushint(st,map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event));
    	return SCRIPT_CMD_SUCCESS;
    }

    what codes do i need to replace so that the mobcount script will read the mob_id instead of event label?

  2. Hi fellow Rathenians, here i am requesting again of your precious time about a script or source code for item requirement before players can trade anything from another player. I know mail system can somehow bypass this function but i can work on it so please if there's a script for my request, i'll be forever grateful to you guys. 

  3. Hi rA community. Can i request a script that will teleport the player back to it's recent location after touching a specific npc.
     

    EXAMPLE SCENARIO:

    A player is happily farming on um_fild01 then triggers the script when he/she kills 100 Dryads. He/She will be teleported to sec_pri then after he/she clicks a walking/sliding npc inside prison. The npc will teleport him/her back to his/her recent exact location on um_fild01. And he/she lives happily ever after. Thank You.

     

  4. As always the rA community doesn't neglect to extend their assistance for those in needs.

    AND HERE'S MY FINAL VERSION THAT I COPIED FROM YOUR CODES SIR Winterfox.

     

    -	script	PARTY_DROP	-1,{
    	end;
    OnInit:
    	.min_online_partysize = 4;
    	setarray .item_arrays[0],505,1,10,502,1,20,501,1,30;
    	end;
    OnNPCKillEvent:
    .@pid = getcharid(1);
    if(.@pid == 0) end;
    
    	getpartymember .@pid,1;
    	getpartymember .@pid,2;
    	
    	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
    			.@online_partymembers++;
    					if($@partymembercount < .min_online_partysize && .@online_partymembers < .min_online_partysize) {
    					end;
    				}
    				else {
    			.@rnd = rand(1,100);
    			for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) {
    				if( .@rnd <= .item_arrays[.@i+2] ) {
    				getitem .item_arrays[.@i], .item_arrays[.@i+1];
    					}
    				}
    			}
    		}
    	}
    }

     

  5. A productive day rA community. I'm hoping that even on your busy day like now still you'll be able to help me on my script request.

    IT SHOUD BE LIKE THIS:

    - ONLY A PLAYER WITH PARTY MEMBERS OF 4 OR MORE HAVE TO GET THE RANDOM BONUS LOOTS. AND ELSE IF SOMEONE AT THAT PARTY BECAME OFFLINE, THE BONUS LOOTS WILL STOPS.

    -	script	PARTY_DROP	FAKE_NPC,{
    OnNPCKillEvent:
    .@pid = getcharid(1);
    	getpartymember .@pid,0;
    	getpartymember .@pid,1;
    	getpartymember .@pid,2;
    	
    	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
    			.@rnd = rand(1,100);
    			for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) {
    				if( .@rnd <= .item_arrays[.@i+2] ) {
    				getitem .item_arrays[.@i], .item_arrays[.@i+1];
    			}
    		}
    	} else {
    	message strcharinfo(0), "Some PARTY MEMBERS are offline.";
    	end;
    	}
    }
    OnInit:
    	setarray .item_arrays[0],505,1,10,502,1,20,501,1,30;
    	end;
    }

     

  6. I tried to use their script but when i use the command @autopot hp 502 90 1000 the script said Orange Potion is not a healing item.

    //===== rAthena Script =======================================
    //= Auto-Potion
    //===== Description: =========================================
    //= Provides an @autopot command to automatically use potions.
    //===== Changelogs: ==========================================
    //= 1.0 First version. [Euphy]
    //= 2.0 rewrite and adding SP option. [sader1992]
    //============================================================
    -	script	#autopot	-1,{
    OnInit:
    	.HP_Option = true;	//Allow HP option
    	.SP_Option = true;	//Allow SP option
    	.MinDelay = 100;	//Minimum Delay Allowed in milliseconds (Default and Recommended: 100) [lower values will increase server strain]
    	.MaxDelay = 1000;	//Maximum Delay Allowed in milliseconds (Default and Recommended: 1000)
    	setarray .blackList[0],0;	//Array of black listed item ID
    
    	if(!.HP_Option && !.SP_Option){
    		debugmes "Warning: @autopot both hp and sp are Disabled";
    		debugmes "Warning: @autopot script has been Disabled!";
    		end;
    	}
    	bindatcmd("autopot",strnpcinfo(0)+"::OnCommand",0,99);
    end;
    
    L_Help:
    	dispbottom "Available commands:";
    	if(.HP_Option && .SP_Option){
    		dispbottom "    @autopot <hp|sp> <item id> {<min hp|sp % [1..100]> {<delay [" + .MinDelay + ".."+.MaxDelay+"]>}}";
    		dispbottom "    @autopot <hp|sp> list";
    		dispbottom "    @autopot <hp|sp> <on|off>";
    	}else{
    		dispbottom "    @autopot <" + (.HP_Option?"hp":"sp") + "> <item id> {<min " + (.HP_Option?"hp":"sp") + " % [1..100]> {<delay [" + .MinDelay + ".."+.MaxDelay+"]>}}";
    		dispbottom "    @autopot <" + (.HP_Option?"hp":"sp") + "> list";
    		dispbottom "    @autopot <" + (.HP_Option?"hp":"sp") + "> <on|off>";
    	}
    	dispbottom "    @autopot info";
    	dispbottom "    @autopot help";
    	dispbottom "    @autopot blacklist";
    	return;
    
    L_Info:
    	dispbottom "----------Auto-Potion Information-----------";
    	if(.HP_Option){
    		dispbottom "HP POTION:  " + getitemname(@autopot_hp_ID) + " (" + @autopot_hp_ID + ")";
    		dispbottom "MIN HP:   " + @autopot_hp_Min + " %";
    	}
    	if(.SP_Option){
    		dispbottom "SP POTION:  " + getitemname(@autopot_sp_ID) + " (" + @autopot_sp_ID + ")";
    		dispbottom "MIN SP:   " + @autopot_sp_Min + " %";
    	}
    	dispbottom "DELAY:    " + @autopot_delay + " ms";
    	dispbottom "---------------------------------------------";
    	return;
    
    L_Start:
    	deltimer strnpcinfo(3) + "::OnStart";
    	.@type$  = getarg(0,0);
    	.@potion = getarg(1,0);
    	setd "@autopot_" + .@type$ + "_Min",getarg(2,0);
    	@autopot_delay = getarg(3,.MinDelay);
    
    	if (getd("@autopot_" + .@type$ + "_Min")   < 1  || getd("@autopot_" + .@type$ + "_Min") > 100)  setd "@autopot_" + .@type$ + "_Min",90;
    	if (@autopot_delay < .MinDelay) @autopot_delay = .MinDelay;
    	if (@autopot_delay > .MaxDelay) @autopot_delay = .MaxDelay;
    	if (getiteminfo(.@potion, ITEMINFO_TYPE) != IT_HEALING) {
    		dispbottom getitemname(.@potion) + " is not a healing item.";
    		end;
    	}
    	if(inarray(.blackList[0],.@potion) != -1){
    		message strcharinfo(0), "'" + getitemname(.@potion) + "' is black listed and cannot be used.";
    		end;
    	}
    	if (BaseLevel < getiteminfo(.@potion, ITEMINFO_EQUIPLEVELMIN)) {
    		message strcharinfo(0), "Your base level is too low to use '" + getitemname(.@potion) + "'.";
    		end;
    	}
    	setd "@autopot_" + .@type$ + "_ID",.@potion;
    	setd "@autopot_" + .@type$ + "_Active",true;
    	addtimer @autopot_delay,strnpcinfo(3) + "::OnStart";
    	message strcharinfo(0), "Auto-Potion " + strtoupper(.@type$) + " enabled.";
    	callsub L_Info;
    	return;
    
    OnCommand:
    	if (!getarraysize(.@atcmd_parameters$)) {
    		message strcharinfo(0), "Invalid syntax.";
    		callsub L_Help;
    		end;
    	}
    	.@command$[0] = strtolower(.@atcmd_parameters$[0]);
    	.@command$[1] = strtolower(.@atcmd_parameters$[1]);
    	
    	if(.@command$[0] == "hp" || .@command$[0] == "sp"){
    		if((!.HP_Option && .@command$[0] == "hp") || (!.SP_Option && .@command$[0] == "sp")){
    			message strcharinfo(0), "Auto-Potion " + strtoupper(.@command$[0]) + " is Disabled from The Server.";
    			end;
    		}
    		if(.@command$[1] == "on"){
    			if(getd("@autopot_" + .@command$[0] + "_Active")){
    				message strcharinfo(0), "Auto-Potion " + strtoupper(.@command$[0]) + " is already on.";
    				end;
    			}
    			if(!getd("@autopot_" + .@command$[0] + "_ID")){
    				dispbottom "You need to set a " + strtoupper(.@command$[0]) + " Potion to be used.";
    				callsub L_Help;
    				end;
    			}
    			callsub L_Start,.@command$[0],getd("@autopot_" + .@command$[0] + "_ID");
    			end;
    		}
    		if(.@command$[1] == "off"){
    			message strcharinfo(0), "Auto-Potion " + strtoupper(.@command$[0]) + " disabled.";
    			setd "@autopot_" + .@command$[0] + "_Active",false;
    			if(!@autopot_hp_Active || !@autopot_sp_Active)
    				deltimer strnpcinfo(3) + "::OnStart";
    			end;
    		}
    		if(.@command$[1] == "list"){
    			getinventorylist;
    			for(.@i = 0;.@i < @inventorylist_count;.@i++){
    				if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE) == IT_HEALING) {
    					.@items[.@count] = @inventorylist_id[.@i];
    					.@menu$ = .@menu$ + sprintf("~ ^0055FF%s^000000 (%dx)" + (inarray(.blackList[0],@inventorylist_id[.@i]) != -1? " ^364022Black Listed^000000":"") + (BaseLevel < getiteminfo(@inventorylist_id[.@i], ITEMINFO_EQUIPLEVELMIN)? " ^E82C0CNeed Higher Level^000000":"") + ":", getitemname(@inventorylist_id[.@i]), countitem(@inventorylist_id[.@i]));
    					.@count++;
    				}
    			}
    			if(.@count){
    				mes "[ Auto-Potion ]";
    				mes "Select a " + strtoupper(.@command$[0]) + " item.";
    				.@select = select(.@menu$ + "   ^777777Cancel^000000") - 1;
    				if (.@select != .@count)
    					callsub L_Start,.@command$[0],.@items[.@select];
    				close2;
    			}else{
    				message strcharinfo(0), "There are no healing items in your inventory.";
    			}
    			end;
    		}
    		.@potion = atoi(.@command$[1]);
    		.@percent = atoi(.@atcmd_parameters$[2]);
    		.@delay = atoi(.@atcmd_parameters$[3]);
    		if(getitemname(.@potion) != "null"){
    			callsub L_Start,.@command$[0],.@potion,.@percent,.@delay;
    			end;
    		}
    		message strcharinfo(0), "Auto-Potion : something went wrong!";
    		callsub L_Help;
    		end;
    	}
    	if(.@command$[0] == "blacklist"){
    		dispbottom "--------------Black Listed Items--------------";
    		for(.@i=0;.@i<getarraysize(.blackList);.@i++){
    			dispbottom "    " + getitemname(.blackList[.@i]) + " (" + .blackList[.@i] + ")";
    		}
    		dispbottom "---------------------------------------------";
    		end;
    	}
    	if(.@command$[0] == "info"){
    		if(@autopot_hp_Active || @autopot_sp_Active){
    			message strcharinfo(0), "Auto-Potion information is displayed below.";
    			callsub L_Info;
    		}else{
    			message strcharinfo(0), "Auto-Potion is not enabled.";
    		}
    		end;
    	}
    	if(.@command$[0] == "help"){
    		message strcharinfo(0), "List of commands is displayed below.";
    		callsub L_Help;
    		end;
    	}
    	
    	message strcharinfo(0), "Invalid syntax.";
    	callsub L_Help;
    end;
    
    OnStart:
    	if (!getstatus(SC_BERSERK) && !getstatus(SC_SATURDAYNIGHTFEVER) && !getstatus(SC_GRAVITATION) &&
    	    !getstatus(SC_TRICKDEAD) && !getstatus(SC_HIDING) && !getstatus(SC__SHADOWFORM) && !getstatus(SC__INVISIBILITY) &&
    	    !getstatus(SC__MANHOLE) && !getstatus(SC_KAGEHUMI) && !getstatus(SC_HEAT_BARREL_AFTER) &&
    		!getstatus(SC_STONE) && !getstatus(SC_FREEZE) && !getstatus(SC_STUN) && !getstatus(SC_SLEEP))
    		{
    		if(Hp){
    			if(@autopot_hp_Active && Hp * 100 / MaxHp < @autopot_hp_Min) {
    				if (countitem(@autopot_hp_ID)) {
    					delitem @autopot_hp_ID,1;
    					consumeitem @autopot_hp_ID;
    					specialeffect2 207;
    				}
    			}
    			if(@autopot_sp_Active && Sp * 100 / MaxSp < @autopot_sp_Min) {
    				if (countitem(@autopot_sp_ID)) {
    					delitem @autopot_sp_ID,1;
    					consumeitem @autopot_sp_ID;
    					specialeffect2 208;
    				}
    			}
    		}
    	}
    	if(@autopot_hp_Active || @autopot_sp_Active)
    		addtimer @autopot_delay,strnpcinfo(3) + "::OnStart";
    end;
    }

     

  7. 35 minutes ago, Winterfox said:
    function	script	ZENYLADDER	{
    	query_sql("SELECT `c`.`name`, `c`.`class`, `c`.`base_level`, `c`.`job_level`, `c`.`zeny`, `g`.`name` FROM `char` c LEFT JOIN (`guild` g) ON (`c`.`guild_id` = `g`.`guild_id`) ORDER BY `c`.`zeny` DESC LIMIT 100", .@names$, .@classes, .@blvls, .@jlvls, .@zeny, .@guilds$);	
    
    	mes "[ INFORMATION ]";
    	for(.@i = 0; .@i < 100; .@i++)
    	    mes "^0000FF" + (.@i + 1) + ".^000000 " + .@names$[.@i] + " - ^FF0000" + callfunc("F_InsertComma", .@zeny[.@i]) + "^000000z";
    	close;
    }

     

    it does what i wanted to do thanks but now all the names of the players that own the zeny are gone.

  8. Can someone help me with this script
     

    function	script	ZENYLADDER	{
    	query_sql("SELECT `c`.`name`, `c`.`class`, `c`.`base_level`, `c`.`job_level`, `c`.`zeny`, `g`.`name` FROM `char` c LEFT JOIN (`guild` g) ON (`c`.`guild_id` = `g`.`guild_id`) ORDER BY `c`.`zeny` DESC LIMIT 100", .@name$, .@class, .@blvl, .@jlvl, .@zeny, .@guild$);	
    
    	mes "[ INFORMATION ]";
    	for( set .@x,0; .@x<=99; set .@x,.@x+1 ) {
    	mes "^0000FF"+(.@x+1)+".^000000 "+.@name$[.@x]+" - ^FF0000"+.@zeny[.@x]+"^000000z";
    	}
    	close;
    }

    This shows the zeny ranking on my server, the problem is the value of the zeny isn't separated by place value it just shows like this 100000 not like this 100,000.

  9. why is it my floating rates didn't go back to normal after an hour, instead it keeps on multiplying after and after
     

    -	script	HappyHour	-1,{
    OnMinute01:
    	setbattleflag "base_exp_rate", 2*getbattleflag("base_exp_rate");
    	setbattleflag "job_exp_rate", 2*getbattleflag("job_exp_rate");
    	setbattleflag "item_rate_common", 2*getbattleflag("item_rate_common");
    	setbattleflag "item_rate_common_boss", 2*getbattleflag("item_rate_common_boss");
    	setbattleflag "item_rate_common_mvp", 2*getbattleflag("item_rate_common_mvp");
    	setbattleflag "item_rate_heal_boss", 2*getbattleflag("item_rate_heal_boss");
    	setbattleflag "item_rate_heal_mvp", 2*getbattleflag("item_rate_heal_mvp");
    	setbattleflag "item_rate_use_boss", 2*getbattleflag("item_rate_use_boss");
    	setbattleflag "item_rate_use_mvp", 2*getbattleflag("item_rate_use_mvp");
    	setbattleflag "item_rate_equip_boss", 2*getbattleflag("item_rate_equip_boss");
    	setbattleflag "item_rate_equip_mvp", 2*getbattleflag("item_rate_equip_mvp");
    	setbattleflag "item_rate_card_boss", 2*getbattleflag("item_rate_card_boss");
    	setbattleflag "item_rate_heal", 2*getbattleflag("item_rate_heal");
    	setbattleflag "item_rate_use", 2*getbattleflag("item_rate_use");
    	setbattleflag "item_rate_equip", 2*getbattleflag("item_rate_equip");
    	setbattleflag "item_rate_card", 2*getbattleflag("item_rate_card");
    	setbattleflag "item_rate_mvp", 2*getbattleflag("item_rate_mvp");
    	setbattleflag "item_rate_treasure", 2*getbattleflag("item_rate_treasure");
    	atcommand "@reloadmobdb";
    	announce "HAPPY HOUR IS NOW ACTIVE.",0;
    	sleep 3600000;
    	setbattleflag "base_exp_rate", getbattleflag("base_exp_rate")/2;
    	setbattleflag "job_exp_rate", getbattleflag("job_exp_rate")/2;
    	setbattleflag "item_rate_common", 2*getbattleflag("item_rate_common")/2;
    	setbattleflag "item_rate_common_boss", 2*getbattleflag("item_rate_common_boss")/2;
    	setbattleflag "item_rate_common_mvp", 2*getbattleflag("item_rate_common_mvp")/2;
    	setbattleflag "item_rate_heal_boss", 2*getbattleflag("item_rate_heal_boss")/2;
    	setbattleflag "item_rate_heal_mvp", 2*getbattleflag("item_rate_heal_mvp")/2;
    	setbattleflag "item_rate_use_boss", 2*getbattleflag("item_rate_use_boss")/2;
    	setbattleflag "item_rate_use_mvp", 2*getbattleflag("item_rate_use_mvp")/2;
    	setbattleflag "item_rate_equip_boss", 2*getbattleflag("item_rate_equip_boss")/2;
    	setbattleflag "item_rate_equip_mvp", 2*getbattleflag("item_rate_equip_mvp")/2;
    	setbattleflag "item_rate_card_boss", 2*getbattleflag("item_rate_card_boss")/2;
    	setbattleflag "item_rate_heal", 2*getbattleflag("item_rate_heal")/2;
    	setbattleflag "item_rate_use", 2*getbattleflag("item_rate_use")/2;
    	setbattleflag "item_rate_equip", 2*getbattleflag("item_rate_equip")/2;
    	setbattleflag "item_rate_card", 2*getbattleflag("item_rate_card")/2;
    	setbattleflag "item_rate_mvp", 2*getbattleflag("item_rate_mvp")/2;
    	setbattleflag "item_rate_treasure", 2*getbattleflag("item_rate_treasure")/2;
    	atcommand "@reloadmobdb";
    	announce "HAPPY HOUR HAS ENDED.",0;
    	end;
    
    }

     

  10. On 10/7/2017 at 12:01 AM, Akkarin said:

    What he linked you to isn't a guide for using VS.

    Right click on the yaml project and select "retarget". You should be given a dropdown box to select a version from. Choose the one it suggests (as this is the version you have installed on your pc). You should then be able to right click and select build.

    here's the result after selecting RETARGET and choosing the version that the VS suggested which is 8.1

    Untitled.jpg

×
×
  • Create New...