Jump to content

Garr

Members
  • Content Count

    482
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Garr


  1. Because it's not SC_SPIRIT, it's SC_SOULLINK.

    prontera,156,165,5    script    Buff & Link    100,{emotion 47;        set .@Price,0;    // Zeny requerido.    set .@Buffs,1;    // Buffar os jogadores? (1: sim / 0: não)    set .@Delay,5;    // Tempo de espera, em segundos ( Padrão 5 segundos )    set .@level,1;    // Level de Player VIP    set .@time, 300000;    // Duração do Buff Soul Link ( Padrão 5 minutos )            // Padrão VIP ----------------------------------------------------    if (getgroupid() >= .@level) {    atcommand "@repairall";    callfunc "F_ClearGarbage",0;    if (@HD > gettimetick(2)) end;    if (.@Price) {        message strcharinfo(0),"Custo: "+.@Price+" Zeny.";        if (Zeny < .@Price) end;        if(select("^0055FFCurar^000000:^777777Sair^000000") == 2) close;        set Zeny, Zeny-.@Price;    }    specialeffect2 313; percentheal 100,100;    if (.@Buffs) {        specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10;        specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;            //  Soul Linker --------------------------------------------------        switch ( BaseJob ) {                case 18:					set .@spirit, 445; break;                case 15:					set .@spirit, 447; break;                case 4047:					set .@spirit, 448; break;                case 16:					set .@spirit, 449; break;                case 14:					set .@spirit, 450; break;                case 23:					set .@spirit, 451; break;                case 7:						set .@spirit, 452; break;                case 9:						set .@spirit, 453; break;                case 8:						set .@spirit, 454; break;                case 19:	case 20:		set .@spirit, 455; break;                case 17:					set .@spirit, 456; break;                case 10:					set .@spirit, 458; break;                case 11:					set .@spirit, 460; break;        }        if ( .@spirit ) {                sc_start2 SC_SOULLINK, .@time, 5, .@spirit;                skilleffect .@spirit, 5;        }            if (.@Delay) set @HD, gettimetick(2)+.@Delay;            end;    }    }    else    {        atcommand "@repairall";    callfunc "F_ClearGarbage",0;    if (@HD > gettimetick(2)) end;    if (.@Price) {        message strcharinfo(0),"Custo: "+.@Price+" Zeny.";        if (Zeny < .@Price) end;        if(select("^0055FFCurar^000000:^777777Sair^000000") == 2) close;        set Zeny, Zeny-.@Price;    }    specialeffect2 313; percentheal 100,100;    if (.@Buffs) {        specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10;        specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;    }        if (.@Delay) set @HD, gettimetick(2)+.@Delay;    end;    }} 

  2. Yeah, my bad, I completely forgot that it's not part of sql query ^^'

     

    Also, for now this will only show @whodrops for first item in the list.

    I'm not sure how you'd like to deal with it, to show chosen item? (Make it like next/previous menu along with whodrops option)

    Or leave as is, where it shows only first item found?

     

    [Edited code in my first post with your fix]


  3. I think something like this:

    L_Item:	next;	dispbottom "Initiating Item Database...";	progressbar "0xRRGGBB",2;	mes "Database successfully loaded. What Item do you want to learn about?:";	mes " ";	mes "Please ^ff0000only input the Item's full name^000000 or there will be incorrect results!";	input .@itemname$;	.@amount = query_sql ("SELECT ID, price_buy, price_sell, weight, atk, defence, slots FROM item_db WHERE name_japanese = '"+ escape_sql(.@itemname$) +"'", @iid$, .@buy, .@sell, .@weight, .@atk, .@defence, .@slots);        	if (.@amount == 0) { //No items found		mes "There's no such item.";		next;		menu "Search for another item",L_Item,"Exit",L_later2;	}	for (.@i = 0; .@i < .@amount; .@i++) {			next;			mes "Name: "+.@itemname$;			mes "Weight: "+.@weight[.@i];			mes "ATK: "+.@atk[.@i]; 			mes "DEF: "+.@defence[.@i];			mes "Slots: "+.@slots[.@i];			mes "Buying Price: "+.@buy[.@i];			mes "Selling Price: "+.@sell[.@i];		}		next;		goto L_menu2;	 L_menu2:	menu "Which monster drops it?",-,"Search for another item",L_Item,"Exit",L_later2;	atcommand "@whodrops "+@iid$;	goto L_menu2;	L_later2:	close; }

  4. I think it's all in that topic you pointed to itself, no? Check your SQL DB for Hercules, table named `login`, and you'll see a column named `character_slots`. If you leave it at 0 all slots are available to characters, if you pass it number between (and including) 1 and MAX_CHARS, people will see "reserved for VIP slots" instead of normal one. At least that's how I understood it without checking it out.


  5. +1

     

    kinda nice 1f44d.png but what about a command to "kill" people in the same way as this script? :D currently we are stick to atcommands in order to kill a character :/

    What about percentheal -100,0?

     

    Not that I use reviving in scripting, I prefer to throw players out and see them start all over again if they die /gg

     

    But still, nice idea :D


  6. If I understoof those right, they are typed with either alt+number if there's no x before, otherwise number is translated fro hex to dec and used that way.

    Like Alt+010 (x0A) gave me new line, same with Alt+013 (x0D), I guess one os them is n, other is r? But not sure.

    Alt+160 is some "Soft Hyphen", but you know that one already(xA0). (255) is unbreakable space, alt+255. 032 is actually space itself.

     

    ETA: New version seems much cleaner *_*


  7. Recently I came along this line in char.c:

    #define TRIM_CHARS "255xA0032tx0Ax0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]

    So there we have few more candidates to be replaced with space :D

     

    So we have:

    if ( message[i] == 'xA0' || message[i] == '255' || message[i] == '032' || message[i] == 't' || message[i] == 'x0A' || message[i] == 'x0D' )	message[i] = 'x20'; // replace invisible chars with space.

  8. Try to track what player is causing this, get their inventory info, since it's the easiest way to check if it's an item. It can be some special move/stance after skill with some item that's causing it, that might be tougher to check out. But that's all I can suggest. Or you can use this: RO SETA to check what sprite you're missing if you're getting stack errors. That really helped me a few times.


  9. I believe db/(pre-)re/skill_cast_db.txt is what you're looking for.

    // Structure of Database:// SkillID,CastingTime,AfterCastActDelay,AfterCastWalkDelay,Duration1,Duration2,Cool Down//-- SL_KAAHI463,0,500,0,1800000,500,0

    Change 1800000 to 30000, I think it should do the trick.


  10. Checking some more I found that skillpointcount() will basically show how many skill points you'd have if you resetted, aka without quest and 9 basic, BUT for novice it counts in basic skill.

     

    Also, each character seems to get a "jobchange_level" variable set on them when they change job, so it's possible to calculate how many points they should have.

    For 1st/high 1st class It'll be (JobLevel-1) skill points + 9 basic, but we'll throw them out if we'll compare to skillpointcount. For 2nd/trans job it'll be (JobLevel + jobchange_level - 2) total, +9 basic which we won't count again. I'm trying to make a script now, i'll edit it in in a bit.

     

     

    ETA: I didn't test it much, but seems to work.

     

    prontera,156,184,5    script    LostPointsRestore    100,{.@sk = skillpointcount();if (eaclass()&EAJL_THIRD) {.@sks = JobLevel + jobchange_level + jobchange_level_3rd - 3;} else {    if (eaclass()&EAJL_2) {        .@sks = jobchange_level + JobLevel - 2;    } else {        .@sks = JobLevel - 1;    }}if (.@sk < .@sks){    dispbottom "It seems something strange happened to your skill points. Here, let me replenish missing ones~";    SkillPoint = SkillPoint + (.@sks-.@sk);    dispbottom "There you go. Now everything should be all right. Have fun!";} else {    dispbottom "Everything is fine with your skill points! Take care~";}end;}

    It doesn't take away skill point, only grants missing ones.

     

    Further edit: But this only includes up to 2nd/trans jobs. I have yet to think a way to count in 3rd jobs "should have" skillpoints.

     

    Edit once more: It seems I am blind. There's "jobchange_level_3rd" variable on each player. How convenient. Edited script to support Novice, 1st, 2nd and 3rd jobs. Haven't tried with extended jobs, but might work as well.


  11. You only needed to lowercase "ResetSkill" and "ResetStatus". Remember, Hercules script commands are case-sensitive.

     

    prontera,148,194,4	script	Reset Girl	124,{ set .@zenyabove,500000;    //The cost of a reset after reaching the .@blvl settedset .@zenybelow,0;        //The cost of a reset before reaching the .@blvl settedset .@blvl,80;            //The max base lvl to have a low cost resetset .@resets,1;            //Amount of resets available after reaching .@blvl, if you set this to 0, you will have infinite resetsset .@itemid,26002;        //The item id you want to make users use when they run out of resets, mine is 26002, if you set this to 0, they will not be able to reset again     mes "[Reset Girl]";    mes "I am the Reset Girl, "+(getd(".@zenybelow")>0?"the ^0000FFresetting cost you^000000 ^FF0000"+.@zenybelow+"^000000 zenies.":"the ^0000FFresetting is Free^000000.")+"";     mes "After reaching ^0000FFBase lvl "+.@blvl+"^000000 you are able to use my services ^FF0000"+.@resets+" last time"+(getd(".@resets")>1?"s":"")+"^000000 for ^0000FF"+.@zenyabove+" zenies^000000"+(getd(".@itemid")>1?", otherwise you will have to get a ^FF0000"+getitemname(.@itemid)+"^000000.":".")+"";                switch(select("Reset Stats","Reset Skills","Reset Both")){ case 1:            set .@resetstatus,1;            next;            goto L_Reset;            case 2:            set .@resetskills,1;            next;            goto L_Reset;            case 3:            set .@resetboth,1;            next;            goto L_Reset;    }close; L_Reset:            if( BaseLevel < .@blvl ){                if ( Zeny >= .@zenybelow ){                    mes "[Reset Girl]";                    if ( .@resetstatus == 1 ) mes "Are you sure you want to ^FF0000Reset Status^000000?";                    if ( .@resetskills == 1 ) mes "Are you sure you want to ^FF0000Reset Skills^000000?";                    if ( .@resetboth == 1 ) mes "Are you sure you want to ^FF0000Reset Status & Skills^000000?";                    if ( .@zenybelow > 0 ) mes "It will cost you ^0000FF"+.@zenybelow+"^000000 zenies.";                        if (select("Yes:No")==1){                            mes "Here you go!";                            if ( .@resetstatus == 1 ) resetstatus;                            if ( .@resetskills == 1 ) resetskill;                            if ( .@resetboth == 1 ) { resetstatus; resetskill; }                            set Zeny,Zeny-.@zenybelow;                            next;                            mes "[Reset Girl]";                            mes "Thank you for using my services!";                        }                        else                            mes "Come back when you are ready!";                }                else                    mes "You don't have enough money!";            }            else{                if(  RESETTED >= .@resets ) {                if ( .@itemid == 0 ){                    mes "Sorry, you cannot use my services anymore.";                    close;                } else {                mes "It seems that you have used all your zeny resets.";                mes "I will need a ^FF0000"+getitemname(.@itemid)+"^000000!";                next;                    if( countitem(.@itemid) >= 1 ){                        if ( .@resetstatus == 1 ) mes "You are about to ^FF0000Reset Stats^000000 using 1 ^FF0000"+getitemname(.@itemid)+"^000000!";;                        if ( .@resetskills == 1 ) mes "You are about to ^FF0000Reset Skills^000000 using 1 ^FF0000"+getitemname(.@itemid)+"^000000!";;                        if ( .@resetboth == 1 ) mes "You are about to ^FF0000Reset Stats & Skills^000000 using 1 ^FF0000"+getitemname(.@itemid)+"^000000!";                         mes "^FF0000Are you really sure?^000000";                            if (select("Yes:No")==1){                                mes "Here you go!";                                delitem .@itemid,1;                                if ( .@resetstatus == 1 ) resetstatus;                                if ( .@resetskills == 1 ) resetskill;                                if ( .@resetboth == 1 ) { resetstatus; resetskill; }                                next;                                    mes "[Reset Girl]";                                    mes "Thank you for using my services!";                                    close;                            }                            else{                                mes "Come back when you are ready!";                            }                    }                    else{                        mes "You do not have any ^FF0000"+getitemname(.@itemid)+"^000000!";                        mes "Come back when you get one.";                        mes "Have a Good day!";                        }                    }                }                else{                    if( Zeny >= .@zenyabove ){                        mes "[Reset Girl]";                        mes "You are over Level "+.@blvl+"!!";                        mes "^FF0000You only have "+(.@resets-RESETTED)+" Resets left!^000000.";                        next;                        if ( .@resetstatus == 1 ) mes "Are you sure you want to ^FF0000Reset Status^000000?";                        if ( .@resetskills == 1 ) mes "Are you sure you want to ^FF0000Reset Skills^000000?";                        if ( .@resetboth == 1 ) mes "Are you sure you want to ^FF0000Reset Status & Skills^000000?";                        if ( .@zenyabove > 0 ) mes "It will cost you ^0000FF"+.@zenyabove+"^000000 zenies.";                            if (select("Yes:No")==1){                                mes "Here you go!";                                set Zeny,Zeny-.@zenyabove;                                if ( .@resetstatus == 1 ) resetstatus;                                if ( .@resetskills == 1 ) resetskill;                                if ( .@resetboth == 1 ) { resetstatus; resetskill; }                                if ( .@resets != 0 ) set RESETTED,RESETTED + 1;                                next;                                mes "[Reset Girl]";                                mes "Thank you for using my services!";                            }                        else{                            mes "Come back when you are ready!";                        }                    }                    else{                        mes "Sorry you don't have enough money to use my services.";                        mes "You need ^0000FF"+.@zenyabove+"^000000 zenies for it.";                        }                    }            }close;}

  12. If I understood your code right problem should be here:

    for ( i = 0; bgd->members[i].sd; i++ )                mapreg->setreg( reference_uid( script->add_str("$@arenamembers"), i ), bgd->members[i].sd->bl.id );

    As I understood it's supposed to add in members until there'll be no id in next member, the problem is:

    int bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type flag) {...	ARR_FIND(0, MAX_BG_MEMBERS, i, bgd->members[i].sd == sd);	if( i < MAX_BG_MEMBERS ) { // Removes member from BG		if( sd->bg_queue.arena ) {			bg->queue_pc_cleanup(sd);			pc->setpos(sd,bgd->members[i].source.map, bgd->members[i].source.x, bgd->members[i].source.y, CLR_OUTSIGHT);		}		memset(&bgd->members[i], 0, sizeof(bgd->members[0]));	}...}

    The leaving member can have any index in array, including index 0, which will result in $@arenamembersnum staying 0.

     

    Oor I may be completely wrong since I never even learned C++ and playing with server code is my first attempt ever >.>

×
×
  • Create New...

Important Information

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