Curdy
Nombre de messages : 8 Date d'inscription : 06/02/2009
| Sujet: Bonjour a tous 16/09/09, 11:34 pm | |
| quelqu'un pourrais m'aidez et me dire comment cree des mobs en apparence humain ou dark elf pour l2jfree serveur garcia ct2 cela serais super gentil merci a tous | |
|
Psychokiller1888
Nombre de messages : 114 Age : 40 Localisation : Suisse Date d'inscription : 24/02/2008
| Sujet: Re: Bonjour a tous 17/09/09, 09:25 am | |
| | |
|
Curdy
Nombre de messages : 8 Date d'inscription : 06/02/2009
| Sujet: Re: Bonjour a tous 18/09/09, 10:34 pm | |
| merci de ta reponse mais je ne comprend pas une chose j'avais vu se tuto mais je suis bloquer ici - Code:
-
Re: Morph NPCs to PCs « Reply #4 on: February 02, 2008, 06:13:10 pm »
OK Code added:
DIFFs probably won't match, but you can see how simple it is to insert the correct lines in the right place:
Guide to install: 1st Stage - Add these 3 New files:
* L2_GameServer_CT1/src/main/java/net/sf/l2j/gameserver/network/serverpackets/CustomNpcInfo.java * L2_GameServer_CT1/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2CustomNpcInstance.java * L2_GameServer_CT1/src/main/java/net/sf/l2j/gameserver/instancemanager/CustomNpcInstanceManager.java
Just place those files...
2nd step: In L2NpcInstance add this: import: Code:
import net.sf.l2j.gameserver.instancemanager.CustomNpcInstanceManager;
variable: Code:
+ /** The Polymorph object that manage this L2NpcInstance's morph to a PcInstance... I wrote this line too =P Darki699 */ + private L2CustomNpcInstance _customNpcInstance; +
in function onRandomAnimation() add this (coz PCs have more animations than regular npcs): Code:
- // Send a packet SocialAction to all L2PcInstance in the _KnownPlayers of the L2NpcInstance - SocialAction sa = new SocialAction(getObjectId(), Rnd.get(2, 3)); + int min = (_customNpcInstance != null) ? 1 : 2; + int max = (_customNpcInstance != null) ? 13 : 3; + // Send a packet SocialAction to all L2PcInstance in the _KnownPlayers of the L2NpcInstance + SocialAction sa = new SocialAction(getObjectId(), Rnd.get(min, max));
Where it shows the admin the (SHIFT+TARGET) NPC data add this (not necessary, just helpful to see the spawn_id, instead of guessing it): Code:
- html1.append("<tr><td>Object ID</td><td>"+getObjectId()+"</td><td>NPC ID</td><td>"+getTemplate().getNpcId()+"</td></tr>"); + html1.append("<tr><td>Object ID</td><td>"+getObjectId()+"</td></tr>"); + html1.append("<tr><td>NPC ID</td><td>"+getTemplate().getNpcId()+"</td></tr>"); + html1.append("<tr><td>Spawn ID</td><td>"+getSpawn().getId()+"</td></tr>");
in function setSpawn(L2Spawn spawn) add this to initialize the morph: Code:
+ // Does this Npc morph into a PcInstance? + if (_spawn != null) + { + if (CustomNpcInstanceManager.getInstance().isThisL2CustomNpcInstance(_spawn.getId() , getNpcId())) + { + new L2CustomNpcInstance(this); + } + }
and at the end of L2NpcInstance.java add these 2 functions: Code:
+ public L2CustomNpcInstance getCustomNpcInstance() + { + return _customNpcInstance; + } + + public void setCustomNpcInstance(L2CustomNpcInstance arg) + { + _customNpcInstance = arg; + }
Now add into NpcInfo.java (serverpackets) this override for morphed npcs, in the constructor NpcInfo(L2NpcInstance cha, L2Character attacker) add: Code:
+ if (cha.getCustomNpcInstance() != null) + { + attacker.sendPacket(new CustomNpcInfo(cha)); + return; + }
and that's it for the editing: 3rd step: Add the sql table and batch my example And it works!!!
je comprend pas bien ce qu'il faut faire | |
|
Melua
Nombre de messages : 264 Age : 36 Localisation : Orléans Date d'inscription : 27/05/2008
| Sujet: Re: Bonjour a tous 18/09/09, 11:02 pm | |
| il faut customiser les sources de ton serveur, ça sous-entend que tu saches modifier et compiler le programme java qu'est le coeur du gameserveur (l2jfree-core.jar) | |
|
yacancoatl
Nombre de messages : 91 Age : 36 Date d'inscription : 24/09/2008
| Sujet: Re: Bonjour a tous 18/09/09, 11:56 pm | |
| il me semble que le code n'est pas suivi avec les majs d'l2jfree. je pense qu'après la version 1.2.9 ça ne fonctionne plus ce code.
Donc si vous ne vous y connaissez pas, je pense pas que ce soit une bonne idée même "d'essayer". | |
|
Curdy
Nombre de messages : 8 Date d'inscription : 06/02/2009
| Sujet: Re: Bonjour a tous 19/09/09, 08:52 pm | |
| merci pour vos reponse je vais faire des test et je tiens au courent de l'evolution merci a vous | |
|
Sig'
Nombre de messages : 30 Date d'inscription : 20/04/2009
| Sujet: Re: Bonjour a tous 29/09/09, 06:32 pm | |
| - yacancoatl a écrit:
- il me semble que le code n'est pas suivi avec les majs d'l2jfree. je pense qu'après la version 1.2.9 ça ne fonctionne plus ce code.
Donc si vous ne vous y connaissez pas, je pense pas que ce soit une bonne idée même "d'essayer". Après la 1.2.11 il faut adapter le code. Et pourquoi ne pas essayer ? c'est comme ça qu'on progresse ... | |
|
yacancoatl
Nombre de messages : 91 Age : 36 Date d'inscription : 24/09/2008
| Sujet: Re: Bonjour a tous 30/09/09, 05:06 pm | |
| Désolé j'aurais dû être plus clair :
[quote=Yacancoatl]Donc si vous ne vous y connaissez pas ou/et que le langage java ne vous intéresse pas, ... [/quote] | |
|
Melua
Nombre de messages : 264 Age : 36 Localisation : Orléans Date d'inscription : 27/05/2008
| Sujet: Re: Bonjour a tous 30/09/09, 05:42 pm | |
| J'ai commencé a essayé de l'adapter pour la 1.3.0 c'est pas si aisé beaucoup de méthodes ont changé et j'ai pas beaucoup de temps libre en ce moment mais ça fait parti de mes objectifs du mois d'octobre xD | |
|
Contenu sponsorisé
| Sujet: Re: Bonjour a tous | |
| |
|