Jump to content

Angelmelody

Members
  • Content Count

    772
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by Angelmelody


  1. @@Angelmelody - Works like a charm!!!! :no1:  Thank you so much.

     

    Anyway what about if it will only show the online char and disregard the offline one? when no character is online on that account id. it will just show

    e.g

    Top 1 - Points: 1300> [Offline] // None of the character is online so it will only put one offline but won't put any character nameTop 2 - Points: 1000> Lord Ganja // This is the online character on the account_id. It won't put the offline character namesTop 3 - Points: 800> [Offline]..........

     

     

    ok try this..
    	.@nb = query_sql("select `name`, r.value, `online` from `char` as c INNER JOIN( select `account_id`, `value` from `acc_reg_num_db` WHERE `key` ='#PK_Points' AND `value` > 0 GROUP BY `account_id` order by `value` desc limit 10) as r on c.account_id = r.account_id order by r.value desc,char_num asc", .@name$, .@value, .@online);	if(.@nb) mes "Top "+( ++.@j)+" - Points: "+.@value[.@i];	for( .@i = 0; .@i < .@nb; .@i++ ) {		if(.@i ) {			if(.@value[.@i] != .@value[.@i-1] ){				if(!.@k){					mes " > [Offline]";				}				mes "Top "+(++.@j)+" - Points: "+.@value[.@i];				.@k = 0;			}		}		if(.@online[.@i]) {			mes " > "+ .@name$[.@i];			.@k++;		}	}

  2.  

    @@Angelmelody -

     

    Thanks for the script. :no1:

     

    Anyway i'm having this error whenever I clicked the npc

     

    [Warning]: script:getelementofarray: index out of range (-1)[Debug]: Data: variable name='.@value' index=0[Debug]: Source (NPC): Most Wanted List at prontera (141,177)

    index goes to -1 XD, now should be fixed ...try again...

    	.@nb = query_sql("select `name`, r.value, `online` from `char` as c INNER JOIN( select `account_id`, `value` from `acc_reg_num_db` WHERE `key` ='#PK_Points' AND `value` > 0 GROUP BY `account_id` order by `value` desc limit 10) as r on c.account_id = r.account_id order by r.value desc,char_num asc", .@name$, .@value, .@online);	if(.@nb) mes "Top "+( ++.@j)+" - Points: "+.@value[.@i];	for( .@i = 0; .@i < .@nb; .@i++ ) {		if(.@i ) {			if(.@value[.@i] != .@value[.@i-1] ){				mes "Top "+(++.@j)+" - Points: "+.@value[.@i];			}		}		mes " > "+ .@name$[.@i] +" "+( ( .@online[.@i] )? "^00FF00[Online]" : "^FF0000[Offline]" )+"^000000";	}

  3.  

    that error was caused by  sleep

    Thank you. I already get rid of the error.  :no1:

     

    What im encountering now is it prints only the char names of the top 1..

    Below top 2,3,4 and so on.. The names are the same as top 1.

     

    Does the script only saves and run 1 account id? :hmm:

     

    try this

    	.@nb = query_sql("select `name` , r.value, `online` from `char` as c INNER JOIN(select `account_id`, `value` from `acc_reg_num_db` WHERE `key` ='#PK_Points' AND `value` > 0 GROUP BY `account_id` order by `value` desc limit 10) as r on c.account_id = r.account_id order by r.value desc,char_num asc", .@name$, .@value, .@online);	if(.@nb) mes "Top "+( ++.@j)+" - Points: "+.@value[.@i];	for( .@i = 0; .@i < .@nb; .@i++ ) {		if(.@i && .@value[.@i] != .@value[.@i-1] ){			mes "Top "+(++.@j)+" - Points: "+.@value[.@i];		}			mes " > "+ .@name$[.@i] +" "+( ( .@online[.@i] )? "^00FF00[Online]" : "^FF0000[Offline]" )+"^000000";	}

  4. yeah but then you'd have to use a loop to re-create that array by adding each element, instead of copying from reference. Also what is getarg(0) in that?

    you don't need a loop to copy array you can directly access the .test array

    get value from  array:

     getelementofarray(getvariableofnpc(.test,"testnpc"), index);

    set value to array:

     set( getelementofarray(getvariableofnpc(.test,"testnpc"),index), value);

     

     


  5. Sorry I didn't explain precisely, I'm talking about something along the lines of this for example -

     

    -	script	test	123,{	OnWhisperGlobal:	setarray .@test[0],1,12,123;	callfunc "abc",.@test;	end;}function	script	abc	{	copyarray .@test,getarg(0);	dispbottom ""+.@test[1];	return;}

     

    This works, just not for npc variables, like .test

    example:

    -	script	testnpc	123,{	OnWhisperGlobal:	setarray .test[0],1,12,123;	callfunc "abc";	end;}function	script	abc	{	dispbottom ""+getelementofarray(getvariableofnpc(.test,"testnpc"),1);	return;}

  6.  

    why is there no pinky style released ? :D

    Like kikay style? i mean girly style?.. ^_^...

    Yeah, the pink color gives a feeling of warmth ,but dunno why no designer was drawn to..

    maybe they are all with a masculine mind ... :P


  7. in http://herc.ws/wiki/Custom_Items#Structure said

    Under pre-re mode third classes are considered upper, making use ofthe 8 and above masks is therefore not necessary unless in renewalmode. When no value is specified, all classes (mask 0x3f) are able toequip the item.

    how about i activated it under pre-renewal mode ?

    in db/pre-re/item_db.conf setting on the Rune Knight is Upper: 8, that i have to set it 2 to make Rune Knight able using it, i want to make genetic item creation like Dish stats +20 is unusable for 2ndtrans job

    Upper: 56  ?

    Third jobs:       0x08 (8)Upper Third jobs: 0x10 (16)Baby Third jobs:  0x20 (32)

  8. addtimer can make player reattached again

    e.g.
     

    prontera,154,173,5	script	testtestest02	100,{	mes "I Will warp you!";        addtimer 1000, strnpcinfo(0)+"::OnReattach";	warp "prt_fild08",169,186;OnReattach:        	mes "So what happens here?";	select("Something");	mes "And now?";	close;}

  9. @@Ranz comment the result afterwards, so that everyone can find and fix their problems

    @@Ranz

    open PC.C

    Path : trunk/src/map/pc.c

    Find This :

    		case SP_SUBRACE:			if (type2 == RC_MAX || (type2 > RC_NONDEMIPLAYER && type2 != RC_ALL) || type2 < RC_FORMLESS ){				ShowWarning("pc_bonus2: SP_SUBRACE: Invalid Race(%d)n",type2);				break;			}						if(sd->state.lr_flag != 2) {				if (type2 >= RC_MAX ) {					for ( i = RC_FORMLESS; i < RC_MAX; i++ ){						if ( (type2 == RC_NONPLAYER && i == RC_PLAYER) ||							 (type2 == RC_NONDEMIHUMAN && i == RC_DEMIHUMAN) ||							 (type2 == RC_DEMIPLAYER && (i != RC_PLAYER && i != RC_DEMIHUMAN)) ||							 (type2 == RC_NONDEMIPLAYER && (i == RC_PLAYER || i == RC_DEMIHUMAN))							)							continue;						sd->subrace[i] += val;					}				} else {					sd->subrace[type2]+=val;				}			}			break;
    Change To This :
    		case SP_SUBRACE:			if (type2 == RC_MAX || (type2 > RC_NONDEMIPLAYER && type2 != RC_ALL) || type2 < RC_FORMLESS ){				ShowWarning("pc_bonus2: SP_SUBRACE: Invalid Race(%d)n",type2);				break;			}			if(sd->state.lr_flag != 2)				sd->subrace[type2]+=val;			break;
    after changing it, recompile your server, i figured out that this is a bug, kindly move this topic to bug section

     

     

    This modification is not correct,here 

    surbrace array range was limited to RC_MAX


  10. wow great.. lemme try this (Y)

    Wooooo great i love you !! it works like a charm <3

    oh btw mr @@Zhao Chow how bout a script when i unequip it? 

    oppps, nevermind... did it on my own :D

     

    using this: 

     

    OnUnequipScript: <" setcashmount(0); ">

      OnEquipScript: <"if(!hascashmount())setcashmount();">

     OnUnequipScript: <"if(hascashmount())setcashmount();">


  11. You could use TRUNCATE(weight/10,1) or ROUND(...) in your query, although the result may not be what you'd except. You could also simply convert the weight manually instead (and make it a function) : 

     

    .@weight$ = .@weight;if (.@weight % 10 != 0) {	.@length = getstrlen(.@weight$);	.@weight$ = (.@length == 1 ? "0" : "") + insertchar(.@weight$, ".", .@length - 1);}else {	.@weight$ = .@weight / 10;}

    This would give you : 

    500 > 50

    505 > 50.5

    8 > 0.8

    nope, the query result (floating point numbers) can't be fully saved into *athena integer variable , but can be fully saved into string variable.

    my test:

    query_sql ("SELECT TRUNCATE(weight/10,1) FROM item_db WHERE name_japanese = 'Poison Arrow'",.@weight);

     

    query_sql ("SELECT ROUND(weight/10,1) FROM item_db WHERE name_japanese = 'Poison Arrow'", .@weight$);

     

    mes "Weight: "+.@weight;

    mes "Weight: "+.@weight$;


  12. skill_require_db.txt

     

    258,0,0,24:28:32:36:40:44:48:52:56:60,0,0,0,4:5,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

    change into

    258,0,0,24:28:32:36:40:44:48:52:56:60,0,0,0,4,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

     

     

     

     

    2: One-handed swords
       3: Two-handed swords
       4: One-handed spears
       5: Two-handed spears
       6: One-handed axes
       7: Two-handed axes

×
×
  • Create New...

Important Information

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