Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kurofly

  1. Tell us exactly what you need to do, that's not really clear ^^ You can't use switch with strings because it's supposed to be used with numbers.
  2. I don't understand the first part >< for the default shop name I can easily add an option for that, don't know why I didn't think about it sooner. for the item restriction I can check if the player has restricted items in his inventory but I would still have a problem: example: if a player has two same equips but one refined and wants to sell one, I will won't be able to check if he's selling the refined one or the other. In this case I can still ask the player to store the restricted equip before trying to sell the other one to make sure he doesn't sell a restricted equip. EDIT: I'm just so stupid, there's actually all the sales details I need set when calling the OnSellItem label In fact I can manage to make a player sell refined or slotted equips but I didn't find any way to make it appear on the shop, you normally can't sell refined or slotted items via a NPC shop so there's no way to display them in it (or i don't know one). for the item quantity there's also no way to display it since NPC shops are supposed to sell as many items as you want but I think I'll just add a message window on which I'll diplay the item quantity & price and ask how many the player wants. So so so.. you made me think a bit about it so now I have an idea I'll make it so that when a player wants to buy an item, the item specs quantity and price will appear in a window so that I'll be able to sell refined or slotted equips. I'll also tell the player if some items have specs when he opens a shop. That'll be really boring if you want to buy a lot of stuff but I guess you usually don't buy a lot in other people's shop. Maybe I could add a '@buy' command which would allow a player to open a shop from a distance. Hmmmmmmmmmmmmmmmmmm; I need to change almost everything in my script to do this because I'll have to make use of sql tables so I'll need a bit of time and I don't won't have much untill the 20th but you gave me good ideas so I'll do it. Could you please explain your first part a bit more clearly? Because I really don't understand >< Tell me if you have other ideas.
  3. Didn't think about it that's also way simplier. Thanks emistry I never noticed there was an "all players" type in addrid, I'll probably make use of it.
  4. File Name: Auto shop File Submitter: Kurofly File Submitted: 27 Apr 2015 File Category: Utilities Content Author: Kurofly This script will allow players to shop their items while playing via a shop NPC, this is kind of an alternative to the auction system. Note: There's also a french version since I'm french ^^ There is a user setup, be sure to check it out ! User can add a cost to shop creation and/or a tax, there's also a delay after which the shop is deleted. Players can create a shop using an item or via the '@shop' command, depending on the mode value in the user setup Players can shop any kind of item apart from bound and time-limit items You can add items, change prices, modify your shop name anytime using the '@shop' command You can disconnect and reconnect anytime, if you sold something and/or your shop was deleted you will get your money and items on relog In case the server reboots you also get back the shop creation's cost or the item you used to open it Please report any bug you find. If I can't answer you while you are experiencing bugs, consider following this step: Make sure no one is selling when you do this because they will loose all of their sales !! Note: you can just reloadscript before doing this to give them back all of their items. //bindatcmd "delall",strnpcinfo(3)+"::OnDelall",99,99; /*In case you have problems I recommend you to uncomment this command and to execute it. It will erase all the data of every shop and every player. I myself experienced some issues not directly related to the script but to unexpected events so reseting data should temporarly solve the problem. Please contact me on rA (Kurofly) if you experience any bug*/ Click here to download this file
  5. File Name: At_var File Submitter: Kurofly File Submitted: 11 Apr 2015 File Category: Utilities Content Author: Kurofly This basically is a script wich allows an admin to use 2 commands: -'@var <variable> {<player/npc>}' : gives you the value of the variable -'@setvar <variable> <value> {<player/npc>}': Sets the variable to value The script will check wether you want to set an integer or string variable and acts accrodingly so no need to bother for this. If you don't enter enough parameters you will be informed on how the commands works so basically you can just type '@var' and '@setvar' in game to see how it works. I made this to help me finding out where my errors were in some scripts and also to directly go at a certain point of a quest. I found that pretty useful so I guess you may think it's useful too ^^ Wanted to say "Have fun!" but this script won't give you much fun so just hope that'll help Click here to download this file
  6. Here is what you need to do in order to give effects to your skills (source solution): To add a custom skill follow this guide Open your src/map/skill.c and look for your custom skill For example: case P_LANCE_FLAMME: skill_attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag); break; Then just turn it to this: case P_LANCE_FLAMME: clif_specialeffect(bl,173,AREA); skill_attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag); break; clif_specialeffect(bl/src,<effect number>,AREA) bl means the effect will be centered on the ennemy. src means the effect will be centered on the caster. You can find all the effects and their corresponding ids in doc/effect_list
  7. Thank you for your answer. Sorry I totally forgot to edit this topic since I solved it >< Mary Magdalene helped me to solve it and it's indeed source-sided. I'll edit this topic tomorrow showing the solution. Note: There's probably a way to do it client side since there's no clif>specialeffect for most of the skills in skill.c but I'm fine with the source way. Maybe we should keep this post open since it's in the client section.
  8. Sorry I really don't have time these days, I'm working a lot on a school project these days and so I don't have motivation on my spare time anymore. Stolao seems kindly so I'm letting you in his hands untill I have more time
  9. Does it work in all maps? I thought soundeffectall could only work on one map >< That's way simplier then, thank you for sharing
  10. really nice indeed ^^ Love it, keep it up!
  11. lua files >> data/lua files/datainfo data/luafiles514/lua files/datainfo I don't know in which of these two you have to put your lua files because the files you edited are in both of them so just save it in both ^^ act & sprite files >> data/sprite/npc
  12. That was funny I think he's not looking for a daily reward system. - script reward npc -1,{ OnInit: bindatcmd "reward",strnpcinfo(0)+"::OnReward",40; end; OnReward: .@nb = query_sql ("SELECT `name` FROM `ragnarok`.`char` WHERE `online` = '1' AND `account_id` NOT IN (SELECT `account_id` FROM `ragnarok`.`login` WHERE `group_id` > '0') LIMIT 128",.@players$); mes "["+strnpcinfo(0)+"]"; if (.@nb == -1) { mes "No player is connected.." ; close; } if (.@nb == 128) { mes "There are too many players for me to handle.." ; close; } mes "Hi there!","I can give items to every players connected","","Players connected : ^0000ff"+.@nb+"^000000"; next; if (select("Give items:Leave") == 2) end; while (!.@ok) { mes "["+strnpcinfo(0)+"]"; mes "please ^0000ffinput the id of the item^000000 you want to give to players."; input .@id,501; mes "","Item selected : ^ff0000"+getitemname(.@id)+"^000000"; .@s = select("Next:Change item:Leave"); next; if (.@s == 3) end; if (.@s == 1) .@ok = 1; } while (!.@ok2) { mes "["+strnpcinfo(0)+"]"; mes "please ^0000ffinput the amount^000000 you want to give to players."; input .@amount,1; mes "","Amount : ^ff0000"+.@amount+"^000000"; .@s = select("Next:Change amount:Leave"); next; if (.@s == 3) end; if (.@s == 1) .@ok2 = 1; } mes "["+strnpcinfo(0)+"]"; mes "Do you want to announce something?"; next; .@s = select("Custom announce:Automatic announce:No announce:Leave"); if (.@s == 4) end; if (.@s == 3) .@noannounce = 1; if (.@s == 1) { mes "["+strnpcinfo(0)+"]"; mes "Please input your announce."; input .@announce$; } close2; if (!.@noannounce) { if (.@announce$ != "") announce .@announce$,0; else announce "Here for you all! Hope you enjoy!",0; } for (.@i = 0 ; .@i < .@nb ; .@i++) if (attachrid(getcharid(3,.@players$[.@i]))) getitem .@id,.@amount; } Don't know if you found something already but if you didn't you can use this. type '@reward' in-game and you will be able to give items to all players online. Note for SQL pros ^^: I couldn't find a way to select names with distinct account_id with my query so if someone know how to do so I'm really curious please tell me Even so I don't think it's a problem since you shouldn't be connected with more than one of your characters.
  13. Can you give us a little bit more details? Do you want your script to be enabled all the time? On which maps do you want guild members to be immuned to attacks? For how much time? When do you want it to be disabled? Also can you tell us for what use you want this script to be? I think that would help us understanding.
  14. If you remove the disctinct please consider using this: query_sql ("SELECT `last_map` FROM `char` WHERE `online` = '1'",.@maps$); for (.@i = 0 ; .@i < getarraysize(.@maps) ; .@i++) for (.@j = .@i+1 ; .@j < getarraysize(.@maps$) ; .@j++) if (.@maps$[.@i] == .@maps$[.@j]) deletearray .@maps$[.@j],1; It will delete duplicates. If you keep it like this, the soundeffect will play as many times as there are players on a map. For example if 10 players are in cap the soundeffect will play 10 times.
  15. i copied and pasted the one you put in this topic so we have exactly the same script. Plus your errors say 'acces denied' so the problem is not related to the command itself but more to your configuration.
  16. I tried it already and I don't have any problem. Have you ever used the 'query_sql' command before? If yes did you also have errors?
  17. well someone here had the same problem. He solved it with these: Check the char_athena and map_athena.conf the IP is probably wrong. Remember to uncomment or remove //. and You will be putting the Router IP. To see what it is, right click on the Internet Connection at the lower right of your taskbar, then Status. You will see your Ip there. Can't help you more than that ^^ Good luck. have a look at this one too: Go to your inter_athena.conf. You must put the correct IP,userid,passwd and db name for Char,Map,Login and log.
  18. costume npc sprite? If you mean custom NPC you have to replace one of the existing NPC id between 46 and 999 because all of the available id ranges are already taken. Look for a NPC sprite you don't care about here and keep his id in mind Go to your lua files folder and open npcidentity.lua Look for the id you kept in mind ^^ and replace his name by the name of your npc sprite in caps example : JT_WARPNPC = 45, >> CUSTOM_NPC = 45, Then open up your jobname.lua and add this line : [jobtbl.<name in npcidentity.lua>] = "<your sprite file name>" example : [jobtbl.FLORIZARRE] = "Florizarre"} >> [jobtbl.FLORIZARRE] = "Florizarre",[jobtbl.CUSTOM_NPC] = "custom_npc"} Don't forget to save your sprite and act files in sprite/npc and you're done.
  19. could you please show me the error?
  20. for 1 and 3 you can look at euphy's quest shop, it's really good. For 2 you can look at this
  21. Hello there! I wonder if it would be possible to make the items description a bit more flexible? I'm talking about these Is there a way, for example, to add scripting elements into the description of an item like decisions. An item could so have two possible descriptions depending on wether we want to display the first or the second one. I know I can make two items so please don't answer me that xD I'm asking this because we already are able to modify an item script with the 'itemscript' command but there is actually no way to inform the player on which bonuses he get when using ths command(apart from messaging him) and if we could do this we would be able to make some cool things like fusion, weapon leveling, sets, etc.. properly. I guess it's a client-sided question but it may find a solution with source so please move my post if needed.
  22. - script weather npc -1,{ function ChangeWeather ; function CheckMap ; function CheckBound; OnInit: //==================================== *user setup* =================================================== setarray .maps$ , "prontera","morocc"; //place the maps you want the weather to be enabled here .mapcount = getarraysize(.maps$); setarray .weathers$ , "clouds","clouds2","fireworks","fog","leaves","sakura","snow"; .weathercount = getarraysize(.weathers$); setarray .announces$ , "It's getting cloudy~~","It's getting cloudy~~","Woah! Fireworks!","That fog came out of nowhere..","Some leaves are falling.","Some pretty leaves are falling.","It's so snowy!"; .delay = 1; //will change the weather every <.delay> minutes //================================= *end of user setup*================================================ bindatcmd "weather",strnpcinfo(0)+"::OnWeather",40; initnpctimer; end; OnTimer60000: $WeatherTimer++; if ($WeatherTimer >= .delay) { $WeatherTimer = 0 ; ChangeWeather(); } //changing weather.. end; OnHour18: for (.@i = 0 ; .@i < .mapcount ; .@i++) setmapflag .maps$[.@i],mf_nightenabled; end; OnHour08: for (.@i = 0 ; .@i < .mapcount ; .@i++) removemapflag .maps$[.@i],mf_nightenabled; end; OnWeather: $WeatherTimer = 0; ChangeWeather(); end; function ChangeWeather { //change weather .@rand = rand(getvariableofnpc(.weathercount,"weather npc")); .@weather$ = getvariableofnpc(.weathers$[.@rand],"weather npc"); while (.@weather$ == getvariableofnpc(.prev_weather$,"weather npc")) .@weather$ = getvariableofnpc(.weathers$[.@rand],"weather npc"); for (.@i = 0 ; .@i < getvariableofnpc(.mapcount,"weather npc") ; .@i++) { if (getvariableofnpc(.prev_weather$,"weather npc") != "") removemapflag getvariableofnpc(.maps$[.@i],"weather npc"),getd("mf_"+getvariableofnpc(.prev_weather$,"weather npc")); setmapflag getvariableofnpc(.maps$[.@i],"weather npc"),getd("mf_"+.@weather$); } set getvariableofnpc(.prev_weather$,"weather npc") , .@weather$; //reload screen for players not selling/in chatroom .@n = query_sql ("SELECT `name` FROM `char` WHERE `online` = 1",.@players$); for (.@i = 0 ; .@i < getarraysize(.@players$) ; .@i++) { if (attachrid(getcharid(3,.@players$[.@i]))) { getmapxy .@map$,.@x,.@y,0; if (CheckMap(.@map$) && CheckBound()) warp .@map$,.@x,.@y; } } sleep 1000; for (.@i = 0 ; .@i < getvariableofnpc(.mapcount,"weather npc") ; .@i++) mapannounce getvariableofnpc(.maps$[.@i],"weather npc"),getvariableofnpc(.announces$[.@rand],"weather npc"),0,0x00ffff; return; } function CheckMap { getmapxy .@map$,.@x,.@y,0; for (.@i = 0 ; .@i < getvariableofnpc(.mapcount,"weather npc") ; .@i++) if (.@map$ == getvariableofnpc(.maps$[.@i],"weather npc")) return 1; return 0; } function CheckBound { if (checkchatting(strcharinfo(0)) || checkvending(strcharinfo(0))) return 0; return 1; } } please edit these because I'm not good at finding cool phrase xD setarray .announces$ , "It's getting cloudy~~","It's getting cloudy~~","Woah! Fireworks!","That fog came out of nowhere..","Some leaves are falling.","Some pretty leaves are falling.","It's so snowy!";
  23. oh that's nice but you have to wait 3 months to see another weather, that's a bit long
  24. You're welcome And I forgot to tell you any gm can instantly change the weather by calling the '@weather' command. It will change the weather randomly and reset the timer. Have fun^^ EDIT: I forgot to reset the npctimer after one minute, I fixed it in the previous post you can copy-paste it again
  25. the script works fine for me but I doon't have the beep.wav file ^^ atcommand "@kamic ffb9f3 "+.News$[ rand( getarraysize( .News$ ) ) ]; A player must be attached to the script.
×
×
  • Create New...