Jump to content

KeyWorld

Members
  • Posts

    379
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by KeyWorld

  1. if ( getgmlevel() > 0 && getgmlevel() < 90 ) { mes "[Warp NPC]"; mes "Sorry you can't use this NPC."; close; } Just add it to the beginning of your script.
  2. A bug in the source. Replace the line with: if ( getequipid(EQI_HEAD_TOP) <= 0) goto No_Head;
  3. lol ? isn't the equipments { Iitem Script } field also run the item script field 255 times ? Yeah you're right
  4. Isn't it too intensive for the server to be official ? ( /str+ 255 will run the script 255 times, no ?)
  5. How do you know it's a SQL injection in your website ?...If you know the answer, you will be able to fix it alone. Why people still continue to believe that the only way to hack is using SQL injection ? There are so more fun and exotic way to have full or partial access to a server.
  6. About script commands: Add: hasuniqueitem(<item uid>) // check if you have it in your inventory deluniqueitem(<item uid>) // delete an item Modify: getitem() / getitem2() / rentitem() // return item unique_id - getitem 1201, 1 {, .@output_uid_array }; getinventorylist() - add an uid array to the list. successremovecards / failedremovecards / successrefitem / downrefitem - keep the item uid And maybe add an optional "unique_item" argument to getitem2() to get RID of auto-magnifier NPC (delete item -> create item) ? So now we can get RID of scripts like npc/jobs/2-1/blacksmith.txt: mes "[Geschupenschte]"; mes "Oh, you should make sure that you are not carrying ^FF0000more than one "+getitemname(.@items[6])+"^000000, you should really only have an "+getitemname(.@items[6])+" that you bought from an NPC shop in your inventory."; next; if (select("Oh, could you give me a second?:Oh, I brought what you asked for.") == 1) { mes "[Geschupenschte]"; mes "Hmmm, it would be"; mes "a good idea to put the"; mes "rest of your items"; mes "in Kafra Storage."; close; } Or to check integrity of an item you give to someone. Well just some ideas.
  7. I don't think we really need "nsi" in the name too, but I don't care. In my own opinion this feature isn't important if it's just for tracing items. But it can help for script commands, when you want to modify/remove one specify item from a list that contain the same item multiples times.
  8. Duplicate NPC don't duplicate NPC script/memory. It just create an object on the map and when you click/touch or run an event on it, it redirect the action to the original script, so you don't duplicate the script, the variables, etc. (You can compare it to a shortcut icon in your desktop, it don't duplicate the original file). NPC will not cause problems on your server.
  9. The HTML5 history API is better for this kind of things (but you still can use the hash method if the API isn't supported).I don't see anything new in your panel for the moment honestly but hard to compare without testing. Hope the best for your project
  10. KeyWorld

    Playertalk

    Doesn't clif_disp_overhead send the message to the surrounding area? Whereas the message script command uses clif_displaymessage. You're right.I just read the latest line on clif.c (clif_send(...,SELF)) but didn't see the other packet send to the area just before
  11. In your function you are trying to access the array SummonType. You have to know first that you can't set a permanent player variable as an array Getd()/Setd() don't turn a variable into a string (as you said), it get a variable from the specify name. set .@varname$, "test"; setd ".@" + .@varname$, 5; // same as set .@test, 5; dispbottom getd(".@" + .@varname$); // same as dispbottom .@test; setd "$test", 5; // same as set $test, 5; mes getd("$test"); // same as mes $test;
  12. Oh i didnt see it , have to buy some new glasses lol
  13. Not bad Omnipotent, love the way you do/code it (I don't have an emu but I can see the way it should like with the code) Just one possible bug (but it's a one year old npc): - Player A (and C,D,E,F,G,...) run the game and wait at "close2". - Player B run the game, start the roulette. - Player A (and C,D,E,F,G...) press the "close2". Result: the roulette will have some fun
  14. Thank you for the pm, I didn't see your edit So now we can comment your script and try to improve it ! So here a list... Please don't use inline switch() / if(), it's not user-friendly to read and add comments Try to don't put "str" in a numerical variable, it can confuse :input .@StrPick; Code before a goto is NEVER execute, so you can remove all your close/end after a goto. In the start of your script, we have:set .RBet,select(.@RouletteMenu$); You are using a global NPC variable .RBet and use it after some next and menu. Problem ? Each time someone talk to the npc will reset everyone choice. So replace it by a player variable or scope variable should be a good choice. Some part can really be rewrite to reduce lines of code, like the huge switch() + goto part, it can be replace by an array... Do you really need to store the choice in permanent variable ? (getd("Bet_"+.@i+"$")). Should be better to use an @array$[]. Well I will try to make mine, but not have time today
  15. And what about using sleep2 ? prontera,155,179,5 script kjdhfkjshf 100,{ doevent strnpcinfo(0)+"::Onstart"; sleep2 1; // execute doevent first input .@name$; dispbottom "test"; close; Onstart: progressbar "", 3; end; }
  16. KeyWorld

    Playertalk

    Where as for playertalk, the variable is different + the message appears in the box and outside and people can see it. The variable is different ? It's not a valid argument for me. Other people can't see message(), just the specify character. The only valid reason is the message appear in the message box (don't know there was a packet just for a message over the head (and not in the dialog box)).
  17. KeyWorld

    Playertalk

    The command you wrote was the same than message(), not unittalk(). I don't see a good reason to add it to be honest.
  18. Funny... doevent strnpcinfo(3)+"::OnStartProgressBar"; doevent strnpcinfo(3)+"::OnCheckHit"; input .@rcode; [...] OnStartProgressBar: progressbar "green", 5; end; OnCheckHit: for ( set .@last_life, HP; .@i<5; set .@i, .@i+1 ) { if ( @last_life < HP ) close; set .@last_life, HP; sleep2 1000; } Try it, but: I'm not sure if it will work to close the script like this (it should since it's the same npcid...), and there is noway to remove a npc dialog/menu/input without the need of the client (or @refresh).
  19. Input and progressbar pause the script, so you have to run a new instance of the script in parallel. Something like: doevent strnpcinfo(3)+"::OnStartProgressBar"; input .@rcode; [...] OnStartProgressBar: progressbar "green",5;
  20. I wrote a function in the past called "autocleanvar" to add a delay timer to a variable to auto-delete it automatically. It's another approach, more complex, but possible too
  21. OnWhisperGlobal = RID But I agree with $KOEGUILD, I was busy to read the entire script So the correct fix should be, replace: if($KOEGUILD!=0) { Announce "The King of Emperium Hill has ended! The King Of Emperium Hill is the ["+GetGuildName($KOEGUILD)+"] guild.",bc_all|bc_WoE; } else { Announce "The King of Emperium Hill has ended! No guild has proven themselves King Of Emperium Hill!",bc_all|bc_WoE; } query_sql "UPDATE guild SET guild_points=guild_points +1 WHERE guild_id="+ getcharid(2); With: if( $KOEGUILD !=0 ) { Announce "The King of Emperium Hill has ended! The King Of Emperium Hill is the ["+GetGuildName($KOEGUILD)+"] guild.",bc_all|bc_WoE; query_sql "UPDATE guild SET guild_points=guild_points +1 WHERE guild_id="+ $KOEGUILD; } else { Announce "The King of Emperium Hill has ended! No guild has proven themselves King Of Emperium Hill!",bc_all|bc_WoE; }
  22. Or you can use: input .@label$; doevent strnpcinfo(3) + "::" + .@label$; end; But I still think there is no need to jump to a dynamic label if your code is structured.
  23. Well, try to replace: query_sql "UPDATE guild SET guild_points=guild_points +1 WHERE guild_id="+ getcharid(2); With: if ( playerattached() ) query_sql "UPDATE guild SET guild_points=guild_points +1 WHERE guild_id=" + getcharid(2);
  24. No you can't store a label into a variable, you will save its value (numerical) but not it's type. But as far I know you can send a label as an argument to a function or return a label from a function. Well, I think you should re-organize your code to avoid using this structure
  25. There are some reasons why I don't reply to this topic. The main reason is because you didn't mention me in your first post ! *joke* Seriously, I don't know well the rules so I can't really figure out how it works. It doesn't seem like a complex script but more like a boring script (to code) but the main reason is mostly because the result in-game will not be impressive : just a NPC dialog/menu like all casinos NPC.
×
×
  • Create New...