[Guide] Ameliorate skill in source

11/10/2012 19:13 WinterWave#1
Hello,

I show to you how to ameliortae the power of a skill directly in source.

This is more convenient than edit propSkillAdd '-'

Go in your WORLDSERVER folder, and open AttackArbitter.cpp.

Search it :

Quote:
int CAttackArbiter::OnAfterDamage( ATTACK_INFO* pInfo, int nDamage )
And in this function, add this (just an example) :

Quote:
if( pInfo->GetSkill() == SI_VAG_ONE_CLEANHIT );
{
nDamage = nDamage * 2;
}
Damage of SI_VAG_ONE_CLEANHIT skill are multiplied by 2.

Winter' :)
11/10/2012 19:51 Mognakor#2
Nothing special and it's also worse than using the ressource cause it will make your server run slower even if it's just a bit.
11/10/2012 20:17 WinterWave#3
It's just a tip, and server run slower if you put 500~ things like that.
11/11/2012 18:14 SourceShop#4
Nice , good idea, is good :)
11/11/2012 23:07 Мarvіn#5
Why you use this function?

I'm using this one (already used by galalab for spiritbombs)

Quote:
CMover::GetDamageMultiplier
Quote:
case SI_ELE_STF_THUNDERBOLT:
factor *= 1.5;
break;
11/12/2012 19:51 Pumaaa#6
If ya want to do this properly, just edit the LoadPropaddskill function.

if( propAddSkill.dwID == SI_VAG_ONE_CLEANHIT );
{
propAddSkill.dwAbilityMin =* 2;
propAddSkill.dwAbilityMax =* 2;
}

Would be the snippet for example.

This would only affect your client/server loadspeed minimally and wouldn't be called on each attack.
11/12/2012 20:32 WinterWave#7
Thanks Marvin and Pumaa for council. =)
11/13/2012 18:56 Mognakor#8
Quote:
Originally Posted by Pumaaa View Post
If ya want to do this properly, just edit the LoadPropaddskill function.

if( propAddSkill.dwID == SI_VAG_ONE_CLEANHIT );
{
propAddSkill.dwAbilityMin =* 2;
propAddSkill.dwAbilityMax =* 2;
}

Would be the snippet for example.

This would only affect your client/server loadspeed minimally and wouldn't be called on each attack.
Also would have to be in the LoadPropSkill function for dwReferStat1 and/or dwReferStat2 to adjust damage growth per Stat point.
11/16/2012 02:04 xMootie#9
Quote:
Originally Posted by Mognakor View Post
Nothing special and it's also worse than using the ressource cause it will make your server run slower even if it's just a bit.
I agree, it is worse than using resource. However, not because of the extra binary operation.

It's less convenient than resource editing because it requires source access. If you're running a proper server, not all administrators should have access to source code. If an administrator wants to make a modification without asking the developer to modify the source code, resource is very useful. That's the point of having resource if you haven't realized.

On top of the convenience of using resource, it's also more organized to keep data such as skill stats in resource. It makes it easier to modify skills in the future because you don't have to check both the source multipliers and the resource stats.

That being said, it would be best if all skill multipliers were done in either resource scripting(such as lua) or static resource data. The v15 source does indeed have damage logic in source, which is inconvenient for production.
11/16/2012 21:48 WinterWave#10
It's for local server, the access to source is not present ^^

I agree, it would be best, but it's more practice i think to do that with a multiplier in source.