Jump to content

Hyroshima

Members
  • Posts

    163
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Hyroshima

  1. Sorry, but I still do not understand... Give me an example, talk about how it would work, that I do the script.
  2. I did not understand, can exemplify?
  3. ^^ script_commands.txt (/map/script.cpp) *itemskill <skill id>,<skill level>{,<keep requirement>}; *itemskill "<skill name>",<skill level>{,<keep requirement>}; This command is meant for item scripts to replicate single-use skills in usable items. It will not work properly if there is a visible dialog window or menu. If the skill is self or auto-targeting, it will be used immediately; otherwise a target cursor is shown. If <keep requirement> parameter is set to true, the skill's requirements will be checked. By default, the requirements for item skills are not checked, and therefore the default value is false. // When Anodyne is used, it will cast Endure (8), Level 1, as if the actual // skill has been used from skill tree. 605,Anodyne,Anodyne,11,2000,0,100,,,,,10477567,2,,,,,{ itemskill 8,1; },{} // When Sienna_Execrate_Scroll_1_5 is used, it will cast Sienna Execrate Level 5 and consume 2 Red_Gemstones. 23194,Sienna_Execrate_Scroll_1_5,Level 5 Sienna Execrate,11,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "WL_SIENNAEXECRATE",5,true; },{},{}
  4. Please explain to me what the script should do normally?
  5. Add below after of OnPCLoginEvent: if(getgroupid() == 99) end; Ex: OnPCLoginEvent: if(getgroupid() == 99) end; for( .@i = 13; .@i <= 18; .@i++ )
  6. OMG, I even thought of doing so, but I was tired and did not reasoned more kkkkk Thank you ^^ I'm creating an interesting store, i do not know if it already exists, because I've never seen something similar. I have not been developing anything for a while, sometimes i get stuck in a small complex problem but looking at script_command.txt I'll reminding. Thanks again ^^
  7. OMG, I forgot that deletearray moves the index. Thank you very much!!
  8. Hyroshima

    Help+

    Please give me more information!
  9. Hello guys, I'm having a problem which is making me confused. The situation is the deletion of null values of an array, however a null value remains... dispbottom "Array Value Before: "+getarraysize(.@tmp_magic_shop)+""; for(set .@i,0; .@i<getarraysize(.@tmp_magic_shop); set .@i,.@i+1) { dispbottom ""+.@tmp_magic_shop[.@i]+""; } Remove null values. for(set .@i,0; .@i<getarraysize(.@tmp_magic_shop); set .@i,.@i+1) { if(!.@tmp_magic_shop[.@i]) deletearray .@tmp_magic_shop[.@i],1; } dispbottom "Array Value After: "+getarraysize(.@tmp_magic_shop)+""; for(set .@i,0; .@i<getarraysize(.@tmp_magic_shop); set .@i,.@i+1) { dispbottom ""+.@tmp_magic_shop[.@i]+""; } OBS: deletearray .@tmp_magic_shop[0],1; <- remove that value 0 the confusion is why this value It's not removed like the others. Thank you since now!
  10. if(Custom !=1){ -> if(#Custom !=1){ set Custom,1; -> set #Custom,1;
  11. @lordfelll iai man, demorou um pouco pq tou ocupado (estudando kkk), script simples pra fazer ^^. (Reciclagem de cards) ver se ficou como esperado, como eu nunca vi esse script fiz de acordo com oq vc explicou ai. https://pastebin.com/raw/69y4EVcf
  12. Sorry for posting in the wrong section, I'm a little crazy.? I forgot about this basic math question... Any value divided by 2 that has left over is odd Thank you! SOLVED!! Sorry, i edited and ended up doing another post '-'
  13. Hello again ? I was searching and there is nothing where I can check if a number is odd or pair. can not create a function to check because the number may or may not have a high value. Thank you to all who can help! By: Hyro~
  14. @AnnieRuru hoho, I have to stop using alt + c & alt + v kk. I work on a very complete quest script and I think the excess complexity is leaving me with the lack of attention kk @sweetmole wait for him to answer his code is impeccél! rsrs
  15. @sweetmole rdy: prontera,152,166,5 script Quest KMob 4_M_02,{ if(mob_qt1) { if(QT_MobKill1 < mob_qt1 || QT_MobKill2 < mob_qt2 || QT_MobKill3 < mob_qt3 || QT_MobKill4 < mob_qt4 || QT_MobKill5 < mob_qt5) { mes "You have not completed the mission!"; mes "Kill: ["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_id1)+""; if(mob_qt2) mes "Kill: ["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_id2)+""; if(mob_qt3) mes "Kill: ["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_id3)+""; if(mob_qt4) mes "Kill: ["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_id4)+""; if(mob_qt5) mes "Kill: ["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_id5)+""; close; } mes "Congratulations, you completed the quest!"; atcommand "@aura 2"; set mob_id1,0; set mob_qt1,0; set mob_id2,0; set mob_qt2,0; set mob_id3,0; set mob_qt3,0; set mob_id4,0; set mob_qt4,0; set mob_id5,0; set mob_qt5,0; close; } mes "Hello, will I now ask you to kill some monsters for me ok?"; if(select("Ok:I do not want...")==2){ close; } next; set mob_id1,1031; //mob_id set mob_qt1,50; //Qty set mob_id2,1002; //mob_id set mob_qt2,150; //Qty set mob_id3,1166; //mob_id set mob_qt3,200; //Qty set mob_id4,1784; //mob_id set mob_qt4,250; //Qty set mob_id5,1095; //mob_id set mob_qt5,300; //Qty mes "Okay, go and kill:", ""+mob_qt1+"x "+strmobinfo(1,mob_id1)+"", ""+mob_qt2+"x "+strmobinfo(1,mob_id2)+"", ""+mob_qt3+"x "+strmobinfo(1,mob_id3)+"", ""+mob_qt4+"x "+strmobinfo(1,mob_id4)+"", ""+mob_qt5+"x "+strmobinfo(1,mob_id5)+""; close; OnNPCKillEvent: if(killedrid == mob_id1){ set QT_MobKill1,QT_MobKill1+1; dispbottom "["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_qt1)+""; } if(killedrid == mob_id2){ set QT_MobKill2,QT_MobKill2+1; dispbottom "["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_qt2)+""; } if(killedrid == mob_id3){ set QT_MobKill3,QT_MobKill3+1; dispbottom "["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_qt3)+""; } if(killedrid == mob_id4){ set QT_MobKill4,QT_MobKill4+1; dispbottom "["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_qt4)+""; } if(killedrid == mob_id5){ set QT_MobKill5,QT_MobKill5+1; dispbottom "["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_qt5)+""; } end; }
  16. @sweetmole Sorry, I just realized... the way I did this is random, I tried to do the same for 5 but it did not work very well, i can do it for 5 mobs but it will be fixed and not random, can it be?
  17. but the question is this, if QP_Act equals 0, so stop, and if 1 then it checks killedrid == .mob_id [QP_Val] or should it be: if(QP_Act) { if(killedrid == .mob_id[QP_Val]) } ?
  18. Hi... prontera,152,166,5 script Quest KMob 4_M_02,{ if(QP_Act) { if(QT_MobKill < .mob_qt[QP_Val]) { mes "You have not completed the mission!","Kill: ["+QT_MobKill+"/"+.mob_qt[QP_Val]+"] "+strmobinfo(1,.mob_id[QP_Val])+""; close; } mes "Congratulations, you completed the quest!"; atcommand "@aura 2"; set QP_Act,0; set QT_MobKill,0; close; } mes "Hello, will I now ask you to kill some monsters for me ok?"; if(select("Ok:I do not want...")==2){ close; } next; set QP_Val,rand(1,getarraysize(.mob_id))-1; //Get a random mob_id set QP_Act,1; mes "Okay, go and kill "+.mob_qt[QP_Val]+"x "+strmobinfo(1,.mob_id[QP_Val])+" !"; close; OnNPCKillEvent: if(QP_Act && killedrid == .mob_id[QP_Val]){ set QT_MobKill,QT_MobKill+1; } end; OnInit: setarray .mob_id[0],1031,1002,1166,1784; //Mob ID, limited (0,126) mobs_ids setarray .mob_qt[0], 1, 2, 3, 5; //Qty kills, limited (0,126) mobs_qty end; }
  19. Many thanks for responding ^^.. Then, as you explained, did not have repeated numbers, I figured that's repeated values are indebted by of quantity the sum of rates in which it is repeated correctly? my example below, how I understood ...
  20. Ty... But I wanted to understand how it was done to have this rate in% of the examples? https://github.com/rathena/rathena/blob/master/doc/item_group.txt#L51 Rate: Probability to get the item. Not a percentage value! Examples: IG_MyItemGroup,Knife,5 IG_MyItemGroup,Dagger,1 - Knife has chance 5/6 (83.3%) to be obtained - Dagger has chance 1/6 (16.7%) to be obtained I created a system in sql: id (auto-increment) item_id item_qtd (amount) rate (%) cat (would be like the groupid, box ID.) But the system is basically basic rand (1,100) set .@rate,rand(1,100); query_sql "SELECT `item_id`,`item_qtd`,`rate` FROM `custom_box` WHERE `rate`>='"+.@rate+"' AND `cat`='"+getarg(0)+"' ORDER BY RAND() LIMIT 1",.@id,.@qtd,.@rt; if(!.@id) query_sql "SELECT `item_id`,`item_qtd`,`rate` FROM `custom_box` WHERE `rate`='100' AND `cat`='"+getarg(0)+"' ORDER BY RAND() LIMIT 1",.@id,.@qtd,.@rt; if(!.@id){ dispbottom "[ Custom Box ]: Houve um erro, por favor informe a um GM!"; end; } getitem .@id,.@qtd; end; the rand () method does not work well, so I would like to understand how the rate of the items added in a custom box works. Thank you in advance for your attention! By: Hyro~
  21. ty, but I need to understand what happens! Pseudocode
  22. Hello, I would like to understand how the item box system works Ex: // Old Card Album Obtainable Items Database // // Structure of Database: // GroupID,ItemID,Rate IG_CardAlbum,4001,10 // Poring Card IG_CardAlbum,4002,10 // Fabre Card IG_CardAlbum,4003,6 // Pupa Card // Old Blue Box Obtainable Items Database // // Structure of Database: // GroupID,ItemID,Rate IG_BlueBox,501,12 // Red Potion IG_BlueBox,502,12 // Orange Potion IG_BlueBox,503,12 // Yellow Potion IG_BlueBox,504,12 // White Potion I would like to know which method is being used to calculate the rate or what it is based on. thank you, by Hyro~
  23. Nossa mano eu jurava que que a var era uma array, muito obrigado me ajudou bastante ^^.
×
×
  • Create New...