Question about skill handling in REVII

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Question about skill handling in REVII

Postby cive on Sun Aug 28, 2016 11:46 am

Hi guys,


Recently I started getting back into developing for a server me and my friends play on. I'm using a tweaked version of REVII and right now I'm working on balancing PvP. I noticed that skills somehow didnt really care about how much defense/magic defense a player had (ie a super tanky knight would take the same damage as a raider) so I dug in the code. Now while doing this, I ran into a switch that confused me.


Talking about the code below, while I understand what is happening, I dont see any code that actually multiplies the appropriate atkdefmult given by the switch by the skillpower. After all, this switch is here to tweak the skillpower (differentiate between magic skills, weapon skills, etc).

Code is from battle.cpp on the bottom, where skills are handled.
  1. switch(skill->formula)//Magical Or Weapon Type Skill?
  2.  
  3.     {
  4.         case 0://Skill Mental Storm
  5.         {
  6.             atkdefmult = 0;
  7.         }
  8.         break;
  9.         case 1://Weapon type dmg
  10.         {
  11.             atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense+Enemy->Stats->Defense);
  12.             skillpower += GetSen();
  13.             if(GServer->RandNumber( 30, 100 )>skill_hitvalue) atkdefmult /= 2; // Miss results in damage cut in half.
  14.         }
  15.         break;
  16.         case 2://Magical type dmg
  17.         {
  18.             atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense+Enemy->Stats->Defense);
  19.             skillpower += GetInt();
  20.             if(GServer->RandNumber( 30, 100 )>skill_hitvalue) atkdefmult /= 2; // Miss results in damage cut in half.
  21.         }
  22.         break;
  23.         case 3://Weapon type dmg
  24.         {
  25.             atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense+Enemy->Stats->Defense);
  26.             skillpower += GetSen();
  27.             if(GServer->RandNumber( 30, 100 )>skill_hitvalue) atkdefmult = 0; // Complete Miss.
  28.         }
  29.         break;
  30.         case 4://Magical type dmg
  31.         {
  32.             atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense+Enemy->Stats->Defense);
  33.             skillpower += GetInt();
  34.             if(GServer->RandNumber( 30, 100 )>skill_hitvalue) atkdefmult = 0; // Complete Miss.
  35.         }
  36.         break;
  37.         case 6://Dual Scratch
  38.         {
  39.             atkdefmult = 1;
  40.         }
  41.         break;
  42.         default:
  43.         {
  44.             atkdefmult = 1;
  45.         }
  46.         break;
  47.  
  48.  
  49.     }


I followed the code down to where the skillpower is actually taken from the health of the enemy (below) but any intervention by the atkdefmult cant be found. Am I overlooking this or is it actually missing/unneccesary? Also, what does the
  1.     skillpower += GetInt();
do? What int does it call?

  1.  Enemy->Stats->HP -=  (long long) skillpower;



For now I will use general 50% DEF and MDEF scaling float to adjust the skillpower to the defense of the player (below). Would be great if someone could clear this up for me! Cheers!


  1. float skilldefense = (float) Stats->Attack_Power / (Enemy->Stats->Defense+Enemy->Stats->Magic_Defense*0.5) ;









Please dont recommend me to use REV4, I know it's way better (go roseZA!) but I happen to like my tweaked REVII.
cive
Jelly Bean
Jelly Bean
 
Posts: 11
Joined: Thu Nov 07, 2013 8:15 pm

Re: Question about skill handling in REVII

Postby PurpleYouko on Sun Aug 28, 2016 9:35 pm

What I would suggest you do is look at the way it's handled in some of the more advanced codebases. KTRose did a half way decent job of it and later versions such as DR4 started to actually pay attention to the fact that she STBs actual define whether any damage is magic or normal, a fact which is wholly ignored in most earlier servers.

Just find the code that suits you and shoehorn it into your good old DR2 ;)

Following what is going on with my new project 137 might not be a bad idea for you since the server there is slowly getting fixed up to correct all this type of crap
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Question about skill handling in REVII

Postby cive on Sun Aug 28, 2016 10:11 pm

Right, I will have a look at how other servers handle skillpower calculation. Am I correct in assuming every skill has a value set in list_skill.stb that actually determines what case is selected when casting a skill? I might also have a look at the latest REV battle.cpp and see if much changed there. Do you happen to have a link to your new project & KTrose serverfiles?

