GetIsReactionTypeHostile

From NWN Lexicon
Revision as of 05:48, 12 September 2017 by 46.161.9.56 (talk) (z7j5yqi6)
Jump to: navigation, search



GetIsReactionTypeHostile(object, object)

Determine whether a creature has a hostile reaction towards another given creature.

int GetIsReactionTypeHostile(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

The target creature to test.

oSource

The source creature to test the feelings of. (Default: OBJECT_SELF)


<a href=https://loansforbadcredit.us.com/>bad credit payday loans direct lenders</a> <a href=https://writemyessay.us.com/>write my essay online</a>

<a href=https://onlineloans.us.com/>payday loans direct lenders</a> <a href=https://loansforbadcredit.us.com/>online payday loans for bad credit</a>

Version

1.62

Example

// This is basically a single check for a target.
 
// GetIsReactionTypeHostile() is used for all spells which affect
// only enemies inside a blast, such as Slow. These spells are 
// never going to affect allies, but likewise might fail if the fact is
// PvP settings are against the caster.
 
// Basically, if a slow spell were to be fired against some creatures,
// several things would stop it - from this one function check (and
// this is why it is so important).
 
// 1. If the caster is allied with the target, there will be no effect. 
//     Note, that unless GetIsReactionTypeNeutral() is also used,
//     no neutral players will be affected either. This is the bare
//     basic of the function - it will only return TRUE if the target is
//     an enemy, unless stated below.
// 2. Depending on the PvP settings, no PvP means no enemies,
//     especially other PC's, can be affected in any way - no fighting!
//     thusly this returns FALSE.
// 3. There are other cases - party PvP and like/dislike flags state
//     if they are even an enemy at all.
 
// Without these basic checks, as well as, of course, Like/Dislike
// flags, personal reputations and so on, the spell could really break
// the game.
 
void main()
{
    // Get spell target
    object oTarget = GetSpellTargetObject();
 
    // They must be an enemy *and* they must not break PvP rules
    // * NOTE: There is no !, this is a pure "must be true" check!
    if(GetIsReactionTypeHostile(oTarget))
    {
        // Do 5 damage to them, if we don't break PvP and so on
        effect eDam = EffectDamage(5);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
    }
}

wh0cd766149 <a href=http://triamterene.zone/>triamterene</a> <a href=http://meloxicam.pro/>meloxicam</a> <a href=http://genericadvair.pro/>advair cost</a>