Jump to content

Eross

Members
  • Content Count

    12
  • Joined

Posts posted by Eross


  1. 2 minutes ago, Samuel said:

    It uses a plugin, you need to add the plugin he mentioned to make it work

    Ohh I get it ... Sorry for being such a noob hehe ... Gonna try It later when I come home ..I dont have compiler here at my office ,I think its an SRC file 


  2. Hi ! Im trying to make a bindatcmd script for @refresh but has a 5minutes cooldown ... I just wondering why is it always @refresh failed ???? here is my script 

     

    //===================================
    //
    // @refresh (Remove Stuck Players)
    //
    //===================================
    -	script	refresh	-1,{
    	OnInit:
    	set .Minutes,5;
    	bindatcmd "refresh",strnpcinfo(0)+"::OnAtcommand";
    	end;
    	OnAtcommand:
    	if( .DelayTime <= gettimetick(2)) {
    		mes "[@refresh]";
    		mes "Stuck on NPC or unable to move?";
    		mes "This command has 5 minute cooldown";
    		next;
    		mes "[@refresh]";		
    		mes "Use @refresh?";
    		switch(select("No.:Yes.")) {
    			case 1:
    				close;
    			case 2:
    				atcommand "@refresh";
    				set .DelayTime,gettimetick(2) + ( .Minutes * 60 );
    				close;
    			}	
    	} else if( .DelayTime > gettimetick(2) ){
            set .last,.DelayTime - gettimetick(2);
            set .@min,  .last % (24*60*60) % (60*60) / (60);
            set .@sec,  .last % (24*60*60) % (60*60) % (60);
    
    		message strcharinfo(0), "Wait for "+.@min+" minutes "+.@sec+" seconds before you can use @refresh again.";
    		end;
    	
    		}
    	}

     


  3. 9 hours ago, meko said:

    MF_LOADEVENT should be in uppercase. Also it might be faster to use a hash table than looping through the array (imagine having an array with 2k maps and doing a string comparison for each one of them every time someone enters the map)

    - script map_name -1,{ OnInit: .maps = htnew(); // create a new hash table // htput(.maps, "<map name>", "<map nick>"); htput(.maps, "prontera", "Prontera City, The Imperial Capital"); htput(.maps, "morocc", "Morroc Town, The Frontier"); htput(.maps, "geffen", "Geffen, The City of Magic"); htput(.maps, "payon", "Payon Town, The Upland Village"); htput(.maps, "alberta", "Alberta, The Port City"); htput(.maps, "izlude", "Izlude Town, The Satellite City of Prontera"); htput(.maps, "aldebaran", "Al De Baran, The Gate to the New World"); htput(.maps, "xmas", "Lutie, The City of Eternal Christmas"); htput(.maps, "comodo", "Comodo, The City of Fun and Celebrations"); htput(.maps, "yuno", "Juno, The Capital of the Commonwealth and Ancient Lore"); htput(.maps, "amatsu", "Amatsu, The New Land Discovered"); htput(.maps, "gonryun", "Gonryun, The Hermit Land"); htput(.maps, "umbala", "Umbala, The Lost Land"); htput(.maps, "niflheim", "Niffleheim, The Cold Land of Death"); htput(.maps, "louyang", "Louyang, The Fortress of Dragon"); htput(.maps, "new_1-1", "Training Ground"); htput(.maps, "sec_pri", "Valhalla Prison"); htput(.maps, "jawaii", "Jawaii, The Island of Love"); htput(.maps, "ayothaya", "Ayothaya, The Land of Majectic Culture"); htput(.maps, "einbroch", "Einbroch, The Steel City"); htput(.maps, "lighthalzen", "Lighthalzen, The City of Scientific Myths"); htput(.maps, "einbech", "Einbech, The Mining Town"); htput(.maps, "hugel", "Hugel, Between the Icy Moutain and Chilly Blue Sea"); htput(.maps, "rachel", "Rachel, The Capital City of Arunafeltz"); htput(.maps, "veins", "Veins, The Canyon Village"); htput(.maps, "mid_camp", "Rune Midgard Allied Forces Post"); .@it = htiterator(.maps); // create an iterator to loop through the table for (.@map$ = htifirstkey(.@it); hticheck(.@it); .@map$ = htinextkey(.@it)) { // we are only interested in the key so no need to htget() here setmapflag(.@map$, MF_LOADEVENT); } htidelete(.@it); // we're done with the iterator: deallocate it end; OnPCLoadMapEvent: // check whether it's in the hash table: if (.@nick$ = htget(.maps, strcharinfo(PC_MAP), "")) { announce(.@nick$, bc_self); } end; }

    
    -	script	map_name	-1,{
    
    OnInit:
    	.maps = htnew(); // create a new hash table
    
    	// htput(.maps, "<map name>", "<map nick>");
    	htput(.maps, "prontera", "Prontera City, The Imperial Capital");
    	htput(.maps, "morocc", "Morroc Town, The Frontier");
    	htput(.maps, "geffen", "Geffen, The City of Magic");
    	htput(.maps, "payon", "Payon Town, The Upland Village");
    	htput(.maps, "alberta", "Alberta, The Port City");
    	htput(.maps, "izlude", "Izlude Town, The Satellite City of Prontera");
    	htput(.maps, "aldebaran", "Al De Baran, The Gate to the New World");
    	htput(.maps, "xmas", "Lutie, The City of Eternal Christmas");
    	htput(.maps, "comodo", "Comodo, The City of Fun and Celebrations");
    	htput(.maps, "yuno", "Juno, The Capital of the Commonwealth and Ancient Lore");
    	htput(.maps, "amatsu", "Amatsu, The New Land Discovered");
    	htput(.maps, "gonryun", "Gonryun, The Hermit Land");
    	htput(.maps, "umbala", "Umbala, The Lost Land");
    	htput(.maps, "niflheim", "Niffleheim, The Cold Land of Death");
    	htput(.maps, "louyang", "Louyang, The Fortress of Dragon");
    	htput(.maps, "new_1-1", "Training Ground");
    	htput(.maps, "sec_pri", "Valhalla Prison");
    	htput(.maps, "jawaii", "Jawaii, The Island of Love");
    	htput(.maps, "ayothaya", "Ayothaya, The Land of Majectic Culture");
    	htput(.maps, "einbroch", "Einbroch, The Steel City");
    	htput(.maps, "lighthalzen", "Lighthalzen, The City of Scientific Myths");
    	htput(.maps, "einbech", "Einbech, The Mining Town");
    	htput(.maps, "hugel", "Hugel, Between the Icy Moutain and Chilly Blue Sea");
    	htput(.maps, "rachel", "Rachel, The Capital City of Arunafeltz");
    	htput(.maps, "veins", "Veins, The Canyon Village");
    	htput(.maps, "mid_camp", "Rune Midgard Allied Forces Post");
    
    	.@it = htiterator(.maps); // create an iterator to loop through the table
    	for (.@map$ = htifirstkey(.@it); hticheck(.@it); .@map$ = htinextkey(.@it)) {
    		// we are only interested in the key so no need to htget() here
    		setmapflag(.@map$, MF_LOADEVENT);
    	}
    	htidelete(.@it); // we're done with the iterator: deallocate it
    	end;
    
    OnPCLoadMapEvent:
    	// check whether it's in the hash table:
    	if (.@nick$ = htget(.maps, strcharinfo(PC_MAP), "")) {
    		announce(.@nick$, bc_self);
    	}
    	end;
    }

     

    THANKYOU SIR !!!!

     

     

    Edited:

     

    Sir I think its not working ? or is there something wrong like typographical error ??

    image.thumb.png.05865f84b07f663bdfb65beaf3c332ef.png


  4. Guys, I need help on this one why its not working ? hmmm map name announcer .. im new here in herc thankyou

    -	script	map_name	-1,{
    OnInit:
    setarray .Map$[0], // <mapname>,<Map Nick>,
    			"prontera","Prontera City, The Imperial Capital",
    			"morocc","Morroc Town, The Frontier",
    			"geffen","Geffen, The City of Magic",
    			"payon","Payon Town, The Upland Village",
    			"alberta","Alberta, The Port City",
    			"izlude","Izlude Town, The Satellite City of Prontera",
    			"aldebaran","Al De Baran, The Gate to the New World",
    			"xmas","Lutie, The City of Eternal Christmas",
    			"comodo","Comodo, The City of Fun and Celebrations",
    			"yuno","Juno, The Capital of the Commonwealth and Ancient Lore",
    			"amatsu","Amatsu, The New Land Discovered",
    			"gonryun","Gonryun, The Hermit Land",
    			"umbala","Umbala, The Lost Land",
    			"niflheim","Niffleheim, The Cold Land of Death",
    			"louyang","Louyang, The Fortress of Dragon",
    			"new_1-1","Training Ground",
    			"sec_pri","Valhalla Prison",
    			"jawaii","Jawaii, The Island of Love",
    			"ayothaya","Ayothaya, The Land of Majectic Culture",
    			"einbroch","Einbroch, The Steel City",
    			"lighthalzen","Lighthalzen, The City of Scientific Myths",
    			"einbech","Einbech, The Mining Town",
    			"hugel","Hugel, Between the Icy Moutain and Chilly Blue Sea",
    			"rachel","Rachel, The Capital City of Arunafeltz",
    			"veins","Veins, The Canyon Village",
    			"mid_camp","Rune Midgard Allied Forces Post";
    
    for( set .i,0; .i < getarraysize( .Map$[ .i ] ) - 1; set .i,.i + 2 )
    	setmapflag .Map$[.i],mf_loadevent;
    end;
    
    OnPCLoadMapEvent:
    for( set .i,0; .i < getarraysize( .Map$[ .i ] ) - 1; set .i,.i + 2 )
    	if( strcharinfo(3) == .Map$[.i] )
    		announce ""+.Map$[.i+1]+"",bc_self;
    end;
    }

     


  5. On 8/23/2020 at 8:43 PM, MikZ said:

    Hi @meko

     

    Good day!
    I did check in https://haru.ws/scriptchecker/#output and got this error. Haven't tried in my server yet.

     

    image.png.18be65e13a59568b3a9580e3201d770f.png

    Sorry to bring this thread up again ,, Its the only topic that matched my problem .. I tried this one changing to array_find and loading the manipulation script but still the same ... 

    heres my script 

    -	script	warp_block	-1,{
    OnInit:
    	bindatcmd "warp",strnpcinfo(3)+"::OnAtcommandWarp",20,99;
    	bindatcmd "recall",strnpcinfo(3)+"::OnAtcommandRecall",20,99;
    	//setarray .maps_from$[0], "guild_01", "guild_02"; // Maps they cannot warp from.
    	setarray .maps$[0], // Maps they cannot warp to.
    		"gld2_pay", // GLD DUNGEON
    		"gld_dun01_2", // GLD DUNGEON
    		"gld_dun01", // GLD DUNGEON
    		"gld2_ald", // GLD DUNGEON
    		"gld_dun02_2", // GLD DUNGEON
    		"gld_dun02", // GLD DUNGEON
    		"gld2_prt", // GLD DUNGEON
    		"gld_dun03_2", // GLD DUNGEON
    		"gld_dun03", // GLD DUNGEON
    		"gld2_gef", // GLD DUNGEON
    		"gld_dun04_2", // GLD DUNGEON
    		"gld_dun04", // GLD DUNGEON
    		"schg_dun01", // GLD DUNGEON
    		"teg_dun01", // GLD DUNGEON
    		"teg_dun02", // GLD DUNGEON
    		
    		"odin_tem01", 
    		"odin_tem02", 
    		"rachel", 
    		"lighthalzen", 
    		"lhz_dun01", 
    		"lhz_dun02", 
    		"lhz_dun03", 
    		"hugel", 
    		"veins", 
    		"ve_fild01", 
    		"ve_fild02", 
    		"ve_fild03", 
    		"thor_v01", 
    		"thor_v02", 
    		"thor_v03", 
    		"moc_pryd06", 
    		"ra_fild02", 
    		"ra_fild03", 
    		"ra_fild04", 
    		"lou_dun03", 
    		"prt_maze03", 
    		"bra_dun02", 
    		"splendide", 
    		"manuk", 
    		"man_fild02", 
    		"dic_fild01", 
    		"dic_fild02", 
    		"spl_fild01", 
    		"spl_fild02", 
    		"spl_fild03", 
    		"moc_fild22", 
    		"moc_fild21", 
    		"gl_chyard", 
    		"abyss_03", 
    		"gef_dun02", 
    		"treasure02", 
    		"pay_fild11", 
    		"gon_dun03", 
    		"abbey02", 
    		"abbey03", 
    		"xmas_fild01", 
    		"ra_san05", 
    		"prt_sewb4", 
    		"mosk_dun03", 
    		"ama_dun03", 
    		"kh_dun02", 
    		"xmas_dun02", 
    		"ice_dun03", 
    		"ice_dun02", 
    		"ice_dun01", 
    		"ayo_dun02", 
    		"niflheim", 
    		"anthell02", 
    		"mjolnir_04", 
    		"pay_dun04", 
    		"2@nyd", 
    		"moc_prydn2", 
    		"gef_fild02", 
    		"gef_fild14", 
    		"gef_fild10", 
    		"moc_pryd04", 
    		"in_sphinx5", 
    		"moc_fild17", 
    		"ein_dun02", 
    		"einbroch", 
    		"beach_dun", 
    		"thana_boss", 
    		"tur_dun04", 
    		"jupe_core", 
    		"nameless_n", 
    		"1@tower", 
    		"2@tower", 
    		"3@tower", 
    		"4@tower", 
    		"5@tower", 
    		"6@tower", 
    		"payon"; 		
    		end;
    
    OnAtcommandWarp:
    	if (getgmlevel() == 99 ) goto Bypass_Script_Warp;
    	if(array_find(.maps$[0], strcharinfo(3))>-1) {
    		message strcharinfo(0), "You can't open use warp here!";
    		end;
    	} else if (inarray(.maps$[0], .@atcmd_parameters$)>-1) {
    		message strcharinfo(0), "You can't warp to that map!";
    		end;
    	}
    Bypass_Script_Warp:
    	if(.@atcmd_numparameters)
    		atcommand "@warp "+ implode(.@atcmd_parameters$, " ");
    	else
    		atcommand "@warp";
    	end;
    OnAtcommandRecall:	
    	if(inarray(.maps$[0], strcharinfo(3))>-1) {
    		message strcharinfo(0), "You can't use recall here!";
    		end;
    	}
    	if(.@atcmd_numparameters)
    		atcommand "@recall "+ implode(.@atcmd_parameters$, " ");
    	else
    		atcommand "@recall";
    	end;
    }
    

     


  6. Hi! recently I asked for a help from a rathena dev to make an NPC that will require players donation to activate ,,, Its working on Hercules ,however, when the event is running ,after the server restart the rates of server is returning to its original rate and the announcement on login turns into 'Base exp: 0x Job exp: 0x' 

     

    heres my script .. Thanks !

     

    Quote
    
    //============================================================
    //= Donation Floating Server Rates
    //============================================================
    
    prontera,123,209,6	script	Rates Broker#FloatingRates	4_M_KHKYEL,{
    
    		//set $floating_rates_hours_left,0;
    		//set $fr_delay,0;
    	if ($fr_delay > gettimetick(2) && .fr_delay) {
    			mes .npc$;
    			mes "I'm afraid you'll have to wait " + Time2Str($fr_delay) + " before you can donate again.";
    			close;
    	}
    	if ($floating_rates_hours_left > 0) {
    		.@seconds_left = 3600 - (gettime(2) * 60 + gettime(1));
    		.@hours_left = ($floating_rates_hours_left - 1) * 3600;
    		.@time_left = .@seconds_left + .@hours_left;
    		
    		.@dun_d = .@time_left / 86400;
    		.@dun_h = (.@time_left / 3600) % 24;
    		.@dun_m = (.@time_left / 60) % 60;
    		.@dun_s = .@time_left % 60;
    		
    		if (.@dun_d > 0) {
    			.@remaining$ = .@dun_d + " day" + (.@dun_d > 1 ? "s" : "") + " and ";
    		}
    		
    		.@remaining$ = .@remaining$ + (.@dun_h < 10 ? "0" : "")+.@dun_h+":"+(.@dun_m < 10 ? "0" : "")+.@dun_m+":"+(.@dun_s < 10 ? "0" : "")+.@dun_s;
    		
    		mes .npc$;
    		mes "Floating Rate event will end in";
    		mes "^0000ff"+.@remaining$+"^000000";
    		mes "^666666Use^000000 ^0000ff@rates^000000 ^666666to see current rates^000000.";
    		//mes "Current rates are:";
    		//mes "Base Exp: ^0000ff"+($@brate/100)+"."+($@brate-$@brateminus)+"^000000x Job Exp: ^0000ff"+($@jrate/100)+"."+($@jrate-$@jrateminus)+"^000000x";
    		close;
    	}
    	
    	mes .npc$;
    	mes "Server's current total funds are:";
    	mes "~ [^0000ff" + callfunc("F_InsertComma",$fr_zeny) + "^000000] Zeny";
    	mes ""+callfunc("F_InsertComma",$fr_diff)+" more Zeny to reach target funds."; 
    	//mes "Target funds to initiate: ^ff0000*" + callfunc("F_InsertComma",.fr_td) + " Zeny*^000000";
    	mes "Exp Rates: ^0000ffRandom (5.00x ~ 8.00x)";
    	mes "^ff0000NOTE:^000000 After reaching our"; 
    	mes "target funds, the floating rate";
    	mes "event will start right away";
    	mes "and will change rates every ^0000ff[Clock 00]^000000."; 
    	mes "^66666601:00, 02:00, 03:00, 04:00^000000 so on for the next 48 hours.";
    	next;
    	mes .npc$;
    	mes "^ff0000WARNING!:^000000 Minutes that has passed before the event starts will not be counted on event timer.";
    	mes "For example, the event started at";
    	mes "04:35, the minutes from 04:00-04:35 will set to ^666666'NULL'^000000 on our timer.";
    	mes "Therefore, instead of having 48hours event, you'll only get 47hours & 25minutes";
    	mes "(Less the minutes passed). That's why we highly suggest to reach target funds within first";
    	mes "one to ten minute of an hour. ^ff0000Always check server time before trying to initiate the event.^000000";
    	next;
    	mes .npc$;
    	mes "Would you like to donate?";
    	next;
    	
    	switch(select("Yes:No")) {
    		case 1:
    Change_Amount:			
    			mes .npc$;
    			mes "Please input desired amount.";
    			next;
    			input .@fr_zeny;
    			
    			if (.@fr_zeny < 1) {
    				mes .npc$;
    				mes "Input number greater than 0.";
    				end;		
    			}
    			mes .npc$;
    			mes "Please confirm Zeny transfer.";
    			next;
    			
    			switch(select("Cancel:Change Amount:Confirm")) {
    				case 1:
    					close;
    				case 2:
    					.@fr_zeny = 0;
    					next;
    					goto Change_Amount;
    					close;
    				case 3:
    					if (Zeny < .@fr_zeny) {
    						mes .npc$;
    						mes "Sorry, but you don't have enough";
    						mes "zeny to donate.";
    						close;
    					}	
    					if (.@fr_zeny > $fr_diff) {
    						mes .npc$;
    						mes "The amount you entered will exceed on remaining balance.";
    						mes "Remaining Balance: "+callfunc("F_InsertComma",$fr_diff)+" Zeny";
    						mes "^ff0000*Please input exact amount next time*.";
    						close;
    					}
    					if (.@fr_zeny == $fr_diff && (gettime(2) > 10)) {
    						mes .npc$;
    						mes "^ff0000Warning:Minutes that has passed will not be counted on 48hour duration of this event.";
    						mes "It'll be best if you start this event on the first 1 to 10 minutes to maximize event time period.^000000";
    						next;
    							switch (select("Okay, Ill be back later.:I don't care! Bring it on!")) {
    								case 1:
    									close;
    								case 2:
    									goto Initiate_FR;
    							}
    					}	
    					Initiate_FR:	
    					mes .npc$;
    					mes "Zeny has succesfully transfered.";
    					Zeny -= .@fr_zeny;
    					$fr_zeny += .@fr_zeny;
    					$fr_diff -= .@fr_zeny;
    					
    					if ($fr_zeny >= .fr_td) {
    						$fr_zeny = 0;	
    						announce ""+.npc$+": We reached our target funds! Activating Floating Rates Event...",bc_all,0xFF6060;					
    						// Up to you whether you want to add an extra hour or not, as otherwise the event will be below 48 hours.
    						$floating_rates_hours_left = 48;
    						donpcevent strnpcinfo(0) + "::OnMinute00";
    					}
    					
    					close;
    			}
    			
    			break;
    		case 2:
    			close;
    			break;
    	}
    	
    	end;
    OnInit:
    //Script Settings
    	.fr_delay = 120;            // Quest delay, in hours (0 to disable).
    	.fr_td = 5000000; 						//Target donation amount
    	$fr_diff = .fr_td - $fr_zeny; 			//Difference between target funds and balance
    	.npc$ = "[Rates Broker]"; 				//NPC Name
    	if ($floating_rates_hours_left > 0) { end; }
    OnMinute00:
    	if (gettime(2) == 0) {
    		$floating_rates_hours_left--;
    	}
    	
    	if ($floating_rates_hours_left < 0) {
    		end;
    	}
    	else if ($floating_rates_hours_left == 0) {
    		$floating_rates_hours_left = -1;
    		.@default_brate = 500;
    		.@default_jrate = 500;
    		
    		if (getbattleflag("base_exp_rate") != .@default_brate) {
    			setbattleflag("base_exp_rate", .@default_brate);
    		}
    		
    		if (getbattleflag("job_exp_rate") != .@default_jrate) {
    			setbattleflag("job_exp_rate", .@default_jrate);
    		}
    		$fr_delay = gettimetick(2) + (.fr_delay * 3600);
    		announce ""+.npc$+": Event is over, rates were changed back to: Base Exp ~ "+(.@default_brate/100)+"x Job Exp ~ "+(.@default_jrate/100)+"x ",bc_all,0xFF6060;
    		end;
    	}
    	
    	$@brate = rand(600,800);
    	$@jrate = rand(600,800);
    	//$@drate = rand(100,150);
    	//Base exp
    	setbattleflag("base_exp_rate",$@brate);
    	//Job exp
    	setbattleflag("job_exp_rate",$@jrate);
    	$@brateminus = ($@brate/100) * 100;
    	$@jrateminus = ($@jrate/100) * 100;
    	announce ""+.npc$+": Current rates are: Base Exp ~ "+($@brate/100)+"."+($@brate-$@brateminus)+"x Job Exp ~ "+($@jrate/100)+"."+($@jrate-$@jrateminus)+"x ",bc_all,0xFF6060;
    	
    	if ($floating_rates_hours_left == 1) {
    		announce ""+.npc$+": There is one hour left before the event will end.",bc_all,0xFF6060;
    	}
    	
    	end;
    	
    OnPCLoginEvent:
    	if ($floating_rates_hours_left > 0) {
    		dispbottom "Current server rates are: Base Exp ~ "+($@brate/100)+"."+($@brate-$@brateminus)+"x Job Exp ~ "+($@jrate/100)+"."+($@jrate-$@jrateminus)+"x [Floating Rates Event: Enabled]",0xFF6060;
    		end;
    	}
    	if ($floating_rates_hours_left == 0) {
    		dispbottom "Current server rates are: Base Exp ~ "+(.@default_brate/100)+"x Job Exp ~ "+(.@default_jrate/100)+"x [Floating Rates Event: Disabled]",0xFF6060;		
    		end;
    	}
    }

     

     


  7. Hi ! I just changed my cash shop currency into item 7179 ,,Instead of asking me to buy it using #CASHPOINTS I made it able to buy using item (credits to @anacondaq).. The Question is how will I change these ? 

     

    1. FREE CASH POINTS must read my PROOF OF DONATION or item 7179 from inventory not my cashpoints 

    2. Change "C" into "PODS"

     

     

    Please help .. I dont know how msgstringtable works there are codes like %s %d etc . thankyou ! 

     

     

    Untitled.png


  8. Good day, I know asking for old RO is kinda weird because many prefered latest, I just want to explore since I didnt tried to create classic one ..I just want to ask if old clients are compatible with latest svn server files ? can I request for old clients I mean full clients not just ragexe or sakexe but with files like data files or system files ? thankyou stay safe fellas.

×
×
  • Create New...

Important Information

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