Thanks for the quick reply!


EDIT: Already found the KTrose server & Your new osProse project. Will dig into the project now and see if I can find something useful to use in my server. Also checked REV4 and was surprised to find that RoseZA was still using those weird skillpower & normalttack calcs as well. Maybe we can update them a little if I find anything productive :P
EDIT2: So in the latest osProse project the core system revolves around
  1. long int skillpower = skill->atkpower + (long int)floor(((double)GetInt( )/2));
  2.     skillpower -= Enemy->Stats->Magic_Defense;

Does that mean that no matter what skill I use, it will always only take magic defense into account? This looks a simplified version os the Osrose skill system, is there another source I should take a look at?
cive
Jelly Bean
Jelly Bean
 
Posts: 11
Joined: Thu Nov 07, 2013 8:15 pm

Re: Question about skill handling in REVII

Postby PurpleYouko on Mon Aug 29, 2016 4:09 pm

Latest OsProse LOL
That would be about 6 or 7 years old then.
Nobody has updated OsProse in ages.

Normal and magic attacks are listed in a few different STBs.
In LIST_NPC.STB the field immediately after "attack speed" denotes Magic / normal attacks. If you don't immediately see the column look down the stb until you see flanaes. They will have a 1 in this column whereas all monsters before that have a blank space (or zero)
In LIST_WEAPON.STB it is once again in the column after attack power and attack speed. Look down the list until you reach the wands. They will all have a 1 in this field as will staffs

in LIST_SKILL.STB there is a field called "formula type" right after "duration". In this field, normal attacks have a 1 and magical attacks have a 2. There are also some 5s which appear to be magical AOE attacks.

That is basically how we tell which attack foormulas to use and whether to apply magic defense or normal defense.

However.... My own code (in project 137 or in KTRose ) is very likely the only place you will ever find this applied.
here are a couple of code snippets.

Battle.cpp void CCharacter::UseAtkSkill( CCharacter* Enemy, CSkills* skill, bool deBuff )
  1. switch(skill->formula)//Magical Or Weapon Type Skill?
  2.     {
  3.         case 1://Weapon type dmg
  4.         {
  5.             skillpower += skill->atkpower +(long int)floor((double)GetSen( )/2);
  6.             skillpower += skillpower  *GetSen( ) / 10000;
  7.             skillpower -= skillpower * Stats->Defense / 10000;
  8.             skillpower -= Stats->Defense * 5 / 100;
  9.             Log(MSG_INFO,"%i cast Weapon Dmg Skill with %i sen, Attack power %u, skillpower %li, Deff %u, level diff %li, to %i",clientid,GetSen( ),skill->atkpower,skillpower,Enemy->Stats->Defense,level_diff,Enemy->clientid);
  10.         }
  11.         break;
  12.         case 2://Magical type dmg
  13.         {
  14.             skillpower += skill->atkpower +(long int)floor((double)GetInt( )/2);
  15.             skillpower += skillpower*GetInt( ) / 10000;
  16.             skillpower -= skillpower*Stats->Magic_Defense / 10000;
  17.             skillpower -= Stats->Magic_Defense * 5 / 100;
  18.             Log(MSG_INFO,"%i cast Magical Dmg Skill with %i int, Attack power %u, skillpower %li, MDeff %u, level diff %li, to %i",clientid,GetInt( ),skill->atkpower,skillpower,Enemy->Stats->Magic_Defense,level_diff,Enemy->clientid);
  19.         }
  20.         break;
  21.         default:
  22.         {
  23.             skillpower += 5;
  24.             Log(MSG_INFO,"%i cast Unknown Formula Skill (%i), Attack power %u, skillpower %li, Deff %u,MDeff %u, level diff %li, to %i",clientid,skill->formula,skill->atkpower,skillpower,Enemy->Stats->Defense,Enemy->Stats->Magic_Defense,level_diff,Enemy->clientid);
  25.         }
  26.         break;
  27.     }


