La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 20/05/2024 05:49:27


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
tempus
Novice
Inscrit le: 12 Juil 2006
Messages: 15
Répondre en citant
Posté le : 22/07/2006 10:26:42 Sujet du message : variable anti deco/reco prob rez

Voila, recement j'ai fait un topic car j'avai un prob pour faire marcher une variable, qui permet de retenir le stauts de "mort" d'un pj, pour eviter que le petit malin fasse un deco/reco pour revivre.

le topic etait ici:
[http]

Mais a present, quand les joueurs meurents, et qu'un pj les rez, a la prochaine reco le pj sera a nouveau mort!

J'en ai deduis que l'erreur venait des variables dans les script suivant:
nw_s0_raisdead
et
nw_s0_resserec

Les voila:
nw_s0_resserec
NWScript :
//:Confused///////////////////////// /////////////////////
//:: [Ressurection]
//:: [NW_S0_Ressurec.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:Confused///////////////////////// ////////////////////
//:: Brings a character back to life with full
//:: health.
//:: When cast on placeables, you get a default error message.
//::  * You can specify a different message in
//::      X2_L_RESURRECT_SPELL_MSG_RESRE F
//::  * You can turn off the message by setting the variable
//::    to -1
//:Confused///////////////////////// ////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:Confused///////////////////////// ////////////////////
//:: Last Updated By: Georg Z on 2003-07-31
//:: VFX Pass By: Preston W, On: June 22, 2001

#include "x2_inc_spellhook"

void main()
{

/*
  Spellcast Hook Code
  Added 2003-06-20 by Georg
  If you want to make changes to all spells,
  check x2_inc_spellhook.nss to find out more

*/


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

// End of Spell Cast Hook

//---------------------------- ------------------------------ ----------------//
//            Positionement de la balise de mort a " FALSE "                //
//---------------------------- ------------------------------ ----------------//
    int BALISE_MORT = GetCampaignInt("bddbvsm","balise_mort",oTarget);
    SetCampaignInt("bddbvsm","balise_mort",FALSE,oTarget);

//---------------------------- ------------------------------ ----------------//

    //Get the spell target
    object oTarget = GetSpellTargetObject();
    //Check to make sure the target is dead first
    //Fire cast spell at event for the specified target
    if (GetIsObjectValid(oTarget))
    {
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RESURRECTION, FALSE));
        if (GetIsDead(oTarget))
        {
            //Declare major variables
            int nHealed = GetMaxHitPoints(oTarget);
            effect eRaise = EffectResurrection();
            effect eHeal = EffectHeal(nHealed + 10);
            effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
            //Apply the heal, raise dead and VFX impact effect
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
            ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
        }
        else
        {
            if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
            {
                int nStrRef = GetLocalInt(oTarget,"X2_L_RESURRECT_SPELL_MSG_RESREF");
                if (nStrRef == 0)
                {
                    nStrRef = 83861;
                }
                if (nStrRef != -1)
                {
                    FloatingTextStrRefOnCreature(nStrRef,OBJECT_SELF);
                }
            }
        }
    }
}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.


et

nw_s0_raisdead
NWScript :
//:Confused///////////////////////// /////////////////////
//:: [Raise Dead]
//:: [NW_S0_RaisDead.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:Confused///////////////////////// ////////////////////
//:: Brings a character back to life with 1 HP.
//:Confused///////////////////////// ////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:Confused///////////////////////// ////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001

#include "x2_inc_spellhook"

void main()
{

/*
  Spellcast Hook Code
  Added 2003-06-20 by Georg
  If you want to make changes to all spells,
  check x2_inc_spellhook.nss to find out more

*/


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

// End of Spell Cast Hook


    //Declare major variables

    object oTarget = GetSpellTargetObject();
    effect eRaise = EffectResurrection();
    effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);

    //Fire cast spell at event for the specified target
    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAISE_DEAD, FALSE));
    if(GetIsDead(oTarget))
    {
        //Apply raise dead effect and VFX impact
        ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
    }
