La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 01/11/2024 06:27:10


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
Black_Morgen'S
Voyageur
Inscrit le: 14 Nov 2005
Messages: 2
Répondre en citant
Posté le : 14/11/2005 20:36:03 Sujet du message : Séparation de scriptes !!!

Voila alors j'ai 8 scriptes qui continenne chacun 2 scipte différent et je n'arrive pas a bien faire les séparation entre les scripte. Merci de m'aider

Scripte 1 :

#include "cad_detcorps"
#include "cad_penalite"
#include "nw_i0_plot"


//Fonctions pour les drogues

void Curse(object oActivator);
void Premonition(object oActivator);
void WizTPActivate(object oActivator, string sTag)
{
if (sTag == "wiztpstaff")//check if the activated item was the staff
{
if (GetLevelByClass(CLASS_TYPE_WIZARD, oActivator) + GetLevelByClass(CLASS_TYPE_SORCERER, oActivator) >= 7)//check if player has sufficient level
{
AssignCommand (oActivator, ActionStartConversation (oActivator, "wiz_teleport", TRUE));
SetLocalInt (oActivator, "wiz_level", GetLevelByClass(CLASS_TYPE_WIZARD, oActivator)); //set the level to check later if he can teleport to that area
}
}

return;
}

void Curse(object oActivator)
{
object oActivator = GetItemActivator();
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
effect eCurse = EffectCurse(6, 6, 6, 6, 6, 6);
eCurse = SupernaturalEffect(eCurse);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oActivator);
}

void Premonition(object oActivator)
{
object oActivator = GetItemActivator();
int nDuration = 360;
int nLimit = 100;
effect eStone = EffectDamageReduction(30, DAMAGE_POWER_PLUS_FIVE, nLimit);
effect eVis = EffectVisualEffect(VFX_DUR_PROT_PREMONITION);
effect eLink = EffectLinkEffects(eStone, eVis);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oActivator, HoursToSeconds(nDuration));
}

//debut du script pour le book log
location GetInFront(location lLocation);

location GetInFront(location lLocation)
{
float fFacing = GetFacingFromLocation(lLocation);
vector vPos = GetPositionFromLocation(lLocation);

vPos.x = vPos.x + 2.0*cos(fFacing);
vPos.y = vPos.y + 2.0*sin(fFacing);

return Location(GetAreaFromLocation(lLocation), vPos, GetFacingFromLocation(lLocation) + 180);

}//end of Script

