Rajouter un bout dans un script.

Répondre
Partager Rechercher
Voila, je voudrai rajouter cela :


Code PHP:

// Parchemin de téléportation


       
void main()
{
   
object oItem=GetItemActivated();
   
object oActivator=GetItemActivator();
     
object oCible GetItemActivator();
effect eVisual EffectVisualEffect(VFX_FNF_FIRESTORM);
 
effect eVisual1 EffectVisualEffectVFX_FNF_IMPLOSION );
  
effect eVisual2 EffectVisualEffectVFX_FNF_SUMMON_CELESTIAL  );



if(
GetTag(oItem) == "LeTlporteur")
 {



   
DelayCommand (2.9,
                         
AssignCommand(GetItemActivator(),
   
JumpToLocation(GetLocation(GetObjectByTag("WP_PORTAILVILLE")))));
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual1oCible);
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual2oCible);
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoCible);
 }

au script DMFI que l'on met dans OnAcitivateItem

Code PHP:

void dmw_CleanUp(object oMySpeaker)
{
   
int nCount;
   
int nCache;
   
DeleteLocalObject(oMySpeaker"dmfi_univ_target");
   
DeleteLocalLocation(oMySpeaker"dmfi_univ_location");
   
DeleteLocalObject(oMySpeaker"dmw_item");
   
DeleteLocalString(oMySpeaker"dmw_repamt");
   
DeleteLocalString(oMySpeaker"dmw_repargs");
   
nCache GetLocalInt(oMySpeaker"dmw_playercache");
   for(
nCount 1nCount <= nCachenCount++)
   {
      
DeleteLocalObject(oMySpeaker"dmw_playercache" IntToString(nCount));
   }
   
DeleteLocalInt(oMySpeaker"dmw_playercache");
   
nCache GetLocalInt(oMySpeaker"dmw_itemcache");
   for(
nCount 1nCount <= nCachenCount++)
   {
      
DeleteLocalObject(oMySpeaker"dmw_itemcache" IntToString(nCount));
   }
   
DeleteLocalInt(oMySpeaker"dmw_itemcache");
   for(
nCount 1nCount <= 10nCount++)
   {
      
DeleteLocalString(oMySpeaker"dmw_dialog" IntToString(nCount));
      
DeleteLocalString(oMySpeaker"dmw_function" IntToString(nCount));
      
DeleteLocalString(oMySpeaker"dmw_params" IntToString(nCount));
   }
   
DeleteLocalString(oMySpeaker"dmw_playerfunc");
   
DeleteLocalInt(oMySpeaker"dmw_started");
}