////////////////////////////// ////////////////////////////// ////////////

    //---------------------------- ----------------------------//
    //      Positionement de la balise de mort a " FALSE "  //
    //---------------------------- ----------------------------//
    int BALISE_MORT = GetCampaignInt("bddbvsm","balise_mort",oTarget);
    SetCampaignInt("bddbvsm","balise_mort",FALSE,oTarget);

////////////////////////////// ////////////////////////////// ////////////
}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.


j'ai beau reguarder je ne vois pas d'erreur de ma part... j'ai pris ces variables sur ce topic:
[http]
donné par "Semcatala" ( merci a lui)

Voila je suis vraiment coincé, d'autant plus qu'aparament chez les autres sa marche :s

PS: merci d'avance a ceux qui pourront m'aider!!!
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Sith Vicious
Grand Sage du Conseil
Inscrit le: 19 Oct 2005
Messages: 693
Répondre en citant
Posté le : 22/07/2006 11:59:32 Sujet du message :

Heu comme ça vite fait déjà dans le premier script tu te sers de oTarget avant de le définir, ça m'étonne même que ça compile...

Ca corrigera surement pas tout mais déjà...
Et tu ferais bien de vérifier que ta cible est un PJ, sinon tu vas avoir ta BDD surchargée par des cibles inutiles (le gars qui clique à coté du corps, qui tente de ressuciter un plaçable enfin des trucs bêtes...)
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
tempus
Novice
Inscrit le: 12 Juil 2006
Messages: 15
Répondre en citant
Posté le : 22/07/2006 13:09:34 Sujet du message :

je vai tester voir si sa viens du otarget mal placer!!

merci a toi!
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
tempus
Novice
Inscrit le: 12 Juil 2006
Messages: 15
Répondre en citant
Posté le : 22/07/2006 17:07:28 Sujet du message :

Sa marche toujours pas...

quand un pj se fait rez par un autre pj, a sa prochaine deco/reco, il re meurt...


plz help :s
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Sith Vicious
Grand Sage du Conseil
Inscrit le: 19 Oct 2005
Messages: 693
Répondre en citant
Posté le : 22/07/2006 17:19:15 Sujet du message :

Poste ton OnDeath stp.

C'est pas un problème de nom de variable ou de DB ? (je sais c'est bête comme question mais des fois ça tient à rien...)
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
tempus
Novice
Inscrit le: 12 Juil 2006
Messages: 15
Répondre en citant
Posté le : 22/07/2006 17:28:50 Sujet du message :

voila le ondeath

NWScript :
//:Confused///////////////////////// /////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright (c) 2001 Bioware Corp.
//:Confused///////////////////////// ////////////////////
/*
    This script handles the default behavior
    that occurs when a player dies.
*/

//:Confused///////////////////////// ////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:Confused///////////////////////// ////////////////////
/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
//    AssignCommand(oMember, SpeakString("here")) ;
    AdjustReputation(oPlayer, oMember, 100);
    SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad&qu ot;, 10); // * Player bad
    object oClear = GetFirstFactionMember(oMember, FALSE);
    while (GetIsObjectValid(oClear) == TRUE)
    {
        ClearPersonalReputation(oPlaye r, oClear);
        oClear = GetNextFactionMember(oMember, FALSE);
    }
}  */

