Jump to content

GmOcean

Community Contributors
  • Content Count

    371
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by GmOcean

  1. Well, for starters, your NPC's name is too long. Not that it'd have much affect to your script. Second, are you sure you have that item in your inventory? If yes, then are you able to properly create the instance? If not you need to fix that problem first, by checking against the other results instead of just 0. (-1,-2,etc..) If yes, are you able to see this dialogue of the npc. If not, you need to attach that NPC to the instance, or specify the instance ID. mes "^CC33CCSeems like^000000 ^008800Antonio^000000 ^CC33CCis waiting for you, Watch out for those stubborn^000000 ^008800Minions^000000^CC33CC!^000000 ^CC33CCand^000000 ^008800BEWARE^000000^CC33CC....^000000"; All in all, I'd recommend, combining your warper npc with the first npc. Multiple NPCs that deal with activation and creation of an instance makes things more complicated then they need to be.
  2. Okay, find this in your script: set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid);for(set .@j,0; .@j<.@size; set .@j,.@j+1) { if (.Options&8 && !(.Options&4)) { set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a"); if (getd(".@ip_"+.@i+"_"+.@ip$)) continue; setd ".@ip_"+.@i+"_"+.@ip$,1; } Firstly, add another query to obtain the mac address based on the player's account ID, after it checks for .options&8 query_sql("SELECT `mac_address` FROM `table_name` WHERE `account_id`='"+.@aid[.@j]+"'",.@mac); You'll have to edit that query to match how it's stored in your sql db. Then replace this line: set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a"); with this: set .@ip$, .@mac$[0]; That should be all that's needed. Should look something like this when you're done: set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid);for(set .@j,0; .@j<.@size; set .@j,.@j+1) { if (.Options&8 && !(.Options&4)) { query_sql("SELECT `mac_address` FROM `table_name` WHERE `account_id`='"+.@aid[.@j]+"'",.@mac$); set .@ip$, .@mac$[0]; if (getd(".@ip_"+.@i+"_"+.@ip$)) continue; setd ".@ip_"+.@i+"_"+.@ip$,1; } That should be it really.
  3. That depends on what Harmony does with the MacAddress, if it doesn't store the mac address anywhere, then I'm not sure where to begin. However, if it stores the MacAddress into a sql table, then you can easily just grab it using query_sql command.
  4. This looks absolutely amazing. I'm loving the palette editor you have here, it looks to be far more advanced then the one in your grf editor. At this rate, you'll have made an editor for everything RO related in no time. So glad to be in the RO scene at this time. Where were these tools 7 years ago :/
  5. Updated~!! Sorry, this took so long. This was quite a long post, so long I hit it's limit. At any rate, first advanced script uploaded. Disguise Event Script - Compeleted (2 Parts)
  6. You can use this command: changebase <job ID number>; However, if it's not used in an item, I believe the effects will be loss upon using SkillPoints, StatPoints, Level up or map change. (This hasn't been tested).
  7. The client can handle 30k players, however it will lag if the PC isn't powerful enough. When RO was free to play during it's Open-Beta phase, there were 3 servers, Chaos, Loki and Sakray. Each server had 30k-45k players on at a time. Then, when p2p came around, it dropped to numbers 10x less, resulting in each server only having 3-6k on at a time, 6k during WoE, 3k on average. But yeah, back then PC's were crappy, just walking through Prontera (where all the vendors were) would lag you rediculously like 1-3second lag every step, if you even managed to make a step through that crowded place lol.
  8. How would I go about adding support for string constants? I know that in script.c there is this code block, which deals with the creation of constants, which is called every time the server starts up. void script_set_constant(const char* name, int value, bool isparameter) { int n = script->add_str(name); if( script->str_data[n].type == C_NOP ) {// new script->str_data[n].type = isparameter ? C_PARAM : C_INT; script->str_data[n].val = value; } else if( script->str_data[n].type == C_PARAM || script->str_data[n].type == C_INT ) {// existing parameter or constant ShowError("script_set_constant: Attempted to overwrite existing %s '%s' (old value=%d, new value=%d).n", ( script->str_data[n].type == C_PARAM ) ? "parameter" : "constant", name, script->str_data[n].val, value); } else {// existing name ShowError("script_set_constant: Invalid name for %s '%s' (already defined as %s).n", isparameter ? "parameter" : "constant", name, script->op2name(script->str_data[n].type)); }} Going off of this, I'd need to edit 3 things as far as I can tell. The first being str_data_struct in script.h // String buffer structures.// str_data stores string informationstruct str_data_struct { enum c_op type; int str; int backpatch; int label; bool (*func)(struct script_state *st); int val; int next;}; I'm assuming I need to add a const char *string in there, but I haven't been able to get that to work. Then second, i'd need to modify this in script.c /*========================================== * Reading constant databases * const.txt *------------------------------------------*/void read_constdb(void) { FILE *fp; char line[1024],name[1024],val[1024]; int type; sprintf(line, "%s/const.txt", map->db_path); fp=fopen(line, "r"); if(fp==NULL) { ShowError("can't read %sn", line); return ; } while (fgets(line, sizeof(line), fp)) { if (line[0] == '/' && line[1] == '/') continue; type = 0; if (sscanf(line, "%1023[A-Za-z0-9_],%1023[-0-9xXA-Fa-f],%d", name, val, &type) >=2 || sscanf(line, "%1023[A-Za-z0-9_] %1023[-0-9xXA-Fa-f] %d", name, val, &type) >=2 ) { script->set_constant(name, (int)strtol(val, NULL, 0), (bool)type); } } fclose(fp);} More specifically: if (sscanf(line, "%1023[A-Za-z0-9_],%1023[-0-9xXA-Fa-f],%d", name, val, &type) >=2 || sscanf(line, "%1023[A-Za-z0-9_] %1023[-0-9xXA-Fa-f] %d", name, val, &type) >=2 ) { script->set_constant(name, (int)strtol(val, NULL, 0), (bool)type); } to represent the changes of having " before and after the value, so that it's seen as a string rather than an integer. Then finally, editing script_set_constant in script.c so that, it properly stores the string value instead of an int. But, I have no idea where to even begin besides this. I mean, I could be completely wrong with what I think needs to be modified, but in theory it should be possible, since we're already capable of reading strings in other dbs. This one shouldn't be any different if you break it down, it's just matter of how the src handles it :/
  9. What you're giving as an example is actually almost nothing. You're missing the bigger issue regarding that example. The PC itself, would be able to handle that and probably 100x that easily, the issue would lie with the bandwidth not the computer's computational abilities. Truthfully, the computer would have been able to process all of that information in about 0.3-1seconds time. The only visual lag you'd see would be from the time it takes the information to be sent to the end user via internet connection. Which is where the real root of the problem comes to play. The sever, with all it's bandwidth can only send out so much at a time, however in the end it's the connection that the user has to the server that will serve as the main variable here. Other's with a fast connection, higher ping, and faster computer, will receive that update anywhere from 10-200milliseconds before someone who would have a mid-level consumer PC back then. This all holds true with current mmorpgs. The server can only do so much, after that it's the reliability of the end user. Which is why people talk about having 60fps and 80ping all the time. Because it's not the server that's stressing, but rather your personal comp. Main reason being, the server doesn't have to run any 3d programs which take up a lot of memory, it just has to run a few calculations, which is way easier to do. Just like how you could copy your whole ragnarok folder, and paste it somewhere, this could take anywhere from 1second - 5mins on average. Now, thats about 2-4gigs of physical memory it had to copy over. Now let's say the physical memory needed for the server to maintain all actions of player to be 10KBs at the highest peak, which is a lot. That's still 10,000x less memory needed. In the end, you have to remember not all 30,000 of those players are doing stuff. Heck most of them could have been merchants afk.
  10. Umm, in your script, you're starting each label with this command next; you need to remove those. Example: continuar:next;if(strcharinfo(0) == getguildmaster(.@guild))goto cadastro;query_sql "SELECT `id_guild`,`quant_menber_re`,`quant_menber_max`,`lider`,`name_guild` FROM `cadastro_pack_guild` WHERE `id_guild`='" +.@guild+"'",.@id_guild,.@Quant_RE,.@Quant_Max,.@LiderG$,.@N_Guild$;if(!getarraysize(.@id_guild) || .@id_guild == 0){goto Nocadastro; Remove the next; continuar:if(strcharinfo(0) == getguildmaster(.@guild))goto cadastro;query_sql "SELECT `id_guild`,`quant_menber_re`,`quant_menber_max`,`lider`,`name_guild` FROM `cadastro_pack_guild` WHERE `id_guild`='" +.@guild+"'",.@id_guild,.@Quant_RE,.@Quant_Max,.@LiderG$,.@N_Guild$;if(!getarraysize(.@id_guild) || .@id_guild == 0){goto Nocadastro; Do this for ALL of your labels. The problem should go away. Edit: Here, I did it for you. prontera,146,164,4 script Pack Guild 65,{set .@conta_id,getcharid(3);set .@guild,getcharid(2);if (.@guild <= 0)goto Noguild;if(BaseLevel < 299 || JobLevel < 149)goto Nolv;if ((Class < 20 && Class == 4001 && Class == 4002 && Class == 4003 && Class == 4004 && Class == 4005 && Class == 4006 && Class == 4007))goto NoClass;if(#pegoupack == 1)goto japegou;if (Weight > 5000)goto Nopeso;query_sql "SELECT `last_mac` FROM `login` WHERE `account_id`='"+.@conta_id+"'",.@mac$;query_sql "SELECT `account_id` FROM `recebeu_packguild` WHERE `mac`='" +.@mac$+"'",.@checkaccount;if(!getarraysize(.@checkaccount)){ goto continuar;}else{ query_sql "SELECT `name_guild`,`name`,`dia`,`mes`,`ano`,`hora`,`mto`,`seg` FROM `recebeu_packguild` WHERE `mac`='" +.@mac$+"'",.@name_guild$,.@name$,.@dia,.@mes,.@ano,.@hora,.@minuto,.@seg; mes "[^FF7F24Pack Guild^000000]"; mes "Você já pegou seu Pack Guild"; mes "Quanto você era do Clã:^FF7F24"+.@name_guild$+"^000000."; mes "Com o Char:^FF7F24"+.@name$+"^000000."; mes "No dia ^FF7F24"+.@dia+"^000000/^FF7F24"+.@mes+"^000000/^FF7F24"+.@ano+"^000000 ás ^FF7F24"+.@hora+"^000000:^FF7F24"+.@minuto+"^000000:^FF7F24"+.@seg+"^000000."; close;}continuar://next;if(strcharinfo(0) == getguildmaster(.@guild))goto cadastro;query_sql "SELECT `id_guild`,`quant_menber_re`,`quant_menber_max`,`lider`,`name_guild` FROM `cadastro_pack_guild` WHERE `id_guild`='" +.@guild+"'",.@id_guild,.@Quant_RE,.@Quant_Max,.@LiderG$,.@N_Guild$;if(!getarraysize(.@id_guild) || .@id_guild == 0){ goto Nocadastro;}else{// next; mes "[^FF7F24Pack Guild^000000]"; mes "Olá Sua Guild já esta cadastrada"; mes "Deseja receber seu pack guild?"; mes "Nome da Guild:"+.@N_Guild$+"."; mes "Membros que já receberam:"+.@Quant_RE+"."; mes "Total Max de Membros:"+.@Quant_Max+"."; mes "Líder:"+.@LiderG$+"."; switch(select(">>Sim:>>Não")) { case 1: mes "Ok receba seu pack guild"; close2; set #pegoupack,1; query_sql "INSERT INTO `recebeu_packguild` (`account_id`,`name`,`name_guild`,`mac`,`dia`,`mes`,`ano`,`hora`,`mto`,`seg`) values ('"+.@conta_id+"','"+strcharinfo(0)+"','"+getguildname(.@guild)+"','"+.@mac$+"','"+gettimestr("%d",21)+"','"+gettimestr("%m",21)+"','"+gettimestr("%Y",21)+"','"+gettimestr("%H",21)+"','"+gettimestr("%M",21)+"','"+gettimestr("%S",21)+"')"; if(.@Quant_Max == 15){ // pack guild de 10 a 15 membros getitem 12032,100; getitem 12030,50; getitem 4195,2; getitem 4411,2; getitem 4198,1; getitem 19021,2; getitem 4047,1; }else{ // pack guild de 15 a 20 membros getitem 12032,100; getitem 12030,50; getitem 4047,1; getitem 19021,2; getitem 4174,1; } end; case 2: next; mes "[^FF7F24Pack Guild^000000]"; mes "Ok volte quando quiser"; close; }}cadastro: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Deseja Cadastra seu clã para pegar o pack guild?"; switch(select(">>Sim:>>Ver pack Guild:>>Não")) { case 1: query_sql "SELECT COUNT(*) FROM`char` WHERE `online`= 1 AND `guild_id`= '"+.@guild+"'",@Cont; set @Cont,@Cont+1; if(@Cont < 10)goto No10Menber; if(@Cont < 15 && @Cont > 10 || @Cont == 15)goto ate15menber; if(@Cont > 15)goto maisde15menber; end; case 2: next; mes "[^FF7F24Pack Guild^000000]"; mes "Pack Guild de 10 à 15 Membros"; mes "Infos"; next; mes "[^FF7F24Pack Guild^000000]"; mes "Pack Guild de 15 à 20 Membros"; mes "Infos"; close; case 3: next; mes "[^FF7F24Pack Guild^000000]"; mes "Ok volte quando quiser"; close; }Noguild: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Você não tem guild para pegar o pack guild"; close;No10Menber: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Seu clã não tem 10 Membros Online ela só tem ^FF7F24"+@Cont+"^000000."; mes "Volte quando tiver no minimo 10 online"; close;japegou: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Você já pegou o pack guild"; close;Nocadastro: //next; mes "[^FF7F24Pack Guild^000000]"; mes "A Guild "" Não está cadastrada para receber o pack guild"; mes "Chame seu Líder aqui e mande-o falar comigo!"; close;Nolv: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Você tem que ter no Minimo Level 300 e JobLv/Base 150 para pegar o Pack Guild!"; close;NoClass: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Você Precisa ser um Transclasse ou um Ninja/Guns/Tk para fala comigo volte quanto estiver na sua ultima classe"; close;Nopeso: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Você deve ter Menos que 5.000 de peso para falar comigo"; close;ate15menber: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Olá Deseja continua e Registrar?"; mes "Nome do Clã "+getguildname(.@guild)+"."; mes "Membros Online do Clã "+@Cont+"."; mes "Membros que já receberam: ""."; mes "Pack Guild Liberado a: 15 Membros"; switch(select(">>Sim:>>Não")) { case 1: next; mes "[^FF7F24Pack Guild^000000]"; mes "Ok Guild cadastrada Pode Chama Todos os membros para pegar o pack guild!"; close2; // pack de menos de 15 membros getitem 12032,100; getitem 12030,50; getitem 4195,2; getitem 4411,2; getitem 4198,1; getitem 19021,2; getitem 4047,1; getitem 5325,1; set #pegoupack,1; query_sql "INSERT INTO `recebeu_packguild` (`account_id`,`name`,`name_guild`,`mac`,`dia`,`mes`,`ano`,`hora`,`mto`,`seg`) values ('"+.@conta_id+"','"+strcharinfo(0)+"','"+getguildname(.@guild)+"','"+.@mac$+"','"+gettimestr("%d",21)+"','"+gettimestr("%m",21)+"','"+gettimestr("%Y",21)+"','"+gettimestr("%H",21)+"','"+gettimestr("%M",21)+"','"+gettimestr("%S",21)+"')"; query_sql "INSERT INTO `cadastro_pack_guild` (`account_id_lider`,`lider`,`name_guild`,`id_guild`,`quant_menber_re`,`quant_menber_max`,`dia`,`mes`,`ano`,`hora`,`mto`,`seg`) values ('"+.@conta_id+"','"+strcharinfo(0)+"','"+getguildname(.@guild)+"','"+.@guild+"','1','15','"+gettimestr("%d",21)+"','"+gettimestr("%m",21)+"','"+gettimestr("%Y",21)+"','"+gettimestr("%H",21)+"','"+gettimestr("%M",21)+"','"+gettimestr("%S",21)+"')"; end; case 2: next; mes "[^FF7F24Pack Guild^000000]"; mes "Ok volte quando quiser"; close; }maisde15menber: //next; mes "[^FF7F24Pack Guild^000000]"; mes "Olá Deseja continua e Registrar?"; mes "Nome do Clã "+getguildname(.@guild)+"."; mes "Membros Online do Clã "+@Cont+"."; mes "Membros que já receberam: ""."; mes "Pack Guild Liberado a: 20 Membros"; switch(select(">>Sim:>>Não")) { case 1: next; mes "[^FF7F24Pack Guild^000000]"; mes "Ok Guild cadastrada Pode Chama Todos os membros para pegar o pack guild!"; close2; // pack de mais de 15 membros getitem 12032,100; getitem 12030,50; getitem 14232,2; getitem 4047,1; getitem 19021,2; getitem 4174,1; getitem 5325,1; set #pegoupack,1; query_sql "INSERT INTO `recebeu_packguild` (`account_id`,`name`,`name_guild`,`mac`,`dia`,`mes`,`ano`,`hora`,`mto`,`seg`) values ('"+.@conta_id+"','"+strcharinfo(0)+"','"+getguildname(.@guild)+"','"+.@mac$+"','"+gettimestr("%d",21)+"','"+gettimestr("%m",21)+"','"+gettimestr("%Y",21)+"','"+gettimestr("%H",21)+"','"+gettimestr("%M",21)+"','"+gettimestr("%S",21)+"')"; query_sql "INSERT INTO `cadastro_pack_guild` (`account_id_lider`,`lider`,`name_guild`,`id_guild`,`quant_menber_re`,`quant_menber_max`,`dia`,`mes`,`ano`,`hora`,`mto`,`seg`) values ('"+.@conta_id+"','"+strcharinfo(0)+"','"+getguildname(.@guild)+"','"+.@guild+"','1','20','"+gettimestr("%d",21)+"','"+gettimestr("%m",21)+"','"+gettimestr("%Y",21)+"','"+gettimestr("%H",21)+"','"+gettimestr("%M",21)+"','"+gettimestr("%S",21)+"')"; end; case 2: next; mes "[^FF7F24Pack Guild^000000]"; mes "Ok volte quando quiser"; close; }}
  11. Answer 1: On the OnEquip Section: if (Sex) { unequip(<equip_slot>); } For equip_slots look here. Answer 2: On the Script Section: if (checkmount()) { setmount "MOUNT_NONE" }; Answer 3: On the Script Section: if (Sex) { //Healing Bonus for Males } else { //Cast blessing for females } All possible to do. Also, for #1, you can just set the item to only be equipable for females or males: item_db: (// Items Database///****************************************************************************** ************* Entry structure ************************************************ ******************************************************************************{ // =================== Mandatory fields =============================== Id: ID (int) AegisName: "Aegis_Name" (string) Name: "Item Name" (string) // =================== Optional fields ================================ Type: Item Type (int, defaults to 3 = etc item) Buy: Buy Price (int, defaults to Sell * 2) Sell: Sell Price (int, defaults to Buy / 2) Weight: Item Weight (int, defaults to 0) Atk: Attack (int, defaults to 0) Matk: Magical Attack (int, defaults to 0, ignored in pre-re) Def: Defense (int, defaults to 0) Range: Attack Range (int, defaults to 0) Slots: Slots (int, defaults to 0) Job: Job mask (int, defaults to all jobs = 0xFFFFFFFF) Upper: Upper mask (int, defaults to any = 0x3f) Gender: Gender (int, defaults to both = 2) Loc: Equip location (int, required value for equipment) WeaponLv: Weapon Level (int, defaults to 0) EquipLv: Equip required level (int, defaults to 0) EquipLv: [min, max] (alternative syntax with min / max level) Refine: Refineable (boolean, defaults to true) View: View ID (int, defaults to 0) BindOnEquip: true/false (boolean, defaults to false) BuyingStore: true/false (boolean, defaults to false) Delay: Delay to use item (int, defaults to 0) Trade: { (defaults to no restrictions) override: GroupID (int, defaults to 100) nodrop: true/false (boolean, defaults to false) notrade: true/false (boolean, defaults to false) partneroverride: true/false (boolean, defaults to false) noselltonpc: true/false (boolean, defaults to false) nocart: true/false (boolean, defaults to false) nostorage: true/false (boolean, defaults to false) nogstorage: true/false (boolean, defaults to false) nomail: true/false (boolean, defaults to false) noauction: true/false (boolean, defaults to false) } Nouse: { (defaults to no restrictions) override: GroupID (int, defaults to 100) sitting: true/false (boolean, defaults to false) } Stack: [amount, type] (int, defaults to 0) Sprite: SpriteID (int, defaults to 0) Script: <" Script (it can be multi-line) "> OnEquipScript: <" OnEquip Script (can also be multi-line) "> OnUnequipScript: <" OnUnequip Script (can also be multi-line) ">},******************************************************************************/ If you do it at the actual item, then you wouldn't need to check if the wearer is female or not, since they'd be the only ones able to use it.
  12. You could use bindatcmd to do this: bindatcmd "command","<NPC object name>::<event label>"{,<group level>,<group level char>,<log>}; Here's a version that does what you want for the original @spawn command. It limits it's use for GMs who's groupid() is 3 -> 98. However, if you're GM lvl 99, then you can use @spawn freely like normal. Additionally, if you're groupid() 0->2, then you can't use it at all. - script spawn -1,{OnInit:// Spawn IDssetarray .mobid[0],1511,1647,1785,1630,1039,1874,1272,1719,1046,1389,1112,1115, 1418,1871,1252,1768,1086,1885,1649,1651,1832,1492,1734,1251, 1779,1688,1646,1373,1147,1059,1150,1087,1190,1038,1157,1159, 1623,1650,1583,1708,1312,1751,1648,1658;for (.@i = 0; .@i < getarraysize(.mobid); .@s++) { if (getmonsterinfo(.mobid[.@i],0) == "" || getmonsterinfo(.mobid[.@i],0) == "null") { debugmes strnpcinfo(3) +": Mob ID ["+ .mobid[.@i] +"] is not a valid ID."; deletearray .mobid[.@i],1; } else { .spawn_menu$ = .spawn_menu$ +"- "+ getmonsterinfo(.mobid[.@i],0) + ((.mobid[.@i+1] == 0)?"":":"); }}bindatcmd "spawn", strnpcinfo(3)+"::OnSpawn";end;OnSpawn:if (getgroupid() < 2) { end; }if (getgroupid() >= 3 && getgroupid() < 99) { mes "Select one monster to spawn."; next; .@select = select(.spawn_menu$) - 1; close2; atcommand "@spawn "+ .mobid[.@select] +" 1";} else { atcommand "@spawn "+ .@atcmd_parameters$[0] +" "+ .@atcmd_parameters$[1];}end; Since, you were making them only able to spawn 1 of those monsters, I got rid of that array, and just made it spawn 1 through the command itself.
  13. Well, you can try this: - script spawn -1,{OnWhisperGlobal: if (getgroupid() < 2) end; if (@whispervar0$ == "mvp") { mes "Select one:"; next; .@m = select(.smenu$) - 1; close2; atcommand "@spawn "+ .mobid[.@m] +" "+ .mobam[.@m]; }end;OnInit:// Spawn IDsetarray .mobid[0],1511,1647,1785,1630,1039,1874,1272,1719,1046,1389,1112,1115,1418,1871,1252,1768,1086,1885,1649,1651,1832,1492,1734,1251,1779,1688,1646,1373,1147,1059,1150,1087,1190,1038,1157,1159,1623,1650,1583,1708,1312,1751,1648,1658;// Spawn amountsetarray .mobam[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;set .smenu$,"";for(set .@s,0; .@s < getarraysize(.mobid); set .@s,.@s + 1) { // Skips an Monster if it does not exist in the db if (getmonsterinfo(.mobid[.@s],0) == "" || getmonsterinfo(.mobid[.@s],0) == "null") { debugmes .n$ + ": Mob ID " + .mobid[.@s] + " is not a valid ID."; deletearray .mobid[.@s],1; deletearray .mobam[.@s],1; deletearray .mobze[.@s],1; continue; } // else adding it to the menu set .smenu$,.smenu$ + "- "+getmonsterinfo(.mobid[.@s],0) + ( (.mobid[.@s+1] == 0)?"":":");}end;} But honestly, I don't think Hercules has that anymore.
  14. Update ~!! Finished migrating all the scripts to my blog. I'll continue to update this topic with other scripts, but the guides will be located at my blog.
  15. When checking for the monster, you also need to put it's name in "quotation" marks. Here is an example. Just talk to the npc near @go 0. And then walk down in prontera, you'll see a row of barricades, and if you try to pass them there is a hidden wall like 2 cells down. This was done because you can't place the barricades ON the wall. If you do so, they can't be killed. prontera,155,180,4 script HiddenWall 123,{setwall "prontera",149,127,14,6,0,"wall_a";for( .@i = 0; .@i < 14; .@i++ ){ monster "prontera",( 149 + .@i ),129, "Santa Wall", 1905, 1, strnpcinfo(0)+"::OnBarricadeA";}end;OnBarricadeA:if( !mobcount("prontera", strnpcinfo(0)+"::OnBarricadeA") ){ delwall "wall_a";}end;}
  16. GmOcean

    *getskillname

    I'll test it in a bit, first a meal @.@; Also, @why player data, I added it only because I was unsure how to obtain a skill name at first, just ended up not removing it xD lastly, I tried using script_pushconststr, however visual c++ 2010 kept telling me the way I was using it was either wrong, or couldn't be called the way you're using it, and was recommending script->push_str. Because the first thing I tried was your example (didn't test with compile) since that was how strcharinfo works (aside from skill name). Edit: Okay, now I feel dumb -.-; What you posted (what I originally had) does indeed work perfectly. I just stupidly forgot to include skill.h into the plugin, so the map-server crashed running a search for that. *sigh* sorry for wasting your time. But thanks for the help.
  17. GmOcean

    *getskillname

    Okay, so I was trying to make this command, when all of a sudden, "map-server crashed". Anyone know where I went wrong with this? BUILDIN(getskillname) { TBL_PC *sd = script->rid2sd(st); uint16 skill_id; int index; if(!sd) return true; skill_id = script_getnum(st,2); if (!(index = skill->get_index(skill_id)) || skill->db[index].name == NULL) { ShowError("script_getskillname: Skill with id %d does not exist in the skill databasen", skill_id); return 0; } script->push_str((st)->stack, C_STR, skill->db[index].name); return true;} My guess is: script->push_str((st)->stack, C_STR, skill->db[index].name); But, I don't know any other way to actually push the name, because skill->get_name(skill_id); is a const char.
  18. Ahh see, this was the part I was missing, the decleration of a session data fake name @.@; I'll try this again.
  19. D: If I had a server, I'd list it!! Fck my slow devloping skills xD
  20. bump~! Anyone wanna try and tackle this, I'm currently 0:8, striking out numerous times :/
  21. if (@whispervar0$ == "mvp") { mes "Select one:"; next; set .@m, select(.smenu$) - 1; } else { close2; atcommand "@spawn " + .mobid[.@m] + " " + .mobam[.@m]; end;} You're telling the script to check if you typed mvp. If you did, it's going to make you choose a menu option. After that, because you have the " else " statement, it's going to skip that and go straight to OnInit: label and and do everything else all over again. Just change the bit of code I copied from there, and change to this: if (@whispervar0$ == "mvp") { mes "Select one:"; next; .@m = select(.smenu$) - 1; close2; atcommand "@spawn "+ .mobid[.@m] +" "+ .mobam[.@m];}end;
  22. @stiflerxx - Like I said, hercules and *athena handle fake names differently. In that diff, they are pulling the fakename as session data, where as hercules stores fakenames as a char. I don't know the proper way to convert it as such so that " dstsd = fakename " in clif_process_WisProcess (I think thats the clif name).
  23. Well I'm not sure how many times this is referenced in char.c, but you can limit the size of new_name in char.h here. However, you'll need to search char.c for every instance of new_name and when ever you see NAME_LENGTH you'd pretty much need to enter the same value. OR define one in mmo.h and use that as the value. #define CHAR_NAME_LENGTH (15 + 1) But, I don't recommend editing char.h or char.c for this fix. The potential dmg far out weighs the gain :/
  24. That would require a far larger edit. First, you need to add this to your mmo.h #define Guild_Name_Length (23 + 1)#define Title_Name_Length (23 + 1)#define Map_Name_Length (23 + 1) Then you'd have to look through each src file and find any reference of: Name_Length and determine if it's being used for either GuildName, MapName or TitleName. If so, then replace it with the respective one above. However, do note, that change Name_Length to 16 will only affect the visual names of maps, not the file name (this is limited to 12).
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.