Battle.cpp void CCharacter::NormalAttack( CCharacter* Enemy )
  1. if(Stats->magicattack == 1) //magic attacks such as wands and some monsters
  2.         {
  3.             unsigned int totalpower = Stats->Attack_Power + Enemy->Stats->Magic_Defense;
  4.             double hitmod = Stats->Attack_Power *100 / totalpower;                              //percentage of hitpower to use
  5.             hitpower = (unsigned int)floor((double)(Stats->Attack_Power * hitmod / 100));
  6.             Log(MSG_DEBUG,"Magic type attack: base AP: %i Defense: %i total: %i Modifier: %f Modified AP: %i)",Stats->Attack_Power,Enemy->Stats->Magic_Defense,totalpower,hitmod,hitpower);
  7.         }
  8.         else
  9.         {
  10.             unsigned int totalpower = Stats->Attack_Power + Enemy->Stats->Defense;
  11.             double hitmod = Stats->Attack_Power * 100 / totalpower;                             //percentage of hitpower to use * 100
  12.             hitpower = (unsigned int)floor((double)(Stats->Attack_Power * hitmod / 100));
  13.             Log(MSG_DEBUG,"normal type attack: base AP: %i Defense: %i total: %i Modifier: %f Modified AP: %i)",Stats->Attack_Power,Enemy->Stats->Defense,totalpower,hitmod,hitpower);
  14.         }
  15.         //add some randomness. + or - 5% of hitpower
  16.         int min = (int)floor((double)(hitpower * 0.85));
  17.         int max = (int)floor((double)(hitpower * 1.15));
  18.         int dif = max - min;
  19.         int mod = GServer->RandNumber( 0, dif );
  20.         hitpower = min + mod;
  21.         if(IsPlayer( )) //temp fix to find balance btw monster and player
  22.             hitpower = (int)floor(hitpower * (GServer->Config.PlayerDmg/100.00));
  23.         if(IsMonster( )) //temp fix to find balance btw monster and player
  24.             hitpower = (int)floor(hitpower * (GServer->Config.MonsterDmg/100.00));
  25.         if(GServer->RandNumber(0,300) < Stats->Critical)        //PY: Why 300? a little Arbitrary no?
  26.  
  27.         {
  28.             hitpower = (int)floor(hitpower*1.5);
  29.             critical = true;
  30.         }
  31.         Log(MSG_DEBUG,"Attack was successful with HitPower: %i Crit: %b)",hitpower, critical);


You will note that the case of 5 in the skill STB has not been applied correctly here. It kind of ignores it in fact. I need to go back and fix that at some point, even though it only applies to magic AOE skills anyway.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Question about skill handling in REVII

Postby cive on Mon Aug 29, 2016 5:12 pm

Right, that explains a lot!
So LIST_NPC.STB = check for monsters if they attack magical or normal
LIST_WEAPON.STB = check for players if their normal attacks are magical or normal
and LIST_SKILL.STB = check for players if their skill attacks are magical or normal

Am I right? Thanks for the snippets, I'll try to modify this to get it to work properly with my server! Cheers! Only thing I dont understand in your code is the part where you add GetInt to the skillpower like so:

  1. skillpower += GetSen();


Is this about the stats Sen and Int or is this c++ that I dont yet understand?
cive
Jelly Bean
Jelly Bean
 
Posts: 11
Joined: Thu Nov 07, 2013 8:15 pm

Re: Question about skill handling in REVII

Postby PurpleYouko on Mon Aug 29, 2016 8:41 pm

Yeah I don't really see why it was ever coded like that either. Seems pretty dumb really and most likely needs to be recoded entirely like i did for basic NormalAttack stuff.
All i did there was split it out to include the different attack types. I didn't have anything to do with the rest of the code design in that section. It's legacy code from Rev 81 I think

GetSen() just returns the value of the characters SEN plus and SEN added by equipable item stats

Playerfunctions.cpp
  1. // return Sensibility
  2. unsigned int CPlayer::GetSen( )
  3. {
  4.     return (Attr->Sen + Attr->Esen); //Tomiz : We need to take sen from cloth,gem,ect into consideration(ExtraSen/Esen)
  5. }

The whole formula looks a bit messed up to me. I have no idea why a skill attack would be modified by how much SEN somebody has. :?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Question about skill handling in REVII

Postby cive on Mon Aug 29, 2016 10:38 pm

Ah yup, as far as I know SEN should only affect crafting and critical hits. Int does make sense though, taking into consideration that a mage builds a lot of int only to have its skills scaled on attack power in the initial skillpower calculation (like skillpower + attack power).

