• Silahkan bergabung dengan chat kami di Telegram group kami di N3Forum - https://t.me/n3forum
  • Welcome to the Nyit-Nyit.Net - N3 forum! This is a forum where offline-online gamers, programmers and reverser community can share, learn, communicate and interact, offer services, sell and buy game mods, hacks, cracks and cheats related, including for iOS and Android.

    If you're a pro-gamer or a programmer or a reverser, we would like to invite you to Sign Up and Log In on our website. Make sure to read the rules and abide by it, to ensure a fair and enjoyable user experience for everyone.

[Tutor] How To Make a NPC

Status
Not open for further replies.

ferry_gukguk

Gukguk Love Cat
Level 2
Sedikit masukkan bagi newbie yang kaga ngerti penggunaan NPC

Sebelum memulai, perhatikan tanda berikut
1. Tanda Kurung ( ) untuk value yang berupa ANGKA
2. Tanda Kurung < > untuk value yang berupa Huruf

Cara membuat Custom NPC # 1

Pengenalan kepada NPC

Untuk membuat sebuah NPC, atau lebih jelasnya Non Player Character, siapkan NPC Editor (Biar lebih mudah) atau pake NotePad juga bisa...

Untuk yang pakai Notepad :

1. Buka notepad anda, Klik Tombol Start -> All Programs -> Accessories -> Notepad

Pada bagian ini kamu membuat sebuah npc...

Pertama, kamu memasukkan Lokasi NPC, koordinat npc (x), koordinat npc (y), direction (Menghadap kemana??)
Code:
Format Location NPC :
<map name>,(x),(y),(direction)