void main()
{
////Variables/////
object oActivatedItem = GetItemActivated();
object oActivator = GetItemActivator();
string sTag = GetTag(oActivatedItem);
location lTarget = GetItemActivatedTargetLocation();
object oMod=GetModule();
string sPre=GetLocalString(oMod,"OnAct_Pre");
string sPreScript=GetLocalString(oMod,"OnAct_PreScript");
int nN=GetStringLength(sPre);
object oArea = GetArea(oActivator);
string sArea = GetTag(oArea);
object oTarget= GetItemActivatedTarget();
string sItemName = GetName(oActivatedItem);

if (sTag == "kit_chaise")
{
CreateObject(OBJECT_TYPE_PLACEABLE, "chaisekit", lTarget);
DestroyObject(oActivatedItem);
}

if (sTag == "kit_table")
{
CreateObject(OBJECT_TYPE_PLACEABLE, "tablekit", lTarget);
DestroyObject(oActivatedItem);
}
// Script pour cambriolage
if(sTag=="Corde" && GetTag(oTarget)==("camb_fenetre_"+GetStringRight(GetStringLowerCase(GetTag(oTarget)), 2)))
{
AssignCommand(oActivator, ActionStartConversation(oTarget, ("camb_fenetre_"+GetStringRight(GetStringLowerCase(GetTag(oTarget)), 2)), TRUE));
}

/////
//////DMFI///
if (sTag =="dmfi_pc_emote")
{
ExecuteScript("dmfi_activate", GetItemActivator());
}
/////
if (sTag =="EmoteWand")
{
AssignCommand (oActivator, ActionStartConversation (oActivator, "emotewand", TRUE));
}

if (sTag == "cadsac") // sac a cadavres
{
int bCorps = FALSE;
if (GetLocalInt(oTarget, "cadavre") == 1)
{
SendMessageToPC(oActivator, "Quelqu'un s'occupe deja de ce corps");
return;
}
if (GetStringLeft(GetTag(oTarget), 4) == "cad_")
{
bCorps = TRUE;
SendMessageToPC(oActivator, "Ce corps est celui de "+GetName(GetLocalObject(oActivator, "cadavre")));
return;
}
if (GetIsPC(oTarget)&&GetIsDead(oTarget))
{
SetLocalObject(oActivator, "nouvocadavre", oTarget);
AssignCommand(oActivator, ActionStartConversation(oActivator, "cad_sac", TRUE));
}
else
{
if (!bCorps)
SendMessageToPC(oActivator, "Cet objet ne peut s'utiliser que sur les cadavres de PJs");
}
}

if (GetStringLeft(sTag, 4) == "cad_") // les corps
{
if (GetTag(GetArea(oActivator))=="area180")
{
SendMessageToPC(oActivator, "On ne peut pas reposer de corps ici");
return;
}
if (GetIsPC(oTarget)&&oTarget!=oActivator)
{
if (!DetectCorps(oTarget))
{
SetLocalObject(oTarget, "donneur", oActivator);
AssignCommand(oTarget, ActionStartConversation(oTarget, "cad_donne", TRUE));
return;
}
else
{
SendMessageToPC(oActivator, GetName(oTarget)+" deplace deja un corps");
return;
}
}
//thrania rez
if (GetTag(oTarget) == "thrania")
{
object oLolo = GetObjectByTag("thrania");
object oCad = GetLocalObject(oActivator, "cadavre");
TakeGoldFromCreature(50, oActivator);
DestroyObject(GetItemPossessedBy(oCad, "coeurmort"));
AssignCommand(oCad, ClearAllActions());
AssignCommand(oCad, ActionJumpToObject(oLolo));
SendMessageToPC(oCad, GetName(oActivator)+" vous a confie a Thrania dans l'hopital");
DestroyObject(oActivatedItem);
return;
}
DestroyObject(oActivatedItem);
ExecuteScript("cad_repose", oActivator);
}

if (sTag == "cadeponge") // l'eponge
{
object oSang = GetNearestObjectByTag("Bloodstain", oActivator);
if (GetDistanceBetween(oActivator, oSang) < 2.)
{
if(GetIsObjectValid(oSang))
{
DestroyObject(oSang);
GiveXPToCreature(oActivator, 10);
}
}
}
//item de faction
if (sTag =="drow")
{
object oEnnemi = GetObjectByTag("Soldatd");
int iReput = GetReputation(oActivator, oEnnemi);
if (iReput <= 50)
{
AdjustReputation(oActivator, oEnnemi, 100);
}
if (iReput > 50)
{
AdjustReputation(oActivator, oEnnemi, 0);
}
}

if (sTag =="demon")
{
object oEnnemi = GetObjectByTag("diantrefosse");
int iReput = GetReputation(oActivator, oEnnemi);
if (iReput <= 50)
{
AdjustReputation(oActivator, oEnnemi, 100);
}
if (iReput > 50)
{
AdjustReputation(oActivator, oEnnemi, 0);
}
}

if (sTag =="orc")
{
object oEnnemi = GetObjectByTag("DemiOrcdelaHorde");
int iReput = GetReputation(oActivator, oEnnemi);
if (iReput <= 50)
{
AdjustReputation(oActivator, oEnnemi, 100);
}
if (iReput > 50)
{
AdjustReputation(oActivator, oEnnemi, 0);
}
}

if (sTag =="rdd")
{
object oEnnemi = GetObjectByTag("GuerrierduDragonRouge");
int iReput = GetReputation(oActivator, oEnnemi);
if (iReput <= 50)
{
AdjustReputation(oActivator, oEnnemi, 100);
}
if (iReput > 50)
{
AdjustReputation(oActivator, oEnnemi, 0);
}
}

if (GetStringLeft(sTag, 9) == "cu_poison")
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(TRUE, TRUE), oActivator);
}

if(sTag== "potiondepouvoird")
{
ForceRest(oActivator);
}

if (GetTag(oActivatedItem) == "LogBook" )
{
//
// Activated Item: Log Book
// Effect: Create the LogBookAvatar then start conversation with it.
//

// Setup the LogBookAvatar location.
location lLogBookAvatar = GetInFront(GetLocation(oActivator));

// Create LogBookAvatar object
object oLogBookAvatar = CreateObject(OBJECT_TYPE_CREATURE, "logbookavatar", lLogBookAvatar, FALSE);

// Store the LogBook object on the avatar for future reference.
SetLocalObject(oLogBookAvatar, "oLogBook", oActivatedItem);

// Store the LogBook activator on the avatar for future reference.
SetLocalObject(oLogBookAvatar, "oActivator", oActivator);

// Start the LogBookAvatar conversation.
AssignCommand(oActivator, ActionStartConversation(oLogBookAvatar, "", FALSE));

//In the conversation script when the conversation ends, the LogBookAvatar is destroyed.
}