void main()
{
    
object oItem=GetItemActivated();
    
object oUser=GetItemActivator();
    
object oOther=GetItemActivatedTarget();
    
location lLocation=GetItemActivatedTargetLocation();
    
string sItemTag=GetTag(oItem);

    
dmw_CleanUp(oUser);
    if (
GetStringLeft(sItemTag,8) == "hlslang_")
    {
            
//Destroy any existing Voice attached to the user
            
if (GetIsObjectValid(GetLocalObject(oUser"dmfi_MyVoice")))
            {
                
DestroyObject(GetLocalObject(oUser"dmfi_MyVoice"));
                
FloatingTextStringOnCreature("You have destroyed your previous Voice"oUserFALSE);
            }

            
//Set the Voice to interpret language of the appropriate widget
            
string ssLanguage GetStringRight(sItemTag2);
            if (
GetStringLeft(ssLanguage1) == "_")
                
ssLanguage GetStringRight(sItemTag1);
            
SetLocalInt(oUser"hls_MyLanguage"StringToInt(ssLanguage));
            
SetLocalString(oUser"hls_MyLanguageName"GetName(oItem));
            
DelayCommand(1.0fFloatingTextStringOnCreature("You are speaking " GetName(oItem) + ". Type /dm [(what you want to say in brackets)]"oUserFALSE));
            
object oArea GetFirstObjectInArea(GetArea(oUser));
            while (
GetIsObjectValid(oArea))
            {
                if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE &&
                    
GetLocalInt(oArea"hls_Listening") &&
                    
GetDistanceBetween(oUseroArea) < 20.0f &&
                    
oArea != GetLocalObject(oUser"dmfi_MyVoice"))
                    {
                        
DeleteLocalObject(oUser"dmfi_MyVoice");
                        return;
                    }
                
oArea GetNextObjectInArea(GetArea(oUser));
            }
        
//Create the Voice
        
object oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"GetLocation(oUser));
        
//Set the Voice to Autofollow the User
        
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
        
//Set Ownership of the Voice to the User
        
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
        return;
    }

    if (
GetStringLeft(sItemTag8) == "dmfi_pc_")
    {
        if (
sItemTag == "dmfi_pc_follow")
        {
            if (
GetIsObjectValid(oOther))
            {
                
FloatingTextStringOnCreature("Now following "GetName(oOther),oUserFALSE);
                
DelayCommand(2.0fAssignCommand(oUserActionForceFollowObject(oOther2.0f)));
            }
            return;
        }
        
SetLocalObject(oUser"dmfi_univ_target"oUser);
        
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
        
SetLocalString(oUser"dmfi_univ_conv"GetStringRight(sItemTagGetStringLength(sItemTag) - 5));
        
AssignCommand(oUserClearAllActions());
        
AssignCommand(oUserActionStartConversation(OBJECT_SELF"dmfi_universal"TRUE));
        return;
    }

    if (
GetStringLeft(sItemTag5) == "dmfi_")
    {
        if (!
GetIsDM(oUser) &&
            !
GetLocalInt(GetModule(), "dmfi_Admin" GetPCPublicCDKey(oUser)) &&
            !
GetLocalInt(oUser"hls_Listening") &&
            
GetIsPC(oUser) &&
            
GetLocalInt(GetModule(), "dmfi_DMToolLock"))
        {
            
FloatingTextStringOnCreature("You cannot use this item." ,oUserFALSE);
            
SendMessageToAllDMs(GetName(oUser)+ " is attempting to use a DM item.");
            return;
        }
        if (
sItemTag == "dmfi_exploder")
        {
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_afflict"))) CreateItemOnObject("dmfi_afflict"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_dicebag"))) CreateItemOnObject("dmfi_dicebag"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_dicebag"))) CreateItemOnObject("dmfi_pc_dicebag"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_follow"))) CreateItemOnObject("dmfi_pc_follow"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_emote"))) CreateItemOnObject("dmfi_pc_emote"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_dmw"))) CreateItemOnObject("dmfi_dmw"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_emote"))) CreateItemOnObject("dmfi_emote"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_encounter"))) CreateItemOnObject("dmfi_encounter"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_faction"))) CreateItemOnObject("dmfi_faction"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_fx"))) CreateItemOnObject("dmfi_fx"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_music"))) CreateItemOnObject("dmfi_music"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_sound"))) CreateItemOnObject("dmfi_sound"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_voice"))) CreateItemOnObject("dmfi_voice"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_xp"))) CreateItemOnObject("dmfi_xp"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_500xp"))) CreateItemOnObject("dmfi_500xp"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_en_ditto"))) CreateItemOnObject("dmfi_en_ditto"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_mute"))) CreateItemOnObject("dmfi_mute"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_peace"))) CreateItemOnObject("dmfi_peace"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_voicewidget"))) CreateItemOnObject("dmfi_voicewidget"oUser);
            return;
        }
        if (
sItemTag == "dmfi_peace")
        {   
//This widget sets all creatures in the area to a neutral stance and clears combat.
            
object oArea GetFirstObjectInArea(GetArea(oUser));
            
object oP;
            while (
GetIsObjectValid(oArea))
            {
                if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE && !GetIsPC(oArea))
                {
                    
AssignCommand(oAreaClearAllActions(TRUE));
                    
oP GetFirstPC();
                    while (
GetIsObjectValid(oP))
                    {
                        if (
GetArea(oP) == GetArea(oUser))
                        {
                            
ClearPersonalReputation(oAreaoP);
                            
SetStandardFactionReputation(STANDARD_FACTION_HOSTILE25oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_COMMONER91oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT91oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER91oP);
                        }
                        
oP GetNextPC();
                    }
                    
AssignCommand(oAreaClearAllActions(TRUE));
                }
                
oArea GetNextObjectInArea(GetArea(oUser));
            }
        }
        if (
sItemTag == "dmfi_voicewidget")
        {
            
object oVoice;
            
//Destroy any existing Voice attached to the user
            
if (GetIsObjectValid(GetLocalObject(oUser"dmfi_MyVoice")))
            {
                
DestroyObject(GetLocalObject(oUser"dmfi_MyVoice"));
                
FloatingTextStringOnCreature("You have destroyed your previous Voice"oUserFALSE);
            }
            if (
GetIsObjectValid(oOther))
            {
                
SetLocalObject(oUser"dmfi_VoiceTarget"oOther);
                
FloatingTextStringOnCreature("You have targeted " GetName(oOther) + " with the Voice Widget"oUserFALSE);
                
object oArea GetFirstObjectInArea(GetArea(oUser));
                while (
GetIsObjectValid(oArea))
                {
                    if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE &&
                    
GetLocalInt(oArea"hls_Listening") &&
                    
GetDistanceBetween(oUseroArea) < 20.0f &&
                    
oArea != GetLocalObject(oUser"dmfi_MyVoice"))
                    {
                        
DeleteLocalObject(oUser"dmfi_MyVoice");
                        return;
                    }
                
oArea GetNextObjectInArea(GetArea(oUser));
                }
                
//Create the Voice
                
object oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"GetLocation(oUser));
                
//Set Ownership of the Voice to the User
                
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
                
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
                return;
            }
            else
            {
                
//Create the Voice
                
oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"lLocation);
                
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
                
SetLocalObject(oUser"dmfi_VoiceTarget"oVoice);
                
//Set Ownership of the Voice to the User
                
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
                
DelayCommand(1.0fFloatingTextStringOnCreature("The Voice is operational"oUserFALSE));
                return;
            }
            return;
        }
        if (
sItemTag == "dmfi_mute")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oUser);
            
