Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by AnnieRuru

  1. yes, battle_config.prevent_logout when set to 30 seconds, if they are hitting monster also need to wait 30 seconds to return to character screen hmm .... this battle_config.prevent_logout cover too broad ...
  2. ok try 1 more time after some intense browsing src/map/clif.cpp file, this function is the one that's responsible for handling client quit /*========================================== * // line 1839 *------------------------------------------*/ void clif_quitsave(int fd,struct map_session_data *sd) { if (!battle_config.prevent_logout || sd->canlog_tick == 0 || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) map_quit(sd); else if (sd->fd) { //Disassociate session from player (session is deleted after this function was called) //And set a timer to make him quit later. session[sd->fd]->session_data = NULL; sd->fd = 0; add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0); } } I have tested in-game that when Player A hitting Player B, and Player B instantly Alt+F4, there is indeed a 10 seconds duration staying in the game add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0); so just change 10000, means 10000 mili-seconds into 30000 to let the player stay in-game for 30 seconds of course the prevent_logout also set to 30000 just to be safe
  3. WAHAHAHA scrap my previous script edi ~ been so long having someone comment on my scripts ~ hahaha no more feeling lonely bg_pvp_point_clone_0.3r.txt <-- PS: no 0.2 version because scrap due to @n0tttt gives better template ? not sure about cloth color, arch bishop dye 0 gives blue color, dye 2 red color wanderer dye 0 red color, dye 2 blue color ... didn't follow a pattern maybe another callsub nah, wait someone gives feedback then only continue this
  4. now THIS is a good idea for a battleground script bg_pvp_point_clone.txt <-- sketch only the 1st thing I notice is the battleground monsters follows you around if its your team, and it seems like official feature and the clones, well can always use mob_avail.txt to get a mob_ID to display their character cloth properly I just using lighthalzen monster out of laziness EDIT: forgot to add nomobloot mapflag @Happy2018 EDIT2: maybe I should make another one with setunitdata script command and see how well rathena mob controller system can handle
  5. I'm quite sure I've made a lot bg_pvp script without waitingroom .... but I think better make a new one every time, after all I hardly see any good battleground script request recently // https://rathena.org/board/topic/117531-battleground-pvp-10-annieruru-help/ function script F_ShuffleNumbers { deletearray getarg(2); .@static = getarg(0); .@range = getarg(1) +1 - .@static; .@count = getarg(3, .@range); if (.@range <= 0 || .@count <= 0) return 0; if (.@count > .@range) .@count = .@range; for (.@i = 0; .@i < .@range; ++.@i) .@temparray[.@i] = .@i; for (.@i = 0; .@i < .@count; ++.@i) { .@rand = rand(.@range); set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static; .@temparray[.@rand] = .@temparray[--.@range]; } return .@count; } prontera,155,185,5 script bg_pvp 1_F_MARIA,{ .minplayer2start = 1; // 1vs1 mes "bg_pvp"; if ( .start == true ) { mes "bg_pvp is on-going"; close; } while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i; if ( .@i < .size ) { mes "You already join the queue."; close; } select "join"; mes "you have to stick to this map"; close2; .aid[ .size++ ] = getcharid(3); for ( .@i = 0; .@i < .size; ++.@i ) { if ( !isloggedin( .aid[.@i] ) ) { deletearray .aid[.@i], 1; --.@i; --.size; } else { attachrid .aid[.@i]; if ( strcharinfo(3) != strnpcinfo(4) ) { deletearray .aid[.@i], 1; --.@i; --.size; } } } detachrid; if ( .size < .minplayer2start *2 ) { announce .size +" players join", bc_npc | bc_area; end; } .start = true; .red = bg_create( "bat_c01",53,128, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead" ); .blue = bg_create( "bat_c01",146,56, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead" ); callfunc "F_ShuffleNumbers", 0, .size -1, .@r; for ( .@i = 0; .@i < .size; ++.@i ) { attachrid .aid[ .@r[.@i] ]; bg_join ( .@i % 2 )? .red : .blue; } detachrid; deletearray .aid; .size = 0; bg_warp .red, "bat_c03", 53,128; bg_warp .blue, "bat_c03", 146,56; sleep 30000; // Match Duration if ( !.winside ) mapannounce "bat_c03", "Battle end as time out", bc_map; else if ( .winside == .red ) { mapannounce "bat_c03", "- Red side Won the match !", bc_map; callsub L_reward, .red; } else if ( .winside == .blue ) { mapannounce "bat_c03", "- Blue side Won the match !", bc_map; callsub L_reward, .blue; } bg_destroy .red; bg_destroy .blue; mapwarp "bat_c03", "prontera",150,185; .start = .winside = false; end; L_reward: bg_get_data getarg(0), 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem 501,1, $@arenamembers[.@i]; return; OnRedQuit: callsub L_Quit, .red, .blue, "Red"; OnBlueQuit: callsub L_Quit, .blue, .red, "Blue"; L_Quit: if ( bg_get_data( getarg(0), 0 ) ) end; mapannounce "bat_c03", "All "+ getarg(2) +" team members has Quit!", bc_map; .winside = getarg(1); awake strnpcinfo(0); end; OnRedDead: callsub L_Dead, .red, .blue, "Red"; OnBlueDead: callsub L_Dead, .lue, .red, "Blue"; L_Dead: bg_leave; if ( bg_get_data( getarg(0), 0 ) ) end; mapannounce "bat_c03", "All "+ getarg(2) +" team members has killed!", bc_map; .winside = getarg(1); awake strnpcinfo(0); sleep2 1250; percentheal 100,100; end; } bat_c03 mapflag battleground bat_c03 mapflag nosave SavePoint bat_c03 mapflag nowarp bat_c03 mapflag nowarpto bat_c03 mapflag noteleport bat_c03 mapflag nomemo bat_c03 mapflag nopenalty bat_c03 mapflag nobranch bat_c03 mapflag noicewall @leonardofan
  6. Feeling nostalgic right now the broken link from Keyworld's post, I found it in my old hard-disk setbit.txt
  7. Hangman .... I remember Keyworld made that script before .... hmm .... ok I also make one right now (shuffle my old hard-disk) OMG found this script hangman.txt PS: Holy shit I have so many eathena scripts inside this hard drive PS: I'm still searching for it's cutin file, but I don't think I can find it
  8. Geeezz ... rathena actually broke 2 of my scripts 1.5 https://drive.google.com/file/d/1PFBD6areDW4j4viH2rYViA4cAeXWWOMz/view fix a server crash bug by rathena @xyxzero @Sky Raker
  9. https://github.com/Stolao/Npc_Release/blob/master/Auto_Event/Auto_Event.txt#L1183 line 1183 .@size = getarraysize( .@cid ); attachrid getcharid(3, .@name$); // ADD THIS LINE for ( .@i = 0; .@i < .@size; .@i++ ){ line 1189 mapannounce .EnterMap$[16],.EventName$[16]+" ended with a total of "+(.@size)+" winners.",bc_all; // FIX THIS LINE @vilkhl
  10. let me have some fun do some source coding ~ src/map/pc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 6f651eff3..72b34137b 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -5040,6 +5040,9 @@ int pc_useitem(struct map_session_data *sd,int n) return 0;/* regardless, effect is not run */ } + if ( id->type == IT_HEALING && sd->status.base_level >= 15 && sd->status.base_level <= 50 ) + return 0; + sd->itemid = item.nameid; sd->itemindex = n; if(sd->catch_target_class != PET_CATCH_FAIL) //Abort pet catching. if you mean not restricting for whole item type, but only 1 item ID, then change if ( id->type == IT_HEALING ) into if ( item.nameid == <item ID> ) ========================= EDIT: - Emistry answer is correct
  11. members love features, that's why the script looks very ugly if you know how to script, use the one inside Github, https://github.com/rathena/rathena/blob/master/npc/custom/etc/mvp_room.txt it lack features but the script is cleaner, you can learn scripting easier that way
  12. yeah, confirm, but its rAthena's fault. This simple script cause map-server crash - script fsfdsfsd -1,{ OnInit: getmapxy .@map$, .@x, .@y, UNITTYPE_NPC; end; } 1.4 - fix server crash because rathena love introducing new bugs all I did was add a new line on line 325
  13. @n0tttt I've tried your script, but my test server throws error on me ... [Error]: Loading NPC file: npc/zzz.txt script error on npc/zzz.txt line 8 script:add_word: invalid word. A word consists of undercores and/or alphanum eric characters, and valid variable prefixes/postfixes. 3 : OnPCStatCalcEvent: 4 : .@item_id = 2301; 5 : .@pid = getcharid(1); 6 : .@oid = getcharid(3); 7 : if(isequipped(.@item_id) && .@pid) { * 8 : .@is_leader = is_party_leader(')'; 9 : getpartymember .@pid,1,.@party_cid; 10 : getpartymember .@pid,2,.@party_aid; 11 : .@size = $@partymembercount; 12 : for(;.@i < .@size;.@i++) { 13 : if(isloggedin(.@party_aid[.@i],.@party_cid[.@i]) ) { @Azeroth I don't think your idea is possible, both methods doesn't work - script sfdfkjshf -1,{ OnInit: setitemscript 2301, "{"+ ".@pid = getcharid(1);"+ "if ( !.@pid ) end;"+ "if ( getpartyleader( .@pid, 2 ) != getcharid(0) ) end;"+ "getpartymember .@pid, 1;"+ "getpartymember .@pid, 2;"+ "for ( .@i = 0; .@i < $@partymembercount; ++.@i ) {"+ " if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {"+ " attachrid $@partymemberaid[.@i];"+ " bonus bStr, 1;"+ // doesn't give other members " dispbottom 1;"+ " }"+ "}"+ "}"; } - script sfdfkjshf -1,{ OnPCStatCalcEvent: if ( !isequipped(2301) ) end; .@pid = getcharid(1); if ( !.@pid ) end; if ( getpartyleader( .@pid, 2 ) != getcharid(0) ) end; getpartymember .@pid, 1; getpartymember .@pid, 2; for ( .@i = 0; .@i < $@partymembercount; ++.@i ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { attachrid $@partymemberaid[.@i]; bonus bAllstats, 1; // recalculatestat(); dispbottom 1; } } end; } the dispbottom part shows for the other party member, but the stats aren't updated probably due to the fact the part where bonus us calculated, namely status_calc_pc function are badly coded it was coded in the way only gives to the user, not for others even *recalculatestat script command doesn't work
  14. wow ... this kind of table logs every single kills I wonder will this kind of table can cause lag to the server ? because `the killer_id` field is not indexed" perhaps index that field just to be safe explain pvplog; alter table pvplog add key killer_id (killer_id); and here's the script for it, @Switcho //===== rAthena Script ======================================= //= PvP log //===== By: ================================================== //= Vietlubu //===== Description: ========================================= //= Simple SQL PvP log //= Notes: //= - Create table `pvplog` when start script. //= - Add new record when has OnPCKillEvent //= - Remove NCP PvP Ranking if you don't want to use. //===== Compatible With: ===================================== //= rAthena Project //===== Changelogs: ========================================== //= 1.0 First version. //============================================================ prontera,155,181,5 script PvP Ranking 430,{ .@limitRanking = 3; .@limitEnemies = 3; mes "[PvP Ranking]"; //menu "Ranking of month", L_RankMonth, "Ranking of week", L_RankWeek, "Ranking of day", L_RankDay; select "Ranking of month", "Ranking of week", "Ranking of day", "My enemies"; if (@menu < 4) { // Ranking switch(@menu) { case 1: .@ranking$ = "MONTH"; .@message$ = "Ranking of month"; break; case 2: .@ranking$ = "WEEK"; .@message$ = "Ranking of week"; break; case 3: .@ranking$ = "DAY"; .@message$ = "Ranking of day"; break; } query_sql("SELECT `pvplog`.`killer_id` AS CID, `char`.`name`, COUNT(`pvplog`.`killer_id`) AS count_kill, (SELECT COUNT(`pvplog`.`victim_id`) from pvplog where victim_id = CID) FROM `pvplog` INNER JOIN `char` ON `char`.`char_id` = `pvplog`.`killer_id` WHERE " + .@ranking$ + "(`pvplog`.`pvp_date`) = " + .@ranking$ + "(CURRENT_DATE()) GROUP BY `char`.`name` ORDER BY count_kill DESC LIMIT " + .@limitRanking, .@cid, .@name$, .@count_kill, .@count_death); mes .@message$; for( @i = 0; @i < getarraysize(.@name$); @i++ ) { mes "Top " + (@i+1) + ": ^2ecc71" + .@name$[@i] + "^000000 kill/death: ^e74c3c" + .@count_kill[@i] + "/"+ .@count_death[@i] + "^000000"; } } else if (@menu == 4) { query_sql("SELECT `char`.`name`, COUNT(`char`.`name`) AS count_kill FROM `pvplog` INNER JOIN `char` ON `char`.`char_id` = `pvplog`.`killer_id` WHERE `pvplog`.`victim_id` = " + getcharid(0) + " GROUP BY `char`.`name` ORDER BY count_kill DESC LIMIT " + .@limitEnemies, .@name$, .@count_kill); mes "Top your enemies:"; for( @i = 0; @i < getarraysize(.@name$); @i++ ) { mes "Top 1: ^e74c3c" + .@name$[0] + "^000000 kill you ^2ecc71" + .@count_kill[0] + "^000000 times" + "^000000"; } } close; L_RankMonth: mes "Ranking of month"; close; L_RankWeek: mes "Ranking of week"; close; L_RankDay: mes "Ranking of day"; close; end; } - script pvplog -1,{ OnInit: query_sql("CREATE TABLE IF NOT EXISTS `pvplog` (`pvp_id` mediumint(9) unsigned NOT NULL auto_increment, `pvp_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `killer_id` int(11) NOT NULL default '0', `victim_id` int(11) NOT NULL default '0', `map` varchar(11) NOT NULL default '', PRIMARY KEY (`pvp_id`)) ENGINE=MyISAM AUTO_INCREMENT=1;"); end; OnPCKillEvent: query_sql("INSERT INTO `pvplog` (`killer_id`, `victim_id`, `map`) VALUES ('" + getcharid(0) + "', (SELECT `char_id` FROM `char` WHERE `name` = '" + rid2name(killedrid) + "'), '" + strcharinfo(3) + "');"); end; }
  15. prontera,155,185,5 script skdjfksjdf 1_F_MARIA,{ if ( !.mobid ) { monster "this", -1,-1, "--ja--", 1002,1, strnpcinfo(0)+"::Onkill"; .mobid = $@mobid; } else { getunitdata .mobid, .@unitdata; dispbottom "X: "+ .@unitdata[UMOB_X] +" - Y: "+ .@unitdata[UMOB_Y]; } end; Onkill: .mobid = 0; end; } EDIT: forgot to add event labels
  16. next time please use *setitemscript since you want it to trigger from npc npc script can totally control item database with *setitemdata and *setitemscript
  17. hercules still haven't made this change, so the value still the same with eamod hercules -> EQI_HEAD_TOP (1) - Upper head gear EQI_ARMOR (2) - Armor (Where you keep your Jackets and Robes) EQI_HAND_L (3) - What is in your Left hand. EQI_HAND_R (4) - What is in your Right hand. EQI_GARMENT (5) - The garment slot (Mufflers, Hoods, Manteaus) EQI_SHOES (6) - What foot gear the player has on. EQI_ACC_L (7) - Accessory 1. EQI_ACC_R (8) - Accessory 2. EQI_HEAD_MID (9) - Middle Headgear (masks and glasses) EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks) rathena -> EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) curious ... you are switching to rathena ? you no longer follow the value by eamod/hercules ...
  18. nope, its the source code I still remember this ... since eathena times, the script command actually return 1; means false -> show a debug message and return 0; means success https://github.com/rathena/rathena/blob/master/src/map/script.hpp#L128 that's why when you do return SCRIPT_CMD_SUCCESS;, actually means return 0; all you have to do is change return 1; into return 0; into the source code, and return 0; into return 1; .... if you are still using eamod btw, hercules did it by swap the return 0; into return true; rathena did it by return SCRIPT_CMD_SUCCESS;
  19. you can increase the castle economy by adding a debug script that use setcastledata - script kdsjfskf 1_F_MARIA,{ end; OnInit: bindatcmd "asdf", strnpcinfo(0)+"::Onaaa"; end; Onaaa: setcastledata "aldeg_cas01", 1, getcharid(2); // set this castle ID to yours setcastledata "aldeg_cas01", 2, 100; // set economy value to 100 donpcevent "Treasure#aldeg_cas01::OnClock0001"; // spawn the treasure immediately end; } well you can play with it btw I'm thinking about going back to hercules forum and concentrate there if you ... or anyone still wants my support just post a topic over there
  20. why not just use *showdigit ? might need to use addrid because showdigit only attach to 1 player though prontera,155,185,5 script kshdfkfs 1_F_MARIA,{ addrid 1; showdigit ~10, 2; sleep2 10000; showdigit 0, 0; end; }
  21. yup this is correct if you think the official woe script spawn wrong treasure chest, I think you should file report to get a developer for clarify the official information ... hmm ... although ratemyserver is normally not use by developers for official information ...
  22. just use the original and only change 1 line Euphy suggestion is make different castles having different sets of treasure chest what you did is all castles spawn the same set of treasure chest
  23. I think that's the problem we have *rentitem and also *getitembound ... but we don't have *rentitembound ... I just tested make a rentitem, then directly hijack the SQL `inventory` table and set the item bound as type 2 still cannot store the item into the guild storage like a normal getitembound with type 2 which means the rental item script takes priority though, your suggestion might need source modification, I search rentitembound on both hercules and rathena forum and no result return nobody ever bring this up
  24. heck, don't use *setlook ... setlook will save to the character data ... for example, like in this script, if you have use setlook here, player can save the clothing color by logging out, and this will make the player permanently have that cloth color - script ksdjhfksjf -1,{ OnInit: // 1201 - knife ... 2301 - cotton shirt setitemscript 1201, "{ changelook LOOK_CLOTHES_COLOR, getlook(LOOK_CLOTHES_COLOR); }", 2; setitemscript 2301, "{ changelook LOOK_CLOTHES_COLOR, getlook(LOOK_CLOTHES_COLOR); }", 2; end; } db\re\item_combo_db.txt 1201:2301,{ changelook LOOK_CLOTHES_COLOR, 2; }
  25. what Euphy suggested there is the treasure box for each castle has its own set of treasure chests eg: castle 1 and castle 2 spawn different sets of treasure chests but what I see on your script is ALL castle spawn randomly -> all the same ID this makes things easier change this line 1273 monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Treasure Chest",.@boxid,1,"Treasure#"+strnpcinfo(2)+"::OnTreasureDied"+.@i; into monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Treasure Chest", F_Rand(1324,1326,1328,1330,1332,1334,1336,1338,1340,1342,1344,1346,1348,1350,1352,1354,1356,1358,1360,1362), 1,"Treasure#"+strnpcinfo(2)+"::OnTreasureDied"+.@i;
×
×
  • Create New...