{
WizTPActivate(oActivator,sTag);

return;
}

//active god
{
ExecuteScript( "it_" + GetTag( GetItemActivated() ), GetItemActivator() );
}


}

// Vampire System
#include "vamp_domination"
#include "vamp_form"
#include "vamp_children"
#include "vamp_energydrain"
#include "vamp_coffintoken"
#include "vamp_stake"
#include "vamp_bottleblood"
#include "vamp_drinkblood"
#include "vamp_gaseous"
#include "vamp_lineage"
#include "vamp_death2undth"


// Hordes of the Underdark switches
#include "x2_inc_switches"

void main()
{
object oItem = GetItemActivated();
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
location lLocation = GetItemActivatedTargetLocation();
string oItemTag = GetTag(oItem);

// si le joueur est un vampire, vérifiez les articles spécifiques du vampire.
if (GetSubRace(oPC) == "Vampire")
{
if (oItemTag=="BloodBottle")
{
vamp_drinkblood(oPC);
return;
}
if (oItemTag=="VampireCoffinToken")
{
coffin_token(oPC,lLocation);
return;
}
// s'ils doivent se reposer / sont mort, ne pas les laissez employer les articles suivants.
if (GetCampaignInt("Vampire", "VampireMustRest", oPC)==1)
{
SendMessageToPC(oPC,"Vous devez vous reposer avant de pouvoir faire ceci. Trouvez votre cercueil...");
return;
}

if (oItemTag=="VampireLineage")
{
vamp_lineage(oPC,oTarget);
return;
}
if (oItemTag=="VampireDomination")
{
vamp_domination(oPC,oTarget);
return;
}
if (oItemTag=="VampireAlternateWolfForm")
{
vamp_form_wolf(oPC);
return;
}
if (oItemTag=="VampireAlternateFormDireWolf")
{
vamp_form_direwolf(oPC);
return;
}
if (oItemTag=="VampireChildrenoftheNight")
{
vamp_children_wolf(oPC,lLocation);
return;
}
if (oItemTag=="ChildrenoftheNightRat")
{
vamp_children_rat(oPC,lLocation);
return;
}
if (oItemTag=="EnergyDrain")
{
vamp_energydrain(oPC,oTarget);
return;
}
if (oItemTag=="WoodenStake")
{
vamp_stake(oPC,oTarget);
return;
}
if (oItemTag=="EmptyBottle")
{
vamp_bottleblood(oItem, oTarget, oPC);
return;
}
if (oItemTag=="gaseous")
{
vamp_gaseous(oPC);
return;
}
if (oItemTag == "vamp_death2undeath")
{
vamp_death2undeath(oPC,oTarget);
}
}

/********** HORDES OF THE UNDERDARK CODE *******************/
// * Generic Item Script Execution Code
// * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// * it will execute a script that has the same name as the item's tag
// * inside this script you can manage scripts for all events by checking against
// * GetUserDefinedItemEventNumber(). See x2_it_example.nss
// object oItem = GetItemActivated();
/*
PrintString("on_used: Perhaps Hordes can take care of: "+GetTag(GetItemActivated()));
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
*/
/********** HORDES OF THE UNDERDARK CODE *******************/
//DAVIDBEOULVE
//Je pense que toute cette sorte de substance fait ceci :
PrintString("on_used: Je ne peux pas imaginer de quel script cet article a besoin, ainsi je vais essayer d'exécuter un script du même tag: "+GetTag(GetItemActivated()));
ExecuteScript( GetTag( GetItemActivated() ), OBJECT_SELF );

Scripte 2 :
#include "cad_detcorps"
#include "NW_I0_GENERIC"
#include "god_inc"
void main()
{
// variables
object oPC = GetEnteringObject();
string sIPName = GetPCIPAddress(oPC);
string sCDKey = GetPCPublicCDKey(oPC);
string sPlayerName = GetPCPlayerName(oPC);
string sName = GetName(oPC);
int sLevel1 = GetLevelByPosition( 1, oPC);
int sLevel2 = GetLevelByPosition( 2, oPC);
int sLevel3 = GetLevelByPosition( 3, oPC);
int totalLevels = sLevel1 + sLevel2 + sLevel3;
int nXP = GetXP(oPC);
string sLvl = IntToString(totalLevels);
string sXP = IntToString(nXP);
//anti clone
if(sName == "Almond" && sPlayerName != "Ptitboud")
{
BootPC(oPC);
}
if(sName == "Amilia Stenen" && sPlayerName != "Fleur8468")
{
BootPC(oPC);
}
if(sName == "Amywiewiel" && sPlayerName != "Fleur8468")
{
BootPC(oPC);
}
// buter un PJ qui reviens avec le coeur
if (GetItemPossessedBy(oPC, "coeurmort")!= OBJECT_INVALID)
{
object oItem = GetFirstItemInInventory(oPC);
string sItem;
while (oItem != OBJECT_INVALID)
{
sItem = GetTag(oItem);
if (sItem == "coeurmort")
{
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oPC);
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(800, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL), oPC);

SendMessageToPC(oPC, "Vous êtes mort lors de votre précédente venue.");

}

//il s'est deco avec un corps / dans le sac
if (DetectCorps(oPC))
ExecuteScript("cad_raz", oPC);

//test de la presence du sac a mort
if (GetItemPossessedBy(oPC, "cadsac")==OBJECT_INVALID)
{
CreateItemOnObject("cadsac", oPC );
}
// emote wand
if (GetItemPossessedBy(oPC, "dmfi_pc_emote")==OBJECT_INVALID)
{
CreateItemOnObject("dmfi_pc_emote", oPC);
}
//god enter + include
{
GodClientEnter();
}
// test de la presence de l eponge

if (GetItemPossessedBy(oPC, "cadeponge")==OBJECT_INVALID)
{
CreateItemOnObject("cadeponge", oPC );
}
AddJournalQuestEntry("enter0", 1, oPC);
AddJournalQuestEntry("enter", 1, oPC);
AddJournalQuestEntry("enter1", 1, oPC);
AddJournalQuestEntry("enter2", 1, oPC);
}
// client_enter

// Vampire System
#include "vamp_subrace"

void main()
{
object oPC = GetEnteringObject();
if (GetSubRace(oPC) == "Vampire")
{
init_subrace(oPC);
}
}

Scripte 3 :

void main()
{
object oPC = GetExitingObject();
if (GetLocalInt(oPC, "cadavre") == 1) // le PJ est dans le sac a cadavre
{
object oCad = GetLocalObject(oPC, "cadavre");
ExecuteScript("cad_raz", oCad);
DestroyObject(GetLocalObject(oCad, "corps"));
SendMessageToPC(GetLocalObject(oPC, "cadavre"), "Le cadavre que vous portiez s'est deconnectee");
}

if (GetLocalInt(oPC, "cadavre") == 2) // le PJ porte un cadavre
{
object oCad = GetLocalObject(oPC, "cadavre");
ExecuteScript("cad_raz", oCad);
DestroyObject(GetLocalObject(oCad, "corps"));
SendMessageToPC(oCad, "La personne qui vous portait s'est deconnectee");
ExecuteScript("_respawn", oCad);
}
}
void main()
{
object oClient = GetExitingObject();
object oCoffin = GetObjectByTag(GetPCPublicCDKey(oClient));
DestroyObject(oCoffin, 1.0f);
}

Scripte 4 :

#include "god_const"
#include "x2_inc_switches"
#include "cs_wdm_i"
void main ()
//god + include
{
{
InitGodVar ();
}
{
SetLocalString(GetModule(),"nodrop01","regles");
SetLocalString(GetModule(),"nodrop02","tetecheforc");
SetLocalString(GetModule(),"nodrop03","coeurmort");
SetLocalString(GetModule(),"nodrop04","calice");
SetLocalString(GetModule(),"nodrop05","bonlvl18");
SetLocalString(GetModule(),"nodrop06","bonlvl15");
SetLocalString(GetModule(),"nodrop07","cad_1_nodrop");
SetLocalString(GetModule(),"nodrop08","cad_2_nodrop");
SetLocalString(GetModule(),"nodrop09","cad_3_nodrop");
SetLocalString(GetModule(),"nodrop10","cad_4_nodrop");
SetLocalString(GetModule(),"nodrop11","cad_5_nodrop");
SetLocalString(GetModule(),"nodrop12","cad_6_nodrop");
SetLocalString(GetModule(),"nodrop13","cad_7_nodrop");
SetLocalString(GetModule(),"nodrop14","cad_0_nodrop");
SetLocalInt(GetModule(),"nodroptotal",14);
DelayCommand(600.0, SignalEvent(OBJECT_SELF, EventUserDefined(200)));
}

SetModuleOverrideSpellscript("cs_wdm");
}
void main()
{
object oMod = GetModule();
//Settings for vampire system:
//
//1 == Enable
//0 == Disable
//
//

//When vampire dies, does he change invisible? (Cutscnene invis)
//If enabled dm cannot use death2undeath item to raise permanently dead vampire
//Because he cannot target him
int iVampCutsceneInvis = 1;


// Every vampire created gets assigned its creator's number +1, and so on.
// This is the difference between two vampire generations there must be
// in order for the greater vampire to errevocably slay a lesser.
int iVampMasterDifference = 1;

//Does vampire have ability "Lineage" to determine who made a vampire?
//
int iVampDetectTemplars = 1;

//Does vampire have ability "Lineage" to determine who made a vampire?
//
int iVampireLineage = 1;

//Does vampire have ability "Domination"?
//
int iDomination = 1;

//Does vampire have ability "Alternate Form"?
//Wolf
int iAlternateWolf = 1;

//Dire Wolf
int iAlternateDireWolf = 1;

//Does vampire have ability "Children of the Night"
//Dire Rat
int iChildrenRat = 1;
//Wolf
int iChildrenWolf = 1;

//Does vampire have ability "Energy Drain"
//
int iEnergyDrain = 1;

//Does vampire have ability "Gaseous Form"
//
int iGaseousForm = 1;

//Use level progression?
// NOTE: Not in use yet.
int iLvlProgression = 1;

//Does vampire need to drink blood?
//
int iDrinkBlood = 1;

//Use coffin system?
//(Vampire respawns next to his coffin. etc.)
int iCoffin = 1;

//Use hungry system?
//
int iHungry = 1;

/*What kind of SunSystem you want to use?

1. Use system what is on use for infinite.
System keeps checking is vampire under sun even he is underground.
Good point using this you dont need to modify Areas OnEnter event.
Bad thing in this is that it might take too much cpu time on some systems.
*/

int iSunKill = 0;

/*
Or do you want to use alternate system?
2. If you want to use this system you need to use following lines
OnAreaEnter event of areas where sun shines.

#include "vamp_sunsystem"
// vamp_sunsystem(GetEnteringObject());

Good point using this system is that it wont take as much cpu time
what System 1 takes. But you need to modify every area where sun shines.
Of course you can make for example so that church burn vampires when they enter.

*/

//If iSunKill enabled
//Does sun kill vampire instantly or just do
//iDamageX damage per 5 seconds.
int iSunKillInstant = 0;
int iSunDamageX = 20;

/*
If you want to use system what makes Undeads friendly towards vampires,
you must add following lines on areas OnEnter event.

#include "vamp_friends"
vamp_friends(GetEnteringObject());

*/

//If SunKill enabled
//Does vampire need "special" clothes to walk outside.
//If enabled vampire needs to wear clothes beginning with tag "Vamp"
//If not enabled vampire can walk outside if he has clothes on.
//NOTE: Vampire needs ALWAYS helmet or hood to be able to walk outside.
int iVampSpecialClothes = 1;

//Does vampire change to gaseous form on death or
//Does he respawn to his coffin?
//Set to 1 if gaseous form.
int iVampMistForm = 1;

//Setting Local Integers.
SetLocalInt(oMod,"iVampCutsceneInvis", iVampCutsceneInvis);
SetLocalInt(oMod,"iVampMasterDifference", iVampMasterDifference);
SetLocalInt(oMod,"iVampDetectTemplars", iVampDetectTemplars);
SetLocalInt(oMod,"iVampireLineage", iVampireLineage);
SetLocalInt(oMod,"iDomination", iDomination);
SetLocalInt(oMod,"iAlternateWolf", iAlternateWolf);
SetLocalInt(oMod,"iAlternateDireWolf", iAlternateDireWolf);
SetLocalInt(oMod,"iChildrenRat", iChildrenRat);
SetLocalInt(oMod,"iChildrenWolf", iChildrenWolf);
SetLocalInt(oMod,"iEnergyDrain", iEnergyDrain);
SetLocalInt(oMod,"iGaseousForm", iGaseousForm);
SetLocalInt(oMod,"iLvlProgression", iLvlProgression);
SetLocalInt(oMod,"iDrinkBlood", iDrinkBlood);
SetLocalInt(oMod,"iSunKill", iSunKill);
SetLocalInt(oMod,"iSunKillInstant", iSunKillInstant);
SetLocalInt(oMod,"iSunDamageX", iSunDamageX);
SetLocalInt(oMod,"iCoffin", iCoffin);
SetLocalInt(oMod,"iHungry", iHungry);
SetLocalInt(oMod,"iVampSpecialClothes", iVampSpecialClothes);
SetLocalInt(oMod,"iVampMistForm", iVampMistForm);
}

Scripte 5 :

//: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.

BK: October 8 2002: Overriden for Expansion
*/
//: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", 10); // * Player bad
object oClear = GetFirstFactionMember(oMember, FALSE);
while (GetIsObjectValid(oClear) == TRUE)
{
ClearPersonalReputation(oPlayer, oClear);
oClear = GetNextFactionMember(oMember, FALSE);
}
} */
void Raise(object oPlayer)
{
effect eVisual = EffectVisualEffect(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 oPC = GetLastPlayerDied();
int iPV = GetCurrentHitPoints(oPC);
int iRec = 2;
int iBCons = GetAbilityModifier(ABILITY_CONSTITUTION, oPC);
location lTarget = GetLocation(oPC);
int iRoll = d20() + iBCons;
if (iPV >= -11)
{

if (iRoll >= 20)
{
string sRoll = IntToString(iRoll);
SendMessageToPC(oPC, sRoll);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(iRec + iBCons +5), oPC);
SendMessageToPC(oPC, "Jet reussi:"+sRoll+"vs20");
}
else
{
string sRoll = IntToString(iRoll);
SendMessageToPC(oPC, sRoll);
SendMessageToPC(oPC, "Vous agonisez au sol, puis mourrez.");
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(80, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL), oPC);
CreateObject(OBJECT_TYPE_PLACEABLE, "flaquesang", lTarget);
SendMessageToPC(oPC, "Jet rate:"+sRoll+"vs 20");
}

}

