Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Community Answers

  1. AnnieRuru's post in Help Learning Instance and how it works. <3 was marked as the answer   
    ok let me rephrase that sentence ...
    in rathena .......
    34,Instance ONE,3600,15,guild_vs1,49,49 35,Instance TWO,3600,15,guild_vs2,49,49 prontera,150,180,0 script Check Instance 1_F_MARIA,{ OnClick: dispbottom strcharinfo(3); dispbottom instance_id() +""; // this line sux ... if you only have 1 instance attached then its ok, but if more than one ... end; OnInit: bindatcmd "test", strnpcinfo(0)+"::OnClick"; end; } prontera,155,180,0 script Instance ONE 1_F_MARIA,{ if ( getstrlen( instance_mapname("guild_vs1") ) ) { instance_enter "Instance ONE"; end; } if ( instance_create( "Instance ONE", IM_PARTY ) < 0 ) { mes "failed to create instance"; close; } instance_enter "Instance ONE"; end; } prontera,158,180,0 script Instance TWO 1_F_MARIA,{ if ( getstrlen( instance_mapname("guild_vs2") ) ) { instance_enter "Instance TWO"; end; } if ( instance_create( "Instance TWO", IM_GUILD ) < 0 ) { mes "failed to create instance"; close; } instance_enter "Instance TWO"; end; } yes, one for party, another one for guild
    now here's the scenario ...
    let's say Player A same party with Player C, and Player A register the Instance ONE for party
    Player B same guild with Player C, and Player B register the Instance TWO for guild
    Player C has the choice to go in both instance, since Player C has meet both requirement
    my test result is ... it seems rathena has bug in this case, Player C allow to go in Party type only
    test again in hercules ... no problem, Player C can go inside both instance
    prontera,150,180,0 script Check Instance 1_F_MARIA,{ OnClick: dispbottom strcharinfo(3); dispbottom instance_id() +""; // this script command is useless in hercules, always return -1 on non-instanced npc. An instanced npc don't need to use this script command anyway dispbottom has_instance2("guild_vs1") +""; dispbottom has_instance2("guild_vs2") +""; end; OnInit: bindatcmd "test", strnpcinfo(0)+"::OnClick"; end; } prontera,155,180,0 script Instance ONE 1_F_MARIA,{ if ( has_instance2("guild_vs1") >= 0 ) { warp has_instance("guild_vs1"), 49,49; end; } if ( ( .@ins = instance_create( "Instance ONE", getcharid(CHAR_ID_PARTY), IOT_PARTY ) ) < 0 ) { mes "error : "+ .@ins; close; } if ( !getstrlen( instance_attachmap( "guild_vs1", .@ins, true, .@ins +"INS1" ) ) ) { mes "error : 5"; instance_destroy .@ins; close; } instance_set_timeout 3600, 15, .@ins; instance_init .@ins; warp has_instance("guild_vs1"), 49,49; end; } prontera,158,180,0 script Instance TWO 1_F_MARIA,{ if ( has_instance2("guild_vs2") >= 0 ) { warp has_instance("guild_vs2"), 49,49; end; } if ( ( .@ins = instance_create( "Instance ONE", getcharid(CHAR_ID_GUILD), IOT_GUILD ) ) < 0 ) { mes "error : "+ .@ins; close; } if ( !getstrlen( instance_attachmap( "guild_vs2", .@ins, true, .@ins +"INS2" ) ) ) { mes "error : 5"; instance_destroy .@ins; close; } instance_set_timeout 3600, 15, .@ins; instance_init .@ins; warp has_instance("guild_vs2"), 49,49; end; }  
  2. AnnieRuru's post in How to deal with case sensitive ? was marked as the answer   
    input .@PlayerSpecInputName$; .@ownName$ = strcharinfo(0); if (compare(.@PlayerSpecInputName$, .@ownName$) && compare(.@ownName$, .@PlayerSpecInputName$)) { mes "You cant use your own name"; close; }  
  3. AnnieRuru's post in Is it possible to mass edit monsters stats? was marked as the answer   
    this is the reason why I love to use SQL `item_db` and `mob_db`
    update mob_db set vit = vit *2 where id > 0; this will make every single monster VIT *2
    and so on ... just learn a few basics SQL command and you can figure out the rest
  4. AnnieRuru's post in Hidden Watchers on PVP event problem was marked as the answer   
    you seems to have 0 knowledge on source edits ...
    so ... spoon feed -> this patch has been tested work
    src/map/unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/unit.cpp b/src/map/unit.cpp index 8171fff..327db3b 100644 --- a/src/map/unit.cpp +++ b/src/map/unit.cpp @@ -562,7 +562,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data ud->to_y = bl->y; if(battle_config.official_cell_stack_limit > 0 - && map_count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) { + && map_count_oncell(bl->m, x, y, BL_CHAR, 1) > battle_config.official_cell_stack_limit) { //Walked on occupied cell, call unit_walktoxy again if(ud->steptimer != INVALID_TIMER) { //Execute step timer on next step instead this will make players can stand on top of ANY npc ... though
    it seems the map_count_oncell is used by several other functions, so I dare not touch it
  5. AnnieRuru's post in Script request was marked as the answer   
    yeah, this script is old school
    1 of my server I worked on, I saw players use openkore to cheat this event
     
    the openkore detect the announcement 999 then send a packet immediately, and most of the time, cheater wins
    I decided to take out this script ever since
     
    weird, our script looks entirely different
    //==================================================================== // Credits to: // acky, for the original script. // Vampy, for adding features to the NPC. // ~AnnieRuru~, for telling me how infinite loops work. // henrikejg, for telling me how to fix infinite loops. //==================================================================== prontera,155,171,5 script Stop The Clock::Ev_StopClock 46,{ set $itemid, 15702; if (getgmlevel() == 99) goto L_GM; if ($@kc > 0 && @kcid != $@kcid) goto L_eventstarted; mes "[Stop The Clock]"; mes "Hello ^FF0000"+strcharinfo(0)+"^000000, how can I help you?"; mes "^FF0000[Note] Stop The Clock starts every Tuesday, Thursday and Saturday at 6:00PM server time.^000000"; menu "^FF0000[Stop The Clock]^000000 information",L_info,"Exit",-; close; L_info: next; mes "[Stop The Clock]"; mes "^FF0000Stop the clock^000000 is a game where by players need to try to stop the clock as close to 1000 as possible."; next; mes "[Stop The Clock]"; mes "The person that stops the clock closest to 1000 wins!"; mes "^FF0000[Note] You need to stop the clock between 950 and 1000 to win.^000000"; next; mes "[Stop The Clock]"; mes "In cases where by there's a draw, all the winners will get a prize. For example, if both John and Tom got 997, both of them will get a prize each."; mes "Current prize for winning: ^FF0000"+ 1000 + " " +getitemname($itemid)+" ^000000"; close; L_eventstarted: set @kcid,$@kcid; setd ".timing_" + .number, $@kc; setd ".player_" + .number + "$", strcharinfo(0); set .number, .number+1; if ($@kc == 1000) { announce "Jackpot! "+strcharinfo(0)+" stopped the clock on "+$@kc+".",0,0x00EEFF; } else { announce ""+strcharinfo(0)+" stopped the clock on "+$@kc+".",0,0x00EEFF; } end; L_GM: mes "[Stop The Clock]"; mes "Hello Administrator, what would you like to do?"; mes "Current prize for winning: ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000"; menu "Configure Prize",L_configure,"Start Event",-,"Stop Event",L_stop; if (.start == 1) goto L_started; next; mes "[Stop The Clock]"; mes "Event started."; close2; L_startevent: set .start, 1; announce "[Stop The Clock] is starting in 1 minute!",0; initnpctimer; end; OnTimer30000: if (.start == 0) goto L_suddenstop; announce "[Stop The Clock] is starting in 30 seconds!",0; end; OnTimer50000: if (.start == 0) goto L_suddenstop; announce "[Stop The Clock] is starting in 10 seconds!",0; end; OnTimer55000: if (.start == 0) goto L_suddenstop; announce "[Stop The Clock] is starting in 5 seconds!",0; OnTimer60000: if (.start == 0) goto L_suddenstop; announce "[Stop The Clock] starts now! Stop the clock as close to 1000 as possible! To stop the clock, just click the NPC.",0; stopnpctimer; set .number, 1; set .count, 1000; set .winner, 0; set $@kc,0; set $@kci,0; set $@kcid,rand(100000,999999); while ($@kc < 1100) { set $@kc,$@kc+1; set $@kci,$@kci+1; if ($@kci == 100 || ($@kci == 10 && $@kc > 600) || ($@kci == 1 && $@kc >= 950 && $@kc < 1050)) { if (.start == 0) goto L_suddenstop; announce $@kc,0; set $@kci,0; specialeffect 18; } sleep 10; } set $@kc,0; set .start, 0; set .players, .number+1; OnFinish: sleep 1; if (.count == 949) goto OnFinish3; if (getd(".timing_" + .number) == .count) goto L_winner1; set .number, .number-1; if (.number != 0) goto OnFinish; set .number, 1; if (.winner == 1) goto OnFinish3; set .count, .count-1; OnFinish2: sleep 1; if (.count == 949) goto OnFinish3; if (getd(".timing_" + .number) == .count) goto L_winner2; set .number, .number+1; if (.number != .players) goto OnFinish2; set .number, .number-1; if (.winner == 1) goto OnFinish3; set .count, .count-1; goto OnFinish; L_winner1: if (getd(".timing_" + .number) == 1000) { announce ""+getd(".player_" + .number + "$")+" wins! (Prize x2 for stopping exactly on 1000)",0; charcommand "#item " + $itemid + " 2000 " + getd(".player_" + .number + "$"); } else { announce ""+getd(".player_" + .number + "$")+" wins!",0; charcommand "#item " + $itemid + " 1000 " + getd(".player_" + .number + "$"); } set .number, .number-1; set .winner, 1; goto OnFinish; L_winner2: if (getd(".timing_" + .number) == 1000) { announce ""+getd(".player_" + .number + "$")+" wins! (Prize x2 for stopping exactly on 1000)",0; charcommand "#item " + $itemid + " 2000 " + getd(".player_" + .number + "$"); } else { announce ""+getd(".player_" + .number + "$")+" wins!",0; charcommand "#item " + $itemid + " 1000 " + getd(".player_" + .number + "$"); } set .number, .number+1; set .winner, 1; goto OnFinish2; OnFinish3: sleep 1; set .number, .players-1; while (.number != 0) { set getd(".timing_" + .number), 0; set .number, .number-1; } end; L_started: next; mes "[Stop The Clock]"; mes "Event is already running!"; close; L_configure: next; mes "[Stop The Clock]"; mes "Are you sure you want ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000 to be the prize of the event?"; menu "Yes",-,"No",L_no; next; mes "[Stop The Clock]"; mes "Prize changed to ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000."; announce "Prize changed to "+ 1000 + " " + getitemname($itemid)+".",0; next; goto L_GM; L_no: close; L_stop: next; if (.start == 1) { mes "[Stop The Clock]"; mes "The event has already started, do you want to stop the event?"; menu "Yes",-,"No",-; if (@menu == 1) { next; set .start, 0; mes "[Stop The Clock]"; mes "Event Stopped"; next; goto L_GM; } else { next; goto L_GM; } } else { mes "[Stop The Clock]"; mes "The event hasn't started yet!"; close; } L_suddenstop: announce "[Stop The Clock] was stopped by an Administrator.",0; end; OnClock1015: OnClock2215: if (gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) end; goto L_startevent; }  
  6. AnnieRuru's post in Upper and mid Head head equipment for Custom Monster was marked as the answer   
    -- SQL command -- REPLACE INTO `mob_db2_re` VALUES (21999,'AnnieRuru','AnnieRuru','AnnieRuru',90,61282,0,100000,117800,1,1300,2053,35,60,1,9,97,145,88,40,10,12,1,7,66,0x3295,180,1152,384,288,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); -- mob_avail -- //21999,4057,2,3,8,1601,2104,167,169,0,0,2 21999,4057,2,3,8,1601,2104,167,73,0,0,2 wearing red_tailed_ribbon , item ID 5083 but sprite ID 167
    use sprite ID not item ID
  7. AnnieRuru's post in R> delete on char_reg_num on a specific time was marked as the answer   
    HAHAHA I just answer this question on the discord yesterday
    I just copy paste the chat log then
     
    Question : (Hyperion)
    how to reset the #BOSSNIAPOINTS using sql?
    i want to reset all players
     
    Answer : (me)
    actually there's a misconception that "I want to reset the variable" so I attachrid everyone and remove the variable from sql
    this method is wrong, or should I say this method consume a lot of server resources on your server
    the correct method is give it an ID, if the player doesn't match the ID, only remove that player
     
    http://upaste.me/4b0f495947cad8c0f
    the test1 example will tries to execute the SQL table, and because the key column isn't indexed (check main.sql file)
    it will perform a full table search and, if you run this query in a live server, with over 500,000 rows ... this can lag on your server
    also, addrid is evil, hercules doesn't even has this script command, it also promote bad scripting habit
    2nd thing, there's also a catch, as you can see, it runs on OnClock0000: , which means if somehow your live server is under maintenance or shut down at the time
    that label isn't run at all
    its better to use another ID like in my example, since it reset daily, I hack it with gettime

    Question : (Hyperion)

    UPDATE acc_reg_num SET value=0 WHERE 'key'="#BOSSNIAPOINTS"
    Answer : (me)
    nope, com'on ... in *athena script language ... 0 = null
    setting a variable into 0 means delete that variable, but SQL isn't like that,
    SQL 0 != null

    .
    .
    .
    why pajodex today can do exactly like what I have predicted yesterday ?
    maybe I have super power
    check the upaste date, it was yesterday
  8. AnnieRuru's post in Filter Guild on Certain map was marked as the answer   
    ah ... found a bug
    I forgotten the loadevent can be use from another script
    if you install another script with loadevent mapflag
    will cause this script to warp out other players indiscriminately
    1 more time
    http://upaste.me/06e6495427daded7f
    EDIT: Jesus ... I made mistake too many times, really lost touch with scripting
     
    yeah ... atm, not a godlike scripter yet XD
     
    btw, did you guys mentioned wrong person ??
    I am @AnnieRuru not @Annie Ruru
  9. AnnieRuru's post in Remove stone from skill TF_THROWSTONE was marked as the answer   
    db/skill_require.db.txt

    152,0,0,2,0,0,0,99,0,0,none,0,0,7049,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //TF_THROWSTONE...7049,1... change to 0,0
  10. AnnieRuru's post in kill/disconnect someone from SQL? was marked as the answer   
    yes, you can do some sort of trick, though, running query_sql repeatedly might eats your server resources
    I don't really recommend though

    - script kdhfksfjs FAKE_NPC,{ OnInit: query_sql "create table if not exists disconnect_char( account_id int(11) primary key, char_id int(11), name varchar(23) ) engine = innodb;"; while ( true ) { .@nb = query_sql( "select * from disconnect_char", .@aid, .@cid, .@name$ ); for ( .@i = 0; .@i < .@nb; .@i++ ) { if ( .@aid[.@i] ) { if ( isloggedin( .@aid[.@i] ) ) { atcommand "@kick "+ rid2name( .@aid[.@i] ); debugmes "the player AID "+ .@aid[.@i] +" has been kick."; } else debugmes "the player AID "+ .@aid[.@i] +" is not online"; query_sql "delete from disconnect_char where account_id = "+ .@aid[.@i]; } else if ( .@cid[.@i] ) { if ( query_sql( "select account_id from `char` where char_id = "+ .@cid[.@i], .@taid ) ) { if ( isloggedin( .@taid ) ) { atcommand "@kick "+ rid2name( .@taid ); debugmes "the player CID "+ .@cid[.@i] +" has been kick."; } else debugmes "the player CID "+ .@cid[.@i] +" is not online"; } else debugmes "the player CID "+ .@cid[.@i] +" doesn't exist"; query_sql "delete from disconnect_char where char_id = "+ .@cid[.@i]; } else if ( .@name$[.@i] ) { if ( query_sql( "select account_id from `char` where name = '"+ escape_sql(.@name$[.@i]) +"'", .@taid ) ) { if ( isloggedin( .@taid ) ) { atcommand "@kick "+ rid2name( .@taid ); debugmes "the player name "+ .@name$[.@i] +" has been kick."; } else debugmes "the player name "+ .@name$[.@i] +" is not online"; } else debugmes "the player name "+ .@name$[.@i] +" doesn't exist"; query_sql "delete from disconnect_char where name = '"+ escape_sql(.@name$[.@i]) +"'"; } } sleep 5000; } }..
    its inside `vendings` tableand the buffs is `sc_data`
  11. AnnieRuru's post in setunitdata parameters, what are these for? was marked as the answer   
    don't know why, but I feel  the urge to answer this particular topic
    ... hmph ... some of them actually rip off my source code actually...
    1st thing that you need to know is, this rathena unit controller script command is based on mob controller script commands
    which you can find them here 
     
    case UMOB_MASTERAID: md->master_id = value; break; the master GID of the monster
    the original mob controller system has *mobattach script command, which is missing in rathena
    means, yes, if you attach a monster to a player, you can use this constant to check this particular monster belongs to which player

    for example, in that script I link the to, pet vs pet system
    if AI_ACTION_TYPE_ATTACK is triggered, that mob controller system doesn't have a RID attached
    so have to check the target it was killed with AI_ACTION_TAR, which push the GID of the unit it killed
    then we can use UMOB_MASTERAID of the AI_ACTION_TAR to know the winner of the duel

    if you don't understand, don't worry, I haven't code mobevent script command yet
    once I did it, rathena will going to have it anyway, so you can play with it later
    so, this is currently useless until I make the mobevent script command
     
    case UMOB_AI: md->special_state.ai = (enum mob_ai)value; break; the special_state ai is defined, in rathena, here
    https://github.com/rathena/rathena/blob/master/src/map/map.h#L385
    ... seriously this should go inside mob.h ...
    from the PM you talk to me earlier, you should be able to read the source code to understand how to search these AI_ constants ...
     
    case UMOB_SCOPTION: md->sc.option = (unsigned short)value; break; similar to player's setoption
    https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L3451
    in theory, if you setoption it with OPTION_HIDE, the monster will hide permanently until it dead
    (unsigned short) .. ? LOL this is funny XD
    case UMOB_SLAVECPYMSTRMD: md->state.copy_master_mode = value > 0 ? 1 : 0; if (value > 0) { TBL_MOB *md2 = map_id2md(md->master_id); md->status.mode = md2->status.mode; } break; this is currently useless, mobattach script command can attach to the player, and can also attach to another mob
    yes, attach to another mob, then copy the master's mode, which is master's UMOB_MODE
    without mobattach script command, this is useless
     
    case UMOB_DMGIMMUNE: md->ud.immune_attack = (bool)value > 0 ? 1 : 0; break; immune attack should be self explain
    you can find the responsible line here
    https://github.com/rathena/rathena/blob/master/src/map/battle.c#L7413
    if the battle_check_target function return 0; you know what it means right ?
  12. AnnieRuru's post in Catching a player and blocking your movement and skills . was marked as the answer   
    block movement

    pcblockmove getcharid(3), 1;. .
    there is no block skill command, but the nearest I would go with setoption, option_xmas, which also blocked attack
  13. AnnieRuru's post in Requesting Zeny Counter NPC was marked as the answer   
    the reason that I say didn't test was because I was using hercules emulator
    and hercules doesn't have `global_reg_value` anymore, we have broken them up into 4 different tables
    by the way ... I forgotten that using IN is a very slow process in mysql -> blame Emistry
    1.

    select zeny, name from `char` where account_id in ( select account_id from login where group_id < 10 ) order by zeny desc limit 7;0.0010 ~ 0.0019 sec
    select name, zeny from `char` left join login on `char`.account_id = login.account_id where group_id < 10 order by zeny desc limit 7;0.0009 ~ 0.0014 sec2.

    select name, value from `char` left join acc_reg_num_db on `char`.account_id = acc_reg_num_db.account_id left join login on `char`.account_id = login.account_id where `key` = '#CASHPOINTS' group by `char`.account_id order by value desc;0.0010 ~ 0.0014 sec
    select `char`.account_id as aaa, ( select name from `char` where account_id = aaa order by char_num limit 1 ), value from `char` left join acc_reg_num_db on `char`.account_id = acc_reg_num_db.account_id where `key` = '#CASHPOINTS' group by `char`.account_id order by value desc;0.0011 ~ 0.0019 secso just have to add 'login.group_id < 10' clause
    3.

    select name, amount from inventory left join `char` on inventory.char_id = `char`.char_id left join login on `char`.account_id = login.account_id where nameid = 671 and group_id < 10 order by amount desc limit 10; tested on hercules

    prontera,156,185,6 script kdsjfhsdkfs 100,{ mes "blah"; next; if ( select( "Show me Top 7 highest Zeny", "Show me Top 5 highest Cash Points", "Show me Top 10 Gold Coin holder" ) == 1 ) { .@nb = query_sql( "select name, zeny from `char` left join login on `char`.account_id = login.account_id where group_id < 10 order by zeny desc limit 7", .@name$, .@zeny ); for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$[.@i] +" - "+ .@zeny[.@i] +"Z"; } else if ( @menu == 2 ) { .@nb = query_sql( "select name, value from `char` left join acc_reg_num_db on `char`.account_id = acc_reg_num_db.account_id left join login on `char`.account_id = login.account_id where `key` = '#CASHPOINTS' and group_id < 10 group by `char`.account_id order by value desc limit 5", .@name$, .@cash ); for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$[.@i] +" - "+ .@cash[.@i] +" points."; } else { .@nb = query_sql( "select name, amount from inventory left join `char` on inventory.char_id = `char`.char_id left join login on `char`.account_id = login.account_id where nameid = 671 and group_id < 10 order by amount desc limit 10", .@name$, .@amount ); for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$[.@i] +" - "+ .@amount[.@i] +" gold coins."; } close; }have fun convert `acc_reg_num_db` into `global_reg_value`
  14. AnnieRuru's post in Addird + loop issue. was marked as the answer   
    ( actually I'm still consider as MIA ...
    hehehe because its rare for you to ask a question so I want to repay your kindness by answering your question ^.^ )
    nonono ... you DON'T attach everyone on the server just to loop a player timer
    you have to remember that addrid runs the script simultaneously equal to the number of player attached to the script
    if there are 10 players near the fireplace, this script will be running 10 times,
    after 10 seconds, if there are still 5 players still standing within the 5x5 grid, it will be run 10x5 = 50 times
    and its quite hard to detachrid because there are no original RID when the script started
    you can just use OnTouch with sleep, while(!getmapxy) method to solve this particular problem
    here's the script revised, its far easier like this

    prontera,155,170,4 script Campfire 723,5,5,{ dispbottom "[Debug] these players was within this fireplace in last 2 seconds"; .@size = getarraysize( .aid ); for ( .@i = 0; .@i < .@size; .@i++ ) if ( isloggedin( .aid[.@i] ) ) dispbottom rid2name( .aid[.@i] ); end; OnTouch: while ( getcharid(3) != .aid[.@i] && .@i < getarraysize(.aid) ) .@i++; if ( .@i < getarraysize(.aid) ) end; .aid[.@i] = getcharid(3); end; OnInit: getmapxy .map$, .x, .y, 1; while (1) { .@size = getarraysize( .aid ); for ( .@i = 0; .@i < .@size; .@i++ ) { if ( isloggedin( .aid[.@i] ) ) { attachrid .aid[.@i]; getmapxy .@map$, .@x, .@y, 0; // dispbottom !strcmp( .@map$, .map$ ) +" "+ distance( .@x, .@y, .x, .y ); if ( !strcmp( .@map$, .map$ ) && distance( .@x, .@y, .x, .y ) <= 5 ) { if ( countitem(604) ) { if ( !.fire ) { setnpcdisplay strnpcinfo(0), strnpcinfo(0), 802; .fire = 1; } delitem 604, 1; break; } } else { deletearray .aid[.@i], 1; .@i--; .@size--; } } else { deletearray .aid[.@i], 1; .@i--; .@size--; } } detachrid; // announce .@i +" "+ .@size +" "+( .@i == .@size )+" "+ .@fire, 0; if ( .@i == .@size && .fire ) { setnpcdisplay strnpcinfo(0), strnpcinfo(0), 723; .fire = 0; } sleep 2000; } end; }so, your title which is -> addrid + looping <- are not existbecause addrid is not a command that is meant to be loop
    I rather think, addrid shouldn't be using in an event script, its meant for utility scripts only
    btw ... I always thought that survival script are more like ...
    it ask you to put in how many firewood, then the fireplace will burn according to how many firewood that you have placed ?
  15. AnnieRuru's post in pvp_nightmare mode was marked as the answer   
    random drop (including equipped)

    - script kjhfksjdf -1,{ OnPCDieEvent: if ( strcharinfo(3) != "prontera" ) end; // set your map if ( pkpoints < 100 ) end; // decide on the pk points getinventorylist; if ( !@inventorylist_count ) end; .@r = rand( @inventorylist_count ); delitem2 @inventorylist_id[.@r], @inventorylist_amount[.@r], @inventorylist_identify[.@r], @inventorylist_refine[.@r], @inventorylist_attribute[.@r], @inventorylist_card1[.@r], @inventorylist_card2[.@r], @inventorylist_card3[.@r], @inventorylist_card4[.@r]; getmapxy .@map$, .@x, .@y, 0; makeitem2 @inventorylist_id[.@r], @inventorylist_amount[.@r], .@map$, .@x, .@y, @inventorylist_identify[.@r], @inventorylist_refine[.@r], @inventorylist_attribute[.@r], @inventorylist_card1[.@r], @inventorylist_card2[.@r], @inventorylist_card3[.@r], @inventorylist_card4[.@r]; end; }random drop (don't drop equipped items)
    function script rand__ { .@range = getarg(0); .@count = getarg(2, 0); if ( !.@count || .@count > .@range ) .@count = .@range; else if ( .@count > 128 ) .@count = 128; while ( .@i < .@count ) { .@r = .@save = rand( .@i, .@range -1 ) ; if ( !getd( ".@tmp1_"+ .@i ) ) { .@r = ( getd(".@tmp1_"+ .@r ) )? getd( ".@tmp2_"+ .@r ) : .@r; setd ".@tmp2_"+ .@i, .@r; setd ".@tmp2_"+ .@save , .@i; setd ".@tmp1_"+ .@save , 1; set getelementofarray( getarg(1), .@i ), .@r; if ( .@save < .@count ) set getelementofarray( getarg(1), .@save ), .@i; } .@i++; } return .@count; } - script kjhfksjdf2 -1,{ OnPCDieEvent: if ( strcharinfo(3) != "prontera" ) end; // set your map if ( pkpoints < 100 ) end; // decide on the pk points getinventorylist; if ( !@inventorylist_count ) end; callfunc "rand__", @inventorylist_count, $@r; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) if ( !@inventorylist_equip[ .@i[ $@r ] ] ) break; .@r = .@i[ $@r ]; delitem2 @inventorylist_id[.@r], @inventorylist_amount[.@r], @inventorylist_identify[.@r], @inventorylist_refine[.@r], @inventorylist_attribute[.@r], @inventorylist_card1[.@r], @inventorylist_card2[.@r], @inventorylist_card3[.@r], @inventorylist_card4[.@r]; getmapxy .@map$, .@x, .@y, 0; makeitem2 @inventorylist_id[.@r], @inventorylist_amount[.@r], .@map$, .@x, .@y, @inventorylist_identify[.@r], @inventorylist_refine[.@r], @inventorylist_attribute[.@r], @inventorylist_card1[.@r], @inventorylist_card2[.@r], @inventorylist_card3[.@r], @inventorylist_card4[.@r]; end; }
  16. AnnieRuru's post in Latest and Working KOE. was marked as the answer   
    http://rathena.org/board/topic/91479-how-to-change-the-time-of-koe-event-every-saturday/?p=240761
  17. AnnieRuru's post in MVP ladder was marked as the answer   
    db\re\instance_db.txt

    12,MvP Ladder Game,86400,guild_vs2-2,49,49,guild_vs2-2 http://rathena.org/board/pastebin/6r2cl8yxm2ff/
  18. AnnieRuru's post in partyrecall and function doesn't close the window was marked as the answer   
    that's because inside the *callfunc made by Capuche, he uses attachrid
    and he didn't attachrid back to the original RID

    prontera,156,188,4 script Call Allies 100,{ mes "I can recall your party for 5,000,000z"; if ( select( "Ok do it", "No thx..." ) == 2 ) { mes "As you wish.."; close; } if ( !getcharid(1) ) { // you need this check as well mes "You don't even have a party ..."; close; } if ( Zeny < 5000000 ) { mes "You don't have enough zeny..."; close; } mes "All right, good luck !"; next; Zeny = Zeny - 5000000; .@origin = getcharid(3); // <-- save the original RID getmapxy .@map$, .@x, .@y, 0; getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { attachrid $@partymemberaid[.@i]; if ( Hp > 0 && getcharid(3) != .@origin && !getmapflag( strcharinfo(3), mf_nowarp ) ) // need another check to prevent players warp outside from events warp .@map$, .@x, .@y; } } attachrid .@origin; // attach back to original RID mes "Your party member has gather around you !"; close; }
  19. AnnieRuru's post in What is the problem? was marked as the answer   
    you need a controller npc to do this kind of operation

    - script main -1,{ OnStart: if ( getwaitingroomstate( 0, "left" ) < 1 || getwaitingroomstate( 0, "right" ) < 1 ) end; announce "blahblah start !", bc_all; donpcevent "left::OnStart"; donpcevent "right::OnStart"; delwaitingroom "left"; delwaitingroom "right"; disablenpc "left"; disablenpc "right"; end; } prontera,157,187,5 script left 100,{ end; OnInit: waitingroom strnpcinfo(0), 2, "main::OnStart", 1; end; OnStart: warpwaitingpc "guild_vs2", 9, 50; end; } prontera,160,187,5 script right 100,{ end; OnInit: waitingroom strnpcinfo(0), 2, "main::OnStart", 1; end; OnStart: warpwaitingpc "guild_vs2", 90, 50; end; }if you are talking about battleground, there's one inside SVNhttps://github.com/rathena/rathena/blob/master/npc/custom/battleground/bg_pvp.txt
  20. AnnieRuru's post in ChatRoom that retrives all the id on it was marked as the answer   
    [paste=74qo3zthrrcz]
     

    - script OnPCJoinChatEvent -1,{ pc_getwaitingroomlist $@waitingroomowner; dispbottom $@waitingroomcount +""; // for ( .@i = 0; .@i < $@waitingroomcount; .@i++ ) // dispbottom ( .@i +1 )+". "+ rid2name( $@waitingroomaid[.@i] ); announce rid2name( $@waitingroomaid[$@waitingroomcount -1] )+" has join "+ rid2name( $@waitingroomaid[0] ) +"'s waitingroom", bc_all; end; }I wrote this based on hercules emulator =/so try convert it into rathena source code
  21. AnnieRuru's post in disable warp on instance dungeon was marked as the answer   
    hmm ... I think I gave wrong answer on previous post ...
    suddenly I remember in rathena already has OnInstanceInit: label
    maybe you can just do
    OnInstanceInit:
    disablenpc instance_npcname ("npc name");
    EDIT:
    yeah forgot about *instance_npcname
  22. AnnieRuru's post in some eqps cant wear with particular eqp was marked as the answer   
    30501,Holy_Armor, .....,{ bonus ... },{ if ( getequipid(EQI_GARMENT) == 30506 ) unequip EQI_GARMENT; if ( getequipid(EQI_SHOES) == 30507 ) unequip EQI_SHOES; if ( getequipid(EQI_HAND_L) == 30508 ) unequip EQI_HAND_L; },{} 30502,Holy_Garment, ...,{ bonus ... },{ if ( getequipid(EQI_ARMOR) == 30505 ) unequip EQI_ARMOR; if ( getequipid(EQI_SHOES) == 30507 ) unequip EQI_SHOES; if ( getequipid(EQI_HAND_L) == 30508 ) unequip EQI_HAND_L; },{} 30503,Holy_Shoes, .....,{ bonus ... },{ if ( getequipid(EQI_ARMOR) == 30505 ) unequip EQI_ARMOR; if ( getequipid(EQI_GARMENT) == 30506 ) unequip EQI_GARMENT; if ( getequipid(EQI_HAND_L) == 30508 ) unequip EQI_HAND_L; },{} 30504,Holy_Shield, ....,{ bonus ... },{ if ( getequipid(EQI_ARMOR) == 30505 ) unequip EQI_ARMOR; if ( getequipid(EQI_GARMENT) == 30506 ) unequip EQI_GARMENT; if ( getequipid(EQI_SHOES) == 30507 ) unequip EQI_SHOES; },{} 30505,Shadow_Armor, ...,{ bonus ... },{ if ( getequipid(EQI_GARMENT) == 30502 ) unequip EQI_GARMENT; if ( getequipid(EQI_SHOES) == 30503 ) unequip EQI_SHOES; if ( getequipid(EQI_HAND_L) == 30504 ) unequip EQI_HAND_L; },{} 30506,Shadow_Garment, .,{ bonus ... },{ if ( getequipid(EQI_ARMOR) == 30501 ) unequip EQI_ARMOR; if ( getequipid(EQI_SHOES) == 30503 ) unequip EQI_SHOES; if ( getequipid(EQI_HAND_L) == 30504 ) unequip EQI_HAND_L; },{} 30507,Shadow_Shoes, ...,{ bonus ... },{ if ( getequipid(EQI_ARMOR) == 30501 ) unequip EQI_ARMOR; if ( getequipid(EQI_GARMENT) == 30502 ) unequip EQI_GARMENT; if ( getequipid(EQI_HAND_L) == 30504 ) unequip EQI_HAND_L; },{} 30508,Shadow_Shield, ..,{ bonus ... },{ if ( getequipid(EQI_ARMOR) == 30501 ) unequip EQI_ARMOR; if ( getequipid(EQI_GARMENT) == 30502 ) unequip EQI_GARMENT; if ( getequipid(EQI_SHOES) == 30503 ) unequip EQI_SHOES; },{}EDIT:forgot to say I got a PM asked to solve this <.<
    EDIT2:
    fixed EQI_HAND_R into EQI_HAND_L
  23. AnnieRuru's post in about input was marked as the answer   
    prontera,155,185,5 script sdkfjhsdkfh2 100,{ input .@test$; query_sql "select '"+ escape_sql( .@test$ )+"' regexp '^[a-z0-9]+$'", .@value; if ( .@value ) dispbottom "pass"; else dispbottom "fail"; end; }------ OR ------ 

    prontera,150,185,5 script sdkfjhsdkfh 100,{ input .@test$; if ( preg_match( "^[a-zA-Z0-9]+$", .@test$ ) ) dispbottom "pass"; else dispbottom "fail"; end; }I still remember last time during eathena times, this preg_match crashed my eathena 12068 test serverI couldn't remember what was the syntax already ... it was 3 years ago
    I didn't post on the forum because it was just a custom modification release at the time
    if you guys able to find the bug then file a report then ... because now this is an official script command =/
  24. AnnieRuru's post in Cart item check was marked as the answer   
    http://rathena.org/board/topic/78276-cartcountitem-cartdelitem-script-count-or-delete-certain-item-in-cart-inventory/
    this one should work ..
    let me read the source code ...
    ... very clean o.o
  25. AnnieRuru's post in Does any 1 remember this script? :3 was marked as the answer   
    run or die event
    http://www.eathena.ws/board/index.php?showtopic=238298
    yeah that's one of my script
    update a little bit
    [paste=4h0fgrgl79d7]
    that server you played just change to use different map
×
×
  • Create New...