Jump to content

Garr

Members
  • Content Count

    482
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Garr

  1. Garr

    cloaking duration

    Actually, just //-- TF_HIDING51,0,0,0,5000,0,0 will suffice
  2. Garr

    NPC masking

    Updated links with your suggestions, thank you very much. It's first time I ever I make a plugin, not to mention I never really worked with C++ or C before. So had to go with guessing game sometimes. Also, about last suggestion with it being inside if, won't the ifs before that prevent it from triggering by returning to main function before the hookStop()? Because this: if ( bl->type == BL_NPC ) { ...code with hookStop()...}return; Seems same with: if (bl->type != BL_NPC) return;...code with hookStop()... Also, found a solution for nullpo not linking: RMB on project, Properties , and change Configuration to "Release" for this plugin.
  3. Patch it into your grf, after extracting it from kro grf?
  4. Find this in atcommand.c under atcommand_exec: if( !pc_get_group_level(sd) ) {if( x >= 1 || y >= 1 ) { /* we have command */info = atcommand->get_info_byname(atcommand->check_alias(command + 1));if( !info || info->char_groups[pcg->get_idx(sd->group)] == 0 ) /* if we can't use or doesn't exist: don't even display the command failed message */return false;} elsereturn false;/* display as normal message */} Relace with: if( !pc_get_group_level(sd) ) { if( x >= 1 || y >= 1 ) { /* we have command */ info = atcommand->get_info_byname(atcommand->check_alias(command + 1)); if( !info || info->char_groups[pcg->get_idx(sd->group)] == 0 ) /* if we can't use or doesn't exist: don't even display the command failed message */ //Our desired plug to stop showing misstyped @commands from GMs above level 5 if ( pc_get_group_level(sd) > 5 ) { sprintf(output, msg_txt(153), command); clif->message(fd, output); return true; } return false; } else return false;/* display as normal message */ }
  5. Garr

    NPC masking

    That's odd, I thought it counts null string as a null and shouldn't pull this off. Find: if (flag && nm->nmask ) { memcpy(WBUFP(buf,6), nm->nmask, NAME_LENGTH); } else { memcpy(WBUFP(buf,6), ((TBL_NPC*)bl)->name, NAME_LENGTH); } And replace with if (flag && nm->nmask != "0") { memcpy(WBUFP(buf,6), nm->nmask, NAME_LENGTH); } else { memcpy(WBUFP(buf,6), ((TBL_NPC*)bl)->name, NAME_LENGTH); } EDIT: Updated upaste link in opening post.
  6. Garr

    NPC masking

    Hmm, try adding this #define pcdb_checkid_sub(class_) ( ( (class_) < JOB_MAX_BASIC ) || ( (class_) >= JOB_NOVICE_HIGH && (class_) <= JOB_DARK_COLLECTOR ) || ( (class_) >= JOB_RUNE_KNIGHT && (class_) <= JOB_MECHANIC_T2 ) || ( (class_) >= JOB_BABY_RUNE && (class_) <= JOB_BABY_MECHANIC2 ) || ( (class_) >= JOB_SUPER_NOVICE_E && (class_) <= JOB_SUPER_BABY_E ) || ( (class_) >= JOB_KAGEROU && (class_) <= JOB_OBORO ) || ( (class_) >= JOB_REBELLION && (class_) < JOB_MAX ) )#define pcdb_checkid(class_) pcdb_checkid_sub((unsigned int)(class_)) inside. What version are you using to compile?
  7. Garr

    NPC masking

    I see that you copied it into some kind of bigger plugin for scripting, maybe you missed the enum part? Make sure it's there: enum compare_method { CM_NONE = 0x00, CM_LESS = 0x01, CM_EQU = 0x02, CM_MORE = 0x04, CM_BETWEEN = 0x10, CM_EXCLUDE = 0x20, CM_MAX = 0x37,} c_m; Otherwise I'm somewhat at a loss why it'd throw that at you.
  8. Garr

    NPC masking

    Added in upaste mirror. And it's a plugin, used with HPM. If there will be requests of such I might make a source mod diff for it, but not today.
  9. Garr

    NPC masking

    Yes, you can hide it, but by using 139 as sprite, not 111. 111 is invisible NPC with speech bubble, 139 is completely invisible
  10. Garr

    NPC masking

    File Name: npcmask File Submitter: Garr File Submitted: 10 Oct 2014 File Category: Plugins Masks NPCs on player's client based on his/her variables. Will need to leave NPC sight range/@refresh for it to trigger (if you change variable while NPC is still in sight nothing will change, but @refresh/leaving screen and entering again will trigger mask). Usage: npcmask <new sprite>,<int variable name>,<compare method>,<value1>,{<value 2>,{<new size>,{<new name>,{<npc name>}}}}npcunmask {<npc name>} Applies and removes NPC masking, accordingly. <new sprite> - sprite NPC will show if conditions are met <int variable name> - variable name to check, only integer character variables. <compare method> - compare method, based on following masks (v - variable, a- value1, b - value2) 0x01 - Less, uses value1 (v < a) 0x02 - Equal, uses value1 (v == a) 0x04 - More, uses value1 (v > a) 0x10 - "BETWEEN" - Between value1 and value2, including values 1 and 2 (a <= v <= b ) 0x20 - "EXCLUDE" - Excluding between value1 and value2, values 1 and 2 are excluded also. (v < a OR v > b ) Example: 0x03 - same as less or equal, makes a check (v <= a) "BETWEEN" and "EXCLUDE" methods overwrite anything else, "EXCLUDE" will take precedence over all other methods. <value1> - value1 to compare too, used in all compare methods. <value2> - value2, used in "BETWEEN" and "EXCLUDE" modes. Optional parameter, if it won't be provided while using "BETWEEN" or "EXCLUDE" methods, those methods will be skipped. <new size> - size masking, defaults to medium size. <new name> - name masking, if not provided will use NPC's original name. <npc name> - NPC name to use masking on. If not provided, will be used on NPC script is running from. This plugin appeared from the idea of hiding NPCs from some players, while it still being visible to others. It's just added in functionality. You can download the file here. OR You can copy it from here.
  11. Because you setup one kind of array in NPC variables, but use a scope array, which you didn't set. setarray .Scheds[0],0,16,50,0,0,0; You see, array is set as .Scheds; announce "inicio Dia "+.@Scheds[0]+" hora " +.@Scheds[1]+" min " +.@Scheds[2],bc_all|bc_woe; But here you use .@Scheds; You can either set .@Scheds in the setarray, or use .Scheds in the announce to fix that. setarray .@Scheds[0],0,16,50,0,0,0; announce "inicio Dia "+.@Scheds[0]+" hora " +.@Scheds[1]+" min " +.@Scheds[2],bc_all|bc_woe; OR setarray .Scheds[0],0,16,50,0,0,0; announce "inicio Dia "+.Scheds[0]+" hora " +.Scheds[1]+" min " +.Scheds[2],bc_all|bc_woe;
  12. It might not be it, but can you try to switch "mapflags" and "disabled_skills" in position, so "disabled_skills" comes first? I have a strong suspicion it'll just leave it out unless they are in the right order.
  13. Garr

    Kamic

    Oh, I know that one. For some weird reason it only accepts int number now. You can fix it yourself if you like. atcommand.c, line 1040: if(!message || !*message || (sscanf(message, "%u %199[^n]", &color, atcmd_output) < 2)) { Replace that %u for %x, and recompile.
  14. Can you please post your intif.c?
  15. You're using it a bit wrong, I think? This is a bit different tecnique. You're adding this masks like they are in decimal, but that "0x" shows that they are in hexadecimal mode, so count goes like: 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF 0x10 0x11 ... and so on So if you add up 0x800 and 0x200 you'll get 0xA00, and not 0x1000. If i got everything right your mask should look like this: 0x00000100+ 0x00000200+ 0x00000800+ 0x00008000+ 0x00010000+ 0x01000000Total: 0x01018B00
  16. Inside db/(pre-)re/map_zone_db.conf in zones, when you input disabled items or skills, you can use 2 ways: use db name of item (ex. "Apple") or id of item (ex. "ID501"). If you'll use just 501: true it will provide that error. Also, when announcing map zones be careful not to write comments right after map zone name, as it counts in towards name.
  17. Open map.h and find: enum { RC2_NONE = 0, ... RC2_MAX} And add your race2 name before RC2_MAX. And recompile after that. Also, you should add it to db/const.txt for easier use
  18. What the title says. Currently it's always returning 0 to this request: packet_db[RFIFOW(*fd,0)].pos[0] And yes, I narrowed it down to only this. RFIFOW/*fd give me the exact same results as on actual server. I have clif.h included. Anything else I'm missing?
  19. Either add this to groups.conf { id: 99 name: "Admin" level: 99 permissions: { can_trade: true can_trade_bound: true can_party: true all_skill: true skill_unconditional: true use_check: true use_changemaptype: true all_commands: true hchsys_admin: true }} Or check out your groups.conf for ID of Admin group, and edit your admin account's login SQL table, `group_id` column, with that ID you found. Or edit your groups.conf for Admin group to have ID of 99. Either of this will work.
  20. Try this one, I think it'll work right: /* =============================================================/* Slot Machine - Triple Slot Machine/* =============================================================/* Version: v0.2a/* v0.1 - Original Script Created./* v0.2 - Added Option for Triple Slot Machine with animations./* v0.2a - Added option for item price instead of zeny.Untested./* =============================================================/* Description/* =============================================================/* This script will allow users to spend zeny for a chance to/* win a prize from the slot machine. Currently there are 2/* versions. First is a Single Slot Machine, where only 1 slot/* is rolled. Second is the Triple Slot machine, where 3 slots/* are rolled. For either version, SUCCESS must be the only/* thing displayed in order to win./* =============================================================/* Created By: GmOcean/* ===========================================================*/prontera,152,176,4 script SlotMachine 563,{switch( .mode ){ case 0: // Single Slot machine mode. mes "Do you want to play a game?","It costs: " + ( .price[2]?(.price[1] + " " + getitemname(.price[0])).price[0] + " zeny") ) + " to play."; if( select("YES:NO") == 2 || (Zeny < .price[0] && !.price[2]) || ( countitem( .price[0] ) < .price[1] && .price[2]) ){ close; } while( @menu == 1 ){ if( !.price[2] ){ Zeny -= .price[0]; } else { delitem .price[0],.price[1]; } .@a = rand(1,100); if( .@a < atoi(.1animate$[0]) ){ .@a = 1; } else { .@a = 2; } .@b = 1; while( .@b < atoi(.1animate$[.@a]) ) { cutin .1animate$[3] + .@b,4; sleep2 ( ( atoi(.1animate$[4]) * 1000 ) / atoi(.1animate$[.@a]) ); .@b++; } if( .@a == 1 ){ cutin .1animate$[3] + atoi(.1animate$[.@a]),4; dispbottom "Failed"; } else { cutin .1animate$[3] + atoi(.1animate$[.@a]),4; getitem .1prize[0], .1prize[1]; } if( select("Another Round:I'm done") == 2 || Zeny < .price[0] && !.price[2] || ( countitem( .price[0] ) < .price[1] ) && .price[2] ){ cutin "",255; close; } } end; case 1: // Triple Slot machine mode. mes "Do you want to play a game?","It costs: "+ .price[1] +" "+ (.price[2]?""+getitemname(.price[0])+"":"zeny") +" to play."; if( select("YES:NO") == 2 || (Zeny < .price[0] && !.price[2]) || (countitem( .price[0] ) < .price[1] && .price[2]) ){ close; } while( @menu == 1 ){ if( !.price[2] ){ Zeny -= .price[0]; } else { delitem .price[0],.price[1]; } // Slot 1 = 100% Chance for success. (Because I didn't make a fail animation for it. .@2 = rand(1,100); //Rolls dice for Slot 2 .@3 = rand(1,100); //Rolls dice for Slot 3 if( .@2 <= atoi(.3animate$[0]) && .@3 <= atoi(.3animate$[1]) ){ .@a = 8; } else if( .@2 <= atoi(.3animate$[0]) && .@3 > atoi(.3animate$[1]) ){ .@a = 6; } else if( .@2 > atoi(.3animate$[0]) && .@3 <= atoi(.3animate$[1]) ){ .@a = 4; } else { .@a = 2; } .@b = 1; while( .@b < atoi(.3animate$[.@a+1]) ) { cutin .3animate$[.@a] + .@b,4; sleep2 ( ( atoi(.3animate$[10]) * 1000 ) / atoi(.3animate$[.@a+1]) ); .@b++; } cutin .3animate$[.@a] + atoi(.3animate$[.@a+1]),4; if( .@a == 2 ){ getitem .3prize[0], .3prize[1]; } else { dispbottom "Failed"; } if( select("Another Round:I'm done") == 2 || Zeny < .price[1] ){ cutin "",255; close; } } end; }OnInit://[ 0 = Single Slot Machine Mode ]_[ 1 = Triple Slot Machine Mode ].mode = 1;//[0] = Fail Rate//[1] = Fail (Do not change)//[2] = Success (Do not change)//[3] = File Name (Do not change)//[4] = Animation Time (Do not change, for best results )setarray .1animate$[0],"30","29","33","slot_","3";//[0] = Fail Rate "Slot 2"//[1] = Fail Rate "Slot 3"//[2] = SSS (Do not change)//[3] = SSS_Count (Do not change)//[4] = SSF (Do not change)//[5] = SSF_Count (Do not change)//[6] = SFS (Do not change)//[7] = SFS_Count (Do not change)//[8] = SFF (Do not change)//[9] = SFF_Count (Do not change)//[10] = Animation Time (Do not change, for best results )setarray .3animate$[0],"30","30","SSS_","41","SSF_","37","SFS_","41","SFF_","45","3";setarray .1prize[0],501,10;setarray .3prize[0],501,30;// [ 0 = SSM Zeny / Item Req ] | [ 1 = TSM Zeny / Item Amt ] | [ 2 = Enable/Disable Item Requirements ( 0 = Disable, 1 = Enable ).// e.g of zeny mode: setarray .price[0], 100, 300, 0; <--- SSM costs 100z, TSM costs 300z to play.// e.g of item mode: setarray .price[0], 501, 10, 1; <---- SSM & TSM costs 10 RedPotions to play.setarray .price[0],7539,3,1;end;} @GmOcean When you use "?" first option after that will go if the condition suceeds, 2nd on failure. Yours were the other way around, and that confused, as it said it should take 3 Poring coins, but was set to take 3 zeny. Also fixed logic for SSM (should've been .price[0] instead of .price[1]).
  21. Garr

    Magic Damage Calc

    Try to go with: struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int mflag) {...}
  22. This indeed seems like a lighting issue. And many things don't appear ingame like they do in browedit. For example, try making gradual light decrease in browedit, and check how it looks like in browedit and how it looks ingame. P.S. Also, just some warning. If you didn't do so intentiaonally, the floor tiles seems way messed up. I think you should clean them up.
  23. Garr

    showsp

    Are you sure? I'd think those clifs are used only to send rightful info to client and nothing else, calculations are always done somewhere else? I just searched files for clif->party_hp/clif->hpmeter_single/clif->hpmeter_sub, and what I found didn't come from any calculations, rather informing clients of change in HP, or resending information(first party joining, changing map, and so on). ETA: Also, why would battle.c rely on packet info sending if it has access right to session data for calculations?
  24. I think you didn't do sprite assigning right. In jobname.lub you need to add name of sprite, in your case it'll be min_roca_n01. [jobtbl.JT_MIN_ROCA_N01] = "min_roca_n01" In npcidentity you need to assign same JT_ number, in this case 15000. JT_MIN_ROCA_N01 = 15000, Then in const.txt you need to assign 15000 to the constant you'll be naming NPC with in scripts, like: ROCA_NIVEL_01 15000 And then inside script you need to use the constant you set in const.txt: prt_fild08,224,128,4 duplicate(rocasuelta) Roca Suelta#01 ROCA_NIVEL_01 Or you can skip the constant setting and just use: prt_fild08,224,128,4 duplicate(rocasuelta) Roca Suelta#01 15000
  25. I think you should set it inside db/const.txt. NPCs start with "WARPNPC" declaration. Add your line in there: ROCA_NIVEL_01 (number that you assigned to NPC) Number that you assigned is the one you input into NPCidentity.lub
×
×
  • Create New...

Important Information

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