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.
void CreateIfNeeded(object oPC, string sTag, string sRes)
{
if (GetItemPossessedBy(oPC, sTag)==OBJECT_INVALID)
CreateItemOnObject(sRes, oPC);
}
void DestroyAllItems(object oPC)
{
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BELT,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC));
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
////////////////////////////// ///////////////////////////
void main()
{
object oMod = GetModule();
object oPC = GetEnteringObject();
DestroyAllItems(oPC);
SendMessageToPC(oPC, "Destruction inventaire");
WriteTimestampedLogEntry("Destruction inventaire");
SetXP(oPC,0);
SetPlotFlag(oPC, TRUE);
SendMessageToPC(oPC, " Vous etes invincible");
WriteTimestampedLogEntry("Invincibilite");
CreateIfNeeded(oPC,"Examen","examenfacteurdep");
WriteTimestampedLogEntry("Creation Examinateur Creature");
CreateIfNeeded(oPC,"epertueusedepnj","epertueusedepnj");
WriteTimestampedLogEntry("Creation tueuse de creature");
CreateIfNeeded(oPC,"BatNiveauPlus","batniveauplus");
WriteTimestampedLogEntry("Creation Level Up");
CreateIfNeeded(oPC,"BatNiveauMoins","batniveaumoins");
WriteTimestampedLogEntry("Creation Level Down");
CreateIfNeeded(oPC,"Maniementdetoute","maniementdetoute");
WriteTimestampedLogEntry("Anneau de maniement de toute arme");
ActionEquipItem(GetItemPossessedBy(oPC,"BatNiveauPlus"),INVENTORY_SLOT_NECK);
WriteTimestampedLogEntry("Equipement outil 1");
ActionEquipItem(GetItemPossessedBy(oPC,"BatNiveauMoins"),INVENTORY_SLOT_RIGHTRING);
WriteTimestampedLogEntry("Equipement outil 2");
ActionEquipItem(GetItemPossessedBy(oPC,"Maniementdetoute"),INVENTORY_SLOT_LEFTRING);
WriteTimestampedLogEntry("Equipement outil 3");
ActionEquipItem(GetItemPossessedBy(oPC,"Epertueusedepnj"),INVENTORY_SLOT_RIGHTHAND);
WriteTimestampedLogEntry("Equipement outil 4");
}
{
if (GetItemPossessedBy(oPC, sTag)==OBJECT_INVALID)
CreateItemOnObject(sRes, oPC);
}
void DestroyAllItems(object oPC)
{
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BELT,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC));
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC));
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
////////////////////////////// ///////////////////////////
void main()
{
object oMod = GetModule();
object oPC = GetEnteringObject();
DestroyAllItems(oPC);
SendMessageToPC(oPC, "Destruction inventaire");
WriteTimestampedLogEntry("Destruction inventaire");
SetXP(oPC,0);
SetPlotFlag(oPC, TRUE);
SendMessageToPC(oPC, " Vous etes invincible");
WriteTimestampedLogEntry("Invincibilite");
CreateIfNeeded(oPC,"Examen","examenfacteurdep");
WriteTimestampedLogEntry("Creation Examinateur Creature");
CreateIfNeeded(oPC,"epertueusedepnj","epertueusedepnj");
WriteTimestampedLogEntry("Creation tueuse de creature");
CreateIfNeeded(oPC,"BatNiveauPlus","batniveauplus");
WriteTimestampedLogEntry("Creation Level Up");
CreateIfNeeded(oPC,"BatNiveauMoins","batniveaumoins");
WriteTimestampedLogEntry("Creation Level Down");
CreateIfNeeded(oPC,"Maniementdetoute","maniementdetoute");
WriteTimestampedLogEntry("Anneau de maniement de toute arme");
ActionEquipItem(GetItemPossessedBy(oPC,"BatNiveauPlus"),INVENTORY_SLOT_NECK);
WriteTimestampedLogEntry("Equipement outil 1");
ActionEquipItem(GetItemPossessedBy(oPC,"BatNiveauMoins"),INVENTORY_SLOT_RIGHTRING);
WriteTimestampedLogEntry("Equipement outil 2");
ActionEquipItem(GetItemPossessedBy(oPC,"Maniementdetoute"),INVENTORY_SLOT_LEFTRING);
WriteTimestampedLogEntry("Equipement outil 3");
ActionEquipItem(GetItemPossessedBy(oPC,"Epertueusedepnj"),INVENTORY_SLOT_RIGHTHAND);
WriteTimestampedLogEntry("Equipement outil 4");
}