Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kurofly

  1. Thanks for that ! I'll try it very soon. I can't use getarraysize because if the previous monster dropped 3 items and the current monster dropped only 2 the third item will count in the getarraysize() even though it was not dropped by that monster. So I either have to delete the array before use or set a global variable to the amount of items dropped by the current monster. This is really too hard for me xD I tried to look up in mob.c and I think I need to add something here if(md->lootitem) { for(i = 0; i < md->lootitem_count; i++) mob_item_drop(md, dlist, mob_setlootitem(&md->lootitem[i]), 1, 10000, homkillonly); } But I have no experience with source and I don't know what to do, I tried a few things but they all give me errors ^^
  2. Thanks for your answer. Yes I know that but I'd like it to fill the array with the items the player got by killing this monster. $@Item_dropped_amount would be the array size of that array.
  3. Hello everyone! I'd like to be able to see which items a player got when he killed a monster but since there's no efficient way to do this via scripting (or so I think) that'd be very nice of you if you could help me doing this via src. I'd like to fill the $@Item_dropped[] array with the items id dropped by the monster before calling the 'OnNPCKillEvent' label. I'd also need to set the '$@Item_dropped_amount' variable to the amount of items dropped to avoid getting items dropped by another monster. I didn't even find the call of that label in the src files so I really need your help ^^
  4. Kurofly

    Script help

    Yeah sure I still don't really get it but now he has two options ^^
  5. Do you want the donations to be displayed with an alphabetical order or the highest/lowest donation first? nevermind didn't see what you wrote at the bottom.. Alphabetical order: query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `name`", .@donor_name$, .@donate_amount; Lowest first: query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `donateamount`", .@donor_name$, .@donate_amount; Highest first: query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `donateamount` DESC", .@donor_name$, .@donate_amount; For the update thing when you want to save the donations do something like this .@n = query_logsql ("SELECT `donateamount` FROM `donornames` WHERE `<your primary key>` = '<value to compare>'",.@donate_amount); if (.@n == -1) query_logsql ("INSERT INTO `donornames` (...) VALUES (...)"); else query_logsql ("UPDATE `donornames` SET `donateamount` = '"+(.@donate_amount+<amount of points to add>)+"' WHERE `<your primary key>` = '<value to compare>'");
  6. Kurofly

    Script help

    I would not recommend you to do this since the NPC will only change card if a player talks to it. prontera,150,150,5 script Sample 89,{ .@name$ = " ^993300[NPC's name]^000000"; mes .@name$; mes "Hi there."; mes "I'm missing a " +.cnames$+ ". I can offer " +.cpoints+ " premium points in return. # "+.number+" "; next; if (select("Exchange:Leave") == 2) end; mes .@name$; if (!countitem(.ccards)) { mes "You don't have any "+.cnames$+"!" ; close; } delitem .ccards,1; //add the line to give points to player here V V // //add the line to give points to player here /\ /\ mes "Thank you! Here are your "+.cpoints+" points!"; close; OnInit: OnTimer300000: .number = rand(1,494); query_sql("SELECT `cards`,`card_name`,`points`,`id` FROM `cards` WHERE `id` = "+.number+"",.ccards,.cnames$,.cpoints,.cid) ; npctalk "I'm missing a " +.cnames$+ ". I can offer " +.cpoints+ " premium points in return. # "+.number+" "; initnpctimer; } The npc will change card every 5 minutes and players can trade those cards for points. Don't forget to change these lines : //add the line to give points to player here V V // //add the line to give points to player here /\ /\ I don't know what kind of points you want to give to players so I couldn't fill this part. Tell me if that's not what you wanted, I'll try to understand next time ^^
  7. Yeah nice it's been more than a month dince I last updated my SVN, should have done that before asking (sorry for this ^^) Thank you for the fast answer
  8. Kurofly

    Script help

    for (.@i = 0; .@i < .@cards; .@i++ ) if( .number == @cid[.@i] ) { mes "I'm missing a " +@cnames[.@i]+ ". I can offer " +@cpoints[.@i]+ " premium points in return."; close; } this one here is useless since you'll only have 1 card returned from your query_sql You can't use player variables on this script because no player will be attached on it on the label triggering Also you can't use 'mes' if no player is attached. Do this instead: .@cards = query_sql("SELECT `card_id`,`card_names`,`cedi_points`,`id` FROM `cards` WHERE `id` = "+.number+"",.@ccards,.@cnames,.@cpoints,.@cid) ; npctalk "I'm missing a " +.@cnames+ ". I can offer " +.@cpoints+ " premium points in return."; note that if '.@cnames' is an array .@cnames is the same as .@cnames[0] For the rest I also didn't understand ^^
  9. Wow I'm really lucky it's fresh new ^^ Thanks a lot it'll save a lot of problems. I just have a small question, how can I get the name of the map a player is in whithout attaching him? Does the player already have a variable set when he goes to a new map? Thanks again
  10. Hi there. I'd like to request a script command that'd get the value of a player variable without attaching the player to the script. I had some issues due to timed checkings which require some player's variables and attaching them to the script will close every menu they could have opened. So I need a way to get the value of those variables without attaching the player to the script... Thanks in advance
  11. weird. Can you show us your sql query? did you write `ragnarok`.`interreg` ? Check your mysql workbench to make sure you have that table.
  12. This is interesting. Looking at this made me think about giving exp/drop bonuses to players according to of often they play. Resting bonuses in fact. Well this is totally different from your script but it gave me an idea , thank you^^ I think it could be nice to recalculate the bonuses on a special event counting them in, for example something like a limited duration event on which the more players complete a task the more bonuses everyone get after the event untill the next one. Well it'd be hard to do this whithout more details but it's just a suggestion ^^ I'm curious about one thing though: set .Random,0,100; why do you have 2 arguments there? Didn't know we could do that.
  13. Hey you're right, a progress bar would be nice. I already sent the script to him but I'll add that, it'll be nicer. Thanks
  14. - script DeleteAccount -1,{ OnInit: bindatcmd "delaccount",strnpcinfo(0)+"::OnDelete",99,99; // @delaccount <account_id> end; OnDelete: .@account_id = atoi(.@atcmd_parameters$); setarray .@log$ , "atcommandlog","branchlog","cashlog","chatlog","loginlog","mvplog","npclog","picklog","zenylog"; setarray .@ragnarok$ , "auction","bonus_script","buyingstore_items","buyingstores","cart_inventory","char","charlog","elemental", "friends","global_reg_value","guild","guild_alliance","guild_castle","guild_expulsion","guild_member", "guild_position","guild_skill","guild_storage","homunculus","hotkey","interlog","interreg","inventory", "ipbanlist","login","mail","mapreg","memo","mercenary","mercenary_owner","party","pet","quest","ragsrvinfo", "sc_data","skill","skill_homunculus","skillcooldown","sstatus","storage","vendig_items","vendings"; for (.@i = 0 ; .@i < getarraysize(.@log$) ; .@i++) query_sql("DELETE FROM `log`.`"+.@log$[.@i]+"` WHERE `` = '"+account_id+"'"); for (.@i = 0 ; .@i < getarraysize(.@ragnarok$) ; .@i++) query_sql("DELETE FROM `ragnarok`.`"+.@ragnarok$[.@i]+"` WHERE `` = '"+account_id+"'"); dispbottom "all SQL data has been erased on account_id "+.@account_id; } There must be another simplier way to do it but I don't know it ^^ Make sure that all those tables are in your sql workbench and add those which are missing (I didn't put my custom tables and my vote table but I still have the auction tables) I din't test it but it's pretty simple so there should be no problem.
  15. Sorry totally forgot you meanwhile >< But dude I really don't get it, could you please send me a pm to clearly explain the concept to me? Tell me what is supposed to do your script? for whom? why? how? what features? Send me a pm so that I can ask some questions directly.
  16. Look for these lines in your db/quests_db.txt : 60200,604800,0,0,0,0,0,0,"Endless Tower Effect" 60201,14400,0,0,0,0,0,0,"Endless Tower Time Limit" If you want a 1 hour delay between each entry you'd have this: 60200,3600,0,0,0,0,0,0,"Endless Tower Effect" 60201,14400,0,0,0,0,0,0,"Endless Tower Time Limit"
  17. Sorry about that. I'll be going for the next 5-6 hours for my finals so don't delete it until then xD
  18. Hey that sounds even cooler I'd love to work on the script if you need any help ^^ Can't wait to see it completed !
  19. Hello there! I have a local server on which I try my scripts before releasing them on rA or on other servers and I'll soon need some help from other people to try out the things I create and to give me their opinions. So I'd like to know how to make other people join my local server? Does anyone know a guide or something to help me doing this? Thanks
  20. Really nice man, keep it up With a little map for this minigame it would be perfect
  21. Hello rA! I'm trying out some new things at the moment and I wonder, is there a way to make friendly monsters (ai type 1) immuned to players attacks? We can already set a master aid for the monster but then the monster follows the character all the time, I'd like the monster to be independant while beeing immuned to players attacks. Thx in advance
  22. // -------------------------------------------------------------- // - Custom Scripts - // -------------------------------------------------------------- // All the custom scripts, remove the '//' to enable... // Place your scripts here! //npc: npc/location/to/script.txt put your script here before all the other ones. if it works...
  23. When you reloadscript and load this NPC only it doesn't load other NPCs? And you don't get any sql errors? It's really weird..
×
×
  • Create New...