<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cyan Street</title>
	<atom:link href="http://cyanstreet.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://cyanstreet.net</link>
	<description>Just notices</description>
	<lastBuildDate>Wed, 16 Dec 2009 10:45:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Specific of getting HTML form attributes by JavaScript code in Internet Explorer</title>
		<link>http://cyanstreet.net/programming/html-form-attributes-internet-explorer/</link>
		<comments>http://cyanstreet.net/programming/html-form-attributes-internet-explorer/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:15:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://cyanstreet.net/?p=131</guid>
		<description><![CDATA[Even such simple action as getting attributes of an html form by JavaScript can sometimes confuse the developer. Internet Explorer, as it often does, makes us research its "illogical logic".

Let's assume we have an HTML form looking like this:

&#60;form action="form1 action attribute" id="f1"&#62;
&#60;input name="input1" value="first input value"&#62;
&#60;/form&#62;

To access form's "action" attribute (or any other attribute) [...]]]></description>
			<content:encoded><![CDATA[<p>Even such simple action as getting attributes of an html form by JavaScript can sometimes confuse the developer. Internet Explorer, as it often does, makes us research its "illogical logic".</p>
<p><span id="more-131"></span></p>
<p>Let's assume we have an HTML form looking like this:</p>
<p class='formula'>
&lt;form action="form1 action attribute" id="f1"&gt;<br />
&lt;input name="input1" value="first input value"&gt;<br />
&lt;/form&gt;
</p>
<p>To access form's "action" attribute (or any other attribute) we may use several methods, i.e.:</p>
<ul>
<li>form.action</li>
<li>form.getAttribute('action')</li>
<li>form.attributes['action'].value</li>
<li>form.getAttributeNode('action').value</li>
</ul>
<p>
Also, to access one of the form’s fields we may use the following method: "form.input1", where "input1" is the value of the "name" attribute of the field inside the form. But lets see what happens if "name" attribute of an input inside a form is the same as the name of one of form's attributes.<br />
<br />
To illustrate this, lets take a simple HTML document with a form and several elements, and add some JavaScript code showing what we receive using different methods of getting form attributes.<br />
<br />
Example is available here (<a href='http://cyanstreet.net/articles/FormAttributes/example.html' rel='nofollow' terget='blank'>example.html</a>), its code looks like this:</p>
<p class='formula'>
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script&gt;<br />
function alert_stat() {<br />
	var f = document.getElementById("f");<br />
	var a = "";<br />
	a += "form.method = " + f.method + "\n\r\n\r";<br />
	a += "form.action = " + f.action + "\n\r";<br />
	a += "form.action.value = " + f.action.value + "\n\r\n\r";<br />
	a += "form.getAttribute('action') = " + f.getAttribute('action') + "\n\r";<br />
	a += "form.getAttribute('action').value = " + f.getAttribute('action').value + "\n\r\n\r";<br />
	a += "form.attributes['action'] = " + f.attributes['action'] + "\n\r";<br />
	a += "form.attributes['action'].value = " + f.attributes['action'].value + "\n\r\n\r";<br />
	a += "form.getAttributeNode('action') = " + f.getAttributeNode('action') + "\n\r";<br />
	a += "form.getAttributeNode('action').value = " + f.getAttributeNode('action').value + "\n\r\n\r";<br />
	a += "form.getAttribute('customName') = " + f.getAttribute('customName') + "\n\r";<br />
	a += "form.getAttribute('customName').value = " + f.getAttribute('customName').value + "\n\r";<br />
	alert(a);<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form action="value of form's 'action' attribute" id="f" customName="value of form's custom attribute" method='post'&gt;<br />
	&lt;input name="action" value="value of input (name='action')" /&gt;<br />
	&lt;input name="customName" value="value of input (name='cusomName') "&gt;<br />
&lt;/form&gt;<br />
&lt;input type='button' onclick="javascript:alert_stat()" value='click me'&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;
</p>
<p>If we open this example in any browser other than IE and press the button, we will see that values we receive are quite logical. But let’s see what happens in any version of Internet Explorer:<br />
"form.method" returns the "method" attribute, how it should, but "form.action" returns input object that has "name" attribute equal to "action". OK, let’s look further: "form.getAttribute('action')" doesn't return attribute, but also returns input object.<br />
<br />
 For me this is not logical at all. However, we still able to access attribute node by calling "form.attributes['action']" or "form.getAttributeNode['action']". We can see the same behavior if the name of the attribute is not html-standart.</p>
<p>The real problems may occur because usually "getAttribute" method is used to get an attribute, but in case described above this method doesn't return what it must return.</p>
<p>So we can assert the following:</p>
<p class='formula'><strong><br />
When getting HTML form’s attribute by getAttribute method in Internet Explorer, it will not return an attribute but will return a form field object, if the “name” attribute of this field is the same as the name of form’s attribute.<br />
</strong></p>
<p>Good point is that other browsers do not have such problems. However developing cross-browser application often makes us to take in account such illogical features.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://cyanstreet.net/programming/onmouseover-onmouseout-of-html-elements/" title="Specific of rising onMouseOver and onMouseOut events of HTML elements">Specific of rising onMouseOver and onMouseOut events of HTML elements</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cyanstreet.net/programming/html-form-attributes-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Specific of rising onMouseOver and onMouseOut events of HTML elements</title>
		<link>http://cyanstreet.net/programming/onmouseover-onmouseout-of-html-elements/</link>
		<comments>http://cyanstreet.net/programming/onmouseover-onmouseout-of-html-elements/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 14:21:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://cyanstreet.net/?p=129</guid>
		<description><![CDATA[In this clause I would like to review some specific of handling onMouseOver and onMouseOut events for HTML elements by JavaScript scenarios.

To see what is happening lets take simple HTML document with a few elements nested inside each other.


&#60;html&#62;
&#60;body&#62;
&#60;div&#62;
First level div
&#60;div class="d2"&#62;
Second level div &#60;br /&#62;
&#60;span&#62;span inside second div&#60;/span&#62;
&#60;/div&#62;
&#60;br /&#62;
&#60;span&#62;span inside first div&#60;/span&#62;
&#60;/div&#62;
&#60;/body&#62;

Then let’s modify [...]]]></description>
			<content:encoded><![CDATA[<p>In this clause I would like to review some specific of handling onMouseOver and onMouseOut events for HTML elements by JavaScript scenarios.</p>
<p><span id="more-129"></span></p>
<p>To see what is happening lets take simple HTML document with a few elements nested inside each other.<br />
</p>
<p class='formula'>
&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;div&gt;<br />
First level div<br />
&lt;div class="d2"&gt;<br />
Second level div &lt;br /&gt;<br />
&lt;span&gt;span inside second div&lt;/span&gt;<br />
&lt;/div&gt;<br />
&lt;br /&gt;<br />
&lt;span&gt;span inside first div&lt;/span&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;
</p>
<p>Then let’s modify it in the following way:</p>
<ul>
<li>For the top-level DIV add handlers for onMouseOver and onMouseOut events.</li>
<li>Add borders for the elements to see where limits of each element are.</li>
<li>Add element where log of handling events will be written and some JavaScript to write this statistic.</li>
</ul>
<p>
The HTML document we got available here (<a target="blank" rel="nofollow" href="http://cyanstreet.net/articles/JSevents/example_1.html">example_1.html</a>).<br />
Its code looks like this:</p>
<p class='formula'>
&lt;html&gt;<br />
	&lt;head&gt;<br />
		&lt;style&gt;<br />
			.d1 { width:250px; height:150px; border:1px solid red; }<br />
			.d2 { border:1px solid blue; margin:10px; }<br />
			span { border:1px solid cyan; }<br />
			#log_container { border:1px solid green; }<br />
		&lt;/style&gt;<br />
		&lt;script&gt;<br />
			var logContainer;<br />
			var index = 0;<br />
			function writelog(msg) { index++; logContainer.innerHTML += index + ". " + msg + "&lt;br /&gt;"; }<br />
			function mouseover() { writelog("onMouseOver Event"); }<br />
			function mouseout() { writelog("onMouseOut Event"); }<br />
		&lt;/script&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;<br />
		&lt;div class="d1" onmouseover="javascript:mouseover()" onmouseout="jabascript:mouseout()"&gt;<br />
			first div<br />
			&lt;div class="d2"&gt;<br />
				another div &lt;br /&gt;<br />
				&lt;span&gt;span inside second div&lt;/span&gt;<br />
			&lt;/div&gt;&lt;br /&gt;<br />
			&lt;span&gt;span inside first div&lt;/span&gt;<br />
		&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;<br />
		&lt;div id='log_container'&gt;&lt;/div&gt;<br />
	&lt;/body&gt;<br />
	&lt;script&gt;logContainer = document.getElementById('log_container');&lt;/script&gt;<br />
&lt;/html&gt;
</p>
<p>Now, if we move mouse cursor over the elements and look at the output statistic we may notice two regularities:</p>
<ul>
<li>When cursor crosses the red border (border of the top-level DIV with event handlers), as it should be, two events – onMouseOver and onMouseOut occur.</li>
<li>But interesting things happen when mouse cursor crosses limits of other elements (nested inside DIV with attached event handlers). Despite that cursor is not crossing borders of the top-level DIV, its events occur anyway. And they occur in the following order: each time the cursor crosses limits of a nested element (at that, it doesn’t matter if it moves inside or outside of the element) firstly onMouseOut event occurs, and then instantly onMouseOver event. And it is the same in any browser.</li>
</ul>
<p>
So now we can affirm the following: </p>
<p class='formula'><b>events onMouseOver and onMouseOut of a parent element occur when mouse cursor crosses limits of a child element.</b></p>
<p>Now lets look what can be affected by such behavior.<br />
<br />
The most widespread area where we can face usage of onMouseOver and onMouseOut events is drop-down menus on websites.<br />
<br />
In the simplest case they behave like this:<br />
When onMouseOver event for some element occur, some JavaScript code showing the menu is executed, and when onMouseOut event occur – some code hiding the menu.<br />
This logic could be ideal, if these “undesirable” events don’t occur when cursor moves inside a displayed menu. Such behavior may become the reason of rising of unexpected effect, because JavaScript code of the onMouseOver and onMouseOut event handles is executed multiple times when cursor crosses limits of nested elements.</p>
<p>Here is a part of the page from real project (<a target="blank" rel="nofollow" href="http://cyanstreet.net/articles/JSevents/example_2.html">example_2.html</a>) where I had to face such problems. If you open this page in IE, then you can notice how drop-down menus “blink” when cursor moves inside them. This happened exactly because of rising of the unexpected events.</p>
<p>
So we can make the following conclusion: while developing JavaScript scenarios we can not manage rising of unexpected onMouseOver and onMouseOut events, so that we must just take into account the specific reviewed in this article and adjust scenarios logic accordingly.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://cyanstreet.net/programming/html-form-attributes-internet-explorer/" title="Specific of getting HTML form attributes by JavaScript code in Internet Explorer">Specific of getting HTML form attributes by JavaScript code in Internet Explorer</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cyanstreet.net/programming/onmouseover-onmouseout-of-html-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Melee damage calculation in RO</title>
		<link>http://cyanstreet.net/ragnarok-online/melee-damage-calculation/</link>
		<comments>http://cyanstreet.net/ragnarok-online/melee-damage-calculation/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 11:23:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ragnarok Online]]></category>
		<category><![CDATA[RO mechanics]]></category>

		<guid isPermaLink="false">http://cyanstreet.net/?p=91</guid>
		<description><![CDATA[While developing the calc I spent many hours trying to understand - why the values of damage I'm getting in my calc are different from the ones I'm getting in the game. All formulas taken from different guides like this one were checked many times and were correct, but the values still was not the [...]]]></description>
			<content:encoded><![CDATA[<p>While developing <a href='http://cyanstreet.net/ragnarok-online/skills-damage-calculator/'>the calc</a> I spent many hours trying to understand - why the values of damage I'm getting in my calc are different from the ones I'm getting in the game. All formulas taken from different guides like <a rel='nofollow' target='blank' href='http://rodatazone.simgaming.net/mechanics/attacks.php'>this one</a> were checked many times and were correct, but the values still was not the same. With time I've finally got correct values. The biggest problem was in different ways of rounding intermediate values.<br />
<br />
In the guide presented below I've tried to describe correct way of calculation melee damage in RO.<br />
</p>
<p><span id="more-91"></span></p>
<p>Mathematical functions used in this guide:</p>
<ul>
<li>Floor(value) - round value down</li>
<li>Round(value) - mathematical round</li>
<li>Max(value1, value2) - returns maximum of value1 and value2</li>
<li>Min(value1, value2) - returns minimum of value1 and value2</li>
</ul>
<p></p>
<ol type='I' class='main_ol'>
<li>
<strong>Calculate attack form stats</strong></p>
<p class='formula'>ATK = STR + Round(Floor(STR/10) * Floor(STR/10)) + Floor(DEX/5) + Floor(LUCK/5)</p>
</li>
<li>
<strong>Add attack modifiers from equipment</strong><br />
i.e. Zipper Bear Card (ATK+30), Picky Card (ATK+10), Ring of Flame Lord (ATK+15) etc.</p>
<p class='formula'>ATK = ATK + AttackModifier1 + AttackModifier2 .. + AttackModifierN</p>
</li>
<li>
<strong>Add weapon attack</strong><br />
If attacking without weapon skip this and go to <strong>IV</strong> </p>
<ol type='1'>
<li>
			Calculate dex-based item </p>
<p class='formula'>DEX_ITEM = Min(WEAPON_ATK, Floor(DEX * (1 + (WEAPON_LVL-1) * 0.2)))</p>
</li>
<li>
			Calculate minimum and maximum weapon danger refine bonuses (MIN_WEAPON_DANGER_REF_BONUS, MAX_WEAPON_DANGER_REF_BONUS)</p>
<ol type='a'>
<li>If no danger refine then minimum and maximum bonuses are 0.</li>
<li>
						Else</p>
<p class='formula'>
							MIN_WEAPON_DANGER_REF_BONUS = 1<br />
							MAX_WEAPON_DANGER_REF_BONUS = DANDER_REF_MPLIER * (REFINE_RATE + WEAPON_LVL - 8)
						</p>
<p>
						Where:</p>
<ul>
<li>WEAPON_LVL - the level of equiped weapon</li>
<li>REFINE_RATE - the total refine rate of the equiped weapon</li>
<li>DANDER_REF_MPLIER depends on WEAPON_LVL:
<ul>
<li>lvl 1 - MPLIER=3</li>
<li>lvl 2 - MPLIER=5</li>
<li>lvl 3 - MPLIER=8</li>
<li>lvl 4 - MPLIER=14</li>
</ul>
</li>
</ul>
</li>
</ol>
</li>
<li>
			Apply calculated values to attack.<br />
			Note, that this is where damage value branches to minimum and maximum.</p>
<p class='formula'>
			MIN_DAMAGE = ATK + MIN_WEAPON_DANGER_REF_BONUS + Floor((DEX_ITEM + IMPOSITO_MANUS) * WEAPON_SIZE_MODIFIER)<br />
			MAX_DAMAGE = ATK + MAX_WEAPON_DANGER_REF_BONUS + Floor((WEAPON_ATK - 1) + IMPOSITO_MANUS) * WEAPON_SIZE_MODIFIER)
			</p>
<p>
			Where:</p>
<ul>
<li>WEAPON_ATK - the attack rate fo the equipped weapon</li>
<li>WEAPON_SIZE_MODIFIER - weapon size modifier. It depends on weapon type and size of target. If damager has Weapon Perfection buff (Blacksmith), then WEAPON_SIZE_MODIFIER always equal to 1.</li>
<li>IMPOSITO_MANUS - Imposito Manus buff  bonus = IMPOSITO_MANUS_LVL*5.</li>
</ul>
</li>
</ol>
</li>
<li>
<strong>Apply attack modifier buffs</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * (BUFF_BONUS + 100) / 100)<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * (BUFF_BONUS + 100) / 100)</p>
<p>
Where BUFF_BONUS is the bunus to attack from the buff in percents:</p>
<ul>
<li>100 for Gospel ATK+100%</li>
<li>5 + 3 * (SKILL_LEVEL - 1) for Provoke</li>
<li>5 for Power Thrust</li>
</ul>
<p>Note, that bonuses must be applied one by one, the order does not matter.
</li>
<li>
<strong>Apply active skill attack modifier</strong><br />
If attack is not a skill then skip this and go to <strong>VI</strong><br />
If skill has some special conditions (i.e. Azura Strike) then this item and items below must be skipped and damage must be calculated according to skill's formula.<br />
This formula and formulas below valid only for attack-based skills with no special conditions (i.e. Sonic Blow, Bash, Tripple Blow, etc)</p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * SKILL_DAMAGE_MODIFIER / 100)<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * SKILL_DAMAGE_MODIFIER / 100)
</p>
<p>
Where SKILL_DAMAGE_MODIFIER in percents.<br />
I.e. for Sonic Blow SKILL_DAMAGE_MODIFIER = SKILL_LEVEL * 50 + 200
</li>
<li>
<strong>Apply target's defence (hard def)</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * (100-RESULT_DEF) / 100)<br />
MAX_DAMAGE = Floor(MIN_DAMAGE * (100-RESULT_DEF) / 100)
</p>
<p>
Where RESULT_DEF is the value of basic def (from equipment) with different def modifiers applied. I.e:</p>
<ul>
<li>
			Provoke casted on mob reduces its def as</p>
<p class='formula'>RESULT_DEF = DEF - Floor(DEF*(5 + 5*PROVOKE_SKILL_LEVEL)/100)</p>
</li>
<li>
			Freeze and Stone Curse statuses reduce def by half</p>
<p class='formula'>RESULT_DEF = DEF - Floor(DEF * 50/100)</p>
</li>
<li>
			Poison status reduces def by 25%</p>
<p class='formula'>RESULT_DEF = DEF - Floor(DEF * 25/100)</p>
</li>
<li>
			Gospel bonus Def+100% increases def by 100%</p>
<p class='formula'>RESULT_DEF = DEF * 2</p>
</li>
</ul>
</li>
<li>
<strong>Apply target's vit defence (soft def)</strong></p>
<ol tyle='1'>
<li>
			Calculate minimum and maximum vit def</p>
<ol type='a'>
<li>
					For players:</p>
<p class='formula'>
					VIT_DEF_MIN = Floor(VIT * 0.5) + Floor(VIT * 0.3)<br />
					VIT_DEF_MAX = Floor(VIT * 0.5) + Max(Floor(VIT * 0.3), Floor((VIT * VIT)/150) - 1)
					</p>
</li>
<li>
					For mobs:</p>
<p class='formula'>
					VIT_DEF_MIN = VIT<br />
					VIT_DEF_MAX = Max(VIT, VIT + (Floor(this.v.Target.StatsVit/20) * Floor(this.v.Target.StatsVit/20)) - 1)
					</p>
</li>
</ol>
</li>
<li>
			Apply Vit def modifiers to the recieved values</p>
<ol type='a'>
<li>
					Angelus buff increases vit def:</p>
<p class='formula'>
					VIT_DEF_MIN = VIT_DEF_MIN + Floor(VIT_DEF_MIN * (5 * ANGELUS_SKILL_LEVEL) / 100)<br />
					VIT_DEF_MAX = VIT_DEF_MAX + Floor(VIT_DEF_MAX * (5 * ANGELUS_SKILL_LEVEL) / 100)
					</p>
</li>
<li>
					Provoke reduces vit def as</p>
<p class='formula'>
					VIT_DEF_MIN = VIT_DEF_MIN - Floor(VIT_DEF_MIN * (5 + 5 * PROVOKE_SKILL_LEVEL)/100)<br />
					VIT_DEF_MAX = VIT_DEF_MAX - Floor(VIT_DEF_MAX * (5 + 5 * PROVOKE_SKILL_LEVEL)/100)
					</p>
</li>
<li>
					Freeze and Stone Curse statuses on mob reduce its vit def by half</p>
<p class='formula'>
					VIT_DEF_MIN = Round(VIT_DEF_MIN * 0.5)<br />
					VIT_DEF_MAX = Round(VIT_DEF_MAX * 0.5)
					</p>
</li>
</ol>
</li>
<li>
			Apply recieved values:</p>
<p class='formula'>
			MIN_DAMAGE = MIN_DAMAGE - MAX_VIT_DEF<br />
			MAX_DAMAGE = MAX_DAMAGE - MIN_VIT_DEF
			</p>
</li>
</ol>
</li>
<li>
<strong>Apply non-danger weapon refine bonus</strong></p>
<p class='formula'>
MIN_DAMAGE = MIN_DAMAGE + WEAPON_NONDANGER_REF_BONUS<br />
MAX_DAMAGE = MAX_DAMAGE + WEAPON_NONDANGER_REF_BONUS
</p>
<p>
Where</p>
<p class='formula'>WEAPON_NONDANGER_REF_BONUS = MODIFIER * WEAPON_REFINE_RATE</p>
<p>
MODIFIER depends on level of equipped weapon:</p>
<ul>
<li>lvl 1 - MODIFIER=2</li>
<li>lvl 2 - MODIFIER=3</li>
<li>lvl 3 - MODIFIER=5</li>
<li>lvl 4 - MODIFIER=7</li>
</ul>
</li>
<li>
<strong>Apply Weapon Mastery Skill</strong><br />
I.e. Mace Mastery, Katar Mastery, Knuckle mastery, etc</p>
<p class='formula'>
MIN_DAMAGE = MIN_DAMAGE + MASTERY_BONUS<br />
MAX_DAMAGE = MAX_DAMAGE + MASTERY_BONUS
</p>
<p>
Where MASTERY_BONUS usually is 3*MASTERY_SKILL_LEVEL
</li>
<li>
<strong>Apply damage modifiers from skills</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * (DAMAGE_MODIFIER / 100))<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * (DAMAGE_MODIFIER / 100))
</p>
<p>
Where DAMAGE_MODIFIER is:</p>
<ol tyle='1'>
<li>
	 	For Enchant Deadly Poison</p>
<p class='formula'>DAMAGE_MODIFIER = 150 + 50 * EDP_SKILL_LEVEL</p>
</li>
<li>
		For Advanced Katar Mastery</p>
<p class='formula'>DAMAGE_MODIFIER = 110 + 2 * ADVANCED_KATAR_MASTERY_SKILL_LEVEL</p>
</li>
<li>
		For Sonic Acceleration</p>
<p class='formula'>DAMAGE_MODIFIER = 110</p>
</li>
</ol>
<p>and so on.<br />
Note, that this bonuses, as always, must be applied not by their summ, but one by one.
</li>
<li>
<strong>Apply different damage modifiers</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * (100 + DAMAGE_MODIFIER) / 100)<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * (100 + DAMAGE_MODIFIER) / 100)
</p>
<p></p>
<ol tyle='1'>
<li>
		Race modifiers.<br />
		i.e. Hydra Card gives race damage modifier 20 on demi-human race
	</li>