SetLocalString(oUser"dmfi_univ_conv""voice");
            
SetLocalInt(oUser"dmfi_univ_int"8);
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        if (
sItemTag == "dmfi_en_ditto")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oOther);
            
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
            
SetLocalString(oUser"dmfi_univ_conv""encounter");
            
SetLocalInt(oUser"dmfi_univ_int"GetLocalInt(oUser"EncounterType"));
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        if (
sItemTag == "dmfi_500xp")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oOther);
            
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
            
SetLocalString(oUser"dmfi_univ_conv""xp");
            
SetLocalInt(oUser"dmfi_univ_int"53);
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        
SetLocalObject(oUser"dmfi_univ_target"oOther);
        
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
        
SetLocalString(oUser"dmfi_univ_conv"GetStringRight(sItemTagGetStringLength(sItemTag) - 5));
        
AssignCommand(oUserClearAllActions());
        
AssignCommand(oUserActionStartConversation(OBJECT_SELF"dmfi_universal"TRUE));
    }

Que dois je faire quand je le met au bout il m'indique une erreur, alors que les deux script a part fonctionnent parfaitement.
Normal tu as 2 main, et il aime pas ca. Il suffit simplement de rajouter le 1er script sans le void main, la premiere et la derniere accolade au 2e juste avant la derniere accollade et ca devrait marcher
Re: Rajouter un bout dans un script.
Code PHP:

void dmw_CleanUp(object oMySpeaker)
{
   
int nCount;
   
int nCache;
   
DeleteLocalObject(oMySpeaker"dmfi_univ_target");
   
DeleteLocalLocation(oMySpeaker"dmfi_univ_location");
   
DeleteLocalObject(oMySpeaker"dmw_item");
   
DeleteLocalString(oMySpeaker"dmw_repamt");
   
DeleteLocalString(oMySpeaker"dmw_repargs");
   
nCache GetLocalInt(oMySpeaker"dmw_playercache");
   for(
nCount 1nCount <= nCachenCount++)
   {
      
DeleteLocalObject(oMySpeaker"dmw_playercache" IntToString(nCount));
   }
   
DeleteLocalInt(oMySpeaker"dmw_playercache");
   
nCache GetLocalInt(oMySpeaker"dmw_itemcache");
   for(
nCount 1nCount <= nCachenCount++)
   {
      
DeleteLocalObject(oMySpeaker"dmw_itemcache" IntToString(nCount));
   }
   
DeleteLocalInt(oMySpeaker"dmw_itemcache");
   for(
nCount 1nCount <= 10nCount++)
   {
      
DeleteLocalString(oMySpeaker"dmw_dialog" IntToString(nCount));
      
DeleteLocalString(oMySpeaker"dmw_function" IntToString(nCount));
      
DeleteLocalString(oMySpeaker"dmw_params" IntToString(nCount));
   }
   
DeleteLocalString(oMySpeaker"dmw_playerfunc");
   
DeleteLocalInt(oMySpeaker"dmw_started");
}