example :
prontera.gat,156,174,2
Setelah lokasi NPC, masukkan tag Script, Nama NPC, ID SPRITE, seperti ini :
Code:
Format Location NPC + Script
<map name>,(x),(y),(direction) *TAB* script *TAB* <Nama NPC Kamu> *TAB* (ID Sprite NPC), {

example :
prontera.gat,156,174,2 *TAB* script *TAB* Healer *TAB* 811, {
Semua yang diatas itu yang WAJIB ada saat pembuatan sebuah SCRIPT pada NPC...

Setelah itu, sekarang membuat sebuah message, yaitu pesan pada saat Player menklik si NPC itu..
seperti ini :
Code:
Format :
<map name>,(x),(y),(direction) *TAB* script *TAB* <Nama NPC Kamu> *TAB* (ID Sprite NPC), {
<tag mes> (kutip (")) <Pesanmu> (kutip(")) (titik koma (;) 
<tag close>
}

Example :
prontera.gat,156,174,2 *TAB* script *TAB* Healer *TAB* 811, {
mes "Halo, selamat datang...";
close;
}
Pada tag diatas, saat Player mengklik si NPC, maka akan keluar tulisan 'Halo, selamat datang...'

Sorry yah, berantakan...
Bersambung... (Cape...)
 

ferry_gukguk

Gukguk Love Cat
Level 2
Cara membuat Custom NPC # 2
Pengenalan Function-function/Action-action pada NPC

Disini kita akan belajar mengenai Aksi-aksi NPC, (Bukan NPCnya bisa beraksi kaya Power Ranger /swt)
Beberapa Action untuk NPC :
1. LabelName :
Ini untuk memberi nama (untuk mengelompokan biar ga pusing [kira" begitu]) label untuk perintah goto
Ini juga berfungsi untuk memberikan script2 lagi, contoh :
Code:
PesanUtama :
mes "Halo..";
close;
2. goto <LabelName>
Perintah/Aksi untuk menuju suatu Label
Code:
PesanUtama :
mes "Halo..";
goto PesanSampingan;
close;
PesanSampingan :
mes "Ini pesan sampingan";
close;
3. menu "NamaMenu",LabelName
Ini fungsi untuk membuat daftar2 menu untuk menuju suatu label tertentu
Contoh :
Code:
PesanUtama :
mes "Halo..";
menu "DuhSayaBingung",Bingung;
close;
Bingung :
mes "Ini Label Bingung dari menu DuhSayaBingung";
close;
4. IF()
Fungsi ini untuk menyatakan sebuah Kondisi, dimana jika kondisi itu SamaDengan(=) atau (or/||) dan (&&)
Contoh :
Code:
PesanUtama :
mes "Halo..";
if (Zeny > 300) goto PesanSampingan;
close;
PesanSampingan :
mes "Ini pesan sampingan hasil dari If";
close;
Kondisi/variabel tersebut bisa berupa :
1.Zeny
2.Weight
3.Countitem
4.Class
5.BaseClass
6.JobClass
7.dll

=> Lebih besar sama dengan dari
<= Lebih kecil sama dengan dari
= Sama dengan
! Tidak Sama Dengan
> Lebih besar dari
< Lebih kecil dari
& Dan
|| atau

5. switch()
Fungsi untuk menentukan suatu label, hampir sama dengan menu, tetapi label nya buatan sendiri (susah jelasinnya)
Untuk menu ke 1, labelnya Case 1 :, dan seterusnya.. biasanya di padukan dengan select
Contoh :
Code:
PesanUtama :
mes "Halo..";
if (Zeny > 300) goto PesanSampingan;
close;
PesanSampingan :
mes "Ini pesan sampingan";
switch("Contoh1","Contoh2","Contoh3") {
Case 1 :
mes "Contoh1";
Case 2 :
mes "Contoh2";
Case 3 :
mes "Contoh3";
}
close;
6. set <nama>/<variabel>
Untuk menset sebuah nama/variabel
Nama :
name - permanent character integer variable
name$ - permanent character string variable
@name - temporary character integer variable
@name$ - temporary character string variable
$name - permanent global integer variable
$name$ - permanent global string variable
$@name - temporary global integer variable
$@name$ - temporary global string variable
.name - permanent npc integer variable
.name$ - permanent npc string variable
.@name - temporary npc integer variable
.@name$ - temporary npc string variable
#name - permanent local account integer variable
#name$ - permanent local account string variable
##name - permanent global account integer variable
##name$ - permanent global account string variable

Contoh :
Code:
set $name, "GukGuk"
Membuat $name = Gukguk menjadi permanen, dst..

Variabel :
StatusPoint - Amount of status points remaining.
BaseLevel - Current base level
SkillPoint - Amount of skill points remaining
Class - Current job
Upper - 1 if the character is an advanced job class.
Zeny - Current amount of zeny
Sex - Character's gender, 0 if female, 1 if male.
Weight - The weight the character currently carries.
MaxWeight - The maximum weight the character can carry.
JobLevel - Character's job level
BaseExp - The amount of base experience points the character has.
Notice that it's zero (or close) if the character just got a level.
JobExp - Same for job levels
NextBaseExp - Amount of experience points needed to reach the next base level.
NextJobExp - Same for job levels.
Hp - Current amount of hit points.
MaxHp - Maximum amount of hit points.
Sp - Current spell points.
MaxSp - Maximum amount of spell points.
BaseJob - This is sneaky, apparently meant for baby class support.
This will supposedly equal Job_Acolyte regardless of whether the
character is an acolyte or a baby acolyte, for example.
Karma - The character's karma. Karma system is not fully functional, but
this doesn't mean this doesn't work at all. Not tested.
Manner - The character's manner rating. Becomes negative if the player
utters words forbidden through the use of 'manner.txt' client-side
file.
Contoh :
Code:
set Zeny, Zeny + 100;
Menambah zeny sebanyak 100,

+ untuk menambah
- untuk mengurangi

7. select()
untuk memilih suatu menu,,
Contoh :
Code:
PesanUtama :
mes "Halo..";
if (Zeny > 300) goto PesanSampingan;
close;
PesanSampingan :
mes "Ini pesan sampingan";
select("Ya","Tidak") {
Case 1 :
mes "Ya";
Case 2 :
mes "Tidak";
}
close;
Yang diselaraskan dengan switch
Contoh :
Code:
PesanUtama :
mes "Halo..";
if (Zeny > 300) goto PesanSampingan;
close;
PesanSampingan :
mes "Ini pesan sampingan";
switch(select("Ya","Tidak")) {
Case 1 :
mes "Ya";
Case 2 :
mes "Tidak";
}
close;
8. countitem (idItem) (ammount)
Mengecek Item ada/tidak ada di Inventory sebanyak ammount

9. delitem (idItem) (ammount)
Menghapus Item di dalam Inventory sebanyak ammount

10. getitem (idItem) (ammount)
Menambah Item di inventory sebanyak ammount

----------------------
Selesai..

Untuk info lebih lanjutnya, kalian bisa melihat di bagian doc/script_command.txt pada folder eAthena/Freya/Aurora kamu..
Mohon maaf bila ada kesalahan, (Terutama karena ketidakrapihan dan keterlambatan melanjutkan tutor ini)

Terima kasih,
 
Status
Not open for further replies.
Top