Zirius
-
Content Count
261 -
Joined
-
Last visited
Reputation Activity
-
Zirius reacted to jaBote in Disabled skills via map_zone_db.conf are still allowed to be used
Oh, you can avoid using mapflag zone pvp if you make your mapflag zone PVP_no_calling inherit the pvp zone.
-
Zirius reacted to AnnieRuru in what does comparison "<<" do?
LOL ... you did well thoughI thought can let you handle ... oh well
anyways,
play around with this little script that I wrote during eathena period ... sh*t eathena forum down
so I make a new one
prontera,156,184,5 script ksdkfjhdkshfj 100,{ .@difficulty = 4; // change this from 1 to 30 ( athena script engine allows up to 2^32 -1 ) mes "Guess the total value of ^0000FF"+( .@value = rand( 1, 1 << .@difficulty ) )+"^000000 ?"; next; while (1) { .@menu$ = ""; for ( .@i = 0; .@i < .@difficulty; .@i++ ) .@menu$ = .@menu$ +( ( .@answer & 1 << .@i )? "^00FF00" : "^FF0000" )+"1 << "+ .@i +":"; .@s = select( .@menu$ ) -1; .@answer = .@answer ^ 1 << .@s; if ( .@answer == .@value ) break; } mes "Correct ! The answer is "; for ( .@i = 0; .@i < .@difficulty; .@i++ ) { if ( .@answer & 1 << .@i ) { .@ans$[.@c] = 1 << .@i; .@c++; } } mes implode( .@ans$, "+" ); close;}1 << 0 = 1 ( also means 20 -> 2 power of 0 -> you press the scientific calculator as 2^0 )1 << 1 = 2 ( also means 21 -> 2 power of 1 -> you press the scientific calculator as 2^1 )
1 << 2 = 4 ( also means 22 -> 2 power of 2 -> you press the scientific calculator as 2^2 )
... and so on
so, if the script randoms a number of 14
the correct answer is 2+4+8
which means
1<<1 + 1<<2 + 1<<3
also means
21 + 22 + 23
also means
14 & 0 == false
14 & 1 == true
14 & 2 == true
14 & 4 == true
in euphy script, which actually ... copy mine ... I wish I can show you the topic in eathena
"prtg_cas01" uses 1<<0 ... "prtg_cas02" use 1<<1 and so on ( see setarray .Castles$[0] )
so if
$WOE_CONTROL[0] = 0
$WOE_CONTROL[1] = 1
$WOE_CONTROL[2] = 2
$WOE_CONTROL[3] = 3
it means, the 1st session has woe on Sunday(0), starts from 1am(1) ~ 2am(2)
with the castle ID 1+2 enable (3)
1+2 = prtg_cas01 + prtg_cas02 <-- these 2 castle on war at the time
if you configure another session
$WOE_CONTROL[4] = 3
$WOE_CONTROL[5] = 20
$WOE_CONTROL[6] = 22
$WOE_CONTROL[7] = 96
means 2nd session has woe on Wednesday (3), starts from 8pm (20) ~ 10pm(22)
with the castle ID 96 = 32+64 = 25 + 26
1<<5 + 1<<6 = "payg_cas01" and "payg_cas02" <-- these 2 castles are enabled
-
Zirius reacted to Dastgir in what does comparison "<<" do?
7&4 will return 4
7&1 will return 0
Want to try those values yourself? Open your Calculator(provided with windows) and use Programmer Mode
for typing & , press "AND" button, "<<" = "LSHFT", ">>" = "RSHFT"
Edit: o_O Annie Viewing topic, probably would answer better than me.
-
Zirius reacted to Dastgir in what does comparison "<<" 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
-
Zirius reacted to Dastgir in what does comparison "<<" do?
Logical bitwise operators work only on numbers, and they are the following: << - Left shift. >> - Right shift. Left shift moves the binary 1(s) of a number n positions to the left, which is the same as multiplying by 2, n times. In the other hand, Right shift moves the binary 1(s) of a number n positions to the right, which is the same as dividing by 2, n times. Example: b = 2; a = b << 3; mes a; a = a >> 2; mes a; The first mes command would display 16, which is the same as: 2 x (2 x 2 x 2) = 16. The second mes command would display 4, which is the same as: 16 / 2 = 8; 8 / 2 = 4. script_commands.txt says it all.
P.S: Its not a comparision sign, its shift signs(binary)
-
Zirius reacted to Mhalicot in Costume System
no its not the only way, you can still add your costume in your database manually.. make sure that you follow this Guide [WIKI]Custom Items
-
Zirius reacted to jaBote in Guildmate position on minimap lags?
Check conf/battle/party.conf at line 13:
// Interval before updating the party-member map mini-dots (milliseconds)party_update_interval: 1000 -
-
Zirius reacted to Angelmelody in @recallall includes vendors @autotrade
just insert this line into for loop
if(pl_sd->state.autotrade) continue;
-
Zirius reacted to Jedzkie in enable monster "luring"
You can check the mob modes in doc/mob_db_mode_list.txt
-
Zirius reacted to Angelmelody in @recallall includes vendors @autotrade
you can use addrid script command to recall all players who isn't with a vendor
through binding @recallall command to overwrite original recall command
http://herc.ws/board/topic/3285-script-command-addrid/
-
Zirius reacted to jaBote in @recallall includes vendors @autotrade
Or you can source edit it (or overwrite with a plugin)
find on src/map/atcommand.c the @recallall command:
/*========================================== * Recall All Characters Online To Your Location *------------------------------------------*/ACMD(recallall){ struct map_session_data* pl_sd; struct s_mapiterator* iter; int count; memset(atcmd_output, '0', sizeof(atcmd_output)); if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map. return false; } count = 0; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) continue; // Don't waste time warping the character to the same place. if (pl_sd->bl.m >= 0 && map->list[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) count++; else { if (pc_isdead(pl_sd)) { //Wake them up pc->setstand(pl_sd); pc->setrestartvalue(pl_sd,1); } pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); } } } mapit->free(iter); clif->message(fd, msg_txt(92)); // All characters recalled! if (count) { sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. clif->message(fd, atcmd_output); } return true;}
Change line 3343 from:
if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {
to:
if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd) && !sd->state.autotrade) {
Then recompile (or make a plugin that overloads it). Haven't tested but should work. This way, you won't recall anyone on autotrade state.
P.S.: Angelmelody's answer works too, but I didn't like this one because this makes you deal with it by a big workload and will make you compile at least the plugins and create a script from scratch; my answer is a 1-line edit or just making a plugin. Much simpler ;P
-
Zirius reacted to evilpuncker in Removing new skills icon in alt + s
remove them from skilltreeview.lub client side and skill_tree.conf server side
-
Zirius reacted to Garr in Example of an NPC that checks if a player has already learned a skill?
You can find all the script functions in doc/script.commands.txt, variables are names of skills, you can see them in skill_db ( db/(pre-)re/skill_db.txt ).
Also, there's quite a few of script-used variables set in db/const.txt. This is not the case, but for the future reference
-
Zirius reacted to Garr in Check how many items free space & available weight in inventory
If I understand it right, it's for when you have an array with ItemIDs to give and another array with amounts, like this:
setarray .itemIDs[0],512,7049,4001,985; // Apple, Stone, Poring Card, Eluniumsetarray .itemAmount[0],10,20,1,15;if ( checkweight2(.itemIDs,.itemAmount) ) { for ( .@i = 0; .@i < getarraysize(.itemIDs); .@i++) { getitem .itemIDs[.@i],.itemAmount[.@i]; }} else { dispbottom "You don't have enough space in your inventory to get the items!";}end; -
Zirius reacted to Angelmelody in Example of an NPC that checks if a player has already learned a skill?
if( getskilllv(SM_FATALBLOW) ){ ....................................}if( getskilllv(MC_CHANGECART) ){ ....................................} -
Zirius reacted to Dastgir in where are the variables stored in SQL?
Character variables
Number: char_reg_num_db
Strings : char_reg_str_db
Account variables
Number: acc_reg_num_db
Strings : acc_reg_str_db
Note: variables are not stored to sql as soon as it is set, theres some time interval before it is saved to SQL.
-
Zirius reacted to Poison in [ Help ] Memory leak & loop bug at my minutely announcer for hercules
add a semi-colon at the end of .News$[0] array
e.g. setarray .News$[0], "MSG1", "MSG2", "MSG3", "MSG4";
-
Zirius reacted to Angelmelody in Rental item problem with cards
try this
--- a/src/map/pc.c +++ b/src/map/pc.c @@ -496,6 +496,25 @@ void pc_rental_expire(struct map_session_data *sd, int i) { } clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid); + + { // expiration return card + int s,flag =0; + for (s = 0; s < MAX_SLOTS; s++) { + if( itemdb->exists(sd->status.inventory[i].card[s]) != NULL ){ + struct item card_it; + memset(&card_it,0,sizeof(card_it)); + card_it.nameid=sd->status.inventory[i].card[s]; + card_it.identify=itemdb->isidentified(card_it.nameid); + if ((flag = pc->additem(sd, &card_it, 1 ,LOG_TYPE_NONE))) + { + clif->additem(sd, 0, 0, flag); + storage->additem(sd,&card_it,1); + + } + } + } + } + pc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER); } void pc_inventory_rentals(struct map_session_data *sd) -
Zirius reacted to Garr in [HELP] how to install @afk in linux VPS
Open Makefile.in in src/plugins/ and edit line
MYPLUGINS = Write there name of plugin, in your case afk. If you'll have more just add them after space. You'll have this:
MYPLUGINS = afk Now do ./configure && make all from Herc directory or, if you have server compiled already, do make plugins.
Also, after that open conf/plugins.conf and add your plugin there.
Since it's a command don't forget to add it to conf/groups.conf. If you want you can add aliases for this command in conf/atcommand.conf.
-
Zirius reacted to Mumbles in Remove some maps from @go & Remove MVP from @whodrops
Use this for @go (script-based)
http://herc.ws/board/topic/3045-utility-go-command/
-
Zirius reacted to Jguy in Hercules as service?
1. Add athena-start to /etc/init.d. Rename as hercules. Adjust $PATH variable inside to point to the location of hercules. Ex: ~/home/user/hercules or /var/hercules
2. # chkconfig -add hercules
3. Reboot
4. ???
5. Profit. You can now use service hercules start provided your user account has the ability to start the service (it should). You shouldn't have to or just plain shouldn't sudo this command, as effectively that makes your server start as root (very bad for you).
-
Zirius reacted to Nameless2you in Hercules as service?
This is a pretty decent tutorial on how to do about it: http://www.shayanderson.com/linux/add-startup-script-or-service-with-linux-on-bootup.htm
-
Zirius reacted to Radamanthysz in Client and Sclientinfo Together
Hello guys, first is a pleasure to be part of this team, I hope to learn a lot with you. Well, my doubt is the following, in my patcher I send a folder with the date and sclientinfo ClientInfo together, it is a hazard because it contains my IP and other important information that a player may use his favor. I already turned the date grf yet the CLIENT only opens if the data folder is inside the patcher folder. to sum up: I wonder if I have to pick up the sclientinfo and ClientInfo and put it inside my client (hexed) so he does not get the folder date and no one has access to and that my client open even without the data folder inside the folder the patcher. Is it possible? if possible how do I do that? have a tutorial? and if not possible, someone could tell me some way of not leaving visible the folder information to date players? Thank you! PS: I'm Brazilian, I used google translator, sorry for grammar error.
-
Zirius reacted to jTynne in Choosing decent Server for hosting Hercules
Sounds like location based latency. The machine itself shouldn't be under so much stress that it causes such latency. As someone else stated, try a service located in Asia or Europe for better ping.