Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by AnnieRuru

  1. correction .... rand(2) actually produce number 0 or 1 .. if ( rand(50) < 4 ) actually means 4 out 50, means land on 0,1,2,3 is true condition, 4~49 is false condition when you quote the code ... didn't you see it has case 0: ? and the default: case is actually case 14:
  2. I think you just have to change your INT(11) UNSIGNED into INT(11) SIGNED yeah I reproduce your error [SQL]: DB error - BIGINT UNSIGNED value is out of range in '(`rathena`.`pvpladder`.`points` - 14)' [Debug]: at d:\ragnarok\rathena\src\map\script.cpp:16882 - insert into `pvpladder` value ( 150001, 'EnnyRuru', 0 ) on duplicate key update `points` = IF( points - 14 < 0, 0, points - 14) [Debug]: Source (NPC): kjsdhfj at prontera (155,185) if you make your `points` field as varchar(30), then when you list out the top 10 players, let's say player A has 20 points and player B has 9 points, the script will show player B has higher score than player A, because the number '9' is bigger than number '2' (remember this is a string) you have to cast the `points` field as Integer like this SELECT * FROM `pvpladder` ORDER BY CAST(`points` AS SIGNED) DESC;
  3. since you want this as equipments, you have to add new skills and adding new skills is never simple https://github.com/rathena/rathena/wiki/Adding_new_skills yes, just like TheDerpySupport said, when you shout the skill name, the skill level is not included which means, you have to make 20 new skills, with each skill having just 1 level, and each skill ID has different name to shout the number you want cannot done with scripting or database alone this is probably source modification
  4. apparently most of the anti-bot out there that uses SC_BERSERK to mute the players, actually can be bypass by opencore https://github.com/HerculesWS/Hercules/pull/937#issuecomment-165323552 I wish rathena actually has this *setpcblock script command that just merge into hercules days ago https://github.com/HerculesWS/Hercules/pull/842 so nope, until rathena actually has its own script command to disable player from using atcommand ... nvm, just write one right now for hercules ones - script anti-bot FAKE_NPC,{ OnNPCKillEvent: if ( getmapflag( strcharinfo(PC_MAP), mf_nosave ) ) end; // never trigger anti-bot on event maps ++@anti_bot_mob_killed; if ( @anti_bot_mob_killed < 100 ) end; setpcblock PCBLOCK_MOVE | PCBLOCK_ATTACK | PCBLOCK_SKILL | PCBLOCK_USEITEM | PCBLOCK_IMMUNE | PCBLOCK_COMMANDS, true; .@a = rand(1,9); .@b = rand(0, 9 - .@a); mes "What is the number"; mes .@a +" + "+ .@b +" = ?"; next; input .@ans, 1, 10; if ( .@a + .@b != .@ans ) { ++#anti_bot_wrong_answer; if ( #anti_bot_wrong_answer >= 3 ) { atcommand "@jailfor 30m "+ strcharinfo(PC_NAME); end; } mes "wrong answer"; close2; setpcblock PCBLOCK_COMMANDS, false; // hmm .... atcommand "@kick "+ strcharinfo(PC_NAME); end; } mes "ok you are free to go"; #anti_bot_wrong_answer = 0; setpcblock PCBLOCK_MOVE | PCBLOCK_ATTACK | PCBLOCK_SKILL | PCBLOCK_USEITEM | PCBLOCK_IMMUNE | PCBLOCK_COMMANDS, false; close; }
  5. announce "[Fast-Type Event] : Next round starts in 5 seconds.",bc_map,0x00FFFF; ---- Change into ----> announce "[Fast-Type Event] : Next round starts in 5 seconds.",bc_map|bc_npc,0x00FFFF; almost all of it needs to add bc_npc flag for the 1st script 2nd script however need to use mapannounce, since the monster spawn in other maps announce "[Find the Plant] : "+.spawnplant+" plants have been spawned in the event area.",bc_map,0x00FFFF; ------ Change into -----> mapannounce .Map$, "[Find the Plant] : "+.spawnplant+" plants have been spawned in the event area.", bc_map, 0x00FFFF;
  6. AnnieRuru

    CTP event?

    prontera,155,185,5 script Click-The-Pub 1_F_MARIA,{ end; OnWhisperGlobal: if ( getgmlevel() >= 99 ) goto OnMinute00; end; OnMinute00: delwaitingroom; waitingroom "Click ME", 2, strnpcinfo(0)+"::OnWinner", 1; end; OnWinner: warpwaitingpc "prontera", 155, 182, 1; attachrid $@warpwaitingpc; if ( !checkweight( 501,1 ) ) { dispbottom "LOL you don't have enought space to get a reward"; end; } getitem 501, 1; announce "Click the Pub: Winner is "+ strcharinfo(0) +" !!", bc_all; delwaitingroom; end; }
  7. AnnieRuru

    CTP event?

    @caspa , too simple ... prontera,155,185,5 script Click-The-Pub 1_F_MARIA,{ end; //OnInit: bindatcmd "test", strnpcinfo(0)+"::OnMinute00"; end; OnMinute00: delwaitingroom; waitingroom "Click ME", 2, strnpcinfo(0)+"::OnWinner", 1; end; OnWinner: getwaitingroomusers; attachrid .@waitingroom_users; if ( !checkweight( 501,1 ) ) { dispbottom "LOL you don't have enought space to get a reward"; kickwaitingroomall; end; } getitem 501, 1; announce "Click the Pub: Winner is "+ strcharinfo(0) +" !!", bc_all; delwaitingroom; end; } btw I remember you said you are using eamod ... I don't think your server has *getwaitingroomusers ?
  8. eh ... 1. showing value from `char_reg_num` is not thread-safe ... 2. `value` field from `char_reg_num` is not index ... well it seems the whole rathena community love to use this method ... I'm not going to comment anymore if(killerrid >= 2000000) I think this condition is not needed for OnPCDieEvent if he uses OnPCDieEvent, then we assume it will trigger whenever the player die .. no matter from which source if he wants to make it trigger by player kill only then should have OnPCKillEvent, and attachrid killedrid; later however the OnPCKillEvent need the killedrid check though, Grand-Cross killing self can trigger both OnPCKillEvent and OnPCDieEvent PS: I got notification several times while you editing your post @sader1992 testing Mention ....
  9. curious .... do you actually mean telling others to make their own ladder type algorithm ... script ? I'm actually interested if you can show me your txt style ladder script ? .@rand = rand(10,20); query_sql "insert into `mvp_ranking value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) "', 0 ) on duplicate key update points = IF( points - "+ .@rand +" < 0, 0, points - "+ .@rand +" )";
  10. AnnieRuru

    CTP event?

    what is this "CTP" or "click the pub" event means the 1st player who join the chat room that shows on top of npc wins ?
  11. #should be `points` on duplicate key update `points` = `points` + "+ rand(100,1000); on duplicate key update `points` = `points` + " .@points; #SQL rand() on duplicate key update `points` = `points` + floor( rand() * (1000-100+1) )+100;" PS: your OnPCDieEvent: should use killerrid instead of killedrid
  12. then how about I ask back ... do you think *announce with bc_all flag will lag your server ? if your answer is no, then *addrid also doesn't lag your server both does the same thing with manipulate data to all players *query_sql should be very fast, and if you index the `nameid` field, yeah it will return result faster EDIT: some time later select name from inventory left join `char` on inventory.char_id = `char`.char_id where nameid = 501 and online = 0; select name from ( select char_id from inventory where nameid = 501 ) as aaa left join ( select char_id, name from `char` where online = 0 ) as bbb on aaa.char_id = bbb.char_id; select char_id as cid, ( select name from `char` where char_id = cid ) from inventory where nameid = 501; well all 3 commands should return same result ... just testing I think ... since the `char_id` field has been indexed in both tables, table JOIN should works fine I guess
  13. HAHAHA sometimes I do get this silly mistakes prontera,155,185,5 script ksdfhksdjf 1_F_MARIA,{ mes "select an item ID"; next; .id = .itemid[ select( .menu$ ) -1 ]; donpcevent strnpcinfo(0) +"::OnGetAID"; mes "These are the players having"; mes "^0000FF"+ getitemname(.id) +"^000000 in their inventory."; for ( .@i = 0; .@i < .c; ++.@i ) mes (.@i +1) +". "+ .name$[.@i]; close; OnGetAID: .c = 0; addrid 0; if ( countitem(.id) ) .name$[.c++] = strcharinfo(0); end; OnInit: setarray .itemid, 501, 502, 503, 504, 505; // add more item here to show .@size = getarraysize(.itemid); for ( .@i = 0; .@i < .@size; ++.@i ) .menu$ += getitemname(.itemid[.@i]) +":"; end; } omg ... I guess have to use query_sql after all ... prontera,155,185,5 script ksdfhksdjf 1_F_MARIA,{ mes "select an item ID"; next; .id = .itemid[ select( .menu$ ) -1 ]; .@id = .id; donpcevent strnpcinfo(0) +"::OnGetAID"; mes "These are ^009900Online^000000 players having"; mes "^0000FF"+ getitemname(.@id) +"^000000 in their inventory."; for ( .@i = 0; .@i < .c; ++.@i ) mes (.@i +1) +". "+ .name$[.@i]; next; mes "These are ^FF0000Offline^000000 players having"; mes "^0000FF"+ getitemname(.@id) +"^000000 in their inventory."; .@nb = query_sql( "select name from inventory left join `char` on inventory.char_id = `char`.char_id where `char`.online = 0 and inventory.nameid = "+ .@id, .@name$ ); for ( .@i = 0; .@i < .@nb; ++.@i ) mes (.@i +1) +". "+ .@name$[.@i]; close; OnGetAID: .c = 0; addrid 0; if ( countitem(.id) ) .name$[.c++] = strcharinfo(0); end; OnInit: setarray .itemid, 501, 502, 503, 504, 505; // add more item here to show .@size = getarraysize(.itemid); for ( .@i = 0; .@i < .@size; ++.@i ) .menu$ += getitemname(.itemid[.@i]) +":"; end; }
  14. eh ... sorry about left this topic out there is also another way to mine the treasure chest like I did in treasure chest pvp event (sry the script is too old and in the middle of fixing it) - script main FAKE_NPC,{ OnInit: bindatcmd "event", strnpcinfo(0)+"::Onaaa", 99,99; for ( .@i = 0; .@i < 20; ++.@i ) disablenpc "Treasure Chest#"+ .@i +"_ev"; end; Onaaa: if ( .start == false && ( compare( .@atcmd_parameters$, "on" ) || compare( .@atcmd_parameters$, "start" ) ) ) goto OnStart; if ( .start == true && ( compare( .@atcmd_parameters$, "off" ) || compare( .@atcmd_parameters$, "end" ) ) ) goto OnEnd; end; OnStart: .start = true; ++.event_id; for ( .@i = 0; .@i < 20; ++.@i ) { while ( checkcell( "prontera", .@x = rand(148,179), .@y = rand(163,191), cell_chknopass ) ); movenpc "Treasure Chest#"+ .@i +"_ev", .@x, .@y; enablenpc "Treasure Chest#"+ .@i +"_ev"; .deny[.@i] = 0; } end; OnEnd: .start = false; for ( .@i = 0; .@i < 20; ++.@i ) disablenpc "Treasure Chest#"+ .@i +"_ev"; end; OnPCLogoutEvent: if ( @treasu_ev_ ) .deny[ @treasu_ev_ ] = 0; end; } - script treasu_ev FAKE_NPC,{ .@id = strnpcinfo(2); if ( @treasu_ev_event_id == getvariableofnpc( .event_id, "main" ) ) { showscript "[Treasure Chest] You have digged treasure chest in this round.", getcharid(3), SELF; end; } if ( getvariableofnpc( .deny[.@id], "main" ) ) { showscript "[Treasure Chest] Somebody else is digging this treasure chest.", getcharid(3), SELF; end; } set getvariableofnpc( .deny[.@id], "main" ), getcharid(3); @treasu_ev_ = .@id; doevent "main::OnPCLogoutEvent"; progressbar "", 5; // time to capture, 5 seconds getitem 501, 1; @treasu_ev_event_id = getvariableofnpc( .event_id, "main" ); disablenpc strnpcinfo(0); movenpc "Treasure Chest#"+ .@i +"_ev", 0, 0; end; } prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#0_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#1_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#2_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#3_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#4_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#5_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#6_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#7_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#8_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#9_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#10_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#11_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#12_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#13_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#14_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#15_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#16_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#17_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#18_ev 1324 prontera,0,0,0 duplicate(treasu_ev) Treasure Chest#19_ev 1324
  15. you guys should petition to get F_ShuffleNumbers function inside Github AHH .... 1 more time http://upaste.me/e7fe499005a72504d
  16. curious then ... let's say a member wants a feature implement ... and have enough cash want to kick start a campaign ... but the feature is not listed in the crowdfunding list ... so how members going to start a petition for a support ? maybe add another subforum for the discussion ? because I don't think its a good idea for members to just open a crowdfunding project easily should have a leader behind to monitor them
  17. this actually reminds me during eathena days, there were bounty ... back in those day we were using SVN so there was no pull request ... maybe its time to bring this feature back how they did ? 1. members put a bounty on a project they like to implement 2. the developers, or whoever get it done get part of the bounty payment of course, if I still remember well, this idea was dropped soon after because this promote developers getting lazy and only do for the bounty well, but in my opinion, it was such a nice idea let me recall some of the important points of the discussion ... because eathena board was no more ... 1. how the members going to put a bounty ... and who going to manage the money ... 2. if I still remember correctly, the bounty can only issue by developers, usually issue for official script that needs IRO confirmation, or something like iro script convertion ... etc yeah, I remember at the time, I don't know why they don't allow members put a bounty ... maybe because they usually asked for unofficial request ? 3. put a bounty on a project to get it done faster, or bounty on things that's not many wants to do, but a popular feature..... 4. can't really remember at the moment ... but anyhow ... discuss ~ EDIT: ... ohh.... https://rathena.org/board/crowdfunding/category/1-rathena-forums/
  18. https://github.com/rathena/rathena/wiki/Timers_(Scripting)#use-number-3-deny-usage urgh .... so bad .... maybe try hercules ones .. https://herc.ws/wiki/Timers_(Scripting)#Use_Number_3:_Deny_Usage
  19. heck, they use *query_sql, which is not thread-safe better use *addrid prontera,155,185,5 script ksdfhksdjf 1_F_MARIA,{ mes "input item ID"; next; input .id, 0, 65535; if ( !.id ) close; if ( getitemname(.id) == "null" ) { mes "item ID doens't exist"; close; } donpcevent strnpcinfo(0) +"::OnGetAID"; copyarray .@name$, .name$, .c; .@c = .c; copyarray .@cname$, .cname$, .cc; .@cc = .cc; copyarray .@sname$, .sname$, .sc; .@sc = .sc; copyarray .@gname$, .gname$, .gc; .@gc = .gc; while (true) { switch( select( "Inventory", "Cart", "Storate", "Guild Storage" ) ) { case 1: mes "Inventory"; for ( .@i = 0; .@i < .@c; ++.@i ) mes (.@i +1) +". "+ .@name$[.@i]; break; case 2: mes "Cart"; for ( .@i = 0; .@i < .@cc; ++.@i ) mes (.@i +1) +". "+ .@cname$[.@i]; break; case 3: mes "Storage"; for ( .@i = 0; .@i < .@sc; ++.@i ) mes (.@i +1) +". "+ .@sname$[.@i]; break; case 4: mes "Guild Storage"; for ( .@i = 0; .@i < .@gc; ++.@i ) mes (.@i +1) +". "+ .@gname$[.@i]; break; } next; } end; OnGetAID: .c = .cc = .sc = .gc = 0; addrid 0; if ( countitem(.id) ) .name$[.c++] = strcharinfo(0); if ( cartcountitem(.id) ) .cname$[.cc++] = strcharinfo(0); if ( storagecountitem(.id) ) .sname$[.sc++] = strcharinfo(0); if ( guildstoragecountitem(.id) ) .gname$[.gc++] = strcharinfo(0); end; } EDIT for below : LOL forgot to reset the variables
  20. why put the best answer already ? you know how to apply the feature to the original woe by referring to my template script ? anyway here's the script, tested http://upaste.me/e7fe499005a72504d though it seems Euphy added unnecessary gvgon on the castle map ... so have to gvgoff them
  21. its been awhile since I wrote a custom woe script http://herc.ws/board/topic/4848-woe-castle-auto-assign-on-guild/ this kind of request doesn't pop up often http://upaste.me/8a6849899fca594c7 anyway tomorrow I'll do the official woe script ones, this one is just a template go to sleep 1st
  22. find close2; ... add announce strcharinfo(0) +" has join blah blah", bc_all;
  23. https://github.com/rathena/rathena/blob/master/db/castle_db.txt there are 20 first edition castles ... you mean like each castle open randomly ... but only loop back every 20 days ? sounds like need a shuffle algorithm to do this . so which castles are chosen ? only the 1st edition castles ? but since you say all castles that would include novice castles and third edition castles
  24. [Error]: script_set_reg: failed to set param 'Zeny' to -37769. [Debug]: Source (NPC): AntiBot (invisible/not on a map) make sure you put Zeny check before deducting Zeny... and probably check Zeny if overflow if the condition is true just put atcommand "@kick "+ strcharinfo(0); if you want to kick players
  25. How to use *addrid script command properly Method 1: Exploits its multi-concurrent run -> use *addrid right before ending the script addrid will run multiple instances equal to number of player attached, which, not entirely a bad thing when use properly, as shown below, don't have to use loop prontera,155,179,5 script kickall 1_F_MARIA,{ if ( getgmlevel() < 99 ) end; mes "I will kick all players after this dialog close"; mes "Exclude: autotrader, GMs, wondering in town."; close2; addrid 0; if ( getgmlevel() >= 60 ) end; // don't kick GMs if ( checkvending() & 2 ) end; // shouldn't kick @autotraders if ( getmapflag( strcharinfo(3), mf_town ) ) end; // doesn't kick anyone in the town atcommand "@kick "+ strcharinfo(0); end; } Method 2: Get all the RID in an array -> use donpcevent as calling a function, within that label, store the account IDs the preferred method, this method is safe from running multiple instances prontera,155,182,5 script getallusers 1_F_MARIA,{ donpcevent strnpcinfo(0)+"::OnGetAID"; // treat this as calling a function to get online player's account ID for ( .@i = 0; .@i < .c; ++.@i ) announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all; end; OnGetAID: .c = 0; addrid 0; .aid[.c++] = getcharid(3); end; } - script getallmap HIDDEN_NPC,{ end; OnTest: donpcevent strnpcinfo(0)+"::OnGetAID"; for ( .@i = 0; .@i < .c; ++.@i ) announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all; end; OnGetAID: .c = 0; addrid 5, 0, "payon"; // only attach to everyone inside payon map .aid[.c++] = getcharid(3); end; OnInit: bindatcmd "test", strnpcinfo(0)+"::OnTest"; end; } guild_vs2,0,0,0 script getareausers HIDDEN_NPC,{ end; OnTest: donpcevent strnpcinfo(0)+"::OnGetAID"; for ( .@i = 0; .@i < .c; ++.@i ) announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all; end; OnGetAID: .c = 0; addrid 4, 0, 46, 46, 53, 53; // attach everyone in the map 'guild_vs2' of (46,46,53,53) area .aid[.c++] = getcharid(3); end; OnInit: bindatcmd "test2", strnpcinfo(0)+"::OnTest"; end; }
×
×
  • Create New...