Jump to content

Bake Mono

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by Bake Mono

  1. @AnnieRuru Appreciate the quick response. While that would technically work, it would face a problem (or at least what I foresee as a problem) calling the OnPCLogoutEvent hundreds of times when it does not need to be called. @darristan While trying the idea, as it's the only option I have now unless a bonus script was available, I did run into this issue, which isn't very good . Adding another thing for it to save/load such as the previous option seems inefficient.
  2. Currently I have a script that when you equip an item, it calls a function which basically resets all your parameters (stats, atk, hit, aspd, etc) to 0/1. However, with the base level being what ever it could be, that adds things like HP, hit, etc. I'm here requesting someone to possibly help me with a "bonus" script that would reduce your base level / job level to 1 when equipped, and like other bonuses, revert it back when unequipped. It would be something like: bonus bBaseLevel, -200; bonus bJobLevel, -70; A couple notes though: 1) If base level was at 100, this would simply bring it down to 1, not 0 or any negative numbers that can't naturally happen 2) If base level was 100, and after equipping this, it becomes 1, unequipping it should not bring it to 200; Simply take away the negative levels, bringing it where it was before. Edit: 3) Upon base level returning, status points shouldn't be returned
  3. I've been thinking of a way to mimic the way the Auction System mails the item / zeny back to the player. I have overlooked the various source files regarding auction and have tried copy pasting + editing parts of them to work with a command that follows the syntax: *mail <charid>,"subject","body",<zeny>,<itemid>; However, everything I've tried has completely and utterly failed. I assume the easiest way would be to manually add the entry into the mail table in the database, however the recipient would only notice this when they relog to see the new mail. With the mail command I hope it would send a real mail, as well as do the normal things mail should do (such as inform the player they have a mail, etc). Is this even possible to do? Edit: Here's a little snippet. Even with it being manually placed in the code (without the script in general, I can't even compile the server due to an error. mail_sendmail(0, "SenderName", 150000, "RecipientName", "Title", "Body of message.", 0, NULL); 1>------ Build started: Project: map-server_sql, Configuration: Release Win32 ------ 1>script.obj : error LNK2001: unresolved external symbol _mail_sendmail 1>..\map-server_sql.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ========== I know enough enough scripting / programming in other languages to understand basic things in C+ however, I am unable to understand this and can't pinpoint what I did wrong / forgot to do to make this work
  4. Could you try explaining what the basis of the event is suppose to be? Without a name, server, or any information aside from a picture, it's hard to discern what type of event that is suppose to be, which makes it near impossible for someone to fulfill your request for the script.
  5. This may seem a bit outdated, but I thought I'd post the solution I seemed to find. You have to declare the mapflag for the map you use the monsters on. At this point, the monsters stopped being aggressive to all players, and only aggressive to the other player.
  6. I was working on a card game (poker) and ran into a slight problem. I started with an array that gave all cards a certain value. The following shows how the values were given. 2, 3, 4, 5 ... King, Ace 1, 2, 4, 8 ... 2048, 4096 No matter what suit they had, a straight (ace high) would have a value of 7,936. This made it easy to determine the hands and who won. However the problem started when ever there were multiple values of some cards. The following hand is an example: Note: 2 cards in hand + 5 on table = 7 cards total Card: 2, 2, 3, 3, 4, 5, 6 Val : 1, 1, 2, 2, 4, 8, 16 Total value of 34 With the total value of 34, it reads it as 32 + 2. So esseitially I can not check for that value, because if someone had a 7 and 3 card, they would have the same value. Is anyone able to think of an alternative to this, or possibly a way that I can use the bit values given to the card to accept and/or search for a pair, two pair, three of a kind, full house, four of a kind? I've been trying to think of alternatives for close to a week and it's just giving me a headache.
  7. I haven't heard of the eRO story, but it seemed like such a popular server. As for Rikimaru's insight, yes, money seekers generally have a more negative than positive effect on things, or so I believe. For complications though, say for example someone offered to buy "xRO" from owner Y for Z dollars/euros/yen/pesos. I could only imagine the risk involved with trusting said person to not double cross you, or attempt to regain control after they've sold it. Since the game is essentially ripped from gravity in a way, I don't believe you can legally file a claim if such a case happened, though I could be wrong. o.o
  8. As a general topic and imo, an interesting thought, has anyone heard of a server of moderate to high popularity changing ownership? Note: Some smaller servers may change, however I am more referring to one that's been around for a while and has a large player base. This could be either the owner selling the server to another party, or simply the owner passing it on to someone for little or no profit. I've yet to hear of something like this happen, however I've only heard tales from the past couple years, if that. If you have, what were some complications that you've seen.. I can only imagine legal issues, contracts to prevent the owner from stealing it back, etc. Though, maybe some did work o.o
  9. That is wonderful! Thank you very much~
  10. Hopefully, I'm able to bump this as it's been quite some time. =x
  11. You might want to double/triple check that. I just tried: pvp_y_2-2,118,132,4 script Runes 403,2,2,{ using proper tabs between 4, script, runes, and 403, and it loaded just fine. When replaced with spaces, it received the same error as you had (as it should) o.o
  12. It could be the forum changing it, but are those spaces or "tabs" in between : 4 and script script and Runes Runes and 403 ? If they are spaces, change it to a tab by hitting the Tab key.
  13. I agree whole-heartidly. First impression blew me away. Then it went beyond just a map and added it to the world map, with inside maps.
  14. I was looking to see if it'd be possible to add in a custom weapon level "5" for some custom weapons on my server. From what I have done below, I tested by changing the weapon level of Angra Manyu to 5. After getting an enriched oridecon, it appeared in the refinement window on my whitesmith. However, when clicked, it did nothing. So far I have done the following in my source code, noted with the comment starting with "// Custom": Here's the snippet from the clif.c file /// Presents a list of weapon items that can be refined [Taken from jAthena] (ZC_NOTIFY_WEAPONITEMLIST). /// 0221 <packet len>.W { <index>.W <name id>.W <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }* void clif_item_refine_list(struct map_session_data *sd) { int i,c; int fd; int skilllv; int wlv; int refine_item[6]; // Custom -- Increased from "int refine_item[5]; nullpo_retv(sd); skilllv = pc_checkskill(sd,WS_WEAPONREFINE); fd=sd->fd; refine_item[0] = -1; refine_item[1] = pc_search_inventory(sd,1010); refine_item[2] = pc_search_inventory(sd,1011); refine_item[3] = refine_item[4] = pc_search_inventory(sd,984); refine_item[5] = pc_search_inventory(sd,7620); // Custom -- Added new line so it uses enriched oridecon WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4); WFIFOW(fd,0)=0x221; for(i=c=0;i<MAX_INVENTORY;i++){ if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].refine < skilllv && sd->status.inventory[i].identify && (wlv=itemdb_wlv(sd->status.inventory[i].nameid)) >=1 && refine_item[wlv]!=-1 && !(sd->status.inventory[i].equip&EQP_ARMS)){ WFIFOW(fd,c*13+ 4)=i+2; WFIFOW(fd,c*13+ 6)=sd->status.inventory[i].nameid; WFIFOB(fd,c*13+ 8)=sd->status.inventory[i].refine; clif_addcards(WFIFOP(fd,c*13+9), &sd->status.inventory[i]); c++; } } WFIFOW(fd,2)=c*13+4; WFIFOSET(fd,WFIFOW(fd,2)); if (c > 0) { sd->menuskill_id = WS_WEAPONREFINE; sd->menuskill_val = skilllv; } } And this is the refine_db.txt // Database for upgrading items. // Stats per level for safe upgrade, Stats per level after safe limit, Safe level limit, Lv.1 %, Lv 2 %, Lv.3%, ect... // Armor defense is done in percentage (ie 70 = .7 def) // Weapons are whole numbers (ie 3 = 3 atk) 70, 4,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, 50, 30, 30, 20, 20, 10, 10, 10, 10, 10, // Armor 2, 3,7, 100,100,100,100,100,100,100, 60, 40, 20, 70, 70, 50, 50, 30, 30, 20, 20, 10, 10, // Lv.1 Weapons 3, 5,6, 100,100,100,100,100,100, 60, 40, 20, 20, 70, 50, 50, 30, 30, 20, 20, 10, 10, 10, // Lv.2 Weapons 5, 8,5, 100,100,100,100,100, 60, 50, 20, 20, 20, 50, 50, 30, 30, 20, 20, 10, 10, 10, 10, // Lv.3 Weapons 7,13,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, 50, 30, 30, 20, 20, 10, 10, 10, 10, 10, // Lv.4 Weapons 10,18,2, 100,100, 80, 60, 60, 20, 20, 15, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // Custom -- Lv.5 Weapons What else should be done, or what file should I look into?
  15. Alright, I'll check that out. Thank you.
  16. Not exactly sure if it's possible, or how, but this is something people have thought of at least once before. Is it possible, when logging in to see: "You are prohibited to log in until ______" or "Account ID blocked by the Game Master Team.(4)", to also list the reason for said ban? I can't seem to find where exactly it states the phrase (aside from the messtrtable.txt), as in the source code where it prints out the physical message. So maybe it'd be possible to query the reason along with the ban date and state of the account and display the reason along with the ban message?
  17. That's just... awesome. I had a feeling it might do something like that (unlike php or normal scripting where you can declare them wherever you want). When I tried, I guess I put it at the top, just not in that exact spot. Thanks for the help everyone.
  18. Thanks for helping guys. But, that comes back to the same problem of saying something is an undeclared identifier (i.e. esc_mes), as well as a couple new errors. Here's a quote of the main code, if it'll help make it easier to see what I'm seeing: /*========================================== * Open shop * data := {<index>.w <amount>.w <value>.l}[count] *------------------------------------------*/ void vending_openvending(struct map_session_data* sd, const char* message, bool flag, const uint8* data, int count) { int i, j; int vending_skill_lvl; nullpo_retv(sd); if( !flag ) // cancelled return; // nothing to do if ( pc_isdead(sd) || !sd->state.prevend || pc_istrading(sd)) return; // can't open vendings lying dead || didn't use via the skill (wpe/hack) || can't have 2 shops at once vending_skill_lvl = pc_checkskill(sd, MC_VENDING); // skill level and cart check if( !vending_skill_lvl || !pc_iscarton(sd) ) { clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } // check number of items in shop if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl ) { // invalid item count clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } // filter out invalid items i = 0; for( j = 0; j < count; j++ ) { short index = *(uint16*)(data + 8*j + 0); short amount = *(uint16*)(data + 8*j + 2); unsigned int value = *(uint32*)(data + 8*j + 4); index -= 2; // offset adjustment (client says that the first cart position is 2) if( index < 0 || index >= MAX_CART // invalid position || pc_cartitem_amount(sd, index, amount) < 0 // invalid item or insufficient quantity //NOTE: official server does not do any of the following checks! || !sd->status.cart[index].identify // unidentified item || sd->status.cart[index].attribute == 1 // broken item || sd->status.cart[index].expire_time // It should not be in the cart but just in case || !itemdb_cantrade(&sd->status.cart[index], pc_isGM(sd), pc_isGM(sd)) ) // untradeable item continue; sd->vending[i].index = index; sd->vending[i].amount = amount; sd->vending[i].value = cap_value(value, 0, (unsigned int)battle_config.vending_max_value); <hidden after problem solved> i++; // item successfully added } if( i != j ) clif_displaymessage (sd->fd, msg_txt(266)); //"Some of your items cannot be vended and were removed from the shop." if( i == 0 ) { // no valid item found clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); // custom reply packet return; } sd->state.prevend = 0; sd->state.vending = true; sd->vender_id = vending_getuid(); sd->vend_num = i; safestrncpy(sd->message, message, MESSAGE_SIZE); pc_stop_walking(sd,1); clif_openvending(sd,sd->bl.id,sd->vending); clif_showvendingboard(&sd->bl,message,0); char esc_mes[MESSAGE_SIZE*2+1]; Sql_EscapeString(mmysql_handle, esc_mes, message); <hidden after problem solved> } /// Checks if an item is being sold in given player's vending. bool vending_search(struct map_session_data* sd, unsigned short nameid) { .... The error message being: </value></amount></index>
  19. How would the syntax follow for that? From what I gathered by looking at other source code, I got the arguments as Sql_EscapeStringLen(handle, variable, variable string being escaped, length) With that, my code now reads: Sql_EscapeStringLen(mmysql_handle, newmes, message, strnlen(message, len)); Sql_Query(mmysql_handle, "INSERT INTO `tableName` (`id`, `char_id`, `char_name`, `column1`, `column2`,) VALUES ('%d', '%d', '%s', '%s', '%s')", sd->vender_id, sd->bl.id, sd->status.name, newmes, mapindex_id2name(sd->mapindex)); When compiling, it spurts out the error (which I can see why) as Now my question is, how would I declare such identifiers, or must I use something already declared?
  20. Sql_Query(mmysql_handle, "INSERT INTO `tableName` (`id`, `char_id`, `char_name`, `column1`, `column2`,) VALUES ('%d', '%d', '%s', '%s', '%s')", sd->vender_id, sd->bl.id, sd->status.name, message, mapindex_id2name(sd->mapindex)); That's essentially the line of code I have in one of my source files. It works great, no errors or anything. However when a player opens a chatroom for example with a name containing quotes ( ' , " ), the map server naturally throws an error because of malformed SQL. What I'm wondering is, how would I add to this to escape the string to prevent any sort of abuse that can come of it? I want to keep the quotes in there, yet protect it from any sort of injection. I'm not too familiar with C#, but I haven't been able to find a somewhat simple way of doing this.
  21. A bulletin board, with a chatroom? prontera,150,150,4 script Bulletin Board 837,{ end; OnInit: waitingroom "Pub Name",20; end; } 1st 'end;' is so nothing happens when people click the NPC The 20 represents the amount of people who can enter the pub.
  22. Good to know Out of the two ways, I was looking for the 2nd way you posted about updating the inventory. It was exactly what I was looking for as I couldn't seem to find where the game recognized if something was equipped. Thanks for the help Brian.
  23. Alright, I'm trying to work on a script that helps manage characters on an account. Part of that, involves resetting the look and unsticking. I got the unsticking part, and resetting the hair color, hair style, and cloth color. However, when resetting the look, it should also unequip everything from the player. Normally this would do something like using " nude; ". But, like when doing it from a control panel, it doesn't work if the character is offline. So I'm trying to figure out where to physically unequip everything from a player in sql. Is anyone able to help or direct me so I can find out?
×
×
  • Create New...