I need help with elements/ weakness/ resistance
My first question is how to read element from the pub? Is it after newdata->chareq = PacketProcessor::Number(buf[51], buf[52]); in eodata.cpp
EX: newdata->element = PacketProcessor::Number(buf[53], buf[54]);
All the element resistance are reading from the pub fine and I have npc weakness working, based off character resistance
EX:if (this->world->eif->Get(from->paperdoll[Character::Weapon])->fire && npc->weakness == 5)
{
the rest of the attack
}
14 years, 18 weeks ago
|
AustinB

Joined: 9th Jul 2010
Posts: 1400
Re: I need help with elements/ weakness/ resistance
- I believe it would be this, though i haven't touched effects yet..
-
if (this->world->eif->Get(from->paperdoll[Character::Weapon]) == fire && npc->weakness == 5)
{
the rest of the attack
}
You had it set to Character::Weapon])->fire, when it should be Character::Weapon]) == fire.
If you have tested this, and it works, GJ.
But if you havn't, i would look in npc.cpp to find stuff dealing with effects. (a shorter way of doing this would be to search through npc.hpp, to get like a void weakness() or something, then you can go into npc.cpp and search for void weakness() or whatever it was)
---
Create your own destiny, don't let someone else do it for you.
14 years, 18 weeks ago
|
Re: I need help with elements/ weakness/ resistance
look in eodata.cpp youll find the resistance
newdata->light = PacketProcessor::Number(buf[26]);
newdata->dark = PacketProcessor::Number(buf[27]);
newdata->earth = PacketProcessor::Number(buf[28]);
newdata->air = PacketProcessor::Number(buf[29]);
newdata->water = PacketProcessor::Number(buf[30]);
newdata->fire = PacketProcessor::Number(buf[31]);
but not the element
EX: newdata->element = PacketProcessor::Number(buf[53], buf[54]);
this is based of resistance, tested and works but not how it was intended to be used!
EX:if (this->world->eif->Get(from->paperdoll[Character::Weapon])->fire && npc->weakness == 5)
{
the rest of the attack
}
if i can get it to read from the pub correctly i believe it would look like this
if (this->world->eif->Get(from->paperdoll[Character::Weapon]) ->element == 5 && npc->weakness == 5)
{
the rest of the attack
}
I have set up the npc weakness and tested off resistance. I just want to get it right, If someone has info on the element/resistance/weaknesses system, how their supposed to work and how the all intertwine Id greatly appreciate your input!
14 years, 18 weeks ago
|
Re: I need help with elements/ weakness/ resistance
I got it reading from the pub useing
newdata->element = PacketProcessor::Number(buf[53]); and its now working like this
if (this->world->eif->Get(from->paperdoll[Character::Weapon]) ->element ==1 && npc->weakness == 1)
{
the rest of the attack
}
another question is, how does the Elem. and neutral on the client tie in to the elemental items?
14 years, 18 weeks ago
|
Apollo
Administrator
Joined: 14th Apr 2009
Posts: 2759
Re: I need help with elements/ weakness/ resistance
I did some research on this a loooooong time ago and passed the info on to Rena. There is really only one flag for each pub file that determines the elemental property.
For Weapons: Input the value of the opposite element (Ice Blade attacks Fire Element)
For Armors: Input the value of the same element (Dark Endur protects Darkness Element)
For Spells: Input the value of the opposite element (Whirl attacks Fire, FireBall attacks Earth)
For NPC's: Input the value of the weakness (Shark is weak against Air(SmThunder))
Also, when you find the element flag, the flag that immediately follows is a bonus attack/resistance property.
A good method for calculation would be:
vs Same = 50%, vs Different = 100%, vs Weakness = 150%, also add/subtract bonus.
The individual element tags in the item file are not used by the EO client.
Hope this is helpful.
14 years, 18 weeks ago
|
Re: I need help with elements/ weakness/ resistance
Yes it does help me understand how to calculate the attacks/bonuses and helps me with figuring out how the spells,weapons,armors, and npcs interact with the elements!
vs Same = 50%, vs Different = 100%, vs Weakness = 150%, also add/subtract bonus.
So vs same or npc weakness/or armor resitance for instance, 1light/2dark
if (this->world->eif->Get(from->paperdoll[Character::Weapon])->element == 1 && this->world->eif->Get(character_ptr->paperdoll[Character::Armor])->light )
{
int amount = util::rand(from->mindam / 2, from->maxdam / 2);
else if (this->world->eif->Get(from->paperdoll[Character::Weapon])->element == 1 && npc->weakness == 2) // test resistance
{
int amount = util::rand(from->mindam / 2, from->maxdam / 2 );
vs Different meaning normal damage no calculation needed! 1light/2dark/3earth/4wind/5water/6fire. Only light/dark effect eachother 3earth/4wind effect eachother 5water/6fire effect eachother!
vs Weakness/or opposite resitance = 150%,
if (this->world->eif->Get(from->paperdoll[Character::Weapon])->element == 1 && this->world->eif->Get(character_ptr->paperdoll[Character::Armor])->dark )
{
int amount = util::rand(from->mindam * 1.5, from->maxdam * 1.5);
if (this->world->eif->Get(from->paperdoll[Character::Weapon])->element == 1 && npc->weakness1 == 1)
{
int amount = util::rand(from->mindam * 1.5, from->maxdam * 1.5 );
Does this look correct, because its going to be a few huge chunks of code?
Should nps have attack bonuses based of their weaknesses?
14 years, 18 weeks ago
|
Apollo
Administrator
Joined: 14th Apr 2009
Posts: 2759
Re: I need help with elements/ weakness/ resistance
A better nethod would be to set an element variable and multiply the from->mindam and from->maxdam by it rather than retyping the same calculation over 3 times.
It appears Vult-r intended Light and Dark to act on each other, and Earth>Air>Water>Fire>Earth where the element left is greater than the element to the right. This hypothesis is based on the original EO pub data. The only in-game evidence of this is was the Ice Blade
vs Rock. In EO main, the Scav Bow should be strong against Crows, but you would have to test that with an equally damaging weapon to confirm damage difference, that is if you can get on EO main.
14 years, 18 weeks ago
|
Re: I need help with elements/ weakness/ resistance
Apollo posted: (28th Dec 2010 05:32 pm)
A better nethod would be to set an element variable and multiply the from->mindam and from->maxdam by it rather than retyping the same calculation over 3 times.
It appears Vult-r intended Light and Dark to act on each other, and Earth>Air>Water>Fire>Earth where the element left is greater than the element to the right. This hypothesis is based on the original EO pub data. The only in-game evidence of this is was the Ice
Bladevs Rock. In EO main, the Scav Bow should be strong against Crows, but you would have to test that with an equally damaging weapon to confirm damage difference, that is if you can get on EO main.
Ive tryed a few different ways and Im not sure how to set the variable?
Earth>Air>Water>Fire>Earth where the element left is greater than the element to the right.
EX: Earth wep vs air npc->weakness 4/ resistance->air, but are you saying Earth is the strongest
over all elements, or just air. Then water over fire etc?
how ive been trying to do it is EX: Earth wep vs Air npc->weakness 4/ resistance->air
is mindam * 1.5, maxdam * 1.5
14 years, 18 weeks ago
|
Apollo
Administrator
Joined: 14th Apr 2009
Posts: 2759
Re: I need help with elements/ weakness/ resistance
Earth is effective against Air, Air is effective against Water, Water is effective against Fire, and Fire is Effective against Earth. It is Rock Paper Scissors.
14 years, 18 weeks ago
|
Kaylinz

Joined: 2nd Dec 2010
Posts: 776
Re: I need help with elements/ weakness/ resistance
But cant air be effective against fire also??
14 years, 18 weeks ago
|
Nerrevar

Joined: 14th Mar 2009
Posts: 780
Re: I need help with elements/ weakness/ resistance
Kaylinz posted: (28th Dec 2010 08:51 pm)
But cant air be effective against fire also??
Touché.
Apolly your right about the "rock paper scissors" concept.
But theres also the other things to consider.
Air could be effective against fire. Earth and water could be effective against eachother.
Earth could be effective against fire.
I think it would be better to have it more advanced to be honest. After all, isnt that what everyone is going for now?
14 years, 18 weeks ago
|
Re: I need help with elements/ weakness/ resistance
It can be setup to fit the server owners preference, Im just trying to see how the original element system was set up, and release my findings. It will be easy to modify how ever you want!
14 years, 18 weeks ago
|
Apollo
Administrator
Joined: 14th Apr 2009
Posts: 2759
Re: I need help with elements/ weakness/ resistance
Nerrevar posted: (28th Dec 2010 09:08 pm)
Kaylinz posted: (28th Dec 2010 08:51 pm)
But cant air be effective against fire also??
Touché.
Apolly your right about the "rock paper scissors" concept.
But theres also the other things to consider.
Air could be effective against fire. Earth and water could be effective against eachother.
Earth could be effective against fire.
I think it would be better to have it more advanced to be honest. After all, isnt that what everyone is going for now?
Yes, it certainly could be set to the operator's preference. Keep in mind though, you have 6 elements to choose from. This concept is based on the original's pub data. I assume an Air attack would be something like Sm Thunder vs a Shark that has the weakness value for Air. Most RPG's use this type
of format. The thing to remember, it is up to the operator to decide how to implement this. Vodka will most likely have a variable rate for each of the 3 elemental scenarios. Your best bet is to keep it simple since you are quite limited to combinations of elements. The true strategy will be
finding a weapon/armor combo to beat a certain NPC, not the mechanics of elemental factoring.
14 years, 18 weeks ago
|
Addison

Joined: 24th Mar 2009
Posts: 1380
Re: I need help with elements/ weakness/ resistance
Alright, so i decided i'll give some code on the way i'd do it. We all understand that the EIF,ENF, & ESF classes all hold light,dark,earth,air,water,fire values. Only the EIF has the values, but you have to just add the rest in yourself. So, i would set them all as a percentage. Forexample,
Ice blade I would put 75 on water and 25 on light. It should all add up to 100 but if it doesn't oh well. Armors & NPCs should be what it's resistant too. Weapons & Spells should be what it is strong at. This would be what the code would look like(it's only a rough draft, if itdoesn't work,
use common sense to fix).
In Map::Attack(Character *from, etc) (Player attacking NPC)
Where you see this:
if (rand > hit_rate)
{
amount = 0;
}
I would add right after:
else
{
amount -= (npc->Data()->light * this->world->eif->Get(from->paperdoll[Character::Weapon])->light) / 100; //Reduces damage because NPC is resistance to light
amount += (npc->Data()->light * (100 + this->world->eif->Get(from->paperdoll[Character::Weapon])->dark)) / 100; //Increases damage because NPC is resistant to light and it's a darkness weapon
// Continue on with this and add the rest that you think is resistant/absorbant.
}
Now, I will explain what this formula does above in the code. The first formula takes the NPCs percentage of light(how resistant they are to it) and multiplies it to how much light the weapon contains. Then it divides by 100 since the percentage is out of 100.
The second formula is the same as the first except it gives an extra 100 points to the darkness element. That way the damage increases. For example, say you have a sun god NPC that is 80% resistant to light and you're using a darkness weapon that is 50% darkness. 80 percent of 50 is only 40.Instead
you want 80 percent of 150 since darkness is the opposite of light.
Of course you would have to add in spells, PK, and npc attacking a player later on, but this is how I would have the element system work.
A suggestion if you want to use my system or impliment any of my ideas; To calculate how 'resistant' a character is to a certain element I would use this:
Armor: 40%
Shield: 25%
Helmet: 10%
Boots: 5%
Gloves: 2.5%
Necklace: 5%
Charm is 5%
The two bracers: 2.5%
The two rings: 2.5%
The two braclets: 2.5%
That's just an example, you can edit them.
---
http://www.addipop.com
14 years, 18 weeks ago
|
Re: I need help with elements/ weakness/ resistance
Thats a cool system to for resistance, and weakness although
amount-=npc->weakness==1((this->world->eif->Get(from->paperdoll[Character::Weapon])->light) / 100);//wouldnt that be based off resistance rather than the element it
self? How Im using the element and weakness in the pub is 1-6, and resistance has individual labels light,dark,earth,air,water,fire and Im thinking those can be labeled as percentages of resistance,butIcant see how the elements/weakness slot could be divided in to percentages?!
14 years, 18 weeks ago
| | | | | | | | | | | | | | | |