Jump to content

pajodex

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by pajodex

  1. 41 minutes ago, domez86 said:

    guys but what is the script that to even just click an NPC you have to have the third class? thank you.

    ex:

    ------------------------------------------------------------------------------

    prontera,150,150,4    script    npc    92,{

    mes "Hello";
    close;

    }
    -------------------------------------------------------------------------------

    clickable only by the third classes, thanks.

    prontera,150,150,4    script    npc    92,{
    switch(Class) {
    	case Job_Rune_Knight:
    	case Job_Royal_Guard:
    	case Job_Warlock:
    	case Job_Sorcerer:
    	case Job_Ranger:
    	case Job_Minstrel:
    	case Job_Wanderer:
    	case Job_Arch_Bishop:
    	case Job_Sura:
    	case Job_Mechanic:
    	case Job_Genetic:
    	case Job_Guillotine_Cross:
    	case Job_Shadow_Chaser:
    	case Job_Kagerou:
    	case Job_Oboro:
    		break;	// goes to `this happens`
    	default:
    		end; // if not listed above, ends npc conversation
    }
    mes "Hello";	// this happens
    close;
    }

    im sure there was a simplified one, EAJ_THIRD? not sure but that will work.

     

  2. 5 hours ago, Brizyous said:

    Thanks! it worked but the arguments replace each other generating a 1 option menu, what i want is if the players have 4 items, they get a 4 option menu, if they have 2 items, they get 2 options, corresponding to the item they have.
    Tried this, but i get errors:
     

    
    switch(select((countitem(34996) >= 1)?"Insertar Ticket Clase C" , (countitem(34995) >= 1)?"Insertar Ticket Clase B" , (countitem(34994) >= 1)?"Insertar Ticket Clase A" , (countitem(34993) >= 1)?"Insertar Ticket Clase S" , "Cancelar")) {
    
    	case 1:
    	mes "ticket 1";
    	close;
    	end;
    	case 2:
    	mes "ticket 2";
    	close;
    	end;
    	case 3:
    	mes "ticket 3";
    	close;
    	end;
    	case 4:
    	mes "ticket 4";
    	close;
    	end;
    	case 5:
    	close;
    	end;
    
    }

     

    switch(select((countitem(34996))?"Insertar Ticket Clase C":"" , (countitem(34995)) ? "Insertar Ticket Clase B":"", (countitem(34994)) ? "Insertar Ticket Clase A":"", (countitem(34993)) ? "Insertar Ticket Clase S":"", "Cancelar"))

     

    • Upvote 1
    • Love 1
  3. 5 hours ago, Brizyous said:

    Two questions about conditions:


    Conditions for labels: Its possible to add a condition to pass to a Label? like, a condition of groupid 1 for OnPCDieEvent to trigger in the player. (I know i can do it inside the label, but i cant make it work otherwise).


    Condition inside a menu: IDK how o do it, tried this(i apologize if its stupid xD, i am very new in scripting) :

    
    switch(select("+((countitem(34996) >= 1)"wow you have item 34996")+":"some text")) { }

    its supposed to print case 1 only if the player has the item, otherwise it should only print case 2.

    switch(select( (countitem(34996) >= 1)? "wow you have item 34996":"some text")) { }
    • Upvote 1
  4. 48 minutes ago, spawnn said:

    announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname( .@item )+"] from a Custom Box.",0;

    add something like..

    announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname( .@item )+"("+.@item+")] from a Custom Box.",0;

     

    • Upvote 1
  5. 1 hour ago, DaemonSpade said:

    thanks for encouragement and giving idea sir ?

    I just read your code right now, I think there is a better way to do that..  (without using SQL)

    just few notes :

    1. Use script commands available at doc/script_commands.txt such as *getguildmaster, *getcharid, *strcharinfo, *attachrid..
    2. You are using "$" as variable.. read in script_commands the functions of the variables.. you can just use ".@" instead.. ".@var$"
    3. Since I still didnt check Euphy's script, I assume it ran in a loop.. 
    	.@aid[.@j] -> already contains account ID of something?
    	you can run it using *attachrid sample:
    
    	attachrid .@aid[.@j]; // attaches the .@aid
    	getitem 501, 10;	// gets the item..
    	detachrid; // detaches the rid 

    As they say, there is still room for improvements.. I constantly learn from my mistakes and being pointed out is not a bad thing.. it means new thing you will learn which will improve your skills a lot.

  6. 2 hours ago, Nero said:

    Is there anyway to remove also the sprite view upon deleting the item in sql?

    Yes, check this part:

    table : `char`
    columns : `head_top` , `head_mid` , `head_bottom`
    Quote

    or is there any scripts that can be done via onlogin to automatically check and remove the player's costume garment sprite view before entering the game?

    I don't think it is possible.. Never tried it tho

  7. 1 hour ago, wwshakioww said:

    But it only moves once at first, then it does not work because there is no "Attached" connection

    Yeah, actually I did not give you off the full code, I want you to learn how to do it yourself.

    TIP: read about *getmapxy 

  8. 4 minutes ago, DaemonSpade said:

    it doesnt work

    if you just copy and pasted it, of course it wont.. I said :

    On ‎1‎/‎28‎/‎2019 at 3:40 PM, pajodex said:

    That is just a psudo-code, meaning you still have to configure it to make it work with euphy's script (which I obviously didn't check /heh )

     

    • MVP 1
  9. 1 hour ago, wwshakioww said:

    I wonder how it is possible?

    Spoiler
    
    	while ( .time < 60*10 ) { // set to 10 mins cuz 60 sec * 10 = 10 mins
    		getmapxy(.@map$, .@x, .@y, UNITTYPE_PC);	// get character's map xy -- im not sure if still using UNITTYPE_ or BL_
    		npcspeed 200;	// set npc walking speed
    		npcwalkto .@x, .@y;	// npc walks to the coordinates of the player
    		.time++;
    		sleep 1000;
    	}

     

     untested but it should work..

    if you want to learn more.. check doc/script_command.txt.

    Spoiler

     

    
    *npcspeed <speed value>;
    *npcwalkto <x>,<y>;
    *npcstop;
    
    These commands will make the NPC object in question move around the map. As they
    currently are, they are a bit buggy and are not useful for much more than making
    an NPC move randomly around the map.
    
    'npcspeed' will set the NPCs walking speed to a specified value. As in the
    @speed GM command, 200 is the slowest possible speed while 0 is the fastest
    possible (instant motion). 100 is the default character walking speed.
    
    'npcwalkto' will start the NPC sprite moving towards the specified coordinates
    on the same map it is currently on. The script proceeds immediately after the
    NPC begins moving.
    
    'npcstop' will stop the motion.
    
    While in transit, the NPC will be clickable, but invoking it will cause it to
    stop moving, which will make its coordinates different from what the client
    computed based on the speed and motion coordinates. The effect is rather
    unnerving.
    
    Only a few NPC sprites have walking animations, and those that do, do not get
    the animation invoked when moving the NPC, due to the problem in the NPC walking
    code, which looks a bit silly. You might have better success by defining a job-
    sprite based sprite id in 'db/mob_avail.txt' with this.

     

     

  10. how about let then use @storage command and for the buff, there is always item scrolls?

    If I am not mistaken, there are pets that can give player buffs.. im not sure but I think there was.. (never tried it).

     

    PS: There are lots of healer / buffer npcs here. you can look them up at the search bar.

  11. 3 hours ago, DaemonSpade said:

    in this line how can i make it divided into two category

    getitem for guild master only and getitem for members only ? 

    im using two boxes for woe prize guild master box ID 45000 and guild member box ID 45001

    i want the system check if the player is a guild master then give the guild master box else if the player is a guild member give the guild member box ? 

    
    for(set .@k,0; .@k<getarraysize(.Reward); set .@k,.@k+2)
    getitem .Reward[.@k], .Reward[.@k+1], .@aid[.@j];

     

    I assume you have basic script knowledge..

    	if (strcharinfo(0) == getguildmaster( getcharid(2) )) // checks if the player interacting the npc is a guild master...
    		getitem 45000, 1;	// if so... guild master reward is given here
    	else 
    		getitem 45001, 1;	// if not.. guild member reward is given here

    That is just a psudo-code, meaning you still have to configure it to make it work with euphy's script (which I obviously didn't check /heh )

    • MVP 1
  12. 15 hours ago, Emonizer08 said:

    sir no need for that no points will gain outside the said map "aldeg_cas03" proven and tested thank you

    True but if there is no active woe, it will still count... I don't see the point of making this script if you don't add the agitcheck()

     

    -	script	asdfg	-1,{
    OnPCKillEvent:
    	setarray .@map$, "aldeg_cas01",	"aldeg_cas02"; // maps
    	if ( getcharid(3) == killerrid || !agitcheck() ) end; // auto end if player kills himself and also if woe is not active
    	for ( .@i = 0; .@i < getarraysize(.@map$); .@i++) {
    		if ( strcharinfo(3) == .@map$[.@i] ) {
    			#WOE_POINTS++;
    			dispbottom "Gained 1 WoE Points. Total : "+ #WOE_POINTS +" WoE Points.";
    		}
    	}	
    	end;
    }

     

    • Like 1
  13. 47 minutes ago, thunginamue said:

    HELP PLEASE Can i Request for a Script That Summons WORLD BOSS when 20k-100k monsters is killed then Announce its Arrival then Summons monsters in all maps like 10 to 20 of them?

    -	script	asdasdasd	-1,{
    OnNPCKillEvent:	
    	
    	++$mobkillcount; // mob kill counter
    	
    	if ( $mobkillcount > 20000 ) { // triggers when mob counter reaches 20k
    		
    		$mobkillcount = 0; // reset the counter to 0
    		
    		.@mobid = 1001; // MOB ID of the monster
    		
    		setarray .@map$, // list the maps you wish to spawn the mobs
    			"prontera",
    			"prt_fild01",
    			"prt_fild02";
    			
    		// summons mob id to the maps listed
    		for ( .@i = 0; .@i < getarraysize(.@map$); ++.@i) {
    			monster .@map$[.@i], 0, 0, "--ja--", .@mobid, rand(10,20); // random of 10 -  20 mobs spawns
    		}
    		
    		announce "World Bosses has invaded the server!", bc_all; // announce
    	}
    	end;
    }

    not tested but you should get the idea

    • MVP 1
  14. ---------------------------------------
    
    *getinventorylist {<char_id>};
    
    This command sets a bunch of arrays with a complete list of whatever the
    invoking character has in their inventory, including all the data needed to
    recreate these items perfectly if they are destroyed. Here's what you get:
    
    @inventorylist_bound[]             - the bound type of the items (see BOUND_* constants)
    
    This could be handy to save/restore a character's inventory, since no other
    command returns such a complete set of data, and could also be the only way to
    correctly handle an NPC trader for carded and named items who could resell them
    - since NPC objects cannot own items, so they have to store item data in
    variables and recreate the items.
    
    Notice that the variables this command generates are all temporary, attached to
    the character, and integer.
    
    Be sure to use @inventorylist_count to go through these arrays, and not
    'getarraysize', because the arrays are not automatically cleared between runs
    of 'getinventorylist'.
    
    ---------------------------------------

     

  15. On ‎10‎/‎13‎/‎2018 at 6:29 PM, Rook1es said:

    Hello. i got error on this line

    .red = bg_create ( strnpcinfo(4), 251, 149, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDie" );

    .blue = bg_create ( strnpcinfo(4), 47, 149, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDie" );

     

    how to fix this thanks

     

    not helpful, post your console error..

     

    but im guessing you are using either an old or wrong emulator..

  16. *setlook <look type>,<look value>{,<char_id>};
    *changelook <look type>,<look value>{,<char_id>};
    
    'setlook' will alter the look data for the invoking character. It is used
    mainly for changing the palette used on hair and clothes: you specify which look
    type you want to change, then the palette you want to use. Make sure you specify
    a palette number that exists/is usable by the client you use.
    'changelook' works the same, but is only client side (it doesn't save the look value).
    
    	// This will change your hair color, so that it uses palette 8, what ever your
    	// palette 8 is, your hair will use that color
    
    	setlook LOOK_HAIR_COLOR,8;
    
    	// This will change your clothes color, so they are using palette 1, whatever
    	// your palette 1 is, your clothes will then use that set of colors.
    
    	setlook LOOK_CLOTHES_COLOR,1;
    
    Here are the possible look types:
    
     LOOK_BASE - Base sprite
     LOOK_HAIR - Hairstyle
     LOOK_WEAPON - Weapon
     LOOK_HEAD_BOTTOM - Head bottom
     LOOK_HEAD_TOP - Head top
     LOOK_HEAD_MID - Head mid
     LOOK_HAIR_COLOR - Hair color
     LOOK_CLOTHES_COLOR - Clothes color
     LOOK_SHIELD - Shield
     LOOK_SHOES - Shoes
     LOOK_BODY2 - Body style
    
    Whatever 'shoes' means is anyone's guess, ask Gravity - the client does nothing
    with this value. It still wants it from the server though, so it is kept, but
    normally doesn't do a thing.
    
    Only the look data for hairstyle, hair color and clothes color are saved to the
    char server's database and will persist. Body style will also persist if 'save_body_style'
    configuration is enabled in '/conf/battle/client.conf'. The rest freely change as the character
    puts on and removes equipment, changes maps, logs in and out and otherwise you
    should not expect to set them. In fact, messing with them is generally
    hazardous, do it at your own risk, it is not tested what will this actually do -
    it won't cause database corruption and probably won't cause a server crash, but
    it's easy to crash the client with just about anything unusual.
    
    However, it might be an easy way to quickly check for empty view IDs for
    sprites, which is essential for making custom headgear.
    
    Since a lot of people have different palettes for hair and clothes, it's
    impossible to tell you what all the color numbers are. If you want a serious
    example, there is a Stylist script inside the default rAthena installation that
    you can look at: 'npc/custom/stylist.txt'

     

×
×
  • Create New...