[SPELL]NWNRo_PRISON

Répondre
Partager Rechercher
Bonjour.

Voici le sort du jour (sort du soir, espoir...) une reprise de l'ancien sort de BG2 : prison.

Je l'ai refait de mémoire, donc les specialiste ès-ruling pourront (et sont invités) a me donner des precision si j'ai oublié qqchose.

En gros : le sort va envoyer la cible dans un endroit d'où il ne peut revenir que par un souhait, ou par le sort complementaire : Freedom

Materiel Necessaire :

- Une area, dont le TAG est = "Area_Prison"

- Un Waypoint, dans cet Area, dont le TAG est = "ro_s0_prisonWP"

- Un Waypoint, dans cet Area, dont le RESREF est = "wp_prison_spell"

Le code suivant :

Code PHP:

//#include "ro_generic"
//#include "ro_randmatk"

void Server_Light(object oTarget,object oWP);
int  StillPrisoner(object oTarget);
void Campaignprison(object oPC,location lLocPrison);

void main()
{
SpeakString("Prison Spell !");
WriteTimestampedLogEntry("prison");

object oTarget GetSpellTargetObject();

//if (GetIsNvnRoDM(oTarget))
if (GetIsDM(oTarget))
return;

object oWP CreateObject(OBJECT_TYPE_WAYPOINT,"wp_prison_spell",GetLocation(oTarget));
SetLocalObject(oWP,"prisontarget",oTarget);
location lPrisonWP GetLocation(GetObjectByTag("ro_s0_prisonWP"));

ApplyEffectToObject(1,EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE),oTarget,5.0);
AssignCommand(oTarget,ClearAllActions());
ApplyEffectToObject(1,EffectCutsceneParalyze(),oTarget,5.0);
DelayCommand(5.2,AssignCommand(oTarget,ActionJumpToLocation(lPrisonWP)));

if  (!
GetIsPC(oTarget))
    {
    
DelayCommand(180.0,Server_Light(oTarget,oWP));
    }

if (
GetIsPC(oTarget))
    {
    
Campaignprison(oTarget,lPrisonWP);
    }
/*
////////////////////////////////////////////////////////////////
//:MODIF 2-2 HERE
///////////////////////////////////////////////////////////////
                if ((GetIsSecondClass(OBJECT_SELF,10)==TRUE) || (GetIsSecondClass(OBJECT_SELF,9)==TRUE))
                    {
                    oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,OBJECT_SELF,1,CREATURE_TYPE_IS_ALIVE,TRUE);
                    AssignCommand(OBJECT_SELF,ActionCastSpellAtObject(1529,oTarget,METAMAGIC_ANY,TRUE,0,PROJECTILE_PATH_TYPE_DEFAULT,TRUE));
                    }
*/
}


void Server_Light(object oTarget,object oWP)
{
if (
StillPrisoner(oTarget))
    {
    
DestroyObject(oTarget);
    
DestroyObject(oWP);
    }
}

int StillPrisoner(object oTarget)
{
if (
GetTag(GetArea(oTarget))=="Area_Prison")
    {
    return 
TRUE;
    }
return 
FALSE;
}


void Campaignprison(object oPC,location lLocPrison)
{
SetCampaignLocation("DDB","prison_spell",lLocPrison,oPC); //ON OUBLIE PAS DE METTRE ICI SA BDD, si on la gere. 
//sinon, accessoirement, c'est ici qu'on gere son systeme de persistance de location des PC

Répondre

Connectés sur ce fil

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