NWScript :
//:///
//:: Update Lylver 2005-09-17
//:: added restarter
//:: + Cache Database
//:///
//:: Update Lylver 2005-09-01
//:: added Items RP from SoW
//:///
// activate_items - Script reecrit par astre - 18/5/03
// Modified by Bilaes March 2005
// FastFrench 13/1/03
// renvoie TRUE si pas un DM (et detruit l'objet), FALSE c'est un DM qui utilise l'objet
int DestroyIfNotDM(object oItem, object oActivator)
{
if (GetIsDM(oActivator)) return FALSE;
// Check to make sure that the Activator is a NPC played by a DM
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
while (GetIsObjectValid(oTest))
{
if (GetPCPlayerName(oTest) == sTestName)
{
DestroyObject(oItem);
SendMessageToPC(oActivator, "Cet objet appartient aux Dieux et n'est pas fait pour les mains d'un simple mortel !");
return TRUE;
}
oTest=GetNextPC();
}
return FALSE;
}
#include "x2_inc_switches"
#include "nw_o0_itemmaker"
#include "getobjectlevel"
#include "nw_i0_spells"
int DestroyLeveledObjectAndPay(object oItem, object oActivator, object oTarget
, int iLvl )
{
location lLoc;
if (GetIsDM(oActivator))
{
lLoc=GetLocation(oActivator);
if (!GetIsPC(oTarget)) // dont destroy PC !!
{
int iVal= GetGoldPieceValue(oTarget);
int iLevel=GetObjectLevel(iVal);
SendMessageToPC(oActivator, "Essai de destuction objet "+IntToString(iVal)
+" level "+IntToString(iLevel));
if (iLevel >= iLvl)
{
object oPossessor =GetItemPossessor(oTarget);
if (GetIsObjectValid(oPossessor))
{ // object in inventory so give 75% gold to ownner
GiveGoldToCreature(oPossessor,(iVal*75)/100);
}
DestroyObject(oTarget);
SendMessageToPC(oActivator, "objet detruit valeur "+IntToString(iVal)
+" level "+IntToString(iLevel));
}
}
// trial to compensated for abnormal movement
// still not good...
AssignCommand(oActivator, JumpToLocation(lLoc));
return FALSE;
}
// Check to make sure that the Activator is a NPC played by a DM
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
while (GetIsObjectValid(oTest))
{
if (GetPCPlayerName(oTest) == sTestName)
{
DestroyObject(oItem);
SendMessageToPC(oActivator, "Les objets des dieux ne sont pas pour vous");
return TRUE;
}
oTest=GetNextPC();
}
return FALSE;
}
void main()
{
object oItem = GetItemActivated(); // get the item activated
string sItemTag = GetTag(oItem); // and its tag
string sItemName = GetName(oItem); // and its name
object oActivator = GetItemActivator(); // get the wand's activator
object oTarget = GetItemActivatedTarget(); // get the target
string sTargetTag = GetTag(GetItemActivatedTarget()); // and its tag
location lTargetLoc = GetItemActivatedTargetLocation(); // Get the Location
location lDM =GetLocation(oActivator);
ExecuteScript("dmfi_activate",OBJECT_SELF);
// pour activer les script de meme nom que le tag de l'objet
// evite de modifier ce script pour chaque nouvel objet
// voir x2_it_example et x2_mod_def_act pour exemple
// bilaes 24/4/05
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet==X2_EXECUTE_SCRIPT_END) return;
if(sItemTag=="Debugger")
{
SendMessageToPC(oActivator,"Tag "+ sTargetTag +" Nom "+ GetName(oTarget));
}
// destruct object with lvl > 5
if(sItemTag=="DMLeveledObjectDestructor")
if (!DestroyLeveledObjectAndPay(oItem, oActivator, oTarget, 5))
{
AssignCommand(oActivator,JumpToLocation(lDM));
return;
//SetLocalObject(oActivator, "dmwandtarget", oTarget); // Put target info into local vars on activator
//SetLocalLocation(oActivator, "dmwandloc", lTargetLoc);
//AssignCommand(oActivator, ActionStartConversation(oActivator, "dmwand", TRUE)); // Start the conversation with itself
}
if(sItemTag=="boispourfeudecamp")
{
CreateObject(OBJECT_TYPE_PLACEABLE,"feudecamp",lTargetLoc,TRUE);
return;
}
if(sItemTag=="tentedebivouacpliee")
{
CreateObject(OBJECT_TYPE_PLACEABLE,"tentedebivouac",lTargetLoc,TRUE);
return;
}
if(sItemTag=="Sacmort")
{
int iHP=GetCurrentHitPoints(oTarget);
if ( iHP<=0 && GetIsPC(oTarget)
&& GetLocalObject(oActivator, "DeadPC")==OBJECT_INVALID )
{
SendMessageToPC(oActivator,"Prendre mort");
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oTarget);
AssignCommand(oTarget,ClearAllActions());
AssignCommand(oTarget,JumpToLocation(GetLocation(GetObjectByTag("fonddusac"))));
SetLocalObject(oActivator,"DeadPC",oTarget);
SetLocalObject(oTarget,"DeadPC",oActivator);
}
else
{
object oDeadPC=GetLocalObject(oActivator,"DeadPC");
if (oDeadPC !=OBJECT_INVALID)
{
SendMessageToPC(oActivator,"Poser mort");
AssignCommand(oDeadPC,ClearAllActions());
AssignCommand(oDeadPC,JumpToLocation(lDM));
DeleteLocalObject(oActivator,"DeadPC" );
DeleteLocalObject(oDeadPC,"DeadPC" );
}
}
return;
}
//if(sItemTag=="gemmeantimagie") // gemme anti magie pour se nettoyer
/*{
int i =1;
while (i<=33)
{
int nSpel=GetSpellBreachProtection(i);
RemoveProtections(nSpel,oActivator,1);
i=i+1;
}
RemoveProtections(SPELL_BARKSKIN,oActivator,1);
RemoveProtections(SPELL_ETHEREALNESS,oActivator,1);
RemoveProtections(SPELL_SHADES_STONESKIN,oActivator,1);
RemoveProtections(SPELL_GREATER_STONESKIN,oActivator,1);
RemoveProtections(SPELL_CAMOFLAGE,oActivator,1);
RemoveProtections(SPELL_INVISIBILITY,oActivator,1);
RemoveProtections(SPELL_IMPROVED_INVISIBILITY,oActivator,1);
RemoveProtections(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oActivator,1);
RemoveProtections(SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE,oActivator,1);
RemoveSpecificEffect(EFFECT_TYPE_ETHEREAL,oActivator);
RemoveSpecificEffect(EFFECT_TYPE_SANCTUARY,oActivator);
}
*/
if(sItemTag=="levelwandNODROP") // pour filler le bon automatiquement
{
int olevel = GetHitDice (oTarget);
if (olevel < 5 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv5NODROP")) )
CreateItemOnObject("passniv5",oTarget,1);
if (GetIsDM(oActivator))
{
if (olevel < 10 && olevel >= 5 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv10",oTarget,1);
if (olevel < 15 && olevel >= 10 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv15",oTarget,1);
if (olevel == 15 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv16",oTarget,1);
if (olevel == 16 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv17",oTarget,1);
if (olevel == 17 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv18",oTarget,1);
if (olevel == 18 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv19",oTarget,1);
if (olevel == 19 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv20",oTarget,1);
}
}
if(sItemTag=="DMsHelper") // DM Helper
if (!DestroyIfNotDM(oItem, oActivator))
{
SetLocalObject(oActivator, "dmwandtarget", oTarget); // Put target info into local vars on activator
SetLocalLocation(oActivator, "dmwandloc", lTargetLoc);
AssignCommand(oActivator, ActionStartConversation(oActivator, "dmwand", TRUE)); // Start the conversation with itself
return;
}
if(sItemTag=="AutoFollow")
{
if(GetIsObjectValid(oTarget))
AssignCommand (oActivator,ActionForceFollowObject(oTarget,3.0));
return;
}
if(sItemTag=="WandOfFX")
if (!DestroyIfNotDM(oItem, oActivator))
{
SetLocalObject(oActivator, "FXWandTarget", oTarget); // Put target info into local vars on activator
SetLocalLocation(oActivator, "FXWandLoc", lTargetLoc);
AssignCommand(oActivator, ActionStartConversation(oActivator, "fxwand", TRUE)); // Start the conversation with itself
return;
}
if(sItemTag=="EmoteWand")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE));
return;
}
if(sItemTag=="SMGAmuletdepouvoir")
{
effect eDeath = EffectDeath(FALSE, FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oActivator);
DestroyObject(oItem);
return;
}
if(sItemTag=="setdemenottes")
{
if (GetIsPC (oTarget))
{
if ( GetItemPossessedBy(oTarget , "menoNODROP") == OBJECT_INVALID)
{
CreateItemOnObject("menonodrop", oTarget, 1);
SendMessageToPC(oActivator, "vous venez de verrouiller des menottes");
}
else
{
DestroyObject ( GetItemPossessedBy(oTarget, "menoNODROP"));
SendMessageToPC(oActivator, "vous venez de retirer des menottes");
}
}
return;
}
if(sItemTag=="DMRodofAffliction")
if (!DestroyIfNotDM(oItem, oActivator))
{
SetLocalObject(oActivator, "RoATarget", oTarget); // Store the Target Info on the Activator
SetLocalLocation(oActivator, "RoALoc", lTargetLoc); // Store location for possible Future Use
// Check to be sure the target is a PC, if so, Start the Conversation
if (GetIsPC(oTarget) == TRUE)
// Start the Conversation
AssignCommand(oActivator, ActionStartConversation(oActivator, "cv_roa", TRUE));
else
// Send a message to the DM that the target is not a PC
SendMessageToPC(oActivator, "Invalid Target");
return;
}
if(sItemTag=="OeufdeDmon")
{
location lWhere = GetLocation (oActivator);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),lWhere,1.0);
CreateObject(OBJECT_TYPE_CREATURE,"dmonticule",lWhere, TRUE);
return;
}
//botte de vitesse dont le tag doit etre : bottesdevitesX X etant le nombre de round ou la botte fonctionne
if (GetStringLeft(sItemTag,13) == "bottesdevites")
{
int iPow = StringToInt(GetSubString(sItemTag, 13, GetStringLength(sItemTag)-13));
int iPower = iPow * 2;
object objetpied = GetItemInSlot(INVENTORY_SLOT_BOOTS, oActivator) ;
if (objetpied == oItem)
{
SignalEvent(oActivator, EventSpellCastAt(oActivator, SPELL_HASTE, FALSE));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectHaste(), oActivator, RoundsToSeconds(iPower));
DelayCommand(12.0, ExecuteScript("test_botte", oActivator));
SetLocalInt(oActivator,"tempbotte",iPow);
}
else
{
SignalEvent(oActivator, EventSpellCastAt(oActivator, SPELL_SLOW, FALSE));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSlow(), oActivator, RoundsToSeconds(iPower/2));
}
}
//Items de transformation en machin-garous...
if (sItemTag == "chatNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_WERECAT),oActivator);
return;
}
if (sItemTag == "ratNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_WERERAT),oActivator);
return;
}
if (sItemTag == "loupNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_WEREWOLF),oActivator);
return;
}
if (sItemTag == "sucuNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_SUCCUBUS),oActivator);
return;
}
if (sItemTag == "pingNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_PENGUIN),oActivator);
return;
}
if (sItemTag == "baloNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_BALOR),oActivator);
return;
}
// Pierres de rappel
int bHasGoodStone = GetItemPossessedBy(oActivator, "pierre_sacree2") != OBJECT_INVALID;
int bHasEvilStone = GetItemPossessedBy(oActivator, "pierre_mal") != OBJECT_INVALID;
int bHasNeutralStone = GetItemPossessedBy(oActivator, "pierre_univ") != OBJECT_INVALID;
int bHasKarakStone = GetItemPossessedBy(oActivator, "pierrerappelkarak") != OBJECT_INVALID;
int bSource = GetItemPossessedBy(oActivator,"PIERRE_SOURCE") != OBJECT_INVALID;
int bhasMenotte = GetItemPossessedBy(oActivator, "menoNODROP") != OBJECT_INVALID;
//
int bUseGoodStone = sItemTag == "pierre_sacree2";
int bUseEvilStone = sItemTag == "pierre_mal";
int bUseNeutralStone = sItemTag == "pierre_univ";
int bUseKarakStone = sItemTag == "pierrerappelkarak";
int bUseSource = sItemTag == "PIERRE_SOURCE"; // Temple d'Ares Marseille "La Source"
if( bUseGoodStone || bUseEvilStone || bUseSource ||
bUseNeutralStone || bUseKarakStone ){ // Une pierre de rappel a ete utilisee
string tArea = GetTag(GetArea(oActivator));
int iArea = StringToInt(GetSubString(tArea, 5, GetStringLength(tArea)-5));
if( bHasGoodStone + bHasEvilStone + bHasNeutralStone +
bHasKarakStone + bhasMenotte + bSource == 1 ){ // Il n'en possede bien qu'une
if( (iArea>=140 && iArea<=179) || (iArea>=190 && iArea<=199) ){ // ceci n'est plus valide : a corriger
SendMessageToPC(oActivator,"Les puissantes protections magiques de cet endroit empechent votre pierre de fonctionner");
return;
} else {
location LastRecallUsed; // Set the location variable
LastRecallUsed = GetLocation(oActivator); // Get the location, fill up the variable
SetLocalLocation(oActivator,"LastRecallUsed",LastRecallUsed); // Set where the portal jump the player to
SetLocalInt(oActivator,"HasRecalled",1); // To make the recall poretal tells the player if he want to go back
ActionCastFakeSpellAtObject ( SPELL_DISMISSAL , oActivator);
int bFighting = 0;
int nHD = GetHitDice(oActivator);
if (GetIsInCombat(oActivator)) bFighting = 1;
//{SendMessageToPC(oActivator,"Vous n'arrivez pas a vous concentrer suffisamment pendant le combat pour utiliser cette pierre de rappel"); return;}
int nXP = GetXP(oActivator);
int nPenalty = 0;
int nGoldPenalty = nHD * nHD * nHD;
if (bFighting) nPenalty = nHD*nHD;
if (bFighting) nGoldPenalty *= 4;
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
if( GetGold(oActivator)<nGoldPenalty)
nGoldPenalty = GetGold(oActivator);
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oActivator, nNewXP);
TakeGoldFromCreature(nGoldPenalty, oActivator, TRUE);
string sDest ;
if (bUseGoodStone) sDest = "catdrale_tele" ; // Get the player to the temple
if (bUseEvilStone) sDest = "maison" ; // Get the player to the temple
if (bUseNeutralStone) sDest = "temple_venus" ; // Get the player to the temple
if (bUseKarakStone) sDest = "karak_rappel" ; // Get the player to Karak
if( bUseSource ) sDest = "RAPPEL_ARES" ; // Envoie Joueur au Temple de la Guerre
object oDest = GetObjectByTag(sDest) ;
if( GetIsObjectValid(oDest) ){
AssignCommand(oActivator,JumpToObject(oDest));
} else {
string sMessage = "Destination invalide pour la pierre de Rappel" ;
SendMessageToAllDMs(sMessage);
SendMessageToPC(oActivator,sMessage);
WriteTimestampedLogEntry(sMessage);
}
// if (bUseSource) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("RAPPEL_SOURCE")))); // Envoie Joueur au Sanctuaire de la Source
}
return;
}
}
// LES BOUCHOMONS
if (sItemTag == "Bouchoballe")
{
string sBouchomon= GetStringRight(sTargetTag,5);
if (sBouchomon == "_bmon")
{
if (GetMaster(oTarget) == oActivator || GetMaster(oTarget) == OBJECT_INVALID)
{
string sNewball = sTargetTag+"_ball";
ApplyEffectToObject (DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_GLOBE_USE),oTarget);
DestroyObject (oTarget);
DestroyObject(oItem);
CopyObject (oItem,lTargetLoc,oActivator,sNewball);
FloatingTextStringOnCreature ("vous avez attrape "+GetName(oTarget), oActivator);
}
}
return;
}
if (GetStringRight(sItemTag,5) == "_ball")
{
/*RemoveSummonedAssociate(oActivator,GetAssociate(ASSOCIATE_TYPE_HENCHMAN,oActivator)); //au cas ou...
ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), lTargetLoc);
object oBouchomon = CreateObject(OBJECT_TYPE_CREATURE, GetStringLeft(sItemTag,10), lTargetLoc, TRUE);
DestroyObject(oItem);
CreateItemOnObject("bouchoballe",oActivator,1);
AddHenchman(oActivator,oBouchomon);
FloatingTextStringOnCreature ("vous avez relache "+GetName(oBouchomon), oActivator);
*/
FloatingTextStringOnCreature ("periode de test, vous ne pouvez pas relacher de Bouchomon", oActivator);
return;
}
// WriteTimestampedLogEntry("[ACTIVATE] object inconnu utilise par "+GetName(oActivator)+": "+sItemName+" (tag:"+sItemTag+")");
// Begin Lylver 2005-09-01
if(sItemTag=="SOW_BUCHE")
{
ExecuteScript("sow_campfire",oActivator);
return;
}
if(sItemTag=="SOW_CHAUDRON")
{
ExecuteScript("sow_campfir2",oActivator);
return;
}
if(sItemTag=="SOW_BROCHE")
{
ExecuteScript("sow_campfir3",oActivator);
return;
}
if(sItemTag=="SOW_TENTE")
{
ExecuteScript("sow_campfir4",oActivator);
return;
}
if(sItemTag=="SOW_BALAIS")
{
ExecuteScript("sow_balais",oActivator);
return;
}
if(sItemTag=="SOW_FLUTEPAN")
{
ExecuteScript("_flute",oActivator);
return;
}
if(sItemTag=="SOW_GUITARE")
{
ExecuteScript("_luth",oActivator);
return;
}
if(sItemTag=="SOW_LUTH")
{
ExecuteScript("_luth",oActivator);
return;
}
if(sItemTag=="SOW_HARP")
{
ExecuteScript("_harp",oActivator);
return;
}
if(sItemTag=="SOW_TAMBOURIN")
{
ExecuteScript("_tamborine",oActivator);
return;
}
if(sItemTag=="SOW_MUS_ARCHET")
{
if( d2() == 1) ExecuteScript("mus_celte2",oActivator);
else ExecuteScript("mus_celte9",oActivator);
return;
}
if(sItemTag=="SOW_MUS_ARCHET1")
{
ExecuteScript("mus_celte2",oActivator);
return;
}
if(sItemTag=="SOW_MUS_ARCHET2")
{
ExecuteScript("mus_celte9",oActivator);
return;
}
if(sItemTag=="SOW_MUS_HARP")
{
ExecuteScript("mus_celte1",oActivator);
return;
}
if(sItemTag=="SOW_MUS_LUTH")
{
ExecuteScript("mus_celte7",oActivator);
return;
}
if(sItemTag=="SOW_POT_NOINVI")
{
ExecuteScript("sow_visible",oActivator);
return;
}
if(sItemTag=="SOW_SEAU")
{
ExecuteScript("sow_seau",oActivator);
return;
}
if(sItemTag=="SOW_TENTEB")
{
ExecuteScript("sow_campfir5",oActivator);
return;
}
// End Lylver 2005-09-01
// Begin Lylver 2005-09-17
if(sItemTag=="SOW_VRAI_GAROU")
{
ExecuteScript("sow_poly_garou",oActivator);
return;
}
if(sItemTag=="RESTARTTN")
{
location lTarget = GetLocation(oTarget);
effect eVis = EffectVisualEffect(VFX_FNF_TIME_STOP);
effect eTime = EffectTimeStop(); // Note : arrete l'horloge PC ca
SetLocalInt(GetModule(),"REBOOT",TRUE); // indicateur pour les process differes
SignalEvent(GetModule(), EventUserDefined(200)); // Update PC Database
DelayCommand(4.0 ,SignalEvent(GetModule(), EventUserDefined(600))) ; // Flush Database
SignalEvent(oActivator, EventSpellCastAt(oActivator, SPELL_TIME_STOP, FALSE));
DelayCommand(0.75, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTime, oActivator, 3.0));
object oPC=GetFirstPC() ;
while( GetIsObjectValid(oPC) ){
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC));
SendMessageToPC(oPC,"REBOOT A CHAUD DU MODULE");
oPC = GetNextPC() ;
}
SignalEvent(GetModule(), EventUserDefined(604)) ; // reboot apres DB flush
return;
}
// End Lylver 2005-09-17
// Begin Lylver 2005-09-18
if(sItemTag=="CHOCOLATINE")
{
ExecuteScript("tn_chocolatine",oActivator);
return;
}
if(sItemTag=="TN_Q_CH_VIF_007")
{
ExecuteScript("tn_epeearadrim",oActivator);
return;
}
// End Lylver 2005-09-18
// Begin Lylver 2005-10-03 , change => erreur sur l'item
if(sItemTag=="TN_DIV_ELVEN_HE")
{
ExecuteScript("tn_s0_elven_he",oActivator);
return;
}
// End Lylver 2005-10-03
// Begin Lylver 2005-10-30 , change => erreur sur l'item
if(sItemTag=="TN_CTRL_PRIAM")
{
ExecuteScript("tn_ctrl_priam",oActivator);
return;
}
// End Lylver 2005-10-30
// Begin Lylver 2005-12-23
if( (sItemTag=="TN_MAT_GUERISON") ){
ExecuteScript("tn_craft_medkit",oActivator);
return;
}
// End Lylver 2005-12-23
WriteTimestampedLogEntry(GetName(oActivator)+" utilise "+sItemTag+" "+GetResRef(oItem)) ;
}
Le code a colorer syntaxiquement est trop long (plus de 10240 caractères) et risque de ne pas s'afficher du tout. Vous pouvez le voir en version colorée ici.//:: Update Lylver 2005-09-17
//:: added restarter
//:: + Cache Database
//:///
//:: Update Lylver 2005-09-01
//:: added Items RP from SoW
//:///
// activate_items - Script reecrit par astre - 18/5/03
// Modified by Bilaes March 2005
// FastFrench 13/1/03
// renvoie TRUE si pas un DM (et detruit l'objet), FALSE c'est un DM qui utilise l'objet
int DestroyIfNotDM(object oItem, object oActivator)
{
if (GetIsDM(oActivator)) return FALSE;
// Check to make sure that the Activator is a NPC played by a DM
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
while (GetIsObjectValid(oTest))
{
if (GetPCPlayerName(oTest) == sTestName)
{
DestroyObject(oItem);
SendMessageToPC(oActivator, "Cet objet appartient aux Dieux et n'est pas fait pour les mains d'un simple mortel !");
return TRUE;
}
oTest=GetNextPC();
}
return FALSE;
}
#include "x2_inc_switches"
#include "nw_o0_itemmaker"
#include "getobjectlevel"
#include "nw_i0_spells"
int DestroyLeveledObjectAndPay(object oItem, object oActivator, object oTarget
, int iLvl )
{
location lLoc;
if (GetIsDM(oActivator))
{
lLoc=GetLocation(oActivator);
if (!GetIsPC(oTarget)) // dont destroy PC !!
{
int iVal= GetGoldPieceValue(oTarget);
int iLevel=GetObjectLevel(iVal);
SendMessageToPC(oActivator, "Essai de destuction objet "+IntToString(iVal)
+" level "+IntToString(iLevel));
if (iLevel >= iLvl)
{
object oPossessor =GetItemPossessor(oTarget);
if (GetIsObjectValid(oPossessor))
{ // object in inventory so give 75% gold to ownner
GiveGoldToCreature(oPossessor,(iVal*75)/100);
}
DestroyObject(oTarget);
SendMessageToPC(oActivator, "objet detruit valeur "+IntToString(iVal)
+" level "+IntToString(iLevel));
}
}
// trial to compensated for abnormal movement
// still not good...
AssignCommand(oActivator, JumpToLocation(lLoc));
return FALSE;
}
// Check to make sure that the Activator is a NPC played by a DM
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oActivator);
while (GetIsObjectValid(oTest))
{
if (GetPCPlayerName(oTest) == sTestName)
{
DestroyObject(oItem);
SendMessageToPC(oActivator, "Les objets des dieux ne sont pas pour vous");
return TRUE;
}
oTest=GetNextPC();
}
return FALSE;
}
void main()
{
object oItem = GetItemActivated(); // get the item activated
string sItemTag = GetTag(oItem); // and its tag
string sItemName = GetName(oItem); // and its name
object oActivator = GetItemActivator(); // get the wand's activator
object oTarget = GetItemActivatedTarget(); // get the target
string sTargetTag = GetTag(GetItemActivatedTarget()); // and its tag
location lTargetLoc = GetItemActivatedTargetLocation(); // Get the Location
location lDM =GetLocation(oActivator);
ExecuteScript("dmfi_activate",OBJECT_SELF);
// pour activer les script de meme nom que le tag de l'objet
// evite de modifier ce script pour chaque nouvel objet
// voir x2_it_example et x2_mod_def_act pour exemple
// bilaes 24/4/05
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet==X2_EXECUTE_SCRIPT_END) return;
if(sItemTag=="Debugger")
{
SendMessageToPC(oActivator,"Tag "+ sTargetTag +" Nom "+ GetName(oTarget));
}
// destruct object with lvl > 5
if(sItemTag=="DMLeveledObjectDestructor")
if (!DestroyLeveledObjectAndPay(oItem, oActivator, oTarget, 5))
{
AssignCommand(oActivator,JumpToLocation(lDM));
return;
//SetLocalObject(oActivator, "dmwandtarget", oTarget); // Put target info into local vars on activator
//SetLocalLocation(oActivator, "dmwandloc", lTargetLoc);
//AssignCommand(oActivator, ActionStartConversation(oActivator, "dmwand", TRUE)); // Start the conversation with itself
}
if(sItemTag=="boispourfeudecamp")
{
CreateObject(OBJECT_TYPE_PLACEABLE,"feudecamp",lTargetLoc,TRUE);
return;
}
if(sItemTag=="tentedebivouacpliee")
{
CreateObject(OBJECT_TYPE_PLACEABLE,"tentedebivouac",lTargetLoc,TRUE);
return;
}
if(sItemTag=="Sacmort")
{
int iHP=GetCurrentHitPoints(oTarget);
if ( iHP<=0 && GetIsPC(oTarget)
&& GetLocalObject(oActivator, "DeadPC")==OBJECT_INVALID )
{
SendMessageToPC(oActivator,"Prendre mort");
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oTarget);
AssignCommand(oTarget,ClearAllActions());
AssignCommand(oTarget,JumpToLocation(GetLocation(GetObjectByTag("fonddusac"))));
SetLocalObject(oActivator,"DeadPC",oTarget);
SetLocalObject(oTarget,"DeadPC",oActivator);
}
else
{
object oDeadPC=GetLocalObject(oActivator,"DeadPC");
if (oDeadPC !=OBJECT_INVALID)
{
SendMessageToPC(oActivator,"Poser mort");
AssignCommand(oDeadPC,ClearAllActions());
AssignCommand(oDeadPC,JumpToLocation(lDM));
DeleteLocalObject(oActivator,"DeadPC" );
DeleteLocalObject(oDeadPC,"DeadPC" );
}
}
return;
}
//if(sItemTag=="gemmeantimagie") // gemme anti magie pour se nettoyer
/*{
int i =1;
while (i<=33)
{
int nSpel=GetSpellBreachProtection(i);
RemoveProtections(nSpel,oActivator,1);
i=i+1;
}
RemoveProtections(SPELL_BARKSKIN,oActivator,1);
RemoveProtections(SPELL_ETHEREALNESS,oActivator,1);
RemoveProtections(SPELL_SHADES_STONESKIN,oActivator,1);
RemoveProtections(SPELL_GREATER_STONESKIN,oActivator,1);
RemoveProtections(SPELL_CAMOFLAGE,oActivator,1);
RemoveProtections(SPELL_INVISIBILITY,oActivator,1);
RemoveProtections(SPELL_IMPROVED_INVISIBILITY,oActivator,1);
RemoveProtections(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oActivator,1);
RemoveProtections(SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE,oActivator,1);
RemoveSpecificEffect(EFFECT_TYPE_ETHEREAL,oActivator);
RemoveSpecificEffect(EFFECT_TYPE_SANCTUARY,oActivator);
}
*/
if(sItemTag=="levelwandNODROP") // pour filler le bon automatiquement
{
int olevel = GetHitDice (oTarget);
if (olevel < 5 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv5NODROP")) )
CreateItemOnObject("passniv5",oTarget,1);
if (GetIsDM(oActivator))
{
if (olevel < 10 && olevel >= 5 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv10",oTarget,1);
if (olevel < 15 && olevel >= 10 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv15",oTarget,1);
if (olevel == 15 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv16",oTarget,1);
if (olevel == 16 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv17",oTarget,1);
if (olevel == 17 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv18",oTarget,1);
if (olevel == 18 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv19",oTarget,1);
if (olevel == 19 )
if (!GetIsObjectValid(GetItemPossessedBy(oTarget, "passniv10NODROP")) )
CreateItemOnObject("passniv20",oTarget,1);
}
}
if(sItemTag=="DMsHelper") // DM Helper
if (!DestroyIfNotDM(oItem, oActivator))
{
SetLocalObject(oActivator, "dmwandtarget", oTarget); // Put target info into local vars on activator
SetLocalLocation(oActivator, "dmwandloc", lTargetLoc);
AssignCommand(oActivator, ActionStartConversation(oActivator, "dmwand", TRUE)); // Start the conversation with itself
return;
}
if(sItemTag=="AutoFollow")
{
if(GetIsObjectValid(oTarget))
AssignCommand (oActivator,ActionForceFollowObject(oTarget,3.0));
return;
}
if(sItemTag=="WandOfFX")
if (!DestroyIfNotDM(oItem, oActivator))
{
SetLocalObject(oActivator, "FXWandTarget", oTarget); // Put target info into local vars on activator
SetLocalLocation(oActivator, "FXWandLoc", lTargetLoc);
AssignCommand(oActivator, ActionStartConversation(oActivator, "fxwand", TRUE)); // Start the conversation with itself
return;
}
if(sItemTag=="EmoteWand")
{
AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE));
return;
}
if(sItemTag=="SMGAmuletdepouvoir")
{
effect eDeath = EffectDeath(FALSE, FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oActivator);
DestroyObject(oItem);
return;
}
if(sItemTag=="setdemenottes")
{
if (GetIsPC (oTarget))
{
if ( GetItemPossessedBy(oTarget , "menoNODROP") == OBJECT_INVALID)
{
CreateItemOnObject("menonodrop", oTarget, 1);
SendMessageToPC(oActivator, "vous venez de verrouiller des menottes");
}
else
{
DestroyObject ( GetItemPossessedBy(oTarget, "menoNODROP"));
SendMessageToPC(oActivator, "vous venez de retirer des menottes");
}
}
return;
}
if(sItemTag=="DMRodofAffliction")
if (!DestroyIfNotDM(oItem, oActivator))
{
SetLocalObject(oActivator, "RoATarget", oTarget); // Store the Target Info on the Activator
SetLocalLocation(oActivator, "RoALoc", lTargetLoc); // Store location for possible Future Use
// Check to be sure the target is a PC, if so, Start the Conversation
if (GetIsPC(oTarget) == TRUE)
// Start the Conversation
AssignCommand(oActivator, ActionStartConversation(oActivator, "cv_roa", TRUE));
else
// Send a message to the DM that the target is not a PC
SendMessageToPC(oActivator, "Invalid Target");
return;
}
if(sItemTag=="OeufdeDmon")
{
location lWhere = GetLocation (oActivator);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),lWhere,1.0);
CreateObject(OBJECT_TYPE_CREATURE,"dmonticule",lWhere, TRUE);
return;
}
//botte de vitesse dont le tag doit etre : bottesdevitesX X etant le nombre de round ou la botte fonctionne
if (GetStringLeft(sItemTag,13) == "bottesdevites")
{
int iPow = StringToInt(GetSubString(sItemTag, 13, GetStringLength(sItemTag)-13));
int iPower = iPow * 2;
object objetpied = GetItemInSlot(INVENTORY_SLOT_BOOTS, oActivator) ;
if (objetpied == oItem)
{
SignalEvent(oActivator, EventSpellCastAt(oActivator, SPELL_HASTE, FALSE));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectHaste(), oActivator, RoundsToSeconds(iPower));
DelayCommand(12.0, ExecuteScript("test_botte", oActivator));
SetLocalInt(oActivator,"tempbotte",iPow);
}
else
{
SignalEvent(oActivator, EventSpellCastAt(oActivator, SPELL_SLOW, FALSE));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSlow(), oActivator, RoundsToSeconds(iPower/2));
}
}
//Items de transformation en machin-garous...
if (sItemTag == "chatNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_WERECAT),oActivator);
return;
}
if (sItemTag == "ratNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_WERERAT),oActivator);
return;
}
if (sItemTag == "loupNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_WEREWOLF),oActivator);
return;
}
if (sItemTag == "sucuNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_SUCCUBUS),oActivator);
return;
}
if (sItemTag == "pingNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_PENGUIN),oActivator);
return;
}
if (sItemTag == "baloNODROP")
{ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH),oActivator);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectPolymorph(POLYMORPH_TYPE_BALOR),oActivator);
return;
}
// Pierres de rappel
int bHasGoodStone = GetItemPossessedBy(oActivator, "pierre_sacree2") != OBJECT_INVALID;
int bHasEvilStone = GetItemPossessedBy(oActivator, "pierre_mal") != OBJECT_INVALID;
int bHasNeutralStone = GetItemPossessedBy(oActivator, "pierre_univ") != OBJECT_INVALID;
int bHasKarakStone = GetItemPossessedBy(oActivator, "pierrerappelkarak") != OBJECT_INVALID;
int bSource = GetItemPossessedBy(oActivator,"PIERRE_SOURCE") != OBJECT_INVALID;
int bhasMenotte = GetItemPossessedBy(oActivator, "menoNODROP") != OBJECT_INVALID;
//
int bUseGoodStone = sItemTag == "pierre_sacree2";
int bUseEvilStone = sItemTag == "pierre_mal";
int bUseNeutralStone = sItemTag == "pierre_univ";
int bUseKarakStone = sItemTag == "pierrerappelkarak";
int bUseSource = sItemTag == "PIERRE_SOURCE"; // Temple d'Ares Marseille "La Source"
if( bUseGoodStone || bUseEvilStone || bUseSource ||
bUseNeutralStone || bUseKarakStone ){ // Une pierre de rappel a ete utilisee
string tArea = GetTag(GetArea(oActivator));
int iArea = StringToInt(GetSubString(tArea, 5, GetStringLength(tArea)-5));
if( bHasGoodStone + bHasEvilStone + bHasNeutralStone +
bHasKarakStone + bhasMenotte + bSource == 1 ){ // Il n'en possede bien qu'une
if( (iArea>=140 && iArea<=179) || (iArea>=190 && iArea<=199) ){ // ceci n'est plus valide : a corriger
SendMessageToPC(oActivator,"Les puissantes protections magiques de cet endroit empechent votre pierre de fonctionner");
return;
} else {
location LastRecallUsed; // Set the location variable
LastRecallUsed = GetLocation(oActivator); // Get the location, fill up the variable
SetLocalLocation(oActivator,"LastRecallUsed",LastRecallUsed); // Set where the portal jump the player to
SetLocalInt(oActivator,"HasRecalled",1); // To make the recall poretal tells the player if he want to go back
ActionCastFakeSpellAtObject ( SPELL_DISMISSAL , oActivator);
int bFighting = 0;
int nHD = GetHitDice(oActivator);
if (GetIsInCombat(oActivator)) bFighting = 1;
//{SendMessageToPC(oActivator,"Vous n'arrivez pas a vous concentrer suffisamment pendant le combat pour utiliser cette pierre de rappel"); return;}
int nXP = GetXP(oActivator);
int nPenalty = 0;
int nGoldPenalty = nHD * nHD * nHD;
if (bFighting) nPenalty = nHD*nHD;
if (bFighting) nGoldPenalty *= 4;
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
if( GetGold(oActivator)<nGoldPenalty)
nGoldPenalty = GetGold(oActivator);
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oActivator, nNewXP);
TakeGoldFromCreature(nGoldPenalty, oActivator, TRUE);
string sDest ;
if (bUseGoodStone) sDest = "catdrale_tele" ; // Get the player to the temple
if (bUseEvilStone) sDest = "maison" ; // Get the player to the temple
if (bUseNeutralStone) sDest = "temple_venus" ; // Get the player to the temple
if (bUseKarakStone) sDest = "karak_rappel" ; // Get the player to Karak
if( bUseSource ) sDest = "RAPPEL_ARES" ; // Envoie Joueur au Temple de la Guerre
object oDest = GetObjectByTag(sDest) ;
if( GetIsObjectValid(oDest) ){
AssignCommand(oActivator,JumpToObject(oDest));
} else {
string sMessage = "Destination invalide pour la pierre de Rappel" ;
SendMessageToAllDMs(sMessage);
SendMessageToPC(oActivator,sMessage);
WriteTimestampedLogEntry(sMessage);
}
// if (bUseSource) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("RAPPEL_SOURCE")))); // Envoie Joueur au Sanctuaire de la Source
}
return;
}
}
// LES BOUCHOMONS
if (sItemTag == "Bouchoballe")
{
string sBouchomon= GetStringRight(sTargetTag,5);
if (sBouchomon == "_bmon")
{
if (GetMaster(oTarget) == oActivator || GetMaster(oTarget) == OBJECT_INVALID)
{
string sNewball = sTargetTag+"_ball";
ApplyEffectToObject (DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_GLOBE_USE),oTarget);
DestroyObject (oTarget);
DestroyObject(oItem);
CopyObject (oItem,lTargetLoc,oActivator,sNewball);
FloatingTextStringOnCreature ("vous avez attrape "+GetName(oTarget), oActivator);
}
}
return;
}
if (GetStringRight(sItemTag,5) == "_ball")
{
/*RemoveSummonedAssociate(oActivator,GetAssociate(ASSOCIATE_TYPE_HENCHMAN,oActivator)); //au cas ou...
ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), lTargetLoc);
object oBouchomon = CreateObject(OBJECT_TYPE_CREATURE, GetStringLeft(sItemTag,10), lTargetLoc, TRUE);
DestroyObject(oItem);
CreateItemOnObject("bouchoballe",oActivator,1);
AddHenchman(oActivator,oBouchomon);
FloatingTextStringOnCreature ("vous avez relache "+GetName(oBouchomon), oActivator);
*/
FloatingTextStringOnCreature ("periode de test, vous ne pouvez pas relacher de Bouchomon", oActivator);
return;
}
// WriteTimestampedLogEntry("[ACTIVATE] object inconnu utilise par "+GetName(oActivator)+": "+sItemName+" (tag:"+sItemTag+")");
// Begin Lylver 2005-09-01
if(sItemTag=="SOW_BUCHE")
{
ExecuteScript("sow_campfire",oActivator);
return;
}
if(sItemTag=="SOW_CHAUDRON")
{
ExecuteScript("sow_campfir2",oActivator);
return;
}
if(sItemTag=="SOW_BROCHE")
{
ExecuteScript("sow_campfir3",oActivator);
return;
}
if(sItemTag=="SOW_TENTE")
{
ExecuteScript("sow_campfir4",oActivator);
return;
}
if(sItemTag=="SOW_BALAIS")
{
ExecuteScript("sow_balais",oActivator);
return;
}
if(sItemTag=="SOW_FLUTEPAN")
{
ExecuteScript("_flute",oActivator);
return;
}
if(sItemTag=="SOW_GUITARE")
{
ExecuteScript("_luth",oActivator);
return;
}
if(sItemTag=="SOW_LUTH")
{
ExecuteScript("_luth",oActivator);
return;
}
if(sItemTag=="SOW_HARP")
{
ExecuteScript("_harp",oActivator);
return;
}
if(sItemTag=="SOW_TAMBOURIN")
{
ExecuteScript("_tamborine",oActivator);
return;
}
if(sItemTag=="SOW_MUS_ARCHET")
{
if( d2() == 1) ExecuteScript("mus_celte2",oActivator);
else ExecuteScript("mus_celte9",oActivator);
return;
}
if(sItemTag=="SOW_MUS_ARCHET1")
{
ExecuteScript("mus_celte2",oActivator);
return;
}
if(sItemTag=="SOW_MUS_ARCHET2")
{
ExecuteScript("mus_celte9",oActivator);
return;
}
if(sItemTag=="SOW_MUS_HARP")
{
ExecuteScript("mus_celte1",oActivator);
return;
}
if(sItemTag=="SOW_MUS_LUTH")
{
ExecuteScript("mus_celte7",oActivator);
return;
}
if(sItemTag=="SOW_POT_NOINVI")
{
ExecuteScript("sow_visible",oActivator);
return;
}
if(sItemTag=="SOW_SEAU")
{
ExecuteScript("sow_seau",oActivator);
return;
}
if(sItemTag=="SOW_TENTEB")
{
ExecuteScript("sow_campfir5",oActivator);
return;
}
// End Lylver 2005-09-01
// Begin Lylver 2005-09-17
if(sItemTag=="SOW_VRAI_GAROU")
{
ExecuteScript("sow_poly_garou",oActivator);
return;
}
if(sItemTag=="RESTARTTN")
{
location lTarget = GetLocation(oTarget);
effect eVis = EffectVisualEffect(VFX_FNF_TIME_STOP);
effect eTime = EffectTimeStop(); // Note : arrete l'horloge PC ca
SetLocalInt(GetModule(),"REBOOT",TRUE); // indicateur pour les process differes
SignalEvent(GetModule(), EventUserDefined(200)); // Update PC Database
DelayCommand(4.0 ,SignalEvent(GetModule(), EventUserDefined(600))) ; // Flush Database
SignalEvent(oActivator, EventSpellCastAt(oActivator, SPELL_TIME_STOP, FALSE));
DelayCommand(0.75, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTime, oActivator, 3.0));
object oPC=GetFirstPC() ;
while( GetIsObjectValid(oPC) ){
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC));
SendMessageToPC(oPC,"REBOOT A CHAUD DU MODULE");
oPC = GetNextPC() ;
}
SignalEvent(GetModule(), EventUserDefined(604)) ; // reboot apres DB flush
return;
}
// End Lylver 2005-09-17
// Begin Lylver 2005-09-18
if(sItemTag=="CHOCOLATINE")
{
ExecuteScript("tn_chocolatine",oActivator);
return;
}
if(sItemTag=="TN_Q_CH_VIF_007")
{
ExecuteScript("tn_epeearadrim",oActivator);
return;
}
// End Lylver 2005-09-18
// Begin Lylver 2005-10-03 , change => erreur sur l'item
if(sItemTag=="TN_DIV_ELVEN_HE")
{
ExecuteScript("tn_s0_elven_he",oActivator);
return;
}
// End Lylver 2005-10-03
// Begin Lylver 2005-10-30 , change => erreur sur l'item
if(sItemTag=="TN_CTRL_PRIAM")
{
ExecuteScript("tn_ctrl_priam",oActivator);
return;
}
// End Lylver 2005-10-30
// Begin Lylver 2005-12-23
if( (sItemTag=="TN_MAT_GUERISON") ){
ExecuteScript("tn_craft_medkit",oActivator);
return;
}
// End Lylver 2005-12-23
WriteTimestampedLogEntry(GetName(oActivator)+" utilise "+sItemTag+" "+GetResRef(oItem)) ;
}