Jump to content

Garr

Members
  • Content Count

    482
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Garr


  1. Hmm, I think it should be C_CONSTSTR.

    script->push_str((st)->stack, C_CONSTSTR, skill->db[index].name);

    May I ask why you need player data here? If you're looking for skill name from skill ID you don't really need to attach player at all. Moreso, there are predefined routines in script.h, so why use one when you already have script_pushconststr?

     

    BUILDIN(getskillname) {    uint16 skill_id;    int index;		if( script_isinttype(st,2) )    skill_id = script_getnum(st,2);    if ( !(index = skill->get_index(skill_id)) || skill->db[index].name == NULL ) {        ShowError("script_getskillname: Skill with id %d does not exist in the skill databasen", skill_id);        return true;    }    script_pushconststr(st, skill->db[index].name);    return true;}

     

    P.S. I didn't check it out as I was lazy to recompile my test server for that, and I was lazy to remake that into plugin to test either :P


  2.  

    I may be misinformed about this, but...

     

    Shouldn't it be mandatory to have a Zeny check before applying the cost? Because if you try to subtract more Zeny than the user has, there could be problems with script execution?

     

    I mean this line:

    Zeny -= (((BaseLevel + JobLevel) / 2) * 5);

     

     

     

    he means this line:

    mes "^FF0000 *Note - It costs "+ (((BaseLevel + JobLevel) / 2) * 5) +" zeny to get healed.* ^000000";

     

    ..? I may be wrong, but he even stated the line he meant, no?


  3. Why not just do a folder search with "goto"? Usually text editors provide such feature, like I know for sure both Notepad++ and Sublime Text have it via ctrl+shift+f (I use it pretty often, helps to find all the instances of something in specific folder. And if coupled with mass replace it helps even more, like I was able to switch to lowercase commands in all scripts quite easy).


  4. That's pretty simple. There's file called sc_config.txt in db folder.

     

    // Status Change configuration database//// Structure of Database:// SC_NAME, flag//// flag    1  - SC cannot be removed by death.//         2  - SC cannot be saved.//         4  - SC cannot be reset by dispell.//         8  - SC cannot be reset by clearance.//         16 - SC considered as buff and be removed by Hermode and etc.//         32 - SC considered as debuff and be removed by Gospel and etc.//         64 - SC cannot be reset when MADO Gear is taken off.//        128 - SC cannot be reset by 'sc_end SC_ALL' and status change clear.//Example://SC_ENDURE, 21 //SC_ENDURE: cannot be removed by death and dispell and cosidered as buff. (16 + 4 + 1 = 21)

  5. Umm... actually, item command has this useful plug that cheks for pet egg, and if it's egg it creates egg as an egg (sorry for ... that).

    if (!pet->create_egg(sd, item_id)) {...}

    So that's not the actual problem, I think? I'd say check that your egg ID in pet DB and in item DB are the same, so the monster is assosiated right.


  6. If you'll look closer, he has .@j++ in the end of loop. That means both .@j and .@i bear the same value, and it goes through all items, even if I miss the reason for 2 variables in the first place. The thing is, I guess the problem lies within delitem2. When there are 2 of same item ( 1 and 2) it deletes 1, creates bound 1, but on next run it deletes the bound 1, and creates it bound again, thus not touching the 2 item at all. I'm a bit at loss on how you can delete a specific item. Maybe if first run all-delete, and then all add-in bound again? (Separate delete and getbound into 2 different loops). That'll take 2 loops, but without editing source of delitem I don't see a way to do it otherwise.


  7. Ah, didn't see that it's not attaching rid. Sorry.

     

    L_reward:    set .@size, getarraysize( getd(".team"+ getarg(0) +"aid") );    for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 )        if ( isloggedin( getd(".team"+ getarg(0) +"aid["+ .@i +"]" ) ) )  {            getitem .rewarditem[ getarg(1) ], .rewarditem[ getarg(1) +1 ], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );            attachrid getd(".team"+ getarg(0) +"aid["+ .@i +"]" );            getexp 200000,200000;            detachrid;        }    return;

  8. L_reward:    set .@size, getarraysize( getd(".team"+ getarg(0) +"aid") );    for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 )        if ( isloggedin( getd(".team"+ getarg(0) +"aid["+ .@i +"]" ) ) )  {            getitem .rewarditem[ getarg(1) ], .rewarditem[ getarg(1) +1 ], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );            getexp 200000,200000;        }    return;

  9. Subnet.conf is best when you need to recognize inside network to use inside IPs. It shouldn't have much effect, but without it I'd be doomed with my router NOT supporting NAT hairpinning >.>

     

    Maybe it could be your network problems rather? Did you try to get connected from the outside before? Some ISPs are running users behind NAT, so without proper intervention you can be lost (aka you're sharing outside IP with some other clients), and when you try to get connected to from outside network you'll fail since it needs special settings on NAT source, like port forwarding or DMZ.


  10. There's no SC_FULLPROTECTION. You just made that up.

     

    SC_PROTECTWEAPON, 28SC_PROTECTSHIELD, 28SC_PROTECTARMOR, 28SC_PROTECTHELM, 28

     

    You need to change those. I think you need to remove 16 from them, but not sure.

     

    SC_PROTECTWEAPON, 12SC_PROTECTSHIELD, 12SC_PROTECTARMOR, 12SC_PROTECTHELM, 12

  11. First of all, some weapons are indestructible by nature, from the top of my head: staves, two-handed staves, axes, two-handed axes, books, maces and huuma shurikens.

     

    Rates do affect rates that weapons/armors break with. For example, if you have equip_skill_break_rate on 100, chances are same as it is in the skill description (AD, per example, so 10%). If you have it at 10, it's 1/10 of what it was, so 1% in our case. In other words, view it as % of the original value.


  12. You can actually use battle_config.variable_name variables in plugin at your will, the only thing is that you'll need to replace battle_config. with battle->bc->, and don't forget to fetch battle symbol for plugin not to crash.

     

    Example: battle_config.go_delay becomes battle->bc->go_delay to be used inside plugins.


  13. Tried what? That report shows that people can switch weapons to gain double card effects, and fixes are applied to counter that. Currently that fix is working, and that's why when you switch weapon its card and effect won't take place until attack finishes.


  14. It's pretty easy to reproduce:

    Try to vend items, that you just put in the cart from inventory, and that were in inventory when you logged on, and it will defy those items. I wrote it in the bug report.

     

    It should be fine if your local server has latest repo though, so don't even try to reproduce it there :P


  15. I like using menu when I have few option that all lead to same result. switch(select) + default seems like a bit too much for such an easy task :P

     

    Anyways, nice one. I believe there was also a somewhat guide on scripting rules as in use of intendation/naming scheme and all that. Might help make scripts cleaner and easier to read for everyone if you'll link it somewhere.


  16. check the db/pre-re/skill_cast_db.

    there you can change the duration of skills

     

    for example:

     

    //-- TF_HIDING51,0,0,0,30000:60000:90000:120000:150000:180000:210000:240000:270000:300000,0,0

    to:

     

    //-- TF_HIDING51,0,0,0,5000:5000:5000:5000:5000:5000:5000:5000:5000:5000,0,0

    Now hiding duration is 5 sec at every lvl

     

    Actually, just

    //-- TF_HIDING51,0,0,0,5000,0,0

    will suffice :D


  17. Updated links with your suggestions, thank you very much. It's first time I ever I make a plugin, not to mention I never really worked with C++ or C before. So had to go with guessing game sometimes.
     
    Also, about last suggestion with it being inside if, won't the ifs before that prevent it from triggering by returning to main function before the hookStop()?
     
    Because this:

    if ( bl->type == BL_NPC ) { ...code with hookStop()...}return;

    Seems same with:

    if (bl->type != BL_NPC)	return;...code with hookStop()...

     
    Also, found a solution for nullpo not linking:
    RMB on project, Properties , and change Configuration to "Release" for this plugin.

    2lmozsh.jpg

×
×
  • Create New...

Important Information

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