#include "nw_i0_plot"
void dialomort(int dialo,object oPlayer)
    { //object oPlayer = GetLastPlayerDied();
        if (GetIsDead(oPlayer))
        {
        switch(dialo)
            {case 1: AssignCommand(oPlayer, SpeakString("A l'aide !"));break;
            case 2: AssignCommand(oPlayer, SpeakString(" Sauvez....moi !")); break;
            case 3: AssignCommand(oPlayer, SpeakString("Je souffre !")); break;
            case 4: AssignCommand(oPlayer, SpeakString("Ma vie va prendre fin..."));break;
            case 5: AssignCommand(oPlayer, SpeakString("Je me sens partir !")); break;
        } }
    }
  void mortoupas(object oPlayer)
  { //object oPlayer = GetLastPlayerDied();
  int nXP = GetXP(oPlayer);
    int nPenalty = 50 * GetHitDice(oPlayer);
    int nHD = GetHitDice(oPlayer);
    // * You can not lose a level with this respawning
    int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

    int nNewXP = nXP - nPenalty;
    if (nNewXP < nMin)
      nNewXP = nMin;

    int nGoldToTake = FloatToInt(0.10 * GetGold(oPlayer));
    // * a cap of 20 000gp taken from you
    if (nGoldToTake > 10000)
    {
        nGoldToTake = 10000;

    }

        if (GetIsDead(oPlayer))
        { location lLoc = GetLocation(oPlayer );
  if(HasItem(oPlayer, "pierredumal"))
    { //objet cree par terre

        CreateObject(OBJECT_TYPE_ITEM, "objetdumal", lLoc);

    }
    if(HasItem(oPlayer, "pierredubien"))
    {

        CreateObject(OBJECT_TYPE_ITEM, "objetdubien", lLoc);
    }
      // TakeGoldFromCreature (nGoldToTake, oPlayer, TRUE);
AssignCommand(oPlayer, TakeGoldFromCreature(nGoldToTake, oPlayer, TRUE));
        effect eVisual = EffectResurrection();
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
      AssignCommand(oPlayer, SpeakString("(Respawn Automatique !)"));
    SetXP(oPlayer, nNewXP);
  object oSpawnPoint = GetObjectByTag("NW_DEATH_TEMPLE");
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)) );
DestroyObject( GetItemPossessedBy(oPlayer,"mort"));
    //SetLocalInt(oPlayer, "activemort", 0);
        }
  }
void Raise(object oPlayer)
{
        effect eVisual = EffectVisualEffect(VFX_IMP_DESTRUCTION); //VFX_IMP_RESTORATION

        effect eBad = GetFirstEffect(oPlayer);
        ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
        ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);

        //Search for negative effects
        while(GetIsEffectValid(eBad))
        {
            if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
                GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
                GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
                GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
                {
                    //Remove effect if it is negative.
                    RemoveEffect(oPlayer, eBad);
                }
            eBad = GetNextEffect(oPlayer);
        }
        //Fire cast spell at event for the specified target
        SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}

void main()
{
    object oPlayer = GetLastPlayerDied();
    int iDied = GetLocalInt(oPlayer,"iDied"); //peut etre pas
    ++iDied;
    SetLocalInt(oPlayer,"iDied",iDied);





object oDeadPlayer=GetLastPlayerDied();
//object oPlayer=GetLastPlayerDied();
string sDeadPlayer=GetName(oDeadPlayer);
object oDeathArea=GetArea(oDeadPlayer);
string sDeathArea=GetTag(oDeathArea);
string sDeadOne="";
string sAreaName=GetName(oDeathArea);


string sSayDeath=sDeadPlayer+sDeadOne+sAreaName;
SendMessageToAllDMs(sSayDeath);


    object oKiller = GetLastKiller(); //a virer
    if (GetIsPC(oKiller) && GetIsPC(oPlayer))
        {
        int iKilled = GetLocalInt(oPlayer,"iKilled"); //peut etre pas
        ++iKilled;
        SetLocalInt(oPlayer,"iKilled",iKilled);
        //string PKReport="PK report: "+GetName(oKiller)+" (Lv "+IntToString(GetHitDice( oKiller))+" -CD key="+GetPCPublicCDKey(oK iller)+") a tue "+GetName(oPlayer)+" (Lv "+IntToString(GetHitDice( oPlayer))+" - CD key="+GetPCPublicCDKey(oP layer)+")";
      string PKReport="PK report: "+GetName(oKiller)+" (Lv "+IntToString(GetHitDice(oKiller))+" a tue "+GetName(oPlayer)+" (Lv "+IntToString(GetHitDice(oPlayer));
        WriteTimestampedLogEntry(PKReport);
        SendMessageToAllDMs(PKReport);

        }




///////////////////////////
//FAB : creation objet de mort
//////////////////////////////
//object oPlayer = GetLastPlayerDied();
//CreateItemOnObject("mor t", oPlayer, 1); // cree objet mort
//////////////////////////////


  //  string sArea = GetTag(GetArea(oPlayer));
  //  if (sArea == "M4Q1D2" || sArea == "M3Q3C" || sArea == "MAP_M1Q6A")
  // {

        //Raise(oPlayer);
        //string sDestTag = "M4QD07_ENTER";
        //object oSpawnPoint = GetObjectByTag(sDestTag);
//        AssignCommand(oPlayer, DelayCommand(1.0, JumpToLocation(GetLocation(oSp awnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
    //  DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer,FAL SE, TRUE, 66487));
    //  return;
  // }



    AssignCommand(oPlayer, ClearAllActions());
    // * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
    if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
    { SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
        SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
    }
    if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
    { SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
        SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
    }
    if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
    { SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
        SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
    }

    DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));

