Jump to content

Emistry

Forum Moderator
  • Posts

    10013
  • Joined

  • Days Won

    395

Everything posted by Emistry

  1. find for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1) if(countitem(.@Items[.@i]))set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" [1]":"")+":"; and replace with for (.@i = 0; .@i < getarraysize(.@Items); .@i++) { if (countitem(.@Items[.@i])) .@menu$ = .@menu$ + getitemname(.@Items[.@i]) + ((.@k)?" [1]":""); .@menu$ = .@menu$ + ":"; }
  2. fix the header https://github.com/rathena/rathena/wiki/Basic-Scripting#NPC prontera,90,210,4<TAB>script<TAB>ZotarCorpNPC<TAB>123,{
  3. mes "[Valkyrie]"; mes "One..."; mes "Two......"; mes "And Three."; if (!countitem(7825)) { mes "You don't have "+getitemname(7825); close; } delitem 7825, 1;
  4. - script atcmd_example -1,{ OnInit: bindatcmd "aura",strnpcinfo(3) + "::OnAtcommand"; end; OnAtcommand: if (.@atcmd_parameters$ == "on") { // your script command to turn on aura end; } if (.@atcmd_parameters$ == "off") { // your script command to turn off aura end; } dispbottom "Invalid " + .@atcmd_command$ + ". Usage: " + .@atcmd_command$ + " <on|off>"; end; }
  5. you are asking for bAtkRate, but Robo Eye is using bonus2 bAddClass,Class_All,2; its different item bonuses.
  6. everything that run after addrid will be repeatedly executed for each attached players. in your case, after your player obtained 10ea of item 7227, then each of this players, trigger the "Main" event again, and give each other another 10ea of 7227 and repeat endlessly. If you wish to trigger it every 5 seconds, you can do it this way. - script Sample -1,{ OnTimer5000: donpcevent strnpcinfo(3)+"::OnReward"; OnInit: initnpctimer; end; OnReward: addrid(5, 0, "prontera"); getitem 7227, 10; end; }
  7. delete the rental items, then recreate a brand new rental items with the remaining rental duration from previous items *rentitem2 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>}; *rentitem2 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>}; *rentitem3 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>}; *rentitem3 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>}; *rentitem4 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>}; *rentitem4 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>}; may use these to count for rental items *rentalcountitem(<item id>{,<accountID>}) *rentalcountitem("<item name>"{,<accountID>}) This function will return the number of rental items for the specified item ID that the invoking character has in the inventory. --------------------------------------- *rentalcountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>}) *rentalcountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>}) *rentalcountitem3(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>}) *rentalcountitem3("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>}) *rentalcountitem4(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>}) *rentalcountitem4("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>}) May use these to retrieve the remaining rental duration *getinventorylist {<char_id>}; This command sets a bunch of arrays with a complete list of whatever the invoking character has in their inventory, including all the data needed to recreate these items perfectly if they are destroyed. Here's what you get: @inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires.
  8. percentheal((isequipped(5334) ? 40 : 20), 0); if (isequipped(5334)) { percenthea(40, 0); } else { percentheal(20, 0); } percentheal(20, 0); if (isequipped(5334)) { percenthea(20, 0); } can use isequipped(...) or isequippedcnt(...) or getequippedid(...) or countitem(...) etc
  9. 3 rewards. .RewardList = 1; // include only reward 1 .RewardList = 1|2; // include only reward 1 and 2 .RewardList = 1|4; // include only reward 1 and 3 .RewardList = 2|4; // include only reward 1 and 3 .RewardList = 2|4; // include only reward 2 and 3 .RewardList = 4; // include only reward 3
  10. https://rathena.org/board/topic/107660-r-sql-mall/?do=findComment&comment=409840
  11. you can also try with HIDDEN_WARP_NPC
  12. getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE) == IT_CARD) .@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]); .@menu$ = .@menu$ + ":"; } .@i = select(.@menu$) - 1; mes "Your selected card = " + getitemname(@inventorylist_id[.@i]); you can also do this this way.
  13. addrid(0); change to addrid(5, 0, "izlude");
  14. - script vip_group_free -1,{ OnSetVIP: #TEMP_GROUP_V = gettimetick(2) + (7 * 24 * 60 * 60);//time in seconds OnPCLoginEvent: if (#TEMP_GROUP_V > gettimetick(2)) { if (getgroupid() == 0) { query_sql("UPDATE `login` SET `group_id` = 5 WHERE `account_id` = "+getcharid(3)); atcommand "@adjgroupid 5"; } .@second = #TEMP_GROUP_V - gettimetick(2); addtimer (.@second * 1000), strnpcinfo(3)+"::OnExpire"; dispbottom "Seu VIP expira em: "+gettimestr("%Y-%m/%d %H:%M:%S",21,#TEMP_GROUP_V); } end; OnExpire: if (getgroupid() == 5) query_sql("UPDATE `login` SET `group_id` = 0 WHERE `account_id` = "+getcharid(3)); atcommand "@adjgroupid 0"; end; } something like this ? perhaps just use the built-in VIP system ? conf\login_athena.conf // Which group (ID) will be denoted as the VIP group? // Default: 5 vip_group: 5
  15. bossnia_01 mapflag monster_noteleport bossnia_02 mapflag monster_noteleport bossnia_03 mapflag monster_noteleport bossnia_04 mapflag monster_noteleport
  16. prontera,164,169,3 script Daily Supply#1 647,{ if (Weight >= (MaxWeight / 2) || !checkweight(1201,1)) { dispbottom "Please free some space from your inventory to get the Daily Supplies."; end; } .@unique_id$ = "" + get_unique_id(); // <--- Your way to accecss the unique ID info if (#DailySupply == .today_date || inarray($today_unique_id$, .@unique_id$) != -1) { dispbottom "Daily Supply can only be claimed once per day. Resets at 12am."; end; } #DailySupply = .today_date; $today_unique_id$[getarraysize($today_unique_id$)] = .@unique_id$; getitembound 11503,100,Bound_Account; getitembound 11504,50,Bound_Account; end; OnHour00: deletearray $today_unique_id$; OnInit: .today_date = atoi(gettimestr("%Y%m%d", 21)); end; } something like this
  17. also can try using npc script if you want. - script getmapmob_main -1,{ OnInit: bindatcmd "getmapmob", strnpcinfo(3) + "::OnAtcommand"; end; OnAtcommand: .@map$ = strcharinfo(3); if (.@atcmd_numparameters) { if (getmapusers(.@atcmd_parameters$) == -1) { dispbottom "Invalid map " + .@atcmd_parameters$+"."; end; } .@map$ = .@atcmd_parameters$; } .@size = getmapunits(BL_MOB, .@map$); for (.@i = 0; .@i < .@size; .@i++) { getunitdata .@array[.@i], .@array; if (!.@mobcount[.@array[UMOB_CLASS]]) { .@mob_id[.@mob_id_size] = .@array[UMOB_CLASS]; .@mob_id_size++; } .@mob[.@array[UMOB_CLASS]]++; } dispbottom "Found "+ .@mob_id_size + " monsters at " + strcharinfo(3); for (.@i = .@mob_id_size - 1; .@i >= 0; .@i--) { if (getmonsterinfo(.@mob_id[.@i], MOB_MVPEXP) > 0) continue; dispbottom sprintf(" %s[%d] : %d", getmonsterinfo(.@mob_id[.@i], MOB_NAME), .@mob_id[.@i], .@mob[.@mob_id[.@i]]); deletearray .@mob_id[.@i], 1; .@mob_id_size--; } dispbottom "Found "+ .@mob_id_size + " normal monsters at " + strcharinfo(3); for (.@i = 0; .@i < .@mob_id_size; .@i++) { dispbottom sprintf(" %s[%d] : %d", getmonsterinfo(.@mob_id[.@i], MOB_NAME), .@mob_id[.@i], .@mob[.@mob_id[.@i]]); } end; } but this may cause performance issue, use at your own risk.
  18. switch(select( "Vote Shop 1", "Vote Shop 2" )) { case 1: callshop "vote_shop_name_1", 1; end; case 2: callshop "vote_shop_name_2", 1; end; }
  19. - Status: SC_LIFEINSURANCE Icon: EFST_CASH_DEATHPENALTY Flags: NoClearbuff: true NoDispell: true NoBanishingBuster: true NoClearance: true EndOnStart: SC_LIFEINSURANCE: true may try add this into db/import/status.yml
  20. prontera,155,181,5 script Sample 757,{ mes "How can I help you?"; if (select("I wish to change my name.", "Cancel") == 1) { logmes "["+getcharid(3)+"/"+getcharid(0)+"] '"+strcharinfo(0)+"' has requested to change name."; CharRename = 1; mes "You may log out now, and select the name change feature."; } close; } you should see the log once you enabled logging. talk to npc and select change name, log off the character and rename it through the game client.
  21. prontera,150,150,5 script HourTimer 111,{ .time = gettimetick(2) + 4800; // 1 hours 20 minutes from current time end; OnTimer1000: delwaitingroom; if (.time > gettimetick(2)) waitingroom ""+gettimestr( "%H:%M:%S %p", 15, .time), 0; OnInit: initnpctimer; end; } something like this. just set the duration when you want it to start. .time = gettimetick(2) + 4800;
  22. in my opinion, submiting a pull request often have higher chance to get grab developers attention to discuss about it or even merge into repository rather than uploading the source code here.
  23. something like this ? https://rathena.org/board/topic/60513-event-ticket-rewarder-php-log-viewer-anti-gm-corruption/
  24. @offtopic it was something that look like this https://i.imgur.com/L38UPvm.png , he probably make use of the vending system to make it possible. (dont ask me for source code, i dont have it) btw would the barter script command above with together with the existing yaml version? wouldn't it be better to make a PR have it merge into rathena too? that could help expand the way we create npc in a much interested way too
×
×
  • Create New...