void main()
{
    
object oItem=GetItemActivated();
    
object oUser=GetItemActivator();
    
object oOther=GetItemActivatedTarget();
    
location lLocation=GetItemActivatedTargetLocation();
    
string sItemTag=GetTag(oItem);

    
dmw_CleanUp(oUser);
    if (
GetStringLeft(sItemTag,8) == "hlslang_")
    {
            
//Destroy any existing Voice attached to the user
            
if (GetIsObjectValid(GetLocalObject(oUser"dmfi_MyVoice")))
            {
                
DestroyObject(GetLocalObject(oUser"dmfi_MyVoice"));
                
FloatingTextStringOnCreature("You have destroyed your previous Voice"oUserFALSE);
            }

            
//Set the Voice to interpret language of the appropriate widget
            
string ssLanguage GetStringRight(sItemTag2);
            if (
GetStringLeft(ssLanguage1) == "_")
                
ssLanguage GetStringRight(sItemTag1);
            
SetLocalInt(oUser"hls_MyLanguage"StringToInt(ssLanguage));
            
SetLocalString(oUser"hls_MyLanguageName"GetName(oItem));
            
DelayCommand(1.0fFloatingTextStringOnCreature("You are speaking " GetName(oItem) + ". Type /dm [(what you want to say in brackets)]"oUserFALSE));
            
object oArea GetFirstObjectInArea(GetArea(oUser));
            while (
GetIsObjectValid(oArea))
            {
                if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE &&
                    
GetLocalInt(oArea"hls_Listening") &&
                    
GetDistanceBetween(oUseroArea) < 20.0f &&
                    
oArea != GetLocalObject(oUser"dmfi_MyVoice"))
                    {
                        
DeleteLocalObject(oUser"dmfi_MyVoice");
                        return;
                    }
                
oArea GetNextObjectInArea(GetArea(oUser));
            }
        
//Create the Voice
        
object oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"GetLocation(oUser));
        
//Set the Voice to Autofollow the User
        
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
        
//Set Ownership of the Voice to the User
        
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
        return;
    }

    if (
GetStringLeft(sItemTag8) == "dmfi_pc_")
    {
        if (
sItemTag == "dmfi_pc_follow")
        {
            if (
GetIsObjectValid(oOther))
            {
                
FloatingTextStringOnCreature("Now following "GetName(oOther),oUserFALSE);
                
DelayCommand(2.0fAssignCommand(oUserActionForceFollowObject(oOther2.0f)));
            }
            return;
        }
        
SetLocalObject(oUser"dmfi_univ_target"oUser);
        
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
        
SetLocalString(oUser"dmfi_univ_conv"GetStringRight(sItemTagGetStringLength(sItemTag) - 5));
        
AssignCommand(oUserClearAllActions());
        
AssignCommand(oUserActionStartConversation(OBJECT_SELF"dmfi_universal"TRUE));
        return;
    }

    if (
GetStringLeft(sItemTag5) == "dmfi_")
    {
        if (!
GetIsDM(oUser) &&
            !
GetLocalInt(GetModule(), "dmfi_Admin" GetPCPublicCDKey(oUser)) &&
            !
GetLocalInt(oUser"hls_Listening") &&
            
GetIsPC(oUser) &&
            
GetLocalInt(GetModule(), "dmfi_DMToolLock"))
        {
            
FloatingTextStringOnCreature("You cannot use this item." ,oUserFALSE);
            
SendMessageToAllDMs(GetName(oUser)+ " is attempting to use a DM item.");
            return;
        }
        if (
sItemTag == "dmfi_exploder")
        {
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_afflict"))) CreateItemOnObject("dmfi_afflict"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_dicebag"))) CreateItemOnObject("dmfi_dicebag"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_dicebag"))) CreateItemOnObject("dmfi_pc_dicebag"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_follow"))) CreateItemOnObject("dmfi_pc_follow"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_emote"))) CreateItemOnObject("dmfi_pc_emote"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_dmw"))) CreateItemOnObject("dmfi_dmw"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_emote"))) CreateItemOnObject("dmfi_emote"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_encounter"))) CreateItemOnObject("dmfi_encounter"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_faction"))) CreateItemOnObject("dmfi_faction"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_fx"))) CreateItemOnObject("dmfi_fx"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_music"))) CreateItemOnObject("dmfi_music"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_sound"))) CreateItemOnObject("dmfi_sound"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_voice"))) CreateItemOnObject("dmfi_voice"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_xp"))) CreateItemOnObject("dmfi_xp"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_500xp"))) CreateItemOnObject("dmfi_500xp"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_en_ditto"))) CreateItemOnObject("dmfi_en_ditto"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_mute"))) CreateItemOnObject("dmfi_mute"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_peace"))) CreateItemOnObject("dmfi_peace"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_voicewidget"))) CreateItemOnObject("dmfi_voicewidget"oUser);
            return;
        }
        if (
sItemTag == "dmfi_peace")
        {   
//This widget sets all creatures in the area to a neutral stance and clears combat.
            
object oArea GetFirstObjectInArea(GetArea(oUser));
            
object oP;
            while (
GetIsObjectValid(oArea))
            {
                if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE && !GetIsPC(oArea))
                {
                    
AssignCommand(oAreaClearAllActions(TRUE));
                    
oP GetFirstPC();
                    while (
GetIsObjectValid(oP))
                    {
                        if (
GetArea(oP) == GetArea(oUser))
                        {
                            
ClearPersonalReputation(oAreaoP);
                            
SetStandardFactionReputation(STANDARD_FACTION_HOSTILE25oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_COMMONER91oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT91oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER91oP);
                        }
                        
oP GetNextPC();
                    }
                    
AssignCommand(oAreaClearAllActions(TRUE));
                }
                
oArea GetNextObjectInArea(GetArea(oUser));
            }
        }
        if (
sItemTag == "dmfi_voicewidget")
        {
            
object oVoice;
            
//Destroy any existing Voice attached to the user
            
if (GetIsObjectValid(GetLocalObject(oUser"dmfi_MyVoice")))
            {
                
DestroyObject(GetLocalObject(oUser"dmfi_MyVoice"));
                
FloatingTextStringOnCreature("You have destroyed your previous Voice"oUserFALSE);
            }
            if (
GetIsObjectValid(oOther))
            {
                
SetLocalObject(oUser"dmfi_VoiceTarget"oOther);
                
FloatingTextStringOnCreature("You have targeted " GetName(oOther) + " with the Voice Widget"oUserFALSE);
                
object oArea GetFirstObjectInArea(GetArea(oUser));
                while (
GetIsObjectValid(oArea))
                {
                    if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE &&
                    
GetLocalInt(oArea"hls_Listening") &&
                    
GetDistanceBetween(oUseroArea) < 20.0f &&
                    
oArea != GetLocalObject(oUser"dmfi_MyVoice"))
                    {
                        
DeleteLocalObject(oUser"dmfi_MyVoice");
                        return;
                    }
                
oArea GetNextObjectInArea(GetArea(oUser));
                }
                
//Create the Voice
                
object oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"GetLocation(oUser));
                
//Set Ownership of the Voice to the User
                
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
                
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
                return;
            }
            else
            {
                
//Create the Voice
                
oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"lLocation);
                
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
                
SetLocalObject(oUser"dmfi_VoiceTarget"oVoice);
                
//Set Ownership of the Voice to the User
                
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
                
DelayCommand(1.0fFloatingTextStringOnCreature("The Voice is operational"oUserFALSE));
                return;
            }
            return;
        }
        if (
sItemTag == "dmfi_mute")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oUser);
            
