Jump to content

Seravy

Members
  • Posts

    176
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Seravy

  1. in status.cpp, this is the pre-re formula for base matk : #ifndef RENEWAL unsigned short status_base_matk_min(const struct status_data* status) { return status->int_ + (status->int_ / 7) * (status->int_ / 7); } unsigned short status_base_matk_max(const struct status_data* status) { return status->int_ + (status->int_ / 5) * (status->int_ / 5); } #else So find the renewal version of these functions in the same file and in the BL_PC and default section replace the formulas with the above ones. This way the change is limited to player characters only and won't break your monster matk stats. If you do want everyone to use pre-re including monsters, delete the entire function and remove the ifdef and else lines in the above quote to enable the old pre-re functions.
  2. Seravy

    Success Message

    if (skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY)) { clif_displaymessage(sd->fd, "SUCCESS."); } else {clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);} is what you want then.
  3. Seravy

    Success Message

    What matters, assuming the skill does try to break the equipment by calling skill_break_equip, "150*skillvl" is the chance of success. It'll return true if it did break something and false if it did not. It won't always break something. In addition to that, you also need to display "fail" if you didn't even call the function, like in your example if the monster is the wrong size. But I don't think he asked for that?
  4. Killing Strike AI now works. Let's see the magic! Flaming Petals - This is Fire Bolt with reduced damage, higher SP cost, about double the casting time and no skill delay. Considering Ninja also gets worse matk equipment than mages, this is pretty much unplayable. Casting it once takes more time than throwing 3 kunais for the same damage output (and that's assuming the worst case damage formula for kunai). Unplayable, I have to make it better... Freezing Spear - More of the same. 2 more hits than colt bolt but total damage is still only 840% instead of 1000%, higher casting time (especially considering there is an additional rebalancing coming for the bolts to make them even better), will have to change this skill too. Wind Blade - Again, 900% total damage, but this one comes in 6 hits so considering MDEF, this is overall as good or better than Lighting Bolt. Casting time is not as high as the other two either. This needs less improving but does need some - Ninja isn't a 1st class, so their skills should be slightly better than mages, but worse than wizards. For the AI, these are easy, same as bolt spells. Trivial to implement. Blaze Shield - This is unique. It doesn't work like normal AOE skills - each map tile is limited in the number of hits so if multiple monsters are on the same tile, it won't be effective. Instead of the usual AOE code, triggering it on multiple melee monsters heading towards the caster might work well - but that won't happen much unless we are in tanking mode and this is interruptable so if any monster actually manages to reach and attack, it fails. Sounds like something for ninjas with "uninterruptable cast" equipment only. Even then, it's best used by casting it then kiting the monster through as much tiles as possible - the AI can't do that. I think this should stay human use only. Also, even considering the item cost this is so much faster to cast for dealing much more potential damage than Flaming Petals, it's ridiculous, FP definitely needs buffing. It's sad Gravity's patch doesn't seem to do that. Exploding Dragon - This is basically a Fireball with more damage and casting time - same AI should work except the part that uses it as a quick spell in emergencies. Fireball is 170% damage, this one is 900%. Basically same damage as Flaming Petals but faster and AOE. What is Flaming Petals for, then? (well, ok, this costs an item but still... I think Flame Petals should have similar casting time as this.) Watery Evasion - Quagmire wannabe, but not instant cast, interruptable, actually very slow to cast, useless. Also costs an item and effect is weaker on AGI than Quagmire. I'm going to buff this one for sure. For the AI, probably useless. AGI and DEX reduction was the important part, making it easier to tank the monsters. The AI doesn't use Quagmire to slow movement and run away. Snow Flake Draft - Low AOE, self targeted, single hit, low damage. This is useful for high chance of freezing, effectively a Frost Nova. Except unlike Frost Nova the casting time is too high so it can't be used for crowd control. Another completely useless skill that needs buffing ? Lightning Jolt - This is finally a normal AOE spell but damage is a joke. 350% MATK, really? Even the 1st class Thunderstorm is 800% total although this one seems faster. Fortunately Gravity increased it so I might as well do the same. AI should be same as Thunderstorm, copy-paste, yay. First Wind - 600% MATK but this isn't hitting a proper AOE, instead it hits a line. The problem? The AOE AI targets a tanking player or other stationary point, assuming monsters will likely head towards that point so anything in the AOE, stays inside the AOE. This skill doesn't work like that. Even if the monster does move towards the tank, it might not stay in the narrow line the spell hits. I see no other solution than to code this as if it was a 1x1 AOE and hope all monsters on the tile head towards the same target. It's targeted so it will at least follow the chosen target's movement. Not ideal but playable for the AI at least. There is one more thing to worry about. We have to compare the character's ATK and MATK to decide if we even want to use magic with it at all, or throwing things is better. And the ratio for that depends on how I set up my spells. It will need to be adjusted for servers with official skill configurations.
  5. Seravy

    Success Message

    I don't see the most important "if" anywhere in there. if (skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY)) { clif_displaymessage(sd->fd, "SUCCESS."); } else {clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);} The return value from skill_break_equip tells you if it broke something or not.
  6. Status report : AI for Throw Shuriken, Throw Kunai, Throw Huuma Shuriken, and Flip Tatami works. I changed Flip Tatami to have a cooldown instead of a skill delay, making it still a lot worse than Pneuma but at least playable. Without that modification, disabling the AI code for that skill is strongly recommended. The AI isn't use Throw Zeny - without modding the skill, it's useless anyway. In made it have no delay and no damage reduction on bosses for my server - it's still nowhere near as good as Cart Termination considering this eats like 5 times the zeny but again, at least playable. I'm unsure what to do with the hide and strike skills, they'll likely remain unplayable for the AI no matter what as damage skills. Even if I increase the damage of these skills, I find it hard to come up with a valid reason why are they worth picking instead of throwing something, even less a reason commonly occurring that's worth teaching for the AI. (or using magic, I haven't yet looked at magic at all...). However as a "hide to avoid getting targeted" ability, they might be useful. I see I haven't even made the AI use the thief's Hiding skill. Maybe something like "use if targeted by enemies, only if not in tanking mode, then immediately cancel to regain the ability to fight" could be helpful? Not sure... the problem is, the character the monster targets instead might be even less tanky or more important. Like if the ninja/thief hides and the monster starts attacking the wizard or priest that's really bad. So I think it's best if the AI stays away from these skills. I also see one good use of these for a human player, using a Smokie card to hide then using the Shadow Slash skill to effectively teleport to the next monster and one-shot it. I can see this being faster than walking and using thrown skills but it's not something the AI can or is meant to do. Ninja Aura, Cicada Skin Shedding, Mirror Image : Implemented these as well. Mirror Image : Most wikis seem to say it's useless because it's same effect as Cicada but I think we can use this very well. If the AI is in tanking mode, you don't want to move backwards, that's very important. It also blocks 2 more hits. Unfortunately it has a casting time but it's reasonably low. Also unfortunately it's interruptable, but against normal mobs, they die quickly, giving a chance to recast it before moving to the next monster. Alternately the player can wear "casting is uninterruptable" equipment which allows recasting this while actively tanking mobs. This skill is far better than it looks like at first sight. So this is for AI use in tanking mode while Cicada will be used for other modes only. For a while I was thinking about changing the skill but I'm sure it's playable as is. Killing Strike deals ~20K damage on a max level Ninja, ~50K on Oboro. That is...not impressive. I guess maxhp equipment can even double that but still not anywhere near as good as Asura - and you die. Although, that's better than getting stuck with no SP. On the other hand this actually is easy to make AI rules for. "target hp at least 80% of the expected damage and party has priest -> use, otherwise don't" sounds about right. 20k+ damage for spending a blue gem and some heals isn't such a bad deal. Wait, Ninja Aura costs HP to use? That's crazy, I'm removing that. Seriously, this isn't even as good as half of Blessing, why? Shouldn't make a difference for the AI though, the HP cost isn't enough to really matter for the "normal" use of the skill. But it is annoying before Killing Strike where hp is the main component of the damage output...
  7. Geez, Gravity. https://ragnarok.gamepedia.com/RO_Patch_(2019_Mar._06) Why is it always the classes I want to make AI for? I'm stuck on 1st classes because of the ongoing rebalancing of those and now it's ninjas? Although having seen what Throw Huuma Shuriken does currently, yeah, anything is better than that. So I guess I put my Ninja away for a year now, waiting for this to get into Rathena? Eh, whatever, I can change the casting time and such myself.
  8. Why inventory? Why not if (character variable=0) give item and set character variable to 1? Not sure if the syntax is correct but like this : if (FreeItemGiven==0) { getitem 2500,1; FreeItemGiven = 1; close; } else { mes "You already received your free items!"; close; }
  9. Great, thanks! Just in case someone wants it, might as well drop the npc script for the quest here (the quest database and client entries are in the first post) : prontera,146,167,6 script Rich Girl::richgirlreins 612,{ if (checkquest(30180)==-1) { mes "[Rich Girl]"; mes "Oh, you're walking on your FEET????!!!"; mes "What a commoner... how dare you talk to me like that?"; next; mes "[Rich Girl]"; mes "An advanturer you say?"; mes "All the more reason you should be riding a mount! Not only is it more noble, but faster too!"; mes "The ability to escape quickly might save your life you know?"; next; mes "[Rich Girl]"; mes "I can let you have one... oh, don't worry, our stables have hundreds of these, I don't mind."; mes "Your life is more important!"; next; mes "[Rich Girl]"; mes "Not so fast!"; mes "You have to first prove you are what you claim. This should be easy for a REAL adventurer!"; mes "Go and kill a Soldier Skeleton, 7 Poison Spores, a Myst Case, a Bigfoot, and... let me think..."; next; mes "[Rich Girl]"; mes "Yes, the last one should be a bit harder..."; mes "How does dragon slaying sound? Hey, stop shaking, I don't mean that sort of dragon..."; mes "I'm doing this to save your life you know? I wouldn't send you after something that dangerous!"; mes "So, go and kill a Dragon Fly for me, and return after you killed everything!"; setquest 30180; setquest 30181; close;} else { if ((checkquest(30180,HUNTING)==2) && (checkquest(30181,HUNTING)==2)) { mes "[Rich Girl]"; mes "Amazing, you're a real adventurer indeed!"; mes "As promised, this mount is now yours. Take care, and beware of dragons!"; completequest(30180); completequest(30181); getexp 4000,0; getitem 12622,1; close; } else { mes "[Rich Girl]"; mes "I was looking forward to hearding about your adventures..."; close; } } }
  10. You use it on every character individually, except the one you want to play manually. Good luck and don't forget it's a WIP, you can read the previous posts to get an idea which classes work and which do not.
  11. I'm using 2018-06-20. I don't have a file with that name (or lua or txt) in my data folder nor any file starting with the word "ongoing". GRF editor isn't showing one in any of the GRF files either. Nevermind, it's in the system folder. Thanks for the help, it worked! Unless this is a weird forum bug, first time I see someone using my avatar on a forum. Which reminds me I never bothered to set it on this site... This might get confusing lol... maybe I should use the picture I uploaded there instead? https://anidb.net/perl-bin/animedb.pl?show=character&charid=9879
  12. I tried adding a custom quest. This is my questid2display.txt file : 30180#Proof of Adventurer#SG_FEEL#QUE_NOIMAGE# You have to prove you're an adventurer worthy of receiving a mount. Hunt 7 Poison Spores, a Soldier Skeleton, and a Myst case.# Hunt 7 Poison Spores, a Soldier Skeleton, and a Myst case.# 30181#Proof of Adventurer 2#SG_FEEL#QUE_NOIMAGE# You have to prove you're an adventurer worthy of receiving a mount. Defeat 1 Bigfoot and 1 Dragon Fly.# Hunt 1 Bigfoot, 1 Dragon Fly.# and this is the quest db : 30180,0,1028,1,1077,7,1249,1,0,0,0,0,0,0,0,0,0,"Proof of Aventurer 1" 30181,0,1060,1,1091,1,0,0,0,0,0,0,0,0,0,0,0,"Proof of Aventurer 2" When the character who received these quests logs in the client throws a bunch of quest errors (value is nil for stuff like reward or whatever), so I feel like maybe something is missing and there are more files that need changed to add the quest properly? As is, aside from the errors, the quest shows up as "unknown quest" with no description. Isn't that what the questid2display.txt should specify for the client? btw the entiries were generated using the SDE tool if that matters.
  13. first you need to enable the commands, like all other GM commands. @autopilot to turn it on, if you type it without a parameter it gives you a list of possible parameters. Tanking mode makes the character go to the monster and hit it with short range skills. Skill mode makes the character use damage skills. Support mode does neither but still uses support skills. All modes follow the party leader, so it's strongly recommended for the leader to be the character you are playing. @autopilotsp <sp percentage> to specify the character should use SP items below that much SP. @autosong to specify which song or dance to play. @autoconc enables... I think it was the Concentration skill for Lord Knights or something? The one that lowers DEF and increases ATK or something like that. The feature assumes there are no other players on the server, for example buffing isn't limited to your party members, the priest will try to buff anyone she sees.
  14. I'm experimenting with the Ninja class, never played it before. AI for the magic skills and throw skills probably won't be an issue, they are just DPS skills used at range like most such skills. (though the zeny one seems useless, it'll always cost more than the loot from the monster is worth...) However no idea what to do with the melee skills. Haze Slasher - this hits the enemy then hides. Hiding makes no sense in tanking mode and you can't use this in other modes due to having no range. So probably use this as an "emergency reaction" like safety wall or various quick casting time spells on mages and wizards? I guess 200% isn't really high enough to consider this a DPS skill. Shadow Leap - I'd expect this is for getting close to an enemy when in melee/tanking mode. But you have to be hiding and the only way to do so is the skill we are not using in that mode. So instead it's for moving away from enemies then? Shadow Slash - this is where things go wrong first. This seems to be the main melee DPS skill but you have to hide first. So you'd need to either use the hide skill in tanking mode which breaks the AI if the user intends the Ninja to actually tank, or used in "skill" = dps mode but then the dps mode has to walk the character near the enemy which is something only the tanking mode does. Neither seems good so this would probably go into the "tank+" mode which is basically tanking mode using class specific skills you normally don't want to use, for example on a Monk, Steel Body is exclusive t this mode. Cicada Skin Shed - This one is ugly. It prevents physical damage so you want it in melee/tanking mode, but it also moves you away from the enemy so you don't. I guess use it for the "skill" mode instead to avoid stray incoming attacks? Mirror Image - this has no backwards movement but has a casting time which seems a bad idea to try to cast during combat. Killing Strike - I guess this should follow a similar protocol as Asura Strike (except instead of SP and Fury, check HP, Ninja Aura and Mirror Image)? So basically a "boss only" skill? Edit : Okay, so after trying Throw Shuriken I came to realize using this class for melee is not practical anyway. The skill costs 2 SP so it's basically free and has no (aspd only?) delay and a minimal cost while doing 1x ATK damage plus whatever skill bonus. So it's equivalent to a ranged normal attack. Meanwhile the melee skills do 2x and 5x ATK damage which sounds good but cost a lot of SP and ultimately it's still not as good as Bash. So it's like trying to use Bash with an Archer, even if I could, why would I want to if I'm not tanking either way? I guess it's useful if Shurikens run out and that's about it... So that means : Haze Slasher - this is useless. Cicada already takes care of avoiding damage when using skills from a range and we don't want to hide when tanking. Using melee on a ranged class without the intention to tank is not something that AI needs to be able to do. This automatically makes Shadow Leap and Shadow Slash AI unusable as well. If there are no items left to throw, there is still Throw Huuma Shuriken. Flip Tatami, Cicada Skin Shed - Limit these to the "skill" mode and avoid using them when tanking and it should be fine. ...or not. Just realized Flip Tatami has 3 seconds of cast delay. That's totally useless, a Ninja can't attack from range without using skills and this knocks away melee enemies. I suppose you can use it to tank and never get hurt which is great except Pnemua does the same thing better and what kind of RO party doesn't want a priest?
  15. Now that things actually run at an acceptable speed on my new computer, I tried making a proper branch for this feature : https://github.com/SeravySensei/rathena/tree/Autopilot
  16. Is there a function I can call to check if a specific map tile has a Warp Portal active? I'd like to make the AI automatically enter warps I open so I don't have to move them all manually. If not, are warp portals stored as one of those "skillunit" things on the player who opened them? Nevermind, checking skillunits on all players on the map worked. (I haven't been able to work on RO much recently because I was busy buying a new computer and reinstalling everything. I didn't give up on this, don't worry!)
  17. Seravy

    Custom "Woe"

    Somewhat related, the TE castles seem to drop item 12399 which is a consumable treasure chest with no script that doesn't sell for zeny either. I did a search for the ID number in the npc folder and nothing came up. So it seems the item is entirely useless, but that can't be right? It's a (common) WOE reward item so it has to have some purpose? I smell a missing item script bug... but even RMS shows no script for that item. Any idea what that item is actually for? I don't want to edit it to generate zeny unless I'm 100% sure it's not an important quest material nor has some hardcoded effect handled by source. Even more confusing is the fact the same castles drop the normal, NPC sellable treasure chest item I'm already used to seeing. I tried searching but I only found information about the normal treasure chest item.
  18. Seravy

    Custom "Woe"

    Tried a Yuno castle yesterday evening and found some unexpected differences. First of all the EMP room doesn't have specific spawns. This isn't a problem, I can make one, I just need to use the same code normal castles do. However, EMP rooms don't seem to be "rooms", in fact I'm starting to vaguely remember SE being special in that there are no warps in the castles, the entire thing is connected. The problem with this is obvious, you can walk into the emp room and break it without fighting bosses, and even if I make a boss spawn at the emperium, it might move away and can be lured away as well. So I decided to implement my original "plan B", require killing the monsters to get the castle. This doesn't seem to be overly difficult, I imagine starting the emp break script with "if there are monsters remaining, respawn emp, otherwise continue" is what I need. However... I want it to be limited to boss monsters only, and I want to display the boss monster's name, like "The Dark Lord has revived the Emperium! You must defeat him to gain ownership of this castle!". I'll try to figure out how to do this on my own, will edit this post if I fail or succeed. I also noticed breaking the emperium in SE castles does not kill the monsters. That's unusual, I'll have to change that too. Novice castles... what are those? I tried a google search but found nothing. Is this an official feature? If it's woe for novices only, I don't think I'll bother with it. I've sent a pull request with the fixes when I found the atk/matk problems, so far it's still open 2 full days later so the bug(s) seem to be real. Edit - this is as far as I was able to do it, now I'm stuck : OnEmpSpawn: callsub(Emprespawn); end; Emprespawn: set .@str$, substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); if (mobcount(strnpcinfo(2),"Steward#"+.@str$+"::OnStartArena")) end; if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") setarray .@i[0],87,219; else if (strnpcinfo(2) == "arug_cas02") setarray .@i[0],89,256; else setarray .@i[0],141,293; // Castles 3,4,5 are identical. } else { if (strnpcinfo(2) == "schg_cas02") setarray .@i[0],162,193; else if (strnpcinfo(2) == "schg_cas03") setarray .@i[0],338,202; else setarray .@i[0],120,272; // Castles 1,4,5 are identical. } monster strnpcinfo(2),.@i[0],.@i[1],"Emperium",1288,1,"Steward#"+.@str$+"::OnStartArena"; return; OnStartArena: set .@GID,getcharid(2); set .@region$, (compare(strnpcinfo(4),"arug"))?"Valfreyja":"Nithafjoll"; .@num = getmapunits(BL_MOB,.@array[0]); freeloop(1); // for if the list was too big. for(.@i=0;.@i<getarraysize(.@array);.@i++) getunitdata array[.@i],.@arr2[0]; if (.@arr2[UMOB_MODE] == MD_MVP) { mapannounce .@arr2[??? no UMOB_NAME???] +" revives the Emperium!"; callsub(Emprespawn); end; } freeloop(0); // rest of the emperium break script is here So basically, unless there are bugs in it, all I need is a way to get the monster's name.
  19. According to videos and skill descriptions I found online (checked several sites), the Marine Sphere should move when attacked, but mine does not. Is it like this for everyone, in which case I found a bug, or is it just me?
  20. Incremental update sounds like a great idea - makes it easier for server owners to decide which of the skill updates they do (not) want.
  21. This is in the npc I'm using : if((Class >= 0 && Class <= 4052) || (Class >= 4190 && Class <=4244)){ // Job ID check so only 3rd Class chars can change costume.
  22. Seravy

    Custom "Woe"

    Please read the whole thing before posting any answers, as I kept updating it and figured a lot of things out as I made progress. o_O sorry about all the questions, I wasn't expecting an answer this detailed, just wanted to be sure I don't jump into this and find out I can't do it after wasting a lot of time trying. All scripting, easy, good news, I'll try to get all of it done today then. Managed to make monsters take back castles at chance as well as reduce economy, also commented out the lines that make economy levels drop when emperium is broken as that's now unnecessary functionality. I tried your treasure spawn change but it doesn't work. I want the treasure to spawn at the time I break the emperium, exactly once, and never again, until the monsters retake the castle and I clean it out again. "onClock0001" seems to be "do this at midnight" if I understand correctly, so instead, I need the treasure spawn to be turned into a function, which I can call from where the emperium is broken I believe. I'll update this post when there is more progress, it shouldn't be too hard to figure out the correct syntax for that. Couldn't figure out how to make it a procedure but copying the treasure spawn script as is to where the emperium breaks works. I only need it to be executed then, so it doesn't really need to be a procedure. Also removed the onClock0001 line, that should be enough to disable daily respawns. So this is now also solved. Seems investment only takes effect as part of the treasure spawns. Had to change that as well, to apply when the investment is made, wasn't too hard. Maybe I have some use for the guardians after all - if branches can be used in castles and the guardians spawn, they can help killing those mobs. Nothing spectacular but it's something... better than outright disabling the feature. Looks like the castle can be conquered from monsters when WOE is off anyway, so I removed the activation timer file and added nothing to replace it. Somewhat confused on the monster level thing. Do I need to raise monster stats separately, or does raising the level automatically adjust all their stats as if the monster leveled up? (How much stats do monsters gain from leveling anyway, never played with monster level up enabled...) ...maybe I'll scale the type and quantity of mobs instead of their level and stats, idk, might be a better solution. I guess I'll experiment with it and see for myself how it works. Ok, testing shows changing monster level doesn't make it stronger. So I have to change the stats as well if I want them to grow stronger. Okay, not entirely sure what stats need to be changed. there is MINATK, MAXATK, MINMATK MAXMATK but that doesn't make sense to me. These are values calculated from base stats, aren't they? I'm completely unsure which of these I need to modify... I mean a monster only has one atk and one matk stat in the database. Min and max are calculated... (although matk is mislabeled as maxatk but that bug was already fixed in that recent update...) ..oh MOB and UMOB are different things. I think I need to set MOB not UMOB as UMOB seem to be the already calculated values? Wouldn't they get overwritten as soon as the monster is recalculated (for example buffed by a status)? Arrgh this is definitely not trivial at all. Oh, docs\script_commands is a thing. Time to read...well "Note: When adjusting a unit's stat (STR, AGI, etc) the unit's respective statuses are recalculated (HIT, FLEE, etc) automatically. Keep in mind that some stats don't affect a unit's status and will have to directly be modified." Ok, that doesn't really tell me what MIN/MAX ATK and MATK in script actually represent. I need to modify ATK and ATK2 that much I realized. case UMOB_ATKMIN: md->base_status->rhw.atk = (unsigned short)value; calc_status = true; break; case UMOB_ATKMAX: md->base_status->rhw.atk2 = (unsigned short)value; calc_status = true; break; case UMOB_MATKMIN: md->base_status->matk_min = (unsigned short)value; calc_status = true; break; case UMOB_MATKMAX: md->base_status->matk_max = (unsigned short)value; calc_status = true; break; Now let's try to find which of these are actually used for what... return status->int_ + level + status->rhw.matk * 70 / 100; So... rhw.matk. None of those set that so as is script functionality to change monster MATK seems to be broken (probably due to the update that fixed monster matk) - you can only change the stats that get recalculated anyway. I guess I'll try to use it just to make sure it is indeed a bug, then change source to set rhw.matk... so Heaven Drive damage/hit from Evil Druid No script : 94 damage (my mdef is 54, no hard mdef, so monster matk was around 150) Script "setunitdata $@mobid[.@i], UMOB_MATKMIN, getmonsterinfo( getarg(1), MOB_ATK2 ) *4" for 4x MATK, code changed to set rhw.matk : same 94 damage (what??) Same script but original source : 1313 damage pet hit...that's 10x more not 4x as specified... omg both results are wrong. Well of course... case MOB_ATK2: script_pushint(st,mob->status.rhw.atk2); break; That's the monster's max atk. There is no way to get the monster's base MATK from script at all it seems? More importantly those are not the base amounts, but the calculated ones... running in debug, for Evil Druid, rhw.atk is 302, rhw.atk2 is 453, batk is 142, rhw.matk is 68, matkmin is 172, matk_max is 213. The database entries for the monster are 378 and 68. So let's try to figure out what's what. rhw.matk - this is the database matk stat. I need to get this but can't so I'll need a new MOB_MATK script parameter. I thought I also need to set this but for some reason that isn't the case. Maybe monster stats weren't actually recalculated from it? batk - This is the monster's atk from its stats, we have nothing to do with this (setting level/str/dex/etc should deal with this part) rhw.atk and rhw.atk2 - These are the 80 and 120% of the monster's database ATK stat. So getting and setting these should work for adjusting physical attack as long as they are not recalculated from the base stat. matk_min and matk_max are the effective matk values. It's possible to set these but you can't "get" them from the database. However setting them should be wrong anyway. base matk should be set instead? ...in status.cpp, this : if((!(bl->type&BL_REGEN)) && (!sc || !sc->count)) { // No difference. status_cpy(status, b_status); return; } what is it for? It makes the entire recalculation process skipped for the monster, so no wonder changing the correct, rhw.matk has no effect on the calculated min and max matk... let's see, ///Define to determine who has regen #define BL_REGEN (BL_PC|BL_HOM|BL_MER|BL_ELEM) Oh, I get it. So that code says if the thing can't regenerate hp/sp and has no status effects on it, skip recalculation because there is no way anything actually changed. Isn't that...compeletely wrong to assume? Wouldn't this break monster stat recalculation from script in all cases (not just matk but STR, AGI, etc)? ...then here : status->matk_min = status_base_matk_min(bl, status, lv); status->matk_max = status_base_matk_max(bl, status, lv); while using status instead of base_status is correct here because INT might have been already been changed by effects, and is used by the formula inside, "status->int_ + level + status->rhw.matk * 70 / 100;", it's also wrong because rhw.matk changes in base_status (through the script or otherwise) do not propagate to status anywhere. Status.rhw.matk=base_status.rhw.matk before these function calls seems necessary - unlike atk, matk isn't recalculated anywhere before the call. (or the script should set status instead of base status, or both.) ...adding that line to set status matk to base status matk fixed the problem. Raising monster matk now works, yay! However, raising atk is broken now as recalculation now correctly happens, but script sets base_status and again the data does not propagate to status anywhere. status.cpp line 4979, these two lines were removed by that "fix monster matk" update we discussed last time that was committed in the past 6 months. However, without them, any changes by script to base_status.rhw.atk and atk2 never have an effect similarly to the matk one. status->rhw.atk = status_calc_watk(bl, sc, b_status->rhw.atk); status->rhw.atk2 = status_calc_watk(bl, sc, b_status->rhw.atk2); Are these seriously all existing bugs? I'm not breaking things due to misunderstandings? I made a pull request just to be sure people in charge are at least aware of these problems and a possible way of fixing them. I should probably test other stats too, at this rate, there might be more broken than just atk and matk. WOE+WOE SE+WOE TE total 40 castles but server says "loaded 44 castles" at startup, what are the last 4?
  23. Asking here because I haven't yet had the time to check whether woe is implemented in script, source or both. I'm playing on my own offline server, so that obviously means no PVP or WOE, as there are no other players. However it would be a waste to not use the castles. So I have been thinking to implement the following instead : -Every X hours (while the server is turned on) there is a chance for each owned castle to be retaken by monsters, or if it's already owned by monsters, chance to lose an investment level. -Treasure does not respawn except after the castle is taken from the monsters and you can invest only once. -Monsters grow stronger the more investment levels there are so each time it's harder to retake the castle (but higher investment means more treasure chest as usual) -Woe is always enabled so I can take the castles from the monsters whenever I feel like doing it. That's all I think. Also, no idea how the guardians could be incorporated into this system, if at all, might be better to get rid of them. How difficult/possible it is do this? Is it as easy as changing some scripts or is it harder? Is it even possible to change the level of the monsters spawned? Do Woe SE castles work the same way as normal castles regarding monsters/chests/investing zeny, so can the same be done for them? It wasn't implemented last time I played so I know nothing about it.
  24. Thanks, searching for hotkey was a good idea, was able to find all the relevant SQL parts through that. So far only tested on my GM account but my implementation seems to work correctly. If no bugs surface in the next few days, I'll consider posting it in source releases.
  25. Seravy

    MAX_WALKPATH

    So far I had #define MAX_WALKPATH 128 and everything was working fine. However I was thinking "hey that's probably way more than I actually need, let's try less." I changed the line to #define MAX_WALKPATH 60 but this caused my characters to be able to move no further than 2 tiles!!! Could this perhaps be a bug? I don't think I have ever changed any of the pathfinding functions. btw my official walkpath is off. (walkpath in client.conf was set to 99 and 60 both, that made no difference.) I'm not that experienced with the C language but maybe the fact 60 is small enough to be signed short but 128 isn't could be what makes this difference? Automatic type conversions and whatnot causing it?
×
×
  • Create New...