Jump to content

Nardoth

Members
  • Content Count

    26
  • Joined

  • Last visited

  • Days Won

    1

Nardoth last won the day on September 15 2016

Nardoth had the most liked content!

About Nardoth

  • Rank
    Member

Recent Profile Visitors

1423 profile views
  1. This fix uses timer functions and still causes the client to render the initial direction for a milisecond when you use shadow jump on a cell that is too close to you, still it's good to go. At unit.c define the following function: int unit_settimeddir(int tid, int64 tick, int id, intptr_t data){ struct block_list *src; src = map->id2bl(id); if (src == NULL){ ShowDebug("unit_settimeddir: src == NULL (tid=%d, id=%d)\n", tid, id); return 0;// not found } unit->setdir(src,data);//data will be the direction return 1; } This is a function of the defined type TimerFunc which means it can be used by the timer functions after we define a name for it. But first we need to define in unit_defaults: unit->settimeddir = unit_settimeddir; and at do_init_unit: timer->add_func_list(unit->settimeddir,"unit_settimeddir"); Then we go to unit.h and define inside the struct unit_interface: int (*settimeddir)(int tid, int64 tick, int id, intptr_t data); Now or function is ready to be used. At skill.c in skill_castend_pos2 go to the case NJ_SHADOWJUMP and make it look like this: case NJ_SHADOWJUMP: { uint8 d = map->calc_dir(src,x,y); if( !map_flag_gvg2(src->m) && !map->list[src->m].flag.battleground ) { //You don't move on GVG grounds. unit->movepos(src, x, y, 1, 0); clif->slide(src,x,y); } timer->add(tick+10,unit->settimeddir,src->id,(intptr_t)d); status_change_end(src, SC_HIDING, INVALID_TIMER); clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); } break; So at 10 ticks later (used 10 because I feel it's safer) the function will be executed, chaging the direction the src is facing.
  2. EDIT: THIS FIX IS DEPRECATED. I did a fix using timer functions which will be in the next post. Don't use this as it will sometimes cause a "miss" animation when using the skill. Managed to do a temporal fix on NJ_SHADOWJUMP. I realized that it does change the direction of the caster but it is never shown to the clients, even if you try it by sending a packet on the same tick. For some reason it sets itself to the direction = 6 at the end of the tick. So what I have done is change the direction a little later. For this, I still don't know how to use timer functions, so I use clif_delay_damage and clif_delay_damage_sub whenever I need that. clif_delay_damage calls clif_delay_damage_sub at the tick it is set to with a packet of data that holds multiple variables and we can take advantage of it. The fix is the following: In skill.c at the case NJ_SHADOWJUMP in skill_castend_pos2 make it look like this: case NJ_SHADOWJUMP: { uint8 d = map->calc_dir(src,x,y); if( !map_flag_gvg2(src->m) && !map->list[src->m].flag.battleground ) { //You don't move on GVG grounds. unit->movepos(src, x, y, 1, 0); clif->slide(src,x,y); } clif->delay_damage(tick+10,src,src,d,skill_id,0,1,0); status_change_end(src, SC_HIDING, INVALID_TIMER); clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); } break; At clif.c in clif_delay_damage_sub (the sub, not the other) add at the start of the codestruct map_session_data *sd; sd=map->id2sd(dd->p.GID);//dd->p.GID is the id of the caster sent from clif_delay_damage if (sd){ if (dd->p.attackedMT==NJ_SHADOWJUMP && dd->p.count==1){//this is the "sdelay" variable where we used the skill_id, the count=1 is a security measure in the case the sdelay of the true use of the packet is =NJ_SHADOWJUMP unit->setdir(&sd->bl,dd->p.attackMT);//this is the "ddelay" variable where we used the direction ers_free(clif->delayed_damage_ers,dd);//It does this at the end, I guess it frees some memory return 0; } } This will solve the problem until it is fixed. Probably the best way to solve it would be using timer functions but I don't know how do they work, actually I'm not even sure what language is this.
  3. Triangulated the problem with the direction in NJ_SHADOWJUMP and found out this: At map.c, in map_moveblock the following lines are causing the problem: if (moveblock) map->delblock(bl); #ifdef CELL_NOSTACK else map->update_cell_bl(bl, false); #endif bl->x = x1;//this one bl->y = y1;//and this one, if (moveblock) map->addblock(bl); #ifdef CELL_NOSTACK else map->update_cell_bl(bl, true); #endif Weird. Tried different things, nothing solved it so I have no idea what to do.
  4. At skill.c : For Back Slide change in skill_castend_nodamage_id case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex] clif->skill_nodamage(src,bl,skill_id,skill_lv,1); skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit->getdir(bl),0); clif->fixpos(bl); break; to case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex] //clif->skill_nodamage(src,bl,skill_id,skill_lv,1); skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit->getdir(bl),0); clif->fixpos(bl); clif->skill_nodamage(src,bl,skill_id,skill_lv,1); break; For Shadow Jump I couldn't solve the direction, but for the animation change at skill_castend_pos2 to this: case NJ_SHADOWJUMP: if( !map_flag_gvg2(src->m) && !map->list[src->m].flag.battleground ) { //You don't move on GVG grounds. unit->movepos(src, x, y, 1, 0); clif->slide(src,x,y); } status_change_end(src, SC_HIDING, INVALID_TIMER); clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); break; Don't forget to recompile.
  5. Hi, reviving this topic because it already has some background of what I'm doing. I used the plugin and succesfully generated the navigation files. However it never uses the airship, the boats or kafra for transportation, it always choose the path by walking, no matter what option I set on the navigation window. Is there a fix for this?
  6. Watch out for the bug in which if you try to restore the costume having another item of the same kind in the inventory, it will fail to restore the costume. What this does is delete the item in the inventory and replace it for a new one, and it may cause to lose cards and refine on that item. A simple solution is to use the condition countitem(item_id)>1 to stop the script if the player has more than one of these items.
  7. Go to skill_check_condition_castend at skill.c and look for case AM_CANNIBALIZE: Below that you will see maxcount = 6-skill_lv; change it to maxcount = 2; save and recompile.
  8. can you help me? I've never done a new custom skill, just edited existing ones so I don't know the preliminar steps. Also you need to be more specific. Check for a tutorial in how to add a new custom skill.
  9. I'm having this issue now, does somebody know how to solve it? I do not have any errors on my console, and I did not edit the itemskill function script nor the clif_item_skill function. I'm using 20140205 Ragexe version. One thing I noted is that after using a magnifier, I couldn't use the skill Appraisal by itself until I used something else like a fly wing, if it helps to know what's going on. The issue happens with items with itemskill script in general. The functions I mentioned are being called and are passing the variables properly. EDIT: Found the problem, was calling skill->check_condition_castbegin at clif_parse_UseSkillToId.
  10. For some reason, when I try to use a magnifier, flywing, Yggdrasil leaf and other items like them, they would be consumed and no skill will happen. There are no errors when loading the server nor when using the items. I updated my hercules like 2 weeks ago but I don't remember if I had this problem before, didn't check. Also I never edited the itemskill script command nor the functions it uses as far as I can recall. wat do? UPDATE: I checked my previous version of hercules that was like a year old and the bug is still there. PACKETVER is 20140205. UPDATE 2: Used an unmodified version, bug was gone. Must be something I made, no idea what could be causing it since I didn't messed up with that :/ LAST UPDATE: Found the problem, was calling skill->check_condition_castbegin at clif_parse_UseSkillToId and ToPos too.
  11. I actually writed it in the code, after the nullpo, you just need to copy and paste. Anyways I checked it, it doesn't work, The function is for older client versions. There are other functions too like clif_hp_meter and the like but I can't figure out how to do it, every mob still has the hp bar.
  12. Try navigating to the function clif_monster_hp_bar in clif.c and add a condition for the mob to be a mvp. Something like md->state.boss void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) { struct packet_monster_hp p; nullpo_retv(md); nullpo_retv(sd); if(md->state.boss){ p.PacketType = monsterhpType; p.GID = md->bl.id; p.HP = md->status.hp; p.MaxHP = md->status.max_hp; clif->send(&p, sizeof(p), &sd->bl, SELF); } } PD: Don't forget to recompile.
  13. Try to check if there is a block_list related to the unit that you can slide to the proper position using clif->slide (and checking if it can be moved using unit->movepos
  14. what are the drawbacks of doing this? Will the client experience more lag? What else?
  15. In skill_castend_pos2. But as I said it doesn't work properly because it's like it stops everything during those 2 seconds until the loop ends. Probably the best thing would be to call clif->delaydamage and adapt the code to that function.
×
×
  • Create New...

Important Information

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