Jump to content


  • Content Count

  • Avg. Content Per Day

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Humble_Bee

  • Rank
    Santa Poring

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. (Note: This issue was solved.) So I was able to trigger pets to perform when I autocast a skill by doing this in skill.cpp: But it is having trouble when I'm not the target already. If I autocast an attack on an enemy (like fire bolt) and set NPC_EMOTION to autocast when fire bolt casts, NPC_EMOTION fails to cast (because fire bolt has it's target set on the enemy). If I autocast something like a heal on myself, NPC_EMOTION works consistently. I'm trying to figure out where the targeting is even coming into this calculation. Perhaps because I'm only using sd instead of pointing the sd to player characters? I also have trouble trying to set NPC_EMOTION as the first attack and having something else autocast off of NPC_EMOTION, because NPC_EMOTION sets my target to myself, which means fire bolt hits me. I have yet to test if this effect happens when trying to autocast fire bolt by causing it to trigger off a self-heal. That will probably be part of my next step. Can anyone point out where my error is that is causing the targeting issues? EDIT (SOLVED): I figured out my problems. AutoSpellOnSkill uses the target of the skill before it- so if you attach it to a self-target skill, it will also target the player (heal+fire bolt will cause fire bolt to hit you). The second part of my problem with the targeting seems to have been linked to NPC_EMOTION being a self skill as well. I tried the code attached to NPC_RANGEATTACK and the code is working like I want it to. After adding Dimik's attack animation as its performance animation client-wise, my Dimik is now happily shooting while I autocast NPC_COMBOATTACK. Just got to figure out why it's also saying it's "I just got fed" quotes and turn that off, and this will be golden.
  2. You were close, and it helped me find the answer. This is huge, because a setup like this will work on finding data for most moves in most areas. I can probably use the following setup to find heal values and other data values like ranged damage buffs to add in to @stats. The trick was for it to look for sc.data (below): All I have to do now is add in what val1 is multiplied by (val1*3+10) and shield reflect will be accurately accounted for when I pull stats when it is on. Obviously, if I do this for other areas, like heal rates, it would probably help to do the output value as a variable (and have the calc far below it in its own section), or at least put more space between each section, because adding a million moves for each stat's calc section would take up a lot of space. Thanks again!
  3. When a player does not have the SC active and this code runs, the mapserver crashes, even with the code we just tried where the game is supposed to check if there is the SC active and if not give it a value of 0. When the player DOES have the SC active, the code generates the appropriate value.
  4. Your code didn't get read by the compiler. The ( ) stopped it. Though even though the below code was read by the compiler successfully, the mapserver still crashed when the power wasn't active, which is weird because the check should check if the move is there or not, and it gives a value to add if it isn't there: I wonder what is causing the mapserver to mess up when this code gives a value properly when the power is active, but doesn't work when a power isn't active. I'll have to do more research into C++ code and the game code.
  5. Your code didn't work, but your explanation of how the variables worked in the sprint setup helped me unlock a lot! I'd say I could kiss you, but I won't do that! Thank you so much!!! Here are some pics of the changes in action, as well as the code it got changed to so that it worked: The items near the bottom of the code that are "//" out are stuff I'm still working on. If it says "Equips + Items" next to it, it means it only includes bonuses read from those, same for atk rate, but atk rate includes 100% base I added in as well. ACMD_FUNC(stats) { unsigned char msize[SZ_ALL][7] = { "Small", "Medium", "Large" }; unsigned char mrace[RC_ALL][11] = { "Formless", "Undead", "Beast", "Plant", "Insect", "Fish", "Demon", "Demi-Human", "Angel", "Dragon", "Player" }; unsigned char melement[ELE_ALL][8] = { "Neutral", "Water", "Earth", "Fire", "Wind", "Poison", "Holy", "Dark", "Ghost", "Undead" }; unsigned char mrweaponelement[ELE_ALL][8] = { "Neutral", "Water", "Earth", "Fire", "Wind", "Poison", "Holy", "Dark", "Ghost", "Undead" }; unsigned char mlweaponelement[ELE_ALL][8] = { "Neutral", "Water", "Earth", "Fire", "Wind", "Poison", "Holy", "Dark", "Ghost", "Undead" }; char xelement[50]; char xrace[50]; char xsize[50]; char rweaponelement[100]; char lweaponelement[100]; char output[CHAT_SIZE_MAX]; int i; struct { const char* format; char details; int value; } output_table[] = { { NULL, 0 }, //Race { NULL, 0 }, //Armor Element { NULL, 0 }, //Size { NULL, 0 }, //Right-Handed Weapon Element { NULL, 0 }, //Left-Handed Weapon Element { "Walk Speed: %d", 0 }, { "HP Regen Rate: %d%%", 0 }, { "SP Regen Rate: %d%%", 0 }, { "Atk Rate: %d%% (Without Skill Bonuses)", 0 }, { "Matk Rate: %d%%", 0 }, { "Physical Def: %d%% (Hard)", 0 }, { "Magic Def: %d%% (Hard)", 0 }, { "Perfect Dodge: %3d%%", 0 }, { "Perfect Hit Bonus: %3d%% (Equips + Items)", 0 }, { "Crit Chance: %3d%%", 0 }, { "Crit Damage Rate: %3d%%", 0 }, { "Crit Def Rate: %3d%%", 0 }, { "Var Cast Bonus: %3d%% (Equips + Items)", 0 }, { "Fixed Cast Bonus: %3d%% (Equips + Items)", 0 }, { "Skill Delay Rate: %3d%%", 0 }, { "Skill SP Use Rate: %3d%%", 0 }, { "Heal Power Bonus: %3d%% (Equips + Items)", 0 }, { "Reflect Bonus (Melee): %3d%% (Equips + Items)", 0 }, { NULL, 0 } }; memset(xrace, '\0', sizeof(xrace)); memset(xelement, '\0', sizeof(xelement)); memset (xsize, '\0', sizeof(xsize)); memset(rweaponelement, '\0', sizeof(rweaponelement)); memset(lweaponelement, '\0', sizeof(lweaponelement)); memset(output, '\0', sizeof(output)); //direct array initialization with variables is not standard C compliant. output_table[0].format = xrace; output_table[1].format = xelement; output_table[2].format = xsize; output_table[3].format = rweaponelement; output_table[4].format = lweaponelement; output_table[5].value = sd->battle_status.speed; output_table[6].value = sd->hprecov_rate; output_table[7].value = sd->sprecov_rate; output_table[8].value = 100 + sd->bonus.atk_rate; output_table[9].value = sd->matk_rate; output_table[10].value = 100-((int)(100 * ((double)(4000 + sd->battle_status.def) / (4000 + sd->battle_status.def * 10)))); output_table[11].value = 100-((int)(100 * ((double)(1000 + sd->battle_status.mdef) / (1000 + sd->battle_status.mdef * 10)))); output_table[12].value = (sd->battle_status.flee2/10 * (sd->flee2_rate))/100; output_table[13].value = sd->bonus.perfect_hit_add; output_table[14].value = (sd->battle_status.cri/10 * (sd->critical_rate))/100; output_table[15].value = 40 + sd->bonus.crit_atk_rate; output_table[16].value = sd->bonus.critical_def; output_table[17].value = -1*(sd->bonus.varcastrate); output_table[18].value = sd->bonus.fixcastrate; output_table[19].value = sd->delayrate; output_table[20].value = sd->dsprate; output_table[21].value = sd->bonus.add_heal_rate; output_table[22].value = sd->bonus.short_weapon_damage_return; // + (sd->sc.data[SC_REFLECTSHIELD]->val1); //sd->subele[ELE_GHOST] //sd->bonus.long_attack_def_rate //sd->bonus.long_attack_atk_rate sprintf(xrace,"Race: %s", mrace[sd->battle_status.race]); sprintf(xelement, "Element: %s (Lv. %u)",melement[sd->battle_status.def_ele],sd->battle_status.ele_lv); sprintf(xsize, "Size: %s", msize[sd->battle_status.size]); sprintf(rweaponelement, "Weapon Element (R): %s", mrweaponelement[sd->battle_status.rhw.ele]); sprintf(lweaponelement, "Weapon Element (L): %s", mlweaponelement[sd->battle_status.lhw.ele]); sprintf(output, msg_txt(sd,53), sd->status.name); // '%s' stats: clif_displaymessage(fd, output); for (i = 0; output_table.format != NULL; i++) { sprintf(output, output_table.format, output_table.value); clif_displaymessage(fd, output); } return 0; } I'm working on an output table for @stats that includes reading from skill data, and I can pull the skill data just fine, but it causes a map crash when the skill is not active (the code below): output_table[22].value = sd->bonus.short_weapon_damage_return + (sd->sc.data[SC_REFLECTSHIELD]->val1); Does anyone know the principle / coding pattern that needs to be used in output tables so that the game will do an "if this is present, do this" check? I tried using if, but the code compiler didn't seem to like it. Thanks!
  6. It should remove all songs that cause a buff, including Assassin Cross of Sunset and Apple of Idun's heal and the others. What I don't think it is does is stop damage songs from causing damage to your homun or other people's homun. Again, note, please test it out first before sending it live if possible, as that way you can see if it causes any bugs on your server. Mess around playing with a homun quite a bit with it, as my bard using a homun (which they normally don't) had some map server crashes, but they may be related to my bard using a homun or to other server issues I might have.
  7. Howdy all. I'm working on updating @stats on my server to show more useful info (I'm not finished with what I want yet, but I'm adding bit by bit). Can someone tell me how I can get this table to pop up the elements, race, and etc instead of numbers? I am able to show my armor element in-game already as a number (Neutral shows as 0, Water shows as 1, etc), but I want it to show a word instead. I think I'm getting close, as the debugger only shows "term does not evaluate to a function taking 1 arguments" as my only error. I just don't know how to finish it. Of course, if you have an easier way so a @stat changes a number variable into a word when it outputs the text in chat, I'm open to that as well. Here is my code: The only line it throws the error I mentioned on is this one: Thanks for anyone familiar with the C++ code!
  8. If you check out the exchanger scripts here, you will probably find your answer:
  9. One of the things I enjoy is implementing custom pet scripts on pets, either current Ragnarok pets or ones that haven't been implemented officially but the sprites exist in-game already. Where would be the best place to start a thread where people can share their custom pet scripts so that everyone can enjoy the bonuses? (By scripts, I mean when a pet is loyal, cordial, etc, it gets such-and-such bonuses.)
  10. Are you talking about how some servers show your elemental resistances in @battlestats or @stats? Because it sounds like that's what you're asking for.
  11. I like your all-in-one script. I'm just trying to figure out how to make it if someone picks a particular slot, they get a particular set of enchants- like slot 4 on a weapon gives a weapon element, slot 3 gives stat buffs, slot 2 gives skill bonus buffs or something. I know it could be simple as make Weapon$ an array with 4 options that each are item arrays, and then it would just be "if slot 4 was selected, use Weapon$ and it's value 4", but I haven't figured out how to do it yet. Otherwise, loving that I can already permanently buff any weapon with any element that I want. Edit: I'm getting a little closer. I copied the Weapon$ array line and made a second one while changing the enchants, and then did an "if / else" statement. When I used the script, the game passed over the first Weapon$ array, which means it's working. Now I just need to find out what variable is attached to each card slot and I should be golden. "If slot 1, use this Weapon$" … "Else If slot 2, use this Weapon$ instead".
  12. I believe this is the answer: Go to your skill.cpp file. Here you will make 2 changes. Change #1 Look for this section of code: Right below it, add: Change #2 Look for this section of code: Right below the #endif, add: Note: Damage songs will still likely hit your homun, because I didn't mess with that. This just gets rid of the buffs and heals from songs. Also, I would try this out on a test server before hitting your live with it. I've been using a homun on a maestro to test stuff, and I'm not sure if the game doesn't like it, or if the changes I'm passing you are causing the issue. What happens for me in my current situation: You will see that you get what you want, but randomly the map crashes at times. This could be a non-issue for you if it is related to me using a bard with a homun pet.
  13. If it's possible, I would love to see a bonus where the pet uses it's special animation (or attack animation) when a move is used. I have some pets that trigger autocast moves, like gargoyle triggering arrow repel. It would be quite fun for the pet to actually look like it's the one firing the arrow repel, even if it's not. Love the work you're doing. If you ever make a video tutorial on how to make new item bonuses, I also would love to see it.
  14. What I care about right now is that I'm adjusting some weapons' matk through bonus scripts- like causing books to give matk to magic using classes- and because the matk isn't listed under the base atk/matk, the heal is not reading it and adding it in. So I would say it's probably the flat heal? The +matk portion at the end of the heal formula.
  15. Look in status.cpp for this: And then switch max health to what you want. I think I've gotten closer to cracking it, but I haven't figured out how the blocklist is setup for mob spawns. On mercs, elementals, and pets, it's probably quite a bit easier (my mercs read my base level and increase stats accordingly when they first spawn). For mob slaves, it probably has something to do with this: My guess is that you have to figure out how the block list is setup so that you can then go from master_id to the master's stats to pull out the max_hp data. I just wish I knew enough about C++ to see what was included in mob_data table. For how I have my mercs set up- that adjust their health to be a little more balanced based on what my base level is- you can see that here: This takes their standard max health, say 2000 at whatever level they might be at, then it subtracts their base level from mine and multiplies it by 200. If I'm lv. 100 and I'm using a lv. 20 merc, it gives the merc a bonus 80*200 HP (+16,000 HP).
  • Create New...

Important Information

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