object oPlayer = GetLastPlayerDied();

if (GetLocalInt(oPlayer, "cadavre") == 2) // il est mort et portait un cadavre
ExecuteScript("cad_repose", oPlayer);


// * increment global tracking number of times that I died
SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);

// * BK: Automation Control. Autopcs ignore death
if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10)
{
Raise(oPlayer);
DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF));
return; // Raise and return
}


// * Handle Spirit of the Wood Death
string sArea = GetTag(GetArea(oPlayer));
/*
if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oPlayer)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
{
int bValid;

Raise(oPlayer);
string sDestTag = "WP_M2Q2GtoM2Q2F";
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)));
return;

}
*/
// * in last level of the Sourcestone, move the player to the beginning of the area
// * May 16 2002: or the main area of the Snowglobe (to prevent plot logic problems).
// * May 21 2002: or Castle Never
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(oSpawnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer,FALSE, TRUE, 66487));
return;
}

// * make friendly to Each of the 3 common factions
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));

//Statistiques de mort

int iDied = GetLocalInt(oPlayer,"iDied");
++iDied;
SetLocalInt(oPlayer,"iDied",iDied);
ExecuteScript("at_playerkill", oPlayer);


//coeurmort
if (!GetIsPC(oPC)) return;
CreateItemOnObject("coeurmort", oPC);
//faction orc debuggage
object oKiller = GetLastKiller();
object oOrc = GetObjectByTag("Biappi");