SetLocalString(oUser"dmfi_univ_conv""voice");
            
SetLocalInt(oUser"dmfi_univ_int"8);
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        if (
sItemTag == "dmfi_en_ditto")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oOther);
            
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
            
SetLocalString(oUser"dmfi_univ_conv""encounter");
            
SetLocalInt(oUser"dmfi_univ_int"GetLocalInt(oUser"EncounterType"));
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        if (
sItemTag == "dmfi_500xp")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oOther);
            
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
            
SetLocalString(oUser"dmfi_univ_conv""xp");
            
SetLocalInt(oUser"dmfi_univ_int"53);
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        
SetLocalObject(oUser"dmfi_univ_target"oOther);
        
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
        
SetLocalString(oUser"dmfi_univ_conv"GetStringRight(sItemTagGetStringLength(sItemTag) - 5));
        
AssignCommand(oUserClearAllActions());
        
AssignCommand(oUserActionStartConversation(OBJECT_SELF"dmfi_universal"TRUE));
    }
}
{
   
object oItem=GetItemActivated();
   
object oActivator=GetItemActivator();
     
object oCible GetItemActivator();
effect eVisual EffectVisualEffect(VFX_FNF_FIRESTORM);
 
effect eVisual1 EffectVisualEffectVFX_FNF_IMPLOSION );
  