The +int part also explains why my cleric has been doing a little too well PvP-wise lately. I've already started rewriting the entire code, I ditched the atkdefmult that just seemed carelessly copied from normal attacks lol. I'll report if I get somewhat decent results on my beloved 307 client.

btw, what's the difference between case 1&3 and 2&4? The comment says something damage cut in half in 1&2 and a complete miss in 3&4 but I have no idea in what way that influences under what case category a skill falls?

I'm half thinking of actually calling the class of the player and making skillpower modifications based on that, right now artisans in my server are pretty poor damagers just because they build a lot of con which rules out str and therefore skillpower, would be cool to check class and add a portion of a characters SEN/CON for instance. I'll see how far I get.
cive
Jelly Bean
Jelly Bean
 
Posts: 11
Joined: Thu Nov 07, 2013 8:15 pm

Re: Question about skill handling in REVII

Postby PurpleYouko on Tue Aug 30, 2016 3:34 pm

I only have 2 cases and a default which looks a bit weird TBH.
  1. switch(skill->formula)//Magical Or Weapon Type Skill?
  2.     {
  3.         case 1://Weapon type dmg
  4.         {
  5.             skillpower += skill->atkpower +(long int)floor((double)GetSen( )/2);
  6.             skillpower += skillpower  *GetSen( ) / 10000;
  7.             skillpower -= skillpower * Stats->Defense / 10000;
  8.             skillpower -= Stats->Defense * 5 / 100;
  9.             Log(MSG_INFO,"%i cast Weapon Dmg Skill with %i sen, Attack power %u, skillpower %li, Deff %u, level diff %li, to %i",clientid,GetSen( ),skill->atkpower,skillpower,Enemy->Stats->Defense,level_diff,Enemy->clientid);
  10.         }
  11.         break;
  12.         case 2://Magical type dmg
  13.         {
  14.             skillpower += skill->atkpower +(long int)floor((double)GetInt( )/2);
  15.             skillpower += skillpower*GetInt( ) / 10000;
  16.             skillpower -= skillpower*Stats->Magic_Defense / 10000;
  17.             skillpower -= Stats->Magic_Defense * 5 / 100;
  18.             Log(MSG_INFO,"%i cast Magical Dmg Skill with %i int, Attack power %u, skillpower %li, MDeff %u, level diff %li, to %i",clientid,GetInt( ),skill->atkpower,skillpower,Enemy->Stats->Magic_Defense,level_diff,Enemy->clientid);
  19.         }
  20.         break;
  21.         default:
  22.         {
  23.             skillpower += 5;
  24.             Log(MSG_INFO,"%i cast Unknown Formula Skill (%i), Attack power %u, skillpower %li, Deff %u,MDeff %u, level diff %li, to %i",clientid,skill->formula,skill->atkpower,skillpower,Enemy->Stats->Defense,Enemy->Stats->Magic_Defense,level_diff,Enemy->clientid);
  25.         }
  26.         break;
  27.     }


This is definitely all kinds of wrong and needs to be recoded.
There are a number of different skill->formula values in the STB. We should probably build out on those.
Examples below are just a few of the list. Not all of them.