if (GetRacialType(oKiller)==RACIAL_TYPE_HALFORC)
{
if (GetReputation(oKiller, oOrc) <=50)
{
AdjustReputation(oKiller, oOrc, 100);
}
}
//debug Kerl
object oKerl = GetObjectByTag("Daminettefouineuse");
if (GetReputation(oPlayer, oKerl) <= 50)
{
AdjustReputation(oPlayer, oKerl, 100);
}
//camaar
object oCamaar = GetObjectByTag("Laurick");
if (GetReputation(oPlayer, oCamaar) <= 50)
{
AdjustReputation(oPlayer, oCamaar, 100);
}
//orink
object oOrink = GetObjectByTag("RoiElaris");
if (GetReputation(oPlayer, oOrink) <= 50)
{
AdjustReputation(oPlayer, oOrink, 100);
}
}
#include "vamp_subrace"
void main()
{
if ((GetSubRace(GetLastPlayerDied()))== "Vampire")
{
object oPC = GetLastPlayerDied();
effect eEffect = GetFirstEffect(oPC);
while ( GetIsEffectValid(eEffect) )
{
RemoveEffect(oPC,eEffect);
GetNextEffect(oPC);
}
vamp_dead(oPC);
}
}

Scripte 6 :

//:Confused//////////////////////////////////////////////
//:: Dying Script
//::Powered By Leakim
//:: (c) 2004
//:Confused/////////////////////////////////////////////
void main()
{
effect eDeath = EffectDeath(FALSE, FALSE);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetLastPlayerDying());
}
#include "vamp_subrace"
void main()
{
object oPC = GetLastPlayerDying();

if ((GetSubRace(oPC))== "Vampire")
{
PrintString("vamp_dying: " + GetName(oPC) + " est un Vampire.");
//vamp_dead(GetLastPlayerDying());
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(),oPC);
}
}