effect eVisual2 EffectVisualEffectVFX_FNF_SUMMON_CELESTIAL  );



if(
GetTag(oItem) == "LeTlporteur")
 {



   
DelayCommand (2.9,
                         
AssignCommand(GetItemActivator(),
   
JumpToLocation(GetLocation(GetObjectByTag("WP_PORTAILVILLE")))));
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual1oCible);
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual2oCible);
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoCible);
 }

je pense que comme sa , sa devrais marcher
Je te poste que à partir du Void Main

Code PHP:

void main()
{
    
object oItem=GetItemActivated();
    
object oUser=GetItemActivator();
    
object oOther=GetItemActivatedTarget();
    
location lLocation=GetItemActivatedTargetLocation();
    
string sItemTag=GetTag(oItem);

    
effect eVisual EffectVisualEffect(VFX_FNF_FIRESTORM);
    
effect eVisual1 EffectVisualEffectVFX_FNF_IMPLOSION );
    
effect eVisual2 EffectVisualEffectVFX_FNF_SUMMON_CELESTIAL  );

    
dmw_CleanUp(oUser);
    if (
GetStringLeft(sItemTag,8) == "hlslang_")
    {
            
//Destroy any existing Voice attached to the user
            
if (GetIsObjectValid(GetLocalObject(oUser"dmfi_MyVoice")))
            {
                
DestroyObject(GetLocalObject(oUser"dmfi_MyVoice"));
                
FloatingTextStringOnCreature("You have destroyed your previous Voice"oUserFALSE);
            }

            
//Set the Voice to interpret language of the appropriate widget
            
string ssLanguage GetStringRight(sItemTag2);
            if (
GetStringLeft(ssLanguage1) == "_")
                
ssLanguage GetStringRight(sItemTag1);
            
SetLocalInt(oUser"hls_MyLanguage"StringToInt(ssLanguage));
            
SetLocalString(oUser"hls_MyLanguageName"GetName(oItem));
            
DelayCommand(1.0fFloatingTextStringOnCreature("You are speaking " GetName(oItem) + ". Type /dm [(what you want to say in brackets)]"oUserFALSE));
            
object oArea GetFirstObjectInArea(GetArea(oUser));
            while (
GetIsObjectValid(oArea))
            {
                if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE &&
                    
GetLocalInt(oArea"hls_Listening") &&
                    
GetDistanceBetween(oUseroArea) < 20.0f &&
                    
oArea != GetLocalObject(oUser"dmfi_MyVoice"))
                    {
                        
DeleteLocalObject(oUser"dmfi_MyVoice");
                        return;
                    }
                
oArea GetNextObjectInArea(GetArea(oUser));
            }
        
//Create the Voice
        
object oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"GetLocation(oUser));
        
//Set the Voice to Autofollow the User
        
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
        