<li>
		Size modifiers<br />
		i.e. 2 Skeleton Worker Cards when hitting Medium-sized enemy give DAMAGE_MODIFIER=30
	</li>
<li>
		Element modifiers<br />
		i.e. 4 Drainliar Cards give DAMAGE_MODIFIER=80 on Water property target
	</li>
<li>
		All damage modifiers<br />
		i.e. Turtle General Card - DAMAGE_MODIFIER=20
	</li>
</ol>
</li>
<li>
<strong>Apply different resist modifiers</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * (100 - RESIST_MODIFIER) / 100)<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * (100 - RESIST_MODIFIER) / 100)
</p>
<p></p>
<ol type='1'>
<li>
		Race modifiers<br />
		i.e. race RESIST_MODIFIER is 40 if Thara Frog Card and Feather Beret equipped
	</li>
<li>
		Element damage modifiers<br />
		i.e. Raydrick card
	</li>
<li>
		Energy coat<br />
		different values depending on target's sp. Maximum resist is 30
	</li>
<li>
		Non-bosses damage modifiers<br />
		Alice Card increases damage from non-bosses on 40%. RESIST_MODIFIER = -40
	</li>
</ol>
</li>
<li>
<strong>Apply last damage modifiers</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * WOE * TERNA * ASSUMPTIO)<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * WOE * TERNA * ASSUMPTIO)
</p>
<p>
Where</p>
<ul>
<li>WOE is 0.6 for WoE mechanic and 1 for PvP/PvM mechanic</li>
<li>ASSUMPTIO is 0.666 if target has Assumptio buff and 1 otherwise</li>
<li>ERNA is 2 if target has Lex Aetherna, otherwise 1</li>
</ul>
</li>
<li>
<strong>Apply element modifier</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE * ELEMENT_MODIFIER/100)<br />
MAX_DAMAGE = Floor(MAX_DAMAGE * ELEMENT_MODIFIER/100)
</p>
<p>
Where ELEMENT_MODIFIER is percentage value of target's element and damager's weapon element.<br />
i.e. for Neutral element attack to Ghost 1 property target ELEMENT_MODIFIER is 25
</li>
<li>
<strong>Apply Fiber Lock bonus</strong><br />
If target is in Fiber Lock and damager's element is Fire, then</p>
<p class='formula'>MIN_DAMAGE = MIN_DAMAGE*2<br />
MAX_DAMAGE = MAX_DAMAGE*2</p>
</li>
<li>
<strong>Apply number of hits</strong></p>
<p class='formula'>
MIN_DAMAGE = Floor(MIN_DAMAGE / NUMBER_OF_HITS) * NUMBER_OF_HITS<br />
MAX_DAMAGE = Floor(MAX_DAMAGE / NUMBER_OF_HITS) * NUMBER_OF_HITS
</p>
<p>
I.e. for Sonic Blow skill NUMBER_OF_HITS is 8, for Bash is 1
</li>
</ol>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://cyanstreet.net/ragnarok-online/skills-damage-calculator/" title="WoE Skill damage calculator">WoE Skill damage calculator</a></li><li><a href="http://cyanstreet.net/ragnarok-online/woe-2-0-castles-flags/" title="WoE 2.0 castles flags">WoE 2.0 castles flags</a></li><li><a href="http://cyanstreet.net/ragnarok-online/" title="Ragnarok Online">Ragnarok Online</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://cyanstreet.net/ragnarok-online/melee-damage-calculation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changed layout</title>
		<link>http://cyanstreet.net/uncategorized/changed-layout/</link>
		<comments>http://cyanstreet.net/uncategorized/changed-layout/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:22:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://cyanstreet.net/?p=88</guid>
		<description><![CDATA[Just finished cutting of new layout. Thanks to sairin for the design =).
Related posts:none]]></description>
			<content:encoded><![CDATA[<p>Just finished cutting of new layout. Thanks to <a title="LC Theory" href="http://lc-theory.net">sairin</a> for the design =).</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li>none</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cyanstreet.net/uncategorized/changed-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UNDER CONSTRUCTION</title>
		<link>http://cyanstreet.net/uncategorized/hello-world/</link>
		<comments>http://cyanstreet.net/uncategorized/hello-world/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 12:00:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cyanstreet.net/?p=1</guid>
		<description><![CDATA[Hello there.
This site is currently under construction, but some stuff is already available. Ragnarok Online players may find this calculator and these maps interesting.
Related posts:none]]></description>
			<content:encoded><![CDATA[<p>Hello there.</p>
<p>This site is currently under construction, but some stuff is already available. Ragnarok Online players may find <a title="Ragnarok Online Skills Damage Calculator" href="http://cyanstreet.net/ragnarok-online/skills-damage-calculator/">this calculator</a> and <a title="Ragnarok Online WOE 2.0 Castles Flags" href="http://cyanstreet.net/ragnarok-online/woe-2-0-castles-flags/">these maps</a> interesting.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li>none</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cyanstreet.net/uncategorized/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
