Jump to content

bWolfie

Members
  • Content Count

    848
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by bWolfie


  1. When you want to trigger the warp, you need to use attachrid(AID)

     

    1. When creating event, you need to add every AID to an array which will be looped through at the end to check.

    2. When event starts, save coordinates and map values using temporary @ value. E.g. @map$ = "prontera"; @x = 150; @y = 150;

    3. When event ends, trigger donpcevent() for the event.

    4. Loop through array and attachrid as you go.

     

    Here is an example...cannot confirm it works trying to work through with logic.

     

     

    prontera,150,150,3    script    Blah_Blah_Me    CLEAR_NPC,{
    
        @map$ = "amatsu"; @x = 200; @y = 200;
        $@Event_Array[$@Count] = getcharid(CHAR_ID_ACCOUNT);
        $@Count ++;
        mes("I saved your coordinates!");
        close;
    
    OnEnd:
        for (.@i = 0; .@i < getarraysize($@Event_Array); ++.@i)
            if (isloggedin($@Event_Array[.@i]))
            {
                attachrid($@Event_Array[.@i]);
                warp("" + @map$ + "", @x, @y, 0);
                detachrid();
            }
        deletearray($@Event_Array);
        $@Count = 0;
        end;
    }

     

    Again, cannot confirm if works, tryna work through logic.


  2. In the following code in channel.c, when your tick is not at 0 it will direct you to message 1455, "You're talking too fast!"

     

        if (sd && chan->msg_delay != 0
         && DIFF_TICK(sd->hchsysch_tick + chan->msg_delay*1000, timer->gettick()) > 0
         && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)) {
            clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1455));
            return;
        }
    

     

    I wish to display the remaining ticks (seconds) instead of a static message. E.g. message 1455, "You cannot send a message to this channel for another %d seconds."

     

    Thanks.


  3.  

     

    That sentence is sent directly to clif, which sends to the client so you can't catch it without source modification. If what you want is just to count all connected users there's an easy way for that:

    getusers(1)
    

     

    We are using custom @who4 command, which displays online players without autotraders.

     

                switch (display_type) {
                    .......
                    default: {
                        if (display_type == 4 && pl_sd->state.autotrade == 1)  // who4: ignore autotrade vendors
                            continue;
     
                        struct party_data *p = party->search(pl_sd->status.party_id);
                    ......
    

     

    So I'm interested in being able to generate this number to use in a script.


  4. hatereset is a custom command.

    someone gave me this code long ago.

    not sure if I should share, but this should probably be in our official code thing.

     

    atcommand.c

    ACMD(hatredreset)
    {
        pc->resethate(sd);
        clif->message(fd, msg_fd(fd,1552));  //Hatred mark target has been reset.
    
        return true;
    }
    
    pc.c
    int pc_resethate(struct map_session_data* sd)
    {
        int i;
        nullpo_ret(sd);
    
        for (i = 0; i < MAX_PC_FEELHATE; i++) {
            sd->hate_mob[i] = -1;
            pc_setglobalreg(sd,script->add_str(pc->sg_info[i].hate_var),0);
        }
        return 0;
    }
    
     

    You need to add msg 1552 or whatever number you want to conf/messages.conf

    also there might be more to it cos this was just inside a plugin on my server.

     

    good luck lol. maybe someone who reads this post can help put my stuff together. i am kind of lazy right now sorry.


  5. I know 2014-10-22b.ragexe is fully stable as far as I know (except one issue where safety check vending button crashes on certain langtype).

     

    Pros of using this client:

    - Updated user interface

    - Bank vault.

    - Mail box still works (breaks on later clients which us RODEX).

    - Instant stat update (not slow like older clients).

     

    Cons

    - There are some unused features, or ones you might not use, which could be confusing for players. Stuff like kafra points.

    - Not supporting new features such as Doram, rodex.

     

    Well IMO I think it is worth updating. I actually don't know what the older clients have which the newer ones don't. Although, if there's nothing in the new clients you want/need, probably don't need to update. 


  6.  

     

    There's already bonus2 bHPRegenRate/bSPRegenRate which do exactly that. Check the documentation.

     

    oh i didnt see that however can it be percentage of your max hp instead?

     

     

    Yup.
    bonus2 bHPRegenRate, (MaxHp/100), 1000;
    This script would drain 1% of max hp every 1000ms (1 second).

  7. I forgot what the whole thing is called, and even what the file is called. But I remember you can put this in some /etc/confs-avaiable/something.??

    
    

    <VirtualHost *:80>

    ServerName example.net

    DocumentRoot /var/www/html/

    ErrorLog /var/www/html/forum/error.log

    CustomLog /var/www/html/forum/requests.log combined

     

    Redirect /index.php http://example.net/cp

    </VirtualHost>

    virtual host that's what it called. i think you should google it so you can learn for you OS.

  8. So I currently have this clif->message which displays in your chat when you cast a certain skill. It only goes to the public log and I want it to go to 'Battle Message' (using 20141022 client).

     

    I noticed in msgstring it has these lines:

     [%s] deal '%d' damage on you.#
     [%s] received damage from [%s] with '%d' damage.#
     [%s] received '%d' damage.#
     [%s] deal damage to [%s] with '%d' damage.#
    
    Where can I find it in the source to send a message like this? Because I want the message to only appear as a Battle Message.

     

    To reiterate, I want to display my custom message so it appears as a battle message like this:

    Tk705nU.png

     

    Thanks


  9. Woohoo! I will test later. This is awesome.
     
    One warning:

    ReduceSkillDamage.c
    ReduceSkillDamage.c: In function ‘battle_calc_damage_post’:
    ReduceSkillDamage.c:100:27: warning: variable ‘s_sd’ set but not used [-Wunused-but-set-variable]
      struct map_session_data *s_sd, *t_sd;
    

     
    Compiling in CentOS7 (gcc 4.8.5 20150623)


  10.  

    Thanks! Works.

     

    Now I have a second question for anybody who may know.

    How come # variable is on the excluded list? Would there be issues if I removed it from here?

     

     

        switch (*name)
        {
        case '#':
        case '$':
        case '.':
        case '\'':
            ShowError("script:getvariableofpc: illegal scope (not pc variable)\n");
            script->reportdata(data);
            script_pushnil(st);
            st->state = END;
            return false;
        }
    

  11. Hello,

     

    I want to set a permanent character variable that calls from an array.

     

    For example, my variable set up:

     

        setarray(variable$[0],
            "value_1",
            "value_2",
            "value_3"
        );
    

     

    And then call array to set the variable:

     

            variable$[2] = 1;
    

     

    It seems to work okay...but when scripts reload, values are cleared.

     

    Any help? Thanks.


  12. The issue is if you are duplicating an NPC (i.e. multiple NPCs running same script), every time OnPCKillEvent/DieEvent is triggered, it will activate for all NPCs. This script very messy, hard to read for me so don't know what's going on.

     

    But something like this is an example. The following script would cause the script to run 5 times - 1 original and 4 duplicates.

     

     

    -    script    Kill Announce    FAKE_NPC,{
    
    OnPCKillEvent:
        announce("" + strcharinfo(PC_NAME) + " killed somebody.", bc_all);
        end;
    
    }
    
    prontera,150,150,3    duplicate(Kill Announce)    Kill Announce#1    FAKE_NPC
    payon,150,150,3    duplicate(Kill Announce)    Kill Announce#2    FAKE_NPC
    izlude,150,150,3    duplicate(Kill Announce)    Kill Announce#3    FAKE_NPC
    alberta,150,150,3    duplicate(Kill Announce)    Kill Announce#4    FAKE_NPC
    

     

    You can edit it like such so it would only announce when killed somebody on your same map.

     

     

    -    script    Kill Announce#template    FAKE_NPC,{
    
    OnPCKillEvent:
        if (strnpcinfo(NPC_NAME_HIDDEN) == "template")
            end;
    
        if (strnpcinfo(NPC_MAP) != strcharinfo(PC_MAP))
            end;
        
        announce("" + strcharinfo(PC_NAME) + " killed somebody.", bc_all);
        end;
    
    }
    
    prontera,150,150,3    duplicate(Kill Announce)    Kill Announce#1    FAKE_NPC
    payon,150,150,3    duplicate(Kill Announce)    Kill Announce#2    FAKE_NPC
    izlude,150,150,3    duplicate(Kill Announce)    Kill Announce#3    FAKE_NPC
    alberta,150,150,3    duplicate(Kill Announce)    Kill Announce#4    FAKE_NPC

     

    Idk if this is helpful ,just thought i would put it out there

×
×
  • Create New...

Important Information

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