Jump to content

chriser

Members
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by chriser

  1. Hello I am trying to add a custom weapon and the collection/item/drop is all working but when i double click it to try to wear it i get a red "Forbidden to wear the state cannot be worn" I am assuming its a issue with my item_db but i'm not sure where I messed up this is the first time i've tried to add a custom weapon before lol. The item id/view id confuses me idk which numbers to use and if they're even correct =/. Here's my item_db line for my custom weapon:

     

     

     16027,16027,Death Scythe,4,,,800,200,,2,4,0xFFFFFFFE,1,2,2,4,99,1,16027,{},{},{}
    ID,AegisName,Name,Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Upper,Gender,Loc,wLV,eLV,Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }

     

    p.s. I use number names to keep it in order and it allows me to add them faster i'll change them later on when I decide which items I want to keep and which I don't

     

    thanks in advance,

    - Kris

    eLV (the 99) is not valid I think, and are you sure you have the right job etc? because you have Upper set to 1.

  2. The RID is the account id, and not the charid. http://rathena.org/wiki/Attachrid

     

    And the stuff I postet is only the representation what happens when using @killmonster to kill the mobs or killing them normally.

     

    @killmonster equals using donpcevent <kill label>, because no RID is attached (and it works)

    killing the monster normally equals attachrid and doevent <kill label>, because a RID is attached (and it does not work)

     

    My problem has nothing to do with the code I posted. My problem is that the Kill label doesn't get found when a RID is attached. 



    finally fixed it, but someone who knows stuff better should look at that, because this is really hacky...

    First of all what I found out:

    /*==========================================
     * NPC processing event type
     *------------------------------------------*/
    int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
    {
    	struct event_data* ev = (struct event_data*)strdb_get(ev_db, eventname);
    	...
    }
    

    if the event is an instanced duplicated one (e.g. dup_1_11009906), this code gets NULL as event data, when the event would be dup_1_11009906::OnKill

    what i did was the following:

    static int npc_event_sub2(DBKey key, DBData *data, va_list ap)
    {
    	const char* p = key.str;
    	struct event_data* ev, **rev;
    	int* c;
    	const char* name;
    
    	nullpo_ret(ev = db_data2ptr(data));
    	nullpo_ret(name = va_arg(ap, const char *));
    	nullpo_ret(rev = va_arg(ap, struct event_data**));
    	if( p && strcmpi(name, p) == 0 )
    	{
    		*rev = ev;
    		return 1;
    	}
    
    
    	return 0;
    }
    /*==========================================
     * NPC processing event type
     *------------------------------------------*/
    int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
    {
    	struct event_data* ev = (struct event_data*)strdb_get(ev_db, eventname);
    	if(ev == NULL)
    		ev_db->foreach(ev_db,npc_event_sub2,eventname,&ev);
    	...
    }
    

    So I iterated over the ev_db, found the event with the eventname and put the event into the pointer &ev, where I then have the event_data for the event  dup_1_11009906::OnKill

    This works for my code posted here, where no error exists.

    Akinari also told me a solution (with which i was not satisfised) to just add Global to the event label, which worked too. But it was not acceptable for me that there is an ugly Global on each of my kill labels, so I made some overtime and now I have this.

     

    So please have a look at this @devs, I think this could be a really nasty bug or sth...

     

    Edit: Can somebody explain what #dandelion_duplicates is? this npcname showed up multiple times when displaying some npc names of events with a player attached.

  3. Why do I have to add the instance_id, if instance_npcname already uses the instance_id which is attached?

    And this is not the problem, the problem is that it works with donpcevent, but not with doevent and an RID attached. I thought I made that clear.

    (the whole EndlessTower script does not use a single instance_id())

  4. Hi guys,

     

    I wanted to launch my new dungeon on my server today, but when people went into it, every mob which called an OnKill label triggered an error saying:

    [01:43:29][Error]: npc_event: event not found [dup_1_110050525::OnKill]
    
    

    I removed the dungeon from my live server then, and tested it again on my test server, and I do not understand the following results:

    We tested the dungeon by killing the mobs with @killmonster and everything worked fine. But now, when the player kills a mob by himself, the error above occurs.

    What I then tested surprised me any more...

    First, I did the following:

    donpcevent instance_npcname(strnpcinfo(0))+"::OnKill";
    

    Which did what I expected: Trigger the OnKill Label. I tought i must be wrong somewhere, when I tested this...

    getpartymember 'partyid,2;
    attachrid $@partymemberaid[0];
    doevent instance_npcname(strnpcinfo(0))+"::OnKill";
    

    This bastard throws the error above. So basically, when there is a RID attached to the kill, the OnKill can not be found, but when there is no RID attached, it works? Am I missing something stupid or is this a bug?

    (I think this snippet should be enough http://pastebin.com/ygRfyJgZ you can be sure that all variables are set right and everything works, except the stuff above...)

    And btw: Both labels were exact the same when I displayed them. Both times the exact same event was called, but with a RID attached, the event could not be found.

  5. Hi guys,

     

    just finished the @autolootclass (@alootcls) implementation. If you have any problems or questions, just let me know.

    The command works exactly like @alootid, except that it loots specific item types (e.g.  @alootcls +6 loots cards only)

    To make it work for players, you have to add the command to your groups.conf of course.

     

     

    Greets~

    chriser

     

    Edit: Fixed compile error

    alootcls.patch

  6. Hi guys,

    I'm planning to convert to git for my server and I wanted to ask if anyone could give me a crash course how to convert my SVN working copy (including my local changes) to git (so that I will have the master branch to pull new changes and my own local branch which has my own customizations)

    I hope this is possible

    And I have a question about cross OS compatibility:

    My server is running Linux, but I am used to work in VS and with TortoiseSVN, so I mounted the servers HDD with win-sshfs that I can work on my linux HDD with windows GUI. The problem is that I can not svn update the repo on linux because the svn versions between windows and linux do not match, so I have to update over sshfs and the tortoiseSVN GUI, which is fcking slow. Does anybody know if GIT has the same problem?

    For myself, it's very convenient to pull the whole stuff on linux (cause its faster) and edit the source (or merge conflicts) on windows.

    Thanks in advance guys :)

    chriser~

  7. you need to reset the #DLogin every day, that does not work automatically. you can reset it either via sql (OnClock0000 and query_sql(update mapreg set value=0 where string='#DLogin')) or set variables that store the next reset time (#resettime = (calc next day 0 oclock) and then check if time now is greter than resettime and reset the points and calc new reset time

    ps: i hope you get the idea, because this will not work copy and paste

  8. Hi guys,

     

    I hope this suggestions wasn't made before and I didn't notice it.

     

    So basically, my idea is to implement a new autoloot command which only loots items of specific classes, like: @autolootclass 6 or @autolootclass Card

    The functionality of alootid would be great, too (with 10 slots or sth,  that you can loot cards, armors and and useables for example)

    If nobody is faster than me or already has such a patch, I will start implementing as soon as I have some spare time.

     

    Greets~

    chriser

  9. Sorry for the wrong section, you can move it if you want to.

     

    I really think that my fix would actually work, because you are exactly doing the same. (You patch definitly works, but it's more code :P)

    You always try to get the SD when there was no 2nd argument passed, that's what I did.

    You only need rid2sd when there was no 2nd argument. When you don't have a second argument, you always take the party, guild or map from the current attached player.

    The only part which might not work with this fix is when recovery raises the whole server (type 4), which does not need any further arguments.

     

    Either ways would work, it's only a matter of beauty :D

  10. Hi guys,

     

    I implemented the King of the Hill Event on my server, and modified it a bit. It now revives all the players in an interval of 20 seconds with the recovery function.

    As there is no RID attached when i call recovery on the whole map, it throws and error and exists the script. But as no RID is needed when reviving the whole map or the whole server, the script should be modified to only get the RID if we really need it, otherwise we have our map iterator getting all the SDs.

     

    I just realised that when there is any option given, you don't need a RID attached. So basically, we just have to check:

    BUILDIN_FUNC(recovery)
    {
        if(!script_hasdata(sd,3)) 
            TBL_PC *sd = script_rid2sd(st);
        ....
    }
    

     

    I think that should be all.

     

    Greets~

    chriser

×
×
  • Create New...