Meurt et laisse une trace

Répondre
Partager Rechercher
Bonjour a tous me revoila, le roi de la quiche
Bon voila j'avais fait un script pour que quand le gars meurs il y a un corps qui aparait. Ceci a pour effet d'eviter que le joueur qui deco-reco ne puisse revenir comme une fleur avec toute sa vie. Si un joueur a un corps,cela a pour effet de le tuer des qu'il rentre sur le serveur.
Mon pb se situe juste dans l'apparition de ce corps. Comme ce script date de mes debuts je pensai en faire un nouveau donc si quelqu'un pouvait m'accorder son aide svp
Merci beaucoup

Edit: dans ce script il audrait aussi un decompte (genre si le gars est mort depuis 30 sec ben respawn automatique)
Voici le script que j'ai modifie,j'ai pris celui de HoTU et j'ai ajoute quelques fonctions:


Code PHP:

 //::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    This script handles the default behavior
    that occurs when a player dies.
    BK: October 8 2002: Overriden for Expansion
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////
/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
//    AssignCommand(oMember, SpeakString("here"));
    AdjustReputation(oPlayer, oMember, 100);
    SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
    object oClear = GetFirstFactionMember(oMember, FALSE);
    while (GetIsObjectValid(oClear) == TRUE)
    {
        ClearPersonalReputation(oPlayer, oClear);
        oClear = GetNextFactionMember(oMember, FALSE);
    }
} */
 
void mortoupas(object oPlayer)
//object oPlayer = GetLastPlayerDied();
int nXP GetXP(oPlayer);
    
int nPenalty 50 GetHitDice(oPlayer);
    
int nHD GetHitDice(oPlayer);
    
// * You can not lose a level with this respawning
    
int nMin = ((nHD * (nHD 1)) / 2) * 1000;
    
int nNewXP nXP nPenalty;
    if (
nNewXP nMin)
     
nNewXP nMin;
    
int nGoldToTake =    FloatToInt(0.10 GetGold(oPlayer));
    
// * a cap of 20 000gp taken from you
    
if (nGoldToTake 10000)
    {
        
nGoldToTake 10000;
    }
 
     
// TakeGoldFromCreature (nGoldToTake, oPlayer, TRUE);
AssignCommand(oPlayerTakeGoldFromCreature(nGoldToTakeoPlayerTRUE));
         
effect eVisual EffectResurrection();
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoPlayer);
     
AssignCommand(oPlayerSpeakString("(Respawn Automatique !)"));
     
SetXP(oPlayernNewXP);
object oSpawnPoint GetObjectByTag("NW_DEATH_TEMPLE");
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)) );
DestroyObjectGetItemPossessedBy(oPlayer,"CORPSMORT"));
     
//SetLocalInt(oPlayer, "activemort", 0);
        
}
void Raise(object oPlayer)
{
        
effect eVisual EffectVisualEffect(VFX_IMP_RESTORATION);
        
effect eBad GetFirstEffect(oPlayer);
        
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
        
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
        
//Search for negative effects
        
while(GetIsEffectValid(eBad))
        {
            if (
GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
                
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
                
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
                
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
                
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
                {
                    
//Remove effect if it is negative.
                    
RemoveEffect(oPlayereBad);
                }
            
eBad GetNextEffect(oPlayer);
        }
        
//Fire cast spell at event for the specified target
        
SignalEvent(oPlayerEventSpellCastAt(OBJECT_SELFSPELL_RESTORATIONFALSE));
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoPlayer);
}
void main()
{
    
object oPlayer GetLastPlayerDied();
    
// * increment global tracking number of times that I died
    
CreateItemOnObject ("CORPSMORT",oPlayer,1);
    
SetLocalInt(oPlayer"NW_L_PLAYER_DIED"GetLocalInt(oPlayer"NW_L_PLAYER_DIED") + 1);
    
// * BK: Automation Control. Autopcs ignore death
    
if (GetLocalInt(oPlayer"NW_L_AUTOMATION") == 10)
    {
        
Raise(oPlayer);
        
DelayCommand(1.0ExecuteScript("crawl"OBJECT_SELF));
        return; 
// Raise and return
    
}
 
    
// * Handle Spirit of the Wood Death
     
string sArea GetTag(GetArea(oPlayer));
/*
    if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oPlayer)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
    {
        int bValid;
        Raise(oPlayer);
        string sDestTag = "WP_M2Q2GtoM2Q2F";
        object oSpawnPoint = GetObjectByTag(sDestTag);
        AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)));
        return;
    }
*/
    // * in last level of the Sourcestone, move the player to the beginning of the area
    // * May 16 2002: or the main area of the Snowglobe (to prevent plot logic problems).
    // * May 21 2002: or Castle Never
    
if (sArea == "M4Q1D2" || sArea == "M3Q3C" || sArea == "MAP_M1Q6A")
    {
        
//Raise(oPlayer);
        //string sDestTag = "M4QD07_ENTER";
        //object oSpawnPoint = GetObjectByTag(sDestTag);
//        AssignCommand(oPlayer, DelayCommand(1.0, JumpToLocation(GetLocation(oSpawnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
        
DelayCommand(2.5PopUpDeathGUIPanel(oPlayer,FALSETRUE66487));
        return;
    }
    
// * make friendly to Each of the 3 common factions
    
AssignCommand(oPlayerClearAllActions());
    
// * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
    
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONERoPlayer) <= 10)
    { 
SetLocalInt(oPlayer"NW_G_Playerhasbeenbad"10); // * Player bad
        
SetStandardFactionReputation(STANDARD_FACTION_COMMONER80oPlayer);
    }
    if (
GetStandardFactionReputation(STANDARD_FACTION_MERCHANToPlayer) <= 10)
    { 
SetLocalInt(oPlayer"NW_G_Playerhasbeenbad"10); // * Player bad
        
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT80oPlayer);
    }
    if (
GetStandardFactionReputation(STANDARD_FACTION_DEFENDERoPlayer) <= 10)
    { 
SetLocalInt(oPlayer"NW_G_Playerhasbeenbad"10); // * Player bad
        
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER80oPlayer);
    }
    
