98 lines
4.3 KiB
Plaintext
98 lines
4.3 KiB
Plaintext
// Shorts and sweet this is the blessing section.
|
|
void Bless(object oPlayer, string sDeity)
|
|
{
|
|
effect eEffect;
|
|
/*/
|
|
Example of what you need.
|
|
|
|
if(sDeity == "") // This will be the deity check
|
|
{eEffect = [effect here];} // and what (s)he will do.
|
|
|
|
On the filter to the right you can type in "effect" to see what is
|
|
avalible. Simply click on the effect and read the description at the
|
|
bottom that will automaticly appear.
|
|
|
|
As an example...
|
|
EffectAbilityIncrease
|
|
|
|
This is filled in simply.
|
|
int nAbilityToIncrease // This is your ability.
|
|
ABILITY_CHARISMA ABILITY_CONSTITUTION ABILITY_DEXTERITY
|
|
ABILITY_INTELLIGENCE ABILITY_STRENGTH ABILITY_WISDOM
|
|
|
|
int nModifyBy // This is the amount raised, Example : 4
|
|
|
|
Therefor, to raise a players strength by 4 it would appear like this.
|
|
effect eEffect = EffectAbilityIncrease(ABILITY_STRENGTH, 4);
|
|
/*/
|
|
////////////////////////////////////////////////////////////////////////////
|
|
if(sDeity == "Shar") // Shar will grant Ultravision, and 50% concealment
|
|
{
|
|
effect e1 = EffectUltravision();
|
|
effect e2 = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
|
|
effect eAllEffects = EffectLinkEffects(e1,e2);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e1, oPlayer, 300.0);
|
|
}
|
|
if(sDeity == "Helm") // Helm will grant 5/- to physical for 5 Minets
|
|
{
|
|
// This one is a little more complexe as we need many effects.
|
|
// Luckaly Bioware made this a little easier with links
|
|
|
|
// start off with Maces and blunt weapons
|
|
effect e1 = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 5, 0);
|
|
// next let's do arrows and piercing weapons.
|
|
effect e2 = EffectDamageResistance(DAMAGE_TYPE_PIERCING, 5, 0);
|
|
// lastly greataxes and slashing weapons
|
|
effect e3 = EffectDamageResistance(DAMAGE_TYPE_SLASHING, 5, 0);
|
|
// Now this is 3 effects so we must mash them into 1 total effect.
|
|
// which is where effect linking is handy.
|
|
effect e4 = EffectLinkEffects(e1,e2);
|
|
// That takes care of Blunt and Piercing, now to finish it off.
|
|
effect eAllEffects = EffectLinkEffects(e3,e4);
|
|
// Slasing is in there now.
|
|
// Now we must make sure that all these are
|
|
// under the right lable or that was for nothing.
|
|
eEffect = eAllEffects;
|
|
// That wasn't so hard. Helm now gives 5/- on all physical
|
|
}
|
|
///////////////////////////////////////////////////////////////////////////
|
|
else // if no Deity is placed above we can do something sipmle like...
|
|
// grant players there level in Temporary hitpoints.
|
|
// level 20 = +20 temp hits
|
|
{eEffect = EffectTemporaryHitpoints(GetHitDice(oPlayer));}
|
|
// That's done, so don't feel bad if you forget tag.
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// Adding visual effect to make it look pretty.
|
|
effect eVisual = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE, FALSE);
|
|
// Again with effect linking so that it's prettyfull and benificial.
|
|
effect eBoth = EffectLinkEffects(eEffect,eVisual);
|
|
// the last of the Bless funtion is to apply it to the player.
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBoth, oPlayer, 300.0);
|
|
// I have this set up so anything lasts for five minets. Not alot of time
|
|
// but if you they don't like it they don't have to pray...
|
|
if(sDeity == "Moradin") // Moradin = Stoneskin
|
|
{
|
|
ActionCastSpellAtObject(SPELL_STONESKIN, oPlayer, METAMAGIC_EXTEND, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
|
|
}
|
|
}
|
|
// Nothing from here on needs to be touched. I'll still say what it dose though.
|
|
void main()
|
|
{
|
|
object oPlayer = GetPCSpeaker(); // Player
|
|
string sDeity = GetDeity(oPlayer); // Player Deity
|
|
string sTag = GetTag(OBJECT_SELF); // Shrine Tag
|
|
// if your Deity is the same as the shrine Tag use Bless function above.
|
|
if(sTag == sDeity)
|
|
{
|
|
FloatingTextStringOnCreature(sDeity+" thanks you for your prayer.", GetPCSpeaker(), TRUE);
|
|
Bless(oPlayer, sDeity); // Refer to the Bless function.
|
|
}
|
|
// if your deity is not the same then you get a little regeneration.
|
|
else
|
|
{
|
|
FloatingTextStringOnCreature(sDeity+" thanks you for your prayer.", GetPCSpeaker(), TRUE);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectRegenerate(1,IntToFloat(GetHitDice(oPlayer))),oPlayer);
|
|
}
|
|
}
|