Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kurofly

  1. set .@size, query_sql( "SELECT `name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `group_id` > 0 ) ORDER BY `name` DESC LIMIT 128", .@name$ ); there is no column 'level' in the login table, you probably mean 'group_id'. Didn't try it but it seems ok
  2. replace your soundeffectall by these two lines
  3. then try this: query_sql ("SELECT DISTINCT `last_map` FROM `ragnarok`.`char` WHERE `online` = '1'",.@maps$); for (.@i = 0 ; .@i < getarraysize(.@maps$) ; .@i++) soundeffectall "beep.wav",0,.@maps$[.@i]; it will play your soundeffect in all maps where there is at least one player. Didn't test it tough
  4. Guess you have to add the map name to your soundeffect. For example: soundeffectall "beep.wav",0,"prontera";
  5. - 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$); .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 .@weather$ = getvariableofnpc(.weathers$[rand(getvariableofnpc(.weathercount,"weather npc"))],"weather npc"); while (.@weather$ == getvariableofnpc(.prev_weather$,"weather npc")) .@weather$ = getvariableofnpc(.weathers$[rand(getvariableofnpc(.weathercount,"weather npc"))],"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; } } 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; } } Check out the user setup. The weather will be changed on the maps in .maps$ array every <.delay> minutes. I put all the weathers in the .weathers$ array but you can delete some if you want night mode will be activated from 6pm to 8am but you can change those if you want (just change OnHour18 to OnHour19 for example) players who are not vending or in a chatroom will be warped to their current location to reload their screens so that they can see the effects. Tell me if you want to add/change anything
  6. I also posted 2 files but I'm not in a hurry I just wonder if I forgot something or if they're just busy. Also one of them is available in this topic since it was a request but I don't know if I have the right to do that. Anyway please keep me informed.
  7. It's just a test script xD this has nothing to do with any real script. Just tell me when do you want to change the weather? Every hour, day, 30 minutes, on a special event? Just so that I know if I'll be using timers or labels. Also are all the weathers working fine for you?(because not for me^^) If not, which ones do you want to use?
  8. I tried out the weathers and not all of htem seem to be working. Plus, those which work are pretty specials so try this and if you still want to make use of weather tell me exactly what you's want to do. It'll be a pleasure do make it happen /*================== | 3. Map Effects | ================== --------------------------------------- *clouds *clouds2 *fireworks *fog *leaves *sakura *snow Displays a weather effect on a map. --------------------------------------- *nightenabled Displays night mode effects on a map. This is used on most outdoor maps. ---------------------------------------*/ - script weather npc -1,{ OnInit: bindatcmd "weather",strnpcinfo(0)+"::OnTest"; end; OnTest: .@rid = getcharid(3,strcharinfo(0)) ; getmapxy .@map$,.@x,.@y,0; announce "night",0; setmapflag .@map$,mf_nightenabled; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_nightenabled; announce "clouds",0; setmapflag .@map$,mf_clouds; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_clouds; announce "clouds2",0; setmapflag .@map$,mf_clouds2; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_clouds2; announce "fireworks",0; setmapflag .@map$,mf_fireworks; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_fireworks; announce "fog",0; setmapflag .@map$,mf_fog; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_fog; announce "leaves",0; setmapflag .@map$,mf_leaves; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_leaves; announce "sakura",0; setmapflag .@map$,mf_sakura; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_sakura; announce "snow",0; setmapflag .@map$,mf_snow; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } sleep 5000; removemapflag .@map$,mf_snow; if (attachrid(.@rid)) { getmapxy .@map$,.@x,.@y,0 ; warp .@map$,.@x,.@y; } } load the script and type '@weather'. It will show you all the weathers available
  9. I guess you should get rid of the space between your last line and the right curly. I had a lot of errors with lub files and it was always because of something stupid so try anything even if you think it's stupid xD
  10. Wow I want it too xD. Hope you'll find it
  11. Maybe you have to recompile. Not sure but it's worth giving a try
  12. if(countitem(4052)<1|| countitem(2607)<1 || countitem(7277)<50 || countitem(592)<1 || Zeny < 1000000) goto L_NoMake; Some ')' not at the right places
  13. Ahh ok I get it. set .@rid , getcharid(3,strcharinfo(0)); addrid (2,0,getcharid(1)); //attach the rid of all players in the group set questdelay,gettimetick(2)+10800; //set the delay for all players in group detachrid; attachrid(.@rid); //so that the rest of the script will only run on the party leader
  14. Oh yeah you're right. function script GetRandEgg { attachrid (getarg(0)); setarray .@PetEggId1 , 1002,1113,1131; setarray .@PetEggChance1 , 100,100,100; setarray .@PetEggId2 , 1002,1113,1131; setarray .@PetEggChance2 , 100,100,100; .@n = 1; while (getd(".@PetEggId"+.@n)) { for (.@i = 0 ; .@i < getarraysize(getd(".@PetEggChance"+.@n)) ; .@i++) .@total = .@total + getd(".@PetEggChance"+.@n+"["+.@i+"]"); .@n++; } .@rand = rand(.@total);debugmes ""+.@total; .@n = 1; while (getd(".@PetEggId"+.@n)) { for (.@i = 0 ; .@i < getarraysize(getd(".@PetEggChance"+.@n)) ; .@i++) { if (.@rand < getd(".@PetEggChance"+.@n+"["+.@i+"]")) { makepet getd(".@PetEggId"+.@n+"["+.@i+"]") ; end;} .@rand = .@rand - getd(".@PetEggChance"+.@n+"["+.@i+"]"); } .@n++; } } //in your item script >> callfunc "GetRandEgg",getcharid(3,strcharinfo(0));
  15. Why don't you make a function similar to getrandgroup item? function script GetRandEgg { attachrid (getarg(0)); setarray .@PetEggId , 1002,1113,1131; setarray .@PetEggChance , 100,100,100; for (.@i = 0 ; .@i < getarraysize(.@PetEggChance) ; .@i++) .@total += .@PetEggChance[.@i]; .@rand = rand(.@total); for (.@i = 0 ; .@i < getarraysize(.@PetEggChance) ; .@i++) { if (.@rand < .@PetEggChance[.@i]) { makepet .@PetEggId[.@i] ; end;} .@rand -= .@PetEggChance[.@i]; } } //in you item script >> callfunc "GetRandEgg",getcharid(3,strcharinfo(0)); You just have to edit the '.@PetEggId' and '.@PetEggChance' arrays using the same way as getrandgroupitem
  16. Hello there. I added some custom skills to my server but they don't have any effect assigned so all of them display the 'bash' effect on the ennemy. Does anyone know how to tell the client which effect I want to be assigned to my skill? Note: this may be a source question since some skills have delayed animations but I'm not sure about it, move this post to the right section if needed.
  17. Not sure this will work ^^ but we never know you can try it
  18. bonus2 bAddRace,RC_NonBoss,<value> ? For demi-humain use the same with all races except demi-human
  19. - script NPC Name -1,{ OnInit: //setarray .class<num> , <max amount of mob that can be spawned> , <mob>{,<mob>{,<mob>}}; setarray .class1 , 1 , 1735,1740,1312,1297,1567,1852,2144,2016,2338,2339,1868,2472,1507,1456,1992,1302,2342,1389,2018,1115; setarray .class2 , 4 , 1964,1715,1500,1098,1476,1593,1713,1882,1786,1269,1937,1109,2323,1117,1869,1512,1788,1257,1437,1662; setarray .class3 , 20 , 1271,1403,1099,1819,1367,1250,1244,1519,1108,1532,1791,1597,1541,1629,1680,1422,1212,1421,1543,1458; setarray .class4 , 25 , 1863,1280,1440,1069,1032,1927,2025,1013,1177,1178,1417,1111,1033,1119,1592,1040,1129,1544,1586,1509; setarray .class5 , 50 , 1420,1060,1188,1036,1129,1130,1135,1282,1242,1141,1142,1144,1058,1854,1160,1077,1445,1001,1235,1562; .@n = 1; while (getd(".class"+.@n)) {.amount ++ ; .@n++;} .name$ = "[^663300"+strnpcinfo(1)+"^000000]"; bindatcmd "mobevent",strnpcinfo(0)+"::OnEvent",40; end; OnEvent: mes .name$; if (.mobs) { mes "Sorry but an event is currently running so you cannot start another one." ; close;} mes "Hey there!","I'm in charge of managing the monster spawn event.","","What do you want to do?"; next; if (select("Start an event:Leave") == 2) end; mes "max amount of monsters you can spawn :"; for (.@i = 1 ; .@i <= .amount ; .@i++) mes "~~ from class "+.@i+" >> ^0000ff"+getd(".class"+.@i)+"^000000"; next; for (.@i = 1 ; .@i <= .amount ; .@i++) { mes "Please enter the amount of monsters to spawn from class "+.@i; input .@num[getarraysize(.@num)],0,getd(".class"+.@i); next; } mes "Recap :"; for (.@i = 1 ; .@i <= .amount ; .@i++) mes "~~ monsters from ^0000ffclass "+.@i+"^000000 >> ^ff0000"+.@num[.@i-1]+"^000000"; if (select("Confirm:Leave") == 2) end; next; mes "In which map do you want to spawn these monsters?"; input .@map$; for (.@i = 1 ; .@i <= .amount ; .@i++) { .@total = .@total + .@num[.@i-1]; for (.@j = 1 ; .@j <= .@num[.@i-1] ; .@j++) { .@rd_id = getd(".class"+.@i+"["+rand(1,getarraysize(getd(".class"+.@i)))+"]") ; monster .@map$,0,0,getmonsterinfo(.@rd_id,0),.@rd_id,1,strnpcinfo(0)+"::OnMobDead"; } } .mobs = .@total; announce "[Event] : "+.@total+" monsters were spawned in "+.@map$+".",0; end; OnMobDead: .mobs -= 1; if (!.mobs) announce "[Event] : All monsters have been killed. Thank you for participating!",0; } So you'd start the event by calling the '@mobevent' command (only for gm lvl >= 40). You can add as many classes as long as you follow this format: //setarray .class<num> , <max amount of mob that can be spawned> , <mob>{,<mob>{,<mob>}}; You didn't want anything special so it ended up pretty short, don't hesitate to tell me if you want to add/change anything.
  20. Ok so you want it to be an event. Do you want it to spawn monsters randomly or do you want to be able to choose them? Do you want it to have a delay between two events? Do you want to be able to add/delete monsters to classes in game? Do you want to be able to edit the max amount of monsters who can be spawned in each class in game? If I get it right, you want, once you start the event, to be asked how many monsters you want to spawn from each class (randomly?) and then spawn them to the map of your choice. Tell me if I'm right or wrong.
  21. prontera,155,155,4 script PvP Warper 411,{ set .@mes$,"[^777777PvP Warper^000000]"; mes .@mes$; switch(select("Room 1","Room 2","Room 3","Cancel")){ case 1: close2; warp "pvp_y_1-1",119,84; end; case 2: close2; warp "pvp_y_1-2",119,84; end; case 3: close2; warp "pvp_y_1-3",119,84; end; case 4: close; } } It's just a tab error. But this is really basic, not very funny..
  22. I don't know anything about flux but I know you'll have to make use of sql tables to store the data you need to get this working. Your script is supposed to be used with FluxCP Addon: Vote For Points 1.2 by JayPee Mateo so if you don't have it already download it. Then here is what you need to do in order to create the sql tables: Open up your MySql Workbench (you should have made use of it when you created you server)​ Connect to your Sql server Click File >> Open SQL Script... Open voteforpoints/schemas/logindb/cp_v4p_sites.sql Execute the script Select 'edit table' on the table you just created and fill in the values (I suppose) Sorry can't help you there I have no idea what these are... Repeat from 'Click File >> Open SQL Script...' step to here opening voteforpoints/schemas/logindb/cp_v4p_votelogs.sql You probably don't have to edit this one but I'm not sure.. Repeat from 'Click File >> Open SQL Script...' step to 'Execute the script' step opening voteforpoints/schemas/logindb/cp_v4p_voters.sql You don't have to edit this table
  23. Ok I get it. This script uses sql tables so you need to create them in order to get this working. and also if the NPC tells you to vote, it's because you don't have enough vote points to get any reward. Look at this line: // Retrieve the Vote Points: For use with FluxCP Addon: Vote For Points 1.2 by JayPee Mateo Look for this while I eat, see you later ^^
  24. Did you add your script location in trunk/npc/scripts_custom.conf ?? If yes, what excatly doesn't work? What happens you you click on your NPC? Do you have errors on your mapserv? I'm gonna go eating I'll come back in a few minutes.
×
×
  • Create New...