Voici ma premiere participation aux script
En voulant "proteger" des archers derriere une barricade je voulais que cette derniere soit détruite pour que les pj puissent passer et attendre les archers.
Cherchant en différents endroits, je n'ai pas trouvé ce type de script, donc, le voici
Respawn d'un Objet apres qu'il ai été cassé par un pj
======================================
1/ rendre l'objet utilisable
2/ mettre ce script dans le OnDeath de l'objet
3/ et enfin ajouter l'objet à la palette (sinon il va etre recreer qu'une fois)
//:://///////////////////////////////////////////// //:: Name Ngs_Respawnobj //::////////////////////////////////////////////// /* Respawn d'objets */ //::////////////////////////////////////////////// //:: Created By: Irgen //:://////////////////////////////////////////////
void RespawnObject(string sResRef, int iType, location lLoc, float fFacing, string sNewTag) { object oRespawn = CreateObject(iType, sResRef, lLoc,FALSE,sNewTag); AssignCommand(oRespawn, ActionDoCommand(SetFacing(fFacing))); }
void main() { string sResRef = GetResRef(OBJECT_SELF); int iType = GetObjectType(OBJECT_SELF); float fFacing= GetFacing(OBJECT_SELF); location lLoc = GetLocation(OBJECT_SELF); string sTag = GetTag(OBJECT_SELF); float fDelay = IntToFloat(d100(3) + 360); AssignCommand(GetModule(), DelayCommand(fDelay, RespawnObject(sResRef, iType, lLoc, fFacing, sTag))); }
[edit by eM : mise a jour des balises pour coloration syntaxique.]
__________________
MD de l'ile de Loth
ip : Loth.servegame.com
[FR] Irgen NGS seveur ATS2
|