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

Panneau de contrôle

Recherche | Retour aux forums

JOL Archives

[script] Embuscade selon le level

Par Zariel le 5/11/2002 à 17:54:20 (#2487886)

Je n'arrive pas à piger ce script, tout d'abord il faut creer un personnage d'apparence innoffensif et sa conversation entrainera l'apparition de bandits. Mais dans quel script faut-il le placer de le OnConversation du NPC ou dans les scripts de dialogues ? Ou dois-je placer cela ?


// I placed this script in the conversation that the PC is having
// with a bandit on a lonely road. This script will get the number
// of hit dice (level) of the PC. Then it will spawn 4 each Halfling thieves
// (any creature can be substituted, just give it the tag of
// Bandir01 - 04). The creatures will appear at the waypoints
// spawn1 - spawn4. It is a fairly simple script that is easily modified.
//
// Created by Slate Stonebreaker. Any and all questions can be
// sent to ieee8021q@yahoo.com
//
void main()
{
object oPC = GetLastSpeaker();
int nPCLevel = GetHitDice(oPC);

// Modify the player's reputation
AdjustReputation(GetPCSpeaker(), OBJECT_SELF, -50);

if(nPCLevel < 4)
{
//spawns level 2 bandits four each (bandit1).
location spawn1 = GetLocation (GetWaypointByTag ("Bandit01"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit01", spawn1);
//
location spawn2 = GetLocation (GetWaypointByTag ("Bandit02"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit01", spawn2);
//
location spawn3 = GetLocation (GetWaypointByTag ("Bandit03"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit01", spawn3);
//
location spawn4 = GetLocation (GetWaypointByTag ("Bandit04"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit01", spawn4);
}
else if(nPCLevel 3)
{
//spawns level 4 bandits four each (bandit2).
location spawn1 = GetLocation (GetWaypointByTag ("Bandit01"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit02", spawn1);
//
location spawn2 = GetLocation (GetWaypointByTag ("Bandit02"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit02", spawn2);
//
location spawn3 = GetLocation (GetWaypointByTag ("Bandit03"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit02", spawn3);
//
location spawn4 = GetLocation (GetWaypointByTag ("Bandit04"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit02", spawn4);
}
else if(nPCLevel 6)
{
//spawns level 8 bandits four each (bandit3).
location spawn1 = GetLocation (GetWaypointByTag ("Bandit01"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit03", spawn1);
//
location spawn2 = GetLocation (GetWaypointByTag ("Bandit02"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit03", spawn2);
//
location spawn3 = GetLocation (GetWaypointByTag ("Bandit03"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit03", spawn3);
//
location spawn4 = GetLocation (GetWaypointByTag ("Bandit04"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit03", spawn4);
}
else
{
//spawns level 14 bandits four each (bandit4).
location spawn1 = GetLocation (GetWaypointByTag ("Bandit01"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit04", spawn1);
//
location spawn2 = GetLocation (GetWaypointByTag ("Bandit02"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit04", spawn2);
//
location spawn3 = GetLocation (GetWaypointByTag ("Bandit03"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit04", spawn3);
//
location spawn4 = GetLocation (GetWaypointByTag ("Bandit04"));
CreateObject (OBJECT_TYPE_CREATURE, "Bandit04", spawn4);
}
}


C'est ok, pour le placement des bandits sur WP mais sont ils invisibles au moment de la rencontre avec le NPC qui entrainera l'embuscade ?

Par Zariel le 5/11/2002 à 18:52:25 (#2488545)

Bon on oublie, ce que j'ai dit avant, le problème est réglé :D

Il me reste un problème :

Si les PJ décident de ne pas parler à l'interlocuteur (de ne pas engager la conversation), je veux qu'ils passent sur un Trigger pour quand même se faire attaquer si ils zappent les voleurs.

Si vous avez une idée à mettre dans le scripts sur le trigger, j'utilise les même tag que dans le script cité plus haut. ;)

Par Frolo Xeres le 5/11/2002 à 19:06:30 (#2488711)

Je détecte un petit détail qui cloche sur ce script !
Et si par hasard le PC ne serait pas seul... Qu'il avait un copain de 2 niveaux de plus que lui... M'enfin un PC de plus çà change les calcul quand même !

Si j'étais toi j'utiliserais le GetHitDice( GetFirstPC() ); ... et une boucle sur les PC avec GetNextPC()...
Comme çà, les voleurs ont prêts à affronter tous les PC si il faut !

Bon accesoirement le PC qui est partit en éclaireur, il est mal !

M'enfin comme dirais un ami Rodeur, "c'est les risques du métier... Mailikki acceuil moi en ton royaume !"

Par Zariel le 5/11/2002 à 19:12:06 (#2488775)

Merci Frolo mais tu pourrais me faire un copier coller du script avec les modifs que tu m'as dites et à ton avis dans quels onglets se colle ce script ?

Car j'ai un problème, les bandits deviennent hostile mais reste coller sur place...

Par Zariel le 5/11/2002 à 22:37:47 (#2490928)

Je reviens sur ce script, au lieu de bandits qui spawn,je me retrouve avec des blaireaux :D

C'est qui le blaireau dans l'histoire ? :hardos:

Je ne vois pas le paramètre à changer dans le script pour obtenir des voleurs...

Edit: Holala, il fallait mettre les Blueprint ou lieu des tags dans le script, fallait le savoir !!! :enerve:

JOL Archives 1.0.1
@ JOL / JeuxOnLine