DelayCommand(10.5, dialomort(1,oPlayer));
DelayCommand(50.5,dialomort(2,oPlayer));
DelayCommand(80.5,dialomort(3,oPlayer));
DelayCommand(120.5,dialomort(4,oPlayer));
DelayCommand(150.5,dialomort(5,oPlayer));
DelayCommand(180.5, mortoupas(oPlayer));
DelayCommand(200.5, DestroyObject( GetItemPossessedBy(oPlayer,"mort")));

//---------------------------- ------------------------------ -------------//
//            On met une balise de mort au pj qui vient de mourir.      //
//---------------------------- ------------------------------ -------------//
sert a declarer une balise pour "marquer" le pj a la mort.

          SetCampaignInt("bddbvsm","balise_mort",TRUE,oPlayer);

//---------------------------- ------------------------------ -----------//

}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.


Le script concerner est le dernier en bas (juste au dessu la ^^ )
pour le nom de la bdd j'ai tous mis ( sauf erreur ) bddbvsm.

j'espere que tu pourra m'aider Sad
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Sith Vicious
Grand Sage du Conseil
Inscrit le: 19 Oct 2005
Messages: 693
Répondre en citant
Posté le : 22/07/2006 21:05:51 Sujet du message :

Ben...

Nope, je vois pas...
Le joueur peut respawn ou bien ? Si oui, quand il respawn, ça marche ?
Et l'objet "mort", il sert à quoi ?

Dernière tentative : poste les bouts concernés du OnRespawn et du OnClientEnter, mais bon...

Enfin perds pas espoir, si ça se trouve c'est gros comme une maison et quelqu'un va trouver en passant par hasard Smile
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
tempus
Novice
Inscrit le: 12 Juil 2006
Messages: 15
Répondre en citant
Posté le : 23/07/2006 07:54:55 Sujet du message :

ben quand il se connecte, il est mort, mais oui il peut respawn ou se faire rez ( si il se fait rez, lors de sa prochaine deco/reco il sera ENCORE mort :s )

L'objet mort , c'etait un ancien item qui jouer le role des variables que j'essaid e faire marcher ( il empechai les deco / reco pour se rez, quand ils meurent, l'objet se créé, et si ils se conencte avec , ils meurent, mais y avait quelques bug)

voila le on enter:

NWScript :