Scripte 7 :

#include "nw_i0_plot"
void main()
{
object oPJ = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPJ);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPJ)), oPJ);
RemoveEffects(oPJ);
int nGold = GetGold(oPJ);
nGold = FloatToInt(0.10 * nGold);
object oDest = GetWaypointByTag("neutre_teleport");
AssignCommand(oPJ, JumpToLocation(GetLocation(oDest)));


int nXP = GetXP(oPJ);
int nPenalty = 50 * GetHitDice(oPJ);
int nHD = GetHitDice(oPJ);
// * 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(oPJ, nNewXP);
if (nHD<=15)
{
nGold = 0;
}
if (nGold>400000)
{
nGold=400000;
}
AssignCommand(oPJ, TakeGoldFromCreature(nGold, oPJ, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oPJ, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oPJ, FALSE));

//detruire coeur de mort
{
object oItem = GetFirstItemInInventory(oPJ);
string sItem;
while (oItem != OBJECT_INVALID)
{
sItem = GetTag(oItem);
if (sItem == "coeurmort")
{
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oPJ);
}
}
}
#include "vamp_subrace"
void main()
{
object oPC = GetLastRespawnButtonPresser();

PrintString("vamp_respawn: " + GetName(oPC));
if (GetCampaignInt("Vampire", "NewVamp",oPC)==1)
{
PrintString("vamp_respawn: " + GetName(oPC) + " est un nouveau vampire.");
object oWaypoint = GetWaypointByTag("vamp_crypt");
if (GetIsObjectValid(oWaypoint) == TRUE)
{
PrintString("vamp_respawn: " + GetName(oPC) + "| vamp_crypt is a valid location to be respawned.");
location lLoc = GetLocation(oWaypoint);
AssignCommand(oPC, ActionJumpToLocation(lLoc));
DelayCommand(3.0f, SetSubRace(oPC, "Vampire"));
DelayCommand(3.0f, ExportSingleCharacter(oPC));
DelayCommand(3.0f, init_subrace(oPC));
SetCampaignInt("Vampire","NewVamp",0,oPC);
}
}
else
{
//Add here what happens to "non new vampires"
PrintString("vamp_respawn: " + GetName(oPC) + " n'est pas un nouveau vampire.");
}
}

Scripte 8 :

/*void main()
{
object oPC = GetLastPCRested ();
if (GetLastRestEventType()== REST_EVENTTYPE_REST_STARTED)// on fe dodo
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectBlindness(), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_SLEEP), oPC);
}

}
*/
void ClearDarkness(object oOwner)
{
effect eTemp=GetFirstEffect(oOwner);
while(GetIsEffectValid(eTemp))
{
if(GetEffectType(eTemp)==EFFECT_TYPE_BLINDNESS)
{
RemoveEffect(oOwner, eTemp);
}
eTemp=GetNextEffect(oOwner);
}
}
#include "cad_detcorps"
#include "cad_penalite"
void main()
{
object oPC= GetLastPCRested();
{
if (GetLastRestEventType()== REST_EVENTTYPE_REST_STARTED)// on fe dodo
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectBlindness(), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_SLEEP), oPC);
}
if (GetLastRestEventType()== REST_EVENTTYPE_REST_CANCELLED) // ou g mal dormis
{
ClearDarkness(oPC);

}
if (GetLastRestEventType()== REST_EVENTTYPE_REST_FINISHED) // arph je baille
{
ClearDarkness(oPC);
}

// ici les trucs de kermo

if(GetLastRestEventType() != REST_EVENTTYPE_REST_STARTED)
{

if (DetectCorps(oPC)&&GetItemPossessedBy(oPC, "cad_0")==OBJECT_INVALID) // il dort avec un cadavre...
CadPenalite(oPC, TRUE);
DelayCommand(2.0, SetLocalInt(oPC, "PlayerWantsToRest", FALSE));
}
}
}
// THIS SCRIPT IS NO LONGER IN USE
// USE DR_REST!


// This script handles vampires resting

// this returns a formerly dead Vampire to normal.
void vamp_coffin_returnToSelf(object oPC)
{
// Get the original appearance of the Vampire.
int iOriginalAppearance = GetCampaignInt("Vampire","Appearance",oPC);

// If they have died and original appearance equals SOMETHING, then
// change them back.
if (GetCampaignInt("Vampire","PermaSpectre",oPC)==TRUE && iOriginalAppearance > 0)
{
// reset this boolean
SetCampaignInt("Vampire","PermaSpectre",FALSE,oPC);
// change them back.
PrintString("vamp_coffin: vamp_coffin_returnToSelf() - GetAppearanceType was ["+IntToString(GetAppearanceType(oPC))+"] "+GetName(oPC));
SetCreatureAppearanceType(oPC, iOriginalAppearance);
PrintString("vamp_coffin: vamp_coffin_returnToSelf() - GetAppearanceType is now ["+IntToString(GetAppearanceType(oPC))+"] "+GetName(oPC));
}
}
void main()
{
// Get resting pc.
object oPC = GetLastPCRested();
if (GetImmortal(oPC)==TRUE)
SetImmortal(oPC,FALSE);

// If resting pc is vampire and rest event is in start stage
if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED
&&GetSubRace(oPC)=="Vampire")
{
// Get coffin
string sCoffin = GetPCPublicCDKey(oPC);
if (sCoffin == "")
{
sCoffin = "VampireCoffin";
}

object oTarget = GetObjectByTag(sCoffin);
PrintString("vamp_rest: Looking for this coffin tag ["+sCoffin+"] LITERAL TAG:["+GetTag(oTarget)+"]");

// If there is no coffin. Inform PC
if (GetIsObjectValid(oTarget)==FALSE)
{
SendMessageToPC(oPC,"Il n'y a aucun cercueil à proximité. Vous devez vous reposer dans votre cercueil.");
// Cancel rest
AssignCommand(oPC,ClearAllActions());
PrintString("vamp_rest: Found nothing. TAG:"+GetTag(oTarget));
return;
}
// If distance to coffin is over 3m, inform PC
else if (GetDistanceBetween(oPC, oTarget) >=3.0f)
{
SendMessageToPC(oPC,"Il n'y a aucun cercueil à proximité. Vous devez vous reposer dans votre cercueil.");
// Cancel rest
AssignCommand(oPC,ClearAllActions());
PrintString("vamp_rest: Target exists, but is too far away to use. TAG:"+GetTag(oTarget));
return;
}
// Check if vampire has died and he need to rest in his coffin.
if (GetCampaignInt("Vampire", "VampireMustRest", oPC)==1)
{
SendMessageToPC(oPC,"You rest near your coffin.");
// Si oui, le vampire s'est reposé et maintenant il ne meurt pas après 5 heures
SetCampaignInt("Vampire", "VampireMustRest",0,oPC);
PrintString("vamp_rest: Vampire must rest set to ZERO. COFFIN TAG:["+GetTag(oTarget)+"] Resetting vampire appearance as well.");
// reset the vampire's appearance
vamp_coffin_returnToSelf(oPC);
}
}
}

Sa doit étre un probléme de séparation entre les scriptes. Si quelqu'un peu corriger sa serait génial !!!
 
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 : 14/11/2005 21:10:55 Sujet du message :

Met t'es script en mode NWN Script tu utilise sa pour chaque script, la je me perd [ nwscript ] et pour la fin [ /nwscript ] (pas d'espace attention!)
sa donne sa
NWScript :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.

_________________
[http]
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Ivellios
Légende vivante
Inscrit le: 25 Jan 2005
Messages: 447
Localisation: Poitiers
Répondre en citant
Posté le : 14/11/2005 21:13:22 Sujet du message :

Utilise les balises [nwscript]Ton script[/nwscript] pour séparer chaque script déjà, car c'est illisible...
E : (déjà dit ^^)
_________________
Scripts, systèmes, fonctions,... c'est par ici...
Pyjama pour castor, une vocation, un avenir sûr
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur MSN Messenger 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 52.505ms