Jump to content

sader1992

Content Moderator
  • Posts

    1676
  • Joined

  • Last visited

  • Days Won

    71

Posts posted by sader1992

  1. no not in the config but you can edit the script body directly 

    above

    mes "Selected Item [" + getequipname(.@eq) + "]";

    you can add something like this

    switch(getequipid(.@eq)){
    	case xxxx:
    		
    		break;
    
    }

    and edit those variables

    .@zeny = int of the zeny cost
    .@cashpoint = int of the cashpoints cost
    .@costumpoint = int of the point cost
    .@item = array of the item id costs
    .@amount = array of the items amounts cost

    for example:

    i want Academy Completion Hat [1]  to only cost 500 zeny

    and Amistr Cap [0] to cost 7 red potions and 3 blue potion and 2000 zeny

    it would be like this

    switch(getequipid(.@eq)){
    	case 5407: //Academy Completion Hat [1]
    		.@zeny = 500;// make zeny cost to 500
    		.@cashpoint = 0;// make cashpoint cost to 0
    		.@costumpoint = 0;//make point cost to 0
    		deletearray(.@item);//clear the item carray cost
    		deletearray(.@amount);//clear the item amount cost
    		break;
    	case 5766: //Amistr Cap [0]
    		.@zeny = 2000;// make zeny cost to 2000
    		.@cashpoint = 0;// make cashpoint cost to 0
    		.@costumpoint = 0;//make point cost to 0
    		deletearray(.@item);//clear the item carray cost
    		deletearray(.@amount);//clear the item amount cost
    		setarray .@item,501,505;// add red poiton and blue potion
    		setarray .@amount,7,3;// add the amount of red potion and blue potion
    		break;
    }

    with that those two items will ignore any all the config cost and apply whats written here 

     

  2. what are item A and B in the script ? I see there is multiple items checked, not only 2

    OnInit should be at the end of the script, or else each time the player will lick on the npc OnInit would run, you can just remove the OnInit event and use .@var instead , it's better to stay away from events because you are duplicating the npc

    there is no .temp_array defined in the script , I assume you wanted .itemid

    you should use 1 chance variable if you want the player to have 10% chance to get one of the items in the array just use if(rand(100) <= 10){//get item whatever }

    keep in mind that countitem() == 1 means the player must have only 1 , no more no less , if you want don't care how many the player have , just remove the "== 1"

    the "else" has no use snice the script will end if the "if" was true

    I suggest you use a UNIQUE NPC NAME as a main

    if you click on the NPC and nothing happens you would get an error code in the Console , read it and you would know why nothing happens when you click it.

     

    I am not sure how you want the npc but here is an optimize to the script

    -	script	::TALL_GRASS_MAIN	-1,{
    	setarray .@itemid[0], 40062,40063,40064,40065,40066;
    	.@Chance = 10;
    	
    	mes "=== Select Tools ===";
    	switch(select("- Stone Blade:- Bone Blade:- Cancel")) {
    		clear;
    		case 1:
    			if (rentalcountitem(40024) == 1){
    				if(countitem(40044) == 1){
    					getitem 40006, 1;
    					getitem 40008, 1;
    					end;
    				}
    				if(countitem(40067) == 1){
    					if(rand(100) <= .@Chance){
    						getitem .@itemid[rand(getarraysize(.@itemid))], 1;
    					}
    					getitem 40006, 1;
    					end;
    				}
    			}
    			mes "Stone Blade is needed.";
    			close;
    		case 2:
    			if (rentalcountitem(40058) == 1 && countitem(40044) == 1 ){
    				getitem 40006, 1;
    				getitem 40008, 1;
    				end;
    			}
    			mes "Bone Blade is needed.";
    			close;
    		case 3:
    			mes "Gathering Cancel";
    			close;
    	}
    end;
    }
    // Duplicates
    //============================================================
    neko_isle,75,122,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new11	666
    new_1-3,111,73,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new12	666
    new_1-3,115,71,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new13	666
    new_1-3,119,71,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new14	666
    new_1-3,123,71,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new15	666
    new_1-3,127,71,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new16	666
    new_1-3,131,72,6	duplicate(TALL_GRASS_MAIN)	Tall Grass#new17	666

     

    if that's not what you want , you might want to follow up with more details so people can help you with the script.

  3. On 8/6/2023 at 9:42 AM, QueenPH said:

    @Winterfox The 2nd link on your comment is gone ... why edit it??
    her comment has a 2nd link on it if you do a back read...why edit it if there is no promblem on his comment

    this is the comment that was gone on her message

    "Anyway, you can download the illustrations here: https://anonfiles.com/dbn01d68z2/EP_18_Illustrations_7z "

    I did check the link and it's safe

     

    Please stay on-topic , no need to argue about this anymore, he was just trying to help you even thought he didn't know how to do it

    and please no more links to download websites .

  4. On 3/2/2023 at 6:25 PM, hendra814 said:

    if by equipment location is it possible?

    instead of

    .@gid = <Group ID>;

    Use

    .@gid = .@eq;

    now this is the group ID for each location

    EQI_ACC_L (0)             - Accessory 1
    EQI_ACC_R (1)             - Accessory 2
    EQI_SHOES (2)             - Footgear (shoes, boots)
    EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
    EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
    EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
    EQI_HEAD_TOP (6)          - Upper Headgear
    EQI_ARMOR (7)             - Armor (jackets, robes)
    EQI_HAND_L (8)            - Left hand (weapons, shields)
    EQI_HAND_R (9)            - Right hand (weapons)
    EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
    EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
    EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
    EQI_COSTUME_GARMENT (13)  - Costume Garment
    EQI_AMMO (14)    		  - Arrow/Ammunition
    EQI_SHADOW_ARMOR (15)     - Shadow Armor
    EQI_SHADOW_WEAPON (16)    - Shadow Weapon
    EQI_SHADOW_SHIELD (17)    - Shadow Shield
    EQI_SHADOW_SHOES (18)     - Shadow Shoes
    EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
    EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

     

    • Upvote 1
  5. On 3/1/2023 at 8:55 AM, aoshinho said:

    it's possible remove necessity of manually insert the item ID on item list? or just bypass it?
    i tryed to create one function to auto add the item selected when selected by player in the item list array but i'ts work just to change collor of item in menu list
    because i want to use that NPC in any item

    You can try replacing lines 45 to 49 with just .@gid = <Group ID>;

     

    like this

    remove 

    			if(inarray(.item_list,.@id) == -1){
    				mes "Sorry , I cannot deal with this item!";
    				end;
    			}
    			.@gid = .it[.@id];

    add

    //.@gid = <Group ID>;
    .@gid = 1;

    this should make all the items group id 1

  6. On 2/27/2023 at 8:23 PM, aoshinho said:

    Hi @sader1992

    i tryed to add all hats ID's in group 1 but not working
    emulator send me the error: 
    [Error]: script:run_script_main: infinity loop !
    [Debug]: Source (NPC): RandomOption at prontera (147,171)
    it's work for allowed item list but now i can't add option in any item

     

    to fix this error on load you need to add

    freeloop(1);

    after

    OnInit:

    also You might need to add it after the start of the npc

    before

    disable_items;

     

    this because the list of items you have is too long.

  7. also you can just redirect to the npc instead of using a duplicate

    for example:

    prontera,263,209,6	duplicate(Deathmatch PvP Warper)	DM PvP Warper#prt02	823

    to

    prontera,263,209,6	script	DM PvP Warper#prt02	823,{ doevent("Deathmatch PvP Warper:OnTalk"); }

    and add OnTalk: at the start of the original npc

    • Upvote 1
    • Love 1
  8. On 4/12/2022 at 3:02 PM, Hitman Monkey said:

    wow! what a  information, this is some high level information right there... thank you for your suggestion, we dont know that we can use search engine what a surprise, thanks capt. obvious!!! wish you goodluck.

    well, you posted your topic in the forum issues section , so i think his assumption that you don't know how to use the search engine is reasonable ?

    • Upvote 2
  9. add

    if(playerattached())

    before

    announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;

    like this

    if(playerattached()) announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;

     

    or just remove

    announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;

    because as I see there is no place calling the OnStop event while a character is attached.

  10. 7 hours ago, AinsLord said:

    im using this sir @sader1992 at 1st it was working fine then several days after when i tried to put options after selecting

    proceed this happens it hangs cant move cant even TP nor chat i need to reboot the whole VPS to bring it back

    i dunno what happen i didnt change any codes or add anything

    i just created another NPC of it for addition ID option i forgot that ID 1 has the same item on the 

    other NPC that has ID 2 like this

    NPC 1

    //Creating Group id 1 , with Hat items inside.
    	AddGroup(1,2220,2221,2222,2223);

    NPC 2

    //Creating Group id 1 , with Hat items inside.
    	AddGroup(2,2223);

    will that affect this 

    DO NOT REUSE THE SAME ITEM ID IN DIFFERENT GROUP!

    image.png.4dcb8aabb991ef19d9f871f4f9bb977c.png

    The groups/ids are per npc , you can use the same item in a different npc copy however you cannot use the same item in the same npc in a different group.

     

    also i need more information about when this happen to you , at any step of the npc ?

    the image you provided the next line is just select , so I don't think this where you are getting the issue

×
×
  • Create New...