//Set Ownership of the Voice to the User
        
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
        return;
    }

    if (
GetStringLeft(sItemTag8) == "dmfi_pc_")
    {
        if (
sItemTag == "dmfi_pc_follow")
        {
            if (
GetIsObjectValid(oOther))
            {
                
FloatingTextStringOnCreature("Now following "GetName(oOther),oUserFALSE);
                
DelayCommand(2.0fAssignCommand(oUserActionForceFollowObject(oOther2.0f)));
            }
            return;
        }
        
SetLocalObject(oUser"dmfi_univ_target"oUser);
        
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
        
SetLocalString(oUser"dmfi_univ_conv"GetStringRight(sItemTagGetStringLength(sItemTag) - 5));
        
AssignCommand(oUserClearAllActions());
        
AssignCommand(oUserActionStartConversation(OBJECT_SELF"dmfi_universal"TRUE));
        return;
    }

    if (
GetStringLeft(sItemTag5) == "dmfi_")
    {
        if (!
GetIsDM(oUser) &&
            !
GetLocalInt(GetModule(), "dmfi_Admin" GetPCPublicCDKey(oUser)) &&
            !
GetLocalInt(oUser"hls_Listening") &&
            
GetIsPC(oUser) &&
            
GetLocalInt(GetModule(), "dmfi_DMToolLock"))
        {
            
FloatingTextStringOnCreature("You cannot use this item." ,oUserFALSE);
            
SendMessageToAllDMs(GetName(oUser)+ " is attempting to use a DM item.");
            return;
        }
        if (
sItemTag == "dmfi_exploder")
        {
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_afflict"))) CreateItemOnObject("dmfi_afflict"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_dicebag"))) CreateItemOnObject("dmfi_dicebag"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_dicebag"))) CreateItemOnObject("dmfi_pc_dicebag"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_follow"))) CreateItemOnObject("dmfi_pc_follow"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_pc_emote"))) CreateItemOnObject("dmfi_pc_emote"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_dmw"))) CreateItemOnObject("dmfi_dmw"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_emote"))) CreateItemOnObject("dmfi_emote"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_encounter"))) CreateItemOnObject("dmfi_encounter"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_faction"))) CreateItemOnObject("dmfi_faction"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_fx"))) CreateItemOnObject("dmfi_fx"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_music"))) CreateItemOnObject("dmfi_music"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_sound"))) CreateItemOnObject("dmfi_sound"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_voice"))) CreateItemOnObject("dmfi_voice"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_xp"))) CreateItemOnObject("dmfi_xp"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_500xp"))) CreateItemOnObject("dmfi_500xp"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_en_ditto"))) CreateItemOnObject("dmfi_en_ditto"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_mute"))) CreateItemOnObject("dmfi_mute"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_peace"))) CreateItemOnObject("dmfi_peace"oUser);
            if(!
GetIsObjectValid(GetItemPossessedBy(oUser"dmfi_voicewidget"))) CreateItemOnObject("dmfi_voicewidget"oUser);
            return;
        }
        if (
sItemTag == "dmfi_peace")
        {   
//This widget sets all creatures in the area to a neutral stance and clears combat.
            
object oArea GetFirstObjectInArea(GetArea(oUser));
            
object oP;
            while (
GetIsObjectValid(oArea))
            {
                if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE && !GetIsPC(oArea))
                {
                    
AssignCommand(oAreaClearAllActions(TRUE));
                    
oP GetFirstPC();
                    while (
GetIsObjectValid(oP))
                    {
                        if (
GetArea(oP) == GetArea(oUser))
                        {
                            
ClearPersonalReputation(oAreaoP);
                            
SetStandardFactionReputation(STANDARD_FACTION_HOSTILE25oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_COMMONER91oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT91oP);
                            
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER91oP);
                        }
                        
oP GetNextPC();
                    }
                    
AssignCommand(oAreaClearAllActions(TRUE));
                }
                
