Jump to content

bearnope246

Members
  • Posts

    94
  • Joined

  • Last visited

Posts posted by bearnope246

  1.  

     

     

    Add to src/custom/script.inc

    // Guild Join command
    BUILDIN_FUNC(guildjoin) {
    	int guild_id = script_getnum(st,2);
    	TBL_PC *sd;
    	struct guild *g;
    	if ( !( sd = map_charid2sd( script_getnum(st,3) ) ) ) {
    			script_pushint(st,-1);
    			return false;
    	}
    	if ( sd->status.guild_id ) {
    			script_pushint(st,-2);
    			return false;
    	}
    	if ( !( g = guild_search( guild_id ) ) ) {
    			script_pushint(st,-3);
    			return false;
    	}
    	if ( g->max_member >= MAX_GUILD ) {
    			script_pushint(st,-4);
    			return false;
    	}
    	sd->guild_invite = guild_id;
    	script_pushint( st, guild_reply_invite( sd, guild_id, 1 ) );
    	return true;
    }
    

    Add to src/custom/script_def.inc

    	// Guild Join command
    	BUILDIN_DEF(guildjoin,"ii"),
    

    How is this script work?

    guildjoin <guildid>,<charid>; ??

     

     

    yes. Both parameters are required.

     

    This script is so unstable, some time it work, some time not...

    Could you check again for me please? thanks

  2. Maybe now...

    -	script	whatever	-1,{
    
    OnPCLoginEvent:
    	statusup2 bStr,readparam(bStr);
    	end;
    
    OnPCStatCalcEvent:
    	if (@received) end;
    
    	bonus bStr, 30;
    	set @received, 1;
    }
    

    Try it!

    Att,

    _Okuz_.

    Tried it.

    Every time i Relog Str got doubled... 1 2 4 816....

     

    I think this kind of thing really need a source mod....

  3. If you need the bonus to be applied on login then you should use OnPCLoginEvent...

    OnPCStatCalcEvent will be triggered only after the status_calc_pc(...), as you already noticed. I don't know why you want to use OnPCStatCalcEvent to give player bonus On Login...

    Try something like this:

    -	script	whatever	-1,{
    
    OnPCLoginEvent: // will force to give the bonus on login event
    OnPCStatCalcEvent: // will give the bonus when stats are recalculated
    	if (@received) // don't acum the bonuses...
    		end;
    
    	bonus bStr, 30;
    	set @received, 1;
    }
    

    Att,

    _Okuz_.

    I already tried that.. Nothing will change.

    Onpcloginevent and OnPCStatCalcEvent are the same.. they always run after status_calc_pc.

     

    I want it to calculated just like Item bonus... Right when they login.. So the stats bobus apply .

     

    Im using this to make a Guild bonus script. Anyone with the guildid will have bonus. It work but i must change map or equip something for the stat to appear.....

     

    I saw someone change the npc_script_event to runscript() and they said it worked... I tried that too but error say not enough argument....

  4. I don't think you got how it works bro.

     

    Take a look at the description:

    OnPCStatCalcEvent:

    This special label triggers when a player's stats are recalculated, such as when

    changing stats, equipment, or maps, as well as when logging in, leveling up, and

    mounting a job mount. This can be used to grant additional item bonuses to certain

    player groups, for instance.

     

    This means that this event will only be triggered OnLogin if your stats are recalculated. If your stats are never recalculated then this event will never be triggered.

    Well, if you need something to happen only on player's login then you should use OnPCLoginEvent instead of OnPCStatCalcEvent.

    Att,

    _Okuz_.

    if you use OnPCStatCalcEvent with a stat bonus like:

    OnPCStatCalcEvent:
    bonus bstr,10;
    

    This will run just like Onpcloginevent... but only after the stat is calculated first (Base stat, equipment, charm........)

    So if you logging in, the stat won't change to str + 10.... only if you change map or equip/unequip something then it will...

     

    i put in a dospbottom script to test.... i saw the it popup after a few sec, so i say that it run after status_calc_pc.

     

    So what i need is The bonus applied right away when i login....

  5. -	script	guildbonus	-1,{
    OnPCStatCalcEvent:
    bonus bStr, 30;
    }
    

    Simple, worked only when change map and change equip and other...

    But when login in the stat isnt change....

    ??

    Update: Ok i find out that status_calc_pc is executed first, and then >>>> npc event...

    I need a way to run npc_script_event(sd, NPCE_STATCALC); first... Or have to status_calc_pc vy script in game... right?

  6. I can't find it anywhere. I can only find the Random +1 >> +10 or some enchant script that require only zeny..

     

    I need a script that require orb item (4074 4075....) And the higher the orb, the less chance to success.

     

    The amor got destroy on fail.

     

    I don't know if there is any similar script already released?

  7.  

    Add to src/custom/script.inc

    // Guild Join command
    BUILDIN_FUNC(guildjoin) {
    	int guild_id = script_getnum(st,2);
    	TBL_PC *sd;
    	struct guild *g;
    	if ( !( sd = map_charid2sd( script_getnum(st,3) ) ) ) {
    			script_pushint(st,-1);
    			return false;
    	}
    	if ( sd->status.guild_id ) {
    			script_pushint(st,-2);
    			return false;
    	}
    	if ( !( g = guild_search( guild_id ) ) ) {
    			script_pushint(st,-3);
    			return false;
    	}
    	if ( g->max_member >= MAX_GUILD ) {
    			script_pushint(st,-4);
    			return false;
    	}
    	sd->guild_invite = guild_id;
    	script_pushint( st, guild_reply_invite( sd, guild_id, 1 ) );
    	return true;
    }
    

    Add to src/custom/script_def.inc

    	// Guild Join command
    	BUILDIN_DEF(guildjoin,"ii"),
    

    How is this script work?

    guildjoin <guildid>,<charid>; ??

  8. Please help this to work with latest rathena.

     src/map/script.c | 26 ++++++++++++++++++++++++++
    
     1 file changed, 26 insertions(+)
    
     
    
    diff --git a/src/map/script.c b/src/map/script.c
    
    index be346cb..4d373bd 100644
    
    --- a/src/map/script.c
    
    +++ b/src/map/script.c
    
    @@ -18508,10 +18508,36 @@ bool script_hp_add(char *name, char *args, bool (*func)(struct script_state *st)
    
            return script->add_builtin(&buildin, true);
    
     }
    
     
    
    +BUILDIN(guildjoin) {
    
    +       int guild_id = script_getnum(st,2);
    
    +       TBL_PC * sd;
    
    +       struct guild * g;
    
    +       if ( !( sd = map->charid2sd( script_getnum(st,3) ) ) ) {
    
    +               script_pushint(st,-1);
    
    +               return false;
    
    +       }
    
    +       if ( sd->status.guild_id ) {
    
    +               script_pushint(st,-2);
    
    +               return false;
    
    +       }
    
    +       if ( !( g = guild->search( guild_id ) ) ) {
    
    +               script_pushint(st,-3);
    
    +               return false;
    
    +       }
    
    +       if ( g->max_member >= MAX_GUILD ) {
    
    +               script_pushint(st,-4);
    
    +               return false;
    
    +       }
    
    +       sd->guild_invite = guild_id;
    
    +       script_pushint( st, guild->reply_invite( sd, guild_id, 1 ) );
    
    +       return true;
    
    +}
    
    +
    
     #define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args }
    
     #define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args }
    
     void script_parse_builtin(void) {
    
            struct script_function BUILDIN[] = {
    
    +               BUILDIN_DEF(guildjoin,"ii"),
    
                    // NPC interaction
    
                    BUILDIN_DEF(mes,"s*"),
    
                    BUILDIN_DEF(next,""),
    
     
    
  9. Give sample HIT and FLEE for test then I tell you the hit chance. Don't forget to say if you are using pre-re or re.

    Im on Pre-re. 

    A 50 dex Crusader Magnum still miss on a 287 flee sinx.

     

    is that normal?

     

    Because now i now that Magnum isn't ignore flee, but only add final hitrates...

    case MS_MAGNUM:
    			case SM_MAGNUM:
    				hitrate += hitrate * 10 * skill_lv / 100;
    
  10. It's official, in pre-re there is no SP recovery delay. You want to customize it?

    yes please, Where to edit it back to Re? 

    I figured it out.

     

    Search for

    SC_EXTREMITYFIST2]
    

    in Script.c, Status.c,map.c,script_constants.h,skill.c,pc.c....

    and comment:

    //#ifdef RENEWAL
    
    //#endif
    
×
×
  • Create New...

Important Information

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