-
Posts
2044 -
Joined
-
Last visited
-
Days Won
51
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by AnnieRuru
-
WAD'S WRONG? [THE CONTENT EXPLAINS WELL]
AnnieRuru replied to imitatia's question in Database Support
can't put the items on is caused by job limitation, base level requirement .... if its client related, it should be client crash, if its view ID, it should only be wrong ID sprite your upper value is 16, try change to 7 or 23 -
if you are talking about creating a new custom weapon using existing weapon type 20, then this is just simple database edits all you can simulate with batkrange, bslashrange, baspdrate ... but if you are talking about creating a custom weapon group outside 22, then its source modification also note that if you are making new custom weapon group, existing gunslinger skills like spread attack need to be reassign
-
hahaha so true xDin just one glance I can tell error in this line warp "bossnia_0" .@i,rand(202,204),rand(202,204);
-
@GmOcean yes, I was the one who said that and I just found the original topic that I learned that from Yhn http://www.eathena.ws/board/index.php?showtopic=151290 Google Translation - Dutch -> English quite understandable
-
that will only setlook on the player who are 1st index in getpartymember still need to attachrid all of them //===== eAthena Script =======================================// //= Party vs Party Npc // //===== Originally By: =======================================// //= icabit69 // //===== Credits for help goes to: ============================// //= Rahuldev345 // //= Emistry // //===== Edited by: ===========================================// //= MrVandalBus // //==============================================================// //Warning! Dont edit unless you know what you are doing! //Updates: //* Fix the prize after the battle (Map 'valkyrie' instead of 'bat_b01') //* Easier to edit //* If the team loses, the players will be ressurected (If dead of course) //* Bug Exploit Thingy (only Lvl 60 GM can warp to there) valkyrie,49,49,0 script teamwarprize -1,2,2,{ OnTouch: getitem 20078,15; //edit the prize <item>,<amount> warp "prontera",156,191; close; } prontera,155,166,4 script Party vs Party (5v5)::teamwar 796,{ if (getgmlevel() >= 99){ menu "standard menu",standard,"reset",lend1; } standard: set $@members,5; // number of party members change this to your party size you want set $@start,0; getpartymember(getcharid(1)); set @partymembercount,$@partymembercount; if ( $@start==1) { mes "The Sign Ups are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!"; close; } if ( @partymembercount==$@members) { mes "Hello "+strcharinfo(0)+" what do you want?"; if (($@TeamID1!=0) && ($@TeamID2!=0)) { mes "The Sign Ups are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!"; close; } if ( getpartyleader(getcharid(1),2) != getcharid(0) ) { mes "Only party leader have the right to sign up / out from the game with me.."; close; } mes "Choose your team to register."; switch(select("Red Team - [" + GetPartyName($@TeamID1) + "] :Blue Team - [" + GetPartyName($@TeamID2) + "]")) { case 1: mes "[ Team War ]"; if ($@TeamID1==0 || getpartyname($@TeamID1)=="null") { getpartymember(getcharid(1)),1; getpartymember(getcharid(1)),2; copyarray $@partymembercidt1[0],$@partymembercid[0],$@members; copyarray $@partymemberaid1[0],$@partymemberaid[0],$@members; for (set .@i,0; .@i<$@members; set .@i,.@i+1) { if(isloggedin($@partymemberaid1[.@i],$@partymembercidt1[.@i])) set .@count,.@count+1; } if(.@count < $@members) { mes "You need all your party members to be online to Register"; close; } set $@TeamID1, getcharid(1); initnpctimer; mes "Your Party is now subscribed, good luck!"; announce "Team 1 : [ " +getpartyname($@TeamID1)+ " ] has sign up For the Team War!",bc_blue|bc_map; doevent "teamwar::OnSubscriptionTeam"; close; } else { mes "I'm sorry! Another Team has sign up before you..."; close; } case 2: mes "[ Team War ]"; if ($@TeamID2==0 || getpartyname($@TeamID2)=="null") { getpartymember(getcharid(1)),1; getpartymember(getcharid(1)),2; copyarray $@partymembercidt2[0],$@partymembercid[0],$@members; copyarray $@partymemberaid2[0],$@partymemberaid[0],$@members; for (set .@i,0; .@i<$@members; set .@i,.@i+1) { if(isloggedin($@partymemberaid2[.@i],$@partymembercidt2[.@i])) set .@count,.@count+1; } if(.@count < $@members) { mes "You need all your party members to be online to Register"; close; } set $@TeamID2, getcharid(1); initnpctimer; mes "Your Party is now subscribed, good luck!"; announce "Team 2 : [ " +getpartyname($@TeamID2)+ " ] has sign up For the Team War!",bc_blue|bc_map; doevent "teamwar::OnSubscriptionTeam"; close; } else { mes "I'm sorry! Another Team has sign up before you..."; close; } } } else { mes "[Event Handler]"; mes "Please contact your party leader."; mes "Your team must have a party consisting of "+$@members+" members."; close; } OnSubscriptionTeam: getpartymember($@TeamID2),1; getpartymember($@TeamID2),2; copyarray $@partymembercidtc2[0],$@partymembercid[0],$@members; copyarray $@partymemberaidc2[0],$@partymemberaid[0],$@members; for (set .@i,0; .@i<$@members; set .@i,.@i+1) { if(isloggedin($@partymemberaidc2[.@i],$@partymembercidtc2[.@i])) set .@countx,.@countx+1; } if(.@countx < $@members) { announce "Team War : "+getpartyname($@TeamID2)+"are not all online the match has been canceled",0; announce "Team War : registration for 2 new teams are now available",0; goto lend; close; } for ( .@i, 0; .@i < $@members; .@i++ ) { if ( isloggedin( $@partymemberaidc2[.@i], $@partymembercidtc2[.@i] ) ) { attachrid $@partymemberaidc2[.@i]; set pvp3vs3_ori_look, getlook(7); setlook 7, 521; } } getpartymember($@TeamID1),1; getpartymember($@TeamID1),2; copyarray $@partymembercidtc1[0],$@partymembercid[0],$@members; copyarray $@partymemberaidc1[0],$@partymemberaid[0],$@members; for (set .@i,0; .@i<$@members; set .@i,.@i+1) { if(isloggedin($@partymemberaidc1[.@i],$@partymembercidtc1[.@i])) set .@countz,.@countz+1; } if(.@countz < $@members) { announce "Team War : "+getpartyname($@TeamID1)+"are not all online the match has been canceled",0; announce "Team War : registration for 2 new teams are now available",0; goto lend; close; } for ( .@i, 0; .@i < $@members; .@i++ ) { if ( isloggedin( $@partymemberaidc1[.@i], $@partymembercidtc1[.@i] ) ) { attachrid $@partymemberaidc1[.@i]; set pvp3vs3_ori_look, getlook(7); setlook 7, 520; } } if($@TeamID1!=0 && $@TeamID2!=0){ announce "Team War : We have 2 Teams signed up now : "+getpartyname($@TeamID1)+" and "+getpartyname($@TeamID2)+".",bc_blue|bc_map; set @win1, 0; set @win2, 0; goto onstart; } end; OnTimer50000: if (($@TeamID1!=0) && ($@TeamID2!=0)) { end; } stopnpctimer; set $@TeamID1, 0; set $@TeamID1, 0; announce "Team War : we lack teams to start registration for two teams are now available",0; end; onstart: warpparty "guild_vs4",7,49,$@TeamID1; warpparty "guild_vs4",92,49,$@TeamID2; set $@start,1; end; lend: stopnpctimer; set $@TeamID1,0; set $@TeamID2,0; set $@start,0; set @win1,0; set @win2,0; set @partymembercount,$@members; end; lend1: stopnpctimer; set $@TeamID1,0; set $@TeamID2,0; set $@start,0; set @win1,0; set @win2,0; set @partymembercount,$@members; announce "Team War has been reset, you may register your team now",0; close; end; OnTimer250000: Announce "Team War : No Party won due to time limit!",0; mapwarp "guild_vs4","prontera",156,203; goto lend; end; OnPCDieEvent: OnPCLogoutEvent: if(strcharinfo(3) != "guild_vs4") end; setlook 7, pvp3vs3_ori_look; pvp3vs3_ori_look = 0; warp "prontera",156,203; for(set .@i, 0; .@i < $@members; set .@i, .@i + 1) { if ( $@partymembercidt1[.@i] == getcharid(0)) { deletearray $@partymembercidt1[.@i], 1; if( getarraysize($@partymembercidt1) == 0 ) { set @win2,$@partymembercount; goto onwin; } } if ( $@partymembercidt2[.@i] == getcharid(0) ) { deletearray $@partymembercidt2[.@i], 1; if( getarraysize($@partymembercidt2) == 0 ) { set @win1,$@partymembercount; goto onwin; } } } end; onwin: if (@win1==0) { warpparty "valkyrie",49,49,$@TeamID2; warpparty "valkyrie",45,45,$@TeamID1; Announce "Team War :"+GetPartyName($@TeamID2)+" won againts "+GetPartyName($@TeamID1)+"",0; goto lend; end; } if (@win2==0) { warpparty "valkyrie",49,49,$@TeamID1; warpparty "valkyrie",45,45,$@TeamID2; Announce "Team War :"+GetPartyName($@TeamID1)+" won againts "+GetPartyName($@TeamID2)+"",0; goto lend; end; } end; } guild_vs4 mapflag nosave guild_vs4 mapflag nomemo guild_vs4 mapflag nobranch guild_vs4 mapflag pvp_noguild guild_vs4 mapflag nocommand 60 guild_vs4 mapflag noicewall guild_vs4 mapflag pvp valkyrie mapflag nosave valkyrie mapflag nomemo valkyrie mapflag nobranch valkyrie mapflag nocommand 60 valkyrie mapflag pvp_noparty valkyrie mapflag nowarpto 99 //Change the GM level if you desire to valkyrie mapflag nowarp 99 //Change the GM level if you desire to valkyrie,45,45,0 script alive -1,2,2,{ OnTouch: atcommand "@alive"; warp "prontera",156,191; close; } more like this
-
pc.c /*========================================== * /resetskill * if flag&1, perform block resync and status_calc call. * if flag&2, just count total amount of skill points used by player, do not really reset. * if flag&4, just reset the skills if the player class is a bard/dancer type (for changesex.) *------------------------------------------*/ int pc_resetskill(struct map_session_data* sd, int flag) { int i, lv, inf2, skill_point=0; nullpo_ret(sd); if( flag&4 && (sd->class_&MAPID_UPPERMASK) != MAPID_BARDDANCER ) return 0; if( !(flag&2) ) { //Remove stuff lost when resetting skills. /** * It has been confirmed on official server that when you reset skills with a ranked tweakwon your skills are not reset (because you have all of them anyway) **/ if( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON) ) return 0; if( pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd) ) clif_status_load(&sd->bl, SI_DEVIL, 0); //Remove perma blindness due to skill-reset. [skotlex] i = sd->sc.option; if( i&OPTION_RIDING && pc_checkskill(sd, KN_RIDING) ) i &= ~OPTION_RIDING; if( i&OPTION_FALCON && pc_checkskill(sd, HT_FALCON) ) i &= ~OPTION_FALCON; if( i&OPTION_DRAGON && pc_checkskill(sd, RK_DRAGONTRAINING) ) i &= ~OPTION_DRAGON; if( i&OPTION_WUG && pc_checkskill(sd, RA_WUGMASTERY) ) i &= ~OPTION_WUG; if( i&OPTION_WUGRIDER && pc_checkskill(sd, RA_WUGRIDER) ) i &= ~OPTION_WUGRIDER; if( i&OPTION_MADOGEAR && ( sd->class_&MAPID_THIRDMASK ) == MAPID_MECHANIC ) i &= ~OPTION_MADOGEAR; if( i&OPTION_MOUNTING ) i &= ~OPTION_MOUNTING; #ifndef NEW_CARTS if( i&OPTION_CART && pc_checkskill(sd, MC_PUSHCART) ) i &= ~OPTION_CART; #else if( sd->sc.data[sC_PUSH_CART] ) pc_setcart(sd, 0); #endif if( i != sd->sc.option ) pc_setoption(sd, i); if( merc_is_hom_active(sd->hd) && pc_checkskill(sd, AM_CALLHOMUN) ) merc_hom_vaporize(sd, 0); } for( i = 1; i < MAX_SKILL; i++ ) { lv = sd->status.skill[i].lv; if (lv < 1) continue; inf2 = skill_get_inf2(i); if( inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL) ) //Avoid reseting wedding/linker skills. continue; // Don't reset trick dead if not a novice/baby if( i == NV_TRICKDEAD && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE ) { sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; continue; } // do not reset basic skill if( i == NV_BASIC && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE ) continue; if( flag&4 && !skill_ischangesex(i) ) continue; if( inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn ) { //Only handle quest skills in a special way when you can't learn them manually if( battle_config.quest_skill_reset && !(flag&2) ) { //Wipe them sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; } continue; } if( sd->status.skill[i].flag == SKILL_FLAG_PERMANENT ) skill_point += lv; else if( sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0 ) skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0); if( !(flag&2) ) {// reset sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; } } if( flag&2 || !skill_point ) return skill_point; sd->status.skill_point += skill_point; if( flag&1 ) { clif_updatestatus(sd,SP_SKILLPOINT); clif_skillinfoblock(sd); status_calc_pc(sd,0); } return skill_point; } ok I give up ... there's some skill that shouldn't be reset like marriage skill ... etc doing it from SQL with this still plausible but the script will become too big and not as efficient to just have an npc script with just 1 single command do all the things above
-
like this ? update `char` set skill_point = job_level -1 where ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50; delete from skill where skill.char_id in ( select char_id from `char` where ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50 ); become simpler SQL script though EDIT: I think above method is not correct ... need to calculate with previous job like dancer also got skill points from archer and novice ..hmm ...
-
you should at least tell 1. what is poring catcher - you want us guess what the event is just by telling the name ? 2. and how you want your round system be - after kill all poring or after event complete it restart itself ?
-
wtf ... goddameit can sometimes think outside the box when solving a problem .... thx for the idea here is the tested sql script update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id; delete from skill; run this when server is off EDIT: wait, this is for all characters ... wait I think of some way for gunslinger only update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id and class >= 4054 and base_level >= 150 and job_level >= 50; delete from skill; like this EDIT2 ... erm ... I think the class is abit ... off wait I recheck the job ID yeah Emistry is wrong, goddameit correct update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id and ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50; delete from skill; like this I think this is final LMAO ... delete from skill will wipe the database ... >.< wait .... urgh ... I really post too fast ... update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id and ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50; delete from skill where skill.char_id in ( select char_id from `char` where ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50 ); bleh .... finally ... I hope no more of such things <.< final EDIT: this method is not correct either - like marriage skill shouldn't be edit and if a user riding, should unmount them ... etc
-
yeah me and goddameit has alot experienced in writing instanced scripts I thought as long as the instance 1st 2 characters is <a number> and '@' this symbol, then it will work however, 1@tnm1 ~ 1@tnm3 is official KRO maps ? or is that just some of your custom map ? this is official rathena endless tower script used for( set .@i, 1; .@i <= 6; set .@i, .@i + 1 ) { if( instance_attachmap(.@i + "@tower", .@instance) == "" ) { mes "^0000ff"+.@md_name$+" ^000000- Reservation Failed!"; instance_destroy(.@instance); close; } since your map name changes on your last character, just do it like this for( set .@i, 1; .@i <= 3; set .@i, .@i + 1 ) { if( instance_attachmap( "1@tnm"+ .@i, .@instance) == "" ) { mes "^0000ff"+.@md_name$+" ^000000- Reservation Failed!"; instance_destroy(.@instance); close; }
-
@keyworld I already know how to SET a bit above 2^31 at the time I post in that topic I just didn't know how to SHIFT a group of bits above 2^31 ... (now I know we can abuse SQL to calculate numbers above 2^31 then calculate return values below 2^31 because of script engine limitations) but if the trick you said is to -> uncompress everytime -> calculate -> compress back then it doesn't sound like a trick to me <.< I originally thought we can do something like SQL select unhex( hex( 65 + 26 + 6 ) ); so I guess rathena script engine doesn't support this type of calculation .... oh well maybe I should abuse SQL system from now on !! XD yeah, actually when I released favorite warper and mission board <- look it just 3 weeks apart in March 2010 at that time, I thought explode/implode to save data was the most efficient method ... until toasty released toasty warper <- in Jan 2011 then I only start to aware this 2040-bit system ( yeah his script more optimized and more user friendly compare to mine ) also, his script only do set and unset 1 bit at a time, he didn't shift the bit ( yeah I also noticed in his later version, he already fixed the bug that caused by map index shifted by user change map position in menu, -> print out an error message instead of getting hang at the dialog ) these scripts used these kinds of data compression now I regret I didn't learned this 2040 bit earlier, or my mission board script can save above 5040 missions and able to have player takes more than 4 missions ... mainly due to eathena script engine limitation (string.. int... gotocount... etc) using SQL table is the easiest way, but I don't think its the most efficient a table having too many columns can caused the query time return too long I also did planned to use SQL table to save all the mission data ( yeah ... I was abusing moderator's power create invisible topic ... hahaha ) using my old computer 2 years ago, the result return in 0.4 second now on this new computer pentium 4 - 2.8GHz - quad-core - result return in 0.01 sec at that time. I scrapped out the idea using SQL table to do it ... and I already predicted keyworld's system will fail at that time I post there, with Ragnarok game is always expanding new towns, fields, dungeons, or new jobs, skills ... etc using bit to save the system without future planning will 1 day break your system -> not enough bits actually I read somewhere long time ago in eathena board eathena item database uses bitmask int signed to store all the jobs, which is unique to eathena aegis doesn't do like this if 1 day Gravity develop more than 31 different jobs, we need to expand another equip_job2 lol ... well ... I don't think I can find that topic anymore ... I believe that topic was at 2005 in forum bug report ... before eathena board even has bug tracker system
-
actually that time I also wanted to say it ... but dunno why I didn't, maybe too much topic to solve in my version that I wrote, http://rathena.org/board/topic/73115-hunting-mission-script-error/#entry150344 I used set .baseexprate, getbattleflag("base_exp_rate"); this is very understandable .. means the rate is directly from your exp.conf set .baseexprate, 1000; will overwrite the rate from exp.conf into 10x rate ... no mathematics calculation needed but the way Euphy's did configuration makes the user need to do some math to figure out how to configure the rate lol actually, his way setarray .Modifier[0], 3,3,60; if you do it this way means x3 baseexp, x3 jobexp, and 60x zeny modifier still I need to read the script only understand about this ... it seems euphy still need more experience when trying to code out a user-friendly configuration lol EDIT: yeah, change that ... I'm sure in the future member who with low IQ will ask this question again
-
http://www.eathena.ws/board/index.php?showtopic=237765 another one of my most famous script, but lol now anyone also can write this
-
announce "Sorry, only 1 character per IP is allowed on this map.", bc_blue|bc_self; sleep 1000; warp "SavePoint",0,0; [Error]: script_rid2sd: fatal error ! player not attached! lol... xD damn ... bumping old topics ! so cheating >.<
-
@Rafael omg ! yeah you are right, using select inside select will return result faster only if the search key is not indexed xD if a search inside the where clause is indexed, run time is the same thx for reminding me though I still prefer to use this method since I don't need to check the field is indexed or not here it is prontera,157,178,5 script Sample 757,{ if ( getgmlevel() < 80 ) end; mes "Input Player Name"; if ( input( .@input$, 4, 23 ) ) { mes "invalid name length"; close; } if ( set( .@nb, query_sql( "select name, online from `char` where account_id = ( select account_id from `char` where name = '"+ escape_sql(.@input$) +"' ) order by char_num", .@name$, .@online ) ) ) for ( set .@i, 0; .@i < .@nb; set .@i, .@i +1 ) mes " > "+ .@name$[.@i] +" "+( ( .@online[.@i] )? "^00FF00[Online]" : "^FF0000[Offline]" )+"^000000"; else mes "No character found"; close; } also ... everyone eathena\rathena script engine sux big time the labels and variable names are NOT case sensitive in rathena script engine, unlike visual basic or C++ prontera,157,178,5 script Sample 757,{ set .@test_var, 123456; npctalk .@TEST_vAr +""; end; onnpckIlLeVenT: dispbottom "You just killed a mob ID "+ kIlLeDrid; end; } all above example works
-
variable tied to MAC address (I am using Harmony)
AnnieRuru replied to Reducto's question in Script Requests
I just add new example in previous post and weird prontera,158,181,5 script test int overflow 100,{ .@a = 2147483647; npctalk ".@a = "+ .@a; // this is correct .@b = 2147483648; npctalk ".@b = "+ .@b; // return 0 .@c$ = "2147483648"; .@c = atoi( .@c$ ); npctalk ".@c = "+ .@c; // it says max int no matter how big numbers you have } map-server no give any error ... even all numbers above -
variable tied to MAC address (I am using Harmony)
AnnieRuru replied to Reducto's question in Script Requests
that fix me! part, we can abuse SQL to calculate numbers above 2^31 select 123456789012345678901 > 123456789012345678900; return 1 also, consider the fact a negative sign is also count as 1 string 2147xxxxxx is 10 strings -2147xxxxxx is 11 strings EDIT: seems you already know this because you used >11 EDIT2: select 123456789012345678901 > 2147000000 OR 123456789012345678901 < -2147000000; select 123 > 2147000000 OR 123 < -2147000000; -
nonono ... if you look at the example script above, I used 5 bit to save each data, which allows up to 2^5 = 32 only in other words, by using 5 bit to save a data, with rathena crappy script engine limited to int signed 2^31 31 bit limitation / 5 bit = 6 types of data can be save only and I also used rathena bit shifting command << and >> but I don't think using your function can shift above 2^31 isn't it ? as you can do until 2^2040 ... I wonder is there a way to do bit shifting above 2^31 ... EDIT: wait ... don't tell me.... manually set them 1 bit by 1 bit ??
-
yesterday emistry ask me in pm what are they saying in this topic I guess should post this out help those people who wants to abuse that 2040 bit keyworld trying to do <3 I think most of you here already know how to do this prontera,156,181,5 script implode data 100,{ mes "string = "+ $data1$; explode .@data$, $data1$, "#"; .@size = getarraysize( .@data$ ); for ( .@i = 0; .@i < .@size; .@i++ ) mes .@data$[.@i] +""; close; OnInit: setarray .@data, 12,21,13,31,11,7; .@size = getarraysize( .@data ); for ( .@i = 0; .@i < .@size; .@i++ ) .@data$[.@i] = .@data[.@i] +""; // stupid implode ask for string only, need to convert number to string set $data1$, implode( .@data$, "#" ); end; } and this is bit-shifting data prontera,158,181,5 script bitshift data 100,{ mes "value = "+ $data2; for ( .@i = 0; .@i < .size; .@i++ ) mes ( ( $data2 >> .@i * 5 ) % pow( 2, 5 ) )+""; close; OnInit: setarray .@data, 12,21,13,31,11,7; $data2 = 0; .size = getarraysize( .@data ); for ( .@i = 0; .@i < .size; .@i++ ) $data2 = $data2 + ( .@data[.@i] << .@i * 5 ); end; } but this script can only save 31 bit only lol @keyworld, come post your 2040 bit godly script xD I also can't do that myself x.x .... though I know you can do it <3
-
devil square was my 1st ever event script that I wrote/fixed http://www.eathena.ws/board/index.php?s=&showtopic=20183&view=findpost&p=915619
-
OMFG !! this is my 1st script prontera,156,183,5 warp Treasure_Hunter_Guild 2,2,yuno_in01,108,164 haha of course not, honestly ... my 1st script was job changer .... lol ... with menu and labels (in year 2006 of course) EDIT for below: ..... seriously ...? I get rep for support this kind of topic O.O
-
I'm don't have any programming background so I don't know anything about those .... blah blah language I just write that simple script out, and the screenshot tells me it gives me 1,2,3,4,5 that's all I know, and that's how I learned rathena scripting LMAO from what I understand, .@i++ also means ( set .@i, .@i +1 ) prontera,152,191,5 script woe 100,{ while ( .@i < 5 ) mes "Counting "+ .@i++; close; } prontera,154,191,5 script woe2 100,{ while ( .@i < 5 ) mes "Counting "+ set( .@i, .@i +1 ); close; } prontera,156,191,5 script woe3 100,{ while ( .@i < 5 ) { set .@i, .@i +1; mes "Counting "+ .@i; } close; } tested these 3 npcs gives me the same dialog if you think this is wrong ... then its rathena script engine error ? I dunno ... as I never learn any other programming language I learn scripting from what my test server told me, not from what others told me
-
I was the one who wrote that script http://rathena.org/b...ng/#entry148440 I understand if you say var++ doesn't work, but has to use set var, var +1;but why you say var = var + 1; ? prontera,152,191,5 script woe 100,{ while ( .@i < 5 ) mes "Counting "+ .@i++; close; } it works you know or have you messed up this rathena forum and eathena forum ?
-
this is one of the most fun script I've written in once in a while I remember the last time I made some algorithm script like this was when I tried to write ladder system sql-files replace into mob_db2 values ( 2901,'EMPERIUM_1','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); replace into mob_db2 values ( 2902,'EMPERIUM_2','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); replace into mob_db2 values ( 2903,'EMPERIUM_3','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); replace into mob_db2 values ( 2904,'EMPERIUM_4','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); replace into mob_db2 values ( 2905,'EMPERIUM_5','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); replace into mob_db2 values ( 2906,'EMPERIUM_6','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); replace into mob_db2 values ( 2907,'EMPERIUM_7','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ); db\mob_avail.txt 2901, 1915 2902, 1915 2903, 1915 2904, 1915 2905, 1915 2906, 1915 2907, 1915 diff Index: battle.c =================================================================== --- battle.c (revision 16821) +++ battle.c (working copy) @@ -5021,6 +5021,21 @@ if( (s_bl = battle_get_master(src)) == NULL ) s_bl = src; + if ( s_bl->type == BL_PC && t_bl->type == BL_MOB ) { + struct map_session_data *sd = BL_CAST( BL_PC, s_bl ); + struct mob_data *md = BL_CAST( BL_MOB, t_bl ); + if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) ) { + int i; char str[23]; + if ( md->class_ >= 2901 && md->class_ <= 2907 && battle_getcurrentskill(src) > 0 ) + return 0; + for ( i = 0; i < 7; i++ ) { + sprintf( str, "$@woe_7ele_%d", i +1 ); + if ( md->class_ == 2901 + i && sd->status.guild_id == mapreg_readreg( add_str(str) ) ) + return 0; + } + } + } + if ( s_bl->type == BL_PC ) { switch( t_bl->type ) { case BL_MOB: // Source => PC, Target => MOB Index: battle.h =================================================================== --- battle.h (revision 16821) +++ battle.h (working copy) @@ -3,6 +3,7 @@ #ifndef _BATTLE_H_ #define _BATTLE_H_ +#include "mapreg.h" // state of a single attack attempt; used in flee/def penalty calculations when mobbed typedef enum damage_lv { npc script prontera,152,191,5 script woe 100,{ detachrid; if ( agitcheck() ) agitend; else agitstart; end; OnAgitStart: announce "woe started", 0; for ( .@i = 1; .@i <= 7; .@i++ ) { monster "prontera", 144 + .@i *3, 185, "Emperium No."+ .@i, 2900 + .@i, 1, strnpcinfo(0)+"::On"+ .@i; .score[.@i] = 0; setd "$@woe_7ele_"+ .@i, 0; } while ( agitcheck() ) { for ( .@i = 1; .@i <= 7; .@i++ ) { if ( getd( "$@woe_7ele_"+ .@i ) ) .score[.@i]++; } sleep 1000; // supposed to be 5000, but 1000 for test purposes } end; On1: callsub L_down, 1; On2: callsub L_down, 2; On3: callsub L_down, 3; On4: callsub L_down, 4; On5: callsub L_down, 5; On6: callsub L_down, 6; On7: callsub L_down, 7; L_down: announce strcharinfo(2) +" has broken Emperium No. "+ getarg(0), 0; setd "$@woe_7ele_"+ getarg(0), getcharid(2); .guild_name$[ getarg(0) ] = strcharinfo(2); monster "prontera", 144 + getarg(0) *3, 185, "Emperium No."+ getarg(0), 2900 + getarg(0), 1, strnpcinfo(0)+"::On"+ getarg(0); .score[ getarg(0) ] = 0; end; OnAgitEnd: announce "woe ended", 0; for ( .@i = 1; .@i <= 7; .@i++ ) killmonster "prontera", strnpcinfo(0) +"::On"+ .@i; for ( .@i = 1; .@i <= 7; .@i++ ) if ( getd( "$@woe_7ele_"+ .@i ) ) announce "[Debug] "+ .guild_name$[.@i] +" holding emp.no."+ .@i +" for "+ .score[.@i] +" points", 0; for ( .@i = 1; .@i <= 7; .@i++ ) { if ( getd( "$@woe_7ele_"+ .@i ) ) { .@j = 0; .@size = getarraysize(.@most_holding_guild_id); while ( getd( "$@woe_7ele_"+ .@i ) != .@most_holding_guild_id[.@j] && .@j < .@size ) .@j++; if ( .@j == .@size ) { .@most_holding_guild_id[ .@size ] = getd( "$@woe_7ele_"+ .@i ); .@most_holding_flags[ .@size ] = 1; } else .@most_holding_flags[ .@j ]++; } } .@size = getarraysize(.@most_holding_guild_id); if ( .@size == 1 ) { announce "Guild ["+ getguildname( .@most_holding_guild_id[ .@size -1 ] ) +"] holding all the emperiums !! Wins !", 0; end; } callfunc "comb_sort", .@most_holding_guild_id, .@most_holding_flags; // WTF !!!! my 1st time use sorting algorithm for ( .@i = 0; .@i < .@size; .@i++ ) announce "[Debug] Guild ["+ getguildname( .@most_holding_guild_id[.@i] ) +"] holding "+ .@most_holding_flags[.@i] +" emperium total", 0; if ( .@most_holding_flags[ .@size -1 ] != .@most_holding_flags[ .@size -2 ] ) { announce "Guild ["+ getguildname( .@most_holding_guild_id[ .@size -1 ] ) +"] holding "+ .@most_holding_flags[ .@size -1 ] +" emperium total !! Wins !", 0; end; } else announce "[Debug] TIE !! Start counting invisible points system", 0; for ( .@i = 1; .@i <= 7; .@i++ ) { if ( getd( "$@woe_7ele_"+ .@i ) ) { .@j = 0; .@size = getarraysize(.@most_points_guild_id); while ( getd( "$@woe_7ele_"+ .@i ) != .@most_points_guild_id[.@j] && .@j < .@size ) .@j++; if ( .@j == .@size ) { .@most_points_guild_id[ .@size ] = getd( "$@woe_7ele_"+ .@i ); .@most_points_flags[ .@size ] = .score[.@i]; } else .@most_points_flags[ .@j ] += .score[.@i]; } } .@size = getarraysize(.@most_points_guild_id); callfunc "comb_sort", .@most_points_guild_id, .@most_points_flags; for ( .@i = 0; .@i < .@size; .@i++ ) announce "[Debug] Guild ["+ getguildname( .@most_points_guild_id[.@i] ) +"] has "+ .@most_points_flags[.@i] +" points total", 0; if ( .@most_points_flags[ .@size -1 ] != .@most_points_flags[ .@size -2 ] ) { announce "Guild ["+ getguildname( .@most_points_guild_id[ .@size -1 ] ) +"] has "+ .@most_points_flags[ .@size -1 ] +" points total !! Wins !", 0; end; } else announce "[Debug] TIE !! oh well ... I'm lazy to do the rest already", 0; end; } // callfunc "comb_sort", <array of IDs>, <array of points to be sorted>; function script comb_sort { .@size = getarraysize( getarg(0) ); .@gap = .@size; do { if ( .@gap > 1 ) .@gap = .@gap * 100 / 130; .@swap = 0; .@i = 0; while ( .@i + .@gap < .@size ) { if ( getelementofarray( getarg(1), .@i ) > getelementofarray( getarg(1), .@i + .@gap ) ) { .@tmp = getelementofarray( getarg(0), .@i ); set getelementofarray( getarg(0), .@i ), getelementofarray( getarg(0), .@i + .@gap ); set getelementofarray( getarg(0), .@i + .@gap ), .@tmp; .@tmp = getelementofarray( getarg(1), .@i ); set getelementofarray( getarg(1), .@i ), getelementofarray( getarg(1), .@i + .@gap ); set getelementofarray( getarg(1), .@i + .@gap ), .@tmp; .@swap = 1; } .@i++; } } while ( .@swap || .@gap > 1 ); return; } actually I have some kind of idea turn this into woe - 7 elements where there's sky, fire, water, wind, wood ... 7 colors of emperiums in those rooms ( sky room has gonryun theme, fire has magma dungeon theme etc ) and if the guild owner owns fire and water emperium, in the next war they have +10 str and +10 int stats when they stay in the map which is do-able with OnPCStatCalcEvent: if ( strcharinfo(3) == "that_room" && getcharid(2) == $woe_7ele_holder ) { if ( $woe_7ele_bits & 1 ) bonus bstr, 100; // hold fire room in previous round gets bonus str if ( $woe_7ele_bits & 2 ) bonus bint, 100; // hold water room gets int bonus .. if ( $woe_7ele_bits & 4 ) bonus .... // hold wind gets agi bonus ... and so on damn if you can pick up map designing skills, I don't mind finish this script off the idea is very good by itself EDIT: forgot to tell this script cannot advance any further if there's no map provided
-
setmapflag .pvpmap$[.@i], mf_pvp; I thought I already did it also