Soldiers -> Most skills use 1 which we can associate with STR perhaps. There are a few that use 4 though. (shield stun, soul wreck, voltage crash)
Muse -> Most skills use 2 which we can associate with INT perhaps. Some use 5. (ALL AOE skills + Voltage Jolt, permafrost, hellfire)
Hawker -> Most skills use 1 (STR again) and a few use 4 (stun arrow, venom knife, flame hawk, spiral kick)
Dealer -> Most skills use 1 (STR doesn't make sense here) and some use 4 (rapidfire triple shot, hypno shot)

At first I thought maybe the exceptions are using status effects but that isn't it. I just don't see any reason for these things to be anything but 1 or 2.
We already have a field that denotes AOEs plus many of the exceptions aren't AOE anyhow.

I'm wondering if the best option might be to change the values in the STB to just show magic attack or normal. Or treat 5 as magic and 4 as non_magic.
We already calculate attack power based on class and weapon type etc. so lets just use AP as a base and the STB skill power as a modifier in some way.
Maybe base AP + skillpower? (eg. AP = 200: STB skillpower = 120: so skill attack power would be 200 + 120 = 220)
maybe base AP + a percentage (eg. AP = 200 STB skillpower = 120 so skill attack power would be 200 + (200 * 120%) = 440) Could get crazy big with skills like Soul Wreck.... :?
Maybe we just use the value from the STB unmodified by anything? Downside of that is that as your AP gets bigger, skills would become less useful and would fall behind.

The first way would certainly be by far the easiest to code. Just add the STB value directly to your calculated AP
The magic or not_magic aspect only comes into it when deciding which defense to apply DEF or MDEF

the code would come out looking something like this
  1.  
  2. switch(skill->formula)//Magical Or Weapon Type Skill?
  3.     {
  4.         case 1: case 4://Weapon type dmg
  5.         {
  6.             skillpower = skill->atkpower + skill->atkpower;
  7.             unsigned int totalpower = skillpower + Enemy->Stats->Defense;
  8.             double hitmod = skillpower *100 / totalpower;                               //percentage of skillpower to use
  9.             skillpower = (unsigned int)floor((double)(skillpower * hitmod / 100));
  10.         }
  11.         break;
  12.         case 2: case 5://Magical type dmg
  13.         {
  14.             skillpower = skill->atkpower + skill->atkpower;
  15.             unsigned int totalpower = skillpower + Enemy->Stats->Magic_Defense;
  16.             double hitmod = skillpower *100 / totalpower;                               //percentage of skillpower to use
  17.             skillpower = (unsigned int)floor((double)(skillpower * hitmod / 100));
  18.         }
  19.         break;
  20.         default:
  21.         {
  22.             skillpower = 0;
  23.             Log(MSG_INFO,"%i cast Unknown Formula Skill (%i), Attack power %u, skillpower %li, Deff %u,MDeff %u, level diff %li, to %i",clientid,skill->formula,skill->atkpower,skillpower,Enemy->Stats->Defense,Enemy->Stats->Magic_Defense,level_diff,Enemy->clientid);
  24.         }
  25.         break;


If you like the look of this then please give it a test run and see how it works out. I don't have the time to test it myself right now.

the definition of skillpower here will overwrite all the previous definitions in this function so if it works out then we can pare down the rest of the code.
Not sure how it will work for monsters though.... Haven't checked their skills yet so we might need some extra cases for them

I'm trying to get rid of all the leveldif crap altogether. I don't like it. I think it makes combat unrealistic.
My formulas are based entirely on attack and defense.
First we add our attack to the enemy's defense (choosing which def type to use) making a total value
Then we determine what percentage of that total is represented by our attack power.
Then we apply that same percentage of the attack power as the damage done.

Example: We have 100 AP. Enemy has 100 DEF. Total = 200. Our attack is exactly 50% of this so half of our damage gets through his defense. We do 50 damage.
This method is infinitely variable and will ALWAYS result in a small amount of damage getting through no matter how big the difference between attack and defense.
The method is also very robust and cannot ever return a negative value as so many previously used formulas do
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Question about skill handling in REVII

Postby cive on Wed Aug 31, 2016 8:49 pm

Right, lots of findings so I'll try to list 'em and if I forget a couple I'll edit :D

So today I ran your code and tried a couple of things of my own. I'll try to explain what I found by describing what happened when I fought a couple of friends with different formulas. (on a 307 client using no custom gears and a max stat of 550 & no reborn nonsense)

On the base skillpower calculation
-BaseAP + skillpower is defintely not an option, a 225 (my levelcap) mage easily reaches 5.5k AP, add 1,8k skillpower to this and hits around 6k+ start flying, even when taking into account mdef of players.
-BaseAP+ skillpower percentages work very well but only if we take either 50%/50% or halve the entire value after adding them up toghether. Example:



  1. long int skillpower = (skill->atkpower*0.2) + (Stats->Attack_Power*0.5) / 3;


gives some reasonable results but things go wrong when ie a mage fights a champ, the champ easily has more AP and almost double the defense so wins every time. A mage has more STB skillpower so when I used

  1. long int skillpower = (skill->atkpower*0.6) + (Stats->Attack_Power*0.5) / 2 ;
things started to look quite balanced, actually. The champ had a chance because of his AP and DEF stats but the mage was able to use 60% STB skillpower instead of just the 20%. It ended up in a draw.


Then I cleaned up all the nonsense that was in the code (so many variables like atkdefmult, Hitvalue, the GetSen crap, levelmult crap and started doing some tweaks. I used some of my own reworks and some of your work to create this, and it actually works very very well. When someone uses a magical skill, its going to calculate a 'skilldefense' variable that's based on your attack / enemy magical defense and vice versa.

snippet from below CCharacter::UseAtkSkill( CCharacter* Enemy, CSkills* skill, bool deBuff )

  1.    long int skillpower = (skill->atkpower*0.5) + (Stats->Attack_Power*0.5) / 2 ;
  2.     float skilldefense = 0  ;
  3.     switch(skill->formula)//Magical Or Weapon Type Skill?
  4.  
  5.     {
  6.         case 0://Skill Mental Storm
  7.         {
  8.         skilldefense = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense * 2.5) ;
  9.         }
  10.         break;
  11.         case 1: case 3: //Weapon type dmg
  12.         {
  13.  
  14.         skilldefense = (float) Stats->Attack_Power / (Enemy->Stats->Defense * 1.5) ;
  15.  
  16.         }
  17.         break;
  18.         case 2: case 4: //Magical type dmg
  19.         {
  20.  
  21.             skillpower += GetInt();
  22.             skilldefense = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense * 2.5) ;
  23.         }
  24.         break;
  25.         case 6://Dual Scratch
  26.         {
  27.          skilldefense = (float) Stats->Attack_Power / (Enemy->Stats->Defense * 1.5) ;
  28.         }
  29.         break;
  30.         default:
  31.         {
  32.         skilldefense = 1 ;
  33.         }
  34.         break;
  35.  
  36.  
  37.     }
  38.  
  39.     if (skilldefense > 1) skilldefense = 1 ;
  40.     skillpower*= skilldefense ;
  41.  


As you can see, it looks much simpler than before, using 2 main case groups, 1&3 + 2&4 (splitting them out seems useless because the code is identical tbh :? )

Things to note:
-I boosted defense and magical defense by respectively 150 % & 250 % out of balancing motives. I suppose that could be reworked slightly but it works fine for now.


With the old code I never missed a single skill, so I deleted all skill_hitvalue crap and made a much easier dodge system right before we take the HP from a player

  1.  //new skilldodge system
  2.     float hitormis = (float)floor(Stats->Accury * 85 / Enemy->Stats->Dodge);
  3.     if(hitormis >100) hitormis = 100;
  4.     if(GServer->RandNumber( 0, 100 )>hitormis) skillpower = 0;


So now, just like in Irose, we can actually MISS skills against a dodgy opponent (the * 85 can be tweaked to make that easier or harder, this seems to be the sweetspot though)

I've been running this combination of skill handling for a full day now and have to say that most classes actually have a solid chance in fighting each other, monster skill damage doesn't seem to be affected too much by this either (but idk if it's solid enough to use).

Would love to hear what you have to say on this. I was thinking of maybe making the skilldefense var into a percentage like you said, it happens that skilldefense turns out as 1 (max value) and nothing happens to skillpower but in this case the higher damage is usually justified because I boosted def and mdef of enemies in the code. The highest skill damages hit around 1.5k/2k (by mages for instance).
cive
Jelly Bean
Jelly Bean
 
Posts: 11
Joined: Thu Nov 07, 2013 8:15 pm

Re: Question about skill handling in REVII

Postby PurpleYouko on Thu Sep 01, 2016 3:28 pm

looks kind of nice.
your groupings are somewhat different than the ones i would use. In my STB normal types are 1 and 4 while magic attacks are 2 and 5.
case 0 wouldn't work typically since every non-combat skill is type zero so you would end up catch all the buffs and doing damage with them. :( Mental storm has no damage factor. It simply lowers enemy accuracy (at least in my STB)
I don't have a singe 3 anywhere in my STB other than a specific GM skill called "Kill (anti crime)" and strangely there is no dual scratch in there at all. I thought some version of that skill had always been with us but apparently not.

Monster skills are all 4 or 5 so those would also work without special cases.

I think I might take your code and incorporate it into my source in some fashion. :D

Oh one more thing. Did you account for "reliable" skills that never miss?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Next

Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 12 guests