#include "ats_inc_init"
#include "nw_i0_tool"
void main()
{

ATS_InitializePlayer(GetEnteringObject());
      //modif par Loup Artic le 27 Avril 2004, le 2 mai 2004
    //string BroadcastThis="Welcome, ";

    object SendToPC = GetEnteringObject();

    if (GetIsPC(SendToPC))
    {
        string PCNameIs=GetName(SendToPC);
        string WelcomeBegin="Bienvenue, ";
        string WelcomeEnd=", sur mon monde ! Que ta presence mene ton Clan a la victoire !";
        string HRP="(Ce serveur est semi Role Play)";
        string HRP2=".";
        string HRP3="";
        string BroadcastThis=WelcomeBegin + PCNameIs + WelcomeEnd + HRP + HRP2 +HRP3;
        SendMessageToPC(SendToPC, BroadcastThis);
      if (GetItemPossessedBy(SendToPC, "poubelledrop") != OBJECT_INVALID)
      {
        CreateItemOnObject("poubelledrop", SendToPC);
        }



object oPC = GetEnteringObject();

////////////////////////////// ////////////////////////////// /////////////
/// sert a recuperer l'info pour savoir si le pj est mort ou vivant  ///
  int BALISE_MORT = GetCampaignInt("bddbvsm","balise_mort", oPC);
////////////////////////////// ////////////////////////////// /////////////


////////////////////////////// ////////////////////////////// /////////////
// sert a detecter si le pj est mort ou vivant, et a le rendre mort  ////
// ou vivant a la conection sur le serveur.                          ////
                                                                  ////
        if(BALISE_MORT == TRUE ) ////
        { ////
          effect eDeath = EffectDeath(FALSE, FALSE); ////
          ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oPC); ////
        } ////
////////////////////////////// ////////////////////////////// /////////////
}





  object oEntering = GetEnteringObject();
if(HasItem(oEntering, "pierredubien"))
{

      SetLocalString(oEntering, "team", "good");
  }
if(HasItem(oEntering, "pierredumal"))
{

      SetLocalString(oEntering, "team", "evil");

    }

//object oPlayer = GetEnteringObject();
//if (GetIsPC (oPlayer))
//{
                  // if(GetItemPossessedBy(oPlayer, "aide-dm") != OBJECT_INVALID)
                    //{
                    //CreateItemOnObject("kic kpc", oPlayer);
                  // CreateItemOnObject("zone- aide-dm", oPlayer);
                    //CreateItemOnObject("pou belledrop", oPlayer);
                  // }
                  // }
//}
object oPlayer = GetEnteringObject();
if (GetIsDM(oPlayer) == TRUE)
    {
      if (GetItemPossessedBy(oPlayer, "kickpc") == OBJECT_INVALID)
      {
                CreateItemOnObject("kickpc",oPlayer);
                                  }
}
}

/*object oPlayer = GetEnteringObject();
if (GetIsDM(oPlayer) == TRUE)
    {
      string sTag = "md";
      object oTarget = GetObjectByTag(sTag);

AssignCommand(oPlayer,JumpToObject(oTarget));
      {
                }
                }
                }/* suspect block end found !*/

Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.


et le on respawn:
NWScript :
//:Confused///////////////////////// /////////////////////
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:Confused///////////////////////// ////////////////////
/*
// * June 1: moved RestoreEffects into plot include
*/

//:Confused///////////////////////// ////////////////////
//:: Created By:  Brent
//:: Created On:  November
//:Confused///////////////////////// ////////////////////
//#include "nw_i0_tool"
#include "nw_i0_plot"

// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
    int nXP = GetXP(oDead);
    int nPenalty = 50 * GetHitDice(oDead);
    int nHD = GetHitDice(oDead);
    // * You can not lose a level with this respawning
    int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

    int nNewXP = nXP - nPenalty;
    if (nNewXP < nMin)
      nNewXP = nMin;
    SetXP(oDead, nNewXP);
    int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
    // * a cap of 10 000gp taken from you
    if (nGoldToTake > 10000)
    {
        nGoldToTake = 10000;
    }
    AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
    DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
    DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}

////////////////////////////// ////////////////////////////// ///////////
// this function resets variabls and clears the arenas in the fighter
// 'gauntlet' subplot in chapter one
////////////////////////////// ////////////////////////////// ///////////

