Jump to content

FatalEror

Members
  • Posts

    67
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by FatalEror

  1. Curly brace should be added at the end of '3rd Class items' NPCs script and before NPC shop.

    prontera,164,172,4 script 3rd Class items 501,{
    mes "3rd Class Item Warper";
    mes "Hello,";
    mes "Would you like to go to the 3rd Class Item shops";
    menu "Yes Please!",yes,"No thanks!",no;
    
    yes: warp "mora", 121, 179; end;
    close;
    
    no: close;
    
    }
    
    
    mora,115,184,4 shop RK & GX shop 946,127172000,127182000,127192000,127202000,127212000,127212000,127222000,127232000,127242000,127252000,127262000,127272000,127282000,127295000000,127302000,127315000000,127322000,127331000000
    mora,118,184,4 shop Warlock shop 743,6189100000,6190100000,6191100000,6192100000,6193100000,6194100000,6197100000,6198100000,6199100000,6200100000,6201100000,6202100000,6203100000,6204100000,6205100000
    mora,121,184,4 shop Mechanic shop 813,154910000,213920000,2800100000,2801100000,2802500000,2803100000,2804100000,2805100000,2806150000,2807200000,280825000
    mora,123,184,4 shop Mechanic Ammo 813,6145100,6146300,6147100,12392220,12393500,123941100,18000100,18001200,18002200,18003200,18004500
    mora,125,184,4 shop Genetic shop 731,6210100,6211100,6212100,62131000,62141000,62151000,62162000,62174000,6244100,6245100,6246100,6247100,6248600,6249100,6253100,6254100,6255500,6256100,6257100
    mora,127,184,4 shop Genetic Shop 2 731,6258800,6259100,6260100,6261500;6262400,6263100,6264100,6265100,62791000,62801000,62811000,62821000,62831000,62841500,62851000,6297100,1102210000,1102310000,1102410000

  2. Add this at the top of your script:

    function    script    isContain    {
       set .@str$, getarg(0, "");
       set .@exc$, getarg(1, "");
       if (.@str$ == "" || .@exc$ == "")
           return 0;
       for (set .@i, 0; .@i < getstrlen(.@exc$); set .@i, .@i+1)
           if (countstr(.@str$, charat(.@exc$, .@i)) > 0)
               return 1;
       return 0;
    }

    Then in your script, above if(getstrlen(.@newname$)>23){, add:

    if (isContain(.@newname$, "!@#$%^&*()-=+_[]{}")) {
       mes .@npcname$;
       mes "Your name contains illegal characters.";
       select("Back");
       goto Firstcase;end;
    }
    

    PS:

    You should add escape_sql to prevent sql injection..

    here is the full script: http://pastebin.com/raw.php?i=xUhxVaC5

  3. should be:

    +vitgain = val * status->vit/100;
    +if( (val + vitgain) >= battle_config.max_hp - 1000000 ) vitgap = 1;
    
    val += val * status->vit/100; // +1% per each point of VIT
    
    +if( vitgap ) val = battle_config.max_hp - 1000000;

    or you can also try:

    static unsigned int status_base_pc_maxhp(struct map_session_data* sd, struct status_data* status)
    {
       ...
    
       return cap_value(val, 0, battle_config.max_hp - 1000000);
    }

    but it will also "gap" trans/baby class hp bonus/penalty..

    • Upvote 1
  4. ../src/map/atcommand.c

    put this above atcommand_basecommands function

    static int count_mob(struct block_list *bl, va_list ap) // [FE]
    {
       struct mob_data *md = (struct mob_data*)bl;
       short id = va_arg(ap, short);
       if (md->class_ == id)
           return 1;
       return 0;
    }
    
    ACMD_FUNC(mapmoblist) // [FE]
    {
       char temp[100];
       bool mob_searched[MAX_MOB_DB];
       bool mob_mvp[MAX_MOB_DB]; // Store mvp data..
       struct s_mapiterator* it;
       unsigned short count = 0, i, mapindex = 0;
       int m = 0;
    
       memset(mob_searched, 0, MAX_MOB_DB);
       memset(mob_mvp, 0, MAX_MOB_DB);
    
       if (message && *message) {
           // Player input map name, search mob list for that map
           mapindex = mapindex_name2id(message);
           if (!mapindex) {
               clif_displaymessage(fd, "Map not found");
               return -1;
           }
           m = map_mapindex2mapid(mapindex);
       } else {
           // Player doesn't input map name, search mob list in player current map
           mapindex = sd->mapindex;
           m = sd->bl.m;
       }
    
       clif_displaymessage(fd, "--------Monster List--------");
    
       sprintf(temp, "Mapname: %s", mapindex_id2name(mapindex));
       clif_displaymessage(fd, temp);
    
       clif_displaymessage(fd, "Monsters: ");
    
       //Looping and search for mobs
       it = mapit_geteachmob();
       while (true) {
           TBL_MOB* md = (TBL_MOB*)mapit_next(it);
           if (md == NULL)
               break;
    
           if (md->bl.m != m || md->status.hp <= 0)
               continue;
           if (mob_searched[md->class_] == true)
               continue; // Already found, skip it
           if (mob_db(md->class_)->mexp) {
               mob_searched[md->class_] = true;
               mob_mvp[md->class_] = true; // Save id for later
               continue; // It's MVP!
           }
    
           mob_searched[md->class_] = true;
           count = map_foreachinmap(count_mob, m, BL_MOB, md->class_);
    
           sprintf(temp, " %s[%d] : %d", mob_db(md->class_)->jname, md->class_, count);
    
           clif_displaymessage(fd, temp);
       }
       mapit_free(it);
    
       clif_displaymessage(fd, "MVP: ");
    
       // Looping again and search for mvp, not sure if this is the best way..
       for (i = 1000; i < MAX_MOB_DB; i++) { //First monster start at 1001 (Scorpion)
           if (mob_mvp[i] == true) {
               count = map_foreachinmap(count_mob, m, BL_MOB, i);
               sprintf(temp, " %s[%d] : %d", mob_db(i)->jname, i, count);
               clif_displaymessage(fd, temp);
           }
       }
    
       return 0;
    }

    below ACMD_DEF(set),

    ACMD_DEF(mapmoblist),

    ../conf/atcommand_athena.conf

    mapmoblist: ["ml"]

    ../conf/groups.conf

    commands: {
    
    ...
    
    mapmoblist: true
    
    ...
    
    }

    • Upvote 1
  5. It's this?

    prontera,150,150,5/*Tab*/script/*Tab*/normal/*Tab*/50,{
    function exit;
    exit "msg";
    }
    
    function/*Tab*/script/*Tab*/exit/*Tab*/{
    mes getarg( 0);
    return close;
    }

    To use a function without use a callfunc you, you just have to use function name_of_the_function; in the beggining of the script.

    umm.. please read my post above..

    you can't declare a function that is outside of npc script..

  6. Please read this: ../doc/script_commands.txt

    *function <function name>;

    *<function name>;

    *function <function name> {

    <code>

    }

    (Skotlex stop being so selfish and give us all the commands T~T! J/k lol :P)

    This works like callfunc. It's used for cleaner and fast scripting. Also they

    must be inside a script. They're not separated scripts and they work more like

    labels with arguments.

    for function outside npc script, it must use "callfunc"

    • Upvote 2
  7. I think he want to call the function without the "callfunc"

    function	script	plus	{
    return getarg(0) + getarg(1);
    }
    
    prontera,100,100,4	script	Plus NPC	508,{
    mes "5 + 6 = " + plus(5, 6);
    close;
    }

    yes you can't do that, but.. whats wrong with "callfunc"?

    function	script	plus	{
    return getarg(0) + getarg(1);
    }
    
    prontera,100,100,4	script	Plus NPC	508,{
    mes "5 + 6 = " + callfunc("plus", 5, 6);
    close;
    }

  8. Hmm how do you make it GM's with group_id ranges from 80 above not get kicked can still enter Server during maintenance?

    rAthena:

    Find:

    if( runflag != CHARSERVER_ST_RUNNING && (runflag != CHARSERVER_ST_MAINTENANCE || group_id != 99) )

    Change to:

    if( runflag != CHARSERVER_ST_RUNNING && (runflag != CHARSERVER_ST_MAINTENANCE || group_id < 80) ) // Below 80 can't enter..

    Find:

    if( (runflag == CHARSERVER_ST_RUNNING || (runflag == CHARSERVER_ST_MAINTENANCE && node->group_id == 99)) &&

    Change to:

    if( (runflag == CHARSERVER_ST_RUNNING || (runflag == CHARSERVER_ST_MAINTENANCE && node->group_id >= 80)) && // Equal/Above 80 can login

    Find:

    if (atoi(data) != 99) {

    Change to:

    if (atoi(data) < 80) { //Below 80 can't login

    Find:

    if (pc_get_group_level(pl_sd) != 99) { // Only Admin(99) that will stay in maintenance

    Change to:

    if (pc_get_group_level(pl_sd) < 80) { // Kick player with group id below 80

    eAthena:

    Find:

    < 99

    Change to:

    < 80

    Find:

    >= 99

    Change to:

    >= 80

    • Upvote 1
  9. Shouldnt there be a Packetver check in the source for the cart option? Make it more organized? :P!

    If someone want to add this diff to rAthena, then yes.. we need to add PACKETVER check in this..

    Sir fataleror what fixes did you made from your diff patch?

    Maybe this?

    New bugs found.

    1) If your character dies, your cart disappears.

    2) If you rent out a cart that you previously had items stored in, it will not display those items inside the cart until you relog respawn with the cart on. Therefore, even if you go rent another cart after dying, you won't be able to see the items you had inside the cart until you relog respawn.

    Another here is if you rent a cart the other player doesn't see your cart until you use the Change Cart skill :P

    nice that worked. but now there's another bug >.<

    so if you have a character that has a cart on, you will notice that all other characters on that account will also show the cart button in the equipment window (alt+q) and also the OFF button. alt+w will work for those characters although no items can be put in. so far it doesn't seem like a bug that can be abused, but it would be nice to have it fixed.

    i posted this on my site but here is what i found out for all 2012 clients 2012-01 through 2012-03

    yeah this may be a dilemma...So this is what I found out, All 2012 clients have Cart Options removed, meaning that carts are not allowed to be used as an option anymore. Option is used to tell the client that characters outside the player's visible range will still be able to see what effects are on the player at all times. So without this, it means that the cart status patch that is available now, players can't see at all time. So if we removing the new carts won't really do anything. Therefore, if we want to keep using 2012 clients then that means we have to stick with this problem unless a dev finds a way for it to keep its status while showing it other players outside their range. 2011-12-20b-2011-12-28, is the latest client that will still use the Option on the cart

    the skill "SA_DISPELL" removing the cart. Anyone know how to solve this?

    Thanks.

  10. in ../src/map/status.c

    search for status_base_pc_maxhp function

    static unsigned int status_base_pc_maxhp(struct map_session_data* sd, struct status_data* status)
    {
    ...
    
    if (sd->class_&JOBL_UPPER)
    	val += val * 25/100; //Trans classes get a 25% hp bonus
    else if (sd->class_&JOBL_BABY)
    	val -= val * 30/100; //Baby classes get a 30% hp penalty
    
    ...
    
    }

  11. case DIY_QIAN:
    hitrate += hitrate * 100 * skill_lv / 100;
    break;

    Increase HIT by (hitrate * 100 * skill_lv /100) 'only' when using this skill,

    your value seems too(VERY) high, this skill sure will never miss :D

    sc_start(bl,SC_STUN,(50*skilllv+(int)sd->status.base_level/10), skilllv,skill_get_time(skillid,skilllv));

    bl = The target of status (src = self, bl = enemy)

    SC_STUN = Status (SC_*)

    (50*skilllv+(int)sd->status.base_level/10) = % chance to inflict SC_STUN status on target (1 = 1%, 50 = 50%)

    skilllv = Type (Doesn't really matter for SC_STUN, this is val1 in status_change_start function in status.c)

    skill_get_time(skillid,skilllv) = Status duration (skill_get_time() = Duration1 in skill_cast_db.txt)

    but ,when i enter the game, i can not find skill in skill bar,

    so,i don't know whether to finish for create a new skill, (i have used @allskill GM order)

    the steps of editor ,where is the mistake?

    Have you changed ../lua files/skillinfoz/skilltreeview.lua and ../db/re/skill_tree.txt ?

  12. It's possible to add a custom illustration image

    Untitled-2.png

    Here what i've got after test it:

    showing Poring illustration → Client doesn't read your petinfo.lua or you didn't add it in petinfo.lua correctly

    showing monster sprite → Client can't find your pet illustration image

    Gravity Error → Your illustration image size is incorrect

    BTW, what is your client date and what monster did you want to add as a pet?

    • Upvote 1
  13. Could you possibly provide a diff patch for those who are currently with eAthena still?

    oh well..

    at_maintenance_eathena_r15077_sql.patch

    possible to change the Message Rejected from Server to Server Maintenance?

    WFIFOHEAD(fd,3);
    WFIFOW(fd,0) = 0x6c;
    WFIFOB(fd,2) = 0; // <-- CHANGE 0 TO 1
    WFIFOSET(fd,3);
    break;

    It should change the message to: "You cannot use this ID on this server."

    search for that line in msgstringtable.txt and edit it..

  14. Hello I was wondering how to create a command that causes the server to enter for maintenance when typing the command giving en kick all players and not letting them connect until the command is enabledagain.

    @maintenance → kick all players except Admin → change map-server status to Maintenance → tell char-server to change status to Maintenance

    Player login → check if (server is in Maintenance and player is not an admin), if yes → block player

    at_maintenance.patch

    Usage: @maintenance <on/off>

    • Upvote 3
×
×
  • Create New...