Jump to content

Lord Ganja

Members
  • Content Count

    161
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Lord Ganja


  1. May I request this source coz I can't make it on my own.. :gawi:  :swt3:

     

    getequipbound <equipment slot>;

     

    It returns the bound type of the currently equipped item.

     

    0 - Equipment is not bounded

    1 - Account Bound

    2 - Guild Bound

    3 - Party Bound

    4 - Character Bound

     

    I will use this to my custom pvp room wherein when you killed a player you have a chance to steal his currently equipped item and I want the bound type to be the same.

    OnPCDieEvent:	for(.@i=0; .@i < 10; .@i++)	{		if( getequipisequiped(.@i) ) {			.@itemid = getequipid(.@i);			.@refine = getequiprefinerycnt(.@i);			.@card1 = getequipcardid(.@i,0);			.@card2 = getequipcardid(.@i,1);			.@card3 = getequipcardid(.@i,2);			.@card4 = getequipcardid(.@i,3);			if( getequipbound(.@i) )				.@bound = getequipbound(.@i);							if( rand(1,100) <= 20 ) {				delequip .@i;				if ( .@bound )					getitembound2 .@itemid,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@bound,killerrid;				else					getitem2 .@itemid,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,killerrid;			}		}	}end;

     

    Thanks in advance!


  2. Fixed this the other way around. Instead I created a command that checks if a player is killable or not.

     

    BUILDIN(iskillable){	TBL_PC* sd;	sd = script->rid2sd(st);	if( sd == NULL )		return true;// no player attached, report source	if( sd->state.killable )		script_pushint(st,1);	else		script_pushint(st,0);	return true;}

  3. i'm trying to create a custom script command that checks if the currently equipped item is  'tradable' or 'untradable(either it is 'bounded' or has the 'notrade' flag)'

    I comeup with my own script but it doesn't work. I don't know how can I declare the itemdb_cantrade :/

    I have hunch that it wouldn't work in the first place but I still tried LOL

    BUILDIN(getequipistradable){	int i = -1,num;	TBL_PC *sd;	num = script_getnum(st,2);	sd = script->rid2sd(st);	if( sd == NULL )		return true;	if( num > 0 && num <= ARRAYLENGTH(script->equip) )		i = pc->checkequip(sd,script->equip[num-1]);			if( i >= 0 && itemdb_cantrade(sd->inventory_data[i]) )	// I also tried this one if( i >= 0 && sd->inventory_data[i]->itemdb_cantrade )				script_pushint(st,1);	else		script_pushint(st,0);	return true;}

     

     

    The other one is a custom script command that checks if an item is 'tradable' or 'untradable(either it is 'bounded' or has the 'notrade' flag)'

    I don't know if it can possibly check if an item is 'bounded' when it is not equipped. Please let me know.

    but im trying to create a script works like 'getitemistradable <item_id>;' If it can't check bounded items that are not currently equipped, but can detect the 'notrade' flag, it would work fine for me..

     

    I comeup with this script but same problem from getequipistradable.

    BUILDIN(getitemistradable){	int item_id;	struct item_data *i_data;	item_id=script_getnum(st,2);	i_data = itemdb->exists(item_id);	if ( itemdb_cantrade(i_data) )		script_pushint(st,1);	else		script_pushint(st,0);	return true;}

     

     

    Anybody can help me to make this script work? Thanks in advance!


  4. Pretty sure everything can be made simply by NPC scripts. With mapflags you can enable no attack, and for #1 use OnPCLoginEvent:

     

    Setup your OnPCLoginEvent however you want, but none of this needs src imo

    The attack is attached per player. some players can attack while some can't. but i've already found it.

     

    on #1 how can i do it on npc script by OnPCLoginEvent if it was supposed to be triggered before a character logout?


  5. I need help to locate this part of source that triggers:

     

    1) After clicking Character Select Button

    - I was about to create an npc script that is triggered AFTER clicking Character Select Button but BEFORE going to the Character Select Screen.

     I just need to know which one and which part of the script is triggered right after you click the Char Select Button.

    - What I will do here is like a confirmation message before a player logged out or go to the char select screen.

     

    2) Before a player attack

    - I was also about to create an npc script that is triggered when you click or about to attack anything.

    - What I will also do here is, if a variable is equals to 1, the player can't attack anything.

    - It's like a restriction so player can't attack anything.

     

     

    I just need to know which part of the source triggers this. Thanks in advance!

     

    EDIT:

    I already found the #2 question 'Before a player attack' at battle.c..


  6. Can anybody help me do this?

     

    I wanted to create a killable command by not using it as atcommand since my custom npc script will repeatedly use @killable and I got no way to detect if it's 'on' or 'off'.

     

    I was thinking to make a custom_script command with this format ==>  killable <"character name/id">,<on|off>;

     

    So even if I repeatedly use the script like killable "Lord Ganja",0; It won't turn on..

     

    this is from atcommand.c , but i don't have any idea how can I do it on script.c.. Any help please? Thanks in advance! :)

    /*========================================== * @killable by MouseJstr * enable other people killing you *------------------------------------------*/ACMD(killable) {	sd->state.killable = !sd->state.killable;	if(sd->state.killable)		clif->message(fd, msg_fd(fd,242));	else {		clif->message(fd, msg_fd(fd,288));		map->foreachinrange(atcommand->stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);	}	return true;}

     

     


  7. I'm currently using 'addtimer' attach to a character that reduces a permanent account variable every minute.

     

    I was just wondering if the timer automatically resets and stop when the player logged out? or do I have to use 'deltimer' attach on OnPCLogoutEvent?

     

    Here's the script that im using:

    -	script	pk_karma_system	-1,{OnPCLoginEvent:	if( #pk_karmasystem_pts < 1 )end;	addtimer 60000,"pk_karma_system::OnPointReduce";    end;	OnPointReduce:    if( #pk_karmasystem_pts < 1 )        deltimer "pk_karma_system::OnPointReduce";    else       {        #pk_karmasystem_pts -= 1;        addtimer 60000,"pk_karma_system::OnPointReduce";       }	end;}

     

     


  8. Okay, I intentionally added an item with less than overcharged selling price.

    Now I was thinking if I can get rid of the warnings that appear by adding the item id to the source so it won't show the warning even if these 'ids' are less than overcharged selling price.

     

    For example, if I set the id 607 less than overcharged selling price. I'll add the id 607 to the src so the warning won't appear.

     

     ' if( type == SHOP && value*0.75 < id->value_sell*1.24 && itemid != 607) { <== This is just my idea for excluding items id's.

     

     

    How do I do that? :hmm:  Thanks in advance.

     

     

    this is the part in npc.c 

    if( type == SHOP && value*0.75 < id->value_sell*1.24 ) {	// Exploit possible: you can buy and sell back with profit	ShowWarning("npc_parse_shop: Item %s [%d] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) in file '%s', line '%d'.n",		id->name, nameid, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));	if (retval) *retval = EXIT_FAILURE;}

     


  9. I wanted to add the 'blue animation' to my Fish Slice.

    The blue animation that appears when consuming Yggdrasil Berry.

     

    Where can I edit the files so when consuming fish slice the blue animation will also appear?

     

    Is this the right place where to post this? Please just move this if i'm wrong. I just thought that src has to do with this, not client side files..

     

    Thanks in advance!

     

    post-1008-0-79011100-1440482700_thumb.png

     

     

    EDIT: Nvmind, figured it out. I can use specialeffect2. xD


  10. Yes you need to change,

    also for source , wherever you see this

     

    if ( skillid >= 3000 && skillid < 4000 ) break; 

    Change to

     

    if ( skillid >= start_id && skillid <= end_id ) break; 

    where start_id = the first skill_id(of CUSTOM_setpos) you set, and end_id is last skill_id(of CUSTOM_setpos) you set

    Alright. Thanks @@Dastgir.. Anyway can you tell me why the src doesn't return mobs/monsters ids?

     

    @useskilltarget doesn't work well on mobs/monsters. It returns numbers but not the ID of mobs/monsters you casted the skill.

    post-1008-0-41325100-1440418361_thumb.png


  11. I've added this OnPCUseSkillEvent. Now do I need to change it's skill id 3001 and 3002 since kagerou and oboro already used that skill id?

    Or Can I just leave it as it is?

     

     

    From Eathena:

    3000,15,6,1,0,0,0,9,1,no,0,0x0,0,none,0,		CUSTOM_damage,CUSTOM_damage3001,15,6,16,0,0x1,0,9,1,no,0,0x0,0,none,0,		CUSTOM_nodamage,CUSTOM_nodamage3002,15,0,2,0,0,0,9,0,no,0,0x0,0,none,0,		CUSTOM_setpos,CUSTOM_setpos

     

     

    From Hercules:

    // Kagerou & Oboro3001,0,6,4,0,0,0,1,1,no,0,0,0,none,0,		KO_YAMIKUMO,Yamikumo3002,0,0,0,0,0,0,5,0,no,0,0,0,weapon,0,		KO_RIGHT,Right Hand Mastery 

     

     

     

     

     

    Thanks!  :no1:

     

     

     

     

     


  12. I've added the patch OnPCUseSkillEvent and modified GoWarpDelay(which only triggers on players vs players)

     

    Now im trying to tick the gowarpdelay using an npc script triggered by OnPCUseSkillEvent. is that possible?

     

    Example:

    OnPCUseSkillEvent:     if( @useskilltarget == 1002 ) { // If a skill is used on poring the gowarpdelay will tick                      // What should I put here to tick the gowarpdelay?     }
     
    Thanks in advance!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.