void ClearArena(object oPC,string sArena)
{
    if(sArena == "Map_M1S4C")
    {
        DestroyObject(GetObjectByTag("M1S04CHRUSK02"));
        DestroyObject(GetObjectByTag("M1S4CBeast"));
        SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4HruskDef",0);
    }
    else if(sArena == "Map_M1S4D")
    {
        DestroyObject(GetObjectByTag("M1S04CFASHI02"));
        DestroyObject(GetObjectByTag("M1S4DBeast"));
        SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4FashiDef",0);
        CreateItemOnObject("M1S04IBADGELVL01",oPC);
    }
    else if(sArena == "Map_M1S4E")
    {
        DestroyObject(GetObjectByTag("M1S04CAGAR02"));
        DestroyObject(GetObjectByTag("M1S4EBeast"));
        SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4AgarDef",0);
        CreateItemOnObject("M1S04IBADGELVL02",oPC);
    }
    else if(sArena == "Map_M1S4F")
    {
        DestroyObject(GetObjectByTag("M1S04CCLAUDUS02"));
        DestroyObject(GetObjectByTag("M1S4FBeast",0));
        DestroyObject(GetObjectByTag("M1S4FBeast",1));
        SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4ClaudusDef",0);
        CreateItemOnObject("M1S04IBADGELVL03",oPC);
    }
    SetLocalInt(oPC,"NW_L_M1S4Won",FALSE);
    SetLocalInt(GetModule(),"NW_G_" + sArena + "_Occupied",FALSE);
}

////////////////////////////// ////////////////////////////// //////////////////


void main()
{
    object oRespawner = GetLastRespawnButtonPresser();


    location lLoc = GetLocation(oRespawner );
  // CreateObject(OBJECT_TYPE_ITEM, "clef03", lLoc);
    if(HasItem(oRespawner, "pierredumal"))
    { //objet cree par terre

        CreateObject(OBJECT_TYPE_ITEM, "objetdumal", lLoc);

    }
    if(HasItem(oRespawner, "pierredubien"))
    {

        CreateObject(OBJECT_TYPE_ITEM, "objetdubien", lLoc);
    }
    SetLocalInt(oRespawner, "activemort", 0);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
    //DestroyObject( GetItemPossessedBy(oRespawner, "mort"));

//////////////////////////
// fab, variable anti deco/reco rez
///////////////////////////

    //---------------------------- ----------------------------//
    //          Positionement des balises a " FALSE "        //
    //---------------------------- ----------------------------//
    SetCampaignInt("bddbvsm","balise_mort",FALSE,oRespawner);

/////////////////////////////
//object oCarte = GetItemPossessedBy(oRespawner, "mort");
//DestroyObject(oCarte);
/////////////////////////////
    RemoveEffects(oRespawner);
    //* Return PC to temple



    string sDestTag = "NW_DEATH_TEMPLE";
    string sArea = GetTag(GetArea(oRespawner));


    if (GetIsObjectValid(GetObjectByTag(sDestTag)))
    {

        if (sDestTag == "NW_DEATH_TEMPLE")
        {
            object oPriest = GetObjectByTag("NW_DEATH_CLERIC");
            //SetLocalInt(oPriest, "NW_L_SAYONELINER", 10);

            //AssignCommand(oPriest, DelayCommand(3.0,ActionStartCo nversation(oRespawner)));
            AssignCommand(oPriest, DelayCommand(2.1, PlayVoiceChat(VOICE_CHAT_TALKTOME, oPriest)));

            SetLocalLocation(oRespawner, "NW_L_I_DIED_HERE", GetLocation(GetLastRespawnButtonPresser()));
            SetLocalInt(oRespawner, "NW_L_I_DIED", 1);
            SetLocalObject(oPriest, "NW_L_LASTDIED", GetLastRespawnButtonPresser());
            // * April 2002: Moved penalty here, only when going back to the death temple
            ApplyPenalty(oRespawner);
        }
        object oSpawnPoint = GetObjectByTag(sDestTag);
        AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
        // * mak
    }
    else
    {
        // * do nothing, just 'res where you are.
    }
}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Black Knight
Grand Maître Chanteur du Conseil
Inscrit le: 27 Oct 2005
Messages: 1031
Localisation: Fin fond du trou du cul du monde
Répondre en citant
Posté le : 23/07/2006 11:34:54 Sujet du message :

