NWScript :
//:///
//:: Created 2006-02-19, Lylver
//:: comme sur Armada : static spawn
//:/
#include "ly_lib_pnj"
#include "ly_lib_item"
void main()
{
object oPC = OBJECT_SELF ;
object oArea = GetArea(oPC) ;
string sAtag = GetLocalString(oArea,"ATAG") ;
int bMesg = FALSE ;
if( sAtag == "" ){
sAtag = GetTag(oArea) ;
if( sAtag != "" ) bMesg = TRUE ;
}
if( !GetIsPC(oPC) ) return ;
string sPCID = GetPCID(oPC) ;
int bSpawn = GetLocalInt(oArea,sPCID) ;
int nDelay = GetLocalInt(oArea,"DELAI") ;
if( nDelay == 0 ) nDelay = 24 ;
if( !bSpawn ){
SetLocalInt(oArea,sPCID,TRUE) ;
DelayCommand(HoursToSeconds(nDelay),DeleteLocalInt(oArea,sPCID));
}
switch( StringToInt(sAtag) ){
// Albion - Esterel : interieur Abbaye
case 209 :{
SpawnPNJ("PNJ_ADELME");
break;
}
// CastelMort - le bourg
case 509 :{
SpawnPNJ("GUERRIERCM","0509",1,0,"GUERRIERCM1");
SpawnPNJ("GUERRIERCM","0509",2,0,"GUERRIERCM2");
SpawnPNJ("GUERRIERCM","0509",3,0,"GUERRIERCM3");
SpawnPNJ("GUERRIERCM","0509",4,0,"GUERRIERCM4");
SpawnPNJ("GUERRIERCM","0509",5,0,"GUERRIERCM5");
SpawnPNJ("GUERRIERCM","0509",6,0,"GUERRIERCM6");
SpawnPNJ("GUERRIERCM","0509",7,0,"GUERRIERCM7");
SpawnPNJ("GUERRIERCM","0509",8,0,"GUERRIERCM8");
SpawnPNJ("GUERRIERCM","0509",9,0,"GUERRIERCM9");
SpawnPNJ("GUERRIERCM","0509",10,0,"GUERRIERCM10");
break;
}
// Labyrinthe - 3
case 1903 :{
SpawnPNJ("TN_GOLEM_DEAMB","",1,0,"DEAMB03");
if( !bSpawn ){
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",1,0,"GOLEMFLESH31");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",2,0,"GOLEMFLESH32");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",3,0,"GOLEMFLESH33");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",4,0,"GOLEMFLESH34");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",5,0,"GOLEMFLESH35");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",6,0,"GOLEMFLESH36");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",7,0,"GOLEMFLESH37");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",8,0,"GOLEMFLESH38");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",9,0,"GOLEMFLESH39");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1903",10,0,"GOLEM_OS310");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1903",11,0,"GOLEM_OS311");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1903",12,0,"GOLEM_OS312");
}
break;
}
// Labyrinthe - 4
case 1904 :{
SpawnPNJ("TN_GOLEM_DEAMB","",1,0,"DEAMB04");
if( !bSpawn ){
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",1,0,"GOLEMFLESH41");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",2,0,"GOLEMFLESH42");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",3,0,"GOLEMFLESH43");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",4,0,"GOLEMFLESH44");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",5,0,"GOLEMFLESH45");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",6,0,"GOLEMFLESH46");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",9,0,"GOLEMFLESH49");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",11,0,"GOLEMFLESH411");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1904",7,0,"GOLEM_OS47");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1904",8,0,"GOLEM_OS48");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1904",10,0,"GOLEM_OS410");
}
break;
}
// Labyrinthe - 7
case 1907 :{
if( !bSpawn ){
SpawnPNJ("SOW_MINOS_TYRAN","1907",1,0,"TYRAN1");
SpawnPNJ("SOW_MINOS_TYRAN","1907",2,0,"TYRAN2");
}
break;
}
// Lyon - la ville
case 3001 :{
SpawnPNJ("PNJ_GARDEDELYON","3001",1,0,"PNJ_GARDEDELYON1");
SpawnPNJ("PNJ_GARDEDELYON","3001",2,0,"PNJ_GARDEDELYON2");
SpawnPNJ("PNJ_GARDEDELYON","3001",3,0,"PNJ_GARDEDELYON3");
SpawnPNJ("PNJ_GARDEDELYON","3001",4,0,"PNJ_GARDEDELYON4");
SpawnPNJ("PNJ_GARDEDELYON","3001",5,0,"PNJ_GARDEDELYON5");
break;
}
// Le Bouchon lyonnais - La Grande Salle
case 3101 :{
SpawnPNJ("PNJ_DEUX_FLEURS","",1,2);
SpawnPNJ("PNJ_GASTON","",1,2);
break;
}
// Lyon - Ecu d'Or
case 3703 :{
SpawnPNJ("PNJ_ETANHAWK");
break;
}
/* etc */
}
}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.
//:///
//:: Created 2006-02-19, Lylver
//:: comme sur Armada : static spawn
//:/
#include "ly_lib_pnj"
#include "ly_lib_item"
void main()
{
object oPC = OBJECT_SELF ;
object oArea = GetArea(oPC) ;
string sAtag = GetLocalString(oArea,"ATAG") ;
int bMesg = FALSE ;
if( sAtag == "" ){
sAtag = GetTag(oArea) ;
if( sAtag != "" ) bMesg = TRUE ;
}
if( !GetIsPC(oPC) ) return ;
string sPCID = GetPCID(oPC) ;
int bSpawn = GetLocalInt(oArea,sPCID) ;
int nDelay = GetLocalInt(oArea,"DELAI") ;
if( nDelay == 0 ) nDelay = 24 ;
if( !bSpawn ){
SetLocalInt(oArea,sPCID,TRUE) ;
DelayCommand(HoursToSeconds(nDelay),DeleteLocalInt(oArea,sPCID));
}
switch( StringToInt(sAtag) ){
// Albion - Esterel : interieur Abbaye
case 209 :{
SpawnPNJ("PNJ_ADELME");
break;
}
// CastelMort - le bourg
case 509 :{
SpawnPNJ("GUERRIERCM","0509",1,0,"GUERRIERCM1");
SpawnPNJ("GUERRIERCM","0509",2,0,"GUERRIERCM2");
SpawnPNJ("GUERRIERCM","0509",3,0,"GUERRIERCM3");
SpawnPNJ("GUERRIERCM","0509",4,0,"GUERRIERCM4");
SpawnPNJ("GUERRIERCM","0509",5,0,"GUERRIERCM5");
SpawnPNJ("GUERRIERCM","0509",6,0,"GUERRIERCM6");
SpawnPNJ("GUERRIERCM","0509",7,0,"GUERRIERCM7");
SpawnPNJ("GUERRIERCM","0509",8,0,"GUERRIERCM8");
SpawnPNJ("GUERRIERCM","0509",9,0,"GUERRIERCM9");
SpawnPNJ("GUERRIERCM","0509",10,0,"GUERRIERCM10");
break;
}
// Labyrinthe - 3
case 1903 :{
SpawnPNJ("TN_GOLEM_DEAMB","",1,0,"DEAMB03");
if( !bSpawn ){
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",1,0,"GOLEMFLESH31");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",2,0,"GOLEMFLESH32");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",3,0,"GOLEMFLESH33");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",4,0,"GOLEMFLESH34");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",5,0,"GOLEMFLESH35");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",6,0,"GOLEMFLESH36");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",7,0,"GOLEMFLESH37");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",8,0,"GOLEMFLESH38");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1903",9,0,"GOLEMFLESH39");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1903",10,0,"GOLEM_OS310");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1903",11,0,"GOLEM_OS311");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1903",12,0,"GOLEM_OS312");
}
break;
}
// Labyrinthe - 4
case 1904 :{
SpawnPNJ("TN_GOLEM_DEAMB","",1,0,"DEAMB04");
if( !bSpawn ){
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",1,0,"GOLEMFLESH41");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",2,0,"GOLEMFLESH42");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",3,0,"GOLEMFLESH43");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",4,0,"GOLEMFLESH44");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",5,0,"GOLEMFLESH45");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",6,0,"GOLEMFLESH46");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",9,0,"GOLEMFLESH49");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_CHAIR","1904",11,0,"GOLEMFLESH411");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1904",7,0,"GOLEM_OS47");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1904",8,0,"GOLEM_OS48");
if( d3() != 1 ) SpawnPNJ("TN_GOLEM_OS","1904",10,0,"GOLEM_OS410");
}
break;
}
// Labyrinthe - 7
case 1907 :{
if( !bSpawn ){
SpawnPNJ("SOW_MINOS_TYRAN","1907",1,0,"TYRAN1");
SpawnPNJ("SOW_MINOS_TYRAN","1907",2,0,"TYRAN2");
}
break;
}
// Lyon - la ville
case 3001 :{
SpawnPNJ("PNJ_GARDEDELYON","3001",1,0,"PNJ_GARDEDELYON1");
SpawnPNJ("PNJ_GARDEDELYON","3001",2,0,"PNJ_GARDEDELYON2");
SpawnPNJ("PNJ_GARDEDELYON","3001",3,0,"PNJ_GARDEDELYON3");
SpawnPNJ("PNJ_GARDEDELYON","3001",4,0,"PNJ_GARDEDELYON4");
SpawnPNJ("PNJ_GARDEDELYON","3001",5,0,"PNJ_GARDEDELYON5");
break;
}
// Le Bouchon lyonnais - La Grande Salle
case 3101 :{
SpawnPNJ("PNJ_DEUX_FLEURS","",1,2);
SpawnPNJ("PNJ_GASTON","",1,2);
break;
}
// Lyon - Ecu d'Or
case 3703 :{
SpawnPNJ("PNJ_ETANHAWK");
break;
}
/* etc */
}
}