Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Rekomendowane odpowiedzi

Opublikowano

Well, I have seen a few people saying "OMG, Someone give me an example of scripting an NPC!?".

 

Ok, well, here is a simple tutorial on doing so!

 

 

[Files that are going to be edited]

To jest ukryta treść, proszę

 

Note:: Online code wrapped around the {code} tags should be added to your NPC,unless you are adding your own code....

 

Let's begin::

 

1.You need to create a new CPP source file ->Cody.cpp

 

2.Ok, In your new NPC file[Which is Cody.cpp] In this tutorial.

Include the following headers

To jest ukryta treść, proszę

 

3.Ok, We are getting to the hard part.

We need to declare a new "void" function, derived from class NPCsScripts..

 

We do this by the following

 

To jest ukryta treść, proszę

 

 

Now, You may be wondering, where the hell did I get npc_2100?

Easy, that is the NPC's ID.You can find all NPC ID's here.

 

 

It is also located in file "NPCsScripts.h". We will look into that later though.

 

Let's move on.

 

Step 4.We need to declare Integers state and map.

state-> Current State

map-> Game map..

 

We do this by adding

To jest ukryta treść, proszę

 

in between

 

To jest ukryta treść, proszę

 

Your new code should look something like this...

 

To jest ukryta treść, proszę

 

:).

 

Step5. Now we need to add our Map Checks :).

add

To jest ukryta treść, proszę

 

after

 

To jest ukryta treść, proszę

 

 

In case you didn't know, the map is defined by it's Id, which in this tutorial is Map ID '100000000'[Henesys].Get Map ID's from here.

 

Ok, lets move on to adding our if(state) commands!

 

Step6. Hmm, This is kinda confusing, but I will get more into detail about this later, for now, just think of this as the npc State. State[0] = Begin Chat with NPC.... State[1] == Selected Yes/No...[Remember, this is not the case, just an example...Look into the code for more details.....]

 

Add your if(state == 0) checks!

 

To do this, add

 

To jest ukryta treść, proszę

 

in between

 

To jest ukryta treść, proszę

 

Your new code should look like this....

 

To jest ukryta treść, proszę

 

We are almost done....With cody.cpp anyways!

 

Now, You just implement what you want cody to do....References at the end of the tutorial....

 

Here is an example...

 

 

To jest ukryta treść, proszę

 

Now, Let's change the NPC ID -> 9200000 <- This is cody's NPC_ID...Can find NPC ID's here.

 

change

 

To jest ukryta treść, proszę

 

to

 

To jest ukryta treść, proszę

 

Geez, Finally, We can close Cody.cpp.

 

Now, Open NPCsScripts.h

 

Step6. In NPCsScripts.h, you should see these both!

 

To jest ukryta treść, proszę

 

and

 

To jest ukryta treść, proszę

 

or something similar eh?

 

Well, We just need to add decelerations and we are done.

 

Look hard? eh, no the hell it doesn't....

 

Simple add these two to the correct areas.

 

To jest ukryta treść, proszę

 

and

 

To jest ukryta treść, proszę

 

It should be obvious as to where these both go, no?

 

Great! Well, we are done with this tutorial for now!

 

Compile and test your new NPC :).

 

 

 

 

Note::

 

Please reply with any ways I can make this thread more understandable/clearer.

English is my fourth language, So I may not have the best english.......

 

 

 

npc Commands

To jest ukryta treść, proszę

 

Enjoy

 

Credits: cPlusPlus @ RaGEZONE

Opublikowano

Sam myślałem nad wstawieniem :P

Dodaj creditsy i będzie kul.

Poza tym, przejrzyste i łatwe do zrozumienia, jak się zna choć trochę angielski.

exModerator MapleStory

Opublikowano

no fajnie nice tylko szkoda ze po angielsku;/

Ja:

Ej wiw3k, jedziemy do czarnobyla?

Wiw3k:

Nieee, bo tam aciek grasuje.

Opublikowano

Ok fajnie troche juz przez translatora przeszło i cos tam rozumiem :]

Zauważyłam ze niektórzy mają w sygnie ze do priv serva zrobione wszystko jest ale npc : 40% :]

Napewno sie przyda :]

 

Z poważaniem

Kacye

Ja:

Ej wiw3k, jedziemy do czarnobyla?

Wiw3k:

Nieee, bo tam aciek grasuje.

  • 2 tygodnie później...

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Zaloguj się poniżej.

Zaloguj się
×
×
  • Dodaj nową pozycję...