Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by AnnieRuru

  1. 	setarray .@min[1],
    				1,	// Hair style 0 crashed my client last time I tested.
    				0,
    				0;

    hmm... just tested hair style 0 works in my hexed client
    perhaps its different in every client version
    or maybe you just missing that palette

    		if(!.@opt) {
    			stand;
    			getmapxy .@m$,.@x,.@y,UNITTYPE_PC;
    			unitwalk getcharid(3),.@x,.@y - 1;
    		}

    hmm ? rathena seems to be missing setunitdir


    ok try 1 more time

    //===== rAthena Script ======================================
    //= Stylist npc
    //===== By: ==================================================
    //= AnnieRuru
    //= original by Euphy
    //===== Current Version: =====================================
    //= 1.3
    //===== Compatible With: ===================================== 
    //= rAthena 2019-01-24
    //===== Description: =========================================
    //= stylist npc
    //===== Topic ================================================
    //= https://rathena.org/board/topic/118030-help-restriction-stylist-npc/
    //===== Additional Comments: =================================  
    //= 1 more time, this time use CSV method, this method is understood by many
    //============================================================
    
    prontera,165,176,1	script	Stylist	HIDDEN_NPC,{
    	.@choose = select( "Hair style", "Hair color", "Cloth color" ) -1;
    	.@lookpart = .@part = .look[.@choose];
    	if ( BaseClass == Job_Summoner )
    		.@part += Job_Summoner;
    	.@revert = .@i = inarray( getd(".list"+ .@part), getlook( .@lookpart ) );
    	while ( true ) {
    		setlook .@lookpart, getd(".list"+ .@part +"["+ .@i +"]");
    		dispbottom "This is style #"+ getd(".list"+ .@part +"["+ .@i +"]") +".";
    		.@next = ( .@i == .maxindex[.@part] )? 0 : .@i+1;
    		.@previous = ( .@i == 0 )? .maxindex[.@part] : .@i-1;	
    		switch ( select( " ~ Next (^0055FF"+ getd(".list"+ .@part +"["+ .@next +"]") +"^000000)", " ~ Previous (^0055FF"+ getd(".list"+ .@part +"["+ .@previous +"]") +"^000000)", " ~ Jump to...", " ~ Revert to original (^0055FF"+ getd(".list"+ .@part +"["+ .@revert +"]") +"^000000)" ) ) {
    		case 1: .@i = .@next; break;
    		case 2: .@i = .@previous; break;
    		case 3:
    			dispbottom "Choose a style between 0 - "+ .maxstyles[.@part] +".";
    			input .@num;
    			.@j = inarray( getd(".list"+ .@part), .@num );
    			if ( .@j == -1 )
    				dispbottom "That style is unavailable";
    			else
    				.@i = .@j;
    			break;
    		case 4: .@i = .@revert;
    		}
    	}
    	end;
    OnInit:
    //	.list$[LOOK_HAIR] = "0-5,11-18,20-23";
    	.list$[LOOK_HAIR] = "0-"+ getbattleflag("max_hair_style");
    	.list$[LOOK_HAIR_COLOR] = "0-"+ getbattleflag("max_hair_color");
    	.list$[LOOK_CLOTHES_COLOR] = "0-"+ getbattleflag("max_cloth_color");
    
    	.list$[Job_Summoner + LOOK_HAIR] = "0-"+ getbattleflag("max_hair_style");
    	.list$[Job_Summoner + LOOK_HAIR_COLOR] = "0-"+ getbattleflag("max_hair_color");
    	.list$[Job_Summoner + LOOK_CLOTHES_COLOR] = "0-1";
    
    	freeloop true;
    	setarray .look[0], LOOK_HAIR, LOOK_HAIR_COLOR, LOOK_CLOTHES_COLOR,
    		Job_Summoner + LOOK_HAIR, Job_Summoner + LOOK_HAIR_COLOR, Job_Summoner + LOOK_CLOTHES_COLOR;
    	for ( .@i = 0; .@i < 6; ++.@i ) {
    		deletearray .@array$;
    		.@index = 0;
    		explode( .@array$, .list$[.look[.@i]], "," );
    		.@size = getarraysize(.@array$);
    		for ( .@j = 0; .@j < .@size; ++.@j ) {
    			if ( compare( .@array$[.@j], "-" ) ) {
    				explode( .@range$, .@array$[.@j], "-" );
    				.@min = atoi(.@range$[0]);
    				.@max = atoi(.@range$[1]);
    				.@range = .@max - .@min +1;
    				for ( .@k = 0; .@k < .@range; ++.@k )
    					setd ".list"+ .look[.@i] +"["+( .@index++ )+"]", .@min + .@k;
    			}
    			else
    				setd ".list"+ .look[.@i] +"["+( .@index++ )+"]", atoi( .@array$[.@j] );
    		}
    		.maxindex[.look[.@i]] = .@index -1;
    		.maxstyles[.look[.@i]] = getd(".list"+ .look[.@i] +"["+( .@index -1 )+"]");
    	}
    	end;
    }

     

    • Like 1
  2. On 1/22/2019 at 7:19 AM, n0tttt said:

    Then you add the cards in item_stack.txt

    
    4001,1,1  // Poring Card

     

    This way you can't insert the card more than X times. It's better than having a division or nullifying the effects since the player doesn't waste cards.

    wait, if you do like that, I can't carry more than 1 Poring Card

    maybe introduce a new bit-mask &16 or something ...

  3. new trick learned, but I doubt it

    -	script	sfkjsf	FAKE_NPC,{
    OnInit:
    //	setarray .event$, "guild_vs1", "guild_vs2", "guild_vs3", "guild_vs4", "guild_vs5";
    	setarray .event$, "xmas_dun01", "xmas_dun02", "xmas_fild01", "xmas_in"; // xmas
    
    	.event_size = getarraysize( .event$ );
    
    	.event_implode$ = implode( .event$, " " );
    	end;
    OnNPCKillEvent:
    //	Method 1
    //	if ( strcharinfo(3) == "guild_vs1" || strcharinfo(3) == "guild_vs2" || strcharinfo(3) == "guild_vs3" || strcharinfo(3) == "guild_vs4" || strcharinfo(3) == "guild_vs5" )
    	if ( strcharinfo(3) == "xmas_dun01" || strcharinfo(3) == "xmas_dun02" || strcharinfo(3) == "xmas_fild01" || strcharinfo(3) == "xmas_in" )
    		dispbottom "say 1";
    
    //	Method 2
    	for ( .@i = 0; .@i < .event_size; ++.@i )
    		if ( strcharinfo(3) == .event$[.@i] )
    			dispbottom "say 2";
    
    //	Method 3
    	if ( countstr( .event_implode$, strcharinfo(3) ) )
    		dispbottom "say 3"; // this method can trigger on the xmas map
    
    //	dispbottom "say 3"+.event_implode$+ strcharinfo(3);
    	end;
    }

    just tested, for example, if the script supposed to only run in xmas dungeon, but it can trigger on xmas map, because the "xmas_dun01" contain "xmas"
    same for yuno_fild01 contain yuno
    payon_in01 contain payon
    prt_cas_q contain prt_cas

     

    EDIT: I forgot I did this before LMAO !!
    https://rathena.org/board/topic/91826-special-party-warper/#comment-241434
    https://rathena.org/board/topic/91723-please-help-this-script-about-mac_address/?do=findComment&amp;comment=240887
     

    ok so its like this ... add "#"+ strcharinfo(3) +"#" like this

    -	script	sfkjsf	FAKE_NPC,{
    OnInit:
    //	setarray .event$, "guild_vs1", "guild_vs2", "guild_vs3", "guild_vs4", "guild_vs5";
    	setarray .event$, "xmas_dun01", "xmas_dun02", "xmas_fild01", "xmas_in"; // xmas
    
    	.event_size = getarraysize( .event$ );
    
    	.event_implode$ = "|"+ implode( .event$, "|" ) +"|";
    	end;
    OnNPCKillEvent:
    //	Method 1
    //	if ( strcharinfo(3) == "guild_vs1" || strcharinfo(3) == "guild_vs2" || strcharinfo(3) == "guild_vs3" || strcharinfo(3) == "guild_vs4" || strcharinfo(3) == "guild_vs5" )
    	if ( strcharinfo(3) == "xmas_dun01" || strcharinfo(3) == "xmas_dun02" || strcharinfo(3) == "xmas_fild01" || strcharinfo(3) == "xmas_in" )
    		dispbottom "say 1";
    
    //	Method 2
    	for ( .@i = 0; .@i < .event_size; ++.@i )
    		if ( strcharinfo(3) == .event$[.@i] )
    			dispbottom "say 2";
    
    //	Method 3
    	if ( compare( .event_implode$, "|"+ strcharinfo(3) +"|" ) )
    		dispbottom "say 3"; // tested, doesn't trigger on xmas
    
    	end;
    }

    now I remember I learned this trick from Keyworld's string manipulation commands

  4. 1 hour ago, Seravy said:

    Oh so it is a bug, I see. It seems to be divest weapon only - curse and other -atk effects I found are  properly present in both the watk and matk  function. I guess people don't divest monsters much so it wasn't noticed.

    If yes then the calc watk should be called for rhw even when Renewal is defined otherwise all non-player units will never get their atk updated from any effect. That's a pretty serious bug there if I'm right. How did no one notice that, are players really never buffing or debuffing monsters? Or is this actually the official behavior and monsters aren't affected by those effects since renewal? That would be strange too.

    ....Aren't there a bunch of MVPs that can buff their ATK? How come no one ever noticed that, this can't be true?

    All I can say you done a good job !!
    yeah nobody bother to read this shitty code, nobody (except malufett) wish to rewrite this junk ... and everyone is happy with what we are having XD
    suddenly I remember there's a topic for it ... searching .... <-- nvm, found it in Hercules, and Hercules has different function for it
    most server running pre-re server are mostly PvP server, so they doesn't bother much about monsters

    ok seriously, I just tested and made sure cast blessing on monster DOES increase its attack ...

    btw I'm pretty sure I've tested that patch before posting ...
    so you are using pre-re ? I tested it on Renewal since I'm using 20180620Re client
    the damage done on me from 300-400 damage reduce to 140-280

    // reduce more to see it actually works
    		batk -= batk * sc->data[SC_SIGNUMCRUCIS]->val2 *4 /100;

     

    1 hour ago, Seravy said:

    I needed to read their attack for the AI to decide when to use safety wall

    there is a script command *getunitdata that can retrieve all the stats available from that unit

    // line 17438
    			getunitdata_sub(UMOB_ATKMIN, md->status.rhw.atk);
    			getunitdata_sub(UMOB_ATKMAX, md->status.rhw.atk2);

     

  5. //===== Hercules Script ======================================
    //= Stylist npc
    //===== By: ==================================================
    //= AnnieRuru
    //= original by Euphy
    //===== Current Version: =====================================
    //= 1.1
    //===== Compatible With: ===================================== 
    //= Hercules 2015-12-02
    //===== Description: =========================================
    //= stylist npc
    //===== Topic ================================================
    //= http://herc.ws/board/topic/11382-help-me-make-an-npc-to-check-style-variables/?do=findComment&comment=67039
    //===== Additional Comments: =================================  
    //= there is a bug on Euphy's stylist npc, the style number should start with 0, but his script always start with 1
    //= and the naming sense very bad, .@style and .@styles, should be avioded
    //============================================================
    
    prontera,155,185,1	script	Stylist	122,{
    	.@choose = select( "Hair style", "Hair color", "Cloth color" );
    	.@part = .look[.@choose];
    	.@i = .@revert = getlook( .@part );
    	while ( true ) {
    		setlook .@part, .@i;
    		dispbottom "This is style #"+ .@i +".";
    		.@next = .@i +1;
    		for ( .@j = 0; .@j < .blacklistsize[.@part]; ++.@j )
    			if ( .@next == getd(".blacklist"+ .@part +"["+ .@j +"]") )
    				++.@next;
    		if ( .@next > .maxstyles[.@part] )
    			.@next = 0;
    		.@previous = .@i -1;
    		for ( .@j = .blacklistsize[.@part] -1; .@j >= 0; --.@j )
    			if ( .@previous == getd(".blacklist"+ .@part +"["+ .@j +"]") )
    				--.@previous;
    		if ( .@previous < 0 )
    			.@previous = .maxstyles[.@part];
    		switch ( select( " ~ Next (^0055FF"+ .@next +"^000000)", " ~ Previous (^0055FF"+ .@previous +"^000000)", " ~ Jump to...", " ~ Revert to original (^0055FF"+ .@revert +"^000000)" ) ) {
    		case 1: .@i = .@next; break;
    		case 2: .@i = .@previous; break;
    		case 3:
    			dispbottom "Choose a style between 0 - "+ .maxstyles[.@part] +".";
    			input .@i, 0, .maxstyles[.@part];
    			break;
    		case 4: .@i = .@revert;
    		}
    	}
    	end;
    OnInit:
    //	setarray getd(".blacklist"+ LOOK_HAIR), 1,3,5,7,9,11,13; // ID that skip for hair styles
    //	setarray getd(".blacklist"+ LOOK_HAIR_COLOR), 2,4,6,8,10,12; // ID that skip for hair color
    //	setarray getd(".blacklist"+ LOOK_CLOTHES_COLOR), 3,6,9,12,15,18; // ID that skip for cloth color
    //  you don't want the normal deny, you want a long range deny ? then make a long long array XD
    	setarray getd(".blacklist"+ LOOK_CLOTHES_COLOR), 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199;
    
    	.maxstyles[LOOK_HAIR] = getbattleflag("max_hair_style");
    	.maxstyles[LOOK_HAIR_COLOR] = getbattleflag("max_hair_color");
    	.maxstyles[LOOK_CLOTHES_COLOR] = 500;
    	setarray .look[1], LOOK_HAIR, LOOK_HAIR_COLOR, LOOK_CLOTHES_COLOR;
    	.blacklistsize[LOOK_HAIR] = getarraysize( getd(".blacklist"+ LOOK_HAIR) );
    	.blacklistsize[LOOK_HAIR_COLOR] = getarraysize( getd(".blacklist"+ LOOK_HAIR_COLOR) );
    	.blacklistsize[LOOK_CLOTHES_COLOR] = getarraysize( getd(".blacklist"+ LOOK_CLOTHES_COLOR) );
    	end;
    }
    

     

  6. prontera,155,185,5	script	kjsdhfkh	1_F_MARIA,{
    	mes "warp to MVP arena";
    	next;
    	for ( .@i = 1; .@i <= 8; ++.@i ) {
    		if ( !getmapusers( "pvp_n_"+ .@i +"-4" ) ) {
    			warp "pvp_n_"+ .@i +"-4", 100, 100;
    			end;
    		}
    	}
    	mes "All 8 rooms are occupied";
    	close;
    }

    hmm ... I remember using getmapusers are not realiable... because the getmapusers check only when the player finished loading in the map
    so if having 2 or more players register at the same time, they might see each other
    that's why my private mvp room script use a variable instead of using getmapusers script command to check available map

    seriously though, this script can be done using instance ... then they never see each other

  7.  src/map/status.cpp | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/src/map/status.cpp b/src/map/status.cpp
    index c338c0e6f..8dd5263a8 100644
    --- a/src/map/status.cpp
    +++ b/src/map/status.cpp
    @@ -258,7 +258,7 @@ void initChangeTables(void)
     	add_sc( AL_PNEUMA		, SC_PNEUMA		);
     	set_sc( AL_INCAGI		, SC_INCREASEAGI	, EFST_INC_AGI, SCB_AGI|SCB_SPEED );
     	set_sc( AL_DECAGI		, SC_DECREASEAGI	, EFST_DEC_AGI, SCB_AGI|SCB_SPEED );
    -	set_sc( AL_CRUCIS		, SC_SIGNUMCRUCIS	, EFST_CRUCIS, SCB_DEF );
    +	set_sc( AL_CRUCIS		, SC_SIGNUMCRUCIS	, EFST_CRUCIS, SCB_DEF|SCB_BATK );
     	set_sc( AL_ANGELUS		, SC_ANGELUS		, EFST_ANGELUS		, SCB_DEF2 );
     	set_sc( AL_BLESSING		, SC_BLESSING		, EFST_BLESSING		, SCB_STR|SCB_INT|SCB_DEX );
     	set_sc( AC_CONCENTRATION	, SC_CONCENTRATE	, EFST_CONCENTRATION, SCB_AGI|SCB_DEX );
    @@ -5984,6 +5984,8 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
     		batk += batk * sc->data[SC_INCATKRATE]->val1/100;
     	if(sc->data[SC_PROVOKE])
     		batk += batk * sc->data[SC_PROVOKE]->val3/100;
    +	if(sc->data[SC_SIGNUMCRUCIS] && bl->type != BL_PC)
    +		batk -= batk * sc->data[SC_SIGNUMCRUCIS]->val2 *2 /100;
     #ifndef RENEWAL
     	if(sc->data[SC_CONCENTRATION])
     		batk += batk * sc->data[SC_CONCENTRATION]->val2/100;
    

    its status_calc_batk, you use wrong function

    don't ask me why, malufett also wanted to rewrite this shitty piece of code
    there were also some concern that .... if you read the code properly,
    if a player gets curse, reduce 1/2, get atk reduction, minus a number, then get negative status, reduce 1/4 ... then got buff, add a number... like that
    this kind of code doesn't really make sense and the developer just put in the statuses based on the finding from wikipedia (iro client or divine pride)....
    we didn't really test the damage in-game to compare with official ragnarok online

  8. ok dynamic_mob is ...

    if you turn it on, the monster wont spawn on unpopulated maps, it only loads the monsters when there is a player warp in
    if you turn it off, monster spawn on all maps, and this takes a lot of server resources

    means MVP ALWAYS respawn on server start/@reloadscript

    // Dynamic Mobs Options
    // Use dynamic mobs? (recommended for small-medium sized servers)
    dynamic_mobs: true
    
    // Remove Mobs even if they are hurt
    mob_remove_damaged: true
    
    // Delay before removing mobs from empty maps (default 5 min = 300 secs)
    mob_remove_delay: 300000

    this is the default setting, its default to ON

    this means the server only loads the resources needed when a player warp into the map
    once you leave the map and left it empty for 5 minutes, the server will remove all the monsters in the map, until someone warp in again

     

    40 minutes ago, Seravy said:

    So, if I understand this right, what I'm looking for is not implemented? I guess I just have to be careful not to shut down the server while I'm trying to kill things then.

    yes, this is not implemented,
    even if someone attempt to do this, there has to be a SQL database to store all the respawn timer, the unique monster ID ... and so on, big project

    40 minutes ago, Seravy said:

    What's the behavior of boss spawns on server start? Do they spawn immediately, or later? I want to avoid the situation where I start playing and there is nothing to kill, so if they spawn later, I need to somehow change that. If it's always immediate, I'm ok with that.

    spawn immediately the moment any player warp in the map

    40 minutes ago, Seravy said:

    (also, what is spawning mobs on playerless maps good for? Is there something I'm missing, I don't see the point? ) 

    this is the idea of dynamic_mob, so your server doesn't use up too much resources

    • Upvote 1
  9. LOL you spot a bug XD

    yes this script NOT allow party members to enter the instance, because there is a party leader check above it

    //	Once the party member fulfill requirement to enter the instance ...
    //	Somehow it check the party leader again !!
    	.@party_id = getcharid(1);
    	if (getcharid(0) != getpartyleader(.@party_id,2) || .@party_id < 1) {
    		mes "[Unpleasant Royal Guard]";
    		mes "I can only open the secret passage for party leaders. Please have your party leader talk to me.";
    		close;
    	}
    
    	.@md_name$ = "Ghost Palace";
    	switch( instance_enter(.@md_name$) ) {
    //	Then only the instance_enter check comes in, even though there is IE_NOMEMBER check

    just remove those party leader check and you are good to go .... I guess ... I didn't test it

  10. topic starter is right,

    @item2 1501 1 1 0 0 4001 4001 4001 4001
    @item2 1502 1 1 0 0 4001 4001 4001 4001
    @item2 1503 1 1 0 0 4001 4001 4001 4001

    make 3 clubs, each having different slots

    Item ID 1501 shows I have 3 poring card insert
    Item ID 1502 shows I have 4 poring card insert
    Item ID 1503 shows I don't have poring card inserted

    in other words this *isequippedcnt is totally depends on the amount of slots the equipment having

    if the check is just based on the player insert the card by double clicking the card, above post might give correct answer
    BUT if your server has a script that can slot cards into non-slot-able area (eg: rune, charms), then have to do source modifications ... maybe

    • Love 1
  11. 58 minutes ago, Chaos92 said:

    solved by changing this line :

    
    set .rand,rand(0,getarraysize(.ItemLists));

    to

    
    set .rand,rand(getarraysize(.ItemLists)-1);

     

    Thanks to @Hurtsky and @pajodex for their precious time !

    it should be

    .rand = rand(getarraysize(.ItemLists));

    if you add -1 means the last index doesn't get random in

  12. function	script	F_MesItemInfo	{
        .@item = getarg(0);
        return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", getitemname(.@item), .@item);
    }
    
    prontera,155,185,5	script	skdfjhskdf	1_F_MARIA,{
    	if ( !countitem(2201) ) {
    		mes "I need a "+ F_MesItemInfo(2201);
    		close;
    	}
    	if ( Zeny < 1000 ) {
    		mes "you don't have a thousand zeny";
    		close;
    	}
    	disable_items;
    	mes "Are you sure you want to exchange your sunglasses into slotted on in 1/10 chance ?";
    	next;
    	if ( select ( "Yes", "No" ) == 2 ) close;
    	if ( !countitem(2201) ) { // just a double check
    		mes "I need a "+ F_MesItemInfo(2201);
    		close;
    	}
    	if ( Zeny < 1000 ) {
    		mes "you don't have a thousand zeny";
    		close;
    	}
    	Zeny -= 1000;
    	if ( rand(100) < 10 ) {
    		delitem 2201, 1;
    		getitem 2202, 1;
    		mes "your "+ F_MesItemInfo(2201) +" now has slot";
    		emotion ET_BEST;
    	}
    	else {
    		delitem 2201, 1;
    		mes "it fails";
    		emotion ET_SORRY;
    	}
    	close;
    }

    script_commands.txt is your best friend

  13. 16 hours ago, Seravy said:

    No, I mean, other than locating and pasting the 1000 changed lines of my itemdb manually, what do I do to have it happen automatically, and would the editor tool actually edit the data in those files for me as if they were still in the original files if I do it? If not, I'm better off not using the imports...

    maybe you are referring using external tools like this one ?
    https://rathena.org/board/topic/98173-server-database-editor/
    https://rathena.org/board/topic/77080-grf-grf-editor/

    as far as I understand, rAthena uses CSV format, hercules uses libconfig, and in the future rathena might change to YAML format

     

    9 hours ago, Seravy said:

     I have a new problem.

    I've been using this to execute skills when possible only and so far it worked fine but on the Cold Bolt spell it makes the character cast the spell on the party leader. I'm 95% sure it only happens if the enemy is far enough, either on the edge of the range or outside (spell is range 9 and I'm fetching targets from an area of 9, but when reducing that to 6 the problem didn't show up.) so there must be something wrong here that causes targeting to get misdirected in those cases. Any idea?

    I wanted to say that the client calculate range and server calculate range differently
    the client use circular check but the server use square
    https://github.com/HerculesWS/Hercules/blob/5dd8a9165d1cd228124c2d9e07c8c38e47251dd6/src/config/core.h#L66-L72

    for example, the firebolt range is 9, when player cast it from client side, it do a circular check.
    however if the player cast it at maximum range diagonally, the server actually perceive it as 7 range as the server uses square check

    so when you code it to cast firebolt at maximum range using skill_get_range function, that function doesn't have circular check
    9 range at the server side is about 12 range client side, and it fails to cast

    .... but I think you should already understand this part by now

     

    9 hours ago, Seravy said:

    ...confirmed, if I remove nothing but the unit_walktobl(&sd->bl, targetbl, 2, 0); function call the bug disappears.  So it has to be the one overriding the spell target somehow. Is there another one I can call that's safer? Also if that isn't the correct way to make sure the character isn't already using a skill, then what else should I put into canskill()?

    oh yeah I remember rAthena unitwalkto script command is broken, maybe its related ?
    hercules unitwalk following players still works perfectly, maybe aleos changed/broke something while he was implementing that unitwalk with an event label

    maybe you should take a look at hercules source code too

  14. a few ways to do this before write this into a script

    Type A
    1. kick every online players (#kickall atcommand)
    2. OnPCLoginEvent, warp to new_1-1
    3. and maybe a BaseLevel check and Class check

    Type B
    1. use OnPCLoadMapEvent on every single map, the loadevent mapflag will be generated from map_index.txt file
    2. kick or warp every online players into new_1-1
    3. and maybe a BaseLevel check and Class check

    or maybe some other idea to do this trick ? suggestion is welcome ...

  15. prontera,155,185,5	script	skdfjhskdf	1_F_MARIA,{
    	if ( !countitem(2201) ) {
    		mes "I need a sunglasses";
    		close;
    	}
    	disable_items;
    	mes "Are you sure you want to exchange your sunglasses into slotted on in 1/10 chance ?";
    	next;
    	if ( select ( "Yes", "No" ) == 2 ) close;
    	if ( !countitem(2201) ) { // just a double check
    		mes "I need a sunglasses";
    		close;
    	}
    	if ( rand(100) < 10 ) {
    		delitem 2201, 1;
    		getitem 2202, 1;
    		mes "your sunglasses now has slot";
    	}
    	else {
    		delitem 2201, 1;
    		mes "it fails";
    	}
    	close;
    }

     

    • MVP 1
  16. prontera,155,185,5	script	kjsfksdfhj	1_F_MARIA,{
    	getinventorylist;
    	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
    		if ( getiteminfo( @inventorylist_id[.@i], 2 ) == IT_CARD ) {
    			.@name$ = getitemname( @inventorylist_id[.@i] );
    			.@strlen = getstrlen(.@name$);
    			if ( substr( .@name$, .@strlen -4, .@strlen -1 ) == "Card" ) {
    				.@cardid[.@c] = @inventorylist_id[.@i];
    				.@amount[.@c] = @inventorylist_amount[.@i];
    				++.@c;
    			}
    		}
    	}
    	for ( .@i = 0; .@i < .@c; ++.@i )
    		.@total += .@amount[.@i];
    	if ( .@total < 5 ) {
    		mes "you don't have total of 5 cards";
    		close;
    	}
    	if ( Zeny < 100000 ) {
    		mes "You don't have enough Zeny.";
    		close;
    	}
    	for ( .@i = 0; .@i < .@c; ++.@i )
    		.@menu$ += .@amount[.@i] +"x "+ getitemname( .@cardid[.@i] ) +":";
    	.@menu$ += "[Done]";
    	while ( true ) {
    		mes "Choose up to 5 cards";
    		for ( .@i = 0; .@i < .@choose_total; ++.@i )
    			mes .@choose_amount[.@i] +"x "+ getitemname( .@choose_cardid[.@i] );
    		next;
    		.@s = select( .@menu$ ) -1;
    		if ( .@s == .@c ) {
    			.@total = 0;
    			for ( .@i = 0; .@i < .@choose_total; ++.@i )
    				.@total += .@choose_amount[.@i];
    			if ( .@total != 5 ) {
    				mes "you didn't choose total of 5 cards";
    				next;
    			}
    			else
    				break;
    		}
    		else {
    			mes "input the amount to roll";
    			if ( input( .@input, 0, .@amount[.@s] ) ) {
    				mes "invalid amount";
    				next;
    			}
    			else {
    				for ( .@i = 0; .@i < .@choose_total; ++.@i ) {
    					if ( .@choose_cardid[.@i] == .@cardid[.@s] ) {
    						deletearray .@choose_cardid[.@i], 1;
    						deletearray .@choose_amount[.@i], 1;
    						--.@i;
    						--.@choose_total;
    						break;
    					}
    				}
    				if ( .@input ) {
    					.@choose_cardid[.@choose_total] = .@cardid[.@s];
    					.@choose_amount[.@choose_total] = .@input;
    					++.@choose_total;
    				}
    			}
    		}
    	}
    	mes "Are you sure you want to use";
    	for ( .@i = 0; .@i < .@choose_total; ++.@i )
    		mes .@choose_amount[.@i] +"x "+ getitemname( .@choose_cardid[.@i] );
    	mes "for a random card ?";
    	next;
    	if ( select ( "Yes", "No" ) == 2 ) close;
    	for ( .@i = 0; .@i < .@choose_total; ++.@i ) {
    		if ( countitem( .@choose_cardid[.@i] ) < .@choose_amount[.@i] ) {
    			mes "Don't try to cheat with me !!";
    			close;
    		}
    	}
    	if ( Zeny < 100000 ) {
    		mes "You don't have enough Zeny.";
    		close;
    	}
    	if ( !checkweight( 1201, 1 ) ) {
    		mes "You don't have enough space";
    		close;
    	}
    	for ( .@i = 0; .@i < .@choose_total; ++.@i )
    		delitem .@choose_cardid[.@i], .@choose_amount[.@i];
    	Zeny -= 100000;
    	getitem .cardid[ rand( .card_total ) ], 1;
    	close;
    OnInit:
    	setarray .cardid, 4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4552,4553,4554,4555,4556,4557,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,6846,22875,27012,27013,27014,27015,27016,27017,27018,27019,27020,27025,27026,27027,27028,27029,27030,27081,27082,27083,27084,27085,27086,27087,27088,27101,27102,27103,27104,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27117,27118,27119,27120,27121,27122,27123,27124,27125,27126,27147,27148,27149,27150,27151,27152,27157,27158,27159,27160,27161,27162,27163,27164,27165,27166,27167,27168,27169,27170,27171,27172,27173,27174,27175,27176,27177,27178,27179,27180,27181,27182,27183,27184,27196,27197,27198,27199,27249,27250,27251,27252,27253,27254,27255,27256,27257,27258,27259,27260,27261,27262,27263,27264,27265,27286,27287,27288,27289,27290,27291,27292,27293,27294,27295,27296,27297,27298,27304,27305,27306,27307,27308,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27322,27323,27324,27325,27326,27327,27328,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,31006,31007,31008,31009,31010,31011,31012,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023;
    	.card_total = getarraysize( .cardid );
    	end;
    }

    array generated by export result into cvs, then run macro with notepad++

  17. 2 hours ago, Seravy said:

    I don't see an option to make patch files in VS2013. In fact as far as I remember from the last project, the whole point of using Git was to not need patch files, those were an svn thing. Instead, branches... so basically I need to make a new branch, with only the related commits somehow if I understand the logic of how this should work, then push that branch to a fork (so I guess I can't avoid setting that up somehow either). Now the problem is I don't see almost any of the usual options in VS. No checkout, no nothing. My first encounter with Git was a year ago so I don't remember all that much details either. I have more important things to do than experimenting with this anyway, for example  actually completing the feature. We still only have one and a half 1st job class worth of skills implemented.

    well people like me use TortoiseGit on a daily basis,
    I have so many f*cking branch that I lazy to remove them

    2 hours ago, Seravy said:

    I wasn't originally planning to update more often than like once every 2 years or something. Resolving conflicts sounds like a pain with the amount of changes I'm doing to the items, monsters, and everything. Meanwhile I found those import folders, that seems like a great idea to use but I don't see an option in this "Server Database Editor" tool to actually put the changes into those files. It might be able to do that but I'm unsure. If you can show me an option that does a one click "put all the changes into the import folders", updating becomes a more viable option. Even then it means I have to actually process all the new stuff and adjust them to my needs, items, drops, everything. Not the thing I'm after when I still haven't even finished doing that to the existing stuff...

    this import folder thing for source code is Hercules only feature, which I already told you in previous post
    you just have to write all the changes in one single file, don't need to touch src folder

    Hercules Plugin System -> http://herc.ws/wiki/HPM
    I usually install my plugin using this guide -> http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC

    rathena planned to implement this system, but there is no ETA, no news about it
    so nope, the emulator server you work on is rAthena, doesn't have this kind of system yet

    and I guess its almost impossible to switch your project from rAthena to Hercules, since you have already progress quite far

     

    2 hours ago, Seravy said:

    Not to mention I started this because I wanted to take it easy and have a place where I don't need to worry about anything except myself. So if you want that patch, you have to be patient, it's not my top priority right now, sorry about that.

    yeah its true... its not some... MANY people also refuse to update their server because they don't like to resolve conflicts

    just need to tell this because by developing on outdated emulator, your project has detached from the majority of the community

     

    but I guess its nice seeing someone has the passion to develop something nobody else has done before

     

    2 hours ago, Seravy said:

    Also, this might actually result in something really scary. At this rate the AI might become a more reliable party member than real people - that's not very healthy for an online server. 

    I can bet some people willingly offer to buy over your project once its done ?

  18. prontera,163,171,3	script	PvP Arena Guardian	966,{
    	.@eaj = eaclass();
    	mes "[Guardian]";
    	mes "Greeting Warriors, which PvP room you wish to enter ?";
    	next;
    	switch(select("3rd Job Arena", "2nd Job Arena", "All Job Arena")) {
    	case 1:
    		if ( (.@eaj & EAJL_THIRD) || (.@eaj & EAJ_KAGEROUOBORO) == EAJ_KAGEROUOBORO || (.@eaj & EAJ_KAGEROUOBORO) == EAJ_KAGEROUOBORO ) {
    			close2;
    			switch( rand(4) ) {
    			case 1: warp "guild_vs3",16,49; end;
    			case 2: warp "guild_vs3",50,83; end;
    			case 3: warp "guild_vs3",83,50; end;
    			default: warp "guild_vs3",50,16; end;
    			}
    		} else {
    			mes "Only 3rd Jobs are allowed in this arena.";
    			close;
    		}
    		end;
    	case 2:
    		if ( Upper == 1 && (.@eaj & EAJL_2) && (.@eaj & EAJL_THIRD) == false && (.@eaj & EAJ_KAGEROUOBORO) != EAJ_KAGEROUOBORO && (.@eaj & EAJ_KAGEROUOBORO) != EAJ_KAGEROUOBORO ) {
    			switch( rand(4) ) {
    			case 1: warp "guild_vs2",89,49; end;
    			case 2: warp "guild_vs2",50,89; end;
    			case 3: warp "guild_vs2",9,50; end;
    			default: warp "guild_vs2",49,10; end;
    			}
    		} else {
    			mes "This arena is only for 2nd jobs";
    			close;
    		}
    		end;
    	case 3:
    		close2;
    		switch( rand(4) ) {
    		case 1: warp "pvp_n_1-5",99,134; end;
    		case 2: warp "pvp_n_1-5",133,100; end;
    		case 3: warp "pvp_n_1-5",100,65; end;
    		default: warp "pvp_n_1-5",66,99; end;
    		}
    		end;
    	}
    }

    now only I understand what you are trying to do....
    this one should fix it

     

    24 minutes ago, Brizyous said:

    no errors but the options keep mixing, for example, i want to warp to 3rd job pvp but sometimes it warps to 2nd or all job pvp maps,

    yeah my fault, didn't know you are making this for pvp room script, now this make sense
    now those who satisfy the 1st option, cannot go inside the 2nd option room

     

    29 minutes ago, Brizyous said:

    and sometimes does not warp at all....

    rand(4) is random number between 0~3

    so just change your case 4 into default: case

×
×
  • Create New...