Jump to content

Jonne

Members
  • Posts

    149
  • Joined

  • Last visited

Everything posted by Jonne

  1. Show us the code from that line. And did you edit anything?
  2. Your MAX_GUILD is 25. The original formular is 16+10*6. Change it back to this and the error disappears. It's in src/common/mmo.h. The original code is: #define MAX_GUILD 16+10*6 // increased max guild members +6 per 1 extension levels [Lupus]
  3. -Ah i thought when you hit something. I can change that, but not today, because I'm busy with university assigments. -Yes, that's the endure effect
  4. - By the looks of it, since it was added as int skill_additional_effect I'm guessing that it would naturally proc on both but as observed, would only last skill*2*100, which only lasted something like 0.2 seconds in the client, it was gone as soon as it casted, at lvl 10 to boot. For some weird reason, x*skill only does x*1? Did we miss calling some stuff? - I just noticed, since youre calling get_time2 for SC_VOICEOFSIREN, maybe that's the skill level its checking for? 1. It procs for AA after the AA, just like SK card and so on. 2. The time is exactly the time of the skill Voice of Siren. I use skill_get_time2 with the skill level of the GM skill. If it does occur, either increase the "skill(level)" in skill_get_time2 or increase "tick" before giving it as parameter in the status_change_start call (better option). A second is 100.
  5. No, because I use the SC of Siren: if (skill = pc_checkskill(sd, NPC_GMPOWER)) { + int tick; + rate = skill*2 * 100; + tick = skill_get_time2(status_sc2skill(SC_VOICEOFSIREN), skill); + status_change_start(src, bl, SC_VOICEOFSIREN, rate, skill, 0, 0, 0, tick, 0); + } Auto Attacks cancel the SC, maybe that's the case?
  6. You did not state that I was wrong in any case, you just confirmed my given input. I will provide the src edit for your skill, you still need to do the DB work, but this should be as stated in the Wiki. Also this patch is really dirty and hardcoded, but it's because this passive skill is actually so strong and I was too lazy adding an extra SC for it, etc. Edit: Using the new Pastebin: Paste: 9yf2sxdzew
  7. It is not mentioned in the wiki because it should be quite self-explainatory. It's about the same as adding an active skill, except leaving anything related to actually using the skill out and just check for those conditions in the code where the skill is actually checked and does something. For example when auto-attacking and using sword mastery passive. So you add the skill into the skill.h, skill db and skill tree. Then you go looking for the HP regen function (pc.c or something) and while calculating the HP regen you also check for the passive skill and apply its effect.
  8. Did not know about the custom folder, thanks. Ye it is more resource-wise, but harder for the scripter to apply, imho. Just as I said, it's not the finest solution, but it should do what is needed.
  9. It's definitly source edit. I did some digging and tried out something, not sure if it's the best solution, but might fit your need. It introduces two new script commands: setvisibility and getvisibility. You set the value of the NPC to a value not 0. Only players with the character variable "npcvisibility" set to this exact value can now see the NPC. It should also not effect NPCs which have no visibility set, since it ignores the value zero. You have to put this into the OnInit event, since I didn't add a saving mechanism so it will be deleted once you reload. Thus the OnInit. Self explaning, imho. An example: // Some NPC here OnInit: SetVisibility(1); End; Only a player with the variable "npcvisibility" set to 1 can see the npc now. The patch: diff --git a/src/map/clif.c b/src/map/clif.c index 2731018..099466f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4152,11 +4152,16 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) if (!vd || vd->class_ == INVISIBLE_CLASS) return; - /** - * Hide NPC from maya purple card. - **/ - if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE)) - return; + if(bl->type == BL_NPC) { + /** + * Hide NPC from maya purple card. + **/ + if (!((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE)) + return; + // Only show NPC to people who have a certain variable set + if (((TBL_NPC*)bl)->visibility != 0 && ((TBL_NPC*)bl)->visibility == pc_readglobalreg(sd, "npcvisibility")) + return; + } ud = unit_bl2ud(bl); len = ( ud && ud->walktimer != INVALID_TIMER ) ? clif_set_unit_walking(bl,ud,buf) : clif_set_unit_idle(bl,buf,false); diff --git a/src/map/npc.h b/src/map/npc.h index ab9d084..b4b6552 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -70,6 +70,7 @@ struct npc_data { char killer_name[NAME_LENGTH]; } tomb; } u; + int visibility; }; diff --git a/src/map/script.c b/src/map/script.c index eda82c7..681867f 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -18165,6 +18165,43 @@ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) return SCRIPT_CMD_SUCCESS; } +/** + * setvisibility <value>{, <"npc">} + * @param <value> the value to set it and checkf or + * @param <"npc"> if another NPC should be targetted +**/ +BUILDIN_FUNC(setvisibility) { + struct npc_data *nd = NULL; + + if (script_hasdata(st, 3)) { + nd = npc_name2id(script_getstr(st, 3)); + ShowWarning("buildin_setvisibility: NPC '%s' not found. Using active NPC.\n", script_getstr(st, 3)); + } + if (nd == NULL) + nd = map_id2nd(st->oid); + + nd->visibility = script_getnum(st, 2); + return SCRIPT_CMD_SUCCESS; +} + +/** + * getvisibility {<"npc>"} + * @param <"npc"> if another NPC should be targetted +**/ +BUILDIN_FUNC(getvisibility) { + struct npc_data *nd = NULL; + + if (script_hasdata(st, 2)) { + nd = npc_name2id(script_getstr(st, 2)); + ShowWarning("buildin_getvisibility: NPC '%s' not found. Using active NPC.\n", script_getstr(st, 2)); + } + if (nd == NULL) + nd = map_id2nd(st->oid); + + script_pushint(st, nd->visibility); + return SCRIPT_CMD_SUCCESS; +} + #include "../custom/script.inc" // declarations that were supposed to be exported from npc_chat.c @@ -18648,6 +18685,8 @@ struct script_function buildin_func[] = { BUILDIN_DEF(vip_time,"i?"), #endif BUILDIN_DEF(bonus_script,"si???"), + BUILDIN_DEF(setvisibility, "i?"), + BUILDIN_DEF(getvisibility, "?"), #include "../custom/script_def.inc"
  10. If I set the EXTRA_BONUS variable to a negative value, I'm sure there will be an error because you don't check it before using it as index. And C will stop working for negative indice.
  11. Try this. You also should add the cell to your const.txt for easier script usage. Here it would be cell number 10, but if you added another cell, it might be higher. Check the CELL_* enum in map.h diff --git a/src/map/battle.c b/src/map/battle.c index 6b7cf4b..63c1c4b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -763,6 +763,9 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam if( battle_config.ksprotection && mob_ksprotected(src, bl) ) return 0; + if (map_getcell(bl->m, bl->x, bl->y, CELL_CHKSAFECELL)) + return 0; + if( map_getcell(bl->m, bl->x, bl->y, CELL_CHKMAELSTROM) && skill_get_type(skill_id) != BF_MISC && skill_get_casttype(skill_id) == CAST_GROUND ) return 0; diff --git a/src/map/map.c b/src/map/map.c index 2c8bf35..ced139c 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2718,6 +2718,7 @@ void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) case CELL_NOCHAT: map[m].cell[j].nochat = flag; break; case CELL_MAELSTROM: map[m].cell[j].maelstrom = flag; break; case CELL_ICEWALL: map[m].cell[j].icewall = flag; break; + case CELL_SAFECELL: map[m].cell[j].safecell = flag; break; default: ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell); break; diff --git a/src/map/map.h b/src/map/map.h index c584671..26f8b52 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -460,6 +460,7 @@ typedef enum { CELL_NOCHAT, CELL_MAELSTROM, CELL_ICEWALL, + CELL_SAFECELL } cell_t; @@ -484,6 +485,7 @@ typedef enum { CELL_CHKNOCHAT, CELL_CHKMAELSTROM, CELL_CHKICEWALL, + CELL_CHKSAFECELL } cell_chk; @@ -503,7 +505,8 @@ struct mapcell novending : 1, nochat : 1, maelstrom : 1, - icewall : 1; + icewall : 1, + safecell : 1; #ifdef CELL_NOSTACK unsigned char cell_bl; //Holds amount of bls in this cell. diff --git a/src/map/skill.c b/src/map/skill.c index 117c0a7..efb1aab 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2247,6 +2247,8 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in break; case BL_PC: { struct map_session_data *sd = BL_CAST(BL_PC, target); + if (map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKSAFECELL)) + return 0; if( sd->sc.data[SC_BASILICA] && sd->sc.data[SC_BASILICA]->val4 == sd->bl.id && !is_boss(src)) return 0; // Basilica caster can't be knocked-back by normal monsters. if( !(flag&0x2) && src != target && sd->special_state.no_knockback )
  12. if i would use your idea i should have a additional slot dedicated only for the rarity enchantment is this possible ?? Slots will be filled up, but the item doesn't need them for the server to put them into. At least afaik
  13. So I can only call my code. Which means I can't open RO client-side windows, right? But I could for example do some anti-hack protection and send out packets or the like as far as I understand that. Sorry for being a bit of a nuisance
  14. I see. So I alter the binary code to call my functions, since it has laoded the DLL?
  15. So does that mean I can inject my code via any custom made DLL, but I can not intruse existing code or change when it is loaded, just add it? Also, why would the client start my pre-defined functions? Do I either have to know function calls in the client to have them loaded or do I overwrite old function calls by the client?
  16. It doesn't feel like it's too hard to use. There might be some people actually using that, but wouldn't encouraging SQL be better? Well, I didn't look deep into the code, but it seems fine, so why not ask other devs and start a poll on it? Edit: For reference: Check the npc_test_csv.txt file in the jAthena folder. It's in sample.
  17. Ye it comes back to me. I didn't read through it again. Well if it still works you can try it out. Depending on what you are trying this might not be what you want. For example if you want access to the database in the src code? But otherwise this might work.
  18. Wow that is really old code by me. Check out Ai4rei's post to it, it mentions some other way which was working much more stable as far as I remember. Maybe somebody can rewrite it?
  19. That is the default, isn't it? It always works like that? What exactly do you want to edit at the formular. Also this is a customization, so it's source support/request
  20. You can just use atcommands to buff for higher duration/levels.
  21. Yes that would be possible, but quite the hardcode just for buffing. I'm not home so I can't provide anything, but might give it a shot next year. OT: It feels like you're trying to add ways to cheat/abuse as admin?
  22. Revert the diff I gave you (but only for the skill.c) and apply this one: diff --git a/src/map/skill.c b/src/map/skill.c index 117c0a7..7d3a586 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11176,6 +11176,12 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char wx = sd->menuskill_val>>16; wy = sd->menuskill_val&0xffff; + // check whether it's allowed to cast AL_WARP there + if (map_getcell(sd->bl.m, wx, wy, CELL_CHKNOWARPPORTAL)) { + skill_failed(sd); + return 0; + } + if( lv <= 0 ) return 0; if( lv > 4 ) lv = 4; // crash prevention
  23. It's in skill.c in skill_weaponrefine: /*========================================== * Weapon Refine [Celest] *------------------------------------------*/ void skill_weaponrefine (struct map_session_data *sd, int idx) { nullpo_retv(sd); if (idx >= 0 && idx < MAX_INVENTORY) { int i = 0, ep = 0, per; int material[5] = { 0, 1010, 1011, 984, 984 }; struct item *item; struct item_data *ditem = sd->inventory_data[idx]; item = &sd->status.inventory[idx]; if(item->nameid > 0 && ditem->type == IT_WEAPON) {
  24. Jonne

    NPC Name

    Isn't this rather in clif_joinchatok ? /// Notifies the client about entering a chatroom (ZC_ENTER_ROOM). /// 00db <packet len>.W <chat id>.L { <role>.L <name>.24B }* /// role: /// 0 = owner (menu) /// 1 = normal void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd) { int fd; int i,t; nullpo_retv(sd); nullpo_retv(cd); fd = sd->fd; if (!session_isActive(fd)) return; t = (int)(cd->owner->type == BL_NPC); WFIFOHEAD(fd, 8 + (28*(cd->users+t))); WFIFOW(fd, 0) = 0xdb; WFIFOW(fd, 2) = 8 + (28*(cd->users+t)); WFIFOL(fd, 4) = cd->bl.id; if(cd->owner->type == BL_NPC){ WFIFOL(fd, 30) = 1; WFIFOL(fd, 8) = 0; memcpy(WFIFOP(fd, 12), ((struct npc_data *)cd->owner)->name, NAME_LENGTH); for (i = 0; i < cd->users; i++) { WFIFOL(fd, 8+(i+1)*28) = 1; memcpy(WFIFOP(fd, 8+(i+t)*28+4), cd->usersd[i]->status.name, NAME_LENGTH); } } else for (i = 0; i < cd->users; i++) { WFIFOL(fd, 8+i*28) = (i != 0 || cd->owner->type == BL_NPC); memcpy(WFIFOP(fd, 8+(i+t)*28+4), cd->usersd[i]->status.name, NAME_LENGTH); } WFIFOSET(fd, WFIFOW(fd, 2)); } Try this maybe: /// Notifies the client about entering a chatroom (ZC_ENTER_ROOM). /// 00db <packet len>.W <chat id>.L { <role>.L <name>.24B }* /// role: /// 0 = owner (menu) /// 1 = normal void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd) { int fd; int i,t; nullpo_retv(sd); nullpo_retv(cd); fd = sd->fd; if (!session_isActive(fd)) return; t = (int)(cd->owner->type == BL_NPC); WFIFOHEAD(fd, 8 + (28*(cd->users+t))); WFIFOW(fd, 0) = 0xdb; WFIFOW(fd, 2) = 8 + (28*(cd->users+t)); WFIFOL(fd, 4) = cd->bl.id; if(cd->owner->type == BL_NPC){ char name[NAME_LENGTH+1]; char *pos; strcpy(name, ((struct npc_data *)cd->owner)->name); pos = strchr(name, '#'); if (pos != NULL) { *pos = '\0'; } WFIFOL(fd, 30) = 1; WFIFOL(fd, 8) = 0; memcpy(WFIFOP(fd, 12), name, NAME_LENGTH); for (i = 0; i < cd->users; i++) { WFIFOL(fd, 8+(i+1)*28) = 1; memcpy(WFIFOP(fd, 8+(i+t)*28+4), cd->usersd[i]->status.name, NAME_LENGTH); } } else for (i = 0; i < cd->users; i++) { WFIFOL(fd, 8+i*28) = (i != 0 || cd->owner->type == BL_NPC); memcpy(WFIFOP(fd, 8+(i+t)*28+4), cd->usersd[i]->status.name, NAME_LENGTH); } WFIFOSET(fd, WFIFOW(fd, 2)); }
×
×
  • Create New...