
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.







La date/heure actuelle est 01/05/2025 07:53:29
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 |
Laitau2 Voyageur Messages: 1 |
Bonjour, j'utilise ce script et il fonctionne bien excepté une chose; les créatures continuent d'attaquer les pc qui tombent à moins de 1 point de vie. Quelqu'un est capable de m'aider pour regler ca?
Merci l2 Quote: 1. Script Name: D & D rules Dying script 2. What it does: This little script I made mimics the way that dying is explained in the D&D Player's Handbook. It states that between -1 and -9, you are dying. Every round you have a 10% chance of stabilizing. At -10, your dead. In this script, after you stabilize you also will have a 33% chance of continuing to heal 1 point, up to 1 hit point. At that point you recover and of course can act normally. This script will also work when the player is at exactly 0 HP. I did this so a player won't have to sit there watching his unconcious body until his friends come and find him. This way you either slowly bleed to death, or you will recover within about 5 minutes or less. If you want to make recovery faster or slower, feel free to change the numbers around to suit your needs. If you need a major change to this script let me know and I will see what I can do. 3. You will need two scripts. The first one goes into the module's OnEnter event. The second goes into the module's OnHeartbeat event. Also remember to blank out the default OnDying script event (VERY IMPORTANT). [EDIT de Lendraste : merci d'utiliser la balise [ code ] et de garder les indentations du script d'origine la prochaine fois, c'est plus lisible ] 4. The onEnter script: Code : void main() { object oPC = GetEnteringObject(); SetLocalString(oPC, "sBleeding", "True"); } The main script that goes in Onheartbeat: /*Created by Fadedshadow 8/28/02. Feel free to modify,pirate,or whatever to suit your needs. */ void main() { object oPC = GetLastPlayerDying(); int nHitPoints = GetCurrentHitPoints(oPC); effect eHeal = EffectHeal(1); effect eDamage = EffectDamage(1,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_PLUS_FIVE); string sDying = "Help ! I'm dying !"; string sStable = "I've stablized."; string sRecover = "I have recovered."; /* You can make this 0 so the pc will stay unconcious until healed by someone else. */ if (nHitPoints < 1) { if (nHitPoints > -10) { int nRoll = (Random(100)); if (GetLocalString(oPC,"sBleeding") == "True" && nRoll <=10) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC); AssignCommand(oPC,SpeakString(sStable)); SetLocalString(oPC, "sBleeding","False"); if (GetCurrentHitPoints(oPC) >= 1) { SetLocalString(oPC, "sBleeding","True"); } } if (GetLocalString(oPC,"sBleeding") == "True" && nRoll > 10) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC); AssignCommand(oPC,SpeakString(sDying)); } if (nRoll <=33 && GetLocalString(oPC,"sBleeding") =="False") { ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC); } if (GetCurrentHitPoints(oPC) >= 1) { SetLocalString(oPC, "sBleeding","True"); AssignCommand(oPC,SpeakString(sRecover)); } } } if(GetCurrentHitPoints(oPC) <= -10) { effect eDeath = EffectDeath(FALSE, FALSE); ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetLastPlayerDying()); } } |
Revenir en haut | ![]() ![]() ![]() ![]() |
Longbow Grand Sage du Conseil Messages: 638 Localisation: Orléans |
Il me semble qu'il s'agit d'un problème de faction.. Je te propose d'adoucir temporairement l'hostilité de la créature hostile la plus proche du mourrant:
En insérant ces lignes en début de script: NWScript :
/* You can make this 0 so the pc will stay unconcious until healed by someone else. */ if (nHitPoints < 1) { object oMo = GetNearestCreature ( CREATURE_TYPE_REPUTATION , REPUTATION_TYPE_ENEMY, oPC ); // Il reste neutre pendant 20.0 secondes... puis de nouveau hostile... SetIsTemporaryNeutral(oPC, oMo , TRUE, 20.0); // Fin de l'ajout // if (nHitPoints > -10) /* warning: 1 unclosed block {} */ Il faut le tester en conditions réelles c'est-à-dire en multijoueur... _________________ Rex illeteratus Quasi Asinus Coronatus Jean de Salisbury |
Revenir en haut | ![]() ![]() ![]() ![]() |


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