Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    52

Everything posted by Capuche

  1. Is that working like you expected ?
  2. mes "Pronto!"; set .@account_id,getcharid(3); updatePoints( .@account_id,-3 ); // dispbottom "Relogue para ter seu VIP ativado."; query_sql "UPDATE `login` SET `dt_vip` = if( `group_id` = 1 and `dt_vip` > now(), `dt_vip` + INTERVAL 1 day, now() + interval 1 day ), `group_id` = 1 WHERE `account_id` = "+ .@account_id; atcommand "@adjgroup 1"; garbagecol(); close2; message strcharinfo(0),"Pontos adicionados"; end; ?
  3. You're right theses npc are missing (at last Meidi). I will make a commit later
  4. http://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file ./athena-start start > file
  5. That ? https://github.com/rathena/rathena/blob/master/npc/other/pvp.txt https://github.com/rathena/rathena/blob/master/npc/pre-re/other/pvp.txt https://github.com/rathena/rathena/blob/master/npc/re/other/pvp.txt
  6. Add the condition for your class if ( ( .@eac & EAJL_UPPER || Class == 24 || .... ) && BaseLevel == 99 ) {
  7. http://irowiki.org/wiki/ASPD#ASPD_Formula The final aspd formula is divided into 3 parts. bonus bAspdRate,10; only impact on the Base ASPD Equip ASPD % part (Equip ASPD Mod) Basically it's final aspd = [ part1 + part2 + (part3 revised with the bonus) ] it's not 10% of the final aspd Edit : misread
  8. You're right ! Thanks for pointing out. However you should make a bugreport in git since it's a bug in the main repo. EDIT : fixed 0edb5c7ff87d305a26aa7c2772c0d920758dffc2
  9. Maybe make a loop to convert the string to int with atoi command explode( .@tmp_string$, "1,2,3,4", "," ); .@size = getarraysize( .@tmp_string$ ); for ( .@i = 0; .@i < .@size; .@i++ ) .@tmp_int[.@i] = atoi( .@tmp_string$[.@i] ); (or use bitwise operator)
  10. Capuche

    Bio Lab

    Ha you're right the mvp are here set .@mob,rand(1646,1651); btw same method, put your mvp in the array then rand index
  11. script prontera,150,150,0 script Cleaner 1002,15,15,{ end; OnTouchNPC: .@gid = monsterattached(); getmapxy .@map$, .@x, .@y, 3; // move to 1 cell near the mob / min distance between npc-mob if ( .@x > .x0 ) .@dx = -1; else if ( .@x < .x0 ) .@dx = 1; if ( .@y > .y0 ) .@dy = -1; else if ( .@y < .y0 ) .@dy = 1; .@x_tmp = .@x + .@dx; .@y_tmp = .@y + .@dy; if ( !checkcell(.@map$,.@x_tmp,.@y_tmp,cell_chkpass) ) { for ( .@dx = -1; .@dx < 2 && .@break == 0; .@dx++ ) for ( .@dy = -1; .@dy < 2; .@dy++ ) { if ( .@dx == 0 && .@dy == 0 ) continue; .@x_tmp = .@x + .@dx; .@y_tmp = .@y + .@dy; if ( checkcell(.@map$,.@x_tmp,.@y_tmp,cell_chkpass) ) { .@break = 1; break; } } } if ( .@x_tmp != .@x && .@y_tmp != .@y ) movenpc strnpcinfo(3), .@x_tmp, .@y_tmp; specialeffectmob 10; unitkill .@gid; end; OnInit: getmapxy .@map$, .x0, .y0, 1; // .@npc_name$ = strnpcinfo(3); npcspeed 50; freeloop 1; while( true ) { sleep 10000; do { .@x = .x0 + rand(-10,10); .@y = .y0 + rand(-10,10); } while( !checkcell(.@map$,.@x,.@y,cell_chkpass) ); .x0 = .@x; .y0 = .@y; npcwalkto .x0, .y0; // movenpc .@npc_name$, .x0, .y0; } } src src/custom/script.inc | 19 +++++++++++++++++++ src/custom/script_def.inc | 3 +++ src/map/script.c | 8 ++++++++ 3 files changed, 30 insertions(+) diff --git a/src/custom/script.inc b/src/custom/script.inc index 1e01c88..c8e825c 100644 --- a/src/custom/script.inc +++ b/src/custom/script.inc @@ -17,3 +17,22 @@ // script_pushint(st,1); // return 0; //} + +BUILDIN_FUNC(monsterattached) +{ + struct block_list *bl = map_id2bl(st->rid); + if(st->rid == 0 || bl == NULL || bl->type != BL_MOB) + script_pushint(st,0); + else + script_pushint(st,st->rid); + return SCRIPT_CMD_SUCCESS; +} + +BUILDIN_FUNC(specialeffectmob) +{ + int type = script_getnum(st,2); + struct block_list *bl=map_id2bl(st->rid); + if(bl != NULL && bl->type == BL_MOB) + clif_specialeffect(bl, type, AREA); + return SCRIPT_CMD_SUCCESS; +} \ No newline at end of file diff --git a/src/custom/script_def.inc b/src/custom/script_def.inc index 3319eea..5a75166 100644 --- a/src/custom/script_def.inc +++ b/src/custom/script_def.inc @@ -9,3 +9,6 @@ **/ //BUILDIN_DEF(example,""), + +BUILDIN_DEF(monsterattached,""), +BUILDIN_DEF(specialeffectmob,"i"), \ No newline at end of file diff --git a/src/map/script.c b/src/map/script.c index b6be34d..29d0634 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13986,6 +13986,14 @@ int recovery_sub(struct map_session_data* sd, int revive) bl = &sd->pd->bl; break; case 3: //Get Mob Position + if( script_hasdata(st,6) ) { + struct script_data *data = script_getdata(st,6); + get_val(st, data); + if( !data_isstring(data) ) + bl = map_id2bl(script_getnum(st, 6)); + } + else if( st->rid && map_id2bl(st->rid) != NULL ) + bl = map_id2bl(st->rid); break; //Not supported? case 4: //Get Homun Position if(script_hasdata(st,6)) I didn't thought about friendly mob
  12. Capuche

    Bio Lab

    https://github.com/rathena/rathena/blob/master/npc/re/mobs/dungeons/lhz_dun.txt replace set .@mob2,rand(1640,1645); by setarray .@tmp[0], 1641,1644; set .@mob2, .@tmp[rand(2)];
  13. bonus2 bAddEff,Eff_Silence,1000; Please read doc/item_bonus.txt for more bonus !
  14. if(@hom_confing[6] there is a typo it should be .@hom_confing me traga "+.@zeny+" para .@zeny unset I think it should be .@hom_confing[2] instead set .@hom, .@type$[@menu]; you can't store a string value in an int variable, it should be set .@hom, atoi( .@type$[@menu] ); healhomun .@hom_confing[8],.@hom_confing[9]; healhomun is a custom command I didn't test the script, maybe there is another mistake ?
  15. There was a mistake. It shoud be fixed in ea6ba2dd3f62d4789d6beaa125e8bca178503809 thanks Radian! (next time please make a post in the bugtracker !)
  16. Capuche

    Pc Bonus!

    No you're right because bIgnoreMdefClass doesn't exist. It should be bIgnoreMdefClassRate Edit : fixed in ea6ba2dd3f62d4789d6beaa125e8bca178503809
  17. Try replacing if( hp != maxhp ) { by if( Hp != MaxHp ) {
  18. https://github.com/rathena/rathena/blob/master/npc/custom/healer.txt
  19. - script dummy -1,{ OnPCLoadMapEvent: if ( strcharinfo(3) == "prontera" && BaseLevel >= 99 ) { warp "geffen",0,0; message strcharinfo(0), "Level 99 or more not allowed on this map."; } end; } prontera mapflag loadevent respectively warp the player level 99 or more to geffen when he enter on prontera
  20. You got a lot of items of item 9 because the last setarray overwrite the value of .Items array starting to index 9 //Gachapon NPC// prontera,156,196,5 script Gachapon Valkyrie#1 403,{ //Items Available through Gachapon NPC// setarray .@items0[0],7081,7075,7074,5075,501,520,521,522,523,525,526,528,529,530,2433,2424,2423,2291,2295,2289,2288,2299,19816,19820,19828,19824,19819,19816,19839,19825,19827,19830,19831,19832,19833,19836,19837,19839,19840,19843,19847,19848,19851,19852,7835,2261,2262,2263,2264,2265,2266; setarray .@items1[0],7073,7090,20002,502,2423,2424,2423,2301,2302,2304,2305,2307,19801,19802,19806,19807,19812,19814,19891,19893,19896,19900,19897,19885,19871,19837,19861,19859,19891,19896,19810,19815,19834,19838,19850,19868,19879,19883,19887,19888,2287,2288,2289,2365,2366,2367,2368,2369,2370,2371,2381; setarray .@items2[0],4008,503,2395,2396,2398,2399,4067,4075,4094,4098,4097,4100,4134,4147,4148,4144,4143,4142,4141,4139,4165,4145,4146,4138,4137,4135,4168,4169,4198,4200,4199,4174,4276,4302,4318,4346,4353,4342,4357,4360,4359,4356,4363,4361,4365,4366,4365,4367,4374,4375,4372,4386,4388,4389; setarray .@items3[0],4008,504,4403,4404,4405,4406,4407,4408,4419,4420,4424,4425,4425,4425,4426,7837,7838,7830,12102,12103,12104,12105,12106,12107,12108,12110,12111,12112,12113,12114,12115,12116,12117,12118,12119,12120,12122,12123,12124,19803,19804,19808,19809,19811,19813,19817,19818,19821,19822; setarray .@items4[0],4008,505,19845,19846,19849,19854,19860,19862,19866,19870,19872,19874,19876,19877,19878,19880,19881,19892,19884,19895,19898,19899,20000,20005,20006,20009,20008,20011,20017,20018,20019,20021,20023,20024,20028,7080,20030,20029,20039,20045,20046,20047,20048,20049,20051,20057,20058,20056; setarray .@items5[0],4008,7082,7083,20090,20091,20092,20093,20094,20095,20097,20098,20099,20102,20104,20105,20108,20109,20110,20111,20112,20115,20116,20117,20119,20123,20125,20128,20130,20133,20134,20137,20140,20141,20142,20143,20147,20150,20151,20153,20154,20155,20156,20157,20158,20159,20174,20161; setarray .@items6[0],4008,20169,20170,20171,20172,20177,20178,20179,20180,20184,20186,20187,20189,20190,20191,20199,20200,7086,7089,20202,20203,20205,20216,20217,20219,20221,20222,20224,20225,20226,20227,20233,20235,20236,20239,20240,20243,20245,7076,20249,20250,20251,20252,20254,20255,20257,20260; setarray .@items7[0],4008,20284,20288,20290,20294,20296,20299,7079,7078,7092,7088,7091,20322,20323,20324,20325,20326,20327,20329,20330,20331,20332,20335,20336,20337,20343,20344,20346,20347,20349,20350,20352,20353,20354,20355,20359,20354,20369,20386,20387,20389,20388,20392,20391,20368,20395,20393; setarray .@items8[0],7835,7836,7837,7838,7830,7831,7832,7833,7834,7080,7081,7082,7083,7084,7085,7086,7089,7075,7074,7073,7077,7076,7079,7078,7090,7092,7088,7091,20413,20414,20415,20416,20418,20419,20420,20423,20486,20487,20488,20489,20499,20501,20504,20505,20507,20510,20511,20514; setarray .@items9[0],7835,7836,7837,7838,7830,7831,7832,7833,7834,20010,20012,20026,20041,20052,20053,20070,20080,20083,20085,20097,20100,20101,20103,20214,20149,20167,20106,20513,20535,20550,20558,20879,20884,20001,20002,20003,20004,20007,20013,20014,20015,20020,20022,20025,20027,20031,20032,20034,20035,20036; mes "[Gachapon Valkyrie]"; mes "Hello, you can earn 1 random item of the following:"; mes "God Item Ingredients, Rare Equipments, Cards, Wings or Junks if you give me the following items."; next; mes "1 Special Exchange Ticket"; next; mes "Do you have the items?"; switch(select("-Yes, i have them:-No, let me go fot them")) { case 1: mes "Alright, let's see..."; if(countitem(6153) <1){ mes "You don't have them, go for them and then comeback..."; } else { mes "Alright, seems like you have them, here you go, good luck!"; set .@random_array, rand(10); set .@random_index, rand(getarraysize( getd( ".@items"+ .@random_array ) )); getitem getd( ".@items"+ .@random_array +"["+ .@random_index +"]" ), 1; delitem 6153,1; } close; case 2: mes "Alright, good luck on the hunting."; close; } }
  21. - script dummy -1,{ OnPCLoadMapEvent: if ( strcharinfo(3) == "prontera" && @on_prontera == 0 ) { addtimer 10000, strnpcinfo(3) + "::OnLoop"; @on_prontera = 1; } end; OnLoop: if ( strcharinfo(3) != "prontera" ) @on_prontera = 0; else { @timer_ += 10; if ( @timer_ % (15*60) )// reward after 15*60 secs #CASHPOINTS += 1; addtimer 10000, strnpcinfo(3) + "::OnLoop"; } end; } prontera mapflag loadevent
  22. http://rathena.org/board/tracker/issue-9167-sql-file-broken/
  23. For reference http://rathena.org/board/topic/69479-fly-wing-and-wing-of-butterfly/
  24. Capuche

    Stalker NPC

    Please read http://rathena.org/board/topic/78263-scripting-faqtipstricks/?p=267219 It's better if you learn to solve this common issue
×
×
  • Create New...