Aller au contenu

Photo

a creature that looks like an item? -


  • Veuillez vous connecter pour répondre
15 réponses à ce sujet

#1
Antares

Antares
  • Members
  • 51 messages

hello,

 

I am working on a magic jar spell type.

 

I'd like to summon a creature with a share damage effect, as long as the creature is alive, the summoner takes only minimal damage.

The creature, should look like this

 

Immagine.jpg

 

but I don't know how a creature could look like an item :(

do you know?



#2
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Yes. Someone has to save it as a creature type and add one bone to it, even if it's not animated.

#3
Antares

Antares
  • Members
  • 51 messages

I have been able to do it myself!

 

NWN2_SS_081214_135344.jpg

 

I studied the black tentacles in the sef file, and I replaced the tentacles with the soul house. :D



#4
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
But how can it take damage if it's only a VFX? It will never die or take hits like you wanted

#5
Antares

Antares
  • Members
  • 51 messages

it' s an effect added to the invisible man creature! ;)

Immagine.jpg


  • rjshae aime ceci

#6
Antares

Antares
  • Members
  • 51 messages

here is the script that summons the Jar and apply the share damage effect and kill the caster if the jar is destroied

 

Spoiler



#7
Tchos

Tchos
  • Members
  • 5 063 messages

Looks like something I could use some time!



#8
kevL

kevL
  • Members
  • 4 070 messages

i agree this is brilliant

here's my take on the scripting. I had to take Immortal off, to let Dismissal and Banishment work right. Otherwise it's completely untested.

//::///////////////////////////////////////////////
//:: Magic Jar
//:://////////////////////////////////////////////

#include "x2_inc_spellhook"

// Applies a damage-sharing effect to the summons.
void ApplyShareEffect(int iDur);
// Runs a pseudo-heartbeat that checks for death of the summons
// and kills the summoning caster if so.
void hb_CheckDeath(object oSummon, object oCaster);


// ___________
// ** MAIN ***
// -----------
void main()
{
    if (!X2PreSpellCastCode())
    {
        // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        return;
    }

    int iDur = 50;
    if (GetMetaMagicFeat() == METAMAGIC_EXTEND)
    {
        iDur *= 2;
    }

    effect eSummon = EffectSummonCreature("AA_MagicJar", VFX_HIT_SPELL_SUMMON_CREATURE);
    ApplyEffectAtLocation(
                        DURATION_TYPE_TEMPORARY,
                        eSummon,
                        GetSpellTargetLocation(),
                        RoundsToSeconds(iDur));

    SetLocalFloat(OBJECT_SELF, "jar_TimeLeft", IntToFloat(iDur));
    DelayCommand(0.1f, ApplyShareEffect(iDur));
}


// ________________
// ** FUNCTIONS ***
// ----------------

// Applies a damage-sharing effect to the summons.
void ApplyShareEffect(int iDur)
{
    object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED);

    // ? summon takes 10%, Caster takes only 1% ? (the rest of damage is lost)
    effect eShare = EffectShareDamage(oSummon, 10, 1);
    ApplyEffectToObject(
                    DURATION_TYPE_TEMPORARY,
                    eShare,
                    OBJECT_SELF,
                    RoundsToSeconds(iDur));

    DelayCommand(0.5f, hb_CheckDeath(oSummon, OBJECT_SELF));
}

// Runs a pseudo-heartbeat that checks for death of the summons
// and kills the summoning caster if so.
void hb_CheckDeath(object oSummon, object oCaster)
{
    if (!GetIsObjectValid(oCaster) // caster died. note: Caster is OBJECT_SELF.
        || GetIsDead(oCaster))
    {
        // Could play a vFx here.
        SetScriptHidden(oSummon, TRUE);
        DestroyObject(oSummon);

        return;
    }


    float fDur = GetLocalFloat(oCaster, "jar_TimeLeft");
    if (fDur < 0.1f)
    {
        return; // don't kill the caster if the spell duration expires.
        // fDur might need adjusting
        // because timing in NwN is not absolutely accurate.
    }

    SetLocalFloat(oCaster, "jar_TimeLeft", fDur - 0.5f);


    if (!GetIsObjectValid(oSummon)
        || GetIsDead(oSummon))
    {
        effect eDeath = EffectDeath(TRUE, TRUE, TRUE);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oCaster);

        // Could play a vFx here.
        SetScriptHidden(oSummon, TRUE);
        DestroyObject(oSummon);

        return;
    }

    DelayCommand(0.5f, hb_CheckDeath(oSummon, oCaster));
}

  • Antares aime ceci

#9
Antares

Antares
  • Members
  • 51 messages

oh thanks for the revision. The setImmortal command is due to the fact that when the caster unsummons the creature, summons a new one, or simply sleeps, dies.

Somehow, the game considers the health of an unsummoned creature = 0,



#10
kevL

kevL
  • Members
  • 4 070 messages

hm, that's a tuff one.

here's the problem with Banishment/Dismissal: it uses EffectDeath to get rid of the summons. But EffectDeath won't do anything to an Immortal creature (tested)


personally, i'd be tempted to just let the critter go, on sleep etc. Unless there's something else 'funny' going on when you say,

the game considers the health of an unsummoned creature = 0

  • Antares aime ceci

#11
Antares

Antares
  • Members
  • 51 messages

hm, that's a tuff one.

here's the problem with Banishment/Dismissal: it uses EffectDeath to get rid of the summons. But EffectDeath won't do anything to an Immortal creature (tested)


personally, i'd be tempted to just let the critter go, on sleep etc. Unless there's something else 'funny' going on when you say,

 

Here is what I found:

- when the jar is unsummoned or the party sleeps, the game considers its health = 0, and the caster dies.

If it is immortal, when I unsummon it or sleep, it disappears and is not considered to have health 0.

 

Banishment, just tested, does nothing to the Jar, but sounds right to me. I consider it a magical object created by the caster, rather than a summoned creature.

 

// ? summon takes 10%, Caster takes only 1% ? (the rest of damage is lost)

 

10% caster, 1% jar.

However, the jar itself ha just 10 hp e no armor and vulnerable to anything. So the caster has to find a right place to create it, and cast spell on it for protection and concealment. (horcrux like) :devil:



#12
kevL

kevL
  • Members
  • 4 070 messages

ah, sounds like immortal's the way to go then

 

 

Ps. what spell level?  .. 5?



#13
Antares

Antares
  • Members
  • 51 messages

I wanted to make it 5, like the P&P game, but the concept itself (tranfer the own vital force to an item) made me chooce a higher level, so 7.



#14
kevL

kevL
  • Members
  • 4 070 messages

7 was my second guess  :)



#15
Morbane

Morbane
  • Members
  • 1 883 messages

I wanted to make it 5, like the P&P game, but the concept itself (tranfer the own vital force to an item) made me chooce a higher level, so 7.

 

 

7 was my second guess  :)

 

bah! i guessed 6 - just can't seem to logic things lately \\//



#16
kevL

kevL
  • Members
  • 4 070 messages

6 is actually the split-the-difference sensible approach

 

Lol