|
Moi au depart dans Onactivateitm j'ai ceci
// activate_items - Script reecrit par astre - 18/5/03
// 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;
}
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
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(GetTag(oItem)=="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(GetTag(oItem)=="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 bhasMenotte = GetItemPossessedBy(oActivator, "menoNODROP") != OBJECT_INVALID;
int bUseGoodStone = sItemTag == "pierre_sacree2";
int bUseEvilStone = sItemTag == "pierre_mal";
int bUseNeutralStone = sItemTag == "pierre_univ";
if (bUseGoodStone || bUseEvilStone || bUseNeutralStone) // 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 + bhasMenotte == 1) // Il n'en possede bien qu'une
if ((iArea>=140 && iArea<=179) || (iArea>=190 && iArea<=199))
{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);
if (bUseGoodStone) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("catdrale_tele")))); // Get the player to the temple
if (bUseEvilStone) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("maison")))); // Get the player to the temple
if (bUseNeutralStone) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("temple_venus")))); // Get the player to the temple
}
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+")");
}
Apres les modif j'obtiens ceci
// activate_items - Script reecrit par astre - 18/5/03
// 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;
}
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
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(GetTag(oItem)=="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(GetTag(oItem)=="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 bhasMenotte = GetItemPossessedBy(oActivator, "menoNODROP") != OBJECT_INVALID;
int bUseGoodStone = sItemTag == "pierre_sacree2";
int bUseEvilStone = sItemTag == "pierre_mal";
int bUseNeutralStone = sItemTag == "pierre_univ";
if (bUseGoodStone || bUseEvilStone || bUseNeutralStone) // 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 + bhasMenotte == 1) // Il n'en possede bien qu'une
if ((iArea>=140 && iArea<=179) || (iArea>=190 && iArea<=199))
{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);
if (bUseGoodStone) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("catdrale_tele")))); // Get the player to the temple
if (bUseEvilStone) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("maison")))); // Get the player to the temple
if (bUseNeutralStone) AssignCommand(oActivator,JumpToLocation(GetLocation(GetObjectByTag("temple_venus")))); // Get the player to the temple
}
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+")");
}
void main()
{
object oPC = GetItemActivator();
object oItem = GetItemActivated()
string sTag = GetTag(oItem);
if(sTag == "Batondureboot")
{
ExecuteScript("batondureboot", oPC);
}
}
et en au moment ou j'enregistre j'ai ceci
16/08/2005 19:51:54 : Erreur. 'activate_items' n’est pas compilé.
activate_items.nss: ERREUR : DUPLICATE FUNCTION IMPLEMENTATION (main)
|