Jump to content

sader1992

Content Moderator
  • Posts

    1676
  • Joined

  • Last visited

  • Days Won

    71

Community Answers

  1. sader1992's post in @warp payment required was marked as the answer   
    try this
    - script war_pay -1,{ OnInit: bindatcmd "warp",strnpcinfo(3)+"::OnWarpCommand"; end; OnWarpCommand: if(.@atcmd_numparameters != 1 && .@atcmd_numparameters != 3){ dispbottom "@warp Failed."; dispbottom "@warp <map_name> <x> <y>"; dispbottom "@warp <map_name>,<x>,<y>"; end; } .@command$ = strtolower(.@atcmd_parameters$[0]); .@x = atoi(.@atcmd_parameters$[1]); .@y = atoi(.@atcmd_parameters$[2]); if(.@atcmd_numparameters == 1){ if(compare(.@command$,",")){ explode(.@info$, .@command$, ","); .@command$ = .@info$[0]; .@x = atoi(.@info$[1]); .@y = atoi(.@info$[2]); } } dispbottom "It cost you 1,000 zeny to warp."; if ( Zeny > 1000 ){ set Zeny, Zeny - 1000; warp .@command$,.@x,.@y; end; } dispbottom "Can't warp you. You don't have zeny."; end; }  
  2. sader1992's post in Check if monster is attacking a player was marked as the answer   
    *getunitdata <GID>,<arrayname>; UMOB_TARGETID  
  3. sader1992's post in [REMAKE] Happy Hour EXP "extended" was marked as the answer   
    happy_hour_npc (1) (1).txt
  4. sader1992's post in HELP - stat bonus bug was marked as the answer   
    https://github.com/rathena/rathena/pull/4885/files
  5. sader1992's post in Additional Function was marked as the answer   
    - script LevelUpQuotes -1,{ OnInit: setarray .q$,"I have advanced forward!","There's no stopping me now!","Look at me go!","There's more where that came from.","This isn't even my final form!"; .num1 = getarraysize(.q$); end; OnPCBaseLvUpEvent: if(!(BaseLevel%10)){ getitem 501,10; .@r = rand(.num1); showscript strcharinfo(0)+" : "+.q$[.@r]; } end; }  
  6. sader1992's post in How To Add @commands to normal account was marked as the answer   
    this ill only log the commands of the normal users , and it's not recommended , you add a command like that
    go: true
    this mean the normal users now can use @go
    ofc under the id 0 group level 0 for the normal users
  7. sader1992's post in Enchant Script not working with random option, getitem3 issue? was marked as the answer   
    given that everything is right in the script , and your error is only on delitem3 , use 
    delequip .@equip_loc; instead of delitem3
    you still need the information to create a new item , but this insure that even if you missed some information about the item (like identify and attribute) the item will get deleted safely and the player can't abuse the system
     
     
     
     
    also you don't need those
    setarray .@OptID[0],0; setarray .@OptID[1],0; setarray .@OptID[2],0; setarray .@OptID[3],0; setarray .@OptID[4],0; setarray .@OptVal[0],0; setarray .@OptVal[1],0; setarray .@OptVal[2],0; setarray .@OptVal[3],0; setarray .@OptVal[4],0; setarray .@OptParam[0],0; setarray .@OptParam[1],0; setarray .@OptParam[2],0; setarray .@OptParam[3],0; setarray .@OptParam[4],0;  
    and your forloop for getting the random options
    from
    for (.@j = 0; .@j < 5; .@j++) { setarray .@OptID[.@j],getequiprandomoption(.@eq_loc,.@j,ROA_ID); setarray .@OptVal[.@j],getequiprandomoption(.@eq_loc,.@j,ROA_VALUE); setarray .@OptParam[.@j],getequiprandomoption(.@eq_loc,.@j,ROA_PARAM); } to
    for (.@j = 0; .@j < 5; .@j++) { .@OptID[.@j] = getequiprandomoption(.@eq_loc,.@j,ROA_ID); .@OptVal[.@j] = getequiprandomoption(.@eq_loc,.@j,ROA_VALUE); .@OptParam[.@j] = getequiprandomoption(.@eq_loc,.@j,ROA_PARAM); }  
  8. sader1992's post in Announce # of people on Pub upon entry was marked as the answer   
    *set <variable>,<expression>{,<char_id>}; set .@join,getwaitingroomstate(0,"Waiting"); you missed a comma , read the console errors before anything.
  9. sader1992's post in How to remove Monster from database? was marked as the answer   
    don't remove the monsters from the database
    just remove the spawn
    check https://github.com/rathena/rathena/tree/master/npc/pre-re/mobs
  10. sader1992's post in mapflag noskill wot was marked as the answer   
    - script noskill_mapflag_remove -1,{ OnInit: if(getmapflag("prt_are_in",mf_noskill)) removemapflag "prt_are_in",mf_noskill; end; } put it at the end of your scripts list
    so it would load last
  11. sader1992's post in Maximun Event Queue was marked as the answer   
    you better not delay the events if you have too many of the same type.
    the maximum number is 3
    after that the events will be deleted instead of moving to the queue.
    https://github.com/rathena/rathena/blob/05ebde0198380c100c92b7873c86ee93b811032d/src/map/map.hpp#L49
     
  12. sader1992's post in Adding Maps deletes other maps? was marked as the answer   
    Do not input map id and put it in the text in the import not in re/pre-re , put your gat into the import map cache, read the console errors if there is any.
  13. sader1992's post in Which tools do I have to install for VS 2017? was marked as the answer   
  14. sader1992's post in Use application gateway IP can't not runserver was marked as the answer   
    conf/import/char_conf.txt login_ip: 127.0.0.1 char_ip: public_ip conf/import/map_conf.txt char_ip: 127.0.0.1 map_ip: public_ip  
  15. sader1992's post in OnPCStatCalcEvent and recalculatestat; Loop was marked as the answer   
    --------------------------------------- *recalculatestat; This command will force a stat recalculation for the attached player. --------------------------------------- OnPCStatCalcEvent: This special label triggers when a player's stats are recalculated, such as when changing stats, equipment, or maps, as well as when logging in, leveling up, and mounting a job mount. This can be used to grant additional item bonuses to certain player groups, for instance. technically , you are asking for loop
    I would suggest to not use OnPCStatCalcEvent unless you are forced too
     
    also I don't understand why disable/enable a npc like that , let's say the script works , the npc would be always disabled depending on the number of players in the server , also I am not sure that you know what you are doing.
     
  16. sader1992's post in How to set Dungeon as town was marked as the answer   
    https://github.com/rathena/rathena/blob/master/npc/mapflag/town.txt
    https://github.com/rathena/rathena/blob/master/npc/mapflag/restricted.txt
  17. sader1992's post in (Request)Max level rewards npc was marked as the answer   
    prontera,0,0,0 script npc_name 444,{ if($MAX_LEVEL_REWARDS_50 < 50){ if(!#MAX_LEVEL_REWARDS_50){ if(BaseLevel == 99){ mes "you can redeem the reward once per account!"; if(select("redeem with this char:close") == 2) end; #MAX_LEVEL_REWARDS_50 = true; $MAX_LEVEL_REWARDS_50++; mes "you got the reward!"; announce "Player '" + strcharinfo(0) + "' has redeemed his max level reward!",0; //=========================== getitem 502,1;//add what you want to give like this. //=========================== close; }else{ mes "you are not at the max level!"; close; } }else{ mes "you alewady redeemed the reward with another char!"; close; } }else{ mes "All the rewards has been redeemed!"; close; } }  
  18. sader1992's post in Custom Costume Wings not displaying was marked as the answer   
    try to add in in data\luafiles514\lua files\transparentItem\transparentItem.lub too
    { 51, 255, 255, 25500 },
    the tool was built before this file
  19. sader1992's post in Enable the use of Ice Wall on Maps. was marked as the answer   
    it's most likly https://github.com/rathena/rathena/blob/master/db/re/skill_nocast_db.txt
    but there is also a mapflag to prevent casting icewall , so check that too in your npc folders
  20. sader1992's post in Random Option Removed when Enchanting was marked as the answer   
    the script is not supported anymore , and it does not support random option , i suggest you create a script that does only what you need instead of using any type of "all in one" scripts
     
    however , this should make the random options work
    sader_s_enchant_V2.6_(with random option support).txt
  21. sader1992's post in open shop by command was marked as the answer   
    I suggest then creating categories instead of one shop
     
    - script impossible_shop_command -1,{ OnCommand: .@s = select("shop0:shop1:shop2:shop3:shop4:shop5:shop6"); callshop "impossible_shop_" + .@s,1; end; OnInit: bindatcmd("brindes",strnpcinfo(3)+"::OnCommand",0,99); end; } - pointshop impossible_shop_0 -1,impossible_shop_points,502:100,503:20; //put the items here; - pointshop impossible_shop_1 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_2 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_3 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_4 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_5 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_6 -1,impossible_shop_points,502:100,503:20;  
  22. sader1992's post in Any suggestion for matrix? was marked as the answer   
    --------------------------------------- *setd "<variable name>",<value>{,<char_id>}; Works almost identically as set, except the variable name is identified as a string and can thus be constructed dynamically. This command is equivalent to: set getd("variable name"),<value>; Examples: setd ".@var$", "Poporing"; mes .@var$; // Displays "Poporing". setd ".@" + .@var$ + "123$", "Poporing is cool"; mes .@Poporing123$; // Displays "Poporing is cool". NOTE: 'char_id' only works for non-server variables. Player with Character ID 'char_id' must be online. --------------------------------------- *getd("<variable name>") Returns a reference to a variable, the name can be constructed dynamically. Refer to 'setd' for usage. This can also be used to set an array dynamically: setarray getd(".array[0]"), 1, 2, 3, 4, 5; Examples: set getd("$varRefence"), 1; set .@i, getd("$" + "pikachu"); --------------------------------------- example:
    setarray .@x,1,2; setarray .@x1,10,20,30,40,50; setarray .@x2,100,200,300,400,500; for(.@i=0;.@i<getarraysize(.@x);.@i++){ for(.@m=0;.@m<getarraysize(getd(".@x" + .@x[.@i]));.@m++){ debugmes "" + getd(".@x" + .@x[.@i] + "[" + .@m + "]"); } }  
  23. sader1992's post in utilities.cpp error in laste rathena version was marked as the answer   
    i think it's you who reported about the issue in github , anyway for anyone who have the same issue , the fix is here
    https://github.com/rathena/rathena/pull/4552
     
  24. sader1992's post in Client crashes on some maps was marked as the answer   
    use the map files from an older data/rdata
  25. sader1992's post in Script event when clone kills another clone was marked as the answer   
    the clone command return the monster gid
    so you can just save the gid and check for it
    like 
    .PlayerOneClone = clone("prontera",155,155,"NpcName::OnEvent",1); .PlayerTwoClone = clone("prontera",145,145,"NpcName::OnEvent",2); end; OnEventOne: if(!unitexists(.PlayerOneClone)){ //player one clone is dead } if(!unitexists(.PlayerTwoClone)){ //player two clone is dead } end;  
    also the event name, you can just use different event name for each clone
    like
    clone("prontera",155,155,"NpcName::OnEventOne",1); clone("prontera",145,145,"NpcName::OnEventTwo",2); end; OnEventOne: //player one clone is dead end; OnEventTwo: //player two clone is dead end;  
     
    here a long example :
    let's clone everyone in prontera , than we check every time one of the mobs are dead we output a debugmes for the char id of the player
    (i didn't test it , i just wrote it as an example , i don't know even if it will work but technically it should work)
    getmapunits(BL_NPC,"prontera",.@AID); for(.@i=0;.@i<getarraysize(.@AID);.@i++){ .@s = getarraysize(.charList); .charList[.@s] = convertpcinfo(.@AID[.@i],CPC_CHAR); .mobList[.@s] = clone("prontera",155,155,"NpcName::OnEvent",.charList[.@s]); } end; OnEvent: for(.@i=0;.@i<getarraysize(.mobList);.@i++){ if(.mobList[.@i] && !unitexists(.mobList[.@i])){ //the monster has been found. //we save it. .@charID = .charList[.@i]; .@mobID = .mobList[.@i]; //we delete it from the array. deletearray .charList[.@i],1; deletearray .mobList[.@i],1; //we break out. break; } } //now we have the here .@charID = the player id , .@mobID = the monster gid debugmes "" + .@charID; debugmes "" + .@mobID;  
×
×
  • Create New...