Jump to content

Tio Akima

Members
  • Content Count

    349
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Tio Akima

  1. yes, skill window! I use the skill in the area .. and then do the whole process right. My skill ALL_TEST case is in skill_castend_pos2
  2. hey man.... I tried this ... I got a mistake ... he is saying that in status.c Val3 was not declared struct block_list *src = map->id2bl(val3); so I tried to put it this way: struct block_list *src = map->id2bl(sce->val3); The Status.c code looks like this: case SC_RUN: { struct unit_data *ud = unit->bl2ud(bl); bool begin_spurt = true; // Note: this int64 value is stored in two separate int32 variables (FIXME) int64 starttick = (int64)sce->val3&0x00000000ffffffffLL; starttick |= ((int64)sce->val4<<32)&0xffffffff00000000LL; if (ud) { if(!ud->state.running) begin_spurt = false; printf("enter 1 \n"); //console debug ud->state.running = 0; if (ud->walktimer != INVALID_TIMER) unit->stop_walking(bl, STOPWALKING_FLAG_FIXPOS); printf("enter 1 \n"); //console debug struct block_list *src = map->id2bl(sce->val3); if(bl->type == BL_MOB && (src && src->type == BL_PC)){ // check to make sure source is available and a pc type skill->castend_nodamage_id(src, bl, NPC_SELFDESTRUCTION, 1, timer->gettick(), 0); //active bomb printf("enter 3 \n"); //console debug } } if (begin_spurt && sce->val1 >= 7 && DIFF_TICK(timer->gettick(), starttick) <= 1000 && (!sd || (sd->weapontype1 == 0 && sd->weapontype2 == 0)) ) sc_start(bl, bl,SC_STRUP,100,sce->val1,skill->get_time2(status->sc2skill(type), sce->val1)); } break; but it's not working I'm using printf to debug ... And he is not going through the BL and SRC check take a look and tell me if I'm doing something wrong
  3. Okay, I'll post the code here. This is my custom skill .. in skill.c She summons a MOB and uses SC in the same monster case ALL_TEST: { int mob_id = 1142; //marina sphere struct mob_data *md; md = mob->once_spawn_sub(src, src->m, x, y, clif->get_bl_name(src), mob_id, "", SZ_BIG, AI_SPHERE); if (md) { mob->spawn (md); //summon mob sc_start4(src,&md->bl,SC_RUN,100,skill_lv,dir,0,0,0); }// end if } break; in status.c, within the function responsible for terminating this status (SC) in status_change_end_ case SC_RUN: { struct map_session_data *pl_sd = map->nick2sd(bl); struct unit_data *ud = unit->bl2ud(bl); bool begin_spurt = true; // Note: this int64 value is stored in two separate int32 variables (FIXME) int64 starttick = (int64)sce->val3&0x00000000ffffffffLL; starttick |= ((int64)sce->val4<<32)&0xffffffff00000000LL; if (ud) { if(!ud->state.running) begin_spurt = false; printf("enter 1 \n"); //console debug ud->state.running = 0; if (ud->walktimer != INVALID_TIMER) unit->stop_walking(bl, STOPWALKING_FLAG_FIXPOS); printf("enter 2 \n"); //console debug skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 1, timer->gettick(), 0); //cast skill if(bl->type == BL_PC) printf("BL_PC \n"); //console debug if(bl->type == BL_MOB) printf("BL_MOB \n"); //console debug } if (begin_spurt && sce->val1 >= 7 && DIFF_TICK(timer->gettick(), starttick) <= 1000 && (!sd || (sd->weapontype1 == 0 && sd->weapontype2 == 0)) ) sc_start(bl, bl,SC_STRUP,100,sce->val1,skill->get_time2(status->sc2skill(type), sce->val1)); printf("enter 3 \n"); //console debug } break; I'm using the function skill->castend_nodamage_id that way it works but it works wrong .. Instead of blasting the target (MOB) she explodes the player
  4. how can i use bl to call them? I already tried to use only bl in the two arguments of the function: skill->castend_nodamage_id(bl, bl, NPC_SELFDESTRUCTION, 1, timer->gettick(), 0); but it does not work Oh yes... I made the following debug I put an if () to know the contents of bl: if(bl->type == BL_MOB) printf("this is BL_MOB \n"); //msg in console so, he enters into this condition, and shows the message. @benching @4144 @Happy Look at an example in this command it uses map_session_data in the atcommando.c file, look for this function: // command to blow up a player if I'm not mistaken ACMD (nuke) { But this command uses a string (typed by the player) it uses the following form: skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, timer->gettick(), 0); I tried to follow the example .. It worked, but as I said above it explodes the player and not the target. I thought it would be so easy ... I believed that, just passing BL as an argument that the target would already be found
  5. Yes, I did it. I also put in both arguments BL and the error is the same ... the map server crashed
  6. I tried to do this... skill->castend_nodamage_id(bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 1, timer->gettick(), 0); I put it like you said... but the server crashes when we store in struct map_session_data and use in the parameter (such for example as pl_sd) apparently not from error but if I only use bl the server map crashed
  7. Cool that someone answered my topic <3 So, what do you think I should do Happy? I honestly tried several alternatives, but I did not succeed.
  8. Hello guys I made a custom structure in my skill But I'm messing around somewhere .. Help me out. I call sumono a MOB struct mob_data *md; md = mob->once_spawn_sub(src, src->m, x, y, clif->get_bl_name(src), mob_id, "", size, type); //example mob->spawn (md); //sumona o mob Then I use an SC in this mob sc_start4(src,&md->bl,SC_RUN,100,skill_lv,0,0,0); in status.c, within the function responsible for terminating this status (SC) in status_change_end_ I'm putting a function (within the case of SC_RUN) I'm trying to use this function struct map_session_data *pl_sd = map->nick2sd(bl); skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 1, timer->gettick(), 0); //function to call the skill NPC_SELFDESTRUCTION on target But... But ... Skill_castend is not working correctly It should call the Selfdestruction skill on the target (the same target I'm using SC) but he uses selfdestruction in PLAYER his is the skill_castend structure: The first or second parameter is responsible for the target //skill castend in skill.c int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag){} I'm pretty sure I'm wrong here: struct map_session_data *pl_sd = map->nick2sd(bl); Because when compiling it says: warning C4133: 'function': incompatible types - from 'block_list *' to 'const char *' map->nick2sd() accepts const char but bl is block_list But, I do not know how to do it the right way. how can I put the correct path to my target (The mob that was summoned) Help me
  9. hi guys It is possible to execute (call) the NPC_SELFDESTRUCTION skill through the file Status.c I'm using an SC and would like to run the NPC_SELFDESTRUCTION skill over there according to one condition, I call this ability. How can I do this?
  10. Hello guys, I'm using a command in skill.c to make a mob floor I'm using unit-> walktoxy () inside a for () (It is in the file skill.c) unit->walktoxy(&md->bl,sx,sy,0); (Ie the mob, and where it goes) Now I would like to display a message when this mob can not walk anymore. I thought about putting a condition (IF) on unit_walktoxy When it finds a non-walking cell, it displays the message. I put this condition if ( map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKWALL) || map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKNOPASS)) { printf("stop! \n"); // console message break; //end } This is the logic .. but it still is not working. Because I need to get the mob reference (from skil.cl) and use this condition I need to refer to the same mob There in bl->m, bl, bl->x, bl->y How can I do this?
  11. Thanks for the message fxfreitas I'll test this. So I do not know if it's going to work out because I'm using the unit-> walktoxy to make the Mob walk ... So while the mob is walking with this function, it does not attack etc ... Just walk in the direction .. The idea to make it self destruct is to check if the next cell is a cell "Not walkable" or if there is any wall. This is looking like a collision test the mob colliding with something. hahahaha
  12. Hi guys Another doubt: Which function is called when I enter the range of a mob and he attacks me? This function should check if there is an enemy in the range of the MOB, if it has, then the mob attacks. Does anyone know where to find this function in src? If it is not the job of some function, excuse me.
  13. Thanks Meko for the tip .. I'm doing everything in SRC myself .. so I guess the NPC_SELFDESTRUCTION might help. I'm summoning a mob and making it walk in one direction (by skill) ... And the idea is if this mob finds something on the way, it destroys itself .. (Auto destroy equal to marine sphere) But I still do not understand how the self-destruct of the Marine Sphere works. Getunits () and unitkill () are script commands? Is there any function in src similar to getunits ()? And also similar to unitkill ()? Does unitkill do the same thing as mob-> dead ()? Sorry for the many questions, but I have many doubts. I'm almost finished, I just need to make the mob self-destruct when I find something
  14. Hello guys How can I make a MOB that self destructs when someone gets close? I looked at the Creator's skill (MARINE SPHERE) but I did not understand how self-destruction works. The idea is to make a mob that walks around the map and when it finds another MOB or player, it self destroys. Can someone help me?
  15. Hi everyone, I'm doing a skill In which he does some checks, cell by cell .. However, this is very very fast. I have a FOR () looping Walking from cell to cell ... But I wanted this FOR () with a delay Doing the check more slowly It's possible???? About the skill: The skill makes a MOB walk on a line ... Then the skill checks cell by cell ... Upon reaching the end of this line, the MOB dies. But ... as this loooping is very fast, the MOB dies before reaching the end of the path .... :'( So, I need a delay in this FOR () so that the MOB can walk to the end and not die before ... Some skills have this delay ... it has a certain delay to cause damage, etc ... But I do not know how to do this ... Is there anything related to skill_timerskill ???? Thanks
  16. Death Knight's???? Are you talking about the Lord Knight's? Or Rune Knight's? Or are you talking about some mob? Knight = ±Â»Ç_³² Lord = ·ÎΜųªÀÌÆ®_³² Rune K. = ·É³ªÀÌÆ®_³²
  17. Hello guys, I have two doubts about editing in SRC. After summoning a mob using mob->spawn() What function do I use to kill it? (I tried to use mob->dead() but it did not work) Second doubt is I have the coordinate of a cell (x, y) I want to do a check IF() if there is any mob or player around that cell. How to do this check?
  18. Thankyou Easycore It worked! Solved!
  19. Hello guys I'm trying to check if the player is donning a certain equipment by hitting a particular MOB. I can not do the check, someone can help me .. I'm trying something like this. in file battle.c Within function battle_check_target() int hand1,hand2 = 0; int item_id = 1201; if(src->type==BL_PC){ sd = BL_UCCAST(BL_PC,src); hand1 = pc->checkequip(sd,script->equip[8]); hand2 = pc->checkequip(sd,script->equip[9]); } Condition when hitting mob if(BL_UCCAST(BL_MOB, t_bl)->class_ == 1002 && (hand1 == item_id || hand2 == item_id)){ state |= BCT_ENEMY; //Natural enemy. } But ... The equipment check is not correct, can anyone help me? I believe the logic is this ..
  20. Hi Arduino right! unit_walk, unit_attack, unit_emote I'm looking at the commands, I'll try to apply my skill .. I'll edit it later if you have any questions. @EDIT: I found this skill in SRC, I believe that is the way! case NPC_RUN: { const int mask[8][2] = {{0,-1},{1,-1},{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1}}; uint8 dir = (bl == src)?unit->getdir(src):map->calc_dir(src,bl->x,bl->y); //If cast on self, run forward, else run away. unit->stop_attack(src); //Run skillv tiles overriding the can-move check. if (unit->walktoxy(src, src->x + skill_lv * mask[dir][0], src->y + skill_lv * mask[dir][1], 2) && md) md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the AI. } break;
  21. Hello everyone, does anyone know if you have some function in SRC to manipulate a mob? (Make him walk in the directions that you want) I've been looking at mob.c and seen that it has mob->randomwalk() It makes the floor mob, but for random directions ... If I do not have any specific commands, I will have to adapt this To make the mob walk It is a skill that summon a Mob and move it in the direction the player has selected. This is the idea ... And when you find a cell "Not walkable", then the mob disappears. Can someone help me with some idea or direction.
  22. Hi, I need some help. Can someone help me with a scrip to summon a mob while using a skill? You use a certain skill, summon a mob for a few seconds, and after a few seconds that mob disappears. The mob can appear in the same coordinate of the player looking in the same direction if possible I do not know how to do it
  23. Forgive me for asking, I had forgotten the proper way to point to the sprite of a weapon. Thanks for the link of the wiki, it is well exposed. hahahaha And on the second doubt, I'm looking for any function to generate an effect done in .spr So any chance interests me. This effect (in .spr) I want to use in a custom skill. Since the effect has to be in all directions, the specialeffect () function does not work, so I'm looking for other possibilities and ideas. Thank you for your response.
  24. Hello, after creating a custom sword, how can I associate this custom sword with these attack effects? Has several sprites of sword attack, I wanted to be able to choose one and put in my custom sword. Second doubt: In SRC, where do I find the code that calls these sprites? These sprites happen when you use basic attack, right? In what part of src do I find this? thank you
×
×
  • Create New...

Important Information

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