Archives des forums MMO/MMORPG > Neverwinter Nights > NWN - Maskado > [Script] Monstre errant pendant le repos des joueurs
[Script] Monstre errant pendant le repos des joueurs
Par Daynos le 12/10/2002 à 16:39:58 (#2323097)
http://nwvault.ign.com/Files/script...20Related.shtml
le script est à coller dans le module OnPlayerRest action..
provoque l'apparition d'un monstre 33% du temps ou un aventurier se repose
Par Zariel le 28/10/2002 à 14:39:14 (#2424366)
Par Rafa le 28/10/2002 à 14:55:55 (#2424497)
C'est mieux comme ca? :p
Par Zariel le 28/10/2002 à 14:56:47 (#2424507)
Par coolstar le 28/10/2002 à 15:20:19 (#2424694)
PLS !!!
Par -Dacaerin- le 30/1/2003 à 13:01:42 (#3133142)
Une âme charitable pourrait-elle faire un copier colletr sur le forum afin que je puisse l'utiliser...
Merci d'avance :merci:
Par sounéva le 30/1/2003 à 14:04:44 (#3133561)
void main()
{
///////////
//Sometimes spawn monster in during rest v1.2
///////////
//This script rolls a D6 and spawns a monster with a CR
//of your level if a 3 is rolled, or spawns a monster with
//a CR of 1 higher than your level if a 4 is rolled.
///////////
//Script by Michael Ham (mindtakerr)
//Date Created: 6/24/02
//Filename: monster_rest
///////////
// An object to hold the last player who rested
object oPlayer = GetLastPCRested();
// Check to see whether resting has started or is over
int nRestTurn = GetLocalInt(oPlayer, "nRestTurns");
SetLocalInt(oPlayer, "nRestTurns", nRestTurn + 1);
nRestTurn = GetLocalInt(oPlayer, "nRestTurns");
if (nRestTurn == 1) {
// Determine whether rest will be peaceful or not
int nRestType = d6();
int nEnemyType = d3();
object oEnemy;
// A string to hold the creature's tag
string sCreature;
// Set a location for where the PC is
location lHere = GetLocation(oPlayer);
// Set the level of the monster to spawn
int iLevel = 0;
iLevel += GetLevelByPosition(1, oPlayer);
iLevel += GetLevelByPosition(2, oPlayer);
iLevel += GetLevelByPosition(3, oPlayer);
// A roll of 4 causes the monster to be even harder
if (nRestType == 4) {
iLevel++;
nRestType = 3;
}
// Script only has 15 places for monster levels
if (iLevel > 15) {
iLevel = 15;
}
// Bad luck, a monster is coming
if (nRestType == 3) {
// Decide which monster to spawn, based on CR
switch (iLevel) {
case 1:
if (nEnemyType == 1)
sCreature = "NW_ORCA";
else if (nEnemyType == 2)
sCreature = "NW_WOLF";
else
sCreature = "NW_ZOMBIE01";
break;
case 2:
if (nEnemyType == 1)
sCreature = "NW_BEARBLCK";
else if (nEnemyType == 2)
sCreature = "NW_BUGBEARA";
else
sCreature = "NW_KRENSHAR";
break;
case 3:
if (nEnemyType == 1)
sCreature = "NW_MEPAIR";
else if (nEnemyType == 2)
sCreature = "NW_BTLBOMB";
else
sCreature = "NW_DIREBADG";
break;
case 4:
if (nEnemyType == 1)
sCreature = "NW_GHAST";
else if (nEnemyType == 2)
sCreature = "NW_AIR";
else
sCreature = "NW_MINOTAUR";
break;
case 5:
if (nEnemyType == 1)
sCreature = "NW_OGREMAGE01";
else if (nEnemyType == 2)
sCreature = "NW_BUGBEARA";
else
sCreature = "NW_KRENSHAR";
break;
case 6:
if (nEnemyType == 1)
sCreature = "NW_OGRECHIEF01";
else if (nEnemyType == 2)
sCreature = "NW_TROLL";
else
sCreature = "NW_DEVOUR";
break;
case 7:
if (nEnemyType == 1)
sCreature = "NW_SLAADBL";
else if (nEnemyType == 2)
sCreature = "NW_UMBERHULK";
else
sCreature = "NW_MUMMY";
break;
case 8:
if (nEnemyType == 1)
sCreature = "NW_GOLFLESH";
else if (nEnemyType == 2)
sCreature = "NW_ETTIN";
else
sCreature = "NW_TROLLCHIEF";
break;
case 9:
if (nEnemyType == 1)
sCreature = "NW_BEARDIRE";
else if (nEnemyType == 2)
sCreature = "NW_MINWIZ";
else
sCreature = "NW_RAKSHASA";
break;
case 10:
if (nEnemyType == 1)
sCreature = "NW_GNTFROST";
else if (nEnemyType == 2)
sCreature = "nw_bugbearboss";
else
sCreature = "NW_GNTHILL";
break;
case 11:
if (nEnemyType == 1)
sCreature = "NW_GOBLINBOSS";
else if (nEnemyType == 2)
sCreature = "NW_BATTDEVOUR";
else
sCreature = "NW_REVENANT001";
break;
case 12:
if (nEnemyType == 1)
sCreature = "NW_GolClay";
else if (nEnemyType == 2)
sCreature = "NW_SHGUARD";
else
sCreature = "NW_DRGBLACK001";
break;
case 13:
if (nEnemyType == 1)
sCreature = "NW_SPIDERBOSS";
else if (nEnemyType == 2)
sCreature = "NW_DRGBLACK001";
else
sCreature = "NW_GNTFIRE";
break;
case 14:
if (nEnemyType == 1)
sCreature = "NW_MUMMYBOSS";
else if (nEnemyType == 2)
sCreature = "drgblue002";
else
sCreature = "NW_GOLIRON";
break;
case 15:
if (nEnemyType == 1)
sCreature = "nw_beetleboss";
else if (nEnemyType == 2)
sCreature = "NW_FIREGREAT";
else
sCreature = "NW_DRGGREEN002";
break;
}
// Create the enemy at the PC's location
oEnemy = CreateObject(OBJECT_TYPE_CREATURE, sCreature, lHere, FALSE);
// The PC alerts of danger
AssignCommand(oPlayer, ActionSpeakString("I'm under attack!"));
// Wait a moment so that the PC might get ready
AssignCommand(oEnemy, ActionWait(3.0));
// Tell the enemy to attack the player
AssignCommand(oEnemy, ActionAttack(oPlayer));
SetLocalInt(oPlayer, "nRestTurns", -1);
}
}
if(nRestTurn != 1)
SetLocalInt(oPlayer, "nRestTurns", 0);
voilou voilou
Par -Dacaerin- le 30/1/2003 à 17:26:22 (#3134944)
Par Archamedes_Fr le 30/1/2003 à 19:13:31 (#3135940)
Par Jaha Effect le 30/1/2003 à 19:37:10 (#3136207)
Mais bon c'est mon goût personnel.
Jaha Effect :D
Par Kaïba le 31/1/2003 à 3:54:18 (#3138745)
Kaïba effect :ange: (dsl pas pu m'empêcher :p )
Par -Dacaerin- le 31/1/2003 à 10:33:25 (#3139673)
M'enfin mwouais bof le script. Je parle même pas techniquement, mais juste l'ensemble. avec ça, tu risques de voir apparaître un dragon vert en plein village si un PJ de niveau 16+ a le malheur de s'y reposer. Et je parle pas d'une auberge...
Ba voila une bonne raison de modifier le script pour le rendre plus RPment correct...
Dacaerin effect :ange:
Par Jaha Effect le 31/1/2003 à 10:45:25 (#3139764)
*Affute ces épées et part bouter les plagiaires*
Jaha Effect :D
JOL Archives 1.0.1
@ JOL / JeuxOnLine