Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/10/24 in Posts

  1. Hi. Change 100 to 10000, and 0.01 to 1. You can't use decimal numbers in scripting. - script Poring_Coin -1,{ OnNPCKillEvent: if ( rand( 10000 ) <= 1 ) { .@item_id = F_Rand( 7539 ); getitem .@item_id,1; } end; } 10000 = 100 % 1000 = 10 % 100 = 1 % 10 = 0.1 % 1 = 0.01 %
    1 point
  2. The player chooses one of the items? Or the NPC chooses one? The player receives multiple items? geffen,151,48,5 script First Person 1_M_LIBRARYMASTER,{ //Put the IDs of the item below. setarray .@items, 909, 910, 911, 912, 913, 914, 915; if (isnpccloaked("Second Person") == 0) { npctalk "You can talk to him.", strnpcinfo(0), bc_self; end; } mes "[First Person]"; mes "Hi, do you have all the items with you?"; next; for (.@i=0;.@i< getarraysize(.@items);.@i++) { if (countitem(.@items[.@i]) < 1) { mes "[First Person]"; mes "You don't have <ITEM>" + getitemname(.@items[.@i]) + "<INFO>" + .@items[.@i] + "</INFO></ITEM>."; close; } } mes "[First Person]"; mes "You have everything. I will call him."; close2; cutin "war_y1", 2; cloakoffnpcself( "Second Person" ); npctalk "Hello.", "Second Person", bc_self; end; } geffen,155,49,3 script Second Person 4_M_FAIRYKID5,{ //Put the IDs of the item below. setarray .@items, 909, 910, 911, 912, 913, 914, 915; //Put here the item IDs of the selection the player can choose from setarray .@reward, 714, 607, 12103; disable_items; mes "[Second Person]"; mes "Hi, the first person told me you have the items."; if (getarraysize(.@reward) > 1) { mes "You can exchange them for one of these:"; for (.@i=0;.@i< getarraysize(.@reward);.@i++) mes "- <ITEM>" + getitemname(.@reward[.@i]) + "<INFO>" + .@reward[.@i] + "</INFO></ITEM>"; next; .@menu$ = ""; for (.@i=0;.@i< getarraysize(.@reward);.@i++) .@menu$ += "- " + getitemname(.@reward[.@i]) + ":"; .@s = select(.@menu$) - 1; mes "[Second Person]"; } mes "Are you sure you want"; mes "<ITEM>" + getitemname(.@reward[.@s]) + "<INFO>" + .@reward[.@s] + "</INFO></ITEM>?"; next; if (select("No", "Yes, let's do this") == 1) { mes "[Second Person]"; mes "I see."; close2; cutin "", 255; cloakonnpcself; end; } for (.@i=0;.@i< getarraysize(.@items);.@i++) { if (countitem(.@items[.@i]) < 1) { mes "[Second Person]"; mes "You don't have <ITEM>" + getitemname(.@items[.@i]) + "<INFO>" + .@items[.@i] + "</INFO></ITEM>."; close2; cutin "", 255; cloakonnpcself; end; } } if ((MaxWeight - Weight) < 1000 || checkweight("Knife",1) == 0) { mes "^0000FF- You cannot continue due to your heavy weight. -^000000"; close2; cutin "", 255; cloakonnpcself; end; } for (.@i=0;.@i < getarraysize(.@items);.@i++) delitem .@items[.@i], 1; getitem .@reward[.@s], 1; mes "[Second Person]"; mes "Done."; close2; cutin "", 255; cloakonnpcself; end; OnInit: cloakonnpc; end; }
    1 point
  3. you are asking a lot of questions i couldn't understand most of it i think you want to know how to add Custom NPC? this a short guide < do it and everything would work: SERVER_FILES: >src >>map >>npc.hpp EXAMPLE: JT_NPC_CUSTOM = 30000, >>script_constants.hpp EXAMPLE: export_constant_npc(JT_NPC_CUSTOM); CLIENT_FILES: >data >>sprite >>>npc >>>> //your npc spr/act here EXAMPLE: >>>>npc_test.act >>>>npc_test.spr >>luafiles514 >>>lua files >>>>datainfo >>>>>npcidentity.lub EXAMPLE: JT_NPC_CUSTOM = 30000, (THE ID MOST NOT BE ALREADY USED IN jobidentity.lub AND npcidentity.lub / THE ID MUST BE THE SAME AS THE SERVER npc.hpp) >>>>>jobname.lub EXAMPLE: [jobtbl.JT_NPC_CUSTOM] = "npc_test", recompile your server do not use already used IDS/NAMES "JT_" is important make sure the client read the files you edited first!!!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< READ THIS run your server now you can add the script in your server prontera,150,150,0 script my_costum_npc 30000,{} OR prontera,150,150,0 script my_costum_npc JT_NPC_CUSTOM,{} reloadscript and you will see your npc
    1 point
×
×
  • Create New...