Je pense que ça doit marcher (j'ai enlevé tout le vert ça me soul de voir les scripts grandir pour si peut de chose -_-)

NWScript :
//Confused//////////////////////// /////////////////////
//:: [Ressurection]
//:: [NW_S0_Ressurec.nss]
//:: Copyright (c) 2000 Bioware Corp.
//Confused//////////////////////// ////////////////////
//:: Brings a character back to life with full
//:: health.
//:: When cast on placeables, you get a default error message.
//::  * You can specify a different message in
//::      X2_L_RESURRECT_SPELL_MSG_RESRE F
//::  * You can turn off the message by setting the variable
//::    to -1
//Confused//////////////////////// ////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//Confused//////////////////////// ////////////////////
//:: Last Updated By: Georg Z on 2003-07-31
//:: VFX Pass By: Preston W, On: June 22, 2001

#include "x2_inc_spellhook"

void main()
{

/*
  Spellcast Hook Code
  Added 2003-06-20 by Georg
  If you want to make changes to all spells,
  check x2_inc_spellhook.nss to find out more

*/


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


    object oTarget = GetSpellTargetObject();
    if (GetIsObjectValid(oTarget))
    {
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RESURRECTION, FALSE));
        if (GetIsDead(oTarget))
        {
            //Declare major variables
            int nHealed = GetMaxHitPoints(oTarget);
            effect eRaise = EffectResurrection();
            effect eHeal = EffectHeal(nHealed + 10);
            effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
            //Apply the heal, raise dead and VFX impact effect
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
            ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
            SetCampaignInt("bddbvsm","balise_mort",FALSE,oTarget);
        }
        else
        {
            if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
            {
                int nStrRef = GetLocalInt(oTarget,"X2_L_RESURRECT_SPELL_MSG_RESREF");
                if (nStrRef == 0)
                {
                    nStrRef = 83861;
                }
                if (nStrRef != -1)
                {
                    FloatingTextStrRefOnCreature(nStrRef,OBJECT_SELF);
                }
            }
        }
    }
}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.


et

NWScript :
//:Confused///////////////////////// /////////////////////
//:: [Raise Dead]
//:: [NW_S0_RaisDead.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:Confused///////////////////////// ////////////////////
//:: Brings a character back to life with 1 HP.
//:Confused///////////////////////// ////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:Confused///////////////////////// ////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001

#include "x2_inc_spellhook"

void main()
{

/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more

*/


if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
object oTarget = GetSpellTargetObject();
effect eRaise = EffectResurrection();
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);

//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAISE_DEAD, FALSE));
if(GetIsDead(oTarget))
{
//Apply raise dead effect and VFX impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
SetCampaignInt("bddbvsm","balise_mort",FALSE,oTarget);

}

}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.


voila essaye... pour moi les fonctions étaient mal placé ...
Ha oui regarde ou j'ai placé les scripts... Si tu dis pas que le joueur EST BIEN rez alors la balise s'enlevera quand meme (le joueur a juste a etre interrompu la ou tu l'ai avait placé pour qu'il puisse deco reco tranquillos).
BK
_________________
[http]
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Montrer les messages depuis :
Page 1 sur 1 ¤


Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum


Sauter vers:
FAQ | Rechercher | Liste des Membres | Groupes d'utilisateurs | S'enregistrer | Profil | Se connecter pour vérifier ses messages privés | Connexion
Powered by phpBB 2.* [m] © 2001, 2002 phpBB Group
Theme rewritten in beautiful XHTML code by Baldurien.
Thème "La Bibliothèque de Neverwinter" crée par Kruger
Traduction par : phpBB-fr.com
Page generated in 108.369ms