Jump to content

Kavaline

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Kavaline

  1. Guys, how I can pass/access 2 or more values to var1~4 of sc_start? Something with this logic (SC_CUSTOM alread declared and functional, codes in right functions) short eff_array[] = {SC_CURSE, SC_STUN}; clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_start2(src, bl, SC_CUSTOM, 100, 2000, eff_array, skill->get_time(skill_id, skill_lv))); int i; for (i = 0; i <= sizeof(sc->data[SC_CUSTOM]->val2); i++) { if (sc->data[SC_CUSTOM]->val2[i] == type) return 0; //error here, with 'i' }
  2. This is useful, thanks. I need know if have any debug message that shows their GID, like in an error, or something like this, for non-equipable items. When an Apple is generated, for example, the game had to know exactly what the Apple was generated, I think. Or if have any other way to attach a variable to an unique Item.
  3. Hi, have any way to attach variables to a specific item (not all Apples, but only a specific Apple)? I tried search how to get the GID of an item, but didn't found a way, and saw no one method for an item hold a variable or attach a variable for a specific item. Only way that I found is the card slots, but I can't use with crafted items that already use the slots, like Alchemist potions, and another scripts that use this, like Sign/Bound NPC. Someone know how I can do it?
  4. How I can get an item GID, or a similar unique variable? For healing item, or equipment, or misc item, anyone? And, is possible to change a script of an only one item? For example, all Apples recover 16~22 HP, but make only one Apple recover 7~10% SP without change all Apples or creating a new Apple? (Before anyone ask, I want the item GID for other purpose. Thinking about the item GID gave me this question, but I need the item GID to solve other problem).
  5. Works, I changed the attribute to aways get broken, and fit fine. "inventorylist" is very useful, you gave me some cool ideas. Thanks so much ?
  6. Hi, I need help for a script that break the players equipped weapon (not delete the player weapon, but breaks that return the weapon with broken status). I tried "delequip" with "getitem2", but how I get the slotted cards? And in case of BS/WS crafted weapons and signed weapons, have problem? And, have any way to do it better than: get weapon id; get refine; get card 1; get card 2; get card 3; get card 4; delequip; getitem2(weapon id, 1, 1, refine, 1, 0, card 1~4); Some item script, function, effect, etc, that I can use to do it better/easier?
  7. Thanks for the answers ? Works perfectly for what I want, because more than one player will activate the NPC. Thanks for the tip ?
  8. Hi, I want a script that gives the player 5 seconds to type a word, with 'input'. But when the time runs out, the script runs normally, and after, read the event label of the time out. Here is what I tried: mes "type anything in 5 seconds"; addtimer(5000, strnpcinfo(NPC_NAME_UNIQUE)+"::On5secs"); input(.@text); deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::On5secs"); next; mes "you did it"; close; On5secs: mes "time over"; close; Maybe is impossible for the 'timer' force close the 'input', but at least, I want a way that after the 'input', run the time out label if the time out, without run the lines above of the script. How I can do it?
  9. Nope, is about source modification, to add a new custom parameter. But was alread done, ty
  10. Hi, someone can tell me where I edit the command "getiteminfo" to add a new option: "getiteminfo(<item ID>, ITEMINFO_CUSTOM)"?
  11. Sorry, I don't explain that is for script. I need do this in a NPC script, thanks for the shot ?
  12. I have a string var with the item name stored (a Jellopy, for example). How I get the ID of the Jellopy by their name, via NPC script? I need do this in this way, because the name that I get is dynamic, based on a long list of items. I want something like "getitemname(<item id>)", but moke like "getitemid(<item name>)", or a way to get it, without using "searchitem(<array name>, "<item name>")".
  13. I didn't knew this command, is very useful for debug and feedback, thanks for show me this. Have lots of commands that I don't know, but I'm learning. Slowy, but ok *shrug*
  14. @Start_ Not full working, same problem: after use one charge (the 5/5 charge), the NPC aways says "Next Charge in 10 seconds.", but now, the charge recover after the right time ? And, after the second use, he shows the right recharge time. I think that first use when in full charge dont update the .cont. But my idea is: in full charge, start the npctimer, that in this state, give the .count the right countdown time, and after one second, in the OnTimer, update for the player. But looks like he don't update using the 5/5 charge, to tell the player the right time, only after talking again, he update right, and I can't find why. @edit The most important is the timer count rightly, the time left message is for help me in debug, so, don't need fix this, because I will remove this showing message. Thanks for the help, the working code is that I need, and is functional. But, you can explain me why my timer dont start, but start with your edit? I want understand better what I did wrong, and don't repeat the same mistake. Awesome, much better than what I tried!
  15. Hi, I write a script that a NPC have X charges (common for all players), and the players can spent a charge. After this, the NPC starts a timer (common for all players) to recharge, until their limit of X charges. Here is: - script TestScript::QuickTest 4_F_03,{ mes "[Quick Test]"; mes "What you want?"; next; switch(select("Use Charge", "See Charge", "Exit")) { case 1: if (.n_now > 0){ mes "[Quick Test]"; if (.n_now == .n_max) { setnpctimer 0; initnpctimer; mes "Starting recharges."; } .n_now -= 1; getitem 512, 1; mes "Done. Current Charges: "+.n_now+"/"+.n_max+"."; } else{ mes "[Quick Test]"; mes "No Charges."; } close; case 2: mes "[Quick Test]"; mes "Next Charge in "+((.cont)/1000)+" seconds."; close; } close; OnInit: set .n_max, 5; //max charges set .n_now, 5; //actual charge set .delay, 10*1000;//time to recover 1 charge set .cont, 0; //actual time left to recharge end; OnTimer1000: if (.cont <= 0) { .cont = .delay; } else{ .cont -= 1000; stopnpctimer; setnpctimer 0; if (.cont <= 0) { .n_now++; if (.n_now == .n_max) end; .cont = .delay; } initnpctimer; } end; } prontera,164,170,4 duplicate(QuickTest) Test Quick#prt 4_F_03 But I can't make the timer work; the NPC aways says "Next Charge in 10 seconds.", and the charges don't recover. I will appreciate if someone tell me were is the error, or another easier solution better than npctimer (I use 'OnTimer1000' because others NPCs will have different .delay's, so, I can use the same scope, and the 'addtimer' is attached to the player).
  16. I'm newbie in programming. I saw this post, but could't figure how to use, I got some errors, and by the time, I expected if another option was easier. Works like a charm, this example was very helpful. The brackets needs to be in "" too, because of this, I got wrong results. Solved question, can close the topic. Ty guys :)
  17. Hi, I need write this kind of script:  setarray .arrayAn[1], 1, 2, 3, 4, 5; setarray .arrayA$[1], "a", "b", "c", "d", "e"; setarray .arrayBn[1], 6, 7, 8, 9, 10, 11; setarray .arrayB$[1], "f", "g", "h", "i", "j", "k"; setarray .arrayCn[1], 12, 13, 14, 15; setarray .arrayC$[1], "l", "m", "n", "o"; .@value = rand(1,getarraysize(.arrayAn)); .resultn[1] = arrayAn[.@value]; .result$[1] = arrayA$[.@value]; .@value = rand(1,getarraysize(.arrayBn)); .resultn[2] = arrayBn[.@value]; .result$[2] = arrayB$[.@value]; .@value = rand(1,getarraysize(.arrayCn)); .resultn[3] = arrayCn[.@value]; .result$[3] = arrayC$[.@value]; Have any way to use matrix or other solution, doing something like this: setarray .arrayn[1][1], 1, 2, 3, 4, 5; setarray .array$[1][1], "a", "b", "c", "d", "e"; setarray .arrayn[2][1], 6, 7, 8, 9, 10, 11; setarray .array$[2][1], "f", "g", "h", "i", "j", "k"; setarray .arrayn[3][1], 12, 13, 14, 15; setarray .array$[3][1], "l", "m", "n", "o"; for (.@i = 1; .@i <= 3; ++.@i) { .@value = rand(1,getarraysize(.arrayn[.@i])); .resultn[.@i] = arrayn[.@i][.@value]; .result$[.@i] = array$[.@i][.@value]; } This is a script with testing values that I'm using to find a solution, my original script will needs 100 loops in this case (and will only use integers, for IDs and numbers, in non logical or consecutive order), and without matrix is really unfair. Have another option that help me?
×
×
  • Create New...