oArea GetNextObjectInArea(GetArea(oUser));
            }
        }
        if (
sItemTag == "dmfi_voicewidget")
        {
            
object oVoice;
            
//Destroy any existing Voice attached to the user
            
if (GetIsObjectValid(GetLocalObject(oUser"dmfi_MyVoice")))
            {
                
DestroyObject(GetLocalObject(oUser"dmfi_MyVoice"));
                
FloatingTextStringOnCreature("You have destroyed your previous Voice"oUserFALSE);
            }
            if (
GetIsObjectValid(oOther))
            {
                
SetLocalObject(oUser"dmfi_VoiceTarget"oOther);
                
FloatingTextStringOnCreature("You have targeted " GetName(oOther) + " with the Voice Widget"oUserFALSE);
                
object oArea GetFirstObjectInArea(GetArea(oUser));
                while (
GetIsObjectValid(oArea))
                {
                    if (
GetObjectType(oArea) == OBJECT_TYPE_CREATURE &&
                    
GetLocalInt(oArea"hls_Listening") &&
                    
GetDistanceBetween(oUseroArea) < 20.0f &&
                    
oArea != GetLocalObject(oUser"dmfi_MyVoice"))
                    {
                        
DeleteLocalObject(oUser"dmfi_MyVoice");
                        return;
                    }
                
oArea GetNextObjectInArea(GetArea(oUser));
                }
                
//Create the Voice
                
object oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"GetLocation(oUser));
                
//Set Ownership of the Voice to the User
                
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
                
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
                return;
            }
            else
            {
                
//Create the Voice
                
oVoice CreateObject(OBJECT_TYPE_CREATURE"dmfi_voice"lLocation);
                
AssignCommand(oVoiceActionForceFollowObject(oUser3.0f));
                
SetLocalObject(oUser"dmfi_VoiceTarget"oVoice);
                
//Set Ownership of the Voice to the User
                
SetLocalObject(oUser"dmfi_MyVoice"oVoice);
                
DelayCommand(1.0fFloatingTextStringOnCreature("The Voice is operational"oUserFALSE));
                return;
            }
            return;
        }
        if (
sItemTag == "dmfi_mute")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oUser);
            
SetLocalString(oUser"dmfi_univ_conv""voice");
            
SetLocalInt(oUser"dmfi_univ_int"8);
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        if (
sItemTag == "dmfi_en_ditto")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oOther);
            
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
            
SetLocalString(oUser"dmfi_univ_conv""encounter");
            
SetLocalInt(oUser"dmfi_univ_int"GetLocalInt(oUser"EncounterType"));
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        if (
sItemTag == "dmfi_500xp")
        {
            
SetLocalObject(oUser"dmfi_univ_target"oOther);
            
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
            
SetLocalString(oUser"dmfi_univ_conv""xp");
            
SetLocalInt(oUser"dmfi_univ_int"53);
            
ExecuteScript("dmfi_execute"oUser);
            return;
        }
        
SetLocalObject(oUser"dmfi_univ_target"oOther);
        
SetLocalLocation(oUser"dmfi_univ_location"lLocation);
        
SetLocalString(oUser"dmfi_univ_conv"GetStringRight(sItemTagGetStringLength(sItemTag) - 5));
        
AssignCommand(oUserClearAllActions());
        
AssignCommand(oUserActionStartConversation(OBJECT_SELF"dmfi_universal"TRUE));
    }

    if(
sItemTag == "LeTlporteur")
    {
        
DelayCommand (2.9AssignCommand(GetItemActivator(),
            
JumpToLocation(GetLocation(GetObjectByTag("WP_PORTAILVILLE")))));
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual1oUser);
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual2oUser);
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoUser);
    }

En fait, les déclarations était déjà faîtes, pas besoin de les refaire.
Je t'ai mis les effet visuels en haut, comme ça, si tu en rajoutes, tu auras pas de collisions.
Ben ça ne marche pas non plus.

Je pense que je pourrai faire un #include "le script de parchemin de téléportation" dans le script dmfi et faire la même chose c-a-d #include "dmfi" dans le script de téléportation.

Qu'en pensez vous ? Ca ne risque pas de faire une boucle ?
oui merci je n'avais pas tout compris.

sinon j'ai une erreur la dedans c'est la fin.
ce que je veux faire c'est d'abord regarde dans l'inventaire du joueur s'il a au moins 250 Po, il peut utilise sinon, il reçoit le message comme quoi il n'as pas assez d'argent.

Code PHP:

    if(sItemTag == "LeTlporteur")
    
int StartingConditional()
{

    if 
GetGold(GetPCSpeaker()) >= 250;



        
DelayCommand (2.9AssignCommand(GetItemActivator(),
            
JumpToLocation(GetLocation(GetObjectByTag("WP_PORTAILVILLE")))));
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual1oUser);
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisual2oUser);
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoUser);
        
TakeGoldFromCreature(250GetItemActivator(), TRUE);

    else
 {
  
ActionSpeakString("Tu n'as pas assez d'argent pour utiliser un parchemin de Teleportation.");
 }

Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés