Jump to content

Zirius

Members
  • Content Count

    261
  • Joined

  • Last visited

Posts posted by Zirius


  1.  

    i'll read the whole script later, i just fixed the current to completely end the announce statement, seems like you need 3 args on announce, that's why the script's announce alters new broadcast's color.

    no, I put 16 | .announce
    announce "blahblah",16|.announce;
    16 is bc_blue

    remove the 16 and you can put color code

     

    btw, I have no idea why .announcekill was defaulted to off, it has to turn on

    set .announcekill, 0; // announce who pawn who's head : 0 - off, 1 - on

     

     

    *Hope, I would be able to describe this. LOL.*

     

    Mam, refer to attachment:

    post-6720-0-59593200-1409527566_thumb.png

     

    PVP Script outputs announcement 1 (blue)

    Another script outputs announcement 2 (should be yellow)

     

    But instead of yellow, outputs color blue as shown on 3.

     

    LOL.

     

    Btw, "|" operator is OR?


  2. just mirror ... in-case

    attachicon.gifdota_pvpladder.2.9.txt

    attachicon.gifdotasoundeffect_2.rar

     

    actually I want to drop this script

    just ... I have no idea it can become so popular ...

     

    that "replace into" was slower than "update" statement, I learned that only after 3 years completed this script

    I was using 'replace into' just because I wanted to squeeze that accessing 12 times query_sql into just 4 times

    and ultramage also proposed to make the table make a huge 'update' every 1 minute to safe further memory

     

    however if changing 'replace into' into 'update' might need to update the whole script

    and I have no motivation to improve this script, I rather focus on battleground scripts

     

    for me because of the stat and announcing the kills and deaths makes it more competitive and daring.

     

    i'll read the whole script later, i just fixed the current to completely end the announce statement, seems like you need 3 args on announce, that's why the script's announce alters new broadcast's color.

     

    thanks again.


  3. of course I have, I'm the author

     

    .... but some google search, somebody already mirror my file

     

    http://pastebin.com/Ynze1S7P

    http://tbro-ph.com/rAFreeFiles/NPC Scripts/

     

    now I look back at this script ... that I made 6 years ago ... a lot of places can be improved

    and I remember that I left out the "modify a value" option, which was took out from 2.7

     

    though, I can guarantee that it will still works in latest hercules

     

    but but I reached page 6. Thanks mam!

     

    LOL. You can do some throwback and do " a lot of places can be improved ". That would be very exciting to wait for.


  4.  

    so I want to know if ragsrvinfo table is constantly getting updated or it remains static for a long time.

    it constantly getting updated

     

    when @reloadbattleconf, it sends (srcmapatcommand.c)

    chrif->ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common);
    then map-server.exe send the value to char-server.exe via (srccharchar.c)
    				if( SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s` SET `index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d'",					ragsrvinfo_db, fd, esc_server_name, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)) )
    .

    .

    ok ... I don't understand why they need a sql table to send a server rate ...

    but for sure, whenever map-server change rate, it does send to the `ragsrvinfo` table

     

    1 reason ... that I am just guessing ... is to support multi map-server

    so with just 1 login server, the player can select which server they like to play, and each map-server has different rates

    and that index indicate different map-server

    I'm just guessing though, maybe try ask Ind

     

    ok now I know why

    in case that map-server.exe crash, and char-server.exe still up

    it can retrieve the last value from SQL, because char-server.exe handles to rates

    (srcmapcharif.c)

    /*========================================== * timerFunction  * Check the connection to char server, (if it down) *------------------------------------------*/
    .

    .

    .

    >>>... any changes will just insert a new row on it. Try to get the last row only...

    I'm quite sure that inserting a new row in a non-indexed table, will be the 1st row

    just do a

    select * from ragsrvinfo limit 1;

    would suffice

     

     

    Is there a way to stop Hercules' @reloadbattleconf on updating the table? That seems to be the only problem anyway.

    jaBote's diff is enough. works great. Thanks!

     

    Memory leaks have nothing to do with database values.

     

    Seems char server deletes the table only on server startup, any changes will just insert a new row on it. Try to get the last row only, or perform an edit to remove the contents of the table prior to insert it.

     

    I don't understand the char server's code very much, but if you've got only one server (since that index seems to change on the amount of servers you've active on your machine) try the following:

     

    src/char/char.c

    				if( SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s` SET index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d'",					ragsrvinfo_db, fd, esc_server_name, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)) )					Sql_ShowDebug(sql_handle);

     

    Add just BEFORE that:

    	if( SQL_ERROR == SQL->Query(sql_handle, "DELETE FROM `%s`", ragsrvinfo_db) )		Sql_ShowDebug(sql_handle);

     

    And recompile your char server. This way you'll only have 1 entry on your SQL table at a time since any other entries will get deleted, then the line will be inserted.

     

    Please perform this on a backup: I haven't tested it and, I repeat, I've got no experience with char server.

     

    I had the option to create my own "ragsrvinfo" table that gets update everytime my floating rates NPC changes rates, but.... I think core edits are better, so I choose yours.


  5. The values of the `ragsvrinfo` tables are set via this function in src/map/chrif.c on the map server, which sends it to the char server to store:

     

    /*========================================== * Send rates to char server [Wizputer] * S 2b16 <base rate>.L <job rate>.L <drop rate>.L *------------------------------------------*/bool chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) {	chrif_check(false);	WFIFOHEAD(chrif->fd,14);	WFIFOW(chrif->fd,0) = 0x2b16;	WFIFOL(chrif->fd,2) = base_rate;	WFIFOL(chrif->fd,6) = job_rate;	WFIFOL(chrif->fd,10) = drop_rate;	WFIFOSET(chrif->fd,14);		return true;}

     

    These rates are placed on server boot and seem (not sure) to get instantly updated when you issue the GM @reloadbattleconf atcommand on the server. It just sends base, job and common item drop rates to the table.

     

    You can give it a try.

     

    Yes thanks! Evidently it showed what you described. But, I think there's something wrong?

     

    I got sooooo many entries in ragsrvinfo with the same indexes. Is that normal?

     

    post-6720-0-02741000-1409497907_thumb.png

     

    Memory leak i think?

     

    edit. If you want to reproduce "this", @reloadbattleconf creates another entry in SQL everytime you type that command, i am using the latest git.


  6. Use space perhaps? to make its like that..

    -	script	atcmd_example	-1,{OnInit:	bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";	end;OnAtcommand:	announce "1.                                                                                                                                        2                                                                                                                                        3",0;	end;}

     

    screenCelestyn000.jpg

     

    Any other way bro? That would require me to send soooo long strings, ugly to the eyes. LOL.


  7. I just want to know how reliable is "ragsrvinfo", I like to put it on my fluxCP. The thing is I implemented floating rates, so I want to know if ragsrvinfo table is constantly getting updated or it remains static for a long time. Or it would be good that it gets updated everytime my floating rates NPC change the rates.

     

    Thanks!


  8. WOW. I do not actually know what to say. I never knew binaries are that cool, it seems you can store soooo many data in just n-digit number.
     
    1) Thank you very much for making me understand those shift operators, I understand them faster and clearer than those I read on google. for now "&" is the only thing I am having confusion.
     
    BTW, about the WOE controller script, if I understood it correctly mam,
    you are storing the data by multiple of four, one[0] for the day, one[1] for the start time, one[2] for the end time, and one[3] for the castle
     
    2) But on $WOE_CONTROL, there would come a time that the "index" will not be continuous, just like now, my current $WOE_CONTROL is now:
     

    Array(    [2] => 1    [3] => 32    [5] => 1    [6] => 2    [7] => 4    [8] => 4    [9] => 22    [10] => 23    [11] => 32    [12] => 5    [13] => 22    [14] => 23    [15] => 4)

    may I know mam what algorithm did you used to create those index? I coded a loop that starts at zero and do the function recursively be 4. The problem is, as shown in my current WOE_CONTROL, index 0 is missing, and some other index numbers, so my code fails.
     
    3) In your example mam you have this:
     

    $WOE_CONTROL[4] = 3$WOE_CONTROL[5] = 20$WOE_CONTROL[6] = 22$WOE_CONTROL[7] = 96

    index [7] stores the castle name, is there a way I can decode that to show me all the integers used to build that bit? (actually, I remember having the same need for solution).

     

    P.S. Is there restriction at quoting Annie Ruru's forum posts? This had been my 4th time having problem quoting her replies.


  9. Hello! I am trying to show the breaker's name on breakguild

     

    I replaced the existing announce with this:

     

    announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by " + strcharinfo(0) + " of [" + getguildname(.@GID) + "] guild.",bc_all|bc_woe;

    but, strcharinfo(0) is not detected as implied by console, how can I attach the strcharinfo to my breaker?


  10. LOL. I guess I should start watching binary introduction videos.

     

    What I am just trying to do is understand how Euphy stored the castlename's data. I successfully made it to "echo" the data and store them all in single array via external PHP file. but if I create more than 1 session, I do not understand it anymore. LOL.

     

    Actually, I just want to convert this into PHP language:

     

    		mes "[Schedule]";		if (.Size) {			freeloop(1);			for(set .@i,0; .@i<.Size; set .@i,.@i+4) {				mes "> ^FF0000"+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1])+"-"+Add_Zero($WOE_CONTROL[.@i+2])+")^000000";				for(set .@j,0; .@j<30; set .@j,.@j+1)					if ($WOE_CONTROL[.@i+3]&(1<<.@j)) mes "  ~ "+getcastlename(.Castles$[.@j])+" ^777777("+.Castles$[.@j]+")^000000";				if (.@i+4 < .Size) mes " ";			}			freeloop(0);		} else			mes "No times are configured.";		next;

    this is as far as I got:

    	$Castles=array(		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05");	$Days = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");	$result = mysql_query('SELECT * FROM mapreg WHERE varname="$WOE_CONTROL"');	$WOE_CONTROL = array();	while($row = mysql_fetch_array($result)) {	  $WOE_CONTROL[$row['index']] = $row['value'];	}	$x=0;	while($x<count($WOE_CONTROL)) {		echo '<br />';		echo $Days[$WOE_CONTROL[$x]];		echo '<br />';		echo $WOE_CONTROL[$x+1] .":00 - ". $WOE_CONTROL[$x+2] .":00";			$j=0;			while($j<30) {				if ($WOE_CONTROL[$x+3]&(1<<$j)) {					echo "  ~ ".$Castles$[$j];				}				if ($x+4 < count($WOE_CONTROL)) {echo " "};				$j=j+1;			}		$x=$x+4;	}

  11.  

    This is going to make me cry. Have no knowledge with binary.

     

    Bro, say, i = 0, and j=0

     

    what is this trying to call?

    $WOE_CONTROL[.@i+3]&(1<<.@j)

     

    also, what does & do in that function? and what actually is it trying to do?

    Suppose if

    $WOE_CONTROL[0],1,3,4,7;

    i=0 that means .@i+3 = 0+3 = 3, it will call $WOE_CONTROL[3](which have value 7 as mentioned on above line)

    So if .@j = 2

    (1<<2) = 4, putting all in the statement , it will look like "7&4" Which will be true, & means that the first value contains second value or not(don't know how to explain if you are not familiar with binary)

     

    & Defination on Script_Command:

    The bitwise operator AND (&) is used to test two values against each     other, and results in setting bits which are active in both arguments.     This can be used for a few things, but in Hercules this operator is     usually used to create bit-masks in scripts.

    Bitwise Opeartions Defination on Wikipedia: http://en.wikipedia.org/wiki/Bitwise_operation

     

    Thank you very much for patience bro.

     

    if (7&4)

    will return true because 7 contains 4?

    did I understand it correctly?


  12. I think the proper way for zone mapflag is just

    <map_name><%tab>mapflag<%tab>zone<%tab><zone_name>

    That "pvp" is excess in your call.

    You can check if your zone is applied on the map by teleporting to it and using @mapinfo, it'll list you all zones it's using. I'd guess this one should either show "PvP" or "PvP + PVP_no_calling".

     

    i tried this: 

    pvp_y_7-2	mapflag	zone	PVP_no_calling

    it successfully enabled the zone, but removed the pvp mapflag.

     

    I tried doing this:

     

    pvp_y_7-2	mapflag	zone	PVP_no_callingpvp_y_7-2	mapflag	pvp

    but it removed the zone. Can't run both? How do you guys solved this?

     

    UPDATE. I don't know but playing and ended up something with this solved my problem:

     

    pvp_y_7-2	mapflag	pvppvp_y_7-2	mapflag	zone	PVP_no_calling

     


  13. Hello! I am trying to disable "recall" skills to my PVP maps since they are level restricted. Some low level GM(guild masters) uses Emergency call to summon level 99 players in my PVP maps designated only for low levels (they are carnaging everyone), so.

     

    I added this to my map_zone_db.conf

     

    {	name: "PVP_no_calling"	disabled_skills: {		WE_CALLPARTNER: "PLAYER"		WE_CALLPARENT: "PLAYER"		WE_CALLBABY: "PLAYER"		GD_EMERGENCYCALL: "PLAYER"	}}

    Then at my mapflags:

     

    pvp_y_7-2	mapflag	pvp	zone	PVP_no_calling

    But still, the GMs are able to summon them, what am I doing wrong?


  14. huh ? by default, you should have 34 castles loaded

    what do you mean by "activate 6 castles" ?

    removed some of them ?

     

    those without entries in SQL, also means those castles are not conquered

     

    when my character AnnieRuru conquered Kriemhild (prtg_cas01)

    SQL will generate a row

    15,2,0,0,0,0, ....

    where 15 is castle ID for Kriemhild

    2 is my AnnieRuru's guild ID

     

    but map-server.exe will still be loading 34 castle as long as you don't comment any of them in castle_db.txt

    so even with just 1 line in sql table, the rest are being readed as 0

    means those castle are not yet conquered

     

    Yes, thanks. Actually I commented them out on my castle db so Hercules only loads 6 castles.

     

    What I wish is that those 6 castles activated in my castle db, conquered or not, to be recorded on SQL, so that I can call them out on my flux cp and list them, and get their info.

     

    Is there a way to do this mam? I only need them to appear in my SQL database.

×
×
  • Create New...

Important Information

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