Jump to content

plankt

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by plankt

  1. Please download and have a look at "queuetest.txt" to get an idea on how you can use the Queue System. The parts related to your script would summarized be: For putting players in the queue, lets say we pick event #1 prontera,155,189,4 script<tab>Queue<tab>123,{ // Check party size getpartymember(getcharid(1)); if($@partymembercount != 2){ // If the party is not of size 2 close; } // Put them in the queue set @result, callfunc("push", 1, 1, 0, 0); if(@result == 0){ mes "Your party has entered the queue"; } close; } For getting people from the queue, still event #1 while(true){ while(callfunc("pull", 1, 1, 2, 1)) sleep 100; // Keep pulling untill we don't have an error set .@queue_size, $@queue_size; copyarray .@queue[0], $@queue[0], .@queue_size; // We now have AID of 2 people who are in the same party // in the array .@queue (.@queue[0] and .@queue[1]) // Now we could warp them for(set .@i, 0; .@i < .@queue_size; set .@i, .@i + 1){ if(attachrid(.@queue[.@i])){ warp "Izlude", 0, 0; } } }
  2. @brunoshp You must check if the party has a size of 2. Register a party for event #4: callfunc("push", 1, 4, 1, 0); Then you can get the next waiting party members' AID: callfunc("pull", 2, 4, 2, 1);
  3. The link at the top works fine for me, it's hosted by the board.
  4. plankt

    Refine edit

    Edit: To change the "advanced_refiner.txt" in merchants folder, just change the red part to the item id you want:
  5. Try to set the script onEquip instead, it's the second item script field. {},{summon "I'm so evil!",1272,120000,"summonpls::On" + getcharid(0);},{getmapxy .@map$, .@x, .@y, 0; killmonster .@map$,"summonpls::On"+getcharid(0);}
  6. Tutorials: http://www.mysqltuto...l-tutorial.aspx Add a table: http://www.mysqltuto...ibe-tables.aspx CREATE TABLE troll ( id int(11) NOT NULL, name varchar(50) NOT NULL, ); Add a value: http://www.mysqltuto...-statement.aspx INSERT troll (id, name) VALUES (1, 'Troll facé'); Get the value: http://www.mysqltuto...query-data.aspx SELECT name FROM troll WHERE id = 1 You will use query_sql with the emulator: http://rathena.org/wiki/Query_sql
  7. or this (if you want to restrict it to a certain map) -<tab>script<tab>Sample<tab>-1,{ OnPCDieEvent: getmapxy( .@map$, .@x, .@y, 0 ); if( .@map$ == "mapname" && countitem(607) ){ makeitem 607, countitem(607), .@map$, .@x, .@y; delitem 607, countitem(607); } end; }
  8. The error itself in english: Warning. Overflow detected when using addition on the two values, 2147483647 and 21474836. As Wikipedia explains overflow: Arithmetic overflow, a condition that occurs when a calculation produces a result that is greater than what a given register can store or represent With the first value being the greatest positive value a signed integer can store, the result of the addition is greater then what a signed integer can store. My guess is that when the script calculates the interest, it doesn't check if the value will overflow or not. I don't remember how the emulator works with overflowing values, but do you get a negative bank value if you deposit more money?
  9. Seems like a primitive way to detect clickbots, what if they just choose another option to click? Even a kiddie would test another option For the "won XX times do this", check out this part and learn about *if *else (in combination "else if"). if (winRPS<5) {
  10. plankt

    script error

    First of, the variables are a bit messed up. 1) You can't use the same variable for both iterating and holding the array data like this. Use the variables actually set by *getpartymember() 2) You use $@members as a static var? The party could have everything from 1 to 12 members. *getpartymember sets $@partymembercount, use that. You use *getpartymember(... , 1) but you don't use the cid in *isloggedin(aid, cid). So technically the player can have 2 characters from the same account and be offline on one of them and still register as online. You can rewrite the for loop to reduce the code: for(set .@i, 0; .@i < $@partymembercount && isloggedin($@partymemberaid[.@i], $@partymembercid[.@i]); set .@i, .@i+1){ } if(.@i < $@partymembercount){ mes "not enough members"; close; }
  11. I have always found the pvp part of RO to be a lot of fun (not to mention pk ), and would like to hear what maps you love to pvp on, or have had the most fun pvping on. It would also be fun to hear what kind of pvp you had on the map (or wish you had). There's two pvp maps I find better then the others: The first is 'pvp_n_1-5'. I like the open and small space, you have to really back up yourself if you attack instead of running away around corners. I haven't really played that much battleground maps but I really like the look and feel of 'bat_b01', was playing capture the flag on that one and it could be really intense on the last turn-in, especially if your team was the one losing ^^ Let's hear what you think!
  12. File Name: [AI] Mobspawn File Submitter: plankt File Submitted: 26 Dec 2011 File Category: Games, Events, Quests [AI] Monster Invasion Event The monster invasion which will change difficulty depending on how well the players are doing! Description: This script will allow the users to go through a monster invasion event in three stages, helping a poor Banquet Houseman who can't finish his job. The monsters spawned are first determined by the level of the character, and then adjusted depending on how difficult it was for him/her. The player has 10 minutes to clear the three stages. If the player runs out of time, the HP is decreased for the spawned monsters, if the player finishes it in under 5 minutes, the HP is increased for the spawned monsters. If the player dies a lot of HP during the event, the damage is decreased for the spawned monsters and likewise if the player don't get hurt that much, the damage is increased. It will search for monsters in the table `mob_db` so if you don't want it to find custom mobs, add them to `mob_db2`. It will only find monsters who match these criteria: Attack is above 1 and matches the difficulty HP is above 1 and matches the difficulty DEF and MDEF is below the users level The monster can move and attack Requirements: This script uses the queue system found here. You need to download and add it. You need to set up the config at the top of the script. Settings in the script: Name of NPC Which queue number it should have (leave this as 1 if you're unsure) What map the event should use, make sure it's an empty map Where the player enters the map If donators/GMs should have priority in the queue system Prize: The script will look up the 100 rarest items owned by players on your server and give one of those. It determines the rarity by how many is owned overall by the players. Click here to download this file
  13. I'm guessing you want the Orb to be usable? One interesting idea: Set the Orb as usable (type 11 if you don't want it to disappear directly). On use you bring up a menu with equipment that are slotable When an item is selected, you remove that item (and the orb if type is 11) and *getitem2 it with the orb in slot 2 Not sure if usable items can be slotted and have OnEquip bonuses. If not, just make 2 items. One for using and one for the slot.
  14. *getguildmasterid(<guild id>) - This function will return the character ID number of the guild master of the guild specified by the ID. *getcharid(<type>); - This function will return an unique ID of the invoking character; 0 for character id and 2 for guild id When combined: if(getcharid(0) == getguildmasterid(getcharid(2)){ // Give guildmaster buffs here }
  15. Note that there are many ways to do this and I haven't worked anything with cards before so this could be far from the most efficient way. There are a total of 52 cards in a deck, an integer can at most store 32 different bits so you can ultimately get away with using only 2 integers for each hand (or table). The first integer could hold the 26 black cards and the second integer the 26 red cards. This however is just a storage solution. When you calculate the hands, you can just OR (you can also XOR if you only play with 1 deck) the tables two variables with the hands two variables to combine them when matching. You then check for combinations, starting with the highest score one and going down. Example: set .@black, .@tableblack | .@handblack; Make sure that you set high card, both on the hand and on the rest. Say they both had pair of 10, but the high card was Ace vs 2. I'll give an example of matching Three of a kind using two different approaches: First some info on how we store the cards in the variables. 1) Counting amount of hits, counting Ace as 13th bit, 1 as first bit for(set .@i, 12; .@i >= 0; set .@i, .@i-1){ set .@j, .@i+13; if( ((.@black >> .@i) & 1) + ((.@black >> .@j) & 1) + ((.@red >> .@i) & 1) + ((.@red >> .@j) & 1) == 3 ){ break; } } set .@i, .@i+1; if(.@i != 0) mes "We have a match for card value " + .@i; 2) Using some bitwise operands and a karnaughdiagram: S is Spades, C is Clubs, H is Hearts and D is Diamonds First expression: S & C & H | S & C & D | S & H & D | C & H & D Optimising: S & ( C & H | C & D | H & D ) | C & H & D S & ( C & ( H | D ) | H & D ) | C & H & D HD = H & D Result: S & ( C & ( H | D ) | HD ) | C & HD Which gives us the code without loops: // This part is put before all matching set .@S, (.@black & 8191); set .@C, (.@black & 67100672); set .@H, (.@red & 8191); set .@D, (.@red & 67100672); set .@HD, .@H & .@D; // this is the match for three of a kind set .@R, .@S & ( .@C & ( .@H | .@D ) | .@HD ) | .@C & .@HD; Then after that you can check the highest bit set with a trick found in Hacker's Delight: set .@R, .@R | (.@R >> 1); set .@R, .@R | (.@R >> 2); set .@R, .@R | (.@R >> 4); set .@R, .@R | (.@R >> 8); set .@R, .@R | (.@R >> 16); set .@R, .@R - (.@R >> 1); if(.@R != 0) mes "We have a match for card value " + .@R; After we have found a match with one of the two methods, you can get the high card easily by excluding the match from the hand by: Merging the four colors Excluding the match with XOR Checking highest bit set Note that you won't know the color by this, so if their high cards match you will have to check which color the user has on it's high card.
  16. Post it in the script request forum and a member might take the time to modify it.
  17. Are you sure that you have tabbed the header? Replace <tab> with an actual tab: prontera,151,175,5<tab>script<tab>VoteForPoints<tab>89,{ Do you get any error messages?
  18. You could do something like this check item id remove the cards if(user has an orb){ remove the item remove the orb give the item with the orb attached }
  19. Depends on how it's stored, usually a NPC is included when you add a voting system like this. Otherwise, check if you have a table in the database containing these points. Then you can access that with "*query_sql()"
  20. You need to keep track of OnPCLogoutEvent and OnPCDieEvent. When they occur, you want to bring another player in. Another way to do it is to check if the map is always empty. If it is, bring another player in. Make sure to check OnPCLoginEvent so that they don't log in to the same map tho. You could warp them away if they log in to an event.
  21. On the OnPCLogoutEvent, you need to change the if(getgmlevel()==XX) end; To if(getgmlevel()!=XX) end; I'd probably redo it a bit to this: http://upaste.me/96e950826f7e686 EDIT @Mysterious: Don't forget to add "end;" after OnPCLoginEvent, to prevent it from going to OnPCLogoutEvent.
  22. Currently, the player can only queue for 1 event at a time. You can however link those 3 events together and let the player sign for all 3 at the same time. When a player is pulled, he is removed from all queues. Working on an update which will let the user be queued for several different events at the same time. He will still be removed from all queues when pulled, this is to not mess up the scripts which holds the AID. Imagine two of them going bananas when a missing player is warped here and there. So it will be first come, first served.
  23. plankt

    Help..

    @Emistry: The chances are actually 1%, 2% and 7% for your code. The else if makes sure that lower numbers are already counted for. For 1%, 3% and 10%, you should set them to "< 1", "< 4" and "< 14".
  24. New version 1.02! Did some minor optimizations and commented better for linked lists. I decided to stick with getgmlevel since it's a better way to sort influential people out then groupid.
×
×
  • Create New...