Elin:Code Analysis/Ether Diseases: Difference between revisions

no edit summary
(Created page with "{{spoiler}} ==Ether Diseases (EA23.61)== ===Depiction of Ether Disease in code: an Index=== <syntaxhighlight lang="c#" line="1"> public const int etherManaBattery = 1564; public const int etherPoisonHand = 1565; public const int etherProvoke = 1563; public const int etherStupid = 1561; public const int etherWeak = 1560; public const int etherAddict = 1559; public const int etherRain = 1558; public const int etherHead = 1557; public const int etherViolence = 1556; public...")
 
No edit summary
Line 138: Line 138:
* A random chance of 50% is applied first, so there is 50% chance your potion will be spared.
* A random chance of 50% is applied first, so there is 50% chance your potion will be spared.
* It also looks like it will transform a whole stack of your potions at once.
* It also looks like it will transform a whole stack of your potions at once.
=== Provoke (Enemy Of All Living Things) ===
<syntaxhighlight lang="c#" line="1">
    case 1563:
ModBase(77, -a * (3 + num / 4), hide: false);
break;
</syntaxhighlight>
* This negatively modify your charisma (Evalue 77) by (3 + Character level / 4) per level of disease.
** We saved a bit of code analysis for esthetic purpose. See vPotential = Char.LV for more detail.
<syntaxhighlight lang="c#" line="1">
    if (!owner.IsPCFactionOrMinion && EClass.rnd(owner.isSynced ? 50 : 2000) == 0 && owner.hostility == Hostility.Neutral && EClass.pc.party.HasElement(1563)
        && !owner.race.tag.Contains("animal") && EClass._zone.IsTown && !EClass._zone.IsPCFaction)
{
EClass.pc.DoHostileAction(owner);
}
</syntaxhighlight>
* Every living thing will turn against you, unless:
** It is your own faction member or pets.
** It is not Neutral towards you already.
** It is an animal.
** You are not in a town.
** You are in your own Faction area.
* A random number still need to be rolled for this effect to apply, and it looks like the possibility is pretty, pretty low (2%).
* This effect apply if ANYONE in your party have this ether disease, so watch out.
<syntaxhighlight lang="c#" line="1">
    if (EClass.pc.party.HasElement(1563) && num < 0)
{
num = num * 30 / 100;
}
</syntaxhighlight>
* This code appears when a Karma negative modification need to be calculated. Your karma decrease will be cut to 30%, round down to nearest integer.
* So -5 becomes -1, -1 becomes 0.


[[Category: EN]]
[[Category: EN]]
[[Category: Elin Spoiler]]
[[Category: Elin Spoiler]]
392

edits