DelayCommand(2.5PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));

Le probleme c'est que le corps,dont le tag est CORPSMORT n'apparait pas a la mort de la personne
euh c'est pas un tag t'es sur (je suis une quiche mais pas autant)parce que j'ai fais le test rien qu'avec le script de base et en rajoutant ca ca marche

edit: bah je sais c'est pas le fait que la resref soit en maj c'est parce que le jeu a pa pris en compte mon editer-copier(oui entre-temps,j'avais efface l'item lol,donc suis une quiche quand meme) et donc forcement la resref etait "corps" (le nom de l'objet) tout court. . .Par contre, la destruction de l'objet quand le personnage respawn ne s'effectue pas
Code PHP:

    // Create an item with the template sItemTemplate in oTarget's inventory.
    // - nStackSize: This is the stack size of the item to be created
    // * Return value: The object that has been created.  On error, this returns
    //   OBJECT_INVALID.
    // If the item created was merged into an existing stack of similar items,
    // the function will return the merged stack object. If the merged stack
    // overflowed, the function will return the overflowed stack that was created.
    
object CreateItemOnObject(string sItemTemplateobject oTarget=OBJECT_SELFint nStackSize=1
string sItemTemplate c'est le ResRef de l'objet, le template, le blueprint. Il est toujours en minuscules.
Pour ton objet qui ne disparaît pas, Il y a quelque chose que je ne comprends pas dans ton script. Tu lui donnes quand il meurt, mais tu lui retires aussi quand il meurt ?
Car là, c'est le script du OnDeath, pas celui du Respawn.

Au passage, si j'ai compris ce que tu veux faire et si tu veux que ton système fonctionne, il va falloir aussi prendre en compte les sorts de resurrection et de rappel à la vie et retirer l'objet à ce moment là. Vire aussi les trucs inutiles de ton script, tu t'embrouilleras moins.



oui je me suis confondu mais c'est pas grave si tu met en majuscule dans le script (le resref ne peut etre qu'en miniscule donc pas de probleme).
Truc inutile? lesquels? ca m'interesse
En fait l'idee c'est d'empecher que ces mechants de PJs deco-reco quand ils sont mort(mais n'ont pas encore respawn) afin de se retrouver en vie avec toute leurs moyens. . . Donc quand le gars meurt il a cet objet(comme ca si il deco reco,ben il meurt quand il reco avec mon script du onenter) mais si il respawn(et donc perds des xp et or) cet objet disparait car le Pj aura pas fraude.
Pour les ressurection et rappel a la vie je ne me rapelle plus de la trame a suivre malheureusement(arg maudite quiche que je suis ).
Par contre j'ai aussi essaye de modif le vfx quand le perso meurt mais cela marche pas
Répondre

Connectés sur ce fil

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