Attack Skills should miss too (Code Inside)

If you want to help us or give some corrections / codes, put it here ;)

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

Attack Skills should miss too (Code Inside)

Postby Terr0risT on Fri Jan 14, 2011 2:53 am

In the official Server (naROSE) their attack skills don't hit 100% unlike how dev rev was coded. Offensive skills are labeled Reliable and non-reliable. Those that are reliable, when they miss, will result in a 50% damage. While those skills that do not have the label "reliable", will completely miss a target. So with this system, Accuracy and Dodge will now play a part. Meaning, a high dodge player will be harder to kill cuz skills may also miss him. And you will be needing enough CON if you want your skills to hit. Here's the code:

In battle.cpp, find this part and replace your old code.

  1. if(skill->formula !=0)
  2.     {
  3.         skillpower += Stats->Attack_Power;
  4.     }
  5.     unsigned int skill_hitvalue = (unsigned int)floor(Stats->Accury * 50 / Enemy->Stats->Dodge);
  6.     if(skill_hitvalue>100) skill_hitvalue = 100;
  7.     switch(skill->formula)//Magical Or Weapon Type Skill?
  8.     {
  9.         case 1: // Reliable Weapon Attack : Shield Stun, Spin Attack, Weapon Launcher, Seismic Impact, Achilles' Heel Strike, Slugger, Blood Attack,
  10.                 //  Impact Wave, Heavy Bow Shot, Fierce Cudgeling, Staff Stun, Stun Arrow, Spiral Kick, Aimed Triple Arrow, Point Blank Arrow,
  11.                 //  Screw Attack, Bloody Assault, Phoenix Slash, Flame Slash, Freezing Assault, Circle Break, Impact Arrow, Sucker Punch,
  12.                 //  Master Twin Shot, Zulie Boltcher Smash, Zulie Stun, Mastered Triple Shot, Flame Stun Burst, Aimed Triple Shot and Poison Shot
  13.         {
  14.             skillpower+=skill->atkpower +(long int)floor(GetSen( )/2);
  15.             skillpower+=skillpower*GetSen( )/10000;
  16.             skillpower-=skillpower*Enemy->Stats->Defense / 10000;
  17.             skillpower-=Enemy->Stats->Defense * 10 / 100;
  18.             if(GServer->RandNumber( 0, 100 )>skill_hitvalue) skillpower /= 2; // Miss results in damage cut in half.
  19.         }
  20.         break;
  21.         case 2: // Reliable Magic Attack : Soul Wreck, Space Attack, Combat Cry, Wind Storm, Tornado, Voltage Jolt, Icy Hailstorm, Fire Ring,
  22.                 // Meteorite Strike, Voltage Shock, Freezing Chill, Tempest, Glaciating Chill, Hurricane, Soul Shock, Soul Electric,
  23.                 // Permafrost Chill, Hellfire, Mana Burn, Elemental Bolt, Elemental Spike, Meteorite Flow, Mana Wave, Voltage Storm,
  24.                 // Flame Hawk, Phoenix Arrow, Mystic Knife, Plasma Falcon, Sniping, Zulie Storm and Hypno Shot
  25.         {
  26.             skillpower+=skill->atkpower +(long int)floor(GetInt( )/2);
  27.             skillpower+=skillpower*GetInt( )/10000;
  28.             skillpower-=skillpower*Enemy->Stats->Magic_Defense / 10000;
  29.             skillpower-=Enemy->Stats->Magic_Defense * 10 / 100;
  30.             if(GServer->RandNumber( 0, 100 )>skill_hitvalue) skillpower /= 2; // Miss results in damage cut in half.
  31.         }
  32.         break;
  33.         case 3: // (Unreliable) Weapon Attack : Double Attack, Triple Attack, Fatal Thrust, Piercing Lunge, Voltage Crash, Heavy Attack, Leap Attack,
  34.                 // Lightning Crasher, Geon Archangel Crumpler, Longinus' Attack, Champion Hit, Taunt Shot, Slow Shot, Clamp Arrow, Double Arrow,
  35.                 // Shackle Arrow, Triple Arrow, Double Slash, Focused Impact, Triple Slash, Katar Upper, Dividing Cleave, Poison Arrow,
  36.                 // Entangling Arrow, Combo Slash, Crazy-style Slash, Quick-style Assault, Twin Shot, Demolition Expertise, Triple Shot,
  37.                 // Shrapnel Burst, Toxic Shot, Cannon Splash Burst and Kill (Anti-Crime)
  38.         {
  39.             skillpower+=skill->atkpower +(long int)floor(GetSen( )/2);
  40.             skillpower+=skillpower*GetSen( )/10000;
  41.             skillpower-=skillpower*Enemy->Stats->Defense / 10000;
  42.             skillpower-=Enemy->Stats->Defense * 10 / 100;
  43.             if(GServer->RandNumber( 0, 100 )>skill_hitvalue) skillpower = 0; // Complete Miss.
  44.         }
  45.         break;
  46.         case 4: // (Unreliable) Magic Attack : Sword Force, Swords of Divinity, Ice Bolt, Frostbiter, Mana Bolt, Mana Spear, Mana Drop,
  47.                 // Poison Knife and Venom Knife
  48.         {
  49.             skillpower+=skill->atkpower +(long int)floor(GetInt( )/2);
  50.             skillpower+=skillpower*GetInt( )/10000;
  51.             skillpower-=skillpower*Enemy->Stats->Magic_Defense / 10000;
  52.             skillpower-=Enemy->Stats->Magic_Defense * 10 / 100;
  53.             if(GServer->RandNumber( 0, 100 )>skill_hitvalue) skillpower = 0; // Complete Miss.
  54.         }
  55.         break;
  56.         case 6: // Dual Scratch
  57.         {
  58.             skillpower+=60;
  59.             skillpower+=skillpower*GetSen( )/10000;
  60.             skillpower-=skillpower*Enemy->Stats->Defense / 10000;
  61.             skillpower-=Enemy->Stats->Defense * 10 / 100;
  62.             if(GServer->RandNumber( 0, 100 )>skill_hitvalue) skillpower = 0; // Complete Miss.
  63.         }
  64.         break;
  65.         default:
  66.         {
  67.             skillpower += 35;
  68.         }
  69.         break;
  70.     }
User avatar
Terr0risT
Rackie
Rackie
 
Posts: 162
Joined: Sat Aug 11, 2007 10:22 am

Re: Attack Skills should miss too (Code Inside)

Postby rave on Tue Feb 01, 2011 5:20 am

does this mean if a raider manage to make a higher dex to put on dodge rate up it will be 100% perfect to dodge to an opponent which dont have good con to hit?

and when a player put lots of CON to manage hit rate he can hit perfectly on other builds?
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Attack Skills should miss too (Code Inside)

Postby Terr0risT on Tue Feb 01, 2011 6:21 pm

There are 2 types of skills

1. Reliable Skills (labeled as Reliable Weapon or Reliable Magic) - A "miss" will result in 50% damage.
2. non-Reliable (labeled as Weapon or Magic) - A "miss" will result in a complete MISS.

So even if you put a super high dex raider against a 15 CON, some skills will still hit him. :D
User avatar
Terr0risT
Rackie
Rackie
 
Posts: 162
Joined: Sat Aug 11, 2007 10:22 am

Re: Attack Skills should miss too (Code Inside)

Postby PurpleYouko on Tue Feb 01, 2011 7:38 pm

osrose does not currently have a way of loading a value denoting whether a skill is reliable or not.

The STB actually contains a field that shows it but it isn't set up the same way as the other skill fields.

Even a lot of editors don't show it. I had to code a special tool to grab the data for my website.

this is what it looks like

Image
if the skill has a number 4 then it is reliable. otherwise it isn't

Problem is that the identifier only shows up on the third row for each skill and not for each level of the skill like all the other stuff does.
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: Attack Skills should miss too (Code Inside)

Postby MightyKai on Tue Feb 01, 2011 8:05 pm

and are you posting your news excel stb on this forum?

becaurse 3.4 makes list_npc_s.stl unuseable

thanks
Consultation en ligne viagrasansordonnancefr.com pharmacie de Paris
MightyKai
Antares
Antares
 
Posts: 335
Joined: Mon May 24, 2010 7:34 pm

Re: Attack Skills should miss too (Code Inside)

Postby PurpleYouko on Wed Feb 02, 2011 6:39 pm

MightyKai wrote:and are you posting your news excel stb on this forum?

becaurse 3.4 makes list_npc_s.stl unuseable

thanks


What's wrong with it?

I just checked that STL with the version of 3.4 that is posted on these forums and it opened it perfectly.

The only stuff I ever added to my own personal version are tools to rip STBs directly to MySQL for my website. Other than that the base is the same as 3.4.
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: Attack Skills should miss too (Code Inside)

Postby MightyKai on Wed Feb 02, 2011 6:46 pm

if you save the file you got a error and the stl is unusable
Consultation en ligne viagrasansordonnancefr.com pharmacie de Paris
MightyKai
Antares
Antares
 
Posts: 335
Joined: Mon May 24, 2010 7:34 pm

Re: Attack Skills should miss too (Code Inside)

Postby PurpleYouko on Thu Feb 03, 2011 5:57 pm

oh it's a save error.

OK i'll look into it when i get a chance.
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: Attack Skills should miss too (Code Inside)

Postby MightyKai on Thu Feb 03, 2011 6:43 pm

PurpleYouko wrote:oh it's a save error.

OK i'll look into it when i get a chance.



thanks
Consultation en ligne viagrasansordonnancefr.com pharmacie de Paris
MightyKai
Antares
Antares
 
Posts: 335
Joined: Mon May 24, 2010 7:34 pm


Return to Submit Code

Who is online

Users browsing this forum: No registered users and 2 guests

cron