La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
FAQ
Rechercher
Liste des Membres
Groupes d'utilisateurs
S'enregistrer Se connecter pour vérifier ses messages privés Connexion
S'enregistrer Se connecter pour vérifier ses messages privés Connexion
La date/heure actuelle est 23/11/2024 20:28:23
La Bibliothèque de Neverwinter Nights Index du Forum »
La Bibliothèque Binaire du NWScript - Neverwinter Nights
Voir le sujet précédent ¤ Voir le sujet suivant | |
---|---|
Auteur | Message |
Karln Novice Messages: 6 |
Posté le : 17/12/2004 13:27:22 Sujet du message : 1 petit coup de main - Combinaison de plusieur script
Bonjour a tous.
Bien voila ... je suis une quiche en script, je m'amuse simplement a copier , combiner et légérement modifier ... mais pour ce qui est du reste je suis nul ... Actuellement je crée mon propre module, il parait que c'est a la mode pour le moment. Soit .... voici mon probléme... j'ai décidé de mettre le systéme HTF sur mon module ... seulement j'aimerais légérement modifier le systéme de repos. j'aimerais que le joueur ne puisse pas ce reposer tout le temps... Voila le premier script et le systéme de repos du htf... qui est lancé via a un exectue script dans le OnPlayerRest du module. Code : //////////////////////////////////////////////////////////////////////////////// // // Camping & HTF Systems Resting Script // cf_mod_on_rest // By Don Anderson // dandersonru@msn.com // // Place this script in the Module On Rest Event // // This is the resting package for both the Camping and HTF Systems // //////////////////////////////////////////////////////////////////////////////// #include "htf_text" void main() { object oPC = GetLastPCRested(); object oMod = GetModule(); object oRuneStone = GetItemPossessedBy(oPC, "RuneStone"); string sHunger = "HUNGER";//Name of Module Hunger Value string sThirst = "THIRST";//Name of Module Thirst Value string sFatigue = "FATIGUE";//Name of Module Fatigue Value int nHungerHP = GetLocalInt(oMod,sHunger); //See htf_mod_onload for this value int nThirstHP = GetLocalInt(oMod,sThirst); //See htf_mod_onload for this value int nFatigueHP = GetLocalInt(oMod,sFatigue); //See htf_mod_onload for this value int nFATIGUESYSTEM = GetLocalInt(oMod,"FATIGUESYSTEM"); float fRestrict = GetLocalFloat(oMod,"RESTRESTRICTIONPERCENT"); int nHCurrent = GetLocalInt(oRuneStone,sHunger); int nTCurrent = GetLocalInt(oRuneStone,sThirst); float fHCanRest = fRestrict * IntToFloat(nHungerHP); float fTCanRest = fRestrict * IntToFloat(nThirstHP); int nLevel = GetHitDice(oPC); int nRestType = GetLastRestEventType(); int nAC = GetArcaneSpellFailure(oPC); switch (nRestType) { case REST_EVENTTYPE_REST_STARTED: if (GetLocalInt(oPC, "REST_ALLOWED") != TRUE) { //HTF System check if(nFATIGUESYSTEM = 1) { if (IntToFloat(nHCurrent) < fHCanRest) { FloatingTextStringOnCreature(TOOHUNGRY, oPC, FALSE); SetLocalInt(oPC, "REST_ALLOWED", FALSE); SetLocalInt(oPC, "TENT", FALSE); } if (IntToFloat(nTCurrent) < fTCanRest) { FloatingTextStringOnCreature(TOOTHIRSTY, oPC, FALSE); SetLocalInt(oPC, "REST_ALLOWED", FALSE); SetLocalInt(oPC, "TENT", FALSE); } } FloatingTextStringOnCreature("This is not a good time to be resting.", oPC); AssignCommand(oPC,ClearAllActions()); } else { SetLocalInt(oPC, "REST_ALLOWED", FALSE); DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_SLEEP),oPC)); DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBlindness(),oPC,10.5 + IntToFloat(nLevel))); SetLocalInt(oPC, "TENT", FALSE); } break; case REST_EVENTTYPE_REST_FINISHED: if(nFATIGUESYSTEM = 1) { // Checks for Armor, Shields, and Clothing if (nAC <= 0) { nFatigueHP = nFatigueHP - 0; SendMessageToPC(oPC, "You slept very nicely."); } else if (nAC > 0 && nAC < 20) { nFatigueHP = nFatigueHP - 20; SendMessageToPC(oPC, "Your equipped items made you rest slightly uncomfortably."); } else if (nAC >= 20 && nAC < 40) { nFatigueHP = nFatigueHP - 50; SendMessageToPC(oPC, "Your equipped items made you rest uncomfortably."); } else if (nAC >= 40 && nAC < 60) { nFatigueHP = nFatigueHP - 60; SendMessageToPC(oPC, "Your equipped items made you sleep poorly."); } else if (nAC >= 60 && nAC < 80) { nFatigueHP = nFatigueHP - 80; SendMessageToPC(oPC, "Your equipped items made toss and turn all night."); } else if (nAC >= 80 && nAC <= 100) { nFatigueHP = nFatigueHP - 100; SendMessageToPC(oPC, "Your equipped items made you very uncomfortable."); } AssignCommand (oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED)); SetLocalInt(oRuneStone,sFatigue,nFatigueHP); //DEBUG string sDebugF = IntToString(nFatigueHP); SendMessageToPC(oPC, "REST FATIGUE RESET : " + sDebugF); //DEBUG } RemoveEffect(oPC, EffectBlindness()); SetLocalInt(oRuneStone,"ALCTOTAL", 0); AssignCommand(oPC,ClearAllActions()); break; } } Et ici le 2 émé script que j'ai trouver sur nwn-fr.com. Code : //://///////////////////////////////////////////
//:: Name: Zimero's Limited Resting v1.2 //:: FileName: z_mod_onrest //:///////////////////////////////////////////// /* Description du Script Il permet d'attendre un certain nombre de temps avant que le joueur puisse se reposer. Mais tout l'interet n'est pas là, ce script permet aussi de gérer le temps de repos, c'est à dire, si on se repose seulement la moitier tu temps d'un repos total, l'attente avant le prochain repos sera proportionnel au repos deja fournit. */ //:///////////////////////////////////////////// //:: Created By: Jonas Boberg aka. zimero //:: Created On: 20021212 //:: Modified On: 20030107 //:: Traduit en Français par Asuke (sasukezero@hotmail.com) //:: Traduit le: Vendredi 31 Janvier 2003 //:///////////////////////////////////////////// //VARIABLE MODIFIABLES //Le nombres d'heure durant lequelles le joueurs doit attendre //avant de pouvoir se reposer après un repos complet (defaut, 8 heures) int TIMEBETWEENRESTING=8; //Le nombre reel de minutes qui correspond a 1 heure dans le jeu int REALTIMEMINUTES=1; //FIN DES VARIABLES MODIFIABLES int CurrentTime(); void main() { //initiation des varibles object oPC = GetLastPCRested(); int iCurrentTime, iLastRestTime, iTimeSinceRest, iTimeUntilRest; float fTimePenalty; switch (GetLastRestEventType()) { case REST_EVENTTYPE_REST_STARTED: iCurrentTime = CurrentTime(); iLastRestTime = GetLocalInt(oPC,"REST_HOUR"); iTimeSinceRest = iCurrentTime-iLastRestTime; SetLocalInt(oPC, "REST_SECOND", GetTimeSecond()); if (iLastRestTime==0 || iTimeSinceRest >= TIMEBETWEENRESTING) { SetLocalInt(oPC, "REST_ALLOWED", TRUE); } else { SetLocalInt(oPC, "REST_ALLOWED", FALSE); iTimeUntilRest = TIMEBETWEENRESTING-iTimeSinceRest; if (REALTIMEMINUTES == 1) { iTimeUntilRest = FloatToInt(HoursToSeconds(iTimeUntilRest)/60); //Vous pouvez changer le message si le repos n'est pas encore //autoriser if (iTimeUntilRest == 1) { FloatingTextStringOnCreature("Vous devez attendre " + " minutes avant de pouvoir vous reposer", oPC); } else { FloatingTextStringOnCreature("Vous devez attendre "+ IntToString(iTimeUntilRest)+ " minutes avant de pouvoir vous reposer", oPC); } } else { if (iTimeUntilRest == 1) { FloatingTextStringOnCreature("Vous devez attendre " + " minutes avant de pouvoir vous reposer", oPC); } else { FloatingTextStringOnCreature("Vous devez attendre "+ IntToString(iTimeUntilRest)+ " minutes avant de pouvoir vous reposer", oPC); } } //Annuler le repos AssignCommand(oPC,ClearAllActions()); } break; case REST_EVENTTYPE_REST_CANCELLED: //variable sur le temps de repos if (GetLocalInt(oPC, "REST_ALLOWED") == TRUE) { iCurrentTime = GetTimeSecond(); iLastRestTime = GetLocalInt(oPC, "REST_SECOND"); iTimeSinceRest = iCurrentTime - iLastRestTime; if (iTimeSinceRest<0) iTimeSinceRest+= 60; fTimePenalty = TIMEBETWEENRESTING*(iTimeSinceRest/(0.5*GetHitDice(oPC)+10)); SetLocalInt(oPC,"REST_HOUR", CurrentTime()-(TIMEBETWEENRESTING-FloatToInt(fTimePenalty))); } break; case REST_EVENTTYPE_REST_FINISHED: SetLocalInt(oPC, "REST_HOUR", CurrentTime()); } } int CurrentTime() { return GetCalendarYear()*8064 + GetCalendarMonth()*672 + GetCalendarDay()*24 + GetTimeHour(); } voila ... quelqu'un pourrais me combiner les deux pour moi ? j'ai le même probléme avec le script de respawn. J'aimerais le modifier légérement afin d'appliquer des pénalité .... même probléme que si dessus mais avec d'autre script. Le premier, script de respawn du Htf. Code : ////////////////////////////////////////////////////////
// // Soul Rune Respawn // bs_mod_respawn // By Don Anderson // dandersonru@msn.com // // This is the Module Respawn for the Soul Rune and // Permanent Death System // //////////////////////////////////////////////////////// void main() { // Set Declarations object oPC = GetPCSpeaker(); object oRespawner = GetLastRespawnButtonPresser(); object oTargetHeaven = GetWaypointByTag("WP_HEAVEN"); object oTargetHell = GetWaypointByTag("WP_HELL"); object oTargetLimbo = GetWaypointByTag("WP_LIMBO"); object oTargetPerm = GetWaypointByTag("WP_PERMDEATH"); object oItem = GetItemPossessedBy(oRespawner, "SoulRune"); location lTargetHeaven = GetLocation(oTargetHeaven); location lTargetHell = GetLocation(oTargetHell); location lTargetLimbo = GetLocation(oTargetLimbo); location lTargetPerm = GetLocation(oTargetPerm); effect eHeaven = EffectVisualEffect(VFX_FNF_WORD); // Heaven base respawn effect effect eLimbo = EffectVisualEffect(VFX_FNF_NATURES_BALANCE); // Limbo base respawn effect effect eHell = EffectVisualEffect(VFX_FNF_PWKILL); // Hell base respawn effect effect ePerm = EffectVisualEffect(VFX_IMP_DEATH_L); // Permanent Death base respawn effect effect eFX1 = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER); // For Healing at Respawn Area effect eFX2 = EffectVisualEffect(VFX_IMP_HEALING_G); //For after Raise Dead effect at Bind Stone or Home effect eFX3 = EffectVisualEffect(VFX_IMP_RAISE_DEAD); //For Bind Stone/Home/Death Eternal effect effect eFX4 = EffectVisualEffect(VFX_IMP_UNSUMMON); // For leaving the dead corpse at respawn effect eFX5 = EffectVisualEffect(VFX_IMP_GOOD_HELP); // Permanent Death Effect effect eFX6 = EffectVisualEffect(VFX_IMP_EVIL_HELP); // Permanent Death Effect float fDelay = 1.5; // This the delay from respawn button pressed to respawn location int nClearCombatState; SetPlotFlag(oRespawner, TRUE); // Checks to see if a Soul Rune is on the Player // If not the Player receives the Death Deed if (GetIsObjectValid(oItem)) DestroyObject(oItem); if (GetItemPossessedBy(oRespawner, "SoulRune") == OBJECT_INVALID) { CreateItemOnObject("DeathDeed", oRespawner); if (GetAreaFromLocation(lTargetPerm) == OBJECT_INVALID) return; AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetPerm))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, ePerm, lTargetPerm)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetPerm)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetPerm)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetPerm)); DelayCommand(fDelay + 9.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX5, lTargetPerm)); DelayCommand(fDelay + 10.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX6, lTargetPerm)); } else { //Respawn Locations Resurrect Player and Heal if (GetGoodEvilValue(oRespawner) <= 29) { //This is the respawn effects for Evil Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetHell))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eHell, lTargetHell)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetHell)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetHell)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetHell)); } else if ((GetGoodEvilValue(oRespawner) >= 30) && (GetGoodEvilValue(oRespawner) <= 70)) { //This is the respawn effects for Neutral Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetLimbo))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eLimbo, lTargetLimbo)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetLimbo)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetLimbo)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetLimbo)); } else if (GetGoodEvilValue(oRespawner) >= 71) { //This is the respawn effects for Good Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetHeaven))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eHeaven, lTargetHeaven)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetHeaven)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetHeaven)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetHeaven)); } string sKiller = GetName(GetLastHostileActor(oRespawner)); SendMessageToPC(oRespawner, "You were Killed by " + sKiller); SetPlotFlag(oRespawner, FALSE); } } et voici, l'autre script trouver également sur nwn-fr.com. Code : //:////////////////////////////////////////////// //:: Self-Adjusting Respawn Penalty //:: Levels 1-5 = Pénalité progressive de GP //:: 6-12 = Pénalités progressives de GP et d'XP //:: 13-20 = Idem avec en plus un respawn avec la moitié des HP //:: CREATED BY: LittleZephyr (fergus_kelley@yahoo.com) //:: traduit/modifié/commenté par MrCocktail pour //:: nwn-fr.com //:///////////////////////////////////////////// #include "nw_i0_plot" void ApplyPenalty(object oDead) { int nHD = GetHitDice(oDead); if (nHD < 6) { int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 7000) { nGoldToTake = 7000; } DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); } if (nHd > 5) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); // * Vous ne pouvez pas perdre de niveau avec cette pénalité int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) { nNewXP = nMin; SetXP(oDead, nNewXP); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); } } if (nHd > 12) { int nHP = GetMaxHitPoints(oDead); int nHPpenalty = nHP / 2; AssignCommand(oDead, EffectDamage(nHPpenalty, oDead)); } } D'avance je vous remercie pour votre aide ... [edit] script trop long == bobo pour le serveur, apparemment. _________________ C'est un beau jour pour mourir... |
Revenir en haut | |
Aladar Chevalier Messages: 96 Localisation: Tours |
Bin je te filerais bien un coup de main (si c'est toujours d'actualité, le post date un peu) mais j'arrive pas a savoir quel script tu veux combiner avec l'autre...
Mais sans vouloir te faire de faux espoir, je suis une quiche comme toi (si tu l'est toujours ) et je suis pas certain de reussir ca, surtout que les scripts sont reativement colossaux j'attend une reponse ou tu me dis precisement quels scripts tu veux combiner et je tente de te faire ca |
Revenir en haut | |
Karln Novice Messages: 6 |
MErci ....
bon, mon poste date d'aujourd'hui ... alors, je pense que tu te trompe ... parce que oui, il est toujour d'acutallité ... pour résumé ... j'ai 2 script de repos a combinert .... le premier étant l'original a garder, le deuxiéme a intégré au premier. Ensuite, j'ai le même probléme mais avec 2 autre script ... mais des script de Respawn le premier étant l'original a garder, le deuxiéme a intégré au premier. voila ..... merci pour toute aide ... _________________ C'est un beau jour pour mourir... |
Revenir en haut | |
Anthraxcite Légende vivante Messages: 372 Localisation: Belgique |
La fonction ApplyPenalty était modifié n'importe comment j'ai du corriger(première fois que je vois un AssignCommand(oDead, EffectDamage(nHPpenalty, oDead)), celui qui a fait ça aurait du essayé de le compiler avant..
NWScript : ////////////////////////////// ////////////////////////// // // Soul Rune Respawn // bs_mod_respawn && ApplyPenalty modif // By Don Anderson // dandersonru@msn.com // // This is the Module Respawn for the Soul Rune and // Permanent Death System // ////////////////////////////// ////////////////////////// void ApplyPenalty(object oDead) { int nHD = GetHitDice(oDead); if (nHD < 6) { int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 7000) { nGoldToTake = 7000; } DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); } if (nHD > 5) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) { nNewXP = nMin; SetXP(oDead, nNewXP); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); } } if (nHD > 12) { int nHP = GetMaxHitPoints(oDead); int nHPpenalty = nHP / 2; ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nHPpenalty),oDead); } } void main() { // Set Declarations object oPC = GetPCSpeaker(); object oRespawner = GetLastRespawnButtonPresser(); object oTargetHeaven = GetWaypointByTag("WP_HEAVEN"); object oTargetHell = GetWaypointByTag("WP_HELL"); object oTargetLimbo = GetWaypointByTag("WP_LIMBO"); object oTargetPerm = GetWaypointByTag("WP_PERMDEATH"); object oItem = GetItemPossessedBy(oRespawner, "SoulRune"); location lTargetHeaven = GetLocation(oTargetHeaven); location lTargetHell = GetLocation(oTargetHell); location lTargetLimbo = GetLocation(oTargetLimbo); location lTargetPerm = GetLocation(oTargetPerm); effect eHeaven = EffectVisualEffect(VFX_FNF_WORD); // Heaven base respawn effect effect eLimbo = EffectVisualEffect(VFX_FNF_NATURES_BALANCE); // Limbo base respawn effect effect eHell = EffectVisualEffect(VFX_FNF_PWKILL); // Hell base respawn effect effect ePerm = EffectVisualEffect(VFX_IMP_DEATH_L); // Permanent Death base respawn effect effect eFX1 = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER); // For Healing at Respawn Area effect eFX2 = EffectVisualEffect(VFX_IMP_HEALING_G); //For after Raise Dead effect at Bind Stone or Home effect eFX3 = EffectVisualEffect(VFX_IMP_RAISE_DEAD); //For Bind Stone/Home/Death Eternal effect effect eFX4 = EffectVisualEffect(VFX_IMP_UNSUMMON); // For leaving the dead corpse at respawn effect eFX5 = EffectVisualEffect(VFX_IMP_GOOD_HELP); // Permanent Death Effect effect eFX6 = EffectVisualEffect(VFX_IMP_EVIL_HELP); // Permanent Death Effect float fDelay = 1.5; // This the delay from respawn button pressed to respawn location int nClearCombatState; SetPlotFlag(oRespawner, TRUE); // Checks to see if a Soul Rune is on the Player // If not the Player receives the Death Deed if (GetIsObjectValid(oItem)) DestroyObject(oItem); if (GetItemPossessedBy(oRespawner, "SoulRune") == OBJECT_INVALID) { CreateItemOnObject("DeathDeed", oRespawner); if (GetAreaFromLocation(lTargetPerm) == OBJECT_INVALID) return; AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetPerm))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, ePerm, lTargetPerm)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetPerm)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetPerm)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetPerm)); DelayCommand(fDelay + 9.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX5, lTargetPerm)); DelayCommand(fDelay + 10.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX6, lTargetPerm)); } else { //Respawn Locations Resurrect Player and Heal if (GetGoodEvilValue(oRespawner) <= 29) { //This is the respawn effects for Evil Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetHell))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eHell, lTargetHell)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetHell)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetHell)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetHell)); } else if ((GetGoodEvilValue(oRespawner) >= 30) && (GetGoodEvilValue(oRespawner) <= 70)) { //This is the respawn effects for Neutral Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetLimbo))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eLimbo, lTargetLimbo)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetLimbo)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetLimbo)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetLimbo)); } else if (GetGoodEvilValue(oRespawner) >= 71) { //This is the respawn effects for Good Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetHeaven))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eHeaven, lTargetHeaven)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetHeaven)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetHeaven)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetHeaven)); DelayCommand(fDelay + 8.5, ApplyPenalty(oRespawner)); } string sKiller = GetName(GetLastHostileActor(oRespawner)); SendMessageToPC(oRespawner, "You were Killed by " + sKiller); SetPlotFlag(oRespawner, FALSE); } } |
Revenir en haut | |
Karln Novice Messages: 6 |
Bien, merci pour ton aide Anthraxcite, mais j'ai tout de même un petit probléme ...
le script respawn bien, mais ne donne aucune pénalité ....... c'est peut être du au fait que le script présent dans le OnPlayerRepawn du module est celui-ci NWScript :
////////////////////////////// ////////////////////////// // // Wrapper // wrap_mod_onrespa // by Don Anderson // ////////////////////////////// ////////////////////////// void main() { ExecuteScript("nw_o0_respawn",OBJECT_SELF); //Default NWN Respawn ExecuteScript("bs_mod_respawn",OBJECT_SELF); //Soul Rune System ExecuteScript("htf_mod_respawn",OBJECT_SELF); //HTF System } en sachant que le "bs_mod_respawn" est le script que tu as modifier .... et que le "htf_mod_respawn" est celui-ci NWScript :
////////////////////////////// ////////////////////////////// //////////////////// // HTF System - Respawn File // htf_mod_respawn // By Don Anderson // dandersonru@msn.com // // Original Script by Edward Beck // // Place this script in the Module On Respawn Event // ////////////////////////////// ////////////////////////////// //////////////////// void main() { object oPC = GetLastRespawnButtonPresser(); object oHenchman = GetHenchman(oPC); object oMod = GetModule(); object oRuneStone = GetItemPossessedBy(oPC, "RuneStone"); string sHunger = "HUNGER";//Name of Module Hunger Value string sThirst = "THIRST";//Name of Module Thirst Value string sFatigue = "FATIGUE";//Name of Module Fatigue Value string sAlcTotal = "ALCTOTAL";//Used for Alcohol System int nHungerHP = GetLocalInt(oMod,sHunger);// See htf_mod_onload int nThirstHP = GetLocalInt(oMod,sThirst);// See htf_mod_onload int nFatigueHP = GetLocalInt(oMod,sFatigue);// See htf_mod_onload //If the Player has a Henchman they are removed so they are not part of the Respawn if (GetIsObjectValid(oHenchman)) RemoveHenchman(oPC, oHenchman); //Gets and checks to see if the Hunger or Fatigue Systems are Enabled int nHUNGERSYSTEM = GetLocalInt(oMod,"HUNGERSYSTEM"); int nFATIGUESYSTEM = GetLocalInt(oMod,"FATIGUESYSTEM"); //Resets the Player HTF values if Hunger OR Fatigue is Enabled if ((nHUNGERSYSTEM=1) || (nFATIGUESYSTEM=1)) { SetLocalInt(oRuneStone,sHunger,nHungerHP); SetLocalInt(oRuneStone,sThirst,nThirstHP); SetLocalInt(oRuneStone,sFatigue,nFatigueHP); SetLocalInt(oRuneStone,sAlcTotal,0); SetCampaignInt("HTF",sHunger,nHungerHP,oPC); SetCampaignInt("HTF",sThirst,nThirstHP,oPC); SetCampaignInt("HTF",sFatigue,nFatigueHP,oPC); SetCampaignInt("HTF",sAlcTotal,0,oPC); } } a ton avis le probléme est du a quoi ? tu en pense quoi ? d'avance merci. _________________ C'est un beau jour pour mourir... |
Revenir en haut | |
Anthraxcite Légende vivante Messages: 372 Localisation: Belgique |
Erreur de ma part ca ne s'executait que dans le cas du troisième type d'alignement(bon). Correction :
NWScript : ////////////////////////////// ////////////////////////// // // Soul Rune Respawn // bs_mod_respawn && ApplyPenalty modif // By Don Anderson // dandersonru@msn.com // // This is the Module Respawn for the Soul Rune and // Permanent Death System // ////////////////////////////// ////////////////////////// void ApplyPenalty(object oDead) { int nHD = GetHitDice(oDead); if (nHD < 6) { int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 7000) { nGoldToTake = 7000; } DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); } if (nHD > 5) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) { nNewXP = nMin; SetXP(oDead, nNewXP); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); } } if (nHD > 12) { int nHP = GetMaxHitPoints(oDead); int nHPpenalty = nHP / 2; ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nHPpenalty),oDead); } } void main() { // Set Declarations object oPC = GetPCSpeaker(); object oRespawner = GetLastRespawnButtonPresser(); object oTargetHeaven = GetWaypointByTag("WP_HEAVEN"); object oTargetHell = GetWaypointByTag("WP_HELL"); object oTargetLimbo = GetWaypointByTag("WP_LIMBO"); object oTargetPerm = GetWaypointByTag("WP_PERMDEATH"); object oItem = GetItemPossessedBy(oRespawner, "SoulRune"); location lTargetHeaven = GetLocation(oTargetHeaven); location lTargetHell = GetLocation(oTargetHell); location lTargetLimbo = GetLocation(oTargetLimbo); location lTargetPerm = GetLocation(oTargetPerm); effect eHeaven = EffectVisualEffect(VFX_FNF_WORD); // Heaven base respawn effect effect eLimbo = EffectVisualEffect(VFX_FNF_NATURES_BALANCE); // Limbo base respawn effect effect eHell = EffectVisualEffect(VFX_FNF_PWKILL); // Hell base respawn effect effect ePerm = EffectVisualEffect(VFX_IMP_DEATH_L); // Permanent Death base respawn effect effect eFX1 = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER); // For Healing at Respawn Area effect eFX2 = EffectVisualEffect(VFX_IMP_HEALING_G); //For after Raise Dead effect at Bind Stone or Home effect eFX3 = EffectVisualEffect(VFX_IMP_RAISE_DEAD); //For Bind Stone/Home/Death Eternal effect effect eFX4 = EffectVisualEffect(VFX_IMP_UNSUMMON); // For leaving the dead corpse at respawn effect eFX5 = EffectVisualEffect(VFX_IMP_GOOD_HELP); // Permanent Death Effect effect eFX6 = EffectVisualEffect(VFX_IMP_EVIL_HELP); // Permanent Death Effect float fDelay = 1.5; // This the delay from respawn button pressed to respawn location int nClearCombatState; SetPlotFlag(oRespawner, TRUE); // Checks to see if a Soul Rune is on the Player // If not the Player receives the Death Deed if (GetIsObjectValid(oItem)) DestroyObject(oItem); if (GetItemPossessedBy(oRespawner, "SoulRune") == OBJECT_INVALID) { CreateItemOnObject("DeathDeed", oRespawner); if (GetAreaFromLocation(lTargetPerm) == OBJECT_INVALID) return; AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetPerm))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, ePerm, lTargetPerm)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetPerm)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetPerm)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetPerm)); DelayCommand(fDelay + 9.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX5, lTargetPerm)); DelayCommand(fDelay + 10.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX6, lTargetPerm)); } else { //Respawn Locations Resurrect Player and Heal if (GetGoodEvilValue(oRespawner) <= 29) { //This is the respawn effects for Evil Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetHell))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eHell, lTargetHell)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetHell)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetHell)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetHell)); DelayCommand(fDelay + 8.5, ApplyPenalty(oRespawner)); } else if ((GetGoodEvilValue(oRespawner) >= 30) && (GetGoodEvilValue(oRespawner) <= 70)) { //This is the respawn effects for Neutral Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetLimbo))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eLimbo, lTargetLimbo)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetLimbo)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetLimbo)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetLimbo)); DelayCommand(fDelay + 8.5, ApplyPenalty(oRespawner)); } else if (GetGoodEvilValue(oRespawner) >= 71) { //This is the respawn effects for Good Players AssignCommand(oRespawner, ClearAllActions(nClearCombatState = TRUE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eFX4, oRespawner); DelayCommand(fDelay, AssignCommand(oRespawner, ActionJumpToLocation(lTargetHeaven))); DelayCommand(fDelay + 2.0, SetPlotFlag(oRespawner, FALSE)); DelayCommand(fDelay + 2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oRespawner, 3.0)); DelayCommand(fDelay + 3.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eHeaven, lTargetHeaven)); DelayCommand(fDelay + 4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX3, lTargetHeaven)); DelayCommand(fDelay + 5.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oRespawner, 5.0)); DelayCommand(fDelay + 6.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX1, lTargetHeaven)); DelayCommand(fDelay + 7.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner)); DelayCommand(fDelay + 8.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, eFX2, lTargetHeaven)); DelayCommand(fDelay + 8.5, ApplyPenalty(oRespawner)); } string sKiller = GetName(GetLastHostileActor(oRespawner)); SendMessageToPC(oRespawner, "You were Killed by " + sKiller); SetPlotFlag(oRespawner, FALSE); } } |
Revenir en haut | |
La Bibliothèque de Neverwinter Nights Index du Forum »
La Bibliothèque Binaire du NWScript - Neverwinter Nights
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