 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
ncrsn
Joined: 10 Feb 2006 Posts: 168
|
Posted: Mon Mar 03, 2008 6:16 pm Post subject: |
|
|
PlayObjectCenteredEffect() is not the function you are looking for.
This code snippet is from Distro 095, spells/bless.src:
| Code: |
var magery := GetEffectiveSkill(caster, SKILLID_MAGERY);
var mod_amount := GetModAmount(magery);
var duration := GetModDuration(magery);
if(CanMod(cast_on, "str"))
DoTempMod(cast_on, "str", mod_amount, duration);
endif
if(CanMod(cast_on, "dex"))
DoTempMod(cast_on, "dex", mod_amount, duration);
endif
if(CanMod(cast_on, "int"))
DoTempMod(cast_on, "int", mod_amount, duration);
endif
|
If you want to change amount of strength, dexterity and/or intelligence casting should give, mod_amount is the variable to do that. It is return value of GetModAmount()-function, so look into it; or, if you want to add only local boost, change mod_amount to something else, like this:
| Code: |
var magery := GetEffectiveSkill(caster, SKILLID_MAGERY);
var mod_amount := 10 * GetModAmount(magery);
var duration := GetModDuration(magery);
if(CanMod(cast_on, "str"))
DoTempMod(cast_on, "str", mod_amount, duration);
endif
if(CanMod(cast_on, "dex"))
DoTempMod(cast_on, "dex", mod_amount, duration);
endif
if(CanMod(cast_on, "int"))
DoTempMod(cast_on, "int", mod_amount, duration);
endif
|
Now, in theory, you would get ten times more boost out of bless-spell (might be just a little overpowered, but what do I know).
If you want to change this easily for all instances, check out and modify pol/scripts/include/statMod.inc.
Edit:
Function GetModAmount():
| Code: |
function GetModAmount(magery)
var mod_amount := CInt(RandomInt(3) +(magery/10));
if(mod_amount > 10)
mod_amount := 10;
endif
return mod_amount;
endfunction
|
Notice that if mod_amount is higher than 10 (because your magery is 1000, this if will be true), it's value will be lowered to 10. Changing this might have unexpectable results in other scripts relying on this if-statement, so you should carefully check other scripts using this function if you are to modify it. |
|
 |
|
|
 |
 |
|