Bienvenue sur JeuxOnLine - MMO, MMORPG et MOBA !
Les sites de JeuxOnLine...
 

Panneau de contrôle

Recherche | Retour aux forums

JOL Archives

scripter des feats?

Par John Hawkmoon le 24/7/2002 à 2:33:51 (#1851597)

est-ce possible des faire des nouvelle feats?

Par Ryval le 24/7/2002 à 15:29:57 (#1854250)

Oui c'est possible: a la place de main tu met autre chose. aprés il faudra que tu fasse un include de ton programme. Je te donne un exemple ca sera plus simple. C'est un truc que g récupéré pour faire la garde de ma ville(quand un type attaque les commoners sans défenses, les gardes apparaissent. tu peux aussi l'utiliser dans des OnEnter de zones ou des OnUse de placeables


void CreateMultipleCreatures(int iNumberOfCreatures, int sSphereSize, string sTemplate, object oSpawnObject, int iEffect, object oObjetaattaquer, int bInstantAttack = FALSE, int bOnceOnly = TRUE) {

if((bOnceOnly == TRUE && (GetLocalInt(oSpawnObject, "SPAWN_ONCE") != 1))
|| (bOnceOnly == FALSE))
{

//Get the location of the object to spawn around
location oMyLocation = GetLocation(oSpawnObject);

//Get the location vector of the object to spawn around
vector oMyVector = GetPosition(oSpawnObject);

//Count the number of creatures
int iCount = 0;

//While we still have items to create
while(iCount < iNumberOfCreatures)
{

//Create a new vector object
vector oNewVector = oMyVector;

//Create some offsets based on the sphere size
int xOffSet = Random(sSphereSize);
int yOffSet = Random(sSphereSize);

//Make the offset negative, randomly
if(Random(2) == 1)
{
xOffSet = xOffSet * -1;
}

//Make the offset negative, randomly
if(Random(2) == 1)
{
yOffSet = yOffSet * -1;
}

//Add the offsets to the vector
oNewVector.x = oNewVector.x + xOffSet;
oNewVector.y = oNewVector.y + yOffSet;

//Create a new location, based on the off set vector
location oNewLocation = Location(GetAreaFromLocation(oMyLocation),
oNewVector, 0.0);

//Create a creature using the supplied template
object oMonster = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, oNewLocation, FALSE);

//Create an effect using the supplied effect constant
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(iEffect), oNewLocation, 0.5);

if(bInstantAttack == TRUE)
{
//Get the creature that we'll attack

AssignCommand(oMonster, ActionAttack(oObjetaattaquer));
}

//Increase the count
iCount = iCount + 1;

}

//Set the spawn once
SetLocalInt(oSpawnObject, "SPAWN_ONCE", 1);

}

}

JOL Archives 1.0.1
